// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/marsh.c
// Function: unmarshal_one
static const uint8_t *unmarshal_one(
    UnmarshalState *st,
    const uint8_t *data,
    Janet *out,
    int flags) {
    uint8_t lead;
    MARSH_STACKCHECK;
    MARSH_EOS(st, data);
    lead = data[0];
    if (lead < LB_REAL) {
        *out = janet_wrap_integer(readint(st, &data));
        return data;
    }
    switch (lead) {
        case LB_NIL:
            *out = janet_wrap_nil();
            return data + 1;
        case LB_FALSE:
            *out = janet_wrap_false();
            return data + 1;
        case LB_TRUE:
            *out = janet_wrap_true();
            return data + 1;
        case LB_INTEGER:
            /* Long integer */
            MARSH_EOS(st, data + 4);
            uint32_t ui = ((uint32_t)(data[4])) |
                          ((uint32_t)(data[3]) << 8) |
                          ((uint32_t)(data[2]) << 16) |
                          ((uint32_t)(data[1]) << 24);
            int32_t si = (int32_t)ui;
            *out = janet_wrap_integer(si);
            return data + 5;
        case LB_REAL:
            /* Real */
        {
            union {
                double d;
                uint8_t bytes[8];
            } u;
            MARSH_EOS(st, data + 8);
#ifdef JANET_BIG_ENDIAN
            u.bytes[0] = data[8];
            u.bytes[1] = data[7];
            u.bytes[2] = data[6];
            u.bytes[3] = data[5];
            u.bytes[4] = data[4];
            u.bytes[5] = data[3];
            u.bytes[6] = data[2];
            u.bytes[7] = data[1];
#else
            memcpy(&u.bytes, data + 1, sizeof(double));
#endif
            *out = janet_wrap_number_safe(u.d);
            janet_v_push(st->lookup, *out);
            return data + 9;
        }
        case LB_STRING:
        case LB_SYMBOL:
        case LB_BUFFER:
        case LB_KEYWORD:
        case LB_REGISTRY: {
            data++;
            int32_t len = readnat(st, &data);
            MARSH_EOS(st, data - 1 + len);
            if (lead == LB_STRING) {
                const uint8_t *str = janet_string(data, len);
                *out = janet_wrap_string(str);
            } else if (lead == LB_SYMBOL) {
                const uint8_t *str = janet_symbol(data, len);
                *out = janet_wrap_symbol(str);
            } else if (lead == LB_KEYWORD) {
                const uint8_t *str = janet_keyword(data, len);
                *out = janet_wrap_keyword(str);
            } else if (lead == LB_REGISTRY) {
                if (st->reg) {
                    Janet regkey = janet_symbolv(data, len);
                    *out = janet_table_get(st->reg, regkey);
                } else {
                    *out = janet_wrap_nil();
                }
            } else { /* (lead == LB_BUFFER) */
                JanetBuffer *buffer = janet_buffer(len);
                buffer->count = len;
                safe_memcpy(buffer->data, data, len);
                *out = janet_wrap_buffer(buffer);
            }
            janet_v_push(st->lookup, *out);
            return data + len;
        }
        case LB_FIBER: {
            JanetFiber *fiber;
            data = unmarshal_one_fiber(st, data + 1, &fiber, flags + 1);
            *out = janet_wrap_fiber(fiber);
            return data;
        }
        case LB_FUNCTION: {
            JanetFunction *func;
            JanetFuncDef *def;
            data++;
            int32_t len = readnat(st, &data);
            if (len > 255) {
                janet_panicf("invalid function - too many environments (%d)", len);
            }
            func = janet_gcalloc(JANET_MEMORY_FUNCTION, sizeof(JanetFunction) +
                                 len * sizeof(JanetFuncEnv));
            func->def = NULL;
            for (int32_t i = 0; i < len; i++) {
                func->envs[i] = NULL;
            }
            *out = janet_wrap_function(func);
            janet_v_push(st->lookup, *out);
            data = unmarshal_one_def(st, data, &def, flags + 1);
            func->def = def;
            for (int32_t i = 0; i < len; i++) {
                data = unmarshal_one_env(st, data, &(func->envs[i]), flags + 1);
            }
            return data;
        }
        case LB_ABSTRACT: {
            data++;
            return unmarshal_one_abstract(st, data, out, flags);
        }
        case LB_REFERENCE:
        case LB_ARRAY:
        case LB_ARRAY_WEAK:
        case LB_TUPLE:
        case LB_STRUCT:
        case LB_STRUCT_PROTO:
        case LB_TABLE:
        case LB_TABLE_PROTO:
        case LB_TABLE_WEAKK:
        case LB_TABLE_WEAKV:
        case LB_TABLE_WEAKKV:
        case LB_TABLE_WEAKK_PROTO:
        case LB_TABLE_WEAKV_PROTO:
        case LB_TABLE_WEAKKV_PROTO:
            /* Things that open with integers */
        {
            data++;
            int32_t len = readnat(st, &data);
            /* DOS check */
            if (lead != LB_REFERENCE) {
                MARSH_EOS(st, data - 1 + len);
            }
            if (lead == LB_ARRAY || lead == LB_ARRAY_WEAK) {
                /* Array */
                JanetArray *array = (lead == LB_ARRAY_WEAK) ? janet_array_weak(len) : janet_array(len);
                array->count = len;
                *out = janet_wrap_array(array);
                janet_v_push(st->lookup, *out);
                for (int32_t i = 0; i < len; i++) {
                    data = unmarshal_one(st, data, array->data + i, flags + 1);
                }
            } else if (lead == LB_TUPLE) {
                /* Tuple */
                Janet *tup = janet_tuple_begin(len);
                int32_t flag = readint(st, &data);
                janet_tuple_flag(tup) |= flag << 16;
                for (int32_t i = 0; i < len; i++) {
                    data = unmarshal_one(st, data, tup + i, flags + 1);
                }
                *out = janet_wrap_tuple(janet_tuple_end(tup));
                janet_v_push(st->lookup, *out);
            } else if (lead == LB_STRUCT || lead == LB_STRUCT_PROTO) {
                /* Struct */
                JanetKV *struct_ = janet_struct_begin(len);
                if (lead == LB_STRUCT_PROTO) {
                    Janet proto;
                    data = unmarshal_one(st, data, &proto, flags + 1);
                    janet_asserttype(proto, JANET_STRUCT, st);
                    janet_struct_proto(struct_) = janet_unwrap_struct(proto);
                }
                for (int32_t i = 0; i < len; i++) {
                    Janet key, value;
                    data = unmarshal_one(st, data, &key, flags + 1);
                    data = unmarshal_one(st, data, &value, flags + 1);
                    janet_struct_put(struct_, key, value);
                }
                *out = janet_wrap_struct(janet_struct_end(struct_));
                janet_v_push(st->lookup, *out);
            } else if (lead == LB_REFERENCE) {
                if (len >= janet_v_count(st->lookup))
                    janet_panicf("invalid reference %d", len);
                *out = st->lookup[len];
            } else {
                /* Table */
                JanetTable *t;
                if (lead == LB_TABLE_WEAKK_PROTO || lead == LB_TABLE_WEAKK) {
                    t = janet_table_weakk(len);
                } else if (lead == LB_TABLE_WEAKV_PROTO || lead == LB_TABLE_WEAKV) {
                    t = janet_table_weakv(len);
                } else if (lead == LB_TABLE_WEAKKV_PROTO || lead == LB_TABLE_WEAKKV) {
                    t = janet_table_weakkv(len);
                } else {
                    t = janet_table(len);
                }
                *out = janet_wrap_table(t);
                janet_v_push(st->lookup, *out);
                if (lead == LB_TABLE_PROTO || lead == LB_TABLE_WEAKK_PROTO || lead == LB_TABLE_WEAKV_PROTO || lead == LB_TABLE_WEAKKV_PROTO) {
                    Janet proto;
                    data = unmarshal_one(st, data, &proto, flags + 1);
                    janet_asserttype(proto, JANET_TABLE, st);
                    t->proto = janet_unwrap_table(proto);
                }
                for (int32_t i = 0; i < len; i++) {
                    Janet key, value;
                    data = unmarshal_one(st, data, &key, flags + 1);
                    data = unmarshal_one(st, data, &value, flags + 1);
                    janet_table_put(t, key, value);
                }
            }
            return data;
        }
        case LB_UNSAFE_POINTER: {
            MARSH_EOS(st, data + sizeof(void *));
            data++;
            if (!(flags & JANET_MARSHAL_UNSAFE)) {
                janet_panicf("unsafe flag not given, "
                             "will not unmarshal raw pointer at index %d",
                             (int)(data - st->start));
            }
            union {
                void *ptr;
                uint8_t bytes[sizeof(void *)];
            } u;
            memcpy(u.bytes, data, sizeof(void *));
            data += sizeof(void *);
            *out = janet_wrap_pointer(u.ptr);
            janet_v_push(st->lookup, *out);
            return data;
        }
#ifdef JANET_EV
        case LB_POINTER_BUFFER: {
            data++;
            int32_t count = readnat(st, &data);
            int32_t capacity = readnat(st, &data);
            MARSH_EOS(st, data + sizeof(void *));
            union {
                void *ptr;
                uint8_t bytes[sizeof(void *)];
            } u;
            if (!(flags & JANET_MARSHAL_UNSAFE)) {
                janet_panicf("unsafe flag not given, "
                             "will not unmarshal raw pointer at index %d",
                             (int)(data - st->start));
            }
            memcpy(u.bytes, data, sizeof(void *));
            data += sizeof(void *);
            JanetBuffer *buffer = janet_pointer_buffer_unsafe(u.ptr, capacity, count);
            *out = janet_wrap_buffer(buffer);
            janet_v_push(st->lookup, *out);
            return data;
        }
#endif
        case LB_UNSAFE_CFUNCTION: {
            MARSH_EOS(st, data + sizeof(JanetCFunction));
            data++;
            if (!(flags & JANET_MARSHAL_UNSAFE)) {
                janet_panicf("unsafe flag not given, "
                             "will not unmarshal function pointer at index %d",
                             (int)(data - st->start));
            }
            union {
                JanetCFunction ptr;
                uint8_t bytes[sizeof(JanetCFunction)];
            } u;
            memcpy(u.bytes, data, sizeof(JanetCFunction));
            data += sizeof(JanetCFunction);
            *out = janet_wrap_cfunction(u.ptr);
            janet_v_push(st->lookup, *out);
            return data;
        }
#ifdef JANET_EV
        case LB_THREADED_ABSTRACT: {
            MARSH_EOS(st, data + sizeof(void *));
            data++;
            if (!(flags & JANET_MARSHAL_UNSAFE)) {
                janet_panicf("unsafe flag not given, "
                             "will not unmarshal threaded abstract pointer at index %d",
                             (int)(data - st->start));
            }
            union {
                void *ptr;
                uint8_t bytes[sizeof(void *)];
            } u;
            memcpy(u.bytes, data, sizeof(void *));
            data += sizeof(void *);

            if (flags & JANET_MARSHAL_DECREF) {
                /* Decrement immediately and don't bother putting into heap */
                janet_abstract_decref(u.ptr);
                *out = janet_wrap_nil();
            } else {
                *out = janet_wrap_abstract(u.ptr);
                Janet check = janet_table_get(&janet_vm.threaded_abstracts, *out);
                if (janet_checktype(check, JANET_NIL)) {
                    /* Transfers reference from threaded channel buffer to current heap */
                    janet_table_put(&janet_vm.threaded_abstracts, *out, janet_wrap_false());
                } else {
                    /* Heap reference already accounted for, remove threaded channel reference. */
                    janet_abstract_decref(u.ptr);
                }
            }

            janet_v_push(st->lookup, *out);
            return data;
        }
#endif
        default: {
            janet_panicf("unknown byte %x at index %d",
                         *data,
                         (int)(data - st->start));
            return NULL;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, -0x30(%rbp)
movzwl %cx, %eax
cmpl $0x401, %eax            # imm = 0x401
jae 0x31410
movq %rsi, %r15
movq %rdi, %r14
movq %rcx, -0x40(%rbp)
movq 0xf0(%rdi), %rax
cmpq %rsi, %rax
jbe 0x31404
movq %rdx, %r12
movzbl (%r15), %r13d
cmpl $0xc7, %r13d
ja 0x30893
leaq -0x30(%rbp), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x30618
cvtsi2sd %eax, %xmm0
callq 0x4fab8
movq %rax, (%r12)
movq (%rbx), %r15
jmp 0x313f2
leal -0xc8(%r13), %ecx
cmpl $0x20, %ecx
ja 0x31489
leaq 0x2fea6(%rip), %rdx     # 0x60750
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
incq %r15
leaq -0x30(%rbp), %rsi
movq %r15, (%rsi)
movq %r14, -0x38(%rbp)
movq %r14, %rdi
callq 0x320ce
movl %eax, %r15d
movl %eax, %r14d
cmpl $0xda, %r13d
jne 0x308f4
movq -0x38(%rbp), %rax
movq 0xc8(%rax), %rax
testq %rax, %rax
je 0x30a66
movl -0x4(%rax), %ecx
jmp 0x30a68
movq -0x30(%rbp), %rax
addq %r14, %rax
decq %rax
movq -0x38(%rbp), %rcx
cmpq 0xf0(%rcx), %rax
jae 0x31404
leal -0xd1(%r13), %eax
cmpl $0x17, %eax
ja 0x31160
leaq 0x2feae(%rip), %rcx     # 0x607d4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl %r15d, %edi
callq 0x46f8c
movq %rax, %r14
cmpl $0xdf, %r13d
jne 0x30991
movq -0x30(%rbp), %rsi
movq -0x40(%rbp), %rax
leal 0x1(%rax), %ecx
leaq -0x50(%rbp), %rbx
movq -0x38(%rbp), %rdi
movq %rbx, %rdx
callq 0x30822
movq %rax, -0x30(%rbp)
movq (%rbx), %rdx
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq %rdx, %rax
movabsq $-0x3000000000000, %rcx # imm = 0xFFFD000000000000
cmpq %rcx, %rax
jne 0x314a4
movq %rdx, %rdi
callq 0x4f838
movq %rax, -0x8(%r14)
movq %r12, -0x48(%rbp)
movq -0x30(%rbp), %r13
testl %r15d, %r15d
je 0x312a8
movq -0x40(%rbp), %r12
incl %r12d
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
leaq -0x50(%rbp), %rdx
movl %r12d, %ecx
callq 0x30822
movq %rbx, %rdi
movq %rax, %rsi
leaq -0x58(%rbp), %rdx
movl %r12d, %ecx
callq 0x30822
movq %rax, %r13
movq -0x50(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq %r14, %rdi
callq 0x472ba
decl %r15d
jne 0x309ad
jmp 0x312ac
movq %r12, -0x48(%rbp)
incq %r15
leaq -0x30(%rbp), %rbx
movq %r15, (%rbx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x320ce
movq %r14, %rcx
movl %eax, %r14d
movq (%rbx), %r15
movl %eax, %ebx
leaq (%r15,%rbx), %rax
decq %rax
cmpq 0xf0(%rcx), %rax
jae 0x31404
movq %rcx, %r12
cmpl $0xcf, %r13d
jg 0x30a7e
cmpl $0xce, %r13d
je 0x30fb3
cmpl $0xcf, %r13d
jne 0x30f7b
movq %r15, %rdi
movl %r14d, %esi
callq 0x47b16
movabsq $-0x5800000000000, %rsi # imm = 0xFFFA800000000000
jmp 0x30fdf
xorl %ecx, %ecx
cmpl %ecx, %r15d
jge 0x3141c
movq (%rax,%r14,8), %rax
movq %rax, (%r12)
jmp 0x313ee
cmpl $0xd0, %r13d
je 0x30fca
cmpl $0xd8, %r13d
jne 0x30f7b
cmpq $0x0, 0xd0(%r12)
je 0x31316
movq %r15, %rdi
movl %r14d, %esi
callq 0x47b16
movabsq $-0x5800000000000, %rsi # imm = 0xFFFA800000000000
movq %rax, %rdi
callq 0x4f9ad
movq 0xd0(%r12), %rdi
movq %rax, %rsi
callq 0x47f51
jmp 0x30fe7
movl %r15d, %edi
callq 0x47ee8
jmp 0x31168
movl %r15d, %edi
callq 0x47f11
jmp 0x31168
movl %r15d, %edi
callq 0x47ebf
jmp 0x31168
incq %r15
movq -0x40(%rbp), %rcx
incl %ecx
leaq -0x50(%rbp), %rbx
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x320ed
movq %rax, %r15
movq %rax, -0x30(%rbp)
movq (%rbx), %rdi
movabsq $-0x6800000000000, %rsi # imm = 0xFFF9800000000000
callq 0x4f9f2
movq %rax, (%r12)
jmp 0x313f2
leaq 0x4(%r15), %rcx
cmpq %rax, %rcx
jae 0x31404
movl 0x1(%r15), %eax
bswapl %eax
cvtsi2sd %eax, %xmm0
callq 0x4fab8
movq %rax, (%r12)
addq $0x5, %r15
jmp 0x313f2
leaq 0x8(%r15), %rcx
cmpq %rax, %rcx
jae 0x31404
movsd 0x1(%r15), %xmm0
callq 0x4fb7f
movq %rax, (%r12)
movq 0xc8(%r14), %rdi
testq %rdi, %rdi
je 0x30b98
movl -0x4(%rdi), %eax
incl %eax
cmpl -0x8(%rdi), %eax
jl 0x30bae
movl $0x1, %esi
movl $0x8, %edx
callq 0x4c0b4
movq %rax, 0xc8(%r14)
movq 0xc8(%r14), %rax
movslq -0x4(%rax), %rcx
leal 0x1(%rcx), %edx
movl %edx, -0x4(%rax)
movq (%r12), %rdx
movq %rdx, (%rax,%rcx,8)
addq $0x9, %r15
jmp 0x313f2
movabsq $-0x7000000000000, %rdi # imm = 0xFFF9000000000000
jmp 0x30bf5
movabsq $-0x7000000000000, %rdi # imm = 0xFFF9000000000000
incq %rdi
jmp 0x30bf5
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x4f95a
movq %rax, (%r12)
incq %r15
jmp 0x313f2
incq %r15
movq %r15, -0x30(%rbp)
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq -0x40(%rbp), %rcx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x32e5b
movq %r12, %r13
incq %r15
movq %r14, %r12
leaq -0x30(%rbp), %r14
movq %r15, (%r14)
movq %r12, %rdi
movq %r14, %rsi
callq 0x320ce
movl %eax, %ebx
movq %r12, %rdi
movq %r14, %rsi
callq 0x320ce
movq (%r14), %rsi
leaq 0x8(%rsi), %r15
cmpq 0xf0(%r12), %r15
jae 0x31404
btl $0x11, -0x40(%rbp)
jae 0x31447
movq (%rsi), %rdi
movq %r15, -0x30(%rbp)
movl %eax, %esi
movl %ebx, %edx
callq 0x176e6
movabsq $-0x2800000000000, %rsi # imm = 0xFFFD800000000000
movq %rax, %rdi
callq 0x4f9f2
movq %rax, (%r13)
movq 0xc8(%r12), %rdi
testq %rdi, %rdi
je 0x30cb2
movl -0x4(%rdi), %eax
incl %eax
cmpl -0x8(%rdi), %eax
jl 0x30cc9
movl $0x1, %esi
movl $0x8, %edx
callq 0x4c0b4
movq %rax, 0xc8(%r12)
movq 0xc8(%r12), %rax
movslq -0x4(%rax), %rcx
leal 0x1(%rcx), %edx
movl %edx, -0x4(%rax)
movq (%r13), %rdx
jmp 0x3137b
leaq 0x8(%r15), %rcx
cmpq %rax, %rcx
jae 0x31404
leaq 0x1(%r15), %rsi
movq %rsi, -0x30(%rbp)
btl $0x11, -0x40(%rbp)
jae 0x31451
movq 0x1(%r15), %rdi
addq $0x9, %r15
movq %r15, -0x30(%rbp)
movabsq $-0x800000000000, %rsi  # imm = 0xFFFF800000000000
jmp 0x30e20
leaq 0x8(%r15), %rcx
cmpq %rax, %rcx
jae 0x31404
movq %r14, -0x38(%rbp)
leaq 0x1(%r15), %rsi
movq %rsi, -0x30(%rbp)
movq -0x40(%rbp), %rax
btl $0x11, %eax
jae 0x31461
movabsq $-0x77fffffffffff, %r13 # imm = 0xFFF8800000000001
movq 0x1(%r15), %r14
addq $0x9, %r15
movq %r15, -0x30(%rbp)
btl $0x12, %eax
jb 0x3128f
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
movq %r14, %rdi
callq 0x4f9f2
movq %r12, %rcx
movq %rax, %r12
movq %rcx, -0x48(%rbp)
movq %rax, (%rcx)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rbx
addq $0x268, %rbx            # imm = 0x268
movq %rbx, %rdi
movq %r12, %rsi
callq 0x47f51
movabsq $-0x800000000000, %rcx  # imm = 0xFFFF800000000000
andq %rax, %rcx
decq %r13
cmpq %r13, %rcx
jne 0x3132a
movabsq $-0x7000000000000, %rdi # imm = 0xFFF9000000000000
callq 0x4f95a
movq -0x48(%rbp), %r12
movq (%r12), %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x481b3
jmp 0x31336
leaq 0x8(%r15), %rcx
cmpq %rax, %rcx
jae 0x31404
leaq 0x1(%r15), %rsi
movq %rsi, -0x30(%rbp)
btl $0x11, -0x40(%rbp)
jae 0x31474
movq 0x1(%r15), %rdi
addq $0x9, %r15
movq %r15, -0x30(%rbp)
movabsq $-0x1800000000000, %rsi # imm = 0xFFFE800000000000
callq 0x4f9f2
movq %rax, (%r12)
movq 0xc8(%r14), %rdi
testq %rdi, %rdi
je 0x30e3f
movl -0x4(%rdi), %eax
incl %eax
cmpl -0x8(%rdi), %eax
jl 0x30e55
movl $0x1, %esi
movl $0x8, %edx
callq 0x4c0b4
movq %rax, 0xc8(%r14)
movq 0xc8(%r14), %rax
jmp 0x3136d
movq %r12, %rbx
incq %r15
leaq -0x30(%rbp), %rsi
movq %r15, (%rsi)
movq %r14, %r12
movq %r14, %rdi
callq 0x320ce
movl %eax, %r13d
cmpl $0x100, %eax            # imm = 0x100
jae 0x3143b
movl %r13d, %esi
shll $0x5, %esi
orl $0x18, %esi
movl $0x9, %edi
callq 0x2bb18
movq %rax, %r14
movq $0x0, 0x10(%rax)
testl %r13d, %r13d
je 0x30ebd
leaq 0x18(%r14), %rdi
leal (,%r13,8), %edx
xorl %esi, %esi
callq 0x12410
movabsq $-0x2000000000000, %rsi # imm = 0xFFFE000000000000
movq %r14, %rdi
callq 0x4f9f2
movq %rax, (%rbx)
movq %r12, %r15
movq 0xc8(%r12), %rdi
testq %rdi, %rdi
je 0x30eec
movl -0x4(%rdi), %eax
incl %eax
cmpl -0x8(%rdi), %eax
jl 0x30f02
movl $0x1, %esi
movl $0x8, %edx
callq 0x4c0b4
movq %rax, 0xc8(%r15)
movq 0xc8(%r15), %rax
movslq -0x4(%rax), %rcx
leal 0x1(%rcx), %edx
movl %edx, -0x4(%rax)
movq (%rbx), %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x30(%rbp), %rsi
movq -0x40(%rbp), %rcx
incl %ecx
leaq -0x50(%rbp), %rbx
movq %r15, %rdi
movq %rbx, %rdx
movq %rcx, -0x40(%rbp)
callq 0x3260c
movq %rax, %r15
movq %rax, -0x30(%rbp)
movq (%rbx), %rax
movq %rax, 0x10(%r14)
testl %r13d, %r13d
je 0x30f72
addq $0x18, %r14
movl %r13d, %ebx
movq -0x40(%rbp), %r13
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %r13d, %ecx
callq 0x32c55
movq %rax, %r15
addq $0x8, %r14
decq %rbx
jne 0x30f55
movq %r15, -0x30(%rbp)
jmp 0x313f2
movl %r14d, %edi
callq 0x17757
movq %rbx, %r13
movq %rax, %rbx
movl %r14d, 0x10(%rax)
movq 0x18(%rax), %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x49017
movabsq $-0x2800000000000, %rsi # imm = 0xFFFD800000000000
movq %rbx, %rdi
movq %r13, %rbx
callq 0x4f9f2
jmp 0x30fe7
movq %r15, %rdi
movl %r14d, %esi
callq 0x45094
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
jmp 0x30fdf
movq %r15, %rdi
movl %r14d, %esi
callq 0x47b16
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
movq %rax, %rdi
callq 0x4f9ad
movq -0x48(%rbp), %rcx
movq %rax, (%rcx)
movq 0xc8(%r12), %rdi
testq %rdi, %rdi
je 0x31005
movl -0x4(%rdi), %eax
incl %eax
cmpl -0x8(%rdi), %eax
jl 0x3101c
movl $0x1, %esi
movl $0x8, %edx
callq 0x4c0b4
movq %rax, 0xc8(%r12)
movq 0xc8(%r12), %rax
movslq -0x4(%rax), %rcx
leal 0x1(%rcx), %edx
movl %edx, -0x4(%rax)
movq -0x48(%rbp), %rdx
movq (%rdx), %rdx
movq %rdx, (%rax,%rcx,8)
addq %rbx, %r15
jmp 0x313f2
movl %r15d, %edi
callq 0x1472d
jmp 0x310b2
movq %r12, -0x48(%rbp)
movl %r15d, %edi
callq 0x48a50
movq %rax, %r13
leaq -0x30(%rbp), %rbx
movq -0x38(%rbp), %rdi
movq %rbx, %rsi
callq 0x30618
shll $0x10, %eax
orl %eax, -0x20(%r13)
movq (%rbx), %rax
testl %r15d, %r15d
je 0x31381
movq -0x40(%rbp), %r12
incl %r12d
movq %r13, %rbx
movq -0x38(%rbp), %r15
movq %r15, %rdi
movq %rax, %rsi
movq %rbx, %rdx
movl %r12d, %ecx
callq 0x30822
addq $0x8, %rbx
decq %r14
jne 0x3108b
jmp 0x31385
movl %r15d, %edi
callq 0x146a0
movq %rax, %rbx
movl %r15d, 0x10(%rax)
movabsq $-0x4800000000000, %rsi # imm = 0xFFFB800000000000
movq %rax, %rdi
callq 0x4f9f2
movq %r12, %r13
movq %rax, (%r12)
movq -0x38(%rbp), %r12
movq 0xc8(%r12), %rdi
testq %rdi, %rdi
je 0x310ed
movl -0x4(%rdi), %eax
incl %eax
cmpl -0x8(%rdi), %eax
jl 0x31104
movl $0x1, %esi
movl $0x8, %edx
callq 0x4c0b4
movq %rax, 0xc8(%r12)
movq 0xc8(%r12), %rax
movslq -0x4(%rax), %rcx
leal 0x1(%rcx), %edx
movl %edx, -0x4(%rax)
movq (%r13), %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x30(%rbp), %rax
testl %r15d, %r15d
je 0x31157
movq -0x40(%rbp), %r13
incl %r13d
shlq $0x3, %r14
xorl %r15d, %r15d
movq -0x38(%rbp), %r12
movq 0x18(%rbx), %rdx
addq %r15, %rdx
movq %r12, %rdi
movq %rax, %rsi
movl %r13d, %ecx
callq 0x30822
addq $0x8, %r15
cmpq %r15, %r14
jne 0x31139
movq %rax, -0x30(%rbp)
jmp 0x313ee
movl %r15d, %edi
callq 0x47e96
movq %rax, %rbx
movabsq $-0x3800000000000, %rsi # imm = 0xFFFC800000000000
movq %rax, %rdi
callq 0x4f9f2
movq %rax, (%r12)
movq -0x38(%rbp), %r14
movq 0xc8(%r14), %rdi
testq %rdi, %rdi
je 0x3119b
movl -0x4(%rdi), %eax
incl %eax
cmpl -0x8(%rdi), %eax
jl 0x311b1
movl $0x1, %esi
movl $0x8, %edx
callq 0x4c0b4
movq %rax, 0xc8(%r14)
movq 0xc8(%r14), %rax
movslq -0x4(%rax), %rcx
leal 0x1(%rcx), %edx
movl %edx, -0x4(%rax)
movq (%r12), %rdx
movq %rdx, (%rax,%rcx,8)
addl $0xffffff2c, %r13d      # imm = 0xFFFFFF2C
cmpl $0x13, %r13d
ja 0x31236
movl $0xe0001, %eax          # imm = 0xE0001
btl %r13d, %eax
jae 0x31236
movq %rbx, %r12
movq -0x30(%rbp), %rsi
movq -0x40(%rbp), %rax
leal 0x1(%rax), %ecx
leaq -0x50(%rbp), %rbx
movq %r14, %rdi
movq %rbx, %rdx
callq 0x30822
movq %rax, -0x30(%rbp)
movq (%rbx), %rdx
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq %rdx, %rax
movabsq $-0x3800000000000, %rcx # imm = 0xFFFC800000000000
cmpq %rcx, %rax
jne 0x31428
movq %rdx, %rdi
callq 0x4f838
movq %r12, %rbx
movq %rax, 0x28(%r12)
movq -0x30(%rbp), %r14
testl %r15d, %r15d
je 0x31286
movq -0x40(%rbp), %r13
incl %r13d
movq -0x38(%rbp), %r12
movq %r12, %rdi
movq %r14, %rsi
leaq -0x50(%rbp), %rdx
movl %r13d, %ecx
callq 0x30822
movq %r12, %rdi
movq %rax, %rsi
leaq -0x58(%rbp), %rdx
movl %r13d, %ecx
callq 0x30822
movq %rax, %r14
movq -0x50(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq %rbx, %rdi
callq 0x481b3
decl %r15d
jne 0x3124a
movq %r14, -0x30(%rbp)
jmp 0x313ee
movq %r14, %rdi
callq 0x14691
movq %r13, %rdi
callq 0x4f95a
movq %rax, (%r12)
jmp 0x31336
movq -0x38(%rbp), %rbx
movq %r13, -0x30(%rbp)
movq %r14, %rdi
callq 0x472c9
movq %rax, %rdi
movabsq $-0x3000000000000, %rsi # imm = 0xFFFD000000000000
callq 0x4f9ad
movq -0x48(%rbp), %r14
movq %rax, (%r14)
movq 0xc8(%rbx), %rdi
testq %rdi, %rdi
je 0x312e7
movl -0x4(%rdi), %eax
incl %eax
cmpl -0x8(%rdi), %eax
jl 0x312fd
movl $0x1, %esi
movl $0x8, %edx
callq 0x4c0b4
movq %rax, 0xc8(%rbx)
movq 0xc8(%rbx), %rax
movslq -0x4(%rax), %rcx
leal 0x1(%rcx), %edx
movl %edx, -0x4(%rax)
movq (%r14), %rdx
jmp 0x313ea
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x4f95a
jmp 0x30fe7
movq %r14, %rdi
callq 0x14691
movq -0x48(%rbp), %r12
movq -0x38(%rbp), %rbx
movq 0xc8(%rbx), %rdi
testq %rdi, %rdi
je 0x31350
movl -0x4(%rdi), %eax
incl %eax
cmpl -0x8(%rdi), %eax
jl 0x31366
movl $0x1, %esi
movl $0x8, %edx
callq 0x4c0b4
movq %rax, 0xc8(%rbx)
movq 0xc8(%rbx), %rax
movslq -0x4(%rax), %rcx
leal 0x1(%rcx), %edx
movl %edx, -0x4(%rax)
movq (%r12), %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x313f2
movq -0x38(%rbp), %r15
movq %rax, -0x30(%rbp)
movq %r13, %rdi
callq 0x48a81
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
movq %rax, %rdi
callq 0x4f9ad
movq -0x48(%rbp), %rbx
movq %rax, (%rbx)
movq 0xc8(%r15), %rdi
testq %rdi, %rdi
je 0x313c0
movl -0x4(%rdi), %eax
incl %eax
cmpl -0x8(%rdi), %eax
jl 0x313d6
movl $0x1, %esi
movl $0x8, %edx
callq 0x4c0b4
movq %rax, 0xc8(%r15)
movq 0xc8(%r15), %rax
movslq -0x4(%rax), %rcx
leal 0x1(%rcx), %edx
movl %edx, -0x4(%rax)
movq (%rbx), %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x30(%rbp), %r15
movq %r15, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2f781(%rip), %rdi     # 0x60b8c
callq 0x19263
leaq 0x2cadc(%rip), %rdi     # 0x5def3
callq 0x19263
leaq 0x2f901(%rip), %rdi     # 0x60d24
movl %r15d, %esi
jmp 0x31482
leaq 0x2fbf3(%rip), %rdi     # 0x61022
movl $0x200, %esi            # imm = 0x200
xorl %eax, %eax
callq 0x1917b
leaq 0x2f8b4(%rip), %rdi     # 0x60cf6
movl %r13d, %esi
jmp 0x31482
subl 0xe8(%r12), %esi
jmp 0x31458
subl 0xe8(%r14), %esi
leaq 0x2f8da(%rip), %rdi     # 0x60d39
jmp 0x31482
movq -0x38(%rbp), %rax
subl 0xe8(%rax), %esi
leaq 0x2f950(%rip), %rdi     # 0x60dc2
jmp 0x31482
subl 0xe8(%r14), %esi
leaq 0x2f8f9(%rip), %rdi     # 0x60d7b
xorl %eax, %eax
callq 0x1917b
subl 0xe8(%r14), %r15d
leaq 0x2f97b(%rip), %rdi     # 0x60e12
movl %r13d, %esi
movl %r15d, %edx
xorl %eax, %eax
callq 0x1917b
leaq 0x2fb77(%rip), %rdi     # 0x61022
movl $0x400, %esi            # imm = 0x400
jmp 0x31434