// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/marsh.c
// Function: marshal_one
static void marshal_one(MarshalState *st, Janet x, int flags) {
    MARSH_STACKCHECK;
    JanetType type = janet_type(x);

    /* Check simple primitives (non reference types, no benefit from memoization) */
    switch (type) {
        default:
            break;
        case JANET_NIL:
            pushbyte(st, LB_NIL);
            return;
        case JANET_BOOLEAN:
            pushbyte(st, janet_unwrap_boolean(x) ? LB_TRUE : LB_FALSE);
            return;
        case JANET_NUMBER: {
            double xval = janet_unwrap_number(x);
            if (janet_checkintrange(xval)) {
                pushint(st, (int32_t) xval);
                return;
            }
            break;
        }
    }

    /* Check reference and registry value */
    {
        Janet check;
        if (st->maybe_cycles) {
            check = janet_table_get(&st->seen, x);
            if (janet_checkint(check)) {
                pushbyte(st, LB_REFERENCE);
                pushint(st, janet_unwrap_integer(check));
                return;
            }
        }
        if (st->rreg) {
            check = janet_table_get(st->rreg, x);
            if (janet_checktype(check, JANET_SYMBOL)) {
                MARK_SEEN();
                const uint8_t *regname = janet_unwrap_symbol(check);
                pushbyte(st, LB_REGISTRY);
                pushint(st, janet_string_length(regname));
                pushbytes(st, regname, janet_string_length(regname));
                return;
            }
        }
    }

    /* Reference types */
    switch (type) {
        case JANET_NUMBER: {
            union {
                double d;
                uint8_t bytes[8];
            } u;
            u.d = janet_unwrap_number(x);
#ifdef JANET_BIG_ENDIAN
            /* Swap byte order */
            uint8_t temp;
            temp = u.bytes[7];
            u.bytes[7] = u.bytes[0];
            u.bytes[0] = temp;
            temp = u.bytes[6];
            u.bytes[6] = u.bytes[1];
            u.bytes[1] = temp;
            temp = u.bytes[5];
            u.bytes[5] = u.bytes[2];
            u.bytes[2] = temp;
            temp = u.bytes[4];
            u.bytes[4] = u.bytes[3];
            u.bytes[3] = temp;
#endif
            pushbyte(st, LB_REAL);
            pushbytes(st, u.bytes, 8);
            MARK_SEEN();
            return;
        }
        case JANET_STRING:
        case JANET_SYMBOL:
        case JANET_KEYWORD: {
            const uint8_t *str = janet_unwrap_string(x);
            int32_t length = janet_string_length(str);
            /* Record reference */
            MARK_SEEN();
            uint8_t lb = (type == JANET_STRING) ? LB_STRING :
                         (type == JANET_SYMBOL) ? LB_SYMBOL :
                         LB_KEYWORD;
            pushbyte(st, lb);
            pushint(st, length);
            pushbytes(st, str, length);
            return;
        }
        case JANET_BUFFER: {
            JanetBuffer *buffer = janet_unwrap_buffer(x);
            /* Record reference */
            MARK_SEEN();
#ifdef JANET_EV
            if ((flags & JANET_MARSHAL_UNSAFE) &&
                    (buffer->gc.flags & JANET_BUFFER_FLAG_NO_REALLOC)) {
                pushbyte(st, LB_POINTER_BUFFER);
                pushint(st, buffer->count);
                pushint(st, buffer->capacity);
                pushpointer(st, buffer->data);
                return;
            }
#endif
            pushbyte(st, LB_BUFFER);
            pushint(st, buffer->count);
            pushbytes(st, buffer->data, buffer->count);
            return;
        }
        case JANET_ARRAY: {
            int32_t i;
            JanetArray *a = janet_unwrap_array(x);
            MARK_SEEN();
            enum JanetMemoryType memtype = janet_gc_type(a);
            pushbyte(st, memtype == JANET_MEMORY_ARRAY_WEAK ? LB_ARRAY_WEAK : LB_ARRAY);
            pushint(st, a->count);
            for (i = 0; i < a->count; i++)
                marshal_one(st, a->data[i], flags + 1);
            return;
        }
        case JANET_TUPLE: {
            int32_t i, count, flag;
            const Janet *tup = janet_unwrap_tuple(x);
            count = janet_tuple_length(tup);
            flag = janet_tuple_flag(tup) >> 16;
            pushbyte(st, LB_TUPLE);
            pushint(st, count);
            pushint(st, flag);
            for (i = 0; i < count; i++)
                marshal_one(st, tup[i], flags + 1);
            /* Mark as seen AFTER marshaling */
            MARK_SEEN();
            return;
        }
        case JANET_TABLE: {
            JanetTable *t = janet_unwrap_table(x);
            MARK_SEEN();
            enum JanetMemoryType memtype = janet_gc_type(t);
            if (memtype == JANET_MEMORY_TABLE_WEAKK) {
                pushbyte(st, t->proto ? LB_TABLE_WEAKK_PROTO : LB_TABLE_WEAKK);
            } else if (memtype == JANET_MEMORY_TABLE_WEAKV) {
                pushbyte(st, t->proto ? LB_TABLE_WEAKV_PROTO : LB_TABLE_WEAKV);
            } else if (memtype == JANET_MEMORY_TABLE_WEAKKV) {
                pushbyte(st, t->proto ? LB_TABLE_WEAKKV_PROTO : LB_TABLE_WEAKKV);
            } else {
                pushbyte(st, t->proto ? LB_TABLE_PROTO : LB_TABLE);
            }
            pushint(st, t->count);
            if (t->proto)
                marshal_one(st, janet_wrap_table(t->proto), flags + 1);
            for (int32_t i = 0; i < t->capacity; i++) {
                if (janet_checktype(t->data[i].key, JANET_NIL))
                    continue;
                marshal_one(st, t->data[i].key, flags + 1);
                marshal_one(st, t->data[i].value, flags + 1);
            }
            return;
        }
        case JANET_STRUCT: {
            int32_t count;
            const JanetKV *struct_ = janet_unwrap_struct(x);
            count = janet_struct_length(struct_);
            pushbyte(st, janet_struct_proto(struct_) ? LB_STRUCT_PROTO : LB_STRUCT);
            pushint(st, count);
            if (janet_struct_proto(struct_))
                marshal_one(st, janet_wrap_struct(janet_struct_proto(struct_)), flags + 1);
            for (int32_t i = 0; i < janet_struct_capacity(struct_); i++) {
                if (janet_checktype(struct_[i].key, JANET_NIL))
                    continue;
                marshal_one(st, struct_[i].key, flags + 1);
                marshal_one(st, struct_[i].value, flags + 1);
            }
            /* Mark as seen AFTER marshaling */
            MARK_SEEN();
            return;
        }
        case JANET_ABSTRACT: {
            marshal_one_abstract(st, x, flags);
            return;
        }
        case JANET_FUNCTION: {
            pushbyte(st, LB_FUNCTION);
            JanetFunction *func = janet_unwrap_function(x);
            pushint(st, func->def->environments_length);
            /* Mark seen before reading def */
            MARK_SEEN();
            marshal_one_def(st, func->def, flags);
            for (int32_t i = 0; i < func->def->environments_length; i++)
                marshal_one_env(st, func->envs[i], flags + 1);
            return;
        }
        case JANET_FIBER: {
            MARK_SEEN();
            pushbyte(st, LB_FIBER);
            marshal_one_fiber(st, janet_unwrap_fiber(x), flags + 1);
            return;
        }
        case JANET_CFUNCTION: {
            if (!(flags & JANET_MARSHAL_UNSAFE)) goto no_registry;
            MARK_SEEN();
            pushbyte(st, LB_UNSAFE_CFUNCTION);
            JanetCFunction cfn = janet_unwrap_cfunction(x);
            pushbytes(st, (uint8_t *) &cfn, sizeof(JanetCFunction));
            return;
        }
        case JANET_POINTER: {
            if (!(flags & JANET_MARSHAL_UNSAFE)) goto no_registry;
            MARK_SEEN();
            pushbyte(st, LB_UNSAFE_POINTER);
            pushpointer(st, janet_unwrap_pointer(x));
            return;
        }
    no_registry:
        default: {
            janet_panicf("no registry value and cannot marshal %p", x);
        }
    }
#undef MARK_SEEN
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, -0x30(%rbp)
movq %rdx, -0x38(%rbp)
movzwl %dx, %eax
cmpl $0x401, %eax            # imm = 0x401
jae 0x2ff30
movq %rsi, %r15
movq %rsi, %xmm0
movq %rsi, %rax
shrq $0x2f, %rax
andl $0xf, %eax
xorl %r13d, %r13d
ucomisd %xmm0, %xmm0
cmovpl %eax, %r13d
testl %r13d, %r13d
je 0x2f642
cmpl $0x2, %r13d
je 0x2f61a
cmpl $0x1, %r13d
jne 0x2f674
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movl $0xc9, %esi
jmp 0x2f62f
andl $0x1, %r15d
movq -0x30(%rbp), %rax
movq (%rax), %rdi
orl $0xca, %r15d
movl %r15d, %esi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x17947
ucomisd 0x22e2e(%rip), %xmm0    # 0x52478
jb 0x2f674
movsd 0x22e2c(%rip), %xmm1    # 0x52480
ucomisd %xmm0, %xmm1
jb 0x2f674
cvttpd2dq %xmm0, %xmm1
cvtdq2pd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x2f674
jp 0x2f674
cvttsd2si %xmm0, %esi
movq -0x30(%rbp), %rdi
jmp 0x2f6ba
movq -0x30(%rbp), %rax
cmpl $0x0, 0x54(%rax)
je 0x2f6cd
movq -0x30(%rbp), %rax
leaq 0x8(%rax), %rdi
movq %r15, %rsi
callq 0x474e0
movq %rax, %r12
movq %rax, %rdi
callq 0x49912
testl %eax, %eax
je 0x2f6cd
movq -0x30(%rbp), %rbx
movq (%rbx), %rdi
movl $0xda, %esi
callq 0x17947
movq %r12, %xmm0
cvttsd2si %xmm0, %esi
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2f4c1
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rdi
testq %rdi, %rdi
je 0x2f760
movq %r15, %rsi
callq 0x474e0
movq %rax, %r12
shrq $0x2f, %rax
cmpl $0x1fff5, %eax          # imm = 0x1FFF5
jne 0x2f760
movq -0x30(%rbp), %rax
cmpl $0x0, 0x54(%rax)
je 0x2f729
movq -0x30(%rbp), %rdx
leaq 0x8(%rdx), %r14
movl 0x50(%rdx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x50(%rdx)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
callq 0x4ee44
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x476f0
movq %r12, %rdi
callq 0x4ebc4
movq %rax, %r14
movq -0x30(%rbp), %rbx
movq (%rbx), %rdi
movl $0xd8, %esi
callq 0x17947
movl -0x8(%r14), %esi
movq %rbx, %rdi
callq 0x2f4c1
movl -0x8(%r14), %edx
movq (%rbx), %rdi
movq %r14, %rsi
jmp 0x2f8e9
cmpl $0xf, %r13d
ja 0x2ff3c
movl %r13d, %eax
leaq 0x2ff9c(%rip), %rcx     # 0x5f710
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r15, %rdi
callq 0x4ebc4
movq %rax, %r14
movl -0x8(%rax), %r12d
movq -0x30(%rbp), %rax
cmpl $0x0, 0x54(%rax)
je 0x2f7c1
movq -0x30(%rbp), %rdx
leaq 0x8(%rdx), %rbx
movl 0x50(%rdx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x50(%rdx)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
callq 0x4ee44
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x476f0
cmpl $0x5, %r13d
sete %al
movb $-0x30, %cl
subb %al, %cl
cmpl $0x4, %r13d
movzbl %cl, %eax
movl $0xce, %ecx
cmovnel %eax, %ecx
movq -0x30(%rbp), %rbx
movq (%rbx), %rdi
movzbl %cl, %esi
callq 0x17947
movq %rbx, %rdi
movl %r12d, %esi
callq 0x2f4c1
movq (%rbx), %rdi
movq %r14, %rsi
movl %r12d, %edx
jmp 0x2f8e9
btl $0x11, -0x38(%rbp)
jae 0x2ff3c
movq -0x30(%rbp), %rax
cmpl $0x0, 0x54(%rax)
je 0x2f843
movq -0x30(%rbp), %rdx
leaq 0x8(%rdx), %r14
movl 0x50(%rdx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x50(%rdx)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
callq 0x4ee44
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x476f0
movq -0x30(%rbp), %rbx
movq (%rbx), %rdi
movl $0xdd, %esi
callq 0x17947
movq %r15, %rdi
callq 0x4ebc4
leaq -0x48(%rbp), %rsi
movq %rax, (%rsi)
movq (%rbx), %rdi
jmp 0x2fe11
movq %r15, %rdi
callq 0x4ebc4
movq %rax, %r12
movq -0x30(%rbp), %rax
cmpl $0x0, 0x54(%rax)
je 0x2f8ab
movq -0x30(%rbp), %rdx
leaq 0x8(%rdx), %r13
movl 0x50(%rdx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x50(%rdx)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
callq 0x4ee44
movq %r13, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x476f0
btl $0x11, -0x38(%rbp)
jae 0x2f8be
testb $0x1, 0x2(%r12)
jne 0x2fdd7
movq -0x30(%rbp), %rbx
movq (%rbx), %rdi
movl $0xd6, %esi
callq 0x17947
movl 0x10(%r12), %esi
movq %rbx, %rdi
callq 0x2f4c1
movq 0x18(%r12), %rsi
movl 0x10(%r12), %edx
movq (%rbx), %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x178c5
movq -0x30(%rbp), %rdi
movq %r15, %rsi
movq -0x38(%rbp), %rdx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31220
movq -0x30(%rbp), %rbx
movq (%rbx), %rdi
movl $0xd7, %esi
callq 0x17947
movq %r15, %rdi
callq 0x4ebc4
movq %rax, %r12
movq 0x10(%rax), %rax
movl 0x74(%rax), %esi
movq %rbx, %rdi
callq 0x2f4c1
cmpl $0x0, 0x54(%rbx)
je 0x2f976
movq -0x30(%rbp), %rdx
leaq 0x8(%rdx), %r13
movl 0x50(%rdx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x50(%rdx)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
callq 0x4ee44
movq %r13, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x476f0
movq 0x10(%r12), %rsi
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rdx
callq 0x31333
movq 0x10(%r12), %rax
cmpl $0x0, 0x74(%rax)
jle 0x2ff21
movq -0x38(%rbp), %rax
incl %eax
movq %rax, -0x38(%rbp)
xorl %r15d, %r15d
movq 0x18(%r12,%r15,8), %rsi
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rdx
callq 0x3166c
incq %r15
movq 0x10(%r12), %rax
movslq 0x74(%rax), %rax
cmpq %rax, %r15
jl 0x2f9a4
jmp 0x2ff21
movq %r15, %rdi
callq 0x4ebc4
movq %rax, %r14
movslq -0x10(%rax), %r13
movswl -0x1e(%rax), %r12d
movq -0x30(%rbp), %rbx
movq (%rbx), %rdi
movl $0xd2, %esi
callq 0x17947
movq %rbx, %rdi
movl %r13d, %esi
callq 0x2f4c1
movq %rbx, %rdi
movl %r12d, %esi
callq 0x2f4c1
testq %r13, %r13
jle 0x2fb36
movq -0x38(%rbp), %rax
incl %eax
movq %rax, -0x38(%rbp)
xorl %r12d, %r12d
movq (%r14,%r12,8), %rsi
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rdx
callq 0x2f5b7
incq %r12
cmpq %r12, %r13
jne 0x2fa1d
jmp 0x2fb36
movq %r15, %rdi
callq 0x4ebc4
movq %rax, %r12
movl -0x18(%rax), %r13d
cmpq $0x0, -0x8(%rax)
movq -0x30(%rbp), %rbx
movq (%rbx), %rdi
movl $0xd5, %eax
movl $0xdf, %esi
cmovel %eax, %esi
callq 0x17947
movq %rbx, %rdi
movl %r13d, %esi
callq 0x2f4c1
movq %r12, -0x40(%rbp)
movq -0x8(%r12), %rdi
testq %rdi, %rdi
je 0x2faa3
movabsq $-0x3000000000000, %rsi # imm = 0xFFFD000000000000
callq 0x4ed39
movq -0x38(%rbp), %rcx
leal 0x1(%rcx), %edx
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x2f5b7
movq -0x40(%rbp), %rax
movl -0x10(%rax), %eax
testl %eax, %eax
jle 0x2fb36
movabsq $-0x800000000000, %rdx  # imm = 0xFFFF800000000000
movabsq $-0x7800000000000, %rdi # imm = 0xFFF8800000000000
movq -0x38(%rbp), %rcx
incl %ecx
movq %rcx, -0x38(%rbp)
movq -0x40(%rbp), %r13
addq $0x8, %r13
xorl %r12d, %r12d
movq -0x30(%rbp), %rbx
movq -0x38(%rbp), %r14
movq -0x8(%r13), %rsi
movq %rsi, %rcx
andq %rdx, %rcx
cmpq %rdi, %rcx
je 0x2fb27
movq %rbx, %rdi
movl %r14d, %edx
callq 0x2f5b7
movq (%r13), %rsi
movq %rbx, %rdi
movl %r14d, %edx
callq 0x2f5b7
movabsq $-0x7800000000000, %rdi # imm = 0xFFF8800000000000
movabsq $-0x800000000000, %rdx  # imm = 0xFFFF800000000000
movq -0x40(%rbp), %rax
movl -0x10(%rax), %eax
incq %r12
movslq %eax, %rcx
addq $0x10, %r13
cmpq %rcx, %r12
jl 0x2fae3
movq -0x30(%rbp), %rax
cmpl $0x0, 0x54(%rax)
je 0x2ff21
movq -0x30(%rbp), %rdx
leaq 0x8(%rdx), %r14
movl 0x50(%rdx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x50(%rdx)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
callq 0x4ee44
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x476f0
movq -0x30(%rbp), %rax
cmpl $0x0, 0x54(%rax)
je 0x2fbb2
movq -0x30(%rbp), %rdx
leaq 0x8(%rdx), %r12
movl 0x50(%rdx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x50(%rdx)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
callq 0x4ee44
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x476f0
movq -0x30(%rbp), %rbx
movq (%rbx), %rdi
movl $0xcc, %esi
callq 0x17947
movq %r15, %rdi
callq 0x4ebc4
movq -0x38(%rbp), %rdx
incl %edx
movq %rbx, %rdi
movq %rax, %rsi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31888
btl $0x11, -0x38(%rbp)
jae 0x2ff3c
movq -0x30(%rbp), %rax
cmpl $0x0, 0x54(%rax)
je 0x2fc2a
movq -0x30(%rbp), %rdx
leaq 0x8(%rdx), %r14
movl 0x50(%rdx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x50(%rdx)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
callq 0x4ee44
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x476f0
movq -0x30(%rbp), %rbx
movq (%rbx), %rdi
movl $0xde, %esi
callq 0x17947
movq %r15, %rdi
callq 0x4ebc4
jmp 0x2fe07
leaq -0x48(%rbp), %r14
movq %r15, (%r14)
movq -0x30(%rbp), %rbx
movq (%rbx), %rdi
movl $0xc8, %esi
callq 0x17947
movq (%rbx), %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x178c5
cmpl $0x0, 0x54(%rbx)
je 0x2ff21
movq -0x30(%rbp), %rdx
leaq 0x8(%rdx), %r14
movl 0x50(%rdx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x50(%rdx)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
callq 0x4ee44
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x476f0
jmp 0x2ff21
movq %r15, %rdi
callq 0x4ebc4
movq %rax, %r12
movq -0x30(%rbp), %rax
cmpl $0x0, 0x54(%rax)
je 0x2fcea
movq -0x30(%rbp), %rdx
leaq 0x8(%rdx), %r13
movl 0x50(%rdx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x50(%rdx)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
callq 0x4ee44
movq %r13, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x476f0
movzbl (%r12), %ecx
movq 0x28(%r12), %rax
movq -0x30(%rbp), %rdx
movq (%rdx), %rdi
cmpl $0x10, %ecx
je 0x2fe32
cmpl $0xf, %ecx
je 0x2fe20
cmpl $0xe, %ecx
jne 0x2fe44
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
leal (%rcx,%rcx,2), %eax
addl $0xe2, %eax
jmp 0x2fe4c
movq %r15, %rdi
callq 0x4ebc4
movq %rax, %r12
movq -0x30(%rbp), %rax
cmpl $0x0, 0x54(%rax)
je 0x2fd6b
movq -0x30(%rbp), %rdx
leaq 0x8(%rdx), %r13
movl 0x50(%rdx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x50(%rdx)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
callq 0x4ee44
movq %r13, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x476f0
cmpb $0x11, (%r12)
movq -0x30(%rbp), %rbx
movq (%rbx), %rdi
movl $0xe8, %eax
movl $0xd1, %esi
cmovel %eax, %esi
callq 0x17947
movl 0x10(%r12), %esi
movq %rbx, %rdi
callq 0x2f4c1
cmpl $0x0, 0x10(%r12)
jle 0x2ff21
movq -0x38(%rbp), %rax
incl %eax
movq %rax, -0x38(%rbp)
xorl %r15d, %r15d
movq 0x18(%r12), %rax
movq (%rax,%r15,8), %rsi
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rdx
callq 0x2f5b7
incq %r15
movslq 0x10(%r12), %rax
cmpq %rax, %r15
jl 0x2fdaf
jmp 0x2ff21
movq -0x30(%rbp), %rbx
movq (%rbx), %rdi
movl $0xe1, %esi
callq 0x17947
movl 0x10(%r12), %esi
movq %rbx, %rdi
callq 0x2f4c1
movl 0x14(%r12), %esi
movq %rbx, %rdi
callq 0x2f4c1
movq 0x18(%r12), %rax
movq (%rbx), %rdi
leaq -0x48(%rbp), %rsi
movq %rax, (%rsi)
movl $0x8, %edx
callq 0x178c5
jmp 0x2ff21
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
leal (%rcx,%rcx,2), %eax
addl $0xe3, %eax
jmp 0x2fe4c
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
leal (%rcx,%rcx,2), %eax
addl $0xe4, %eax
jmp 0x2fe4c
cmpq $0x1, %rax
movb $-0x2c, %al
sbbb $0x0, %al
movzbl %al, %esi
callq 0x17947
movl 0x10(%r12), %esi
movq -0x30(%rbp), %rdi
callq 0x2f4c1
movq 0x28(%r12), %rdi
testq %rdi, %rdi
je 0x2fe8e
movabsq $-0x3800000000000, %rsi # imm = 0xFFFC800000000000
callq 0x4ed7e
movq -0x38(%rbp), %rcx
leal 0x1(%rcx), %edx
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x2f5b7
movl 0x14(%r12), %eax
testl %eax, %eax
jle 0x2ff21
movabsq $-0x800000000000, %rdx  # imm = 0xFFFF800000000000
movabsq $-0x7800000000000, %rdi # imm = 0xFFF8800000000000
movq -0x38(%rbp), %rcx
incl %ecx
movq %rcx, -0x38(%rbp)
xorl %r15d, %r15d
xorl %r13d, %r13d
movq -0x30(%rbp), %r14
movq -0x38(%rbp), %rbx
movq 0x20(%r12), %rcx
movq (%rcx,%r15), %rsi
movq %rsi, %rcx
andq %rdx, %rcx
cmpq %rdi, %rcx
je 0x2ff12
movq %r14, %rdi
movl %ebx, %edx
callq 0x2f5b7
movq 0x20(%r12), %rax
movq 0x8(%rax,%r15), %rsi
movq %r14, %rdi
movl %ebx, %edx
callq 0x2f5b7
movabsq $-0x7800000000000, %rdi # imm = 0xFFF8800000000000
movabsq $-0x800000000000, %rdx  # imm = 0xFFFF800000000000
movl 0x14(%r12), %eax
incq %r13
movslq %eax, %rcx
addq $0x10, %r15
cmpq %rcx, %r13
jl 0x2fec7
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2cfbc(%rip), %rdi     # 0x5cef3
callq 0x191a3
leaq 0x2fd03(%rip), %rdi     # 0x5fc46
movq %r15, %rsi
xorl %eax, %eax
callq 0x190bb