// File: rofl0r[P]ascc/cs_parser.cpp
// Function: cc_tokenize(char const*, ccInternalList*, ccCompiledScript*)
int cc_tokenize(const char*inpl, ccInternalList*targ, ccCompiledScript*scrip) {
    // *** create the symbol table and parse the text code into symbol code
    int linenum=1,in_struct_declr=-1,bracedepth = 0, last_time=0;
    int parenthesisdepth = 0;
    FMEM*iii=fmem_open(inpl);
    targ->write_meta(SMETA_LINENUM,1);
    while (!fmem_eof(iii)) {
        int thischar, waseof = 0;
        do {  // skip the whitespace
            if (fmem_eof(iii)) {
                waseof = 1;
                break;
            }
            thischar = fmem_getc(iii);
        } while (is_whitespace(thischar));
        // if it was the end of file, abort
        if (waseof)
            break;
        if ((thischar == '\r') || (thischar == '\n')) {
            // write the line number (for debugging)
            linenum++;
            targ->write_meta(SMETA_LINENUM,linenum);
            if (fmem_peekc(iii) =='\n') fmem_getc(iii);
            currentline=linenum;
            // go back and get the whitespace after the CRLF
            continue;
        }
        // it's some sort of symbol, so read it in
        char thissymbol[MAX_SYM_LEN];
        int symlen=1;
        thissymbol[0]=thischar;
        int thisIsEscaped = 0;
        while (is_part_of_symbol(fmem_peekc(iii),thischar) ||
               (thischar == '0' && symlen >= 2 && thissymbol[1] == 'x' && isxdigit(fmem_peekc(iii)))
        ) {

            thissymbol[symlen] = fmem_getc(iii);
            symlen++;
            if (symlen >= MAX_SYM_LEN - 1) break;
        }
        thissymbol[symlen]=0;
        if (thissymbol[0] == '0' && thissymbol[1] == 'x' && isxdigit(thissymbol[2])) {
            long tmp = strtoul(thissymbol, (char**) 0, 16);
            sprintf(thissymbol, "%d", (int)tmp);
        }
        if ((thissymbol[0] == '\'') && (thissymbol[2] == '\'')) {
            // convert the character to its ASCII equivalent
            sprintf(thissymbol,"%d",thissymbol[1]);
        }
        else if (thissymbol[0] == '\'') {
            cc_error("incorrectly terminated character constant");
            return -1;
        }

        if (sym.entries[last_time].stype == SYM_DOT) {
            // mangle member variable accesses so that you can have a
            // struct called Room but also a member property called Room
            char thissymbol_mangled[MAX_SYM_LEN + 1];
            sprintf(thissymbol_mangled, ".%s", thissymbol);
            strcpy(thissymbol, thissymbol_mangled);
        }

        int towrite = sym_find_or_add(sym, thissymbol);
        if (towrite < 0) {
            cc_error("symbol table overflow - could not ensure new symbol.");
            return -1;
        }
        if (
            (thissymbol[0] >= '0') && (thissymbol[0] <= '9') ||
            (thissymbol[0] == '-' && (thissymbol[1] >= '0') && (thissymbol[1] <= '9'))
        ) {
            if (strchr(thissymbol, '.') != NULL)
                sym.entries[towrite].stype = SYM_LITERALFLOAT;
            else
                sym.entries[towrite].stype = SYM_LITERALVALUE;
        }
        if (sym.entries[towrite].stype == SYM_MASSIGN && thischar == '*' && sym.entries[last_time].stype == SYM_VARTYPE) {
            // Break up *= when a parameter is declared with only the type and an initial value
            // e.g. import void someMethod(InventoryItem *= 0);
            targ->write(sym.find("*"));
            towrite = sym.find("=");
        }

        if (sym.entries[towrite].stype == SYM_OPENPARENTHESIS)
            parenthesisdepth++;
        else if (sym.entries[towrite].stype == SYM_CLOSEPARENTHESIS)
            parenthesisdepth--;

        // deal with forward-declas
        if ((sym.entries[towrite].stype == SYM_SEMICOLON) && (bracedepth == 0))
            in_struct_declr = -1;

        // this bit sorts out renaming struct members to allow different
        // structs to have same member names at different offsets
        if (towrite < 1) ;
        else if (sym.entries[last_time].stype == SYM_STRUCT) {
            in_struct_declr = towrite;
            bracedepth = 0;
        }
        else if ((sym.entries[last_time].stype == SYM_ENUM) && (sym.entries[towrite].stype == 0)) {
            // make sure it doens't get jibbled when used within
            // structs
            sym.entries[towrite].stype = SYM_TEMPORARYTYPE;
        }
        else if ((sym.entries[towrite].stype == SYM_OPENBRACE) && (in_struct_declr >= 0))
            bracedepth++;
        else if ((sym.entries[towrite].stype == SYM_CLOSEBRACE) && (in_struct_declr >= 0)) {
            bracedepth--;
            if (bracedepth <= 0)
                in_struct_declr = -1;
        }
        else if ((sym.entries[towrite].stype == 0 || sym.entries[towrite].stype == SYM_FUNCTION || sym.entries[towrite].stype == SYM_GLOBALVAR) &&
            (in_struct_declr >= 0) && (parenthesisdepth == 0) && (bracedepth > 0)) {
                // change the name of structure members so that the same member name
                // can be used in multiple structs
                // (but only if not currently in a function params list
                // and not an imported func/property type)
                // (and if not the struct type (this allows member functions
                // which return the struct)
                if ((sym.entries[last_time].stype != SYM_PROPERTY) &&
                    (sym.entries[last_time].stype != SYM_IMPORT) &&
                    (sym.entries[last_time].stype != SYM_STATIC) &&
                    (sym.entries[last_time].stype != SYM_PROTECTED) &&
                    (sym.entries[last_time].stype != SYM_WRITEPROTECTED) &&
                    (sym.entries[last_time].stype != SYM_SEMICOLON) &&
                    (sym.entries[last_time].stype != SYM_OPENBRACE) &&
                    (sym.entries[last_time].stype != SYM_OPENBRACKET) &&
                    (towrite != in_struct_declr)) {
                        const char *new_name = get_member_full_name(in_struct_declr, towrite);
                        //      printf("changed '%s' to '%s'\n",sym.get_friendly_name(towrite).c_str(),new_name);
                        towrite = sym_find_or_add(sym, new_name);
                        if (towrite < 0) {
                            cc_error("symbol table error - could not ensure new struct symbol.");
                            return -1;
                        }
                }
        }

        if (thissymbol[0]=='\"') {
            // strip closing speech mark
            thissymbol[strlen(thissymbol)-1] = 0;
            // save the string into the string table area
            sym.entries[towrite].stype = SYM_STRING;
            sym.entries[towrite].soffs = scrip->add_string(&thissymbol[1]);
            // set it to be recognised as a string
            sym.entries[towrite].vartype = sym.normalStringSym;

            if (strncmp(thissymbol, NEW_SCRIPT_TOKEN_PREFIX, 18) == 0)
            {
                snprintf(scriptNameBuffer, sizeof(scriptNameBuffer), "%s", &thissymbol[18]);
                ccCurScriptName = scriptNameBuffer;

                linenum = 0;
                currentline = 0;
            }
        }
        targ->write(towrite);
        last_time = towrite;
    }
    fmem_close(iii);
    targ->write_meta(SMETA_END,0);
    // clear any temporary tpyes set
    for (int ii = 0; (size_t)ii < sym.entries.size(); ii++) {
        if (sym.entries[ii].stype == SYM_TEMPORARYTYPE)
            sym.entries[ii].stype = 0;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x480, %rsp            # imm = 0x480
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x1, -0x24(%rbp)
movl $0xffffffff, -0x28(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x10(%rbp), %rdi
callq 0x24ce0
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0x1e010
movq -0x40(%rbp), %rdi
callq 0x25020
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x68a1
jmp 0x7147
movl $0x0, -0x48(%rbp)
movq -0x40(%rbp), %rdi
callq 0x25020
cmpl $0x0, %eax
je 0x68bf
movl $0x1, -0x48(%rbp)
jmp 0x68db
movq -0x40(%rbp), %rdi
callq 0x24fc0
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movsbl %al, %edi
callq 0x26240
cmpl $0x0, %eax
jne 0x68a8
cmpl $0x0, -0x48(%rbp)
je 0x68e6
jmp 0x7147
cmpl $0xd, -0x44(%rbp)
je 0x68f2
cmpl $0xa, -0x44(%rbp)
jne 0x6934
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %edx
movl $0x1, %esi
callq 0x1e010
movq -0x40(%rbp), %rdi
callq 0x25000
cmpl $0xa, %eax
jne 0x6923
movq -0x40(%rbp), %rdi
callq 0x24fc0
movl -0x24(%rbp), %ecx
leaq 0x3c003(%rip), %rax     # 0x42930
movl %ecx, (%rax)
jmp 0x6887
movl $0x1, -0x244(%rbp)
movl -0x44(%rbp), %eax
movb %al, -0x240(%rbp)
movl $0x0, -0x248(%rbp)
movq -0x40(%rbp), %rdi
callq 0x25000
movb %al, %cl
movl -0x44(%rbp), %eax
movsbl %cl, %edi
movsbl %al, %esi
callq 0x64a0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x465(%rbp)
jne 0x69d4
xorl %eax, %eax
cmpl $0x30, -0x44(%rbp)
movb %al, -0x466(%rbp)
jne 0x69c8
xorl %eax, %eax
cmpl $0x2, -0x244(%rbp)
movb %al, -0x466(%rbp)
jl 0x69c8
movsbl -0x23f(%rbp), %ecx
xorl %eax, %eax
cmpl $0x78, %ecx
movb %al, -0x466(%rbp)
jne 0x69c8
movq -0x40(%rbp), %rdi
callq 0x25000
movl %eax, %edi
callq 0x4100
cmpl $0x0, %eax
setne %al
movb %al, -0x466(%rbp)
movb -0x466(%rbp), %al
movb %al, -0x465(%rbp)
movb -0x465(%rbp), %al
testb $0x1, %al
jne 0x69e0
jmp 0x6a1b
movq -0x40(%rbp), %rdi
callq 0x24fc0
movb %al, %cl
movslq -0x244(%rbp), %rax
movb %cl, -0x240(%rbp,%rax)
movl -0x244(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x244(%rbp)
cmpl $0x1f3, -0x244(%rbp)    # imm = 0x1F3
jl 0x6a16
jmp 0x6a1b
jmp 0x6951
movslq -0x244(%rbp), %rax
movb $0x0, -0x240(%rbp,%rax)
movsbl -0x240(%rbp), %eax
cmpl $0x30, %eax
jne 0x6a8d
movsbl -0x23f(%rbp), %eax
cmpl $0x78, %eax
jne 0x6a8d
movsbl -0x23e(%rbp), %edi
callq 0x4100
cmpl $0x0, %eax
je 0x6a8d
leaq -0x240(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x10, %edx
callq 0x4150
movq %rax, -0x250(%rbp)
leaq -0x240(%rbp), %rdi
movq -0x250(%rbp), %rax
movl %eax, %edx
leaq 0x2d105(%rip), %rsi     # 0x33b8b
movb $0x0, %al
callq 0x40d0
movsbl -0x240(%rbp), %eax
cmpl $0x27, %eax
jne 0x6ac3
movsbl -0x23e(%rbp), %eax
cmpl $0x27, %eax
jne 0x6ac3
leaq -0x240(%rbp), %rdi
movsbl -0x23f(%rbp), %edx
leaq 0x2d0d1(%rip), %rsi     # 0x33b8b
movb $0x0, %al
callq 0x40d0
jmp 0x6aeb
movsbl -0x240(%rbp), %eax
cmpl $0x27, %eax
jne 0x6ae9
leaq 0x2ae35(%rip), %rdi     # 0x3190b
movb $0x0, %al
callq 0x1bac0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x71ee
jmp 0x6aeb
movslq -0x30(%rbp), %rsi
leaq 0x3bd7a(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x20(%rax), %eax
cmpl $0x9, %eax
jne 0x6b37
leaq -0x450(%rbp), %rdi
leaq -0x240(%rbp), %rdx
leaq 0x2ae18(%rip), %rsi     # 0x31935
movb $0x0, %al
callq 0x40d0
leaq -0x240(%rbp), %rdi
leaq -0x450(%rbp), %rsi
callq 0x4350
leaq -0x240(%rbp), %rsi
leaq 0x3bd2b(%rip), %rdi     # 0x42870
callq 0x67f0
movl %eax, -0x454(%rbp)
cmpl $0x0, -0x454(%rbp)
jge 0x6b73
leaq 0x2add9(%rip), %rdi     # 0x31939
movb $0x0, %al
callq 0x1bac0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x71ee
movsbl -0x240(%rbp), %eax
cmpl $0x30, %eax
jl 0x6b8b
movsbl -0x240(%rbp), %eax
cmpl $0x39, %eax
jle 0x6baf
movsbl -0x240(%rbp), %eax
cmpl $0x2d, %eax
jne 0x6c04
movsbl -0x23f(%rbp), %eax
cmpl $0x30, %eax
jl 0x6c04
movsbl -0x23f(%rbp), %eax
cmpl $0x39, %eax
jg 0x6c04
leaq -0x240(%rbp), %rdi
movl $0x2e, %esi
callq 0x4180
cmpq $0x0, %rax
je 0x6be5
movslq -0x454(%rbp), %rsi
leaq 0x3bc9c(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movw $0x16, 0x20(%rax)
jmp 0x6c02
movslq -0x454(%rbp), %rsi
leaq 0x3bc7d(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movw $0x13, 0x20(%rax)
jmp 0x6c04
movslq -0x454(%rbp), %rsi
leaq 0x3bc5e(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x20(%rax), %eax
cmpl $0x1a, %eax
jne 0x6c8c
cmpl $0x2a, -0x44(%rbp)
jne 0x6c8c
movslq -0x30(%rbp), %rsi
leaq 0x3bc3b(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x20(%rax), %eax
cmpl $0x2e, %eax
jne 0x6c8c
movq -0x18(%rbp), %rax
movq %rax, -0x470(%rbp)
leaq 0x3bc17(%rip), %rdi     # 0x42870
leaq 0x2d5bc(%rip), %rsi     # 0x3421c
callq 0x1f050
movq -0x470(%rbp), %rdi
movl %eax, %esi
callq 0x1df70
leaq 0x3bbf6(%rip), %rdi     # 0x42870
leaq 0x2cd57(%rip), %rsi     # 0x339d8
callq 0x1f050
movl %eax, -0x454(%rbp)
movslq -0x454(%rbp), %rsi
leaq 0x3bbd6(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x20(%rax), %eax
cmpl $0x5, %eax
jne 0x6cb7
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x6ce2
movslq -0x454(%rbp), %rsi
leaq 0x3bbab(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x20(%rax), %eax
cmpl $0x6, %eax
jne 0x6ce0
movl -0x34(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x6ce2
movslq -0x454(%rbp), %rsi
leaq 0x3bb80(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x20(%rax), %eax
cmpl $0x28, %eax
jne 0x6d0f
cmpl $0x0, -0x2c(%rbp)
jne 0x6d0f
movl $0xffffffff, -0x28(%rbp) # imm = 0xFFFFFFFF
cmpl $0x1, -0x454(%rbp)
jge 0x6d1d
jmp 0x700f
movslq -0x30(%rbp), %rsi
leaq 0x3bb48(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x20(%rax), %eax
cmpl $0x1e, %eax
jne 0x6d4f
movl -0x454(%rbp), %eax
movl %eax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
jmp 0x700d
movslq -0x30(%rbp), %rsi
leaq 0x3bb16(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x20(%rax), %eax
cmpl $0x27, %eax
jne 0x6dae
movslq -0x454(%rbp), %rsi
leaq 0x3baf6(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x20(%rax), %eax
cmpl $0x0, %eax
jne 0x6dae
movslq -0x454(%rbp), %rsi
leaq 0x3bad6(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movw $0xff9d, 0x20(%rax)     # imm = 0xFF9D
jmp 0x700b
movslq -0x454(%rbp), %rsi
leaq 0x3bab4(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x20(%rax), %eax
cmpl $0x17, %eax
jne 0x6de2
cmpl $0x0, -0x28(%rbp)
jl 0x6de2
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x7009
movslq -0x454(%rbp), %rsi
leaq 0x3ba80(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x20(%rax), %eax
cmpl $0x18, %eax
jne 0x6e23
cmpl $0x0, -0x28(%rbp)
jl 0x6e23
movl -0x2c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jg 0x6e1e
movl $0xffffffff, -0x28(%rbp) # imm = 0xFFFFFFFF
jmp 0x7007
movslq -0x454(%rbp), %rsi
leaq 0x3ba3f(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x20(%rax), %eax
cmpl $0x0, %eax
je 0x6e87
movslq -0x454(%rbp), %rsi
leaq 0x3ba1f(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x20(%rax), %eax
cmpl $0x4, %eax
je 0x6e87
movslq -0x454(%rbp), %rsi
leaq 0x3b9ff(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x20(%rax), %eax
cmpl $0x1, %eax
jne 0x7005
cmpl $0x0, -0x28(%rbp)
jl 0x7005
cmpl $0x0, -0x34(%rbp)
jne 0x7005
cmpl $0x0, -0x2c(%rbp)
jle 0x7005
movslq -0x30(%rbp), %rsi
leaq 0x3b9c0(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x20(%rax), %eax
cmpl $0x26, %eax
je 0x7003
movslq -0x30(%rbp), %rsi
leaq 0x3b99f(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x20(%rax), %eax
cmpl $0x20, %eax
je 0x7003
movslq -0x30(%rbp), %rsi
leaq 0x3b97e(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x20(%rax), %eax
cmpl $0x2c, %eax
je 0x7003
movslq -0x30(%rbp), %rsi
leaq 0x3b95d(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x20(%rax), %eax
cmpl $0x2d, %eax
je 0x7003
movslq -0x30(%rbp), %rsi
leaq 0x3b93c(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x20(%rax), %eax
cmpl $0x30, %eax
je 0x7003
movslq -0x30(%rbp), %rsi
leaq 0x3b91b(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x20(%rax), %eax
cmpl $0x28, %eax
je 0x7003
movslq -0x30(%rbp), %rsi
leaq 0x3b8fa(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x20(%rax), %eax
cmpl $0x17, %eax
je 0x7003
movslq -0x30(%rbp), %rsi
leaq 0x3b8dd(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x20(%rax), %eax
cmpl $0x7, %eax
je 0x7003
movl -0x454(%rbp), %eax
cmpl -0x28(%rbp), %eax
je 0x7003
movl -0x28(%rbp), %edi
movl -0x454(%rbp), %esi
callq 0x6770
movq %rax, -0x460(%rbp)
movq -0x460(%rbp), %rsi
leaq 0x3b89d(%rip), %rdi     # 0x42870
callq 0x67f0
movl %eax, -0x454(%rbp)
cmpl $0x0, -0x454(%rbp)
jge 0x7001
leaq 0x2a980(%rip), %rdi     # 0x3196e
movb $0x0, %al
callq 0x1bac0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x71ee
jmp 0x7003
jmp 0x7005
jmp 0x7007
jmp 0x7009
jmp 0x700b
jmp 0x700d
jmp 0x700f
movsbl -0x240(%rbp), %eax
cmpl $0x22, %eax
jne 0x712a
leaq -0x240(%rbp), %rdi
callq 0x41d0
subq $0x1, %rax
movb $0x0, -0x240(%rbp,%rax)
movslq -0x454(%rbp), %rsi
leaq 0x3b82b(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movw $0x12, 0x20(%rax)
movq -0x20(%rbp), %rdi
leaq -0x240(%rbp), %rsi
addq $0x1, %rsi
callq 0x25650
movl %eax, -0x478(%rbp)
movslq -0x454(%rbp), %rsi
leaq 0x3b7f4(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movl -0x478(%rbp), %ecx
movl %ecx, 0x34(%rax)
leaq 0x3b7db(%rip), %rax     # 0x42870
movl 0x10(%rax), %eax
movw %ax, -0x472(%rbp)
movslq -0x454(%rbp), %rsi
leaq 0x3b7c3(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movw -0x472(%rbp), %cx
movw %cx, 0x30(%rax)
leaq -0x240(%rbp), %rdi
leaq 0x2a8d8(%rip), %rsi     # 0x319a7
movl $0x12, %edx
callq 0x4210
cmpl $0x0, %eax
jne 0x7128
leaq -0x240(%rbp), %rcx
addq $0x12, %rcx
leaq 0x3b650(%rip), %rdi     # 0x42740
movl $0x100, %esi            # imm = 0x100
leaq 0x2c5cc(%rip), %rdx     # 0x336c8
movb $0x0, %al
callq 0x45f0
leaq 0x3b346(%rip), %rax     # 0x42450
leaq 0x3b62f(%rip), %rcx     # 0x42740
movq %rcx, (%rax)
movl $0x0, -0x24(%rbp)
leaq 0x3b80e(%rip), %rax     # 0x42930
movl $0x0, (%rax)
jmp 0x712a
movq -0x18(%rbp), %rdi
movl -0x454(%rbp), %esi
callq 0x1df70
movl -0x454(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x6887
movq -0x40(%rbp), %rdi
callq 0x24d90
movq -0x18(%rbp), %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x1e010
movl $0x0, -0x464(%rbp)
movslq -0x464(%rbp), %rax
movq %rax, -0x480(%rbp)
leaq 0x3b6f1(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e80
movq %rax, %rcx
movq -0x480(%rbp), %rax
cmpq %rcx, %rax
jae 0x71e7
movslq -0x464(%rbp), %rsi
leaq 0x3b6cb(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x20(%rax), %eax
cmpl $-0x63, %eax
jne 0x71d4
movslq -0x464(%rbp), %rsi
leaq 0x3b6ab(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movw $0x0, 0x20(%rax)
jmp 0x71d6
movl -0x464(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x464(%rbp)
jmp 0x716a
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x480, %rsp            # imm = 0x480
popq %rbp
retq
nopw (%rax,%rax)