"use strict";
// THIS FILE IS AUTOMATICALLY GENERATED BY make-ts-wrapper.ts
// DO NOT EDIT IT BY HAND
Object.defineProperty(exports, "__esModule", { value: true });
exports.init = init;
async function init(initModule) {
    let Mod = await initModule();
    // this works for both signed and unsigned, because JS will wrap for you when constructing the Uint32Array
    function intArrayToByteArr(ints) {
        return new Uint8Array(new Uint32Array(ints).buffer);
    }
    function boolArrayToByteArr(bools) {
        return bools.map((b) => (b ? 1 : 0));
    }
    function readUintArray(address, count) {
        return Array.from(new Uint32Array(Mod.HEAPU32.buffer, address, count));
    }
    let outAddress = Mod._malloc(24);
    let outUintArray = new Uint32Array(Mod.HEAPU32.buffer, outAddress, 4);
    let getOutUint = (i) => outUintArray[i];
    let outIntArray = new Int32Array(Mod.HEAPU32.buffer, outAddress, 4);
    let getOutInt = (i) => outIntArray[i];
    let outUint64Array = new BigUint64Array(Mod.HEAPU32.buffer, outAddress, 2);
    let getOutUint64 = (i) => outUint64Array[i];
    let outInt64Array = new BigInt64Array(Mod.HEAPU32.buffer, outAddress, 2);
    let getOutInt64 = (i) => outInt64Array[i];
    return {
        em: Mod,
        Z3: {
            mk_context: function (c) {
                let ctx = Mod._Z3_mk_context(c);
                Mod._set_noop_error_handler(ctx);
                return ctx;
            },
            mk_context_rc: function (c) {
                let ctx = Mod._Z3_mk_context_rc(c);
                Mod._set_noop_error_handler(ctx);
                return ctx;
            },
            global_param_set: function (param_id, param_value) {
                return Mod.ccall('Z3_global_param_set', 'void', ['string', 'string'], [param_id, param_value]);
            },
            global_param_reset_all: Mod._Z3_global_param_reset_all,
            global_param_get: function (param_id) {
                let ret = Mod.ccall('Z3_global_param_get', 'boolean', ['string', 'number'], [param_id, outAddress]);
                if (!ret) {
                    return null;
                }
                return Mod.UTF8ToString(getOutUint(0));
            },
            mk_config: Mod._Z3_mk_config,
            del_config: Mod._Z3_del_config,
            set_param_value: function (c, param_id, param_value) {
                return Mod.ccall('Z3_set_param_value', 'void', ['number', 'string', 'string'], [c, param_id, param_value]);
            },
            del_context: Mod._Z3_del_context,
            inc_ref: Mod._Z3_inc_ref,
            dec_ref: Mod._Z3_dec_ref,
            update_param_value: function (c, param_id, param_value) {
                return Mod.ccall('Z3_update_param_value', 'void', ['number', 'string', 'string'], [c, param_id, param_value]);
            },
            get_global_param_descrs: Mod._Z3_get_global_param_descrs,
            interrupt: Mod._Z3_interrupt,
            enable_concurrent_dec_ref: Mod._Z3_enable_concurrent_dec_ref,
            mk_params: Mod._Z3_mk_params,
            params_inc_ref: Mod._Z3_params_inc_ref,
            params_dec_ref: Mod._Z3_params_dec_ref,
            params_set_bool: Mod._Z3_params_set_bool,
            params_set_uint: Mod._Z3_params_set_uint,
            params_set_double: Mod._Z3_params_set_double,
            params_set_symbol: Mod._Z3_params_set_symbol,
            params_to_string: function (c, p) {
                return Mod.ccall('Z3_params_to_string', 'string', ['number', 'number'], [c, p]);
            },
            params_validate: Mod._Z3_params_validate,
            param_descrs_inc_ref: Mod._Z3_param_descrs_inc_ref,
            param_descrs_dec_ref: Mod._Z3_param_descrs_dec_ref,
            param_descrs_get_kind: Mod._Z3_param_descrs_get_kind,
            param_descrs_size: function (c, p) {
                let ret = Mod.ccall('Z3_param_descrs_size', 'number', ['number', 'number'], [c, p]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            param_descrs_get_name: Mod._Z3_param_descrs_get_name,
            param_descrs_get_documentation: function (c, p, s) {
                return Mod.ccall('Z3_param_descrs_get_documentation', 'string', ['number', 'number', 'number'], [c, p, s]);
            },
            param_descrs_to_string: function (c, p) {
                return Mod.ccall('Z3_param_descrs_to_string', 'string', ['number', 'number'], [c, p]);
            },
            mk_int_symbol: Mod._Z3_mk_int_symbol,
            mk_string_symbol: function (c, s) {
                return Mod.ccall('Z3_mk_string_symbol', 'number', ['number', 'string'], [c, s]);
            },
            mk_uninterpreted_sort: Mod._Z3_mk_uninterpreted_sort,
            mk_type_variable: Mod._Z3_mk_type_variable,
            mk_bool_sort: Mod._Z3_mk_bool_sort,
            mk_int_sort: Mod._Z3_mk_int_sort,
            mk_real_sort: Mod._Z3_mk_real_sort,
            mk_bv_sort: Mod._Z3_mk_bv_sort,
            mk_finite_domain_sort: Mod._Z3_mk_finite_domain_sort,
            mk_array_sort: Mod._Z3_mk_array_sort,
            mk_array_sort_n: function (c, domain, range) {
                return Mod.ccall('Z3_mk_array_sort_n', 'number', ['number', 'number', 'array', 'number'], [
                    c,
                    domain.length,
                    intArrayToByteArr(domain),
                    range,
                ]);
            },
            mk_tuple_sort: function (c, mk_tuple_name, field_names, field_sorts) {
                if (field_names.length !== field_sorts.length) {
                    throw new TypeError(`field_names and field_sorts must be the same length (got ${field_names.length} and {field_sorts.length})`);
                }
                let outArray_proj_decl = Mod._malloc(4 * field_names.length);
                try {
                    let ret = Mod.ccall('Z3_mk_tuple_sort', 'number', [
                        'number',
                        'number',
                        'number',
                        'array',
                        'array',
                        'number',
                        'number',
                    ], [
                        c,
                        mk_tuple_name,
                        field_names.length,
                        intArrayToByteArr(field_names),
                        intArrayToByteArr(field_sorts),
                        outAddress,
                        outArray_proj_decl,
                    ]);
                    return {
                        rv: ret,
                        mk_tuple_decl: getOutUint(0),
                        proj_decl: readUintArray(outArray_proj_decl, field_names.length),
                    };
                }
                finally {
                    Mod._free(outArray_proj_decl);
                }
            },
            mk_enumeration_sort: function (c, name, enum_names) {
                let outArray_enum_consts = Mod._malloc(4 * enum_names.length);
                try {
                    let outArray_enum_testers = Mod._malloc(4 * enum_names.length);
                    try {
                        let ret = Mod.ccall('Z3_mk_enumeration_sort', 'number', ['number', 'number', 'number', 'array', 'number', 'number'], [
                            c,
                            name,
                            enum_names.length,
                            intArrayToByteArr(enum_names),
                            outArray_enum_consts,
                            outArray_enum_testers,
                        ]);
                        return {
                            rv: ret,
                            enum_consts: readUintArray(outArray_enum_consts, enum_names.length),
                            enum_testers: readUintArray(outArray_enum_testers, enum_names.length),
                        };
                    }
                    finally {
                        Mod._free(outArray_enum_testers);
                    }
                }
                finally {
                    Mod._free(outArray_enum_consts);
                }
            },
            mk_list_sort: function (c, name, elem_sort) {
                let ret = Mod.ccall('Z3_mk_list_sort', 'number', [
                    'number',
                    'number',
                    'number',
                    'number',
                    'number',
                    'number',
                    'number',
                    'number',
                    'number',
                ], [
                    c,
                    name,
                    elem_sort,
                    outAddress,
                    outAddress + 4,
                    outAddress + 8,
                    outAddress + 12,
                    outAddress + 16,
                    outAddress + 20,
                ]);
                return {
                    rv: ret,
                    nil_decl: getOutUint(0),
                    is_nil_decl: getOutUint(1),
                    cons_decl: getOutUint(2),
                    is_cons_decl: getOutUint(3),
                    head_decl: getOutUint(4),
                    tail_decl: getOutUint(5),
                };
            },
            mk_constructor: function (c, name, recognizer, field_names, sorts, sort_refs) {
                if (field_names.length !== sorts.length) {
                    throw new TypeError(`field_names and sorts must be the same length (got ${field_names.length} and {sorts.length})`);
                }
                if (field_names.length !== sort_refs.length) {
                    throw new TypeError(`field_names and sort_refs must be the same length (got ${field_names.length} and {sort_refs.length})`);
                }
                return Mod.ccall('Z3_mk_constructor', 'number', ['number', 'number', 'number', 'number', 'array', 'array', 'array'], [
                    c,
                    name,
                    recognizer,
                    field_names.length,
                    intArrayToByteArr(field_names),
                    intArrayToByteArr(sorts),
                    intArrayToByteArr(sort_refs),
                ]);
            },
            constructor_num_fields: function (c, constr) {
                let ret = Mod.ccall('Z3_constructor_num_fields', 'number', ['number', 'number'], [c, constr]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            del_constructor: Mod._Z3_del_constructor,
            mk_datatype: function (c, name, constructors) {
                return Mod.ccall('Z3_mk_datatype', 'number', ['number', 'number', 'number', 'array'], [
                    c,
                    name,
                    constructors.length,
                    intArrayToByteArr(constructors),
                ]);
            },
            mk_polymorphic_datatype: function (c, name, parameters, constructors) {
                return Mod.ccall('Z3_mk_polymorphic_datatype', 'number', ['number', 'number', 'number', 'array', 'number', 'array'], [
                    c,
                    name,
                    parameters.length,
                    intArrayToByteArr(parameters),
                    constructors.length,
                    intArrayToByteArr(constructors),
                ]);
            },
            mk_datatype_sort: function (c, name, params) {
                return Mod.ccall('Z3_mk_datatype_sort', 'number', ['number', 'number', 'number', 'array'], [
                    c,
                    name,
                    params.length,
                    intArrayToByteArr(params),
                ]);
            },
            mk_constructor_list: function (c, constructors) {
                return Mod.ccall('Z3_mk_constructor_list', 'number', ['number', 'number', 'array'], [
                    c,
                    constructors.length,
                    intArrayToByteArr(constructors),
                ]);
            },
            del_constructor_list: Mod._Z3_del_constructor_list,
            mk_datatypes: function (c, sort_names, constructor_lists) {
                if (sort_names.length !== constructor_lists.length) {
                    throw new TypeError(`sort_names and constructor_lists must be the same length (got ${sort_names.length} and {constructor_lists.length})`);
                }
                let outArray_sorts = Mod._malloc(4 * sort_names.length);
                try {
                    let ret = Mod.ccall('Z3_mk_datatypes', 'void', ['number', 'number', 'array', 'number', 'array'], [
                        c,
                        sort_names.length,
                        intArrayToByteArr(sort_names),
                        outArray_sorts,
                        intArrayToByteArr(constructor_lists),
                    ]);
                    return readUintArray(outArray_sorts, sort_names.length);
                }
                finally {
                    Mod._free(outArray_sorts);
                }
            },
            query_constructor: function (c, constr, num_fields) {
                let outArray_accessors = Mod._malloc(4 * num_fields);
                try {
                    let ret = Mod.ccall('Z3_query_constructor', 'void', ['number', 'number', 'number', 'number', 'number', 'number'], [
                        c,
                        constr,
                        num_fields,
                        outAddress,
                        outAddress + 4,
                        outArray_accessors,
                    ]);
                    return {
                        constructor: getOutUint(0),
                        tester: getOutUint(1),
                        accessors: readUintArray(outArray_accessors, num_fields),
                    };
                }
                finally {
                    Mod._free(outArray_accessors);
                }
            },
            mk_func_decl: function (c, s, domain, range) {
                return Mod.ccall('Z3_mk_func_decl', 'number', ['number', 'number', 'number', 'array', 'number'], [
                    c,
                    s,
                    domain.length,
                    intArrayToByteArr(domain),
                    range,
                ]);
            },
            mk_app: function (c, d, args) {
                return Mod.ccall('Z3_mk_app', 'number', ['number', 'number', 'number', 'array'], [c, d, args.length, intArrayToByteArr(args)]);
            },
            mk_const: Mod._Z3_mk_const,
            mk_fresh_func_decl: function (c, prefix, domain, range) {
                return Mod.ccall('Z3_mk_fresh_func_decl', 'number', ['number', 'string', 'number', 'array', 'number'], [
                    c,
                    prefix,
                    domain.length,
                    intArrayToByteArr(domain),
                    range,
                ]);
            },
            mk_fresh_const: function (c, prefix, ty) {
                return Mod.ccall('Z3_mk_fresh_const', 'number', ['number', 'string', 'number'], [c, prefix, ty]);
            },
            mk_rec_func_decl: function (c, s, domain, range) {
                return Mod.ccall('Z3_mk_rec_func_decl', 'number', ['number', 'number', 'number', 'array', 'number'], [
                    c,
                    s,
                    domain.length,
                    intArrayToByteArr(domain),
                    range,
                ]);
            },
            add_rec_def: function (c, f, args, body) {
                return Mod.ccall('Z3_add_rec_def', 'void', ['number', 'number', 'number', 'array', 'number'], [
                    c,
                    f,
                    args.length,
                    intArrayToByteArr(args),
                    body,
                ]);
            },
            mk_true: Mod._Z3_mk_true,
            mk_false: Mod._Z3_mk_false,
            mk_eq: Mod._Z3_mk_eq,
            mk_distinct: function (c, args) {
                return Mod.ccall('Z3_mk_distinct', 'number', ['number', 'number', 'array'], [c, args.length, intArrayToByteArr(args)]);
            },
            mk_not: Mod._Z3_mk_not,
            mk_ite: Mod._Z3_mk_ite,
            mk_iff: Mod._Z3_mk_iff,
            mk_implies: Mod._Z3_mk_implies,
            mk_xor: Mod._Z3_mk_xor,
            mk_and: function (c, args) {
                return Mod.ccall('Z3_mk_and', 'number', ['number', 'number', 'array'], [c, args.length, intArrayToByteArr(args)]);
            },
            mk_or: function (c, args) {
                return Mod.ccall('Z3_mk_or', 'number', ['number', 'number', 'array'], [c, args.length, intArrayToByteArr(args)]);
            },
            mk_add: function (c, args) {
                return Mod.ccall('Z3_mk_add', 'number', ['number', 'number', 'array'], [c, args.length, intArrayToByteArr(args)]);
            },
            mk_mul: function (c, args) {
                return Mod.ccall('Z3_mk_mul', 'number', ['number', 'number', 'array'], [c, args.length, intArrayToByteArr(args)]);
            },
            mk_sub: function (c, args) {
                return Mod.ccall('Z3_mk_sub', 'number', ['number', 'number', 'array'], [c, args.length, intArrayToByteArr(args)]);
            },
            mk_unary_minus: Mod._Z3_mk_unary_minus,
            mk_div: Mod._Z3_mk_div,
            mk_mod: Mod._Z3_mk_mod,
            mk_rem: Mod._Z3_mk_rem,
            mk_power: Mod._Z3_mk_power,
            mk_abs: Mod._Z3_mk_abs,
            mk_lt: Mod._Z3_mk_lt,
            mk_le: Mod._Z3_mk_le,
            mk_gt: Mod._Z3_mk_gt,
            mk_ge: Mod._Z3_mk_ge,
            mk_divides: Mod._Z3_mk_divides,
            mk_int2real: Mod._Z3_mk_int2real,
            mk_real2int: Mod._Z3_mk_real2int,
            mk_is_int: Mod._Z3_mk_is_int,
            mk_bvnot: Mod._Z3_mk_bvnot,
            mk_bvredand: Mod._Z3_mk_bvredand,
            mk_bvredor: Mod._Z3_mk_bvredor,
            mk_bvand: Mod._Z3_mk_bvand,
            mk_bvor: Mod._Z3_mk_bvor,
            mk_bvxor: Mod._Z3_mk_bvxor,
            mk_bvnand: Mod._Z3_mk_bvnand,
            mk_bvnor: Mod._Z3_mk_bvnor,
            mk_bvxnor: Mod._Z3_mk_bvxnor,
            mk_bvneg: Mod._Z3_mk_bvneg,
            mk_bvadd: Mod._Z3_mk_bvadd,
            mk_bvsub: Mod._Z3_mk_bvsub,
            mk_bvmul: Mod._Z3_mk_bvmul,
            mk_bvudiv: Mod._Z3_mk_bvudiv,
            mk_bvsdiv: Mod._Z3_mk_bvsdiv,
            mk_bvurem: Mod._Z3_mk_bvurem,
            mk_bvsrem: Mod._Z3_mk_bvsrem,
            mk_bvsmod: Mod._Z3_mk_bvsmod,
            mk_bvult: Mod._Z3_mk_bvult,
            mk_bvslt: Mod._Z3_mk_bvslt,
            mk_bvule: Mod._Z3_mk_bvule,
            mk_bvsle: Mod._Z3_mk_bvsle,
            mk_bvuge: Mod._Z3_mk_bvuge,
            mk_bvsge: Mod._Z3_mk_bvsge,
            mk_bvugt: Mod._Z3_mk_bvugt,
            mk_bvsgt: Mod._Z3_mk_bvsgt,
            mk_concat: Mod._Z3_mk_concat,
            mk_extract: Mod._Z3_mk_extract,
            mk_sign_ext: Mod._Z3_mk_sign_ext,
            mk_zero_ext: Mod._Z3_mk_zero_ext,
            mk_repeat: Mod._Z3_mk_repeat,
            mk_bit2bool: Mod._Z3_mk_bit2bool,
            mk_bvshl: Mod._Z3_mk_bvshl,
            mk_bvlshr: Mod._Z3_mk_bvlshr,
            mk_bvashr: Mod._Z3_mk_bvashr,
            mk_rotate_left: Mod._Z3_mk_rotate_left,
            mk_rotate_right: Mod._Z3_mk_rotate_right,
            mk_ext_rotate_left: Mod._Z3_mk_ext_rotate_left,
            mk_ext_rotate_right: Mod._Z3_mk_ext_rotate_right,
            mk_int2bv: Mod._Z3_mk_int2bv,
            mk_bv2int: Mod._Z3_mk_bv2int,
            mk_bvadd_no_overflow: Mod._Z3_mk_bvadd_no_overflow,
            mk_bvadd_no_underflow: Mod._Z3_mk_bvadd_no_underflow,
            mk_bvsub_no_overflow: Mod._Z3_mk_bvsub_no_overflow,
            mk_bvsub_no_underflow: Mod._Z3_mk_bvsub_no_underflow,
            mk_bvsdiv_no_overflow: Mod._Z3_mk_bvsdiv_no_overflow,
            mk_bvneg_no_overflow: Mod._Z3_mk_bvneg_no_overflow,
            mk_bvmul_no_overflow: Mod._Z3_mk_bvmul_no_overflow,
            mk_bvmul_no_underflow: Mod._Z3_mk_bvmul_no_underflow,
            mk_select: Mod._Z3_mk_select,
            mk_select_n: function (c, a, idxs) {
                return Mod.ccall('Z3_mk_select_n', 'number', ['number', 'number', 'number', 'array'], [c, a, idxs.length, intArrayToByteArr(idxs)]);
            },
            mk_store: Mod._Z3_mk_store,
            mk_store_n: function (c, a, idxs, v) {
                return Mod.ccall('Z3_mk_store_n', 'number', ['number', 'number', 'number', 'array', 'number'], [
                    c,
                    a,
                    idxs.length,
                    intArrayToByteArr(idxs),
                    v,
                ]);
            },
            mk_const_array: Mod._Z3_mk_const_array,
            mk_map: function (c, f, args) {
                return Mod.ccall('Z3_mk_map', 'number', ['number', 'number', 'number', 'array'], [c, f, args.length, intArrayToByteArr(args)]);
            },
            mk_array_default: Mod._Z3_mk_array_default,
            mk_as_array: Mod._Z3_mk_as_array,
            mk_set_sort: Mod._Z3_mk_set_sort,
            mk_empty_set: Mod._Z3_mk_empty_set,
            mk_full_set: Mod._Z3_mk_full_set,
            mk_set_add: Mod._Z3_mk_set_add,
            mk_set_del: Mod._Z3_mk_set_del,
            mk_set_union: function (c, args) {
                return Mod.ccall('Z3_mk_set_union', 'number', ['number', 'number', 'array'], [c, args.length, intArrayToByteArr(args)]);
            },
            mk_set_intersect: function (c, args) {
                return Mod.ccall('Z3_mk_set_intersect', 'number', ['number', 'number', 'array'], [c, args.length, intArrayToByteArr(args)]);
            },
            mk_set_difference: Mod._Z3_mk_set_difference,
            mk_set_complement: Mod._Z3_mk_set_complement,
            mk_set_member: Mod._Z3_mk_set_member,
            mk_set_subset: Mod._Z3_mk_set_subset,
            mk_array_ext: Mod._Z3_mk_array_ext,
            mk_numeral: function (c, numeral, ty) {
                return Mod.ccall('Z3_mk_numeral', 'number', ['number', 'string', 'number'], [c, numeral, ty]);
            },
            mk_real: Mod._Z3_mk_real,
            mk_real_int64: Mod._Z3_mk_real_int64,
            mk_int: Mod._Z3_mk_int,
            mk_unsigned_int: Mod._Z3_mk_unsigned_int,
            mk_int64: Mod._Z3_mk_int64,
            mk_unsigned_int64: Mod._Z3_mk_unsigned_int64,
            mk_bv_numeral: function (c, bits) {
                return Mod.ccall('Z3_mk_bv_numeral', 'number', ['number', 'number', 'array'], [c, bits.length, boolArrayToByteArr(bits)]);
            },
            mk_seq_sort: Mod._Z3_mk_seq_sort,
            is_seq_sort: function (c, s) {
                return Mod.ccall('Z3_is_seq_sort', 'boolean', ['number', 'number'], [c, s]);
            },
            get_seq_sort_basis: Mod._Z3_get_seq_sort_basis,
            mk_re_sort: Mod._Z3_mk_re_sort,
            is_re_sort: function (c, s) {
                return Mod.ccall('Z3_is_re_sort', 'boolean', ['number', 'number'], [c, s]);
            },
            get_re_sort_basis: Mod._Z3_get_re_sort_basis,
            mk_string_sort: Mod._Z3_mk_string_sort,
            mk_char_sort: Mod._Z3_mk_char_sort,
            is_string_sort: function (c, s) {
                return Mod.ccall('Z3_is_string_sort', 'boolean', ['number', 'number'], [c, s]);
            },
            is_char_sort: function (c, s) {
                return Mod.ccall('Z3_is_char_sort', 'boolean', ['number', 'number'], [c, s]);
            },
            mk_string: function (c, s) {
                return Mod.ccall('Z3_mk_string', 'number', ['number', 'string'], [c, s]);
            },
            mk_lstring: function (c, len, s) {
                return Mod.ccall('Z3_mk_lstring', 'number', ['number', 'number', 'string'], [c, len, s]);
            },
            mk_u32string: function (c, chars) {
                return Mod.ccall('Z3_mk_u32string', 'number', ['number', 'number', 'array'], [c, chars.length, intArrayToByteArr(chars)]);
            },
            is_string: function (c, s) {
                return Mod.ccall('Z3_is_string', 'boolean', ['number', 'number'], [c, s]);
            },
            get_string: function (c, s) {
                return Mod.ccall('Z3_get_string', 'string', ['number', 'number'], [c, s]);
            },
            get_string_length: function (c, s) {
                let ret = Mod.ccall('Z3_get_string_length', 'number', ['number', 'number'], [c, s]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            get_string_contents: function (c, s, length) {
                let outArray_contents = Mod._malloc(4 * length);
                try {
                    let ret = Mod.ccall('Z3_get_string_contents', 'void', ['number', 'number', 'number', 'number'], [c, s, length, outArray_contents]);
                    return readUintArray(outArray_contents, length);
                }
                finally {
                    Mod._free(outArray_contents);
                }
            },
            mk_seq_empty: Mod._Z3_mk_seq_empty,
            mk_seq_unit: Mod._Z3_mk_seq_unit,
            mk_seq_concat: function (c, args) {
                return Mod.ccall('Z3_mk_seq_concat', 'number', ['number', 'number', 'array'], [c, args.length, intArrayToByteArr(args)]);
            },
            mk_seq_prefix: Mod._Z3_mk_seq_prefix,
            mk_seq_suffix: Mod._Z3_mk_seq_suffix,
            mk_seq_contains: Mod._Z3_mk_seq_contains,
            mk_str_lt: Mod._Z3_mk_str_lt,
            mk_str_le: Mod._Z3_mk_str_le,
            mk_seq_extract: Mod._Z3_mk_seq_extract,
            mk_seq_replace: Mod._Z3_mk_seq_replace,
            mk_seq_replace_all: Mod._Z3_mk_seq_replace_all,
            mk_seq_replace_re: Mod._Z3_mk_seq_replace_re,
            mk_seq_replace_re_all: Mod._Z3_mk_seq_replace_re_all,
            mk_seq_at: Mod._Z3_mk_seq_at,
            mk_seq_nth: Mod._Z3_mk_seq_nth,
            mk_seq_length: Mod._Z3_mk_seq_length,
            mk_seq_index: Mod._Z3_mk_seq_index,
            mk_seq_last_index: Mod._Z3_mk_seq_last_index,
            mk_seq_map: Mod._Z3_mk_seq_map,
            mk_seq_mapi: Mod._Z3_mk_seq_mapi,
            mk_seq_foldl: Mod._Z3_mk_seq_foldl,
            mk_seq_foldli: Mod._Z3_mk_seq_foldli,
            mk_str_to_int: Mod._Z3_mk_str_to_int,
            mk_int_to_str: Mod._Z3_mk_int_to_str,
            mk_string_to_code: Mod._Z3_mk_string_to_code,
            mk_string_from_code: Mod._Z3_mk_string_from_code,
            mk_ubv_to_str: Mod._Z3_mk_ubv_to_str,
            mk_sbv_to_str: Mod._Z3_mk_sbv_to_str,
            mk_seq_to_re: Mod._Z3_mk_seq_to_re,
            mk_seq_in_re: Mod._Z3_mk_seq_in_re,
            mk_re_plus: Mod._Z3_mk_re_plus,
            mk_re_star: Mod._Z3_mk_re_star,
            mk_re_option: Mod._Z3_mk_re_option,
            mk_re_union: function (c, args) {
                return Mod.ccall('Z3_mk_re_union', 'number', ['number', 'number', 'array'], [c, args.length, intArrayToByteArr(args)]);
            },
            mk_re_concat: function (c, args) {
                return Mod.ccall('Z3_mk_re_concat', 'number', ['number', 'number', 'array'], [c, args.length, intArrayToByteArr(args)]);
            },
            mk_re_range: Mod._Z3_mk_re_range,
            mk_re_allchar: Mod._Z3_mk_re_allchar,
            mk_re_loop: Mod._Z3_mk_re_loop,
            mk_re_power: Mod._Z3_mk_re_power,
            mk_re_intersect: function (c, args) {
                return Mod.ccall('Z3_mk_re_intersect', 'number', ['number', 'number', 'array'], [c, args.length, intArrayToByteArr(args)]);
            },
            mk_re_complement: Mod._Z3_mk_re_complement,
            mk_re_diff: Mod._Z3_mk_re_diff,
            mk_re_empty: Mod._Z3_mk_re_empty,
            mk_re_full: Mod._Z3_mk_re_full,
            mk_char: Mod._Z3_mk_char,
            mk_char_le: Mod._Z3_mk_char_le,
            mk_char_to_int: Mod._Z3_mk_char_to_int,
            mk_char_to_bv: Mod._Z3_mk_char_to_bv,
            mk_char_from_bv: Mod._Z3_mk_char_from_bv,
            mk_char_is_digit: Mod._Z3_mk_char_is_digit,
            mk_linear_order: Mod._Z3_mk_linear_order,
            mk_partial_order: Mod._Z3_mk_partial_order,
            mk_piecewise_linear_order: Mod._Z3_mk_piecewise_linear_order,
            mk_tree_order: Mod._Z3_mk_tree_order,
            mk_transitive_closure: Mod._Z3_mk_transitive_closure,
            mk_pattern: function (c, terms) {
                return Mod.ccall('Z3_mk_pattern', 'number', ['number', 'number', 'array'], [c, terms.length, intArrayToByteArr(terms)]);
            },
            mk_bound: Mod._Z3_mk_bound,
            mk_forall: function (c, weight, patterns, sorts, decl_names, body) {
                if (sorts.length !== decl_names.length) {
                    throw new TypeError(`sorts and decl_names must be the same length (got ${sorts.length} and {decl_names.length})`);
                }
                return Mod.ccall('Z3_mk_forall', 'number', [
                    'number',
                    'number',
                    'number',
                    'array',
                    'number',
                    'array',
                    'array',
                    'number',
                ], [
                    c,
                    weight,
                    patterns.length,
                    intArrayToByteArr(patterns),
                    sorts.length,
                    intArrayToByteArr(sorts),
                    intArrayToByteArr(decl_names),
                    body,
                ]);
            },
            mk_exists: function (c, weight, patterns, sorts, decl_names, body) {
                if (sorts.length !== decl_names.length) {
                    throw new TypeError(`sorts and decl_names must be the same length (got ${sorts.length} and {decl_names.length})`);
                }
                return Mod.ccall('Z3_mk_exists', 'number', [
                    'number',
                    'number',
                    'number',
                    'array',
                    'number',
                    'array',
                    'array',
                    'number',
                ], [
                    c,
                    weight,
                    patterns.length,
                    intArrayToByteArr(patterns),
                    sorts.length,
                    intArrayToByteArr(sorts),
                    intArrayToByteArr(decl_names),
                    body,
                ]);
            },
            mk_quantifier: function (c, is_forall, weight, patterns, sorts, decl_names, body) {
                if (sorts.length !== decl_names.length) {
                    throw new TypeError(`sorts and decl_names must be the same length (got ${sorts.length} and {decl_names.length})`);
                }
                return Mod.ccall('Z3_mk_quantifier', 'number', [
                    'number',
                    'boolean',
                    'number',
                    'number',
                    'array',
                    'number',
                    'array',
                    'array',
                    'number',
                ], [
                    c,
                    is_forall,
                    weight,
                    patterns.length,
                    intArrayToByteArr(patterns),
                    sorts.length,
                    intArrayToByteArr(sorts),
                    intArrayToByteArr(decl_names),
                    body,
                ]);
            },
            mk_quantifier_ex: function (c, is_forall, weight, quantifier_id, skolem_id, patterns, no_patterns, sorts, decl_names, body) {
                if (sorts.length !== decl_names.length) {
                    throw new TypeError(`sorts and decl_names must be the same length (got ${sorts.length} and {decl_names.length})`);
                }
                return Mod.ccall('Z3_mk_quantifier_ex', 'number', [
                    'number',
                    'boolean',
                    'number',
                    'number',
                    'number',
                    'number',
                    'array',
                    'number',
                    'array',
                    'number',
                    'array',
                    'array',
                    'number',
                ], [
                    c,
                    is_forall,
                    weight,
                    quantifier_id,
                    skolem_id,
                    patterns.length,
                    intArrayToByteArr(patterns),
                    no_patterns.length,
                    intArrayToByteArr(no_patterns),
                    sorts.length,
                    intArrayToByteArr(sorts),
                    intArrayToByteArr(decl_names),
                    body,
                ]);
            },
            mk_forall_const: function (c, weight, bound, patterns, body) {
                return Mod.ccall('Z3_mk_forall_const', 'number', ['number', 'number', 'number', 'array', 'number', 'array', 'number'], [
                    c,
                    weight,
                    bound.length,
                    intArrayToByteArr(bound),
                    patterns.length,
                    intArrayToByteArr(patterns),
                    body,
                ]);
            },
            mk_exists_const: function (c, weight, bound, patterns, body) {
                return Mod.ccall('Z3_mk_exists_const', 'number', ['number', 'number', 'number', 'array', 'number', 'array', 'number'], [
                    c,
                    weight,
                    bound.length,
                    intArrayToByteArr(bound),
                    patterns.length,
                    intArrayToByteArr(patterns),
                    body,
                ]);
            },
            mk_quantifier_const: function (c, is_forall, weight, bound, patterns, body) {
                return Mod.ccall('Z3_mk_quantifier_const', 'number', [
                    'number',
                    'boolean',
                    'number',
                    'number',
                    'array',
                    'number',
                    'array',
                    'number',
                ], [
                    c,
                    is_forall,
                    weight,
                    bound.length,
                    intArrayToByteArr(bound),
                    patterns.length,
                    intArrayToByteArr(patterns),
                    body,
                ]);
            },
            mk_quantifier_const_ex: function (c, is_forall, weight, quantifier_id, skolem_id, bound, patterns, no_patterns, body) {
                return Mod.ccall('Z3_mk_quantifier_const_ex', 'number', [
                    'number',
                    'boolean',
                    'number',
                    'number',
                    'number',
                    'number',
                    'array',
                    'number',
                    'array',
                    'number',
                    'array',
                    'number',
                ], [
                    c,
                    is_forall,
                    weight,
                    quantifier_id,
                    skolem_id,
                    bound.length,
                    intArrayToByteArr(bound),
                    patterns.length,
                    intArrayToByteArr(patterns),
                    no_patterns.length,
                    intArrayToByteArr(no_patterns),
                    body,
                ]);
            },
            mk_lambda: function (c, sorts, decl_names, body) {
                if (sorts.length !== decl_names.length) {
                    throw new TypeError(`sorts and decl_names must be the same length (got ${sorts.length} and {decl_names.length})`);
                }
                return Mod.ccall('Z3_mk_lambda', 'number', ['number', 'number', 'array', 'array', 'number'], [
                    c,
                    sorts.length,
                    intArrayToByteArr(sorts),
                    intArrayToByteArr(decl_names),
                    body,
                ]);
            },
            mk_lambda_const: function (c, bound, body) {
                return Mod.ccall('Z3_mk_lambda_const', 'number', ['number', 'number', 'array', 'number'], [
                    c,
                    bound.length,
                    intArrayToByteArr(bound),
                    body,
                ]);
            },
            get_symbol_kind: Mod._Z3_get_symbol_kind,
            get_symbol_int: Mod._Z3_get_symbol_int,
            get_symbol_string: function (c, s) {
                return Mod.ccall('Z3_get_symbol_string', 'string', ['number', 'number'], [c, s]);
            },
            get_sort_name: Mod._Z3_get_sort_name,
            get_sort_id: function (c, s) {
                let ret = Mod.ccall('Z3_get_sort_id', 'number', ['number', 'number'], [c, s]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            sort_to_ast: Mod._Z3_sort_to_ast,
            is_eq_sort: function (c, s1, s2) {
                return Mod.ccall('Z3_is_eq_sort', 'boolean', ['number', 'number', 'number'], [c, s1, s2]);
            },
            get_sort_kind: Mod._Z3_get_sort_kind,
            get_bv_sort_size: function (c, t) {
                let ret = Mod.ccall('Z3_get_bv_sort_size', 'number', ['number', 'number'], [c, t]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            get_finite_domain_sort_size: function (c, s) {
                let ret = Mod.ccall('Z3_get_finite_domain_sort_size', 'boolean', ['number', 'number', 'number'], [c, s, outAddress]);
                if (!ret) {
                    return null;
                }
                return getOutUint64(0);
            },
            get_array_arity: function (c, s) {
                let ret = Mod.ccall('Z3_get_array_arity', 'number', ['number', 'number'], [c, s]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            get_array_sort_domain: Mod._Z3_get_array_sort_domain,
            get_array_sort_domain_n: Mod._Z3_get_array_sort_domain_n,
            get_array_sort_range: Mod._Z3_get_array_sort_range,
            get_tuple_sort_mk_decl: Mod._Z3_get_tuple_sort_mk_decl,
            get_tuple_sort_num_fields: function (c, t) {
                let ret = Mod.ccall('Z3_get_tuple_sort_num_fields', 'number', ['number', 'number'], [c, t]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            get_tuple_sort_field_decl: Mod._Z3_get_tuple_sort_field_decl,
            is_recursive_datatype_sort: function (c, s) {
                return Mod.ccall('Z3_is_recursive_datatype_sort', 'boolean', ['number', 'number'], [c, s]);
            },
            get_datatype_sort_num_constructors: function (c, t) {
                let ret = Mod.ccall('Z3_get_datatype_sort_num_constructors', 'number', ['number', 'number'], [c, t]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            get_datatype_sort_constructor: Mod._Z3_get_datatype_sort_constructor,
            get_datatype_sort_recognizer: Mod._Z3_get_datatype_sort_recognizer,
            get_datatype_sort_constructor_accessor: Mod._Z3_get_datatype_sort_constructor_accessor,
            datatype_update_field: Mod._Z3_datatype_update_field,
            get_relation_arity: function (c, s) {
                let ret = Mod.ccall('Z3_get_relation_arity', 'number', ['number', 'number'], [c, s]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            get_relation_column: Mod._Z3_get_relation_column,
            mk_atmost: function (c, args, k) {
                return Mod.ccall('Z3_mk_atmost', 'number', ['number', 'number', 'array', 'number'], [c, args.length, intArrayToByteArr(args), k]);
            },
            mk_atleast: function (c, args, k) {
                return Mod.ccall('Z3_mk_atleast', 'number', ['number', 'number', 'array', 'number'], [c, args.length, intArrayToByteArr(args), k]);
            },
            mk_pble: function (c, args, coeffs, k) {
                if (args.length !== coeffs.length) {
                    throw new TypeError(`args and coeffs must be the same length (got ${args.length} and {coeffs.length})`);
                }
                return Mod.ccall('Z3_mk_pble', 'number', ['number', 'number', 'array', 'array', 'number'], [
                    c,
                    args.length,
                    intArrayToByteArr(args),
                    intArrayToByteArr(coeffs),
                    k,
                ]);
            },
            mk_pbge: function (c, args, coeffs, k) {
                if (args.length !== coeffs.length) {
                    throw new TypeError(`args and coeffs must be the same length (got ${args.length} and {coeffs.length})`);
                }
                return Mod.ccall('Z3_mk_pbge', 'number', ['number', 'number', 'array', 'array', 'number'], [
                    c,
                    args.length,
                    intArrayToByteArr(args),
                    intArrayToByteArr(coeffs),
                    k,
                ]);
            },
            mk_pbeq: function (c, args, coeffs, k) {
                if (args.length !== coeffs.length) {
                    throw new TypeError(`args and coeffs must be the same length (got ${args.length} and {coeffs.length})`);
                }
                return Mod.ccall('Z3_mk_pbeq', 'number', ['number', 'number', 'array', 'array', 'number'], [
                    c,
                    args.length,
                    intArrayToByteArr(args),
                    intArrayToByteArr(coeffs),
                    k,
                ]);
            },
            func_decl_to_ast: Mod._Z3_func_decl_to_ast,
            is_eq_func_decl: function (c, f1, f2) {
                return Mod.ccall('Z3_is_eq_func_decl', 'boolean', ['number', 'number', 'number'], [c, f1, f2]);
            },
            get_func_decl_id: function (c, f) {
                let ret = Mod.ccall('Z3_get_func_decl_id', 'number', ['number', 'number'], [c, f]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            get_decl_name: Mod._Z3_get_decl_name,
            get_decl_kind: Mod._Z3_get_decl_kind,
            get_domain_size: function (c, d) {
                let ret = Mod.ccall('Z3_get_domain_size', 'number', ['number', 'number'], [c, d]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            get_arity: function (c, d) {
                let ret = Mod.ccall('Z3_get_arity', 'number', ['number', 'number'], [c, d]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            get_domain: Mod._Z3_get_domain,
            get_range: Mod._Z3_get_range,
            get_decl_num_parameters: function (c, d) {
                let ret = Mod.ccall('Z3_get_decl_num_parameters', 'number', ['number', 'number'], [c, d]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            get_decl_parameter_kind: Mod._Z3_get_decl_parameter_kind,
            get_decl_int_parameter: Mod._Z3_get_decl_int_parameter,
            get_decl_double_parameter: Mod._Z3_get_decl_double_parameter,
            get_decl_symbol_parameter: Mod._Z3_get_decl_symbol_parameter,
            get_decl_sort_parameter: Mod._Z3_get_decl_sort_parameter,
            get_decl_ast_parameter: Mod._Z3_get_decl_ast_parameter,
            get_decl_func_decl_parameter: Mod._Z3_get_decl_func_decl_parameter,
            get_decl_rational_parameter: function (c, d, idx) {
                return Mod.ccall('Z3_get_decl_rational_parameter', 'string', ['number', 'number', 'number'], [c, d, idx]);
            },
            app_to_ast: Mod._Z3_app_to_ast,
            get_app_decl: Mod._Z3_get_app_decl,
            get_app_num_args: function (c, a) {
                let ret = Mod.ccall('Z3_get_app_num_args', 'number', ['number', 'number'], [c, a]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            get_app_arg: Mod._Z3_get_app_arg,
            is_eq_ast: function (c, t1, t2) {
                return Mod.ccall('Z3_is_eq_ast', 'boolean', ['number', 'number', 'number'], [c, t1, t2]);
            },
            get_ast_id: function (c, t) {
                let ret = Mod.ccall('Z3_get_ast_id', 'number', ['number', 'number'], [c, t]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            get_ast_hash: function (c, a) {
                let ret = Mod.ccall('Z3_get_ast_hash', 'number', ['number', 'number'], [c, a]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            get_sort: Mod._Z3_get_sort,
            is_well_sorted: function (c, t) {
                return Mod.ccall('Z3_is_well_sorted', 'boolean', ['number', 'number'], [c, t]);
            },
            get_bool_value: Mod._Z3_get_bool_value,
            get_ast_kind: Mod._Z3_get_ast_kind,
            is_app: function (c, a) {
                return Mod.ccall('Z3_is_app', 'boolean', ['number', 'number'], [c, a]);
            },
            is_ground: function (c, a) {
                return Mod.ccall('Z3_is_ground', 'boolean', ['number', 'number'], [c, a]);
            },
            get_depth: function (c, a) {
                let ret = Mod.ccall('Z3_get_depth', 'number', ['number', 'number'], [c, a]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            is_numeral_ast: function (c, a) {
                return Mod.ccall('Z3_is_numeral_ast', 'boolean', ['number', 'number'], [c, a]);
            },
            is_algebraic_number: function (c, a) {
                return Mod.ccall('Z3_is_algebraic_number', 'boolean', ['number', 'number'], [c, a]);
            },
            to_app: Mod._Z3_to_app,
            to_func_decl: Mod._Z3_to_func_decl,
            get_numeral_string: function (c, a) {
                return Mod.ccall('Z3_get_numeral_string', 'string', ['number', 'number'], [c, a]);
            },
            get_numeral_binary_string: function (c, a) {
                return Mod.ccall('Z3_get_numeral_binary_string', 'string', ['number', 'number'], [c, a]);
            },
            get_numeral_decimal_string: function (c, a, precision) {
                return Mod.ccall('Z3_get_numeral_decimal_string', 'string', ['number', 'number', 'number'], [c, a, precision]);
            },
            get_numeral_double: Mod._Z3_get_numeral_double,
            get_numerator: Mod._Z3_get_numerator,
            get_denominator: Mod._Z3_get_denominator,
            get_numeral_small: function (c, a) {
                let ret = Mod.ccall('Z3_get_numeral_small', 'boolean', ['number', 'number', 'number', 'number'], [c, a, outAddress, outAddress + 8]);
                if (!ret) {
                    return null;
                }
                return { num: getOutInt64(0), den: getOutInt64(1) };
            },
            get_numeral_int: function (c, v) {
                let ret = Mod.ccall('Z3_get_numeral_int', 'boolean', ['number', 'number', 'number'], [c, v, outAddress]);
                if (!ret) {
                    return null;
                }
                return getOutInt(0);
            },
            get_numeral_uint: function (c, v) {
                let ret = Mod.ccall('Z3_get_numeral_uint', 'boolean', ['number', 'number', 'number'], [c, v, outAddress]);
                if (!ret) {
                    return null;
                }
                return getOutUint(0);
            },
            get_numeral_uint64: function (c, v) {
                let ret = Mod.ccall('Z3_get_numeral_uint64', 'boolean', ['number', 'number', 'number'], [c, v, outAddress]);
                if (!ret) {
                    return null;
                }
                return getOutUint64(0);
            },
            get_numeral_int64: function (c, v) {
                let ret = Mod.ccall('Z3_get_numeral_int64', 'boolean', ['number', 'number', 'number'], [c, v, outAddress]);
                if (!ret) {
                    return null;
                }
                return getOutInt64(0);
            },
            get_numeral_rational_int64: function (c, v) {
                let ret = Mod.ccall('Z3_get_numeral_rational_int64', 'boolean', ['number', 'number', 'number', 'number'], [c, v, outAddress, outAddress + 8]);
                if (!ret) {
                    return null;
                }
                return { num: getOutInt64(0), den: getOutInt64(1) };
            },
            get_algebraic_number_lower: Mod._Z3_get_algebraic_number_lower,
            get_algebraic_number_upper: Mod._Z3_get_algebraic_number_upper,
            pattern_to_ast: Mod._Z3_pattern_to_ast,
            get_pattern_num_terms: function (c, p) {
                let ret = Mod.ccall('Z3_get_pattern_num_terms', 'number', ['number', 'number'], [c, p]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            get_pattern: Mod._Z3_get_pattern,
            get_index_value: function (c, a) {
                let ret = Mod.ccall('Z3_get_index_value', 'number', ['number', 'number'], [c, a]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            is_quantifier_forall: function (c, a) {
                return Mod.ccall('Z3_is_quantifier_forall', 'boolean', ['number', 'number'], [c, a]);
            },
            is_quantifier_exists: function (c, a) {
                return Mod.ccall('Z3_is_quantifier_exists', 'boolean', ['number', 'number'], [c, a]);
            },
            is_lambda: function (c, a) {
                return Mod.ccall('Z3_is_lambda', 'boolean', ['number', 'number'], [c, a]);
            },
            get_quantifier_weight: function (c, a) {
                let ret = Mod.ccall('Z3_get_quantifier_weight', 'number', ['number', 'number'], [c, a]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            get_quantifier_skolem_id: Mod._Z3_get_quantifier_skolem_id,
            get_quantifier_id: Mod._Z3_get_quantifier_id,
            get_quantifier_num_patterns: function (c, a) {
                let ret = Mod.ccall('Z3_get_quantifier_num_patterns', 'number', ['number', 'number'], [c, a]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            get_quantifier_pattern_ast: Mod._Z3_get_quantifier_pattern_ast,
            get_quantifier_num_no_patterns: function (c, a) {
                let ret = Mod.ccall('Z3_get_quantifier_num_no_patterns', 'number', ['number', 'number'], [c, a]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            get_quantifier_no_pattern_ast: Mod._Z3_get_quantifier_no_pattern_ast,
            get_quantifier_num_bound: function (c, a) {
                let ret = Mod.ccall('Z3_get_quantifier_num_bound', 'number', ['number', 'number'], [c, a]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            get_quantifier_bound_name: Mod._Z3_get_quantifier_bound_name,
            get_quantifier_bound_sort: Mod._Z3_get_quantifier_bound_sort,
            get_quantifier_body: Mod._Z3_get_quantifier_body,
            simplify: function (c, a) {
                return Mod.async_call(Mod._async_Z3_simplify, c, a);
            },
            simplify_ex: function (c, a, p) {
                return Mod.async_call(Mod._async_Z3_simplify_ex, c, a, p);
            },
            simplify_get_help: function (c) {
                return Mod.ccall('Z3_simplify_get_help', 'string', ['number'], [c]);
            },
            simplify_get_param_descrs: Mod._Z3_simplify_get_param_descrs,
            update_term: function (c, a, args) {
                return Mod.ccall('Z3_update_term', 'number', ['number', 'number', 'number', 'array'], [c, a, args.length, intArrayToByteArr(args)]);
            },
            substitute: function (c, a, from, to) {
                if (from.length !== to.length) {
                    throw new TypeError(`from and to must be the same length (got ${from.length} and {to.length})`);
                }
                return Mod.ccall('Z3_substitute', 'number', ['number', 'number', 'number', 'array', 'array'], [
                    c,
                    a,
                    from.length,
                    intArrayToByteArr(from),
                    intArrayToByteArr(to),
                ]);
            },
            substitute_vars: function (c, a, to) {
                return Mod.ccall('Z3_substitute_vars', 'number', ['number', 'number', 'number', 'array'], [c, a, to.length, intArrayToByteArr(to)]);
            },
            substitute_funs: function (c, a, from, to) {
                if (from.length !== to.length) {
                    throw new TypeError(`from and to must be the same length (got ${from.length} and {to.length})`);
                }
                return Mod.ccall('Z3_substitute_funs', 'number', ['number', 'number', 'number', 'array', 'array'], [
                    c,
                    a,
                    from.length,
                    intArrayToByteArr(from),
                    intArrayToByteArr(to),
                ]);
            },
            translate: Mod._Z3_translate,
            mk_model: Mod._Z3_mk_model,
            model_inc_ref: Mod._Z3_model_inc_ref,
            model_dec_ref: Mod._Z3_model_dec_ref,
            model_eval: function (c, m, t, model_completion) {
                let ret = Mod.ccall('Z3_model_eval', 'boolean', ['number', 'number', 'number', 'boolean', 'number'], [c, m, t, model_completion, outAddress]);
                if (!ret) {
                    return null;
                }
                return getOutUint(0);
            },
            model_get_const_interp: Mod._Z3_model_get_const_interp,
            model_has_interp: function (c, m, a) {
                return Mod.ccall('Z3_model_has_interp', 'boolean', ['number', 'number', 'number'], [c, m, a]);
            },
            model_get_func_interp: Mod._Z3_model_get_func_interp,
            model_get_num_consts: function (c, m) {
                let ret = Mod.ccall('Z3_model_get_num_consts', 'number', ['number', 'number'], [c, m]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            model_get_const_decl: Mod._Z3_model_get_const_decl,
            model_get_num_funcs: function (c, m) {
                let ret = Mod.ccall('Z3_model_get_num_funcs', 'number', ['number', 'number'], [c, m]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            model_get_func_decl: Mod._Z3_model_get_func_decl,
            model_get_num_sorts: function (c, m) {
                let ret = Mod.ccall('Z3_model_get_num_sorts', 'number', ['number', 'number'], [c, m]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            model_get_sort: Mod._Z3_model_get_sort,
            model_get_sort_universe: Mod._Z3_model_get_sort_universe,
            model_translate: Mod._Z3_model_translate,
            is_as_array: function (c, a) {
                return Mod.ccall('Z3_is_as_array', 'boolean', ['number', 'number'], [c, a]);
            },
            get_as_array_func_decl: Mod._Z3_get_as_array_func_decl,
            add_func_interp: Mod._Z3_add_func_interp,
            add_const_interp: Mod._Z3_add_const_interp,
            func_interp_inc_ref: Mod._Z3_func_interp_inc_ref,
            func_interp_dec_ref: Mod._Z3_func_interp_dec_ref,
            func_interp_get_num_entries: function (c, f) {
                let ret = Mod.ccall('Z3_func_interp_get_num_entries', 'number', ['number', 'number'], [c, f]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            func_interp_get_entry: Mod._Z3_func_interp_get_entry,
            func_interp_get_else: Mod._Z3_func_interp_get_else,
            func_interp_set_else: Mod._Z3_func_interp_set_else,
            func_interp_get_arity: function (c, f) {
                let ret = Mod.ccall('Z3_func_interp_get_arity', 'number', ['number', 'number'], [c, f]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            func_interp_add_entry: Mod._Z3_func_interp_add_entry,
            func_entry_inc_ref: Mod._Z3_func_entry_inc_ref,
            func_entry_dec_ref: Mod._Z3_func_entry_dec_ref,
            func_entry_get_value: Mod._Z3_func_entry_get_value,
            func_entry_get_num_args: function (c, e) {
                let ret = Mod.ccall('Z3_func_entry_get_num_args', 'number', ['number', 'number'], [c, e]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            func_entry_get_arg: Mod._Z3_func_entry_get_arg,
            open_log: function (filename) {
                return Mod.ccall('Z3_open_log', 'boolean', ['string'], [filename]);
            },
            append_log: function (string) {
                return Mod.ccall('Z3_append_log', 'void', ['string'], [string]);
            },
            close_log: Mod._Z3_close_log,
            toggle_warning_messages: Mod._Z3_toggle_warning_messages,
            set_ast_print_mode: Mod._Z3_set_ast_print_mode,
            ast_to_string: function (c, a) {
                return Mod.ccall('Z3_ast_to_string', 'string', ['number', 'number'], [c, a]);
            },
            pattern_to_string: function (c, p) {
                return Mod.ccall('Z3_pattern_to_string', 'string', ['number', 'number'], [c, p]);
            },
            sort_to_string: function (c, s) {
                return Mod.ccall('Z3_sort_to_string', 'string', ['number', 'number'], [c, s]);
            },
            func_decl_to_string: function (c, d) {
                return Mod.ccall('Z3_func_decl_to_string', 'string', ['number', 'number'], [c, d]);
            },
            model_to_string: function (c, m) {
                return Mod.ccall('Z3_model_to_string', 'string', ['number', 'number'], [c, m]);
            },
            benchmark_to_smtlib_string: function (c, name, logic, status, attributes, assumptions, formula) {
                return Mod.ccall('Z3_benchmark_to_smtlib_string', 'string', [
                    'number',
                    'string',
                    'string',
                    'string',
                    'string',
                    'number',
                    'array',
                    'number',
                ], [
                    c,
                    name,
                    logic,
                    status,
                    attributes,
                    assumptions.length,
                    intArrayToByteArr(assumptions),
                    formula,
                ]);
            },
            parse_smtlib2_string: function (c, str, sort_names, sorts, decl_names, decls) {
                if (sort_names.length !== sorts.length) {
                    throw new TypeError(`sort_names and sorts must be the same length (got ${sort_names.length} and {sorts.length})`);
                }
                if (decl_names.length !== decls.length) {
                    throw new TypeError(`decl_names and decls must be the same length (got ${decl_names.length} and {decls.length})`);
                }
                return Mod.ccall('Z3_parse_smtlib2_string', 'number', [
                    'number',
                    'string',
                    'number',
                    'array',
                    'array',
                    'number',
                    'array',
                    'array',
                ], [
                    c,
                    str,
                    sort_names.length,
                    intArrayToByteArr(sort_names),
                    intArrayToByteArr(sorts),
                    decl_names.length,
                    intArrayToByteArr(decl_names),
                    intArrayToByteArr(decls),
                ]);
            },
            parse_smtlib2_file: function (c, file_name, sort_names, sorts, decl_names, decls) {
                if (sort_names.length !== sorts.length) {
                    throw new TypeError(`sort_names and sorts must be the same length (got ${sort_names.length} and {sorts.length})`);
                }
                if (decl_names.length !== decls.length) {
                    throw new TypeError(`decl_names and decls must be the same length (got ${decl_names.length} and {decls.length})`);
                }
                return Mod.ccall('Z3_parse_smtlib2_file', 'number', [
                    'number',
                    'string',
                    'number',
                    'array',
                    'array',
                    'number',
                    'array',
                    'array',
                ], [
                    c,
                    file_name,
                    sort_names.length,
                    intArrayToByteArr(sort_names),
                    intArrayToByteArr(sorts),
                    decl_names.length,
                    intArrayToByteArr(decl_names),
                    intArrayToByteArr(decls),
                ]);
            },
            eval_smtlib2_string: async function (c, str) {
                return await Mod.async_call(() => Mod.ccall('async_Z3_eval_smtlib2_string', 'void', ['number', 'string'], [c, str]));
            },
            mk_parser_context: Mod._Z3_mk_parser_context,
            parser_context_inc_ref: Mod._Z3_parser_context_inc_ref,
            parser_context_dec_ref: Mod._Z3_parser_context_dec_ref,
            parser_context_add_sort: Mod._Z3_parser_context_add_sort,
            parser_context_add_decl: Mod._Z3_parser_context_add_decl,
            parser_context_from_string: function (c, pc, s) {
                return Mod.ccall('Z3_parser_context_from_string', 'number', ['number', 'number', 'string'], [c, pc, s]);
            },
            get_error_code: Mod._Z3_get_error_code,
            set_error: Mod._Z3_set_error,
            get_error_msg: function (c, err) {
                return Mod.ccall('Z3_get_error_msg', 'string', ['number', 'number'], [c, err]);
            },
            get_version: function () {
                let ret = Mod.ccall('Z3_get_version', 'void', ['number', 'number', 'number', 'number'], [outAddress, outAddress + 4, outAddress + 8, outAddress + 12]);
                return {
                    major: getOutUint(0),
                    minor: getOutUint(1),
                    build_number: getOutUint(2),
                    revision_number: getOutUint(3),
                };
            },
            get_full_version: function () {
                return Mod.ccall('Z3_get_full_version', 'string', [], []);
            },
            enable_trace: function (tag) {
                return Mod.ccall('Z3_enable_trace', 'void', ['string'], [tag]);
            },
            disable_trace: function (tag) {
                return Mod.ccall('Z3_disable_trace', 'void', ['string'], [tag]);
            },
            reset_memory: Mod._Z3_reset_memory,
            finalize_memory: Mod._Z3_finalize_memory,
            mk_goal: Mod._Z3_mk_goal,
            goal_inc_ref: Mod._Z3_goal_inc_ref,
            goal_dec_ref: Mod._Z3_goal_dec_ref,
            goal_precision: Mod._Z3_goal_precision,
            goal_assert: Mod._Z3_goal_assert,
            goal_inconsistent: function (c, g) {
                return Mod.ccall('Z3_goal_inconsistent', 'boolean', ['number', 'number'], [c, g]);
            },
            goal_depth: function (c, g) {
                let ret = Mod.ccall('Z3_goal_depth', 'number', ['number', 'number'], [c, g]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            goal_reset: Mod._Z3_goal_reset,
            goal_size: function (c, g) {
                let ret = Mod.ccall('Z3_goal_size', 'number', ['number', 'number'], [c, g]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            goal_formula: Mod._Z3_goal_formula,
            goal_num_exprs: function (c, g) {
                let ret = Mod.ccall('Z3_goal_num_exprs', 'number', ['number', 'number'], [c, g]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            goal_is_decided_sat: function (c, g) {
                return Mod.ccall('Z3_goal_is_decided_sat', 'boolean', ['number', 'number'], [c, g]);
            },
            goal_is_decided_unsat: function (c, g) {
                return Mod.ccall('Z3_goal_is_decided_unsat', 'boolean', ['number', 'number'], [c, g]);
            },
            goal_translate: Mod._Z3_goal_translate,
            goal_convert_model: Mod._Z3_goal_convert_model,
            goal_to_string: function (c, g) {
                return Mod.ccall('Z3_goal_to_string', 'string', ['number', 'number'], [c, g]);
            },
            goal_to_dimacs_string: function (c, g, include_names) {
                return Mod.ccall('Z3_goal_to_dimacs_string', 'string', ['number', 'number', 'boolean'], [c, g, include_names]);
            },
            mk_tactic: function (c, name) {
                return Mod.ccall('Z3_mk_tactic', 'number', ['number', 'string'], [c, name]);
            },
            tactic_inc_ref: Mod._Z3_tactic_inc_ref,
            tactic_dec_ref: Mod._Z3_tactic_dec_ref,
            mk_probe: function (c, name) {
                return Mod.ccall('Z3_mk_probe', 'number', ['number', 'string'], [c, name]);
            },
            probe_inc_ref: Mod._Z3_probe_inc_ref,
            probe_dec_ref: Mod._Z3_probe_dec_ref,
            tactic_and_then: Mod._Z3_tactic_and_then,
            tactic_or_else: Mod._Z3_tactic_or_else,
            tactic_par_or: function (c, ts) {
                return Mod.ccall('Z3_tactic_par_or', 'number', ['number', 'number', 'array'], [c, ts.length, intArrayToByteArr(ts)]);
            },
            tactic_par_and_then: Mod._Z3_tactic_par_and_then,
            tactic_try_for: Mod._Z3_tactic_try_for,
            tactic_when: Mod._Z3_tactic_when,
            tactic_cond: Mod._Z3_tactic_cond,
            tactic_repeat: Mod._Z3_tactic_repeat,
            tactic_skip: Mod._Z3_tactic_skip,
            tactic_fail: Mod._Z3_tactic_fail,
            tactic_fail_if: Mod._Z3_tactic_fail_if,
            tactic_fail_if_not_decided: Mod._Z3_tactic_fail_if_not_decided,
            tactic_using_params: Mod._Z3_tactic_using_params,
            mk_simplifier: function (c, name) {
                return Mod.ccall('Z3_mk_simplifier', 'number', ['number', 'string'], [c, name]);
            },
            simplifier_inc_ref: Mod._Z3_simplifier_inc_ref,
            simplifier_dec_ref: Mod._Z3_simplifier_dec_ref,
            solver_add_simplifier: Mod._Z3_solver_add_simplifier,
            simplifier_and_then: Mod._Z3_simplifier_and_then,
            simplifier_using_params: Mod._Z3_simplifier_using_params,
            get_num_simplifiers: function (c) {
                let ret = Mod.ccall('Z3_get_num_simplifiers', 'number', ['number'], [c]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            get_simplifier_name: function (c, i) {
                return Mod.ccall('Z3_get_simplifier_name', 'string', ['number', 'number'], [c, i]);
            },
            simplifier_get_help: function (c, t) {
                return Mod.ccall('Z3_simplifier_get_help', 'string', ['number', 'number'], [c, t]);
            },
            simplifier_get_param_descrs: Mod._Z3_simplifier_get_param_descrs,
            simplifier_get_descr: function (c, name) {
                return Mod.ccall('Z3_simplifier_get_descr', 'string', ['number', 'string'], [c, name]);
            },
            probe_const: Mod._Z3_probe_const,
            probe_lt: Mod._Z3_probe_lt,
            probe_gt: Mod._Z3_probe_gt,
            probe_le: Mod._Z3_probe_le,
            probe_ge: Mod._Z3_probe_ge,
            probe_eq: Mod._Z3_probe_eq,
            probe_and: Mod._Z3_probe_and,
            probe_or: Mod._Z3_probe_or,
            probe_not: Mod._Z3_probe_not,
            get_num_tactics: function (c) {
                let ret = Mod.ccall('Z3_get_num_tactics', 'number', ['number'], [c]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            get_tactic_name: function (c, i) {
                return Mod.ccall('Z3_get_tactic_name', 'string', ['number', 'number'], [c, i]);
            },
            get_num_probes: function (c) {
                let ret = Mod.ccall('Z3_get_num_probes', 'number', ['number'], [c]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            get_probe_name: function (c, i) {
                return Mod.ccall('Z3_get_probe_name', 'string', ['number', 'number'], [c, i]);
            },
            tactic_get_help: function (c, t) {
                return Mod.ccall('Z3_tactic_get_help', 'string', ['number', 'number'], [c, t]);
            },
            tactic_get_param_descrs: Mod._Z3_tactic_get_param_descrs,
            tactic_get_descr: function (c, name) {
                return Mod.ccall('Z3_tactic_get_descr', 'string', ['number', 'string'], [c, name]);
            },
            probe_get_descr: function (c, name) {
                return Mod.ccall('Z3_probe_get_descr', 'string', ['number', 'string'], [c, name]);
            },
            probe_apply: Mod._Z3_probe_apply,
            tactic_apply: function (c, t, g) {
                return Mod.async_call(Mod._async_Z3_tactic_apply, c, t, g);
            },
            tactic_apply_ex: function (c, t, g, p) {
                return Mod.async_call(Mod._async_Z3_tactic_apply_ex, c, t, g, p);
            },
            apply_result_inc_ref: Mod._Z3_apply_result_inc_ref,
            apply_result_dec_ref: Mod._Z3_apply_result_dec_ref,
            apply_result_to_string: function (c, r) {
                return Mod.ccall('Z3_apply_result_to_string', 'string', ['number', 'number'], [c, r]);
            },
            apply_result_get_num_subgoals: function (c, r) {
                let ret = Mod.ccall('Z3_apply_result_get_num_subgoals', 'number', ['number', 'number'], [c, r]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            apply_result_get_subgoal: Mod._Z3_apply_result_get_subgoal,
            mk_solver: Mod._Z3_mk_solver,
            mk_simple_solver: Mod._Z3_mk_simple_solver,
            mk_solver_for_logic: Mod._Z3_mk_solver_for_logic,
            mk_solver_from_tactic: Mod._Z3_mk_solver_from_tactic,
            solver_translate: Mod._Z3_solver_translate,
            solver_import_model_converter: Mod._Z3_solver_import_model_converter,
            solver_get_help: function (c, s) {
                return Mod.ccall('Z3_solver_get_help', 'string', ['number', 'number'], [c, s]);
            },
            solver_get_param_descrs: Mod._Z3_solver_get_param_descrs,
            solver_set_params: Mod._Z3_solver_set_params,
            solver_inc_ref: Mod._Z3_solver_inc_ref,
            solver_dec_ref: Mod._Z3_solver_dec_ref,
            solver_interrupt: Mod._Z3_solver_interrupt,
            solver_push: Mod._Z3_solver_push,
            solver_pop: Mod._Z3_solver_pop,
            solver_reset: Mod._Z3_solver_reset,
            solver_get_num_scopes: function (c, s) {
                let ret = Mod.ccall('Z3_solver_get_num_scopes', 'number', ['number', 'number'], [c, s]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            solver_assert: Mod._Z3_solver_assert,
            solver_assert_and_track: Mod._Z3_solver_assert_and_track,
            solver_from_file: function (c, s, file_name) {
                return Mod.ccall('Z3_solver_from_file', 'void', ['number', 'number', 'string'], [c, s, file_name]);
            },
            solver_from_string: function (c, s, str) {
                return Mod.ccall('Z3_solver_from_string', 'void', ['number', 'number', 'string'], [c, s, str]);
            },
            solver_get_assertions: Mod._Z3_solver_get_assertions,
            solver_get_units: Mod._Z3_solver_get_units,
            solver_get_trail: Mod._Z3_solver_get_trail,
            solver_get_non_units: Mod._Z3_solver_get_non_units,
            solver_get_levels: function (c, s, literals, sz) {
                let outArray_levels = Mod._malloc(4 * sz);
                try {
                    let ret = Mod.ccall('Z3_solver_get_levels', 'void', ['number', 'number', 'number', 'number', 'number'], [c, s, literals, sz, outArray_levels]);
                    return readUintArray(outArray_levels, sz);
                }
                finally {
                    Mod._free(outArray_levels);
                }
            },
            solver_congruence_root: Mod._Z3_solver_congruence_root,
            solver_congruence_next: Mod._Z3_solver_congruence_next,
            solver_congruence_explain: Mod._Z3_solver_congruence_explain,
            solver_solve_for: Mod._Z3_solver_solve_for,
            solver_next_split: function (c, cb, t, idx, phase) {
                return Mod.ccall('Z3_solver_next_split', 'boolean', ['number', 'number', 'number', 'number', 'number'], [c, cb, t, idx, phase]);
            },
            solver_propagate_declare: function (c, name, domain, range) {
                return Mod.ccall('Z3_solver_propagate_declare', 'number', ['number', 'number', 'number', 'array', 'number'], [
                    c,
                    name,
                    domain.length,
                    intArrayToByteArr(domain),
                    range,
                ]);
            },
            solver_propagate_register: Mod._Z3_solver_propagate_register,
            solver_propagate_register_cb: Mod._Z3_solver_propagate_register_cb,
            solver_propagate_consequence: function (c, cb, fixed, eq_lhs, eq_rhs, conseq) {
                if (eq_lhs.length !== eq_rhs.length) {
                    throw new TypeError(`eq_lhs and eq_rhs must be the same length (got ${eq_lhs.length} and {eq_rhs.length})`);
                }
                return Mod.ccall('Z3_solver_propagate_consequence', 'boolean', [
                    'number',
                    'number',
                    'number',
                    'array',
                    'number',
                    'array',
                    'array',
                    'number',
                ], [
                    c,
                    cb,
                    fixed.length,
                    intArrayToByteArr(fixed),
                    eq_lhs.length,
                    intArrayToByteArr(eq_lhs),
                    intArrayToByteArr(eq_rhs),
                    conseq,
                ]);
            },
            solver_set_initial_value: Mod._Z3_solver_set_initial_value,
            solver_check: function (c, s) {
                return Mod.async_call(Mod._async_Z3_solver_check, c, s);
            },
            solver_check_assumptions: async function (c, s, assumptions) {
                const assumptions_ptr = Mod._malloc(assumptions.length * 4);
                Mod.HEAPU32.set(assumptions, assumptions_ptr / 4);
                try {
                    let ret = await Mod.async_call(() => Mod.ccall('async_Z3_solver_check_assumptions', 'void', ['number', 'number', 'number', 'number'], [c, s, assumptions.length, assumptions_ptr]));
                    return ret;
                }
                finally {
                    Mod._free(assumptions_ptr);
                }
            },
            get_implied_equalities: function (c, s, terms) {
                let outArray_class_ids = Mod._malloc(4 * terms.length);
                try {
                    let ret = Mod.ccall('Z3_get_implied_equalities', 'number', ['number', 'number', 'number', 'array', 'number'], [
                        c,
                        s,
                        terms.length,
                        intArrayToByteArr(terms),
                        outArray_class_ids,
                    ]);
                    return {
                        rv: ret,
                        class_ids: readUintArray(outArray_class_ids, terms.length),
                    };
                }
                finally {
                    Mod._free(outArray_class_ids);
                }
            },
            solver_get_consequences: function (c, s, assumptions, variables, consequences) {
                return Mod.async_call(Mod._async_Z3_solver_get_consequences, c, s, assumptions, variables, consequences);
            },
            solver_cube: function (c, s, vars, backtrack_level) {
                return Mod.async_call(Mod._async_Z3_solver_cube, c, s, vars, backtrack_level);
            },
            solver_get_model: Mod._Z3_solver_get_model,
            solver_get_proof: Mod._Z3_solver_get_proof,
            solver_get_unsat_core: Mod._Z3_solver_get_unsat_core,
            solver_get_reason_unknown: function (c, s) {
                return Mod.ccall('Z3_solver_get_reason_unknown', 'string', ['number', 'number'], [c, s]);
            },
            solver_get_statistics: Mod._Z3_solver_get_statistics,
            solver_to_string: function (c, s) {
                return Mod.ccall('Z3_solver_to_string', 'string', ['number', 'number'], [c, s]);
            },
            solver_to_dimacs_string: function (c, s, include_names) {
                return Mod.ccall('Z3_solver_to_dimacs_string', 'string', ['number', 'number', 'boolean'], [c, s, include_names]);
            },
            stats_to_string: function (c, s) {
                return Mod.ccall('Z3_stats_to_string', 'string', ['number', 'number'], [c, s]);
            },
            stats_inc_ref: Mod._Z3_stats_inc_ref,
            stats_dec_ref: Mod._Z3_stats_dec_ref,
            stats_size: function (c, s) {
                let ret = Mod.ccall('Z3_stats_size', 'number', ['number', 'number'], [c, s]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            stats_get_key: function (c, s, idx) {
                return Mod.ccall('Z3_stats_get_key', 'string', ['number', 'number', 'number'], [c, s, idx]);
            },
            stats_is_uint: function (c, s, idx) {
                return Mod.ccall('Z3_stats_is_uint', 'boolean', ['number', 'number', 'number'], [c, s, idx]);
            },
            stats_is_double: function (c, s, idx) {
                return Mod.ccall('Z3_stats_is_double', 'boolean', ['number', 'number', 'number'], [c, s, idx]);
            },
            stats_get_uint_value: function (c, s, idx) {
                let ret = Mod.ccall('Z3_stats_get_uint_value', 'number', ['number', 'number', 'number'], [c, s, idx]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            stats_get_double_value: Mod._Z3_stats_get_double_value,
            get_estimated_alloc_size: Mod._Z3_get_estimated_alloc_size,
            algebraic_is_value: function (c, a) {
                return Mod.ccall('Z3_algebraic_is_value', 'boolean', ['number', 'number'], [c, a]);
            },
            algebraic_is_pos: function (c, a) {
                return Mod.ccall('Z3_algebraic_is_pos', 'boolean', ['number', 'number'], [c, a]);
            },
            algebraic_is_neg: function (c, a) {
                return Mod.ccall('Z3_algebraic_is_neg', 'boolean', ['number', 'number'], [c, a]);
            },
            algebraic_is_zero: function (c, a) {
                return Mod.ccall('Z3_algebraic_is_zero', 'boolean', ['number', 'number'], [c, a]);
            },
            algebraic_sign: Mod._Z3_algebraic_sign,
            algebraic_add: Mod._Z3_algebraic_add,
            algebraic_sub: Mod._Z3_algebraic_sub,
            algebraic_mul: Mod._Z3_algebraic_mul,
            algebraic_div: Mod._Z3_algebraic_div,
            algebraic_root: Mod._Z3_algebraic_root,
            algebraic_power: Mod._Z3_algebraic_power,
            algebraic_lt: function (c, a, b) {
                return Mod.ccall('Z3_algebraic_lt', 'boolean', ['number', 'number', 'number'], [c, a, b]);
            },
            algebraic_gt: function (c, a, b) {
                return Mod.ccall('Z3_algebraic_gt', 'boolean', ['number', 'number', 'number'], [c, a, b]);
            },
            algebraic_le: function (c, a, b) {
                return Mod.ccall('Z3_algebraic_le', 'boolean', ['number', 'number', 'number'], [c, a, b]);
            },
            algebraic_ge: function (c, a, b) {
                return Mod.ccall('Z3_algebraic_ge', 'boolean', ['number', 'number', 'number'], [c, a, b]);
            },
            algebraic_eq: function (c, a, b) {
                return Mod.ccall('Z3_algebraic_eq', 'boolean', ['number', 'number', 'number'], [c, a, b]);
            },
            algebraic_neq: function (c, a, b) {
                return Mod.ccall('Z3_algebraic_neq', 'boolean', ['number', 'number', 'number'], [c, a, b]);
            },
            algebraic_roots: async function (c, p, a) {
                const a_ptr = Mod._malloc(a.length * 4);
                Mod.HEAPU32.set(a, a_ptr / 4);
                try {
                    let ret = await Mod.async_call(() => Mod.ccall('async_Z3_algebraic_roots', 'void', ['number', 'number', 'number', 'number'], [c, p, a.length, a_ptr]));
                    return ret;
                }
                finally {
                    Mod._free(a_ptr);
                }
            },
            algebraic_eval: async function (c, p, a) {
                const a_ptr = Mod._malloc(a.length * 4);
                Mod.HEAPU32.set(a, a_ptr / 4);
                try {
                    let ret = await Mod.async_call(() => Mod.ccall('async_Z3_algebraic_eval', 'void', ['number', 'number', 'number', 'number'], [c, p, a.length, a_ptr]));
                    return ret;
                }
                finally {
                    Mod._free(a_ptr);
                }
            },
            algebraic_get_poly: Mod._Z3_algebraic_get_poly,
            algebraic_get_i: function (c, a) {
                let ret = Mod.ccall('Z3_algebraic_get_i', 'number', ['number', 'number'], [c, a]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            mk_ast_vector: Mod._Z3_mk_ast_vector,
            ast_vector_inc_ref: Mod._Z3_ast_vector_inc_ref,
            ast_vector_dec_ref: Mod._Z3_ast_vector_dec_ref,
            ast_vector_size: function (c, v) {
                let ret = Mod.ccall('Z3_ast_vector_size', 'number', ['number', 'number'], [c, v]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            ast_vector_get: Mod._Z3_ast_vector_get,
            ast_vector_set: Mod._Z3_ast_vector_set,
            ast_vector_resize: Mod._Z3_ast_vector_resize,
            ast_vector_push: Mod._Z3_ast_vector_push,
            ast_vector_translate: Mod._Z3_ast_vector_translate,
            ast_vector_to_string: function (c, v) {
                return Mod.ccall('Z3_ast_vector_to_string', 'string', ['number', 'number'], [c, v]);
            },
            mk_ast_map: Mod._Z3_mk_ast_map,
            ast_map_inc_ref: Mod._Z3_ast_map_inc_ref,
            ast_map_dec_ref: Mod._Z3_ast_map_dec_ref,
            ast_map_contains: function (c, m, k) {
                return Mod.ccall('Z3_ast_map_contains', 'boolean', ['number', 'number', 'number'], [c, m, k]);
            },
            ast_map_find: Mod._Z3_ast_map_find,
            ast_map_insert: Mod._Z3_ast_map_insert,
            ast_map_erase: Mod._Z3_ast_map_erase,
            ast_map_reset: Mod._Z3_ast_map_reset,
            ast_map_size: function (c, m) {
                let ret = Mod.ccall('Z3_ast_map_size', 'number', ['number', 'number'], [c, m]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            ast_map_keys: Mod._Z3_ast_map_keys,
            ast_map_to_string: function (c, m) {
                return Mod.ccall('Z3_ast_map_to_string', 'string', ['number', 'number'], [c, m]);
            },
            mk_fixedpoint: Mod._Z3_mk_fixedpoint,
            fixedpoint_inc_ref: Mod._Z3_fixedpoint_inc_ref,
            fixedpoint_dec_ref: Mod._Z3_fixedpoint_dec_ref,
            fixedpoint_add_rule: Mod._Z3_fixedpoint_add_rule,
            fixedpoint_add_fact: function (c, d, r, args) {
                return Mod.ccall('Z3_fixedpoint_add_fact', 'void', ['number', 'number', 'number', 'number', 'array'], [
                    c,
                    d,
                    r,
                    args.length,
                    intArrayToByteArr(args),
                ]);
            },
            fixedpoint_assert: Mod._Z3_fixedpoint_assert,
            fixedpoint_query: function (c, d, query) {
                return Mod.async_call(Mod._async_Z3_fixedpoint_query, c, d, query);
            },
            fixedpoint_query_relations: async function (c, d, relations) {
                const relations_ptr = Mod._malloc(relations.length * 4);
                Mod.HEAPU32.set(relations, relations_ptr / 4);
                try {
                    let ret = await Mod.async_call(() => Mod.ccall('async_Z3_fixedpoint_query_relations', 'void', ['number', 'number', 'number', 'number'], [c, d, relations.length, relations_ptr]));
                    return ret;
                }
                finally {
                    Mod._free(relations_ptr);
                }
            },
            fixedpoint_get_answer: Mod._Z3_fixedpoint_get_answer,
            fixedpoint_get_reason_unknown: function (c, d) {
                return Mod.ccall('Z3_fixedpoint_get_reason_unknown', 'string', ['number', 'number'], [c, d]);
            },
            fixedpoint_update_rule: Mod._Z3_fixedpoint_update_rule,
            fixedpoint_get_num_levels: function (c, d, pred) {
                let ret = Mod.ccall('Z3_fixedpoint_get_num_levels', 'number', ['number', 'number', 'number'], [c, d, pred]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            fixedpoint_get_cover_delta: Mod._Z3_fixedpoint_get_cover_delta,
            fixedpoint_add_cover: Mod._Z3_fixedpoint_add_cover,
            fixedpoint_get_statistics: Mod._Z3_fixedpoint_get_statistics,
            fixedpoint_register_relation: Mod._Z3_fixedpoint_register_relation,
            fixedpoint_set_predicate_representation: function (c, d, f, relation_kinds) {
                return Mod.ccall('Z3_fixedpoint_set_predicate_representation', 'void', ['number', 'number', 'number', 'number', 'array'], [
                    c,
                    d,
                    f,
                    relation_kinds.length,
                    intArrayToByteArr(relation_kinds),
                ]);
            },
            fixedpoint_get_rules: Mod._Z3_fixedpoint_get_rules,
            fixedpoint_get_assertions: Mod._Z3_fixedpoint_get_assertions,
            fixedpoint_set_params: Mod._Z3_fixedpoint_set_params,
            fixedpoint_get_help: function (c, f) {
                return Mod.ccall('Z3_fixedpoint_get_help', 'string', ['number', 'number'], [c, f]);
            },
            fixedpoint_get_param_descrs: Mod._Z3_fixedpoint_get_param_descrs,
            fixedpoint_to_string: function (c, f, queries) {
                return Mod.ccall('Z3_fixedpoint_to_string', 'string', ['number', 'number', 'number', 'array'], [
                    c,
                    f,
                    queries.length,
                    intArrayToByteArr(queries),
                ]);
            },
            fixedpoint_from_string: function (c, f, s) {
                return Mod.ccall('Z3_fixedpoint_from_string', 'number', ['number', 'number', 'string'], [c, f, s]);
            },
            fixedpoint_from_file: function (c, f, s) {
                return Mod.ccall('Z3_fixedpoint_from_file', 'number', ['number', 'number', 'string'], [c, f, s]);
            },
            mk_fpa_rounding_mode_sort: Mod._Z3_mk_fpa_rounding_mode_sort,
            mk_fpa_round_nearest_ties_to_even: Mod._Z3_mk_fpa_round_nearest_ties_to_even,
            mk_fpa_rne: Mod._Z3_mk_fpa_rne,
            mk_fpa_round_nearest_ties_to_away: Mod._Z3_mk_fpa_round_nearest_ties_to_away,
            mk_fpa_rna: Mod._Z3_mk_fpa_rna,
            mk_fpa_round_toward_positive: Mod._Z3_mk_fpa_round_toward_positive,
            mk_fpa_rtp: Mod._Z3_mk_fpa_rtp,
            mk_fpa_round_toward_negative: Mod._Z3_mk_fpa_round_toward_negative,
            mk_fpa_rtn: Mod._Z3_mk_fpa_rtn,
            mk_fpa_round_toward_zero: Mod._Z3_mk_fpa_round_toward_zero,
            mk_fpa_rtz: Mod._Z3_mk_fpa_rtz,
            mk_fpa_sort: Mod._Z3_mk_fpa_sort,
            mk_fpa_sort_half: Mod._Z3_mk_fpa_sort_half,
            mk_fpa_sort_16: Mod._Z3_mk_fpa_sort_16,
            mk_fpa_sort_single: Mod._Z3_mk_fpa_sort_single,
            mk_fpa_sort_32: Mod._Z3_mk_fpa_sort_32,
            mk_fpa_sort_double: Mod._Z3_mk_fpa_sort_double,
            mk_fpa_sort_64: Mod._Z3_mk_fpa_sort_64,
            mk_fpa_sort_quadruple: Mod._Z3_mk_fpa_sort_quadruple,
            mk_fpa_sort_128: Mod._Z3_mk_fpa_sort_128,
            mk_fpa_nan: Mod._Z3_mk_fpa_nan,
            mk_fpa_inf: Mod._Z3_mk_fpa_inf,
            mk_fpa_zero: Mod._Z3_mk_fpa_zero,
            mk_fpa_fp: Mod._Z3_mk_fpa_fp,
            mk_fpa_numeral_float: Mod._Z3_mk_fpa_numeral_float,
            mk_fpa_numeral_double: Mod._Z3_mk_fpa_numeral_double,
            mk_fpa_numeral_int: Mod._Z3_mk_fpa_numeral_int,
            mk_fpa_numeral_int_uint: Mod._Z3_mk_fpa_numeral_int_uint,
            mk_fpa_numeral_int64_uint64: Mod._Z3_mk_fpa_numeral_int64_uint64,
            mk_fpa_abs: Mod._Z3_mk_fpa_abs,
            mk_fpa_neg: Mod._Z3_mk_fpa_neg,
            mk_fpa_add: Mod._Z3_mk_fpa_add,
            mk_fpa_sub: Mod._Z3_mk_fpa_sub,
            mk_fpa_mul: Mod._Z3_mk_fpa_mul,
            mk_fpa_div: Mod._Z3_mk_fpa_div,
            mk_fpa_fma: Mod._Z3_mk_fpa_fma,
            mk_fpa_sqrt: Mod._Z3_mk_fpa_sqrt,
            mk_fpa_rem: Mod._Z3_mk_fpa_rem,
            mk_fpa_round_to_integral: Mod._Z3_mk_fpa_round_to_integral,
            mk_fpa_min: Mod._Z3_mk_fpa_min,
            mk_fpa_max: Mod._Z3_mk_fpa_max,
            mk_fpa_leq: Mod._Z3_mk_fpa_leq,
            mk_fpa_lt: Mod._Z3_mk_fpa_lt,
            mk_fpa_geq: Mod._Z3_mk_fpa_geq,
            mk_fpa_gt: Mod._Z3_mk_fpa_gt,
            mk_fpa_eq: Mod._Z3_mk_fpa_eq,
            mk_fpa_is_normal: Mod._Z3_mk_fpa_is_normal,
            mk_fpa_is_subnormal: Mod._Z3_mk_fpa_is_subnormal,
            mk_fpa_is_zero: Mod._Z3_mk_fpa_is_zero,
            mk_fpa_is_infinite: Mod._Z3_mk_fpa_is_infinite,
            mk_fpa_is_nan: Mod._Z3_mk_fpa_is_nan,
            mk_fpa_is_negative: Mod._Z3_mk_fpa_is_negative,
            mk_fpa_is_positive: Mod._Z3_mk_fpa_is_positive,
            mk_fpa_to_fp_bv: Mod._Z3_mk_fpa_to_fp_bv,
            mk_fpa_to_fp_float: Mod._Z3_mk_fpa_to_fp_float,
            mk_fpa_to_fp_real: Mod._Z3_mk_fpa_to_fp_real,
            mk_fpa_to_fp_signed: Mod._Z3_mk_fpa_to_fp_signed,
            mk_fpa_to_fp_unsigned: Mod._Z3_mk_fpa_to_fp_unsigned,
            mk_fpa_to_ubv: Mod._Z3_mk_fpa_to_ubv,
            mk_fpa_to_sbv: Mod._Z3_mk_fpa_to_sbv,
            mk_fpa_to_real: Mod._Z3_mk_fpa_to_real,
            fpa_get_ebits: function (c, s) {
                let ret = Mod.ccall('Z3_fpa_get_ebits', 'number', ['number', 'number'], [c, s]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            fpa_get_sbits: function (c, s) {
                let ret = Mod.ccall('Z3_fpa_get_sbits', 'number', ['number', 'number'], [c, s]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            fpa_is_numeral: function (c, t) {
                return Mod.ccall('Z3_fpa_is_numeral', 'boolean', ['number', 'number'], [c, t]);
            },
            fpa_is_numeral_nan: function (c, t) {
                return Mod.ccall('Z3_fpa_is_numeral_nan', 'boolean', ['number', 'number'], [c, t]);
            },
            fpa_is_numeral_inf: function (c, t) {
                return Mod.ccall('Z3_fpa_is_numeral_inf', 'boolean', ['number', 'number'], [c, t]);
            },
            fpa_is_numeral_zero: function (c, t) {
                return Mod.ccall('Z3_fpa_is_numeral_zero', 'boolean', ['number', 'number'], [c, t]);
            },
            fpa_is_numeral_normal: function (c, t) {
                return Mod.ccall('Z3_fpa_is_numeral_normal', 'boolean', ['number', 'number'], [c, t]);
            },
            fpa_is_numeral_subnormal: function (c, t) {
                return Mod.ccall('Z3_fpa_is_numeral_subnormal', 'boolean', ['number', 'number'], [c, t]);
            },
            fpa_is_numeral_positive: function (c, t) {
                return Mod.ccall('Z3_fpa_is_numeral_positive', 'boolean', ['number', 'number'], [c, t]);
            },
            fpa_is_numeral_negative: function (c, t) {
                return Mod.ccall('Z3_fpa_is_numeral_negative', 'boolean', ['number', 'number'], [c, t]);
            },
            fpa_get_numeral_sign_bv: Mod._Z3_fpa_get_numeral_sign_bv,
            fpa_get_numeral_significand_bv: Mod._Z3_fpa_get_numeral_significand_bv,
            fpa_get_numeral_significand_string: function (c, t) {
                return Mod.ccall('Z3_fpa_get_numeral_significand_string', 'string', ['number', 'number'], [c, t]);
            },
            fpa_get_numeral_significand_uint64: function (c, t) {
                let ret = Mod.ccall('Z3_fpa_get_numeral_significand_uint64', 'boolean', ['number', 'number', 'number'], [c, t, outAddress]);
                if (!ret) {
                    return null;
                }
                return getOutUint64(0);
            },
            fpa_get_numeral_exponent_string: function (c, t, biased) {
                return Mod.ccall('Z3_fpa_get_numeral_exponent_string', 'string', ['number', 'number', 'boolean'], [c, t, biased]);
            },
            fpa_get_numeral_exponent_int64: function (c, t, biased) {
                let ret = Mod.ccall('Z3_fpa_get_numeral_exponent_int64', 'boolean', ['number', 'number', 'number', 'boolean'], [c, t, outAddress, biased]);
                if (!ret) {
                    return null;
                }
                return getOutInt64(0);
            },
            fpa_get_numeral_exponent_bv: Mod._Z3_fpa_get_numeral_exponent_bv,
            mk_fpa_to_ieee_bv: Mod._Z3_mk_fpa_to_ieee_bv,
            mk_fpa_to_fp_int_real: Mod._Z3_mk_fpa_to_fp_int_real,
            mk_optimize: Mod._Z3_mk_optimize,
            optimize_inc_ref: Mod._Z3_optimize_inc_ref,
            optimize_dec_ref: Mod._Z3_optimize_dec_ref,
            optimize_assert: Mod._Z3_optimize_assert,
            optimize_assert_and_track: Mod._Z3_optimize_assert_and_track,
            optimize_assert_soft: function (c, o, a, weight, id) {
                let ret = Mod.ccall('Z3_optimize_assert_soft', 'number', ['number', 'number', 'number', 'string', 'number'], [c, o, a, weight, id]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            optimize_maximize: function (c, o, t) {
                let ret = Mod.ccall('Z3_optimize_maximize', 'number', ['number', 'number', 'number'], [c, o, t]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            optimize_minimize: function (c, o, t) {
                let ret = Mod.ccall('Z3_optimize_minimize', 'number', ['number', 'number', 'number'], [c, o, t]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            optimize_push: Mod._Z3_optimize_push,
            optimize_pop: Mod._Z3_optimize_pop,
            optimize_set_initial_value: Mod._Z3_optimize_set_initial_value,
            optimize_check: async function (c, o, assumptions) {
                const assumptions_ptr = Mod._malloc(assumptions.length * 4);
                Mod.HEAPU32.set(assumptions, assumptions_ptr / 4);
                try {
                    let ret = await Mod.async_call(() => Mod.ccall('async_Z3_optimize_check', 'void', ['number', 'number', 'number', 'number'], [c, o, assumptions.length, assumptions_ptr]));
                    return ret;
                }
                finally {
                    Mod._free(assumptions_ptr);
                }
            },
            optimize_get_reason_unknown: function (c, d) {
                return Mod.ccall('Z3_optimize_get_reason_unknown', 'string', ['number', 'number'], [c, d]);
            },
            optimize_get_model: Mod._Z3_optimize_get_model,
            optimize_get_unsat_core: Mod._Z3_optimize_get_unsat_core,
            optimize_set_params: Mod._Z3_optimize_set_params,
            optimize_get_param_descrs: Mod._Z3_optimize_get_param_descrs,
            optimize_get_lower: Mod._Z3_optimize_get_lower,
            optimize_get_upper: Mod._Z3_optimize_get_upper,
            optimize_get_lower_as_vector: Mod._Z3_optimize_get_lower_as_vector,
            optimize_get_upper_as_vector: Mod._Z3_optimize_get_upper_as_vector,
            optimize_to_string: function (c, o) {
                return Mod.ccall('Z3_optimize_to_string', 'string', ['number', 'number'], [c, o]);
            },
            optimize_from_string: function (c, o, s) {
                return Mod.ccall('Z3_optimize_from_string', 'void', ['number', 'number', 'string'], [c, o, s]);
            },
            optimize_from_file: function (c, o, s) {
                return Mod.ccall('Z3_optimize_from_file', 'void', ['number', 'number', 'string'], [c, o, s]);
            },
            optimize_get_help: function (c, t) {
                return Mod.ccall('Z3_optimize_get_help', 'string', ['number', 'number'], [c, t]);
            },
            optimize_get_statistics: Mod._Z3_optimize_get_statistics,
            optimize_get_assertions: Mod._Z3_optimize_get_assertions,
            optimize_get_objectives: Mod._Z3_optimize_get_objectives,
            optimize_translate: Mod._Z3_optimize_translate,
            polynomial_subresultants: function (c, p, q, x) {
                return Mod.async_call(Mod._async_Z3_polynomial_subresultants, c, p, q, x);
            },
            rcf_del: Mod._Z3_rcf_del,
            rcf_mk_rational: function (c, val) {
                return Mod.ccall('Z3_rcf_mk_rational', 'number', ['number', 'string'], [c, val]);
            },
            rcf_mk_small_int: Mod._Z3_rcf_mk_small_int,
            rcf_mk_pi: Mod._Z3_rcf_mk_pi,
            rcf_mk_e: Mod._Z3_rcf_mk_e,
            rcf_mk_infinitesimal: Mod._Z3_rcf_mk_infinitesimal,
            rcf_mk_roots: function (c, a) {
                let outArray_roots = Mod._malloc(4 * a.length);
                try {
                    let ret = Mod.ccall('Z3_rcf_mk_roots', 'number', ['number', 'number', 'array', 'number'], [
                        c,
                        a.length,
                        intArrayToByteArr(a),
                        outArray_roots,
                    ]);
                    ret = new Uint32Array([ret])[0];
                    return {
                        rv: ret,
                        roots: readUintArray(outArray_roots, a.length),
                    };
                }
                finally {
                    Mod._free(outArray_roots);
                }
            },
            rcf_add: Mod._Z3_rcf_add,
            rcf_sub: Mod._Z3_rcf_sub,
            rcf_mul: Mod._Z3_rcf_mul,
            rcf_div: Mod._Z3_rcf_div,
            rcf_neg: Mod._Z3_rcf_neg,
            rcf_inv: Mod._Z3_rcf_inv,
            rcf_power: Mod._Z3_rcf_power,
            rcf_lt: function (c, a, b) {
                return Mod.ccall('Z3_rcf_lt', 'boolean', ['number', 'number', 'number'], [c, a, b]);
            },
            rcf_gt: function (c, a, b) {
                return Mod.ccall('Z3_rcf_gt', 'boolean', ['number', 'number', 'number'], [c, a, b]);
            },
            rcf_le: function (c, a, b) {
                return Mod.ccall('Z3_rcf_le', 'boolean', ['number', 'number', 'number'], [c, a, b]);
            },
            rcf_ge: function (c, a, b) {
                return Mod.ccall('Z3_rcf_ge', 'boolean', ['number', 'number', 'number'], [c, a, b]);
            },
            rcf_eq: function (c, a, b) {
                return Mod.ccall('Z3_rcf_eq', 'boolean', ['number', 'number', 'number'], [c, a, b]);
            },
            rcf_neq: function (c, a, b) {
                return Mod.ccall('Z3_rcf_neq', 'boolean', ['number', 'number', 'number'], [c, a, b]);
            },
            rcf_num_to_string: function (c, a, compact, html) {
                return Mod.ccall('Z3_rcf_num_to_string', 'string', ['number', 'number', 'boolean', 'boolean'], [c, a, compact, html]);
            },
            rcf_num_to_decimal_string: function (c, a, prec) {
                return Mod.ccall('Z3_rcf_num_to_decimal_string', 'string', ['number', 'number', 'number'], [c, a, prec]);
            },
            rcf_get_numerator_denominator: function (c, a) {
                let ret = Mod.ccall('Z3_rcf_get_numerator_denominator', 'void', ['number', 'number', 'number', 'number'], [c, a, outAddress, outAddress + 4]);
                return {
                    n: getOutUint(0),
                    d: getOutUint(1),
                };
            },
            rcf_is_rational: function (c, a) {
                return Mod.ccall('Z3_rcf_is_rational', 'boolean', ['number', 'number'], [c, a]);
            },
            rcf_is_algebraic: function (c, a) {
                return Mod.ccall('Z3_rcf_is_algebraic', 'boolean', ['number', 'number'], [c, a]);
            },
            rcf_is_infinitesimal: function (c, a) {
                return Mod.ccall('Z3_rcf_is_infinitesimal', 'boolean', ['number', 'number'], [c, a]);
            },
            rcf_is_transcendental: function (c, a) {
                return Mod.ccall('Z3_rcf_is_transcendental', 'boolean', ['number', 'number'], [c, a]);
            },
            rcf_extension_index: function (c, a) {
                let ret = Mod.ccall('Z3_rcf_extension_index', 'number', ['number', 'number'], [c, a]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            rcf_transcendental_name: Mod._Z3_rcf_transcendental_name,
            rcf_infinitesimal_name: Mod._Z3_rcf_infinitesimal_name,
            rcf_num_coefficients: function (c, a) {
                let ret = Mod.ccall('Z3_rcf_num_coefficients', 'number', ['number', 'number'], [c, a]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            rcf_coefficient: Mod._Z3_rcf_coefficient,
            rcf_num_sign_conditions: function (c, a) {
                let ret = Mod.ccall('Z3_rcf_num_sign_conditions', 'number', ['number', 'number'], [c, a]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            rcf_sign_condition_sign: Mod._Z3_rcf_sign_condition_sign,
            rcf_num_sign_condition_coefficients: function (c, a, i) {
                let ret = Mod.ccall('Z3_rcf_num_sign_condition_coefficients', 'number', ['number', 'number', 'number'], [c, a, i]);
                ret = new Uint32Array([ret])[0];
                return ret;
            },
            rcf_sign_condition_coefficient: Mod._Z3_rcf_sign_condition_coefficient,
            fixedpoint_query_from_lvl: function (c, d, query, lvl) {
                return Mod.async_call(Mod._async_Z3_fixedpoint_query_from_lvl, c, d, query, lvl);
            },
            fixedpoint_get_ground_sat_answer: Mod._Z3_fixedpoint_get_ground_sat_answer,
            fixedpoint_get_rules_along_trace: Mod._Z3_fixedpoint_get_rules_along_trace,
            fixedpoint_get_rule_names_along_trace: Mod._Z3_fixedpoint_get_rule_names_along_trace,
            fixedpoint_add_invariant: Mod._Z3_fixedpoint_add_invariant,
            fixedpoint_get_reachable: Mod._Z3_fixedpoint_get_reachable,
            qe_model_project: function (c, m, bound, body) {
                return Mod.ccall('Z3_qe_model_project', 'number', ['number', 'number', 'number', 'array', 'number'], [
                    c,
                    m,
                    bound.length,
                    intArrayToByteArr(bound),
                    body,
                ]);
            },
            qe_model_project_skolem: function (c, m, bound, body, map) {
                return Mod.ccall('Z3_qe_model_project_skolem', 'number', ['number', 'number', 'number', 'array', 'number', 'number'], [
                    c,
                    m,
                    bound.length,
                    intArrayToByteArr(bound),
                    body,
                    map,
                ]);
            },
            qe_model_project_with_witness: function (c, m, bound, body, map) {
                return Mod.ccall('Z3_qe_model_project_with_witness', 'number', ['number', 'number', 'number', 'array', 'number', 'number'], [
                    c,
                    m,
                    bound.length,
                    intArrayToByteArr(bound),
                    body,
                    map,
                ]);
            },
            model_extrapolate: Mod._Z3_model_extrapolate,
            qe_lite: Mod._Z3_qe_lite,
        },
    };
}
