# Copyright 2022 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Provides information about MuJoCo API functions.

DO NOT EDIT. THIS FILE IS AUTOMATICALLY GENERATED.
"""

from typing import Mapping

from .ast_nodes import ArrayType
from .ast_nodes import FunctionDecl
from .ast_nodes import FunctionParameterDecl
from .ast_nodes import PointerType
from .ast_nodes import ValueType

FUNCTIONS: Mapping[str, FunctionDecl] = dict([
    ('mj_defaultVFS',
     FunctionDecl(
         name='mj_defaultVFS',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='vfs',
                 type=PointerType(
                     inner_type=ValueType(name='mjVFS'),
                 ),
             ),
         ),
         doc='Initialize an empty VFS, mj_deleteVFS must be called to deallocate the VFS.',  # pylint: disable=line-too-long
     )),
    ('mj_mountVFS',
     FunctionDecl(
         name='mj_mountVFS',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='vfs',
                 type=PointerType(
                     inner_type=ValueType(name='mjVFS'),
                 ),
             ),
             FunctionParameterDecl(
                 name='filepath',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='provider',
                 type=PointerType(
                     inner_type=ValueType(name='mjpResourceProvider', is_const=True),  # pylint: disable=line-too-long
                 ),
             ),
         ),
         doc='Mount a ResourceProvider to handle file operations under the given path; return 0: success, 2: repeated name, -1: invalid resource provider.',  # pylint: disable=line-too-long
     )),
    ('mj_unmountVFS',
     FunctionDecl(
         name='mj_unmountVFS',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='vfs',
                 type=PointerType(
                     inner_type=ValueType(name='mjVFS'),
                 ),
             ),
             FunctionParameterDecl(
                 name='filename',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Unmount a previously mounted ResourceProvider; return 0: success, -1: not found in VFS.',  # pylint: disable=line-too-long
     )),
    ('mj_addFileVFS',
     FunctionDecl(
         name='mj_addFileVFS',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='vfs',
                 type=PointerType(
                     inner_type=ValueType(name='mjVFS'),
                 ),
             ),
             FunctionParameterDecl(
                 name='directory',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='filename',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Add file to VFS; return 0: success, 2: repeated name, -1: failed to load.',  # pylint: disable=line-too-long
     )),
    ('mj_addBufferVFS',
     FunctionDecl(
         name='mj_addBufferVFS',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='vfs',
                 type=PointerType(
                     inner_type=ValueType(name='mjVFS'),
                 ),
             ),
             FunctionParameterDecl(
                 name='name',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='buffer',
                 type=PointerType(
                     inner_type=ValueType(name='void', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='nbuffer',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Add file to VFS from buffer; return 0: success, 2: repeated name, -1: failed to load.',  # pylint: disable=line-too-long
     )),
    ('mj_deleteFileVFS',
     FunctionDecl(
         name='mj_deleteFileVFS',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='vfs',
                 type=PointerType(
                     inner_type=ValueType(name='mjVFS'),
                 ),
             ),
             FunctionParameterDecl(
                 name='filename',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Delete file from VFS; return 0: success, -1: not found in VFS.',
     )),
    ('mj_deleteVFS',
     FunctionDecl(
         name='mj_deleteVFS',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='vfs',
                 type=PointerType(
                     inner_type=ValueType(name='mjVFS'),
                 ),
             ),
         ),
         doc='Delete all files from VFS and deallocates VFS internal memory.',
     )),
    ('mj_getCacheSize',
     FunctionDecl(
         name='mj_getCacheSize',
         return_type=ValueType(name='size_t'),
         parameters=(
             FunctionParameterDecl(
                 name='cache',
                 type=PointerType(
                     inner_type=ValueType(name='mjCache', is_const=True),
                 ),
             ),
         ),
         doc='Get the current size of the asset cache in bytes.',
     )),
    ('mj_getCacheCapacity',
     FunctionDecl(
         name='mj_getCacheCapacity',
         return_type=ValueType(name='size_t'),
         parameters=(
             FunctionParameterDecl(
                 name='cache',
                 type=PointerType(
                     inner_type=ValueType(name='mjCache', is_const=True),
                 ),
             ),
         ),
         doc='Get the capacity of the asset cache in bytes.',
     )),
    ('mj_setCacheCapacity',
     FunctionDecl(
         name='mj_setCacheCapacity',
         return_type=ValueType(name='size_t'),
         parameters=(
             FunctionParameterDecl(
                 name='cache',
                 type=PointerType(
                     inner_type=ValueType(name='mjCache'),
                 ),
             ),
             FunctionParameterDecl(
                 name='size',
                 type=ValueType(name='size_t'),
             ),
         ),
         doc='Set the capacity of the asset cache in bytes (0 to disable); return the new capacity.',  # pylint: disable=line-too-long
     )),
    ('mj_getCache',
     FunctionDecl(
         name='mj_getCache',
         return_type=PointerType(
             inner_type=ValueType(name='mjCache'),
         ),
         parameters=(),
         doc='Get the internal asset cache used by the compiler.',
     )),
    ('mj_clearCache',
     FunctionDecl(
         name='mj_clearCache',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='cache',
                 type=PointerType(
                     inner_type=ValueType(name='mjCache'),
                 ),
             ),
         ),
         doc='Clear the asset cache.',
     )),
    ('mj_loadXML',
     FunctionDecl(
         name='mj_loadXML',
         return_type=PointerType(
             inner_type=ValueType(name='mjModel'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='filename',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='vfs',
                 type=PointerType(
                     inner_type=ValueType(name='mjVFS', is_const=True),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='error',
                 type=PointerType(
                     inner_type=ValueType(name='char'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='error_sz',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Parse XML file in MJCF or URDF format, compile it; return low-level model. If vfs is not NULL, look up files in vfs before reading from disk. If error is not NULL, it must have size error_sz.',  # pylint: disable=line-too-long
     )),
    ('mj_parseXML',
     FunctionDecl(
         name='mj_parseXML',
         return_type=PointerType(
             inner_type=ValueType(name='mjSpec'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='filename',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='vfs',
                 type=PointerType(
                     inner_type=ValueType(name='mjVFS', is_const=True),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='error',
                 type=PointerType(
                     inner_type=ValueType(name='char'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='error_sz',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Parse spec from XML file.',
     )),
    ('mj_parseXMLString',
     FunctionDecl(
         name='mj_parseXMLString',
         return_type=PointerType(
             inner_type=ValueType(name='mjSpec'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='xml',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='vfs',
                 type=PointerType(
                     inner_type=ValueType(name='mjVFS', is_const=True),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='error',
                 type=PointerType(
                     inner_type=ValueType(name='char'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='error_sz',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Parse spec from XML string.',
     )),
    ('mj_parse',
     FunctionDecl(
         name='mj_parse',
         return_type=PointerType(
             inner_type=ValueType(name='mjSpec'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='filename',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='content_type',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='vfs',
                 type=PointerType(
                     inner_type=ValueType(name='mjVFS', is_const=True),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='error',
                 type=PointerType(
                     inner_type=ValueType(name='char'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='error_sz',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Parse spec from a file.',
     )),
    ('mj_compile',
     FunctionDecl(
         name='mj_compile',
         return_type=PointerType(
             inner_type=ValueType(name='mjModel'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='vfs',
                 type=PointerType(
                     inner_type=ValueType(name='mjVFS', is_const=True),
                 ),
                 nullable=True,
             ),
         ),
         doc='Compile spec to model.',
     )),
    ('mj_copyBack',
     FunctionDecl(
         name='mj_copyBack',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
         ),
         doc='Copy real-valued arrays from model to spec; return 1 on success.',
     )),
    ('mj_recompile',
     FunctionDecl(
         name='mj_recompile',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='vfs',
                 type=PointerType(
                     inner_type=ValueType(name='mjVFS', is_const=True),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel'),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Recompile spec to model, preserving the state; return 0 on success.',  # pylint: disable=line-too-long
     )),
    ('mj_saveLastXML',
     FunctionDecl(
         name='mj_saveLastXML',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='filename',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='error',
                 type=PointerType(
                     inner_type=ValueType(name='char'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='error_sz',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Update XML data structures with info from low-level model created with mj_loadXML, save as MJCF. If error is not NULL, it must have size error_sz.',  # pylint: disable=line-too-long
     )),
    ('mj_freeLastXML',
     FunctionDecl(
         name='mj_freeLastXML',
         return_type=ValueType(name='void'),
         parameters=(),
         doc='Free last XML model if loaded. Called internally at each load.',
     )),
    ('mj_saveXMLString',
     FunctionDecl(
         name='mj_saveXMLString',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='xml',
                 type=PointerType(
                     inner_type=ValueType(name='char'),
                 ),
             ),
             FunctionParameterDecl(
                 name='xml_sz',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='error',
                 type=PointerType(
                     inner_type=ValueType(name='char'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='error_sz',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Save spec to XML string; return 0 on success, -1 on failure. If length of the output buffer is too small; return the required size.',  # pylint: disable=line-too-long
     )),
    ('mj_saveXML',
     FunctionDecl(
         name='mj_saveXML',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='filename',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='error',
                 type=PointerType(
                     inner_type=ValueType(name='char'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='error_sz',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Save spec to XML file; return 0 on success, -1 otherwise.',
     )),
    ('mju_getXMLDependencies',
     FunctionDecl(
         name='mju_getXMLDependencies',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='filename',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='dependencies',
                 type=PointerType(
                     inner_type=ValueType(name='mjStringVec'),
                 ),
             ),
         ),
         doc='Given MJCF filename, fills dependencies with a list of all other asset files it depends on. The search is recursive, and the list includes the filename itself.',  # pylint: disable=line-too-long
     )),
    ('mj_step',
     FunctionDecl(
         name='mj_step',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Advance simulation, use control callback to obtain external force and control.',  # pylint: disable=line-too-long
     )),
    ('mj_step1',
     FunctionDecl(
         name='mj_step1',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Advance simulation in two steps: before external force and control is set by user.',  # pylint: disable=line-too-long
     )),
    ('mj_step2',
     FunctionDecl(
         name='mj_step2',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Advance simulation in two steps: after external force and control is set by user.',  # pylint: disable=line-too-long
     )),
    ('mj_forward',
     FunctionDecl(
         name='mj_forward',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Forward dynamics: same as mj_step but do not integrate in time.',
     )),
    ('mj_inverse',
     FunctionDecl(
         name='mj_inverse',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Inverse dynamics: qacc must be set before calling.',
     )),
    ('mj_forwardSkip',
     FunctionDecl(
         name='mj_forwardSkip',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='skipstage',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='skipsensor',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Forward dynamics with skip; skipstage is mjtStage.',
     )),
    ('mj_inverseSkip',
     FunctionDecl(
         name='mj_inverseSkip',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='skipstage',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='skipsensor',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Inverse dynamics with skip; skipstage is mjtStage.',
     )),
    ('mj_defaultLROpt',
     FunctionDecl(
         name='mj_defaultLROpt',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='opt',
                 type=PointerType(
                     inner_type=ValueType(name='mjLROpt'),
                 ),
             ),
         ),
         doc='Set default options for length range computation.',
     )),
    ('mj_defaultSolRefImp',
     FunctionDecl(
         name='mj_defaultSolRefImp',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='solref',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='solimp',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
         ),
         doc='Set solver parameters to default values.',
     )),
    ('mj_defaultOption',
     FunctionDecl(
         name='mj_defaultOption',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='opt',
                 type=PointerType(
                     inner_type=ValueType(name='mjOption'),
                 ),
             ),
         ),
         doc='Set physics options to default values.',
     )),
    ('mj_defaultVisual',
     FunctionDecl(
         name='mj_defaultVisual',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='vis',
                 type=PointerType(
                     inner_type=ValueType(name='mjVisual'),
                 ),
             ),
         ),
         doc='Set visual options to default values.',
     )),
    ('mj_copyModel',
     FunctionDecl(
         name='mj_copyModel',
         return_type=PointerType(
             inner_type=ValueType(name='mjModel'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='dest',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='src',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
         ),
         doc='Copy mjModel, allocate new if dest is NULL.',
     )),
    ('mj_saveModel',
     FunctionDecl(
         name='mj_saveModel',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='filename',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='buffer',
                 type=PointerType(
                     inner_type=ValueType(name='void'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='buffer_sz',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Save model to binary MJB file or memory buffer; buffer has precedence when given.',  # pylint: disable=line-too-long
     )),
    ('mj_loadModel',
     FunctionDecl(
         name='mj_loadModel',
         return_type=PointerType(
             inner_type=ValueType(name='mjModel'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='filename',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='vfs',
                 type=PointerType(
                     inner_type=ValueType(name='mjVFS', is_const=True),
                 ),
                 nullable=True,
             ),
         ),
         doc='Load model from binary MJB file. If vfs is not NULL, look up file in vfs before reading from disk.',  # pylint: disable=line-too-long
     )),
    ('mj_loadModelBuffer',
     FunctionDecl(
         name='mj_loadModelBuffer',
         return_type=PointerType(
             inner_type=ValueType(name='mjModel'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='buffer',
                 type=PointerType(
                     inner_type=ValueType(name='void', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='buffer_sz',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Load model from memory buffer.',
     )),
    ('mj_deleteModel',
     FunctionDecl(
         name='mj_deleteModel',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel'),
                 ),
             ),
         ),
         doc='Free memory allocation in model.',
     )),
    ('mj_sizeModel',
     FunctionDecl(
         name='mj_sizeModel',
         return_type=ValueType(name='mjtSize'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
         ),
         doc='Return size of buffer needed to hold model.',
     )),
    ('mj_makeData',
     FunctionDecl(
         name='mj_makeData',
         return_type=PointerType(
             inner_type=ValueType(name='mjData'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
         ),
         doc='Allocate mjData corresponding to given model. If the model buffer is unallocated the initial configuration will not be set.',  # pylint: disable=line-too-long
     )),
    ('mj_copyData',
     FunctionDecl(
         name='mj_copyData',
         return_type=PointerType(
             inner_type=ValueType(name='mjData'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='dest',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='src',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
         ),
         doc='Copy mjData. m is only required to contain the size fields from MJMODEL_INTS.',  # pylint: disable=line-too-long
     )),
    ('mjv_copyData',
     FunctionDecl(
         name='mjv_copyData',
         return_type=PointerType(
             inner_type=ValueType(name='mjData'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='dest',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='src',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
         ),
         doc='Copy mjData, skip large arrays not required for visualization.',
     )),
    ('mj_resetData',
     FunctionDecl(
         name='mj_resetData',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Reset data to defaults.',
     )),
    ('mj_resetDataDebug',
     FunctionDecl(
         name='mj_resetDataDebug',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='debug_value',
                 type=ValueType(name='unsigned char'),
             ),
         ),
         doc='Reset data to defaults, fill everything else with debug_value.',
     )),
    ('mj_resetDataKeyframe',
     FunctionDecl(
         name='mj_resetDataKeyframe',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='key',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Reset data. If 0 <= key < nkey, set fields from specified keyframe.',  # pylint: disable=line-too-long
     )),
    ('mj_markStack',
     FunctionDecl(
         name='mj_markStack',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Mark a new frame on the mjData stack.',
     )),
    ('mj_freeStack',
     FunctionDecl(
         name='mj_freeStack',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Free the current mjData stack frame. All pointers returned by mj_stackAlloc since the last call to mj_markStack must no longer be used afterwards.',  # pylint: disable=line-too-long
     )),
    ('mj_stackAllocByte',
     FunctionDecl(
         name='mj_stackAllocByte',
         return_type=PointerType(
             inner_type=ValueType(name='void'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='bytes',
                 type=ValueType(name='size_t'),
             ),
             FunctionParameterDecl(
                 name='alignment',
                 type=ValueType(name='size_t'),
             ),
         ),
         doc='Allocate a number of bytes on mjData stack at a specific alignment. Call mju_error on stack overflow.',  # pylint: disable=line-too-long
     )),
    ('mj_stackAllocNum',
     FunctionDecl(
         name='mj_stackAllocNum',
         return_type=PointerType(
             inner_type=ValueType(name='mjtNum'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='size',
                 type=ValueType(name='size_t'),
             ),
         ),
         doc='Allocate array of mjtNums on mjData stack. Call mju_error on stack overflow.',  # pylint: disable=line-too-long
     )),
    ('mj_stackAllocInt',
     FunctionDecl(
         name='mj_stackAllocInt',
         return_type=PointerType(
             inner_type=ValueType(name='int'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='size',
                 type=ValueType(name='size_t'),
             ),
         ),
         doc='Allocate array of ints on mjData stack. Call mju_error on stack overflow.',  # pylint: disable=line-too-long
     )),
    ('mj_deleteData',
     FunctionDecl(
         name='mj_deleteData',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Free memory allocation in mjData.',
     )),
    ('mj_resetCallbacks',
     FunctionDecl(
         name='mj_resetCallbacks',
         return_type=ValueType(name='void'),
         parameters=(),
         doc='Reset all callbacks to NULL pointers (NULL is the default).',
     )),
    ('mj_setConst',
     FunctionDecl(
         name='mj_setConst',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel'),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Set constant fields of mjModel, corresponding to qpos0 configuration.',  # pylint: disable=line-too-long
     )),
    ('mj_setLengthRange',
     FunctionDecl(
         name='mj_setLengthRange',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel'),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='index',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='opt',
                 type=PointerType(
                     inner_type=ValueType(name='mjLROpt', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='error',
                 type=PointerType(
                     inner_type=ValueType(name='char'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='error_sz',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Set actuator_lengthrange for specified actuator; return 1 if ok, 0 if error.',  # pylint: disable=line-too-long
     )),
    ('mj_makeSpec',
     FunctionDecl(
         name='mj_makeSpec',
         return_type=PointerType(
             inner_type=ValueType(name='mjSpec'),
         ),
         parameters=(),
         doc='Create empty spec.',
     )),
    ('mj_copySpec',
     FunctionDecl(
         name='mj_copySpec',
         return_type=PointerType(
             inner_type=ValueType(name='mjSpec'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec', is_const=True),
                 ),
             ),
         ),
         doc='Copy spec.',
     )),
    ('mj_deleteSpec',
     FunctionDecl(
         name='mj_deleteSpec',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
         ),
         doc='Free memory allocation in mjSpec.',
     )),
    ('mjs_activatePlugin',
     FunctionDecl(
         name='mjs_activatePlugin',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='name',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Activate plugin; return 0 on success.',
     )),
    ('mjs_setDeepCopy',
     FunctionDecl(
         name='mjs_setDeepCopy',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='deepcopy',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Turn deep copy on or off attach; return 0 on success.',
     )),
    ('mj_printFormattedModel',
     FunctionDecl(
         name='mj_printFormattedModel',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='filename',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='float_format',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Print mjModel to text file, specifying format. float_format must be a valid printf-style format string for a single float value.',  # pylint: disable=line-too-long
     )),
    ('mj_printModel',
     FunctionDecl(
         name='mj_printModel',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='filename',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Print model to text file.',
     )),
    ('mj_printFormattedData',
     FunctionDecl(
         name='mj_printFormattedData',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='filename',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='float_format',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Print mjData to text file, specifying format. float_format must be a valid printf-style format string for a single float value.',  # pylint: disable=line-too-long
     )),
    ('mj_printData',
     FunctionDecl(
         name='mj_printData',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='filename',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Print data to text file.',
     )),
    ('mju_printMat',
     FunctionDecl(
         name='mju_printMat',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='mat',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='nr',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='nc',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Print matrix to screen.',
     )),
    ('mju_printMatSparse',
     FunctionDecl(
         name='mju_printMatSparse',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='mat',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='nr',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='rownnz',
                 type=PointerType(
                     inner_type=ValueType(name='int', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='rowadr',
                 type=PointerType(
                     inner_type=ValueType(name='int', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='colind',
                 type=PointerType(
                     inner_type=ValueType(name='int', is_const=True),
                 ),
             ),
         ),
         doc='Print sparse matrix to screen.',
     )),
    ('mj_printSchema',
     FunctionDecl(
         name='mj_printSchema',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='filename',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='buffer',
                 type=PointerType(
                     inner_type=ValueType(name='char'),
                 ),
             ),
             FunctionParameterDecl(
                 name='buffer_sz',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='flg_html',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='flg_pad',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Print internal XML schema as plain text or HTML, with style-padding or &nbsp;.',  # pylint: disable=line-too-long
     )),
    ('mj_printScene',
     FunctionDecl(
         name='mj_printScene',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjvScene', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='filename',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Print scene to text file.',
     )),
    ('mj_printFormattedScene',
     FunctionDecl(
         name='mj_printFormattedScene',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjvScene', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='filename',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='float_format',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Print scene to text file, specifying format. float_format must be a valid printf-style format string for a single float value.',  # pylint: disable=line-too-long
     )),
    ('mj_fwdKinematics',
     FunctionDecl(
         name='mj_fwdKinematics',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Run all kinematics-like computations (kinematics, comPos, camlight, flex, tendon).',  # pylint: disable=line-too-long
     )),
    ('mj_fwdPosition',
     FunctionDecl(
         name='mj_fwdPosition',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Run position-dependent computations.',
     )),
    ('mj_fwdVelocity',
     FunctionDecl(
         name='mj_fwdVelocity',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Run velocity-dependent computations.',
     )),
    ('mj_fwdActuation',
     FunctionDecl(
         name='mj_fwdActuation',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Compute actuator force qfrc_actuator.',
     )),
    ('mj_fwdAcceleration',
     FunctionDecl(
         name='mj_fwdAcceleration',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Add up all non-constraint forces, compute qacc_smooth.',
     )),
    ('mj_fwdConstraint',
     FunctionDecl(
         name='mj_fwdConstraint',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Run selected constraint solver.',
     )),
    ('mj_Euler',
     FunctionDecl(
         name='mj_Euler',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Euler integrator, semi-implicit in velocity.',
     )),
    ('mj_RungeKutta',
     FunctionDecl(
         name='mj_RungeKutta',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='N',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Runge-Kutta explicit order-N integrator.',
     )),
    ('mj_implicit',
     FunctionDecl(
         name='mj_implicit',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Implicit-in-velocity integrators.',
     )),
    ('mj_invPosition',
     FunctionDecl(
         name='mj_invPosition',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Run position-dependent computations in inverse dynamics.',
     )),
    ('mj_invVelocity',
     FunctionDecl(
         name='mj_invVelocity',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Run velocity-dependent computations in inverse dynamics.',
     )),
    ('mj_invConstraint',
     FunctionDecl(
         name='mj_invConstraint',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Apply the analytical formula for inverse constraint dynamics.',
     )),
    ('mj_compareFwdInv',
     FunctionDecl(
         name='mj_compareFwdInv',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Compare forward and inverse dynamics, save results in fwdinv.',
     )),
    ('mj_sensorPos',
     FunctionDecl(
         name='mj_sensorPos',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Evaluate position-dependent sensors.',
     )),
    ('mj_sensorVel',
     FunctionDecl(
         name='mj_sensorVel',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Evaluate velocity-dependent sensors.',
     )),
    ('mj_sensorAcc',
     FunctionDecl(
         name='mj_sensorAcc',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Evaluate acceleration and force-dependent sensors.',
     )),
    ('mj_energyPos',
     FunctionDecl(
         name='mj_energyPos',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Evaluate position-dependent energy (potential).',
     )),
    ('mj_energyVel',
     FunctionDecl(
         name='mj_energyVel',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Evaluate velocity-dependent energy (kinetic).',
     )),
    ('mj_checkPos',
     FunctionDecl(
         name='mj_checkPos',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Check qpos, reset if any element is too big or nan.',
     )),
    ('mj_checkVel',
     FunctionDecl(
         name='mj_checkVel',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Check qvel, reset if any element is too big or nan.',
     )),
    ('mj_checkAcc',
     FunctionDecl(
         name='mj_checkAcc',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Check qacc, reset if any element is too big or nan.',
     )),
    ('mj_kinematics',
     FunctionDecl(
         name='mj_kinematics',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Run forward kinematics.',
     )),
    ('mj_comPos',
     FunctionDecl(
         name='mj_comPos',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Map inertias and motion dofs to global frame centered at CoM.',
     )),
    ('mj_camlight',
     FunctionDecl(
         name='mj_camlight',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Compute camera and light positions and orientations.',
     )),
    ('mj_flex',
     FunctionDecl(
         name='mj_flex',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Compute flex-related quantities.',
     )),
    ('mj_tendon',
     FunctionDecl(
         name='mj_tendon',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Compute tendon lengths, velocities and moment arms.',
     )),
    ('mj_transmission',
     FunctionDecl(
         name='mj_transmission',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Compute actuator transmission lengths and moments.',
     )),
    ('mj_crb',
     FunctionDecl(
         name='mj_crb',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Run composite rigid body inertia algorithm (CRB).',
     )),
    ('mj_makeM',
     FunctionDecl(
         name='mj_makeM',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Make inertia matrix.',
     )),
    ('mj_factorM',
     FunctionDecl(
         name='mj_factorM',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc="Compute sparse L'*D*L factorizaton of inertia matrix.",
     )),
    ('mj_solveM',
     FunctionDecl(
         name='mj_solveM',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='x',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='y',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc="Solve linear system M * x = y using factorization:  x = inv(L'*D*L)*y",  # pylint: disable=line-too-long
     )),
    ('mj_solveM2',
     FunctionDecl(
         name='mj_solveM2',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='x',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='y',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='sqrtInvD',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc="Half of linear solve:  x = sqrt(inv(D))*inv(L')*y",
     )),
    ('mj_comVel',
     FunctionDecl(
         name='mj_comVel',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Compute cvel, cdof_dot.',
     )),
    ('mj_passive',
     FunctionDecl(
         name='mj_passive',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Compute qfrc_passive from spring-dampers, gravity compensation and fluid forces.',  # pylint: disable=line-too-long
     )),
    ('mj_subtreeVel',
     FunctionDecl(
         name='mj_subtreeVel',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Sub-tree linear velocity and angular momentum: compute subtree_linvel, subtree_angmom.',  # pylint: disable=line-too-long
     )),
    ('mj_rne',
     FunctionDecl(
         name='mj_rne',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='flg_acc',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='result',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
         ),
         doc='RNE: compute M(qpos)*qacc + C(qpos,qvel); flg_acc=0 removes inertial term.',  # pylint: disable=line-too-long
     )),
    ('mj_rnePostConstraint',
     FunctionDecl(
         name='mj_rnePostConstraint',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='RNE with complete data: compute cacc, cfrc_ext, cfrc_int.',
     )),
    ('mj_collision',
     FunctionDecl(
         name='mj_collision',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Run collision detection.',
     )),
    ('mj_makeConstraint',
     FunctionDecl(
         name='mj_makeConstraint',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Construct constraints.',
     )),
    ('mj_island',
     FunctionDecl(
         name='mj_island',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Find constraint islands.',
     )),
    ('mj_projectConstraint',
     FunctionDecl(
         name='mj_projectConstraint',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Compute inverse constraint inertia efc_AR.',
     )),
    ('mj_referenceConstraint',
     FunctionDecl(
         name='mj_referenceConstraint',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
         ),
         doc='Compute efc_vel, efc_aref.',
     )),
    ('mj_constraintUpdate',
     FunctionDecl(
         name='mj_constraintUpdate',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='jar',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='cost',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(1,),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='flg_coneHessian',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Compute efc_state, efc_force, qfrc_constraint, and (optionally) cone Hessians. If cost is not NULL, set *cost = s(jar) where jar = Jac*qacc-aref.',  # pylint: disable=line-too-long
     )),
    ('mj_stateSize',
     FunctionDecl(
         name='mj_stateSize',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='sig',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Return size of state signature.',
     )),
    ('mj_getState',
     FunctionDecl(
         name='mj_getState',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='state',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='sig',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Get state.',
     )),
    ('mj_extractState',
     FunctionDecl(
         name='mj_extractState',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='src',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='srcsig',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='dst',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='dstsig',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Extract a subset of components from a state previously obtained via mj_getState.',  # pylint: disable=line-too-long
     )),
    ('mj_setState',
     FunctionDecl(
         name='mj_setState',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='state',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='sig',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Set state.',
     )),
    ('mj_copyState',
     FunctionDecl(
         name='mj_copyState',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='src',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='dst',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='sig',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Copy state from src to dst.',
     )),
    ('mj_readCtrl',
     FunctionDecl(
         name='mj_readCtrl',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='id',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='time',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='interp',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Read ctrl value for actuator at given time. Returns d->ctrl[id] if no history, otherwise reads from history buffer. interp: 0=zero-order-hold, 1=linear, 2=cubic spline.',  # pylint: disable=line-too-long
     )),
    ('mj_readSensor',
     FunctionDecl(
         name='mj_readSensor',
         return_type=PointerType(
             inner_type=ValueType(name='mjtNum', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='id',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='time',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='result',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='interp',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Read sensor value from history buffer at given time. Returns pointer to sensordata (no history) or history buffer (exact match), or NULL if interpolation performed (writes to result). interp: 0=zero-order-hold, 1=linear, 2=cubic spline.',  # pylint: disable=line-too-long
     )),
    ('mj_initCtrlHistory',
     FunctionDecl(
         name='mj_initCtrlHistory',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='id',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='times',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='values',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
         ),
         doc='Initialize history buffer for actuator; if times is NULL, uses existing buffer timestamps.',  # pylint: disable=line-too-long
     )),
    ('mj_initSensorHistory',
     FunctionDecl(
         name='mj_initSensorHistory',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='id',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='times',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='values',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='phase',
                 type=ValueType(name='mjtNum'),
             ),
         ),
         doc='Initialize history buffer for sensor; if times is NULL, uses existing buffer timestamps. phase sets the user slot (last computation time for interval sensors).',  # pylint: disable=line-too-long
     )),
    ('mj_setKeyframe',
     FunctionDecl(
         name='mj_setKeyframe',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel'),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='k',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Copy current state to the k-th model keyframe.',
     )),
    ('mj_addContact',
     FunctionDecl(
         name='mj_addContact',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjContact', is_const=True),
                 ),
             ),
         ),
         doc='Add contact to d->contact list; return 0 if success; 1 if buffer full.',  # pylint: disable=line-too-long
     )),
    ('mj_isPyramidal',
     FunctionDecl(
         name='mj_isPyramidal',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
         ),
         doc='Determine type of friction cone.',
     )),
    ('mj_isSparse',
     FunctionDecl(
         name='mj_isSparse',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
         ),
         doc='Determine type of constraint Jacobian.',
     )),
    ('mj_isDual',
     FunctionDecl(
         name='mj_isDual',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
         ),
         doc='Determine type of solver (PGS is dual, CG and Newton are primal).',  # pylint: disable=line-too-long
     )),
    ('mj_mulJacVec',
     FunctionDecl(
         name='mj_mulJacVec',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
         ),
         doc='Multiply dense or sparse constraint Jacobian by vector.',
     )),
    ('mj_mulJacTVec',
     FunctionDecl(
         name='mj_mulJacTVec',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
         ),
         doc='Multiply dense or sparse constraint Jacobian transpose by vector.',  # pylint: disable=line-too-long
     )),
    ('mj_jac',
     FunctionDecl(
         name='mj_jac',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='jacp',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='jacr',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='point',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='body',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Compute 3/6-by-nv end-effector Jacobian of global point attached to given body.',  # pylint: disable=line-too-long
     )),
    ('mj_jacBody',
     FunctionDecl(
         name='mj_jacBody',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='jacp',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='jacr',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='body',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Compute body frame end-effector Jacobian.',
     )),
    ('mj_jacBodyCom',
     FunctionDecl(
         name='mj_jacBodyCom',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='jacp',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='jacr',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='body',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Compute body center-of-mass end-effector Jacobian.',
     )),
    ('mj_jacSubtreeCom',
     FunctionDecl(
         name='mj_jacSubtreeCom',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='jacp',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='body',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Compute subtree center-of-mass end-effector Jacobian.',
     )),
    ('mj_jacGeom',
     FunctionDecl(
         name='mj_jacGeom',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='jacp',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='jacr',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='geom',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Compute geom end-effector Jacobian.',
     )),
    ('mj_jacSite',
     FunctionDecl(
         name='mj_jacSite',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='jacp',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='jacr',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='site',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Compute site end-effector Jacobian.',
     )),
    ('mj_jacPointAxis',
     FunctionDecl(
         name='mj_jacPointAxis',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='jacPoint',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='jacAxis',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='point',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='axis',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='body',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Compute translation end-effector Jacobian of point, and rotation Jacobian of axis.',  # pylint: disable=line-too-long
     )),
    ('mj_jacDot',
     FunctionDecl(
         name='mj_jacDot',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='jacp',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='jacr',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='point',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='body',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Compute 3/6-by-nv Jacobian time derivative of global point attached to given body.',  # pylint: disable=line-too-long
     )),
    ('mj_angmomMat',
     FunctionDecl(
         name='mj_angmomMat',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='body',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Compute subtree angular momentum matrix.',
     )),
    ('mj_name2id',
     FunctionDecl(
         name='mj_name2id',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='type',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='name',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Get id of object with the specified mjtObj type and name; return -1 if id not found.',  # pylint: disable=line-too-long
     )),
    ('mj_id2name',
     FunctionDecl(
         name='mj_id2name',
         return_type=PointerType(
             inner_type=ValueType(name='char', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='type',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='id',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Get name of object with the specified mjtObj type and id; return NULL if name not found.',  # pylint: disable=line-too-long
     )),
    ('mj_fullM',
     FunctionDecl(
         name='mj_fullM',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='dst',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='M',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
         ),
         doc='Convert sparse inertia matrix M into full (i.e. dense) matrix.',
     )),
    ('mj_mulM',
     FunctionDecl(
         name='mj_mulM',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
         ),
         doc='Multiply vector by inertia matrix.',
     )),
    ('mj_mulM2',
     FunctionDecl(
         name='mj_mulM2',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
         ),
         doc='Multiply vector by (inertia matrix)^(1/2).',
     )),
    ('mj_addM',
     FunctionDecl(
         name='mj_addM',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='dst',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='rownnz',
                 type=PointerType(
                     inner_type=ValueType(name='int'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='rowadr',
                 type=PointerType(
                     inner_type=ValueType(name='int'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='colind',
                 type=PointerType(
                     inner_type=ValueType(name='int'),
                 ),
                 nullable=True,
             ),
         ),
         doc='Add inertia matrix to destination matrix (lower triangle only). Destination can be sparse or dense when all int* are NULL.',  # pylint: disable=line-too-long
     )),
    ('mj_applyFT',
     FunctionDecl(
         name='mj_applyFT',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='force',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='torque',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='point',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='body',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='qfrc_target',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
         ),
         doc='Apply Cartesian force and torque (outside xfrc_applied mechanism).',  # pylint: disable=line-too-long
     )),
    ('mj_objectVelocity',
     FunctionDecl(
         name='mj_objectVelocity',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='objtype',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='objid',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(6,),
                 ),
             ),
             FunctionParameterDecl(
                 name='flg_local',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Compute object 6D velocity (rot:lin) in object-centered frame, world/local orientation.',  # pylint: disable=line-too-long
     )),
    ('mj_objectAcceleration',
     FunctionDecl(
         name='mj_objectAcceleration',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='objtype',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='objid',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(6,),
                 ),
             ),
             FunctionParameterDecl(
                 name='flg_local',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Compute object 6D acceleration (rot:lin) in object-centered frame, world/local orientation.',  # pylint: disable=line-too-long
     )),
    ('mj_geomDistance',
     FunctionDecl(
         name='mj_geomDistance',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='geom1',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='geom2',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='distmax',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='fromto',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(6,),
                 ),
                 nullable=True,
             ),
         ),
         doc='Return smallest signed distance between two geoms and optionally segment from geom1 to geom2.',  # pylint: disable=line-too-long
     )),
    ('mj_contactForce',
     FunctionDecl(
         name='mj_contactForce',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='id',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='result',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(6,),
                 ),
             ),
         ),
         doc='Extract 6D force:torque given contact id, in the contact frame.',
     )),
    ('mj_differentiatePos',
     FunctionDecl(
         name='mj_differentiatePos',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='qvel',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='dt',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='qpos1',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='qpos2',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
         ),
         doc='Compute velocity by finite-differencing two positions.',
     )),
    ('mj_integratePos',
     FunctionDecl(
         name='mj_integratePos',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='qpos',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='qvel',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='dt',
                 type=ValueType(name='mjtNum'),
             ),
         ),
         doc='Integrate position with given velocity.',
     )),
    ('mj_normalizeQuat',
     FunctionDecl(
         name='mj_normalizeQuat',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='qpos',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
         ),
         doc='Normalize all quaternions in qpos-type vector.',
     )),
    ('mj_local2Global',
     FunctionDecl(
         name='mj_local2Global',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='xpos',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='xmat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(9,),
                 ),
             ),
             FunctionParameterDecl(
                 name='pos',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='quat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='body',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='sameframe',
                 type=ValueType(name='mjtByte'),
             ),
         ),
         doc='Map from body local to global Cartesian coordinates, sameframe takes values from mjtSameFrame.',  # pylint: disable=line-too-long
     )),
    ('mj_getTotalmass',
     FunctionDecl(
         name='mj_getTotalmass',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
         ),
         doc='Sum all body masses.',
     )),
    ('mj_setTotalmass',
     FunctionDecl(
         name='mj_setTotalmass',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel'),
                 ),
             ),
             FunctionParameterDecl(
                 name='newmass',
                 type=ValueType(name='mjtNum'),
             ),
         ),
         doc='Scale body masses and inertias to achieve specified total mass.',
     )),
    ('mj_getPluginConfig',
     FunctionDecl(
         name='mj_getPluginConfig',
         return_type=PointerType(
             inner_type=ValueType(name='char', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='plugin_id',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='attrib',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Return a config attribute value of a plugin instance; NULL: invalid plugin instance ID or attribute name',  # pylint: disable=line-too-long
     )),
    ('mj_loadPluginLibrary',
     FunctionDecl(
         name='mj_loadPluginLibrary',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='path',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Load a dynamic library. The dynamic library is assumed to register one or more plugins.',  # pylint: disable=line-too-long
     )),
    ('mj_loadAllPluginLibraries',
     FunctionDecl(
         name='mj_loadAllPluginLibraries',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='directory',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='callback',
                 type=ValueType(name='mjfPluginLibraryLoadCallback'),
             ),
         ),
         doc='Scan a directory and load all dynamic libraries. Dynamic libraries in the specified directory are assumed to register one or more plugins. Optionally, if a callback is specified, it is called for each dynamic library encountered that registers plugins.',  # pylint: disable=line-too-long
     )),
    ('mj_version',
     FunctionDecl(
         name='mj_version',
         return_type=ValueType(name='int'),
         parameters=(),
         doc='Return version number: 1.0.2 is encoded as 102.',
     )),
    ('mj_versionString',
     FunctionDecl(
         name='mj_versionString',
         return_type=PointerType(
             inner_type=ValueType(name='char', is_const=True),
         ),
         parameters=(),
         doc='Return the current version of MuJoCo as a null-terminated string.',  # pylint: disable=line-too-long
     )),
    ('mj_ray',
     FunctionDecl(
         name='mj_ray',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='pnt',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='geomgroup',
                 type=PointerType(
                     inner_type=ValueType(name='mjtByte', is_const=True),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='flg_static',
                 type=ValueType(name='mjtByte'),
             ),
             FunctionParameterDecl(
                 name='bodyexclude',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='geomid',
                 type=ArrayType(
                     inner_type=ValueType(name='int'),
                     extents=(1,),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='normal',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
                 nullable=True,
             ),
         ),
         doc='Intersect ray (pnt+x*vec, x>=0) with visible geoms, except geoms in bodyexclude. Return distance (x) to nearest surface, or -1 if no intersection. geomgroup, flg_static are as in mjvOption; geomgroup==NULL skips group exclusion.',  # pylint: disable=line-too-long
     )),
    ('mj_multiRay',
     FunctionDecl(
         name='mj_multiRay',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='pnt',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='geomgroup',
                 type=PointerType(
                     inner_type=ValueType(name='mjtByte', is_const=True),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='flg_static',
                 type=ValueType(name='mjtByte'),
             ),
             FunctionParameterDecl(
                 name='bodyexclude',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='geomid',
                 type=PointerType(
                     inner_type=ValueType(name='int'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='dist',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='normal',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='nray',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='cutoff',
                 type=ValueType(name='mjtNum'),
             ),
         ),
         doc='Intersect multiple rays emanating from a single point, compute normals if given. Similar semantics to mj_ray, but vec, normal and dist are arrays. Geoms further than cutoff are ignored.',  # pylint: disable=line-too-long
     )),
    ('mj_rayHfield',
     FunctionDecl(
         name='mj_rayHfield',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='geomid',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='pnt',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='normal',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
                 nullable=True,
             ),
         ),
         doc='Intersect ray with hfield; return nearest distance or -1 if no intersection.',  # pylint: disable=line-too-long
     )),
    ('mj_rayMesh',
     FunctionDecl(
         name='mj_rayMesh',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='geomid',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='pnt',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='normal',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
                 nullable=True,
             ),
         ),
         doc='Intersect ray with mesh; return nearest distance or -1 if no intersection.',  # pylint: disable=line-too-long
     )),
    ('mju_rayGeom',
     FunctionDecl(
         name='mju_rayGeom',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='pos',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(9,),
                 ),
             ),
             FunctionParameterDecl(
                 name='size',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='pnt',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='geomtype',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='normal',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
                 nullable=True,
             ),
         ),
         doc='Intersect ray with pure geom; return nearest distance or -1 if no intersection.',  # pylint: disable=line-too-long
     )),
    ('mj_rayFlex',
     FunctionDecl(
         name='mj_rayFlex',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='flex_layer',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='flg_vert',
                 type=ValueType(name='mjtByte'),
             ),
             FunctionParameterDecl(
                 name='flg_edge',
                 type=ValueType(name='mjtByte'),
             ),
             FunctionParameterDecl(
                 name='flg_face',
                 type=ValueType(name='mjtByte'),
             ),
             FunctionParameterDecl(
                 name='flg_skin',
                 type=ValueType(name='mjtByte'),
             ),
             FunctionParameterDecl(
                 name='flexid',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='pnt',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vertid',
                 type=ArrayType(
                     inner_type=ValueType(name='int'),
                     extents=(1,),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='normal',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
                 nullable=True,
             ),
         ),
         doc='Intersect ray with flex; return nearest distance or -1 if no intersection, and also output nearest vertex id and surface normal.',  # pylint: disable=line-too-long
     )),
    ('mju_raySkin',
     FunctionDecl(
         name='mju_raySkin',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='nface',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='nvert',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='face',
                 type=PointerType(
                     inner_type=ValueType(name='int', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='vert',
                 type=PointerType(
                     inner_type=ValueType(name='float', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='pnt',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vertid',
                 type=ArrayType(
                     inner_type=ValueType(name='int'),
                     extents=(1,),
                 ),
                 nullable=True,
             ),
         ),
         doc='Intersect ray with skin; return nearest distance or -1 if no intersection, and also output nearest vertex id.',  # pylint: disable=line-too-long
     )),
    ('mjv_defaultCamera',
     FunctionDecl(
         name='mjv_defaultCamera',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='cam',
                 type=PointerType(
                     inner_type=ValueType(name='mjvCamera'),
                 ),
             ),
         ),
         doc='Set default camera.',
     )),
    ('mjv_defaultFreeCamera',
     FunctionDecl(
         name='mjv_defaultFreeCamera',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='cam',
                 type=PointerType(
                     inner_type=ValueType(name='mjvCamera'),
                 ),
             ),
         ),
         doc='Set default free camera.',
     )),
    ('mjv_defaultPerturb',
     FunctionDecl(
         name='mjv_defaultPerturb',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='pert',
                 type=PointerType(
                     inner_type=ValueType(name='mjvPerturb'),
                 ),
             ),
         ),
         doc='Set default perturbation.',
     )),
    ('mjv_room2model',
     FunctionDecl(
         name='mjv_room2model',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='modelpos',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='modelquat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='roompos',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='roomquat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='scn',
                 type=PointerType(
                     inner_type=ValueType(name='mjvScene', is_const=True),
                 ),
             ),
         ),
         doc='Transform pose from room to model space.',
     )),
    ('mjv_model2room',
     FunctionDecl(
         name='mjv_model2room',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='roompos',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='roomquat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='modelpos',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='modelquat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='scn',
                 type=PointerType(
                     inner_type=ValueType(name='mjvScene', is_const=True),
                 ),
             ),
         ),
         doc='Transform pose from model to room space.',
     )),
    ('mjv_cameraInModel',
     FunctionDecl(
         name='mjv_cameraInModel',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='headpos',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='forward',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='up',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='scn',
                 type=PointerType(
                     inner_type=ValueType(name='mjvScene', is_const=True),
                 ),
             ),
         ),
         doc='Get camera info in model space; average left and right OpenGL cameras.',  # pylint: disable=line-too-long
     )),
    ('mjv_cameraInRoom',
     FunctionDecl(
         name='mjv_cameraInRoom',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='headpos',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='forward',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='up',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='scn',
                 type=PointerType(
                     inner_type=ValueType(name='mjvScene', is_const=True),
                 ),
             ),
         ),
         doc='Get camera info in room space; average left and right OpenGL cameras.',  # pylint: disable=line-too-long
     )),
    ('mjv_frustumHeight',
     FunctionDecl(
         name='mjv_frustumHeight',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='scn',
                 type=PointerType(
                     inner_type=ValueType(name='mjvScene', is_const=True),
                 ),
             ),
         ),
         doc='Get frustum height at unit distance from camera; average left and right OpenGL cameras.',  # pylint: disable=line-too-long
     )),
    ('mjv_alignToCamera',
     FunctionDecl(
         name='mjv_alignToCamera',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='forward',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
         ),
         doc='Rotate 3D vec in horizontal plane by angle between (0,1) and (forward_x,forward_y).',  # pylint: disable=line-too-long
     )),
    ('mjv_moveCamera',
     FunctionDecl(
         name='mjv_moveCamera',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='action',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='reldx',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='reldy',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='scn',
                 type=PointerType(
                     inner_type=ValueType(name='mjvScene', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='cam',
                 type=PointerType(
                     inner_type=ValueType(name='mjvCamera'),
                 ),
             ),
         ),
         doc='Move camera with mouse; action is mjtMouse.',
     )),
    ('mjv_movePerturb',
     FunctionDecl(
         name='mjv_movePerturb',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='action',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='reldx',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='reldy',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='scn',
                 type=PointerType(
                     inner_type=ValueType(name='mjvScene', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='pert',
                 type=PointerType(
                     inner_type=ValueType(name='mjvPerturb'),
                 ),
             ),
         ),
         doc='Move perturb object with mouse; action is mjtMouse.',
     )),
    ('mjv_moveModel',
     FunctionDecl(
         name='mjv_moveModel',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='action',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='reldx',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='reldy',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='roomup',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='scn',
                 type=PointerType(
                     inner_type=ValueType(name='mjvScene'),
                 ),
             ),
         ),
         doc='Move model with mouse; action is mjtMouse.',
     )),
    ('mjv_initPerturb',
     FunctionDecl(
         name='mjv_initPerturb',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='scn',
                 type=PointerType(
                     inner_type=ValueType(name='mjvScene', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='pert',
                 type=PointerType(
                     inner_type=ValueType(name='mjvPerturb'),
                 ),
             ),
         ),
         doc='Copy perturb pos,quat from selected body; set scale for perturbation.',  # pylint: disable=line-too-long
     )),
    ('mjv_applyPerturbPose',
     FunctionDecl(
         name='mjv_applyPerturbPose',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='pert',
                 type=PointerType(
                     inner_type=ValueType(name='mjvPerturb', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='flg_paused',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Set perturb pos,quat in d->mocap when selected body is mocap, and in d->qpos otherwise. Write d->qpos only if flg_paused and subtree root for selected body has free joint.',  # pylint: disable=line-too-long
     )),
    ('mjv_applyPerturbForce',
     FunctionDecl(
         name='mjv_applyPerturbForce',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='pert',
                 type=PointerType(
                     inner_type=ValueType(name='mjvPerturb', is_const=True),
                 ),
             ),
         ),
         doc='Set perturb force,torque in d->xfrc_applied, if selected body is dynamic.',  # pylint: disable=line-too-long
     )),
    ('mjv_averageCamera',
     FunctionDecl(
         name='mjv_averageCamera',
         return_type=ValueType(name='mjvGLCamera'),
         parameters=(
             FunctionParameterDecl(
                 name='cam1',
                 type=PointerType(
                     inner_type=ValueType(name='mjvGLCamera', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='cam2',
                 type=PointerType(
                     inner_type=ValueType(name='mjvGLCamera', is_const=True),
                 ),
             ),
         ),
         doc='Return the average of two OpenGL cameras.',
     )),
    ('mjv_select',
     FunctionDecl(
         name='mjv_select',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='vopt',
                 type=PointerType(
                     inner_type=ValueType(name='mjvOption', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='aspectratio',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='relx',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='rely',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='scn',
                 type=PointerType(
                     inner_type=ValueType(name='mjvScene', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='selpnt',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='geomid',
                 type=ArrayType(
                     inner_type=ValueType(name='int'),
                     extents=(1,),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='flexid',
                 type=ArrayType(
                     inner_type=ValueType(name='int'),
                     extents=(1,),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='skinid',
                 type=ArrayType(
                     inner_type=ValueType(name='int'),
                     extents=(1,),
                 ),
                 nullable=True,
             ),
         ),
         doc='Select geom, flex or skin with mouse; return bodyid; -1: none selected.',  # pylint: disable=line-too-long
     )),
    ('mjv_defaultOption',
     FunctionDecl(
         name='mjv_defaultOption',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='opt',
                 type=PointerType(
                     inner_type=ValueType(name='mjvOption'),
                 ),
             ),
         ),
         doc='Set default visualization options.',
     )),
    ('mjv_defaultFigure',
     FunctionDecl(
         name='mjv_defaultFigure',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='fig',
                 type=PointerType(
                     inner_type=ValueType(name='mjvFigure'),
                 ),
             ),
         ),
         doc='Set default figure.',
     )),
    ('mjv_initGeom',
     FunctionDecl(
         name='mjv_initGeom',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='geom',
                 type=PointerType(
                     inner_type=ValueType(name='mjvGeom'),
                 ),
             ),
             FunctionParameterDecl(
                 name='type',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='size',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='pos',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='mat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(9,),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='rgba',
                 type=ArrayType(
                     inner_type=ValueType(name='float', is_const=True),
                     extents=(4,),
                 ),
                 nullable=True,
             ),
         ),
         doc='Initialize given geom fields when not NULL, set the rest to their default values.',  # pylint: disable=line-too-long
     )),
    ('mjv_connector',
     FunctionDecl(
         name='mjv_connector',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='geom',
                 type=PointerType(
                     inner_type=ValueType(name='mjvGeom'),
                 ),
             ),
             FunctionParameterDecl(
                 name='type',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='width',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='from',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='to',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
         ),
         doc='Set (type, size, pos, mat) for connector-type geom between given points. Assume that mjv_initGeom was already called to set all other properties. Width of mjGEOM_LINE is denominated in pixels.',  # pylint: disable=line-too-long
     )),
    ('mjv_defaultScene',
     FunctionDecl(
         name='mjv_defaultScene',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='scn',
                 type=PointerType(
                     inner_type=ValueType(name='mjvScene'),
                 ),
             ),
         ),
         doc='Set default abstract scene.',
     )),
    ('mjv_makeScene',
     FunctionDecl(
         name='mjv_makeScene',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='scn',
                 type=PointerType(
                     inner_type=ValueType(name='mjvScene'),
                 ),
             ),
             FunctionParameterDecl(
                 name='maxgeom',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Allocate resources in abstract scene.',
     )),
    ('mjv_freeScene',
     FunctionDecl(
         name='mjv_freeScene',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='scn',
                 type=PointerType(
                     inner_type=ValueType(name='mjvScene'),
                 ),
             ),
         ),
         doc='Free abstract scene.',
     )),
    ('mjv_updateScene',
     FunctionDecl(
         name='mjv_updateScene',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='opt',
                 type=PointerType(
                     inner_type=ValueType(name='mjvOption', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='pert',
                 type=PointerType(
                     inner_type=ValueType(name='mjvPerturb', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='cam',
                 type=PointerType(
                     inner_type=ValueType(name='mjvCamera'),
                 ),
             ),
             FunctionParameterDecl(
                 name='catmask',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='scn',
                 type=PointerType(
                     inner_type=ValueType(name='mjvScene'),
                 ),
             ),
         ),
         doc='Update entire scene given model state.',
     )),
    ('mjv_copyModel',
     FunctionDecl(
         name='mjv_copyModel',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='dest',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='src',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
         ),
         doc='Copy mjModel, skip large arrays not required for abstract visualization.',  # pylint: disable=line-too-long
     )),
    ('mjv_addGeoms',
     FunctionDecl(
         name='mjv_addGeoms',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='opt',
                 type=PointerType(
                     inner_type=ValueType(name='mjvOption', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='pert',
                 type=PointerType(
                     inner_type=ValueType(name='mjvPerturb', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='catmask',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='scn',
                 type=PointerType(
                     inner_type=ValueType(name='mjvScene'),
                 ),
             ),
         ),
         doc='Add geoms from selected categories.',
     )),
    ('mjv_makeLights',
     FunctionDecl(
         name='mjv_makeLights',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='scn',
                 type=PointerType(
                     inner_type=ValueType(name='mjvScene'),
                 ),
             ),
         ),
         doc='Make list of lights.',
     )),
    ('mjv_updateCamera',
     FunctionDecl(
         name='mjv_updateCamera',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='cam',
                 type=PointerType(
                     inner_type=ValueType(name='mjvCamera'),
                 ),
             ),
             FunctionParameterDecl(
                 name='scn',
                 type=PointerType(
                     inner_type=ValueType(name='mjvScene'),
                 ),
             ),
         ),
         doc='Update camera.',
     )),
    ('mjv_updateSkin',
     FunctionDecl(
         name='mjv_updateSkin',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='scn',
                 type=PointerType(
                     inner_type=ValueType(name='mjvScene'),
                 ),
             ),
         ),
         doc='Update skins.',
     )),
    ('mjv_cameraFrame',
     FunctionDecl(
         name='mjv_cameraFrame',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='headpos',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='forward',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='up',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='right',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='cam',
                 type=PointerType(
                     inner_type=ValueType(name='mjvCamera', is_const=True),
                 ),
             ),
         ),
         doc='Compute camera position and forward, up, and right vectors.',
     )),
    ('mjv_cameraFrustum',
     FunctionDecl(
         name='mjv_cameraFrustum',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='zver',
                 type=ArrayType(
                     inner_type=ValueType(name='float'),
                     extents=(2,),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='zhor',
                 type=ArrayType(
                     inner_type=ValueType(name='float'),
                     extents=(2,),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='zclip',
                 type=ArrayType(
                     inner_type=ValueType(name='float'),
                     extents=(2,),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='cam',
                 type=PointerType(
                     inner_type=ValueType(name='mjvCamera', is_const=True),
                 ),
             ),
         ),
         doc='Compute camera frustum: vertical, horizontal, and clip planes.',
     )),
    ('mjr_defaultContext',
     FunctionDecl(
         name='mjr_defaultContext',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext'),
                 ),
             ),
         ),
         doc='Set default mjrContext.',
     )),
    ('mjr_makeContext',
     FunctionDecl(
         name='mjr_makeContext',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext'),
                 ),
             ),
             FunctionParameterDecl(
                 name='fontscale',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Allocate resources in custom OpenGL context; fontscale is mjtFontScale.',  # pylint: disable=line-too-long
     )),
    ('mjr_changeFont',
     FunctionDecl(
         name='mjr_changeFont',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='fontscale',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext'),
                 ),
             ),
         ),
         doc='Change font of existing context.',
     )),
    ('mjr_addAux',
     FunctionDecl(
         name='mjr_addAux',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='index',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='width',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='height',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='samples',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext'),
                 ),
             ),
         ),
         doc='Add Aux buffer with given index to context; free previous Aux buffer.',  # pylint: disable=line-too-long
     )),
    ('mjr_freeContext',
     FunctionDecl(
         name='mjr_freeContext',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext'),
                 ),
             ),
         ),
         doc='Free resources in custom OpenGL context, set to default.',
     )),
    ('mjr_resizeOffscreen',
     FunctionDecl(
         name='mjr_resizeOffscreen',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='width',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='height',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext'),
                 ),
             ),
         ),
         doc='Resize offscreen buffers.',
     )),
    ('mjr_uploadTexture',
     FunctionDecl(
         name='mjr_uploadTexture',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='texid',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Upload texture to GPU, overwriting previous upload if any.',
     )),
    ('mjr_uploadMesh',
     FunctionDecl(
         name='mjr_uploadMesh',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='meshid',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Upload mesh to GPU, overwriting previous upload if any.',
     )),
    ('mjr_uploadHField',
     FunctionDecl(
         name='mjr_uploadHField',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='hfieldid',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Upload height field to GPU, overwriting previous upload if any.',
     )),
    ('mjr_restoreBuffer',
     FunctionDecl(
         name='mjr_restoreBuffer',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext', is_const=True),
                 ),
             ),
         ),
         doc='Make con->currentBuffer current again.',
     )),
    ('mjr_setBuffer',
     FunctionDecl(
         name='mjr_setBuffer',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='framebuffer',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext'),
                 ),
             ),
         ),
         doc='Set OpenGL framebuffer for rendering: mjFB_WINDOW or mjFB_OFFSCREEN. If only one buffer is available, set that buffer and ignore framebuffer argument.',  # pylint: disable=line-too-long
     )),
    ('mjr_readPixels',
     FunctionDecl(
         name='mjr_readPixels',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='rgb',
                 type=PointerType(
                     inner_type=ValueType(name='unsigned char'),
                 ),
             ),
             FunctionParameterDecl(
                 name='depth',
                 type=PointerType(
                     inner_type=ValueType(name='float'),
                 ),
             ),
             FunctionParameterDecl(
                 name='viewport',
                 type=ValueType(name='mjrRect'),
             ),
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext', is_const=True),
                 ),
             ),
         ),
         doc='Read pixels from current OpenGL framebuffer to client buffer. Viewport is in OpenGL framebuffer; client buffer starts at (0,0).',  # pylint: disable=line-too-long
     )),
    ('mjr_drawPixels',
     FunctionDecl(
         name='mjr_drawPixels',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='rgb',
                 type=PointerType(
                     inner_type=ValueType(name='unsigned char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='depth',
                 type=PointerType(
                     inner_type=ValueType(name='float', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='viewport',
                 type=ValueType(name='mjrRect'),
             ),
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext', is_const=True),
                 ),
             ),
         ),
         doc='Draw pixels from client buffer to current OpenGL framebuffer. Viewport is in OpenGL framebuffer; client buffer starts at (0,0).',  # pylint: disable=line-too-long
     )),
    ('mjr_blitBuffer',
     FunctionDecl(
         name='mjr_blitBuffer',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='src',
                 type=ValueType(name='mjrRect'),
             ),
             FunctionParameterDecl(
                 name='dst',
                 type=ValueType(name='mjrRect'),
             ),
             FunctionParameterDecl(
                 name='flg_color',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='flg_depth',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext', is_const=True),
                 ),
             ),
         ),
         doc='Blit from src viewpoint in current framebuffer to dst viewport in other framebuffer. If src, dst have different size and flg_depth==0, color is interpolated with GL_LINEAR.',  # pylint: disable=line-too-long
     )),
    ('mjr_setAux',
     FunctionDecl(
         name='mjr_setAux',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='index',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext', is_const=True),
                 ),
             ),
         ),
         doc='Set Aux buffer for custom OpenGL rendering (call restoreBuffer when done).',  # pylint: disable=line-too-long
     )),
    ('mjr_blitAux',
     FunctionDecl(
         name='mjr_blitAux',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='index',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='src',
                 type=ValueType(name='mjrRect'),
             ),
             FunctionParameterDecl(
                 name='left',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='bottom',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext', is_const=True),
                 ),
             ),
         ),
         doc='Blit from Aux buffer to con->currentBuffer.',
     )),
    ('mjr_text',
     FunctionDecl(
         name='mjr_text',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='font',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='txt',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='x',
                 type=ValueType(name='float'),
             ),
             FunctionParameterDecl(
                 name='y',
                 type=ValueType(name='float'),
             ),
             FunctionParameterDecl(
                 name='r',
                 type=ValueType(name='float'),
             ),
             FunctionParameterDecl(
                 name='g',
                 type=ValueType(name='float'),
             ),
             FunctionParameterDecl(
                 name='b',
                 type=ValueType(name='float'),
             ),
         ),
         doc='Draw text at (x,y) in relative coordinates; font is mjtFont.',
     )),
    ('mjr_overlay',
     FunctionDecl(
         name='mjr_overlay',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='font',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='gridpos',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='viewport',
                 type=ValueType(name='mjrRect'),
             ),
             FunctionParameterDecl(
                 name='overlay',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='overlay2',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext', is_const=True),
                 ),
             ),
         ),
         doc='Draw text overlay; font is mjtFont; gridpos is mjtGridPos.',
     )),
    ('mjr_maxViewport',
     FunctionDecl(
         name='mjr_maxViewport',
         return_type=ValueType(name='mjrRect'),
         parameters=(
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext', is_const=True),
                 ),
             ),
         ),
         doc='Get maximum viewport for active buffer.',
     )),
    ('mjr_rectangle',
     FunctionDecl(
         name='mjr_rectangle',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='viewport',
                 type=ValueType(name='mjrRect'),
             ),
             FunctionParameterDecl(
                 name='r',
                 type=ValueType(name='float'),
             ),
             FunctionParameterDecl(
                 name='g',
                 type=ValueType(name='float'),
             ),
             FunctionParameterDecl(
                 name='b',
                 type=ValueType(name='float'),
             ),
             FunctionParameterDecl(
                 name='a',
                 type=ValueType(name='float'),
             ),
         ),
         doc='Draw rectangle.',
     )),
    ('mjr_label',
     FunctionDecl(
         name='mjr_label',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='viewport',
                 type=ValueType(name='mjrRect'),
             ),
             FunctionParameterDecl(
                 name='font',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='txt',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='r',
                 type=ValueType(name='float'),
             ),
             FunctionParameterDecl(
                 name='g',
                 type=ValueType(name='float'),
             ),
             FunctionParameterDecl(
                 name='b',
                 type=ValueType(name='float'),
             ),
             FunctionParameterDecl(
                 name='a',
                 type=ValueType(name='float'),
             ),
             FunctionParameterDecl(
                 name='rt',
                 type=ValueType(name='float'),
             ),
             FunctionParameterDecl(
                 name='gt',
                 type=ValueType(name='float'),
             ),
             FunctionParameterDecl(
                 name='bt',
                 type=ValueType(name='float'),
             ),
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext', is_const=True),
                 ),
             ),
         ),
         doc='Draw rectangle with centered text.',
     )),
    ('mjr_figure',
     FunctionDecl(
         name='mjr_figure',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='viewport',
                 type=ValueType(name='mjrRect'),
             ),
             FunctionParameterDecl(
                 name='fig',
                 type=PointerType(
                     inner_type=ValueType(name='mjvFigure'),
                 ),
             ),
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext', is_const=True),
                 ),
             ),
         ),
         doc='Draw 2D figure.',
     )),
    ('mjr_render',
     FunctionDecl(
         name='mjr_render',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='viewport',
                 type=ValueType(name='mjrRect'),
             ),
             FunctionParameterDecl(
                 name='scn',
                 type=PointerType(
                     inner_type=ValueType(name='mjvScene'),
                 ),
             ),
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext', is_const=True),
                 ),
             ),
         ),
         doc='Render 3D scene.',
     )),
    ('mjr_finish',
     FunctionDecl(
         name='mjr_finish',
         return_type=ValueType(name='void'),
         parameters=(),
         doc='Call glFinish.',
     )),
    ('mjr_getError',
     FunctionDecl(
         name='mjr_getError',
         return_type=ValueType(name='int'),
         parameters=(),
         doc='Call glGetError and return result.',
     )),
    ('mjr_findRect',
     FunctionDecl(
         name='mjr_findRect',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='x',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='y',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='nrect',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='rect',
                 type=PointerType(
                     inner_type=ValueType(name='mjrRect', is_const=True),
                 ),
             ),
         ),
         doc='Find first rectangle containing mouse, -1: not found.',
     )),
    ('mjui_themeSpacing',
     FunctionDecl(
         name='mjui_themeSpacing',
         return_type=ValueType(name='mjuiThemeSpacing'),
         parameters=(
             FunctionParameterDecl(
                 name='ind',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Get builtin UI theme spacing (ind: 0-1).',
     )),
    ('mjui_themeColor',
     FunctionDecl(
         name='mjui_themeColor',
         return_type=ValueType(name='mjuiThemeColor'),
         parameters=(
             FunctionParameterDecl(
                 name='ind',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Get builtin UI theme color (ind: 0-3).',
     )),
    ('mjui_add',
     FunctionDecl(
         name='mjui_add',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='ui',
                 type=PointerType(
                     inner_type=ValueType(name='mjUI'),
                 ),
             ),
             FunctionParameterDecl(
                 name='def',
                 type=PointerType(
                     inner_type=ValueType(name='mjuiDef', is_const=True),
                 ),
             ),
         ),
         doc='Add definitions to UI.',
     )),
    ('mjui_addToSection',
     FunctionDecl(
         name='mjui_addToSection',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='ui',
                 type=PointerType(
                     inner_type=ValueType(name='mjUI'),
                 ),
             ),
             FunctionParameterDecl(
                 name='sect',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='def',
                 type=PointerType(
                     inner_type=ValueType(name='mjuiDef', is_const=True),
                 ),
             ),
         ),
         doc='Add definitions to UI section.',
     )),
    ('mjui_resize',
     FunctionDecl(
         name='mjui_resize',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='ui',
                 type=PointerType(
                     inner_type=ValueType(name='mjUI'),
                 ),
             ),
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext', is_const=True),
                 ),
             ),
         ),
         doc='Compute UI sizes.',
     )),
    ('mjui_update',
     FunctionDecl(
         name='mjui_update',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='section',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='item',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='ui',
                 type=PointerType(
                     inner_type=ValueType(name='mjUI', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='state',
                 type=PointerType(
                     inner_type=ValueType(name='mjuiState', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext', is_const=True),
                 ),
             ),
         ),
         doc='Update specific section/item; -1: update all.',
     )),
    ('mjui_event',
     FunctionDecl(
         name='mjui_event',
         return_type=PointerType(
             inner_type=ValueType(name='mjuiItem'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='ui',
                 type=PointerType(
                     inner_type=ValueType(name='mjUI'),
                 ),
             ),
             FunctionParameterDecl(
                 name='state',
                 type=PointerType(
                     inner_type=ValueType(name='mjuiState'),
                 ),
             ),
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext', is_const=True),
                 ),
             ),
         ),
         doc='Handle UI event; return pointer to changed item, NULL if no change.',  # pylint: disable=line-too-long
     )),
    ('mjui_render',
     FunctionDecl(
         name='mjui_render',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='ui',
                 type=PointerType(
                     inner_type=ValueType(name='mjUI'),
                 ),
             ),
             FunctionParameterDecl(
                 name='state',
                 type=PointerType(
                     inner_type=ValueType(name='mjuiState', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='con',
                 type=PointerType(
                     inner_type=ValueType(name='mjrContext', is_const=True),
                 ),
             ),
         ),
         doc='Copy UI image to current buffer.',
     )),
    ('mju_error',
     FunctionDecl(
         name='mju_error',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='msg',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Main error function; does not return to caller.',
     )),
    ('mju_error_i',
     FunctionDecl(
         name='mju_error_i',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='msg',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='i',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Deprecated: use mju_error.',
     )),
    ('mju_error_s',
     FunctionDecl(
         name='mju_error_s',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='msg',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='text',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Deprecated: use mju_error.',
     )),
    ('mju_warning',
     FunctionDecl(
         name='mju_warning',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='msg',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Main warning function; returns to caller.',
     )),
    ('mju_warning_i',
     FunctionDecl(
         name='mju_warning_i',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='msg',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='i',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Deprecated: use mju_warning.',
     )),
    ('mju_warning_s',
     FunctionDecl(
         name='mju_warning_s',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='msg',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='text',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Deprecated: use mju_warning.',
     )),
    ('mju_clearHandlers',
     FunctionDecl(
         name='mju_clearHandlers',
         return_type=ValueType(name='void'),
         parameters=(),
         doc='Clear user error and memory handlers.',
     )),
    ('mju_malloc',
     FunctionDecl(
         name='mju_malloc',
         return_type=PointerType(
             inner_type=ValueType(name='void'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='size',
                 type=ValueType(name='size_t'),
             ),
         ),
         doc='Allocate memory; byte-align on 64; pad size to multiple of 64.',
     )),
    ('mju_free',
     FunctionDecl(
         name='mju_free',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='ptr',
                 type=PointerType(
                     inner_type=ValueType(name='void'),
                 ),
             ),
         ),
         doc='Free memory, using free() by default.',
     )),
    ('mj_warning',
     FunctionDecl(
         name='mj_warning',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='warning',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='info',
                 type=ValueType(name='int'),
             ),
         ),
         doc='High-level warning function: count warnings in mjData, print only the first.',  # pylint: disable=line-too-long
     )),
    ('mju_writeLog',
     FunctionDecl(
         name='mju_writeLog',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='type',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='msg',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Write [datetime, type: message] to MUJOCO_LOG.TXT.',
     )),
    ('mjs_getError',
     FunctionDecl(
         name='mjs_getError',
         return_type=PointerType(
             inner_type=ValueType(name='char', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
         ),
         doc='Get compiler error message from spec.',
     )),
    ('mjs_isWarning',
     FunctionDecl(
         name='mjs_isWarning',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
         ),
         doc='Return 1 if compiler error is a warning.',
     )),
    ('mju_zero3',
     FunctionDecl(
         name='mju_zero3',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
         ),
         doc='Set res = 0.',
     )),
    ('mju_copy3',
     FunctionDecl(
         name='mju_copy3',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='data',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
         ),
         doc='Set res = vec.',
     )),
    ('mju_scl3',
     FunctionDecl(
         name='mju_scl3',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='scl',
                 type=ValueType(name='mjtNum'),
             ),
         ),
         doc='Set res = vec*scl.',
     )),
    ('mju_add3',
     FunctionDecl(
         name='mju_add3',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec1',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec2',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
         ),
         doc='Set res = vec1 + vec2.',
     )),
    ('mju_sub3',
     FunctionDecl(
         name='mju_sub3',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec1',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec2',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
         ),
         doc='Set res = vec1 - vec2.',
     )),
    ('mju_addTo3',
     FunctionDecl(
         name='mju_addTo3',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
         ),
         doc='Set res = res + vec.',
     )),
    ('mju_subFrom3',
     FunctionDecl(
         name='mju_subFrom3',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
         ),
         doc='Set res = res - vec.',
     )),
    ('mju_addToScl3',
     FunctionDecl(
         name='mju_addToScl3',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='scl',
                 type=ValueType(name='mjtNum'),
             ),
         ),
         doc='Set res = res + vec*scl.',
     )),
    ('mju_addScl3',
     FunctionDecl(
         name='mju_addScl3',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec1',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec2',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='scl',
                 type=ValueType(name='mjtNum'),
             ),
         ),
         doc='Set res = vec1 + vec2*scl.',
     )),
    ('mju_normalize3',
     FunctionDecl(
         name='mju_normalize3',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='vec',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
         ),
         doc='Normalize vector; return length before normalization.',
     )),
    ('mju_norm3',
     FunctionDecl(
         name='mju_norm3',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='vec',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
         ),
         doc='Return vector length (without normalizing the vector).',
     )),
    ('mju_dot3',
     FunctionDecl(
         name='mju_dot3',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='vec1',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec2',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
         ),
         doc='Return dot-product of vec1 and vec2.',
     )),
    ('mju_dist3',
     FunctionDecl(
         name='mju_dist3',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='pos1',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='pos2',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
         ),
         doc='Return Cartesian distance between 3D vectors pos1 and pos2.',
     )),
    ('mju_mulMatVec3',
     FunctionDecl(
         name='mju_mulMatVec3',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(9,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
         ),
         doc='Multiply 3-by-3 matrix by vector: res = mat * vec.',
     )),
    ('mju_mulMatTVec3',
     FunctionDecl(
         name='mju_mulMatTVec3',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(9,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
         ),
         doc="Multiply transposed 3-by-3 matrix by vector: res = mat' * vec.",
     )),
    ('mju_cross',
     FunctionDecl(
         name='mju_cross',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='a',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='b',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
         ),
         doc='Compute cross-product: res = cross(a, b).',
     )),
    ('mju_zero4',
     FunctionDecl(
         name='mju_zero4',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(4,),
                 ),
             ),
         ),
         doc='Set res = 0.',
     )),
    ('mju_unit4',
     FunctionDecl(
         name='mju_unit4',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(4,),
                 ),
             ),
         ),
         doc='Set res = (1,0,0,0).',
     )),
    ('mju_copy4',
     FunctionDecl(
         name='mju_copy4',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='data',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(4,),
                 ),
             ),
         ),
         doc='Set res = vec.',
     )),
    ('mju_normalize4',
     FunctionDecl(
         name='mju_normalize4',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='vec',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(4,),
                 ),
             ),
         ),
         doc='Normalize vector; return length before normalization.',
     )),
    ('mju_zero',
     FunctionDecl(
         name='mju_zero',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Set res = 0.',
     )),
    ('mju_fill',
     FunctionDecl(
         name='mju_fill',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='val',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Set res = val.',
     )),
    ('mju_copy',
     FunctionDecl(
         name='mju_copy',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Set res = vec.',
     )),
    ('mju_sum',
     FunctionDecl(
         name='mju_sum',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='vec',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Return sum(vec).',
     )),
    ('mju_L1',
     FunctionDecl(
         name='mju_L1',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='vec',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Return L1 norm: sum(abs(vec)).',
     )),
    ('mju_scl',
     FunctionDecl(
         name='mju_scl',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='scl',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Set res = vec*scl.',
     )),
    ('mju_add',
     FunctionDecl(
         name='mju_add',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec1',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec2',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Set res = vec1 + vec2.',
     )),
    ('mju_sub',
     FunctionDecl(
         name='mju_sub',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec1',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec2',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Set res = vec1 - vec2.',
     )),
    ('mju_addTo',
     FunctionDecl(
         name='mju_addTo',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Set res = res + vec.',
     )),
    ('mju_subFrom',
     FunctionDecl(
         name='mju_subFrom',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Set res = res - vec.',
     )),
    ('mju_addToScl',
     FunctionDecl(
         name='mju_addToScl',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='scl',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Set res = res + vec*scl.',
     )),
    ('mju_addScl',
     FunctionDecl(
         name='mju_addScl',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec1',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec2',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='scl',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Set res = vec1 + vec2*scl.',
     )),
    ('mju_normalize',
     FunctionDecl(
         name='mju_normalize',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Normalize vector; return length before normalization.',
     )),
    ('mju_norm',
     FunctionDecl(
         name='mju_norm',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Return vector length (without normalizing vector).',
     )),
    ('mju_dot',
     FunctionDecl(
         name='mju_dot',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='vec1',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec2',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Return dot-product of vec1 and vec2.',
     )),
    ('mju_mulMatVec',
     FunctionDecl(
         name='mju_mulMatVec',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='nr',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='nc',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Multiply matrix and vector: res = mat * vec.',
     )),
    ('mju_mulMatTVec',
     FunctionDecl(
         name='mju_mulMatTVec',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='nr',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='nc',
                 type=ValueType(name='int'),
             ),
         ),
         doc="Multiply transposed matrix and vector: res = mat' * vec.",
     )),
    ('mju_mulVecMatVec',
     FunctionDecl(
         name='mju_mulVecMatVec',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='vec1',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec2',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc="Multiply square matrix with vectors on both sides: return vec1' * mat * vec2.",  # pylint: disable=line-too-long
     )),
    ('mju_transpose',
     FunctionDecl(
         name='mju_transpose',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='nr',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='nc',
                 type=ValueType(name='int'),
             ),
         ),
         doc="Transpose matrix: res = mat'.",
     )),
    ('mju_symmetrize',
     FunctionDecl(
         name='mju_symmetrize',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc="Symmetrize square matrix res = (mat + mat')/2.",
     )),
    ('mju_eye',
     FunctionDecl(
         name='mju_eye',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='mat',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Set mat to the identity matrix.',
     )),
    ('mju_mulMatMat',
     FunctionDecl(
         name='mju_mulMatMat',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat1',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat2',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='r1',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='c1',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='c2',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Multiply matrices: res = mat1 * mat2.',
     )),
    ('mju_mulMatMatT',
     FunctionDecl(
         name='mju_mulMatMatT',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat1',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat2',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='r1',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='c1',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='r2',
                 type=ValueType(name='int'),
             ),
         ),
         doc="Multiply matrices, second argument transposed: res = mat1 * mat2'.",  # pylint: disable=line-too-long
     )),
    ('mju_mulMatTMat',
     FunctionDecl(
         name='mju_mulMatTMat',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat1',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat2',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='r1',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='c1',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='c2',
                 type=ValueType(name='int'),
             ),
         ),
         doc="Multiply matrices, first argument transposed: res = mat1' * mat2.",  # pylint: disable=line-too-long
     )),
    ('mju_sqrMatTD',
     FunctionDecl(
         name='mju_sqrMatTD',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='diag',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='nr',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='nc',
                 type=ValueType(name='int'),
             ),
         ),
         doc="Set res = mat' * diag * mat if diag is not NULL, and res = mat' * mat otherwise.",  # pylint: disable=line-too-long
     )),
    ('mju_transformSpatial',
     FunctionDecl(
         name='mju_transformSpatial',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(6,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(6,),
                 ),
             ),
             FunctionParameterDecl(
                 name='flg_force',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='newpos',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='oldpos',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='rotnew2old',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(9,),
                 ),
                 nullable=True,
             ),
         ),
         doc='Coordinate transform of 6D motion or force vector in rotation:translation format. rotnew2old is 3-by-3, NULL means no rotation; flg_force specifies force or motion type.',  # pylint: disable=line-too-long
     )),
    ('mju_dense2sparse',
     FunctionDecl(
         name='mju_dense2sparse',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='nr',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='nc',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='rownnz',
                 type=PointerType(
                     inner_type=ValueType(name='int'),
                 ),
             ),
             FunctionParameterDecl(
                 name='rowadr',
                 type=PointerType(
                     inner_type=ValueType(name='int'),
                 ),
             ),
             FunctionParameterDecl(
                 name='colind',
                 type=PointerType(
                     inner_type=ValueType(name='int'),
                 ),
             ),
             FunctionParameterDecl(
                 name='nnz',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Convert matrix from dense to sparse.  nnz is size of res and colind; return 1 if too small, 0 otherwise.',  # pylint: disable=line-too-long
     )),
    ('mju_sparse2dense',
     FunctionDecl(
         name='mju_sparse2dense',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='nr',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='nc',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='rownnz',
                 type=PointerType(
                     inner_type=ValueType(name='int', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='rowadr',
                 type=PointerType(
                     inner_type=ValueType(name='int', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='colind',
                 type=PointerType(
                     inner_type=ValueType(name='int', is_const=True),
                 ),
             ),
         ),
         doc='Convert matrix from sparse to dense.',
     )),
    ('mju_rotVecQuat',
     FunctionDecl(
         name='mju_rotVecQuat',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='quat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(4,),
                 ),
             ),
         ),
         doc='Rotate vector by quaternion.',
     )),
    ('mju_negQuat',
     FunctionDecl(
         name='mju_negQuat',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='quat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(4,),
                 ),
             ),
         ),
         doc='Conjugate quaternion, corresponding to opposite rotation.',
     )),
    ('mju_mulQuat',
     FunctionDecl(
         name='mju_mulQuat',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='quat1',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='quat2',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(4,),
                 ),
             ),
         ),
         doc='Multiply quaternions.',
     )),
    ('mju_mulQuatAxis',
     FunctionDecl(
         name='mju_mulQuatAxis',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='quat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='axis',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
         ),
         doc='Multiply quaternion and axis.',
     )),
    ('mju_axisAngle2Quat',
     FunctionDecl(
         name='mju_axisAngle2Quat',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='axis',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='angle',
                 type=ValueType(name='mjtNum'),
             ),
         ),
         doc='Convert axisAngle to quaternion.',
     )),
    ('mju_quat2Vel',
     FunctionDecl(
         name='mju_quat2Vel',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='quat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='dt',
                 type=ValueType(name='mjtNum'),
             ),
         ),
         doc='Convert quaternion (corresponding to orientation difference) to 3D velocity.',  # pylint: disable=line-too-long
     )),
    ('mju_subQuat',
     FunctionDecl(
         name='mju_subQuat',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='qa',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='qb',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(4,),
                 ),
             ),
         ),
         doc='Subtract quaternions, express as 3D velocity: qb*quat(res) = qa.',
     )),
    ('mju_quat2Mat',
     FunctionDecl(
         name='mju_quat2Mat',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(9,),
                 ),
             ),
             FunctionParameterDecl(
                 name='quat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(4,),
                 ),
             ),
         ),
         doc='Convert quaternion to 3D rotation matrix.',
     )),
    ('mju_mat2Quat',
     FunctionDecl(
         name='mju_mat2Quat',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='quat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(9,),
                 ),
             ),
         ),
         doc='Convert 3D rotation matrix to quaternion.',
     )),
    ('mju_derivQuat',
     FunctionDecl(
         name='mju_derivQuat',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='quat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vel',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
         ),
         doc='Compute time-derivative of quaternion, given 3D rotational velocity.',  # pylint: disable=line-too-long
     )),
    ('mju_quatIntegrate',
     FunctionDecl(
         name='mju_quatIntegrate',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='quat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vel',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='scale',
                 type=ValueType(name='mjtNum'),
             ),
         ),
         doc='Integrate quaternion given 3D angular velocity.',
     )),
    ('mju_quatZ2Vec',
     FunctionDecl(
         name='mju_quatZ2Vec',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='quat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
         ),
         doc='Construct quaternion performing rotation from z-axis to given vector.',  # pylint: disable=line-too-long
     )),
    ('mju_mat2Rot',
     FunctionDecl(
         name='mju_mat2Rot',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='quat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(9,),
                 ),
             ),
         ),
         doc='Extract 3D rotation from an arbitrary 3x3 matrix by refining the input quaternion. Return the number of iterations required to converge.',  # pylint: disable=line-too-long
     )),
    ('mju_euler2Quat',
     FunctionDecl(
         name='mju_euler2Quat',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='quat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='euler',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='seq',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc="Convert sequence of Euler angles (radians) to quaternion. seq[0,1,2] must be in 'xyzXYZ', lower/upper-case mean intrinsic/extrinsic rotations.",  # pylint: disable=line-too-long
     )),
    ('mju_mulPose',
     FunctionDecl(
         name='mju_mulPose',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='posres',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='quatres',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='pos1',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='quat1',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='pos2',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='quat2',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(4,),
                 ),
             ),
         ),
         doc='Multiply two poses.',
     )),
    ('mju_negPose',
     FunctionDecl(
         name='mju_negPose',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='posres',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='quatres',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='pos',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='quat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(4,),
                 ),
             ),
         ),
         doc='Conjugate pose, corresponding to the opposite spatial transformation.',  # pylint: disable=line-too-long
     )),
    ('mju_trnVecPose',
     FunctionDecl(
         name='mju_trnVecPose',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='pos',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='quat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
         ),
         doc='Transform vector by pose.',
     )),
    ('mju_cholFactor',
     FunctionDecl(
         name='mju_cholFactor',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='mat',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='mindiag',
                 type=ValueType(name='mjtNum'),
             ),
         ),
         doc="Cholesky decomposition: mat = L*L'; return rank, decomposition performed in-place into mat.",  # pylint: disable=line-too-long
     )),
    ('mju_cholSolve',
     FunctionDecl(
         name='mju_cholSolve',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc="Solve (mat*mat') * res = vec, where mat is a Cholesky factor.",
     )),
    ('mju_cholUpdate',
     FunctionDecl(
         name='mju_cholUpdate',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='mat',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='x',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='flg_plus',
                 type=ValueType(name='int'),
             ),
         ),
         doc="Cholesky rank-one update: L*L' +/- x*x'; return rank.",
     )),
    ('mju_cholFactorBand',
     FunctionDecl(
         name='mju_cholFactorBand',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='mat',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='ntotal',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='nband',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='ndense',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='diagadd',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='diagmul',
                 type=ValueType(name='mjtNum'),
             ),
         ),
         doc='Band-dense Cholesky decomposition.  Return minimum value in the factorized diagonal, or 0 if rank-deficient.  mat has (ntotal-ndense) x nband + ndense x ntotal elements.  The first (ntotal-ndense) x nband store the band part, left of diagonal, inclusive.  The second ndense x ntotal store the band part as entire dense rows.  Add diagadd+diagmul*mat_ii to diagonal before factorization.',  # pylint: disable=line-too-long
     )),
    ('mju_cholSolveBand',
     FunctionDecl(
         name='mju_cholSolveBand',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='ntotal',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='nband',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='ndense',
                 type=ValueType(name='int'),
             ),
         ),
         doc="Solve (mat*mat')*res = vec where mat is a band-dense Cholesky factor.",  # pylint: disable=line-too-long
     )),
    ('mju_band2Dense',
     FunctionDecl(
         name='mju_band2Dense',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='ntotal',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='nband',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='ndense',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='flg_sym',
                 type=ValueType(name='mjtByte'),
             ),
         ),
         doc='Convert banded matrix to dense matrix, fill upper triangle if flg_sym>0.',  # pylint: disable=line-too-long
     )),
    ('mju_dense2Band',
     FunctionDecl(
         name='mju_dense2Band',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='ntotal',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='nband',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='ndense',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Convert dense matrix to banded matrix.',
     )),
    ('mju_bandMulMatVec',
     FunctionDecl(
         name='mju_bandMulMatVec',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='ntotal',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='nband',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='ndense',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='nvec',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='flg_sym',
                 type=ValueType(name='mjtByte'),
             ),
         ),
         doc='Multiply band-diagonal matrix with nvec vectors, include upper triangle if flg_sym>0.',  # pylint: disable=line-too-long
     )),
    ('mju_bandDiag',
     FunctionDecl(
         name='mju_bandDiag',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='i',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='ntotal',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='nband',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='ndense',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Address of diagonal element i in band-dense matrix representation.',  # pylint: disable=line-too-long
     )),
    ('mju_eig3',
     FunctionDecl(
         name='mju_eig3',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='eigval',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='eigvec',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(9,),
                 ),
             ),
             FunctionParameterDecl(
                 name='quat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='mat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(9,),
                 ),
             ),
         ),
         doc="Eigenvalue decomposition of symmetric 3x3 matrix, mat = eigvec * diag(eigval) * eigvec'.",  # pylint: disable=line-too-long
     )),
    ('mju_boxQP',
     FunctionDecl(
         name='mju_boxQP',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='R',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='index',
                 type=PointerType(
                     inner_type=ValueType(name='int'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='H',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='g',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='lower',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='upper',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
                 nullable=True,
             ),
         ),
         doc="minimize 0.5*x'*H*x + x'*g  s.t. lower <= x <= upper; return rank or -1 if failed   inputs:     n           - problem dimension     H           - SPD matrix                n*n     g           - bias vector               n     lower       - lower bounds              n     upper       - upper bounds              n     res         - solution warmstart        n   return value:     nfree <= n  - rank of unconstrained subspace, -1 if failure   outputs (required):     res         - solution                  n     R           - subspace Cholesky factor  nfree*nfree    allocated: n*(n+7)   outputs (optional):     index       - set of free dimensions    nfree          allocated: n   notes:     the initial value of res is used to warmstart the solver     R must have allocatd size n*(n+7), but only nfree*nfree values are used in output     index (if given) must have allocated size n, but only nfree values are used in output     only the lower triangles of H and R and are read from and written to, respectively     the convenience function mju_boxQPmalloc allocates the required data structures",  # pylint: disable=line-too-long
     )),
    ('mju_boxQPmalloc',
     FunctionDecl(
         name='mju_boxQPmalloc',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=PointerType(
                         inner_type=ValueType(name='mjtNum'),
                     ),
                 ),
             ),
             FunctionParameterDecl(
                 name='R',
                 type=PointerType(
                     inner_type=PointerType(
                         inner_type=ValueType(name='mjtNum'),
                     ),
                 ),
             ),
             FunctionParameterDecl(
                 name='index',
                 type=PointerType(
                     inner_type=PointerType(
                         inner_type=ValueType(name='int'),
                     ),
                 ),
             ),
             FunctionParameterDecl(
                 name='H',
                 type=PointerType(
                     inner_type=PointerType(
                         inner_type=ValueType(name='mjtNum'),
                     ),
                 ),
             ),
             FunctionParameterDecl(
                 name='g',
                 type=PointerType(
                     inner_type=PointerType(
                         inner_type=ValueType(name='mjtNum'),
                     ),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='lower',
                 type=PointerType(
                     inner_type=PointerType(
                         inner_type=ValueType(name='mjtNum'),
                     ),
                 ),
             ),
             FunctionParameterDecl(
                 name='upper',
                 type=PointerType(
                     inner_type=PointerType(
                         inner_type=ValueType(name='mjtNum'),
                     ),
                 ),
             ),
         ),
         doc='allocate heap memory for box-constrained Quadratic Program   as in mju_boxQP, index, lower, and upper are optional   free all pointers with mju_free()',  # pylint: disable=line-too-long
     )),
    ('mju_muscleGain',
     FunctionDecl(
         name='mju_muscleGain',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='len',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='vel',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='lengthrange',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(2,),
                 ),
             ),
             FunctionParameterDecl(
                 name='acc0',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='prm',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(9,),
                 ),
             ),
         ),
         doc='Muscle active force, prm = (range[2], force, scale, lmin, lmax, vmax, fpmax, fvmax).',  # pylint: disable=line-too-long
     )),
    ('mju_muscleBias',
     FunctionDecl(
         name='mju_muscleBias',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='len',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='lengthrange',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(2,),
                 ),
             ),
             FunctionParameterDecl(
                 name='acc0',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='prm',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(9,),
                 ),
             ),
         ),
         doc='Muscle passive force, prm = (range[2], force, scale, lmin, lmax, vmax, fpmax, fvmax).',  # pylint: disable=line-too-long
     )),
    ('mju_muscleDynamics',
     FunctionDecl(
         name='mju_muscleDynamics',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='ctrl',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='act',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='prm',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
         ),
         doc='Muscle activation dynamics, prm = (tau_act, tau_deact, smoothing_width).',  # pylint: disable=line-too-long
     )),
    ('mju_encodePyramid',
     FunctionDecl(
         name='mju_encodePyramid',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='pyramid',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='force',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='mu',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='dim',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Convert contact force to pyramid representation.',
     )),
    ('mju_decodePyramid',
     FunctionDecl(
         name='mju_decodePyramid',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='force',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='pyramid',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='mu',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='dim',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Convert pyramid representation to contact force.',
     )),
    ('mju_springDamper',
     FunctionDecl(
         name='mju_springDamper',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='pos0',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='vel0',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='Kp',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='Kv',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='dt',
                 type=ValueType(name='mjtNum'),
             ),
         ),
         doc='Integrate spring-damper analytically; return pos(dt).',
     )),
    ('mju_min',
     FunctionDecl(
         name='mju_min',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='a',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='b',
                 type=ValueType(name='mjtNum'),
             ),
         ),
         doc='Return min(a,b) with single evaluation of a and b.',
     )),
    ('mju_max',
     FunctionDecl(
         name='mju_max',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='a',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='b',
                 type=ValueType(name='mjtNum'),
             ),
         ),
         doc='Return max(a,b) with single evaluation of a and b.',
     )),
    ('mju_clip',
     FunctionDecl(
         name='mju_clip',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='x',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='min',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='max',
                 type=ValueType(name='mjtNum'),
             ),
         ),
         doc='Clip x to the range [min, max].',
     )),
    ('mju_sign',
     FunctionDecl(
         name='mju_sign',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='x',
                 type=ValueType(name='mjtNum'),
             ),
         ),
         doc='Return sign of x: +1, -1 or 0.',
     )),
    ('mju_round',
     FunctionDecl(
         name='mju_round',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='x',
                 type=ValueType(name='mjtNum'),
             ),
         ),
         doc='Round x to nearest integer.',
     )),
    ('mju_type2Str',
     FunctionDecl(
         name='mju_type2Str',
         return_type=PointerType(
             inner_type=ValueType(name='char', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='type',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Convert type id (mjtObj) to type name.',
     )),
    ('mju_str2Type',
     FunctionDecl(
         name='mju_str2Type',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='str',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Convert type name to type id (mjtObj).',
     )),
    ('mju_writeNumBytes',
     FunctionDecl(
         name='mju_writeNumBytes',
         return_type=PointerType(
             inner_type=ValueType(name='char', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='nbytes',
                 type=ValueType(name='size_t'),
             ),
         ),
         doc='Return human readable number of bytes using standard letter suffix.',  # pylint: disable=line-too-long
     )),
    ('mju_warningText',
     FunctionDecl(
         name='mju_warningText',
         return_type=PointerType(
             inner_type=ValueType(name='char', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='warning',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='info',
                 type=ValueType(name='size_t'),
             ),
         ),
         doc='Construct a warning message given the warning type and info.',
     )),
    ('mju_isBad',
     FunctionDecl(
         name='mju_isBad',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='x',
                 type=ValueType(name='mjtNum'),
             ),
         ),
         doc='Return 1 if nan or abs(x)>mjMAXVAL, 0 otherwise. Used by check functions.',  # pylint: disable=line-too-long
     )),
    ('mju_isZero',
     FunctionDecl(
         name='mju_isZero',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='vec',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Return 1 if all elements are 0.',
     )),
    ('mju_standardNormal',
     FunctionDecl(
         name='mju_standardNormal',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='num2',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
         ),
         doc='Standard normal random number generator (optional second number).',  # pylint: disable=line-too-long
     )),
    ('mju_f2n',
     FunctionDecl(
         name='mju_f2n',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=PointerType(
                     inner_type=ValueType(name='float', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Convert from float to mjtNum.',
     )),
    ('mju_n2f',
     FunctionDecl(
         name='mju_n2f',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='float'),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Convert from mjtNum to float.',
     )),
    ('mju_d2n',
     FunctionDecl(
         name='mju_d2n',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=PointerType(
                     inner_type=ValueType(name='double', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Convert from double to mjtNum.',
     )),
    ('mju_n2d',
     FunctionDecl(
         name='mju_n2d',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='res',
                 type=PointerType(
                     inner_type=ValueType(name='double'),
                 ),
             ),
             FunctionParameterDecl(
                 name='vec',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Convert from mjtNum to double.',
     )),
    ('mju_insertionSort',
     FunctionDecl(
         name='mju_insertionSort',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='list',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Insertion sort, resulting list is in increasing order.',
     )),
    ('mju_insertionSortInt',
     FunctionDecl(
         name='mju_insertionSortInt',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='list',
                 type=PointerType(
                     inner_type=ValueType(name='int'),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Integer insertion sort, resulting list is in increasing order.',
     )),
    ('mju_Halton',
     FunctionDecl(
         name='mju_Halton',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='index',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='base',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Generate Halton sequence.',
     )),
    ('mju_strncpy',
     FunctionDecl(
         name='mju_strncpy',
         return_type=PointerType(
             inner_type=ValueType(name='char'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='dst',
                 type=PointerType(
                     inner_type=ValueType(name='char'),
                 ),
             ),
             FunctionParameterDecl(
                 name='src',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='n',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Call strncpy, then set dst[n-1] = 0.',
     )),
    ('mju_sigmoid',
     FunctionDecl(
         name='mju_sigmoid',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='x',
                 type=ValueType(name='mjtNum'),
             ),
         ),
         doc='Sigmoid function over 0<=x<=1 using quintic polynomial.',
     )),
    ('mjc_getSDF',
     FunctionDecl(
         name='mjc_getSDF',
         return_type=PointerType(
             inner_type=ValueType(name='mjpPlugin', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='id',
                 type=ValueType(name='int'),
             ),
         ),
         doc='get sdf from geom id',
     )),
    ('mjc_distance',
     FunctionDecl(
         name='mjc_distance',
         return_type=ValueType(name='mjtNum'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSDF', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='x',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
         ),
         doc='signed distance function',
     )),
    ('mjc_gradient',
     FunctionDecl(
         name='mjc_gradient',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSDF', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='gradient',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='x',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
         ),
         doc='gradient of sdf',
     )),
    ('mjd_transitionFD',
     FunctionDecl(
         name='mjd_transitionFD',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='eps',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='flg_centered',
                 type=ValueType(name='mjtByte'),
             ),
             FunctionParameterDecl(
                 name='A',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='B',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='C',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='D',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
         ),
         doc='Finite differenced transition matrices (control theory notation)   d(x_next) = A*dx + B*du   d(sensor) = C*dx + D*du   required output matrix dimensions:      A: (2*nv+na x 2*nv+na)      B: (2*nv+na x nu)      D: (nsensordata x 2*nv+na)      C: (nsensordata x nu)',  # pylint: disable=line-too-long
     )),
    ('mjd_inverseFD',
     FunctionDecl(
         name='mjd_inverseFD',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='m',
                 type=PointerType(
                     inner_type=ValueType(name='mjModel', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='eps',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='flg_actuation',
                 type=ValueType(name='mjtByte'),
             ),
             FunctionParameterDecl(
                 name='DfDq',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='DfDv',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='DfDa',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='DsDq',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='DsDv',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='DsDa',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='DmDq',
                 type=PointerType(
                     inner_type=ValueType(name='mjtNum'),
                 ),
                 nullable=True,
             ),
         ),
         doc='Finite differenced Jacobians of (force, sensors) = mj_inverse(state, acceleration)   All outputs are optional. Output dimensions (transposed w.r.t Control Theory convention):     DfDq: (nv x nv)     DfDv: (nv x nv)     DfDa: (nv x nv)     DsDq: (nv x nsensordata)     DsDv: (nv x nsensordata)     DsDa: (nv x nsensordata)     DmDq: (nv x nM)   single-letter shortcuts:     inputs: q=qpos, v=qvel, a=qacc     outputs: f=qfrc_inverse, s=sensordata, m=qM   notes:     optionally computes mass matrix Jacobian DmDq     flg_actuation specifies whether to subtract qfrc_actuator from qfrc_inverse',  # pylint: disable=line-too-long
     )),
    ('mjd_subQuat',
     FunctionDecl(
         name='mjd_subQuat',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='qa',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='qb',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='Da',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(9,),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='Db',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(9,),
                 ),
                 nullable=True,
             ),
         ),
         doc='Derivatives of mju_subQuat.',
     )),
    ('mjd_quatIntegrate',
     FunctionDecl(
         name='mjd_quatIntegrate',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='vel',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum', is_const=True),
                     extents=(3,),
                 ),
             ),
             FunctionParameterDecl(
                 name='scale',
                 type=ValueType(name='mjtNum'),
             ),
             FunctionParameterDecl(
                 name='Dquat',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(9,),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='Dvel',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(9,),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='Dscale',
                 type=ArrayType(
                     inner_type=ValueType(name='mjtNum'),
                     extents=(3,),
                 ),
                 nullable=True,
             ),
         ),
         doc='Derivatives of mju_quatIntegrate.',
     )),
    ('mjp_defaultPlugin',
     FunctionDecl(
         name='mjp_defaultPlugin',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='plugin',
                 type=PointerType(
                     inner_type=ValueType(name='mjpPlugin'),
                 ),
             ),
         ),
         doc='Set default plugin definition.',
     )),
    ('mjp_registerPlugin',
     FunctionDecl(
         name='mjp_registerPlugin',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='plugin',
                 type=PointerType(
                     inner_type=ValueType(name='mjpPlugin', is_const=True),
                 ),
             ),
         ),
         doc='Globally register a plugin. This function is thread-safe. If an identical mjpPlugin is already registered, this function does nothing. If a non-identical mjpPlugin with the same name is already registered, an mju_error is raised. Two mjpPlugins are considered identical if all member function pointers and numbers are equal, and the name and attribute strings are all identical, however the char pointers to the strings need not be the same.',  # pylint: disable=line-too-long
     )),
    ('mjp_pluginCount',
     FunctionDecl(
         name='mjp_pluginCount',
         return_type=ValueType(name='int'),
         parameters=(),
         doc='Return the number of globally registered plugins.',
     )),
    ('mjp_getPlugin',
     FunctionDecl(
         name='mjp_getPlugin',
         return_type=PointerType(
             inner_type=ValueType(name='mjpPlugin', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='name',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='slot',
                 type=PointerType(
                     inner_type=ValueType(name='int'),
                 ),
             ),
         ),
         doc='Look up a plugin by name. If slot is not NULL, also write its registered slot number into it.',  # pylint: disable=line-too-long
     )),
    ('mjp_getPluginAtSlot',
     FunctionDecl(
         name='mjp_getPluginAtSlot',
         return_type=PointerType(
             inner_type=ValueType(name='mjpPlugin', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='slot',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Look up a plugin by the registered slot number that was returned by mjp_registerPlugin.',  # pylint: disable=line-too-long
     )),
    ('mjp_defaultResourceProvider',
     FunctionDecl(
         name='mjp_defaultResourceProvider',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='provider',
                 type=PointerType(
                     inner_type=ValueType(name='mjpResourceProvider'),
                 ),
             ),
         ),
         doc='Set default resource provider definition.',
     )),
    ('mjp_registerResourceProvider',
     FunctionDecl(
         name='mjp_registerResourceProvider',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='provider',
                 type=PointerType(
                     inner_type=ValueType(name='mjpResourceProvider', is_const=True),  # pylint: disable=line-too-long
                 ),
             ),
         ),
         doc='Globally register a resource provider in a thread-safe manner. The provider must have a prefix that is not a sub-prefix or super-prefix of any current registered providers. Return a slot number >= 0 on success, -1 on failure.',  # pylint: disable=line-too-long
     )),
    ('mjp_resourceProviderCount',
     FunctionDecl(
         name='mjp_resourceProviderCount',
         return_type=ValueType(name='int'),
         parameters=(),
         doc='Return the number of globally registered resource providers.',
     )),
    ('mjp_getResourceProvider',
     FunctionDecl(
         name='mjp_getResourceProvider',
         return_type=PointerType(
             inner_type=ValueType(name='mjpResourceProvider', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='resource_name',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Return the resource provider with the prefix that matches against the resource name. If no match, return NULL.',  # pylint: disable=line-too-long
     )),
    ('mjp_getResourceProviderAtSlot',
     FunctionDecl(
         name='mjp_getResourceProviderAtSlot',
         return_type=PointerType(
             inner_type=ValueType(name='mjpResourceProvider', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='slot',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Look up a resource provider by slot number returned by mjp_registerResourceProvider. If invalid slot number, return NULL.',  # pylint: disable=line-too-long
     )),
    ('mjp_registerDecoder',
     FunctionDecl(
         name='mjp_registerDecoder',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='decoder',
                 type=PointerType(
                     inner_type=ValueType(name='mjpDecoder', is_const=True),
                 ),
             ),
         ),
         doc='Globally register a decoder. This function is thread-safe. If an identical mjpDecoder is already registered, this function does nothing. If a non-identical mjpDecoder with the same name is already registered, an mju_error is raised.',  # pylint: disable=line-too-long
     )),
    ('mjp_defaultDecoder',
     FunctionDecl(
         name='mjp_defaultDecoder',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='decoder',
                 type=PointerType(
                     inner_type=ValueType(name='mjpDecoder'),
                 ),
             ),
         ),
         doc='Set default resource decoder definition.',
     )),
    ('mjp_findDecoder',
     FunctionDecl(
         name='mjp_findDecoder',
         return_type=PointerType(
             inner_type=ValueType(name='mjpDecoder', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='resource',
                 type=PointerType(
                     inner_type=ValueType(name='mjResource', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='content_type',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Return the resource provider with the prefix that matches against the resource name. If no match, return NULL.',  # pylint: disable=line-too-long
     )),
    ('mju_openResource',
     FunctionDecl(
         name='mju_openResource',
         return_type=PointerType(
             inner_type=ValueType(name='mjResource'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='dir',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='name',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='vfs',
                 type=PointerType(
                     inner_type=ValueType(name='mjVFS', is_const=True),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='error',
                 type=PointerType(
                     inner_type=ValueType(name='char'),
                 ),
                 nullable=True,
             ),
             FunctionParameterDecl(
                 name='nerror',
                 type=ValueType(name='size_t'),
             ),
         ),
         doc="Open a resource; if the name doesn't have a prefix matching a registered resource provider, then the OS filesystem is used.",  # pylint: disable=line-too-long
     )),
    ('mju_closeResource',
     FunctionDecl(
         name='mju_closeResource',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='resource',
                 type=PointerType(
                     inner_type=ValueType(name='mjResource'),
                 ),
             ),
         ),
         doc='Close a resource; no-op if resource is NULL.',
     )),
    ('mju_readResource',
     FunctionDecl(
         name='mju_readResource',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='resource',
                 type=PointerType(
                     inner_type=ValueType(name='mjResource'),
                 ),
             ),
             FunctionParameterDecl(
                 name='buffer',
                 type=PointerType(
                     inner_type=PointerType(
                         inner_type=ValueType(name='void', is_const=True),
                     ),
                 ),
             ),
         ),
         doc='Set buffer to bytes read from the resource and return number of bytes in buffer; return negative value if error.',  # pylint: disable=line-too-long
     )),
    ('mju_getResourceDir',
     FunctionDecl(
         name='mju_getResourceDir',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='resource',
                 type=PointerType(
                     inner_type=ValueType(name='mjResource'),
                 ),
             ),
             FunctionParameterDecl(
                 name='dir',
                 type=PointerType(
                     inner_type=PointerType(
                         inner_type=ValueType(name='char', is_const=True),
                     ),
                 ),
             ),
             FunctionParameterDecl(
                 name='ndir',
                 type=PointerType(
                     inner_type=ValueType(name='int'),
                 ),
             ),
         ),
         doc='For a resource with a name partitioned as {dir}{filename}, get the dir and ndir pointers.',  # pylint: disable=line-too-long
     )),
    ('mju_isModifiedResource',
     FunctionDecl(
         name='mju_isModifiedResource',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='resource',
                 type=PointerType(
                     inner_type=ValueType(name='mjResource', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='timestamp',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Compare resource timestamp to provided timestamp. Return 0 if timestamps match, >0 if resource is newer, <0 if resource is older.',  # pylint: disable=line-too-long
     )),
    ('mju_decodeResource',
     FunctionDecl(
         name='mju_decodeResource',
         return_type=PointerType(
             inner_type=ValueType(name='mjSpec'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='resource',
                 type=PointerType(
                     inner_type=ValueType(name='mjResource'),
                 ),
             ),
             FunctionParameterDecl(
                 name='content_type',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='vfs',
                 type=PointerType(
                     inner_type=ValueType(name='mjVFS', is_const=True),
                 ),
                 nullable=True,
             ),
         ),
         doc='Find the decoder for a resource and return the decoded spec. The caller takes ownership of the spec and is responsible for cleaning it up.',  # pylint: disable=line-too-long
     )),
    ('mju_threadPoolCreate',
     FunctionDecl(
         name='mju_threadPoolCreate',
         return_type=PointerType(
             inner_type=ValueType(name='mjThreadPool'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='number_of_threads',
                 type=ValueType(name='size_t'),
             ),
         ),
         doc='Create a thread pool with the specified number of threads running.',  # pylint: disable=line-too-long
     )),
    ('mju_bindThreadPool',
     FunctionDecl(
         name='mju_bindThreadPool',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='d',
                 type=PointerType(
                     inner_type=ValueType(name='mjData'),
                 ),
             ),
             FunctionParameterDecl(
                 name='thread_pool',
                 type=PointerType(
                     inner_type=ValueType(name='void'),
                 ),
             ),
         ),
         doc='Adds a thread pool to mjData and configures it for multi-threaded use.',  # pylint: disable=line-too-long
     )),
    ('mju_threadPoolEnqueue',
     FunctionDecl(
         name='mju_threadPoolEnqueue',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='thread_pool',
                 type=PointerType(
                     inner_type=ValueType(name='mjThreadPool'),
                 ),
             ),
             FunctionParameterDecl(
                 name='task',
                 type=PointerType(
                     inner_type=ValueType(name='mjTask'),
                 ),
             ),
         ),
         doc='Enqueue a task in a thread pool.',
     )),
    ('mju_threadPoolDestroy',
     FunctionDecl(
         name='mju_threadPoolDestroy',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='thread_pool',
                 type=PointerType(
                     inner_type=ValueType(name='mjThreadPool'),
                 ),
             ),
         ),
         doc='Destroy a thread pool.',
     )),
    ('mju_defaultTask',
     FunctionDecl(
         name='mju_defaultTask',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='task',
                 type=PointerType(
                     inner_type=ValueType(name='mjTask'),
                 ),
             ),
         ),
         doc='Initialize an mjTask.',
     )),
    ('mju_taskJoin',
     FunctionDecl(
         name='mju_taskJoin',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='task',
                 type=PointerType(
                     inner_type=ValueType(name='mjTask'),
                 ),
             ),
         ),
         doc='Wait for a task to complete.',
     )),
    ('mjs_attach',
     FunctionDecl(
         name='mjs_attach',
         return_type=PointerType(
             inner_type=ValueType(name='mjsElement'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='parent',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
             FunctionParameterDecl(
                 name='child',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='prefix',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='suffix',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Attach child to a parent; return the attached element if success or NULL otherwise.',  # pylint: disable=line-too-long
     )),
    ('mjs_addBody',
     FunctionDecl(
         name='mjs_addBody',
         return_type=PointerType(
             inner_type=ValueType(name='mjsBody'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='body',
                 type=PointerType(
                     inner_type=ValueType(name='mjsBody'),
                 ),
             ),
             FunctionParameterDecl(
                 name='def',
                 type=PointerType(
                     inner_type=ValueType(name='mjsDefault', is_const=True),
                 ),
                 nullable=True,
             ),
         ),
         doc='Add child body to body; return child.',
     )),
    ('mjs_addSite',
     FunctionDecl(
         name='mjs_addSite',
         return_type=PointerType(
             inner_type=ValueType(name='mjsSite'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='body',
                 type=PointerType(
                     inner_type=ValueType(name='mjsBody'),
                 ),
             ),
             FunctionParameterDecl(
                 name='def',
                 type=PointerType(
                     inner_type=ValueType(name='mjsDefault', is_const=True),
                 ),
                 nullable=True,
             ),
         ),
         doc='Add site to body; return site spec.',
     )),
    ('mjs_addJoint',
     FunctionDecl(
         name='mjs_addJoint',
         return_type=PointerType(
             inner_type=ValueType(name='mjsJoint'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='body',
                 type=PointerType(
                     inner_type=ValueType(name='mjsBody'),
                 ),
             ),
             FunctionParameterDecl(
                 name='def',
                 type=PointerType(
                     inner_type=ValueType(name='mjsDefault', is_const=True),
                 ),
                 nullable=True,
             ),
         ),
         doc='Add joint to body.',
     )),
    ('mjs_addFreeJoint',
     FunctionDecl(
         name='mjs_addFreeJoint',
         return_type=PointerType(
             inner_type=ValueType(name='mjsJoint'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='body',
                 type=PointerType(
                     inner_type=ValueType(name='mjsBody'),
                 ),
             ),
         ),
         doc='Add freejoint to body.',
     )),
    ('mjs_addGeom',
     FunctionDecl(
         name='mjs_addGeom',
         return_type=PointerType(
             inner_type=ValueType(name='mjsGeom'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='body',
                 type=PointerType(
                     inner_type=ValueType(name='mjsBody'),
                 ),
             ),
             FunctionParameterDecl(
                 name='def',
                 type=PointerType(
                     inner_type=ValueType(name='mjsDefault', is_const=True),
                 ),
                 nullable=True,
             ),
         ),
         doc='Add geom to body.',
     )),
    ('mjs_addCamera',
     FunctionDecl(
         name='mjs_addCamera',
         return_type=PointerType(
             inner_type=ValueType(name='mjsCamera'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='body',
                 type=PointerType(
                     inner_type=ValueType(name='mjsBody'),
                 ),
             ),
             FunctionParameterDecl(
                 name='def',
                 type=PointerType(
                     inner_type=ValueType(name='mjsDefault', is_const=True),
                 ),
                 nullable=True,
             ),
         ),
         doc='Add camera to body.',
     )),
    ('mjs_addLight',
     FunctionDecl(
         name='mjs_addLight',
         return_type=PointerType(
             inner_type=ValueType(name='mjsLight'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='body',
                 type=PointerType(
                     inner_type=ValueType(name='mjsBody'),
                 ),
             ),
             FunctionParameterDecl(
                 name='def',
                 type=PointerType(
                     inner_type=ValueType(name='mjsDefault', is_const=True),
                 ),
                 nullable=True,
             ),
         ),
         doc='Add light to body.',
     )),
    ('mjs_addFrame',
     FunctionDecl(
         name='mjs_addFrame',
         return_type=PointerType(
             inner_type=ValueType(name='mjsFrame'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='body',
                 type=PointerType(
                     inner_type=ValueType(name='mjsBody'),
                 ),
             ),
             FunctionParameterDecl(
                 name='parentframe',
                 type=PointerType(
                     inner_type=ValueType(name='mjsFrame'),
                 ),
             ),
         ),
         doc='Add frame to body.',
     )),
    ('mjs_delete',
     FunctionDecl(
         name='mjs_delete',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='spec',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Remove object corresponding to the given element; return 0 on success.',  # pylint: disable=line-too-long
     )),
    ('mjs_addActuator',
     FunctionDecl(
         name='mjs_addActuator',
         return_type=PointerType(
             inner_type=ValueType(name='mjsActuator'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='def',
                 type=PointerType(
                     inner_type=ValueType(name='mjsDefault', is_const=True),
                 ),
                 nullable=True,
             ),
         ),
         doc='Add actuator.',
     )),
    ('mjs_addSensor',
     FunctionDecl(
         name='mjs_addSensor',
         return_type=PointerType(
             inner_type=ValueType(name='mjsSensor'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
         ),
         doc='Add sensor.',
     )),
    ('mjs_addFlex',
     FunctionDecl(
         name='mjs_addFlex',
         return_type=PointerType(
             inner_type=ValueType(name='mjsFlex'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
         ),
         doc='Add flex.',
     )),
    ('mjs_addPair',
     FunctionDecl(
         name='mjs_addPair',
         return_type=PointerType(
             inner_type=ValueType(name='mjsPair'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='def',
                 type=PointerType(
                     inner_type=ValueType(name='mjsDefault', is_const=True),
                 ),
                 nullable=True,
             ),
         ),
         doc='Add contact pair.',
     )),
    ('mjs_addExclude',
     FunctionDecl(
         name='mjs_addExclude',
         return_type=PointerType(
             inner_type=ValueType(name='mjsExclude'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
         ),
         doc='Add excluded body pair.',
     )),
    ('mjs_addEquality',
     FunctionDecl(
         name='mjs_addEquality',
         return_type=PointerType(
             inner_type=ValueType(name='mjsEquality'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='def',
                 type=PointerType(
                     inner_type=ValueType(name='mjsDefault', is_const=True),
                 ),
                 nullable=True,
             ),
         ),
         doc='Add equality.',
     )),
    ('mjs_addTendon',
     FunctionDecl(
         name='mjs_addTendon',
         return_type=PointerType(
             inner_type=ValueType(name='mjsTendon'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='def',
                 type=PointerType(
                     inner_type=ValueType(name='mjsDefault', is_const=True),
                 ),
                 nullable=True,
             ),
         ),
         doc='Add tendon.',
     )),
    ('mjs_wrapSite',
     FunctionDecl(
         name='mjs_wrapSite',
         return_type=PointerType(
             inner_type=ValueType(name='mjsWrap'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='tendon',
                 type=PointerType(
                     inner_type=ValueType(name='mjsTendon'),
                 ),
             ),
             FunctionParameterDecl(
                 name='name',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Wrap site using tendon.',
     )),
    ('mjs_wrapGeom',
     FunctionDecl(
         name='mjs_wrapGeom',
         return_type=PointerType(
             inner_type=ValueType(name='mjsWrap'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='tendon',
                 type=PointerType(
                     inner_type=ValueType(name='mjsTendon'),
                 ),
             ),
             FunctionParameterDecl(
                 name='name',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='sidesite',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Wrap geom using tendon.',
     )),
    ('mjs_wrapJoint',
     FunctionDecl(
         name='mjs_wrapJoint',
         return_type=PointerType(
             inner_type=ValueType(name='mjsWrap'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='tendon',
                 type=PointerType(
                     inner_type=ValueType(name='mjsTendon'),
                 ),
             ),
             FunctionParameterDecl(
                 name='name',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='coef',
                 type=ValueType(name='double'),
             ),
         ),
         doc='Wrap joint using tendon.',
     )),
    ('mjs_wrapPulley',
     FunctionDecl(
         name='mjs_wrapPulley',
         return_type=PointerType(
             inner_type=ValueType(name='mjsWrap'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='tendon',
                 type=PointerType(
                     inner_type=ValueType(name='mjsTendon'),
                 ),
             ),
             FunctionParameterDecl(
                 name='divisor',
                 type=ValueType(name='double'),
             ),
         ),
         doc='Wrap pulley using tendon.',
     )),
    ('mjs_addNumeric',
     FunctionDecl(
         name='mjs_addNumeric',
         return_type=PointerType(
             inner_type=ValueType(name='mjsNumeric'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
         ),
         doc='Add numeric.',
     )),
    ('mjs_addText',
     FunctionDecl(
         name='mjs_addText',
         return_type=PointerType(
             inner_type=ValueType(name='mjsText'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
         ),
         doc='Add text.',
     )),
    ('mjs_addTuple',
     FunctionDecl(
         name='mjs_addTuple',
         return_type=PointerType(
             inner_type=ValueType(name='mjsTuple'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
         ),
         doc='Add tuple.',
     )),
    ('mjs_addKey',
     FunctionDecl(
         name='mjs_addKey',
         return_type=PointerType(
             inner_type=ValueType(name='mjsKey'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
         ),
         doc='Add keyframe.',
     )),
    ('mjs_addPlugin',
     FunctionDecl(
         name='mjs_addPlugin',
         return_type=PointerType(
             inner_type=ValueType(name='mjsPlugin'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
         ),
         doc='Add plugin.',
     )),
    ('mjs_addDefault',
     FunctionDecl(
         name='mjs_addDefault',
         return_type=PointerType(
             inner_type=ValueType(name='mjsDefault'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='classname',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='parent',
                 type=PointerType(
                     inner_type=ValueType(name='mjsDefault', is_const=True),
                 ),
                 nullable=True,
             ),
         ),
         doc='Add default.',
     )),
    ('mjs_setToMotor',
     FunctionDecl(
         name='mjs_setToMotor',
         return_type=PointerType(
             inner_type=ValueType(name='char', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='actuator',
                 type=PointerType(
                     inner_type=ValueType(name='mjsActuator'),
                 ),
             ),
         ),
         doc='Set actuator to motor; return error if any.',
     )),
    ('mjs_setToPosition',
     FunctionDecl(
         name='mjs_setToPosition',
         return_type=PointerType(
             inner_type=ValueType(name='char', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='actuator',
                 type=PointerType(
                     inner_type=ValueType(name='mjsActuator'),
                 ),
             ),
             FunctionParameterDecl(
                 name='kp',
                 type=ValueType(name='double'),
             ),
             FunctionParameterDecl(
                 name='kv',
                 type=ArrayType(
                     inner_type=ValueType(name='double'),
                     extents=(1,),
                 ),
             ),
             FunctionParameterDecl(
                 name='dampratio',
                 type=ArrayType(
                     inner_type=ValueType(name='double'),
                     extents=(1,),
                 ),
             ),
             FunctionParameterDecl(
                 name='timeconst',
                 type=ArrayType(
                     inner_type=ValueType(name='double'),
                     extents=(1,),
                 ),
             ),
             FunctionParameterDecl(
                 name='inheritrange',
                 type=ValueType(name='double'),
             ),
         ),
         doc='Set actuator to position; return error if any.',
     )),
    ('mjs_setToIntVelocity',
     FunctionDecl(
         name='mjs_setToIntVelocity',
         return_type=PointerType(
             inner_type=ValueType(name='char', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='actuator',
                 type=PointerType(
                     inner_type=ValueType(name='mjsActuator'),
                 ),
             ),
             FunctionParameterDecl(
                 name='kp',
                 type=ValueType(name='double'),
             ),
             FunctionParameterDecl(
                 name='kv',
                 type=ArrayType(
                     inner_type=ValueType(name='double'),
                     extents=(1,),
                 ),
             ),
             FunctionParameterDecl(
                 name='dampratio',
                 type=ArrayType(
                     inner_type=ValueType(name='double'),
                     extents=(1,),
                 ),
             ),
             FunctionParameterDecl(
                 name='timeconst',
                 type=ArrayType(
                     inner_type=ValueType(name='double'),
                     extents=(1,),
                 ),
             ),
             FunctionParameterDecl(
                 name='inheritrange',
                 type=ValueType(name='double'),
             ),
         ),
         doc='Set actuator to integrated velocity; return error if any.',
     )),
    ('mjs_setToVelocity',
     FunctionDecl(
         name='mjs_setToVelocity',
         return_type=PointerType(
             inner_type=ValueType(name='char', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='actuator',
                 type=PointerType(
                     inner_type=ValueType(name='mjsActuator'),
                 ),
             ),
             FunctionParameterDecl(
                 name='kv',
                 type=ValueType(name='double'),
             ),
         ),
         doc='Set actuator to velocity servo; return error if any.',
     )),
    ('mjs_setToDamper',
     FunctionDecl(
         name='mjs_setToDamper',
         return_type=PointerType(
             inner_type=ValueType(name='char', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='actuator',
                 type=PointerType(
                     inner_type=ValueType(name='mjsActuator'),
                 ),
             ),
             FunctionParameterDecl(
                 name='kv',
                 type=ValueType(name='double'),
             ),
         ),
         doc='Set actuator to activate damper; return error if any.',
     )),
    ('mjs_setToCylinder',
     FunctionDecl(
         name='mjs_setToCylinder',
         return_type=PointerType(
             inner_type=ValueType(name='char', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='actuator',
                 type=PointerType(
                     inner_type=ValueType(name='mjsActuator'),
                 ),
             ),
             FunctionParameterDecl(
                 name='timeconst',
                 type=ValueType(name='double'),
             ),
             FunctionParameterDecl(
                 name='bias',
                 type=ValueType(name='double'),
             ),
             FunctionParameterDecl(
                 name='area',
                 type=ValueType(name='double'),
             ),
             FunctionParameterDecl(
                 name='diameter',
                 type=ValueType(name='double'),
             ),
         ),
         doc='Set actuator to hydraulic or pneumatic cylinder; return error if any.',  # pylint: disable=line-too-long
     )),
    ('mjs_setToMuscle',
     FunctionDecl(
         name='mjs_setToMuscle',
         return_type=PointerType(
             inner_type=ValueType(name='char', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='actuator',
                 type=PointerType(
                     inner_type=ValueType(name='mjsActuator'),
                 ),
             ),
             FunctionParameterDecl(
                 name='timeconst',
                 type=ArrayType(
                     inner_type=ValueType(name='double'),
                     extents=(2,),
                 ),
             ),
             FunctionParameterDecl(
                 name='tausmooth',
                 type=ValueType(name='double'),
             ),
             FunctionParameterDecl(
                 name='range',
                 type=ArrayType(
                     inner_type=ValueType(name='double'),
                     extents=(2,),
                 ),
             ),
             FunctionParameterDecl(
                 name='force',
                 type=ValueType(name='double'),
             ),
             FunctionParameterDecl(
                 name='scale',
                 type=ValueType(name='double'),
             ),
             FunctionParameterDecl(
                 name='lmin',
                 type=ValueType(name='double'),
             ),
             FunctionParameterDecl(
                 name='lmax',
                 type=ValueType(name='double'),
             ),
             FunctionParameterDecl(
                 name='vmax',
                 type=ValueType(name='double'),
             ),
             FunctionParameterDecl(
                 name='fpmax',
                 type=ValueType(name='double'),
             ),
             FunctionParameterDecl(
                 name='fvmax',
                 type=ValueType(name='double'),
             ),
         ),
         doc='Set actuator to muscle; return error if any.a',
     )),
    ('mjs_setToAdhesion',
     FunctionDecl(
         name='mjs_setToAdhesion',
         return_type=PointerType(
             inner_type=ValueType(name='char', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='actuator',
                 type=PointerType(
                     inner_type=ValueType(name='mjsActuator'),
                 ),
             ),
             FunctionParameterDecl(
                 name='gain',
                 type=ValueType(name='double'),
             ),
         ),
         doc='Set actuator to active adhesion; return error if any.',
     )),
    ('mjs_addMesh',
     FunctionDecl(
         name='mjs_addMesh',
         return_type=PointerType(
             inner_type=ValueType(name='mjsMesh'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='def',
                 type=PointerType(
                     inner_type=ValueType(name='mjsDefault', is_const=True),
                 ),
                 nullable=True,
             ),
         ),
         doc='Add mesh.',
     )),
    ('mjs_addHField',
     FunctionDecl(
         name='mjs_addHField',
         return_type=PointerType(
             inner_type=ValueType(name='mjsHField'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
         ),
         doc='Add height field.',
     )),
    ('mjs_addSkin',
     FunctionDecl(
         name='mjs_addSkin',
         return_type=PointerType(
             inner_type=ValueType(name='mjsSkin'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
         ),
         doc='Add skin.',
     )),
    ('mjs_addTexture',
     FunctionDecl(
         name='mjs_addTexture',
         return_type=PointerType(
             inner_type=ValueType(name='mjsTexture'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
         ),
         doc='Add texture.',
     )),
    ('mjs_addMaterial',
     FunctionDecl(
         name='mjs_addMaterial',
         return_type=PointerType(
             inner_type=ValueType(name='mjsMaterial'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='def',
                 type=PointerType(
                     inner_type=ValueType(name='mjsDefault', is_const=True),
                 ),
                 nullable=True,
             ),
         ),
         doc='Add material.',
     )),
    ('mjs_makeMesh',
     FunctionDecl(
         name='mjs_makeMesh',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='mesh',
                 type=PointerType(
                     inner_type=ValueType(name='mjsMesh'),
                 ),
             ),
             FunctionParameterDecl(
                 name='builtin',
                 type=ValueType(name='mjtMeshBuiltin'),
             ),
             FunctionParameterDecl(
                 name='params',
                 type=PointerType(
                     inner_type=ValueType(name='double'),
                 ),
             ),
             FunctionParameterDecl(
                 name='nparams',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Sets the vertices and normals of a mesh.',
     )),
    ('mjs_getSpec',
     FunctionDecl(
         name='mjs_getSpec',
         return_type=PointerType(
             inner_type=ValueType(name='mjSpec'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Get spec from body.',
     )),
    ('mjs_findSpec',
     FunctionDecl(
         name='mjs_findSpec',
         return_type=PointerType(
             inner_type=ValueType(name='mjSpec'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='spec',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='name',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Find spec (model asset) by name.',
     )),
    ('mjs_findBody',
     FunctionDecl(
         name='mjs_findBody',
         return_type=PointerType(
             inner_type=ValueType(name='mjsBody'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='name',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Find body in spec by name.',
     )),
    ('mjs_findElement',
     FunctionDecl(
         name='mjs_findElement',
         return_type=PointerType(
             inner_type=ValueType(name='mjsElement'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='type',
                 type=ValueType(name='mjtObj'),
             ),
             FunctionParameterDecl(
                 name='name',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Find element in spec by name.',
     )),
    ('mjs_findChild',
     FunctionDecl(
         name='mjs_findChild',
         return_type=PointerType(
             inner_type=ValueType(name='mjsBody'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='body',
                 type=PointerType(
                     inner_type=ValueType(name='mjsBody'),
                 ),
             ),
             FunctionParameterDecl(
                 name='name',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Find child body by name.',
     )),
    ('mjs_getParent',
     FunctionDecl(
         name='mjs_getParent',
         return_type=PointerType(
             inner_type=ValueType(name='mjsBody'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Get parent body.',
     )),
    ('mjs_getFrame',
     FunctionDecl(
         name='mjs_getFrame',
         return_type=PointerType(
             inner_type=ValueType(name='mjsFrame'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Get parent frame.',
     )),
    ('mjs_findFrame',
     FunctionDecl(
         name='mjs_findFrame',
         return_type=PointerType(
             inner_type=ValueType(name='mjsFrame'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='name',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Find frame by name.',
     )),
    ('mjs_getDefault',
     FunctionDecl(
         name='mjs_getDefault',
         return_type=PointerType(
             inner_type=ValueType(name='mjsDefault'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Get default corresponding to an element.',
     )),
    ('mjs_findDefault',
     FunctionDecl(
         name='mjs_findDefault',
         return_type=PointerType(
             inner_type=ValueType(name='mjsDefault'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='classname',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Find default in model by class name.',
     )),
    ('mjs_getSpecDefault',
     FunctionDecl(
         name='mjs_getSpecDefault',
         return_type=PointerType(
             inner_type=ValueType(name='mjsDefault'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
         ),
         doc='Get global default from model.',
     )),
    ('mjs_getId',
     FunctionDecl(
         name='mjs_getId',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Get element id.',
     )),
    ('mjs_firstChild',
     FunctionDecl(
         name='mjs_firstChild',
         return_type=PointerType(
             inner_type=ValueType(name='mjsElement'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='body',
                 type=PointerType(
                     inner_type=ValueType(name='mjsBody'),
                 ),
             ),
             FunctionParameterDecl(
                 name='type',
                 type=ValueType(name='mjtObj'),
             ),
             FunctionParameterDecl(
                 name='recurse',
                 type=ValueType(name='int'),
             ),
         ),
         doc="Return body's first child of given type. If recurse is nonzero, also search the body's subtree.",  # pylint: disable=line-too-long
     )),
    ('mjs_nextChild',
     FunctionDecl(
         name='mjs_nextChild',
         return_type=PointerType(
             inner_type=ValueType(name='mjsElement'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='body',
                 type=PointerType(
                     inner_type=ValueType(name='mjsBody'),
                 ),
             ),
             FunctionParameterDecl(
                 name='child',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
             FunctionParameterDecl(
                 name='recurse',
                 type=ValueType(name='int'),
             ),
         ),
         doc="Return body's next child of the same type; return NULL if child is last. If recurse is nonzero, also search the body's subtree.",  # pylint: disable=line-too-long
     )),
    ('mjs_firstElement',
     FunctionDecl(
         name='mjs_firstElement',
         return_type=PointerType(
             inner_type=ValueType(name='mjsElement'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='type',
                 type=ValueType(name='mjtObj'),
             ),
         ),
         doc="Return spec's first element of selected type.",
     )),
    ('mjs_nextElement',
     FunctionDecl(
         name='mjs_nextElement',
         return_type=PointerType(
             inner_type=ValueType(name='mjsElement'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='s',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc="Return spec's next element; return NULL if element is last.",
     )),
    ('mjs_getWrapTarget',
     FunctionDecl(
         name='mjs_getWrapTarget',
         return_type=PointerType(
             inner_type=ValueType(name='mjsElement'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='wrap',
                 type=PointerType(
                     inner_type=ValueType(name='mjsWrap'),
                 ),
             ),
         ),
         doc='Get wrapped element in tendon path.',
     )),
    ('mjs_getWrapSideSite',
     FunctionDecl(
         name='mjs_getWrapSideSite',
         return_type=PointerType(
             inner_type=ValueType(name='mjsSite'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='wrap',
                 type=PointerType(
                     inner_type=ValueType(name='mjsWrap'),
                 ),
             ),
         ),
         doc='Get wrapped element side site in tendon path if it has one, nullptr otherwise.',  # pylint: disable=line-too-long
     )),
    ('mjs_getWrapDivisor',
     FunctionDecl(
         name='mjs_getWrapDivisor',
         return_type=ValueType(name='double'),
         parameters=(
             FunctionParameterDecl(
                 name='wrap',
                 type=PointerType(
                     inner_type=ValueType(name='mjsWrap'),
                 ),
             ),
         ),
         doc='Get divisor of mjsWrap wrapping a puller.',
     )),
    ('mjs_getWrapCoef',
     FunctionDecl(
         name='mjs_getWrapCoef',
         return_type=ValueType(name='double'),
         parameters=(
             FunctionParameterDecl(
                 name='wrap',
                 type=PointerType(
                     inner_type=ValueType(name='mjsWrap'),
                 ),
             ),
         ),
         doc='Get coefficient of mjsWrap wrapping a joint.',
     )),
    ('mjs_setName',
     FunctionDecl(
         name='mjs_setName',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
             FunctionParameterDecl(
                 name='name',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc="Set element's name; return 0 on success.",
     )),
    ('mjs_setBuffer',
     FunctionDecl(
         name='mjs_setBuffer',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='dest',
                 type=PointerType(
                     inner_type=ValueType(name='mjByteVec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='array',
                 type=PointerType(
                     inner_type=ValueType(name='void', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='size',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Copy buffer.',
     )),
    ('mjs_setString',
     FunctionDecl(
         name='mjs_setString',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='dest',
                 type=PointerType(
                     inner_type=ValueType(name='mjString'),
                 ),
             ),
             FunctionParameterDecl(
                 name='text',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Copy text to string.',
     )),
    ('mjs_setStringVec',
     FunctionDecl(
         name='mjs_setStringVec',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='dest',
                 type=PointerType(
                     inner_type=ValueType(name='mjStringVec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='text',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Split text to entries and copy to string vector.',
     )),
    ('mjs_setInStringVec',
     FunctionDecl(
         name='mjs_setInStringVec',
         return_type=ValueType(name='mjtByte'),
         parameters=(
             FunctionParameterDecl(
                 name='dest',
                 type=PointerType(
                     inner_type=ValueType(name='mjStringVec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='i',
                 type=ValueType(name='int'),
             ),
             FunctionParameterDecl(
                 name='text',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Set entry in string vector.',
     )),
    ('mjs_appendString',
     FunctionDecl(
         name='mjs_appendString',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='dest',
                 type=PointerType(
                     inner_type=ValueType(name='mjStringVec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='text',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Append text entry to string vector.',
     )),
    ('mjs_setInt',
     FunctionDecl(
         name='mjs_setInt',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='dest',
                 type=PointerType(
                     inner_type=ValueType(name='mjIntVec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='array',
                 type=PointerType(
                     inner_type=ValueType(name='int', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='size',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Copy int array to vector.',
     )),
    ('mjs_appendIntVec',
     FunctionDecl(
         name='mjs_appendIntVec',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='dest',
                 type=PointerType(
                     inner_type=ValueType(name='mjIntVecVec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='array',
                 type=PointerType(
                     inner_type=ValueType(name='int', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='size',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Append int array to vector of arrays.',
     )),
    ('mjs_setFloat',
     FunctionDecl(
         name='mjs_setFloat',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='dest',
                 type=PointerType(
                     inner_type=ValueType(name='mjFloatVec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='array',
                 type=PointerType(
                     inner_type=ValueType(name='float', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='size',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Copy float array to vector.',
     )),
    ('mjs_appendFloatVec',
     FunctionDecl(
         name='mjs_appendFloatVec',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='dest',
                 type=PointerType(
                     inner_type=ValueType(name='mjFloatVecVec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='array',
                 type=PointerType(
                     inner_type=ValueType(name='float', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='size',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Append float array to vector of arrays.',
     )),
    ('mjs_setDouble',
     FunctionDecl(
         name='mjs_setDouble',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='dest',
                 type=PointerType(
                     inner_type=ValueType(name='mjDoubleVec'),
                 ),
             ),
             FunctionParameterDecl(
                 name='array',
                 type=PointerType(
                     inner_type=ValueType(name='double', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='size',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Copy double array to vector.',
     )),
    ('mjs_setPluginAttributes',
     FunctionDecl(
         name='mjs_setPluginAttributes',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='plugin',
                 type=PointerType(
                     inner_type=ValueType(name='mjsPlugin'),
                 ),
             ),
             FunctionParameterDecl(
                 name='attributes',
                 type=PointerType(
                     inner_type=ValueType(name='void'),
                 ),
             ),
         ),
         doc='Set plugin attributes.',
     )),
    ('mjs_getName',
     FunctionDecl(
         name='mjs_getName',
         return_type=PointerType(
             inner_type=ValueType(name='mjString'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc="Get element's name.",
     )),
    ('mjs_getString',
     FunctionDecl(
         name='mjs_getString',
         return_type=PointerType(
             inner_type=ValueType(name='char', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='source',
                 type=PointerType(
                     inner_type=ValueType(name='mjString', is_const=True),
                 ),
             ),
         ),
         doc='Get string contents.',
     )),
    ('mjs_getDouble',
     FunctionDecl(
         name='mjs_getDouble',
         return_type=PointerType(
             inner_type=ValueType(name='double', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='source',
                 type=PointerType(
                     inner_type=ValueType(name='mjDoubleVec', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='size',
                 type=PointerType(
                     inner_type=ValueType(name='int'),
                 ),
                 nullable=True,
             ),
         ),
         doc='Get double array contents and optionally its size.',
     )),
    ('mjs_getWrapNum',
     FunctionDecl(
         name='mjs_getWrapNum',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='tendonspec',
                 type=PointerType(
                     inner_type=ValueType(name='mjsTendon', is_const=True),
                 ),
             ),
         ),
         doc='Get number of elements a tendon wraps.',
     )),
    ('mjs_getWrap',
     FunctionDecl(
         name='mjs_getWrap',
         return_type=PointerType(
             inner_type=ValueType(name='mjsWrap'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='tendonspec',
                 type=PointerType(
                     inner_type=ValueType(name='mjsTendon', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='i',
                 type=ValueType(name='int'),
             ),
         ),
         doc='Get mjsWrap element at position i in the tendon path.',
     )),
    ('mjs_getPluginAttributes',
     FunctionDecl(
         name='mjs_getPluginAttributes',
         return_type=PointerType(
             inner_type=ValueType(name='void', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='plugin',
                 type=PointerType(
                     inner_type=ValueType(name='mjsPlugin', is_const=True),
                 ),
             ),
         ),
         doc='Get plugin attributes.',
     )),
    ('mjs_setDefault',
     FunctionDecl(
         name='mjs_setDefault',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
             FunctionParameterDecl(
                 name='def',
                 type=PointerType(
                     inner_type=ValueType(name='mjsDefault', is_const=True),
                 ),
             ),
         ),
         doc="Set element's default.",
     )),
    ('mjs_setFrame',
     FunctionDecl(
         name='mjs_setFrame',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='dest',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
             FunctionParameterDecl(
                 name='frame',
                 type=PointerType(
                     inner_type=ValueType(name='mjsFrame'),
                 ),
             ),
         ),
         doc="Set element's enclosing frame; return 0 on success.",
     )),
    ('mjs_resolveOrientation',
     FunctionDecl(
         name='mjs_resolveOrientation',
         return_type=PointerType(
             inner_type=ValueType(name='char', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='quat',
                 type=ArrayType(
                     inner_type=ValueType(name='double'),
                     extents=(4,),
                 ),
             ),
             FunctionParameterDecl(
                 name='degree',
                 type=ValueType(name='mjtByte'),
             ),
             FunctionParameterDecl(
                 name='sequence',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='orientation',
                 type=PointerType(
                     inner_type=ValueType(name='mjsOrientation', is_const=True),
                 ),
             ),
         ),
         doc='Resolve alternative orientations to quat; return error if any.',
     )),
    ('mjs_bodyToFrame',
     FunctionDecl(
         name='mjs_bodyToFrame',
         return_type=PointerType(
             inner_type=ValueType(name='mjsFrame'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='body',
                 type=PointerType(
                     inner_type=PointerType(
                         inner_type=ValueType(name='mjsBody'),
                     ),
                 ),
             ),
         ),
         doc='Transform body into a frame.',
     )),
    ('mjs_setUserValue',
     FunctionDecl(
         name='mjs_setUserValue',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
             FunctionParameterDecl(
                 name='key',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
             FunctionParameterDecl(
                 name='data',
                 type=PointerType(
                     inner_type=ValueType(name='void', is_const=True),
                 ),
             ),
         ),
         doc='Set user payload, overriding the existing value for the specified key if present.',  # pylint: disable=line-too-long
     )),
    ('mjs_getUserValue',
     FunctionDecl(
         name='mjs_getUserValue',
         return_type=PointerType(
             inner_type=ValueType(name='void', is_const=True),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
             FunctionParameterDecl(
                 name='key',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Return user payload or NULL if none found.',
     )),
    ('mjs_deleteUserValue',
     FunctionDecl(
         name='mjs_deleteUserValue',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
             FunctionParameterDecl(
                 name='key',
                 type=PointerType(
                     inner_type=ValueType(name='char', is_const=True),
                 ),
             ),
         ),
         doc='Delete user payload.',
     )),
    ('mjs_sensorDim',
     FunctionDecl(
         name='mjs_sensorDim',
         return_type=ValueType(name='int'),
         parameters=(
             FunctionParameterDecl(
                 name='sensor',
                 type=PointerType(
                     inner_type=ValueType(name='mjsSensor', is_const=True),
                 ),
             ),
         ),
         doc='Return sensor dimension.',
     )),
    ('mjs_defaultSpec',
     FunctionDecl(
         name='mjs_defaultSpec',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='spec',
                 type=PointerType(
                     inner_type=ValueType(name='mjSpec'),
                 ),
             ),
         ),
         doc='Default spec attributes.',
     )),
    ('mjs_defaultOrientation',
     FunctionDecl(
         name='mjs_defaultOrientation',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='orient',
                 type=PointerType(
                     inner_type=ValueType(name='mjsOrientation'),
                 ),
             ),
         ),
         doc='Default orientation attributes.',
     )),
    ('mjs_defaultBody',
     FunctionDecl(
         name='mjs_defaultBody',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='body',
                 type=PointerType(
                     inner_type=ValueType(name='mjsBody'),
                 ),
             ),
         ),
         doc='Default body attributes.',
     )),
    ('mjs_defaultFrame',
     FunctionDecl(
         name='mjs_defaultFrame',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='frame',
                 type=PointerType(
                     inner_type=ValueType(name='mjsFrame'),
                 ),
             ),
         ),
         doc='Default frame attributes.',
     )),
    ('mjs_defaultJoint',
     FunctionDecl(
         name='mjs_defaultJoint',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='joint',
                 type=PointerType(
                     inner_type=ValueType(name='mjsJoint'),
                 ),
             ),
         ),
         doc='Default joint attributes.',
     )),
    ('mjs_defaultGeom',
     FunctionDecl(
         name='mjs_defaultGeom',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='geom',
                 type=PointerType(
                     inner_type=ValueType(name='mjsGeom'),
                 ),
             ),
         ),
         doc='Default geom attributes.',
     )),
    ('mjs_defaultSite',
     FunctionDecl(
         name='mjs_defaultSite',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='site',
                 type=PointerType(
                     inner_type=ValueType(name='mjsSite'),
                 ),
             ),
         ),
         doc='Default site attributes.',
     )),
    ('mjs_defaultCamera',
     FunctionDecl(
         name='mjs_defaultCamera',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='camera',
                 type=PointerType(
                     inner_type=ValueType(name='mjsCamera'),
                 ),
             ),
         ),
         doc='Default camera attributes.',
     )),
    ('mjs_defaultLight',
     FunctionDecl(
         name='mjs_defaultLight',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='light',
                 type=PointerType(
                     inner_type=ValueType(name='mjsLight'),
                 ),
             ),
         ),
         doc='Default light attributes.',
     )),
    ('mjs_defaultFlex',
     FunctionDecl(
         name='mjs_defaultFlex',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='flex',
                 type=PointerType(
                     inner_type=ValueType(name='mjsFlex'),
                 ),
             ),
         ),
         doc='Default flex attributes.',
     )),
    ('mjs_defaultMesh',
     FunctionDecl(
         name='mjs_defaultMesh',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='mesh',
                 type=PointerType(
                     inner_type=ValueType(name='mjsMesh'),
                 ),
             ),
         ),
         doc='Default mesh attributes.',
     )),
    ('mjs_defaultHField',
     FunctionDecl(
         name='mjs_defaultHField',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='hfield',
                 type=PointerType(
                     inner_type=ValueType(name='mjsHField'),
                 ),
             ),
         ),
         doc='Default height field attributes.',
     )),
    ('mjs_defaultSkin',
     FunctionDecl(
         name='mjs_defaultSkin',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='skin',
                 type=PointerType(
                     inner_type=ValueType(name='mjsSkin'),
                 ),
             ),
         ),
         doc='Default skin attributes.',
     )),
    ('mjs_defaultTexture',
     FunctionDecl(
         name='mjs_defaultTexture',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='texture',
                 type=PointerType(
                     inner_type=ValueType(name='mjsTexture'),
                 ),
             ),
         ),
         doc='Default texture attributes.',
     )),
    ('mjs_defaultMaterial',
     FunctionDecl(
         name='mjs_defaultMaterial',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='material',
                 type=PointerType(
                     inner_type=ValueType(name='mjsMaterial'),
                 ),
             ),
         ),
         doc='Default material attributes.',
     )),
    ('mjs_defaultPair',
     FunctionDecl(
         name='mjs_defaultPair',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='pair',
                 type=PointerType(
                     inner_type=ValueType(name='mjsPair'),
                 ),
             ),
         ),
         doc='Default pair attributes.',
     )),
    ('mjs_defaultEquality',
     FunctionDecl(
         name='mjs_defaultEquality',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='equality',
                 type=PointerType(
                     inner_type=ValueType(name='mjsEquality'),
                 ),
             ),
         ),
         doc='Default equality attributes.',
     )),
    ('mjs_defaultTendon',
     FunctionDecl(
         name='mjs_defaultTendon',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='tendon',
                 type=PointerType(
                     inner_type=ValueType(name='mjsTendon'),
                 ),
             ),
         ),
         doc='Default tendon attributes.',
     )),
    ('mjs_defaultActuator',
     FunctionDecl(
         name='mjs_defaultActuator',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='actuator',
                 type=PointerType(
                     inner_type=ValueType(name='mjsActuator'),
                 ),
             ),
         ),
         doc='Default actuator attributes.',
     )),
    ('mjs_defaultSensor',
     FunctionDecl(
         name='mjs_defaultSensor',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='sensor',
                 type=PointerType(
                     inner_type=ValueType(name='mjsSensor'),
                 ),
             ),
         ),
         doc='Default sensor attributes.',
     )),
    ('mjs_defaultNumeric',
     FunctionDecl(
         name='mjs_defaultNumeric',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='numeric',
                 type=PointerType(
                     inner_type=ValueType(name='mjsNumeric'),
                 ),
             ),
         ),
         doc='Default numeric attributes.',
     )),
    ('mjs_defaultText',
     FunctionDecl(
         name='mjs_defaultText',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='text',
                 type=PointerType(
                     inner_type=ValueType(name='mjsText'),
                 ),
             ),
         ),
         doc='Default text attributes.',
     )),
    ('mjs_defaultTuple',
     FunctionDecl(
         name='mjs_defaultTuple',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='tuple',
                 type=PointerType(
                     inner_type=ValueType(name='mjsTuple'),
                 ),
             ),
         ),
         doc='Default tuple attributes.',
     )),
    ('mjs_defaultKey',
     FunctionDecl(
         name='mjs_defaultKey',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='key',
                 type=PointerType(
                     inner_type=ValueType(name='mjsKey'),
                 ),
             ),
         ),
         doc='Default keyframe attributes.',
     )),
    ('mjs_defaultPlugin',
     FunctionDecl(
         name='mjs_defaultPlugin',
         return_type=ValueType(name='void'),
         parameters=(
             FunctionParameterDecl(
                 name='plugin',
                 type=PointerType(
                     inner_type=ValueType(name='mjsPlugin'),
                 ),
             ),
         ),
         doc='Default plugin attributes.',
     )),
    ('mjs_asBody',
     FunctionDecl(
         name='mjs_asBody',
         return_type=PointerType(
             inner_type=ValueType(name='mjsBody'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsBody, or return NULL if the element is not an mjsBody.',  # pylint: disable=line-too-long
     )),
    ('mjs_asGeom',
     FunctionDecl(
         name='mjs_asGeom',
         return_type=PointerType(
             inner_type=ValueType(name='mjsGeom'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsGeom, or return NULL if the element is not an mjsGeom.',  # pylint: disable=line-too-long
     )),
    ('mjs_asJoint',
     FunctionDecl(
         name='mjs_asJoint',
         return_type=PointerType(
             inner_type=ValueType(name='mjsJoint'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsJoint, or return NULL if the element is not an mjsJoint.',  # pylint: disable=line-too-long
     )),
    ('mjs_asSite',
     FunctionDecl(
         name='mjs_asSite',
         return_type=PointerType(
             inner_type=ValueType(name='mjsSite'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsSite, or return NULL if the element is not an mjsSite.',  # pylint: disable=line-too-long
     )),
    ('mjs_asCamera',
     FunctionDecl(
         name='mjs_asCamera',
         return_type=PointerType(
             inner_type=ValueType(name='mjsCamera'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsCamera, or return NULL if the element is not an mjsCamera.',  # pylint: disable=line-too-long
     )),
    ('mjs_asLight',
     FunctionDecl(
         name='mjs_asLight',
         return_type=PointerType(
             inner_type=ValueType(name='mjsLight'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsLight, or return NULL if the element is not an mjsLight.',  # pylint: disable=line-too-long
     )),
    ('mjs_asFrame',
     FunctionDecl(
         name='mjs_asFrame',
         return_type=PointerType(
             inner_type=ValueType(name='mjsFrame'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsFrame, or return NULL if the element is not an mjsFrame.',  # pylint: disable=line-too-long
     )),
    ('mjs_asActuator',
     FunctionDecl(
         name='mjs_asActuator',
         return_type=PointerType(
             inner_type=ValueType(name='mjsActuator'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsActuator, or return NULL if the element is not an mjsActuator.',  # pylint: disable=line-too-long
     )),
    ('mjs_asSensor',
     FunctionDecl(
         name='mjs_asSensor',
         return_type=PointerType(
             inner_type=ValueType(name='mjsSensor'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsSensor, or return NULL if the element is not an mjsSensor.',  # pylint: disable=line-too-long
     )),
    ('mjs_asFlex',
     FunctionDecl(
         name='mjs_asFlex',
         return_type=PointerType(
             inner_type=ValueType(name='mjsFlex'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsFlex, or return NULL if the element is not an mjsFlex.',  # pylint: disable=line-too-long
     )),
    ('mjs_asPair',
     FunctionDecl(
         name='mjs_asPair',
         return_type=PointerType(
             inner_type=ValueType(name='mjsPair'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsPair, or return NULL if the element is not an mjsPair.',  # pylint: disable=line-too-long
     )),
    ('mjs_asEquality',
     FunctionDecl(
         name='mjs_asEquality',
         return_type=PointerType(
             inner_type=ValueType(name='mjsEquality'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsEquality, or return NULL if the element is not an mjsEquality.',  # pylint: disable=line-too-long
     )),
    ('mjs_asExclude',
     FunctionDecl(
         name='mjs_asExclude',
         return_type=PointerType(
             inner_type=ValueType(name='mjsExclude'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsExclude, or return NULL if the element is not an mjsExclude.',  # pylint: disable=line-too-long
     )),
    ('mjs_asTendon',
     FunctionDecl(
         name='mjs_asTendon',
         return_type=PointerType(
             inner_type=ValueType(name='mjsTendon'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsTendon, or return NULL if the element is not an mjsTendon.',  # pylint: disable=line-too-long
     )),
    ('mjs_asNumeric',
     FunctionDecl(
         name='mjs_asNumeric',
         return_type=PointerType(
             inner_type=ValueType(name='mjsNumeric'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsNumeric, or return NULL if the element is not an mjsNumeric.',  # pylint: disable=line-too-long
     )),
    ('mjs_asText',
     FunctionDecl(
         name='mjs_asText',
         return_type=PointerType(
             inner_type=ValueType(name='mjsText'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsText, or return NULL if the element is not an mjsText.',  # pylint: disable=line-too-long
     )),
    ('mjs_asTuple',
     FunctionDecl(
         name='mjs_asTuple',
         return_type=PointerType(
             inner_type=ValueType(name='mjsTuple'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsTuple, or return NULL if the element is not an mjsTuple.',  # pylint: disable=line-too-long
     )),
    ('mjs_asKey',
     FunctionDecl(
         name='mjs_asKey',
         return_type=PointerType(
             inner_type=ValueType(name='mjsKey'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsKey, or return NULL if the element is not an mjsKey.',  # pylint: disable=line-too-long
     )),
    ('mjs_asMesh',
     FunctionDecl(
         name='mjs_asMesh',
         return_type=PointerType(
             inner_type=ValueType(name='mjsMesh'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsMesh, or return NULL if the element is not an mjsMesh.',  # pylint: disable=line-too-long
     )),
    ('mjs_asHField',
     FunctionDecl(
         name='mjs_asHField',
         return_type=PointerType(
             inner_type=ValueType(name='mjsHField'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsHField, or return NULL if the element is not an mjsHField.',  # pylint: disable=line-too-long
     )),
    ('mjs_asSkin',
     FunctionDecl(
         name='mjs_asSkin',
         return_type=PointerType(
             inner_type=ValueType(name='mjsSkin'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsSkin, or return NULL if the element is not an mjsSkin.',  # pylint: disable=line-too-long
     )),
    ('mjs_asTexture',
     FunctionDecl(
         name='mjs_asTexture',
         return_type=PointerType(
             inner_type=ValueType(name='mjsTexture'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsTexture, or return NULL if the element is not an mjsTexture.',  # pylint: disable=line-too-long
     )),
    ('mjs_asMaterial',
     FunctionDecl(
         name='mjs_asMaterial',
         return_type=PointerType(
             inner_type=ValueType(name='mjsMaterial'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsMaterial, or return NULL if the element is not an mjsMaterial.',  # pylint: disable=line-too-long
     )),
    ('mjs_asPlugin',
     FunctionDecl(
         name='mjs_asPlugin',
         return_type=PointerType(
             inner_type=ValueType(name='mjsPlugin'),
         ),
         parameters=(
             FunctionParameterDecl(
                 name='element',
                 type=PointerType(
                     inner_type=ValueType(name='mjsElement'),
                 ),
             ),
         ),
         doc='Safely cast an element as mjsPlugin, or return NULL if the element is not an mjsPlugin.',  # pylint: disable=line-too-long
     )),
])
