// File: /workspace/github_c_makefile_star2_O0/janet-lang[P]janet/src/core/peg.c
// Function: peg_compile1
static uint32_t peg_compile1(Builder *b, Janet peg) {

    /* Keep track of the form being compiled for error purposes */
    Janet old_form = b->form;
    JanetTable *old_grammar = b->grammar;
    b->form = peg;

    /* Resolve keyword references */
    int i = JANET_RECURSION_GUARD;
    JanetTable *grammar = old_grammar;
    for (; i > 0 && janet_checktype(peg, JANET_KEYWORD); --i) {
        Janet nextPeg = janet_table_get_ex(grammar, peg, &grammar);
        if (!grammar || janet_checktype(nextPeg, JANET_NIL)) {
            nextPeg = (b->default_grammar == NULL)
                      ? janet_wrap_nil()
                      : janet_table_get(b->default_grammar, peg);
            if (janet_checktype(nextPeg, JANET_NIL)) {
                peg_panic(b, "unknown rule");
            }
        }
        peg = nextPeg;
        b->form = peg;
        b->grammar = grammar;
    }
    if (i == 0)
        peg_panic(b, "reference chain too deep");

    /* Check cache - for tuples we check only the local cache, as
     * in a different grammar, the same tuple can compile to a different
     * rule - for example, (+ :a :b) depends on whatever :a and :b are bound to. */
    Janet check = janet_checktype(peg, JANET_TUPLE)
                  ? janet_table_rawget(grammar, peg)
                  : janet_table_get(grammar, peg);
    if (!janet_checktype(check, JANET_NIL)) {
        b->form = old_form;
        b->grammar = old_grammar;
        return (uint32_t) janet_unwrap_number(check);
    }

    /* Check depth */
    if (b->depth-- == 0)
        peg_panic(b, "peg grammar recursed too deeply");

    /* The final rule to return */
    uint32_t rule = janet_v_count(b->bytecode);

    /* Add to cache. Do not cache structs, as we don't yet know
     * what rule they will return! We can just as effectively cache
     * the structs main rule. */
    if (!janet_checktype(peg, JANET_STRUCT)) {
        JanetTable *which_grammar = grammar;
        /* If we are a primitive pattern, add to the global cache (root grammar table) */
        if (!janet_checktype(peg, JANET_TUPLE)) {
            while (which_grammar->proto)
                which_grammar = which_grammar->proto;
        }
        janet_table_put(which_grammar, peg, janet_wrap_number(rule));
    }

    switch (janet_type(peg)) {
        default:
            peg_panic(b, "unexpected peg source");
            return 0;

        case JANET_BOOLEAN: {
            int n = janet_unwrap_boolean(peg);
            Reserve r = reserve(b, 2);
            emit_1(r, n ? RULE_NCHAR : RULE_NOTNCHAR, 0);
            break;
        }
        case JANET_NUMBER: {
            int32_t n = peg_getinteger(b, peg);
            Reserve r = reserve(b, 2);
            if (n < 0) {
                emit_1(r, RULE_NOTNCHAR, -n);
            } else {
                emit_1(r, RULE_NCHAR, n);
            }
            break;
        }
        case JANET_STRING: {
            const uint8_t *str = janet_unwrap_string(peg);
            int32_t len = janet_string_length(str);
            emit_bytes(b, RULE_LITERAL, len, str);
            break;
        }
        case JANET_BUFFER: {
            const JanetBuffer *buf = janet_unwrap_buffer(peg);
            emit_bytes(b, RULE_LITERAL, buf->count, buf->data);
            break;
        }
        case JANET_TABLE: {
            /* Build grammar table */
            JanetTable *new_grammar = janet_table_clone(janet_unwrap_table(peg));
            new_grammar->proto = grammar;
            b->grammar = grammar = new_grammar;
            /* Run the main rule */
            Janet main_rule = janet_table_rawget(grammar, janet_ckeywordv("main"));
            if (janet_checktype(main_rule, JANET_NIL))
                peg_panic(b, "grammar requires :main rule");
            rule = peg_compile1(b, main_rule);
            break;
        }
        case JANET_STRUCT: {
            /* Build grammar table */
            const JanetKV *st = janet_unwrap_struct(peg);
            JanetTable *new_grammar = janet_table(2 * janet_struct_capacity(st));
            for (int32_t i = 0; i < janet_struct_capacity(st); i++) {
                if (janet_checktype(st[i].key, JANET_KEYWORD)) {
                    janet_table_put(new_grammar, st[i].key, st[i].value);
                }
            }
            new_grammar->proto = grammar;
            b->grammar = grammar = new_grammar;
            /* Run the main rule */
            Janet main_rule = janet_table_rawget(grammar, janet_ckeywordv("main"));
            if (janet_checktype(main_rule, JANET_NIL))
                peg_panic(b, "grammar requires :main rule");
            rule = peg_compile1(b, main_rule);
            break;
        }
        case JANET_TUPLE: {
            const Janet *tup = janet_unwrap_tuple(peg);
            int32_t len = janet_tuple_length(tup);
            if (len == 0) peg_panic(b, "tuple in grammar must have non-zero length");
            if (janet_checkint(tup[0])) {
                int32_t n = janet_unwrap_integer(tup[0]);
                if (n < 0) {
                    peg_panicf(b, "expected non-negative integer, got %d", n);
                }
                spec_repeat(b, len, tup);
                break;
            }
            if (!janet_checktype(tup[0], JANET_SYMBOL))
                peg_panicf(b, "expected grammar command, found %v", tup[0]);
            const uint8_t *sym = janet_unwrap_symbol(tup[0]);
            const SpecialPair *sp = janet_strbinsearch(
                                        &peg_specials,
                                        sizeof(peg_specials) / sizeof(SpecialPair),
                                        sizeof(SpecialPair),
                                        sym);
            if (sp) {
                sp->special(b, len - 1, tup + 1);
            } else {
                peg_panicf(b, "unknown special %S", sym);
            }
            break;
        }
    }

    /* Increase depth again */
    b->depth++;
    b->form = old_form;
    b->grammar = old_grammar;
    return rule;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rsi, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, 0x28(%rax)
movl $0x400, -0x2c(%rbp)     # imm = 0x400
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x2c(%rbp)
movb %al, -0x119(%rbp)
jle 0x57247
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq -0x10(%rbp), %rax
movabsq $-0x5000000000000, %rcx # imm = 0xFFFB000000000000
cmpq %rcx, %rax
sete %al
movb %al, -0x119(%rbp)
movb -0x119(%rbp), %al
testb $0x1, %al
jne 0x57256
jmp 0x57393
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x69510
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x572c4
xorl %eax, %eax
testb $0x1, %al
jne 0x5727a
jmp 0x572a3
movsd -0x40(%rbp), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x5728c
jmp 0x572c4
movq -0x40(%rbp), %rax
shrq $0x2f, %rax
andq $0xf, %rax
cmpq $0x0, %rax
je 0x572c4
jmp 0x57366
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq -0x40(%rbp), %rax
movabsq $-0x7800000000000, %rcx # imm = 0xFFF8800000000000
cmpq %rcx, %rax
jne 0x57366
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x572ec
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x7b460
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x57309
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x69420
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x40(%rbp)
xorl %eax, %eax
testb $0x1, %al
jne 0x57311
jmp 0x57337
movsd -0x40(%rbp), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x57323
jmp 0x57354
movq -0x40(%rbp), %rax
shrq $0x2f, %rax
andq $0xf, %rax
cmpq $0x0, %rax
je 0x57354
jmp 0x57364
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq -0x40(%rbp), %rax
movabsq $-0x7800000000000, %rcx # imm = 0xFFF8800000000000
cmpq %rcx, %rax
jne 0x57364
movq -0x18(%rbp), %rdi
leaq 0x3deea(%rip), %rsi     # 0x95249
callq 0x57e80
jmp 0x57366
movq -0x40(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, 0x28(%rax)
movq -0x38(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl -0x2c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x57215
cmpl $0x0, -0x2c(%rbp)
jne 0x573a9
movq -0x18(%rbp), %rdi
leaq 0x3deb2(%rip), %rsi     # 0x95256
callq 0x57e80
xorl %eax, %eax
testb $0x1, %al
jne 0x573b1
jmp 0x573d7
movsd -0x10(%rbp), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x573c3
jmp 0x573f4
movq -0x10(%rbp), %rax
shrq $0x2f, %rax
andq $0xf, %rax
cmpq $0x0, %rax
je 0x573f4
jmp 0x57407
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq -0x10(%rbp), %rax
movabsq $-0x4000000000000, %rcx # imm = 0xFFFC000000000000
cmpq %rcx, %rax
jne 0x57407
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x69610
movq %rax, -0x58(%rbp)
jmp 0x57418
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x69420
movq %rax, -0x58(%rbp)
xorl %eax, %eax
testb $0x1, %al
jne 0x57420
jmp 0x57446
movsd -0x58(%rbp), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x57432
jmp 0x57488
movq -0x58(%rbp), %rax
shrq $0x2f, %rax
andq $0xf, %rax
cmpq $0x0, %rax
je 0x57488
jmp 0x57463
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq -0x58(%rbp), %rax
movabsq $-0x7800000000000, %rcx # imm = 0xFFF8800000000000
cmpq %rcx, %rax
je 0x57488
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, 0x28(%rax)
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
cvttsd2si -0x58(%rbp), %rax
movl %eax, -0x4(%rbp)
jmp 0x57c88
movq -0x18(%rbp), %rcx
movl 0x30(%rcx), %eax
movl %eax, %edx
addl $-0x1, %edx
movl %edx, 0x30(%rcx)
cmpl $0x0, %eax
jne 0x574ac
movq -0x18(%rbp), %rdi
leaq 0x3ddc8(%rip), %rsi     # 0x9526f
callq 0x57e80
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x574ca
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x4(%rax), %eax
movl %eax, -0x120(%rbp)
jmp 0x574d4
xorl %eax, %eax
movl %eax, -0x120(%rbp)
jmp 0x574d4
movl -0x120(%rbp), %eax
movl %eax, -0x5c(%rbp)
xorl %eax, %eax
testb $0x1, %al
jne 0x574e5
jmp 0x57512
movsd -0x10(%rbp), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x574fa
jmp 0x575d3
movq -0x10(%rbp), %rax
shrq $0x2f, %rax
andq $0xf, %rax
cmpq $0x0, %rax
je 0x575d3
jmp 0x57533
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq -0x10(%rbp), %rax
movabsq $-0x3000000000000, %rcx # imm = 0xFFFD000000000000
cmpq %rcx, %rax
je 0x575d3
movq -0x38(%rbp), %rax
movq %rax, -0x68(%rbp)
xorl %eax, %eax
testb $0x1, %al
jne 0x57543
jmp 0x57569
movsd -0x10(%rbp), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x57555
jmp 0x575a3
movq -0x10(%rbp), %rax
shrq $0x2f, %rax
andq $0xf, %rax
cmpq $0x0, %rax
je 0x575a3
jmp 0x57586
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq -0x10(%rbp), %rax
movabsq $-0x4000000000000, %rcx # imm = 0xFFFC000000000000
cmpq %rcx, %rax
je 0x575a3
jmp 0x57588
movq -0x68(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x575a1
movq -0x68(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x68(%rbp)
jmp 0x57588
jmp 0x575a3
movq -0x68(%rbp), %rax
movq %rax, -0x128(%rbp)
movl -0x5c(%rbp), %eax
cvtsi2sd %rax, %xmm0
callq 0x7b820
movq -0x128(%rbp), %rdi
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rsi
movq -0x70(%rbp), %rdx
callq 0x697e0
movsd -0x10(%rbp), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x575e5
jmp 0x575f9
movq -0x10(%rbp), %rax
shrq $0x2f, %rax
andq $0xf, %rax
movl %eax, -0x12c(%rbp)
jmp 0x57603
xorl %eax, %eax
movl %eax, -0x12c(%rbp)
jmp 0x57603
movl -0x12c(%rbp), %eax
movl %eax, %ecx
movq %rcx, -0x138(%rbp)
subl $0xb, %eax
ja 0x5762e
movq -0x138(%rbp), %rax
leaq 0x3d5e7(%rip), %rcx     # 0x94c0c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rdi
leaq 0x3dc56(%rip), %rsi     # 0x9528f
callq 0x57e80
movq -0x10(%rbp), %rax
andq $0x1, %rax
movl %eax, -0x74(%rbp)
movq -0x18(%rbp), %rdi
movl $0x2, %esi
callq 0x57ec0
movq %rax, -0x88(%rbp)
movq %rdx, -0x80(%rbp)
movl -0x74(%rbp), %ecx
movl $0x2, %edx
movl $0x1, %eax
cmpl $0x0, %ecx
cmovnel %eax, %edx
movq -0x88(%rbp), %rdi
movq -0x80(%rbp), %rsi
xorl %ecx, %ecx
callq 0x57fb0
jmp 0x57c5e
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x57ff0
movl %eax, -0x8c(%rbp)
movq -0x18(%rbp), %rdi
movl $0x2, %esi
callq 0x57ec0
movq %rax, -0xa0(%rbp)
movq %rdx, -0x98(%rbp)
cmpl $0x0, -0x8c(%rbp)
jge 0x576e6
xorl %ecx, %ecx
subl -0x8c(%rbp), %ecx
movq -0xa0(%rbp), %rdi
movq -0x98(%rbp), %rsi
movl $0x2, %edx
callq 0x57fb0
jmp 0x57704
movl -0x8c(%rbp), %ecx
movq -0xa0(%rbp), %rdi
movq -0x98(%rbp), %rsi
movl $0x1, %edx
callq 0x57fb0
jmp 0x57c5e
movq -0x10(%rbp), %rdi
callq 0x7b260
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movl -0x8(%rax), %eax
movl %eax, -0xac(%rbp)
movq -0x18(%rbp), %rdi
movl -0xac(%rbp), %edx
movq -0xa8(%rbp), %rcx
xorl %esi, %esi
callq 0x58040
jmp 0x57c5e
movq -0x10(%rbp), %rdi
callq 0x7b260
movq %rax, -0xb8(%rbp)
movq -0x18(%rbp), %rdi
movq -0xb8(%rbp), %rax
movl 0x10(%rax), %edx
movq -0xb8(%rbp), %rax
movq 0x18(%rax), %rcx
xorl %esi, %esi
callq 0x58040
jmp 0x57c5e
movq -0x10(%rbp), %rdi
callq 0x7b260
movq %rax, %rdi
callq 0x69c50
movq %rax, -0xc0(%rbp)
movq -0x38(%rbp), %rcx
movq -0xc0(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0xc0(%rbp), %rcx
movq %rcx, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x140(%rbp)
leaq 0x3dadf(%rip), %rdi     # 0x952a5
callq 0x68d90
movq %rax, %rdi
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
callq 0x7b550
movq -0x140(%rbp), %rdi
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rsi
callq 0x69610
movq %rax, -0xc8(%rbp)
xorl %eax, %eax
testb $0x1, %al
jne 0x57806
jmp 0x57832
movsd -0xc8(%rbp), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x5781b
jmp 0x57852
movq -0xc8(%rbp), %rax
shrq $0x2f, %rax
andq $0xf, %rax
cmpq $0x0, %rax
je 0x57852
jmp 0x57862
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq -0xc8(%rbp), %rax
movabsq $-0x7800000000000, %rcx # imm = 0xFFF8800000000000
cmpq %rcx, %rax
jne 0x57862
movq -0x18(%rbp), %rdi
leaq 0x3da4d(%rip), %rsi     # 0x952aa
callq 0x57e80
movq -0x18(%rbp), %rdi
movq -0xc8(%rbp), %rsi
callq 0x571d0
movl %eax, -0x5c(%rbp)
jmp 0x57c5e
movq -0x10(%rbp), %rdi
callq 0x7b260
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rax
movl -0x10(%rax), %edi
shll %edi
callq 0x692f0
movq %rax, -0xe0(%rbp)
movl $0x0, -0xe4(%rbp)
movl -0xe4(%rbp), %eax
movq -0xd8(%rbp), %rcx
cmpl -0x10(%rcx), %eax
jge 0x5799c
xorl %eax, %eax
testb $0x1, %al
jne 0x578ca
jmp 0x57918
movq -0xd8(%rbp), %rax
movslq -0xe4(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x578f0
jmp 0x57949
movq -0xd8(%rbp), %rax
movslq -0xe4(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x2f, %rax
andq $0xf, %rax
cmpq $0x0, %rax
je 0x57949
jmp 0x57986
movq -0xd8(%rbp), %rcx
movslq -0xe4(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq (%rcx), %rax
movabsq $-0x5000000000000, %rcx # imm = 0xFFFB000000000000
cmpq %rcx, %rax
jne 0x57986
movq -0xe0(%rbp), %rdi
movq -0xd8(%rbp), %rcx
movslq -0xe4(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movq -0xd8(%rbp), %rax
movslq -0xe4(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq (%rcx), %rsi
movq 0x8(%rax), %rdx
callq 0x697e0
jmp 0x57988
movl -0xe4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe4(%rbp)
jmp 0x578ac
movq -0x38(%rbp), %rcx
movq -0xe0(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0xe0(%rbp), %rcx
movq %rcx, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x148(%rbp)
leaq 0x3d8d6(%rip), %rdi     # 0x952a5
callq 0x68d90
movq %rax, %rdi
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
callq 0x7b550
movq -0x148(%rbp), %rdi
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rsi
callq 0x69610
movq %rax, -0xf0(%rbp)
xorl %eax, %eax
testb $0x1, %al
jne 0x57a0f
jmp 0x57a3b
movsd -0xf0(%rbp), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x57a24
jmp 0x57a5b
movq -0xf0(%rbp), %rax
shrq $0x2f, %rax
andq $0xf, %rax
cmpq $0x0, %rax
je 0x57a5b
jmp 0x57a6b
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq -0xf0(%rbp), %rax
movabsq $-0x7800000000000, %rcx # imm = 0xFFF8800000000000
cmpq %rcx, %rax
jne 0x57a6b
movq -0x18(%rbp), %rdi
leaq 0x3d844(%rip), %rsi     # 0x952aa
callq 0x57e80
movq -0x18(%rbp), %rdi
movq -0xf0(%rbp), %rsi
callq 0x571d0
movl %eax, -0x5c(%rbp)
jmp 0x57c5e
movq -0x10(%rbp), %rdi
callq 0x7b260
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rax
movl -0x10(%rax), %eax
movl %eax, -0x104(%rbp)
cmpl $0x0, -0x104(%rbp)
jne 0x57abc
movq -0x18(%rbp), %rdi
leaq 0x3d80f(%rip), %rsi     # 0x952c6
callq 0x57e80
movq -0x100(%rbp), %rax
movq (%rax), %rdi
callq 0x6d480
cmpl $0x0, %eax
je 0x57b33
movq -0x100(%rbp), %rax
cvttsd2si (%rax), %eax
movl %eax, -0x108(%rbp)
cmpl $0x0, -0x108(%rbp)
jge 0x57b18
movq -0x18(%rbp), %rax
movq %rax, -0x150(%rbp)
movl -0x108(%rbp), %esi
leaq 0x3d7ef(%rip), %rdi     # 0x952f1
movb $0x0, %al
callq 0x5bdd0
movq -0x150(%rbp), %rdi
movq %rax, %rsi
callq 0x57e80
movq -0x18(%rbp), %rdi
movl -0x104(%rbp), %esi
movq -0x100(%rbp), %rdx
callq 0x58230
jmp 0x57c5e
xorl %eax, %eax
testb $0x1, %al
jne 0x57b3b
jmp 0x57b6d
movq -0x100(%rbp), %rax
movsd (%rax), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x57b53
jmp 0x57bc2
movq -0x100(%rbp), %rax
movq (%rax), %rax
shrq $0x2f, %rax
andq $0xf, %rax
cmpq $0x0, %rax
je 0x57bc2
jmp 0x57b90
movq -0x100(%rbp), %rcx
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq (%rcx), %rax
movabsq $-0x5800000000000, %rcx # imm = 0xFFFA800000000000
cmpq %rcx, %rax
je 0x57bc2
movq -0x18(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x100(%rbp), %rax
movq (%rax), %rsi
leaq 0x3d76b(%rip), %rdi     # 0x95317
movb $0x0, %al
callq 0x5bdd0
movq -0x158(%rbp), %rdi
movq %rax, %rsi
callq 0x57e80
movq -0x100(%rbp), %rax
movq (%rax), %rdi
callq 0x7b260
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rcx
leaq 0x5740a(%rip), %rdi     # 0xaeff0
movl $0x36, %esi
movl $0x10, %edx
callq 0x6b360
movq %rax, -0x118(%rbp)
cmpq $0x0, -0x118(%rbp)
je 0x57c2d
movq -0x118(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rdi
movl -0x104(%rbp), %esi
subl $0x1, %esi
movq -0x100(%rbp), %rdx
addq $0x8, %rdx
callq *%rax
jmp 0x57c5c
movq -0x18(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x110(%rbp), %rsi
leaq 0x3d6f4(%rip), %rdi     # 0x9533a
movb $0x0, %al
callq 0x5bdd0
movq -0x160(%rbp), %rdi
movq %rax, %rsi
callq 0x57e80
jmp 0x57c5e
movq -0x18(%rbp), %rax
movl 0x30(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x30(%rax)
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, 0x28(%rax)
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl -0x5c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
nopw %cs:(%rax,%rax)