// File: /workspace/github_c_makefile_star2_O3/endeav0r[P]hvm/src/lexer.c
// Function: lexer
struct _token * lexer (const char * text)
{
    int i     = 0;
    int j, k  = 0;
    int line  = 1;
    char buf[64];

    struct _lexer lexer;
    lexer.first = NULL;
    lexer.last  = NULL;

    while (text[i] != '\0') {
        if (    (text[i] == ' ')
             || (text[i] == '\t')) {
            i++;
            continue;
        }

        if (text[i] == '\n') {
            lexer_append(&lexer, token_create(TOK_NEWLINE, NULL, line));
            i++;
            line++;
            continue;
        }

        if (text[i] == ',') {
            lexer_append(&lexer, token_create(TOK_COMMA, NULL, line));
            i++;
            continue;
        }

        if (text[i] == ';') {
            while (text[i] != '\n')
                i++;
            continue;
        }

        #define MATCHTOK(TOKSTR, TOKVAL) \
        if (strncmp(&(text[i]), #TOKSTR, strlen(#TOKSTR)) == 0) { \
            if (    ((text[i+strlen(#TOKSTR)] < 'a') || (text[i+strlen(#TOKSTR)] > 'z')) \
                 && ((text[i+strlen(#TOKSTR)] < '0') || (text[i+strlen(#TOKSTR)] > '9')) \
                 && (text[i+strlen(#TOKSTR)] != '_')) { \
                lexer_append(&lexer, token_create(TOKVAL, #TOKSTR, line)); \
                i += strlen(#TOKSTR); \
                continue; \
            } \
        }

        MATCHTOK(r0,      REG_0)
        MATCHTOK(r1,      REG_1)
        MATCHTOK(r2,      REG_2)
        MATCHTOK(r3,      REG_3)
        MATCHTOK(r4,      REG_4)
        MATCHTOK(r5,      REG_5)
        MATCHTOK(r6,      REG_6)
        MATCHTOK(r7,      REG_7)
        MATCHTOK(rsp,     REG_SP)
        MATCHTOK(rbp,     REG_BP)
        MATCHTOK(rip,     REG_IP)
        MATCHTOK(mov,     OP_MOV)
        MATCHTOK(cmp,     OP_CMP)
        MATCHTOK(add,     OP_ADD)
        MATCHTOK(sub,     OP_SUB)
        MATCHTOK(mul,     OP_MUL)
        MATCHTOK(div,     OP_DIV)
        MATCHTOK(mod,     OP_MOD)
        MATCHTOK(and,     OP_AND)
        MATCHTOK(or,      OP_OR)
        MATCHTOK(xor,     OP_XOR)
        MATCHTOK(jmp,     OP_JMP)
        MATCHTOK(je,      OP_JE)
        MATCHTOK(jne,     OP_JNE)
        MATCHTOK(jle,     OP_JLE)
        MATCHTOK(jl,      OP_JL)
        MATCHTOK(jge,     OP_JGE)
        MATCHTOK(jg,      OP_JG)
        MATCHTOK(call,    OP_CALL)
        MATCHTOK(ret,     OP_RET)
        MATCHTOK(loadb,   OP_LOADB)
        MATCHTOK(load,    OP_LOAD)
        MATCHTOK(storb,   OP_STORB)
        MATCHTOK(stor,    OP_STOR)
        MATCHTOK(in,      OP_IN)
        MATCHTOK(out,     OP_OUT)
        MATCHTOK(push,    OP_PUSH)
        MATCHTOK(pop,     OP_POP)
        MATCHTOK(hlt,     OP_HLT)
        MATCHTOK(syscall, OP_SYSCALL)
        MATCHTOK(nop,     OP_NOP)

        // numbers
        if (((text[i] >= '0') && (text[i] <= '9')) || (text[i] == '-')) {
            if ((text[i + 1] == 'x') && (text[i] != '-')) {
                for (j = i + 2;
                     (    ((text[j] >= '0') && (text[j] <= '9'))
                       || ((text[j] >= 'a') && (text[j] <= 'f')));
                     j++) {}
            }
            else {
                for (j = i + 1;
                     ((text[j] >= '0') && (text[j] <= '9'));
                     j++) {}
            }
            // catch #x case
            if (text[j - 1] != 'x') {
                strncpy(buf, &(text[i]), j - i < 64 ? j - i : 64);
                buf[j - i] = '\0'; // weird strncpy not copy null-terminator
                buf[63] = '\0';
                lexer_append(&lexer, token_create(TOK_NUMBER, buf, line));
                i = j;
                continue;
            }
        }

        // labels
        if ((text[i] >= 'a') && (text[i] <= 'z')) {
            for (j = i + 1; 
                       ((text[j] >= 'a') && (text[j] <= 'z'))
                    || ((text[j] >= '0') && (text[j] <= '9'))
                    || (text[j] == '_');
                 j++) {}
            for (k = j; (text[k] == ' ') || (text[k] == '\t'); k++) {}
            strncpy(buf, &(text[i]), j - i < 64 ? j - i : 64);
            buf[j - i] = '\0';
            buf[63] = '\0';
            if (text[k] == ':') {
                lexer_append(&lexer, token_create(TOK_LABELDEC, buf, line));
                i = k + 1;
            }
            else {
                lexer_append(&lexer, token_create(TOK_LABEL, buf, line));
                i = j;
            }
            continue;
        }

        // strings
        if (text[i] == '"') {
            char * tmpstr = (char *) malloc(4096);
            j = i + 1;
            k = 0;
            while (text[j] != '"') {
                if (text[j] == '\\') {
                    j++;
                    if (text[j] == 'n')
                        tmpstr[k++] = '\n';
                    else if (text[j] == 't')
                        tmpstr[k++] = '\t';
                    else
                        tmpstr[k++] = text[j];
                }
                else
                    tmpstr[k++] = text[j];
                j++;
            }
            tmpstr[k] = '\0';
            lexer_append(&lexer, token_create(TOK_STRING, tmpstr, line));
            i = j + 1;
            free(tmpstr);
            continue;
        }


        fprintf(stderr, "invalid input to lexer, line %d (char=0x%02x)\n",
                line, text[i]);

        return NULL;
    }

    if (lexer.last == NULL)
        return NULL;

    if (lexer.last->type != TOK_NEWLINE)
        lexer_append(&lexer, token_create(TOK_NEWLINE, NULL, line));

    return lexer.first;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl $0x1, 0xc(%rsp)
xorl %ebx, %ebx
xorl %r12d, %r12d
xorl %r15d, %r15d
movq %rdi, 0x10(%rsp)
movq %r12, %rax
movq %rbx, %rbp
movslq %r15d, %r14
leaq (%rdi,%r14), %r12
movsbl (%rdi,%r14), %r13d
movzbl %r13b, %ebx
cmpl $0x1f, %ebx
jle 0x2f78
cmpl $0x20, %ebx
je 0x2fbb
cmpl $0x2c, %ebx
je 0x2fc9
cmpl $0x3b, %ebx
jne 0x3006
decl %r15d
incl %r15d
cmpb $0xa, (%r12)
leaq 0x1(%r12), %r12
jne 0x2f67
jmp 0x2fbe
cmpl $0x9, %ebx
je 0x2fbb
cmpl $0xa, %ebx
jne 0x2ffe
movl $0x70, %edi
xorl %esi, %esi
movl 0xc(%rsp), %edx
movq %rax, %rbx
callq 0x3f58
movq %rax, %r12
movq %rbx, %rax
movq %r12, %rbx
testq %rax, %rax
je 0x2faa
movq %r12, 0x10(%rax)
movq %rbp, %rbx
incl %r15d
incl 0xc(%rsp)
movq 0x10(%rsp), %rdi
jmp 0x2f36
incl %r15d
movq %rbp, %rbx
movq %rax, %r12
jmp 0x2f36
movl $0x71, %edi
xorl %esi, %esi
movl 0xc(%rsp), %edx
movq %rax, %rbx
callq 0x3f58
movq %rax, %r12
movq %rbx, %rax
movq %r12, %rbx
testq %rax, %rax
je 0x2ff1
movq %r12, 0x10(%rax)
movq %rbp, %rbx
incl %r15d
movq 0x10(%rsp), %rdi
jmp 0x2f36
testl %ebx, %ebx
je 0x3efe
movq %rax, 0x18(%rsp)
cmpl $0x72, %ebx
jne 0x3222
cmpb $0x30, 0x1(%r12)
jne 0x303f
movb 0x2(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x303f
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x32da
cmpb $0x31, 0x1(%r12)
jne 0x306a
movb 0x2(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x306a
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x34ec
cmpb $0x32, 0x1(%r12)
jne 0x3095
movb 0x2(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x3095
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x34fd
cmpb $0x33, 0x1(%r12)
jne 0x30c0
movb 0x2(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x30c0
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3c45
cmpb $0x34, 0x1(%r12)
jne 0x30eb
movb 0x2(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x30eb
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3c64
cmpb $0x35, 0x1(%r12)
jne 0x3116
movb 0x2(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x3116
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3cbb
cmpb $0x36, 0x1(%r12)
jne 0x3141
movb 0x2(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x3141
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3d15
cmpb $0x37, 0x1(%r12)
jne 0x316c
movb 0x2(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x316c
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3d6c
cmpb $0x73, 0x1(%r12)
jne 0x319f
cmpb $0x70, 0x2(%r12)
jne 0x319f
movb 0x3(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x319f
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3e43
cmpb $0x62, 0x1(%r12)
jne 0x31d2
cmpb $0x70, 0x2(%r12)
jne 0x31d2
movb 0x3(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x31d2
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3e51
cmpb $0x69, 0x1(%r12)
jne 0x3541
cmpb $0x70, 0x2(%r12)
jne 0x3541
movb 0x3(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x3541
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
jne 0x3541
movl $0x7, %edi
leaq 0x327b(%rip), %rsi      # 0x6498
jmp 0x3ecd
xorl %edx, %edx
leal -0x61(%rbx), %eax
cmpl $0xe, %eax
ja 0x32c3
leaq 0x3305(%rip), %rcx      # 0x653c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpb $0x64, 0x1(%r12)
jne 0x3273
cmpb $0x64, 0x2(%r12)
jne 0x3273
movb 0x3(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x3273
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3e97
cmpb $0x6e, 0x1(%r12)
jne 0x343a
cmpb $0x64, 0x2(%r12)
jne 0x343a
movb 0x3(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x343a
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
jne 0x343a
movl $0x1a, %edi
leaq 0x31f2(%rip), %rsi      # 0x64b0
jmp 0x3ecd
cmpl $0x73, %ebx
je 0x350e
cmpl $0x78, %ebx
je 0x349c
jmp 0x369a
xorl %edi, %edi
leaq 0x3195(%rip), %rsi      # 0x6478
jmp 0x3dc9
cmpb $0x6d, 0x1(%r12)
jne 0x3541
cmpb $0x70, 0x2(%r12)
jne 0x3541
movb 0x3(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x3541
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
jne 0x3541
movl $0x53, %edi
leaq 0x31cc(%rip), %rsi      # 0x64ff
jmp 0x3ecd
cmpb $0x69, 0x1(%r12)
jne 0x3541
cmpb $0x76, 0x2(%r12)
jne 0x3541
movb 0x3(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x3541
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
jne 0x3541
movl $0x16, %edi
leaq 0x3125(%rip), %rsi      # 0x64a8
jmp 0x3ecd
cmpb $0x6f, 0x1(%r12)
jne 0x33bb
cmpb $0x76, 0x2(%r12)
jne 0x33bb
movb 0x3(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x33bb
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3ea5
cmpb $0x75, 0x1(%r12)
jne 0x33ee
cmpb $0x6c, 0x2(%r12)
jne 0x33ee
movb 0x3(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x33ee
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3eb3
cmpb $0x6f, 0x1(%r12)
jne 0x343a
cmpb $0x64, 0x2(%r12)
jne 0x3541
movb 0x3(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x3541
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
jne 0x3541
movl $0x18, %edi
leaq 0x3077(%rip), %rsi      # 0x64ac
jmp 0x3ecd
cmpb $0x6a, %r13b
je 0x354b
movzbl %r13b, %eax
cmpl $0x78, %eax
je 0x349c
cmpl $0x6f, %eax
jne 0x3698
movb $0x1, %dl
cmpb $0x72, 0x1(%r12)
jne 0x369a
movb 0x2(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x369a
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
jne 0x369a
movl $0x1c, %edi
leaq 0x304b(%rip), %rsi      # 0x64e2
jmp 0x3dc9
cmpb $0x6f, 0x1(%r12)
jne 0x3698
cmpb $0x72, 0x2(%r12)
jne 0x3698
movb 0x3(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x3698
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
jne 0x3698
movl $0x1e, %edi
leaq 0x2fcd(%rip), %rsi      # 0x64b4
jmp 0x3ecd
movl $0x1, %edi
leaq 0x2f83(%rip), %rsi      # 0x647b
jmp 0x3dc9
movl $0x2, %edi
leaq 0x2f75(%rip), %rsi      # 0x647e
jmp 0x3dc9
cmpb $0x75, 0x1(%r12)
jne 0x3541
cmpb $0x62, 0x2(%r12)
jne 0x3541
movb 0x3(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x3541
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3ec1
cmpb $0x6a, %r13b
jne 0x3698
cmpb $0x6d, 0x1(%r12)
jne 0x357e
cmpb $0x70, 0x2(%r12)
jne 0x357e
movb 0x3(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x357e
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3df2
cmpb $0x65, 0x1(%r12)
jne 0x35a9
movb 0x2(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x35a9
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3d26
cmpb $0x6e, 0x1(%r12)
jne 0x35dc
cmpb $0x65, 0x2(%r12)
jne 0x35dc
movb 0x3(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x35dc
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3e21
cmpb $0x6c, 0x1(%r12)
jne 0x360f
cmpb $0x65, 0x2(%r12)
jne 0x360f
movb 0x3(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x360f
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3e32
cmpb $0x6c, 0x1(%r12)
jne 0x363a
movb 0x2(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x363a
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3daf
cmpb $0x67, 0x1(%r12)
jne 0x366d
cmpb $0x65, 0x2(%r12)
jne 0x366d
movb 0x3(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x366d
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3e5f
cmpb $0x67, 0x1(%r12)
jne 0x3698
movb 0x2(%rdi,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x3698
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3dbd
xorl %edx, %edx
movl %edx, 0x2c(%rsp)
movl $0x4, %edx
movq %r12, %rdi
leaq 0x2e5d(%rip), %rsi      # 0x650a
callq 0x2090
movq 0x10(%rsp), %rdx
testl %eax, %eax
jne 0x36de
movb 0x4(%rdx,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x36de
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3c34
cmpl $0x72, %ebx
jne 0x3716
cmpb $0x65, 0x1(%r12)
jne 0x3716
cmpb $0x74, 0x2(%r12)
jne 0x3716
movb 0x3(%rdx,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x3716
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3e03
movl $0x5, %edx
movq %r12, %rdi
leaq 0x2db5(%rip), %rsi      # 0x64da
callq 0x2090
testl %eax, %eax
jne 0x3756
movq 0x10(%rsp), %rax
movb 0x5(%rax,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x3756
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3c56
movl $0x4, %edx
movq %r12, %rdi
leaq 0x2d70(%rip), %rsi      # 0x64d5
callq 0x2090
testl %eax, %eax
jne 0x3796
movq 0x10(%rsp), %rax
movb 0x4(%rax,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x3796
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3c75
movl $0x5, %edx
movq %r12, %rdi
leaq 0x2d40(%rip), %rsi      # 0x64e5
callq 0x2090
testl %eax, %eax
jne 0x37d6
movq 0x10(%rsp), %rax
movb 0x5(%rax,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x37d6
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3c86
movl $0x4, %edx
movq %r12, %rdi
leaq 0x2cfb(%rip), %rsi      # 0x64e0
callq 0x2090
testl %eax, %eax
movq 0x10(%rsp), %rdx
jne 0x3816
movb 0x4(%rdx,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x3816
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3d07
cmpl $0x69, %ebx
jne 0x3853
cmpb $0x6e, 0x1(%r12)
jne 0x388d
movb 0x2(%rdx,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x388d
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
jne 0x388d
movl $0x40, %edi
leaq 0x2c9d(%rip), %rsi      # 0x64eb
jmp 0x3dc9
cmpb $0x0, 0x2c(%rsp)
je 0x388d
cmpb $0x75, 0x1(%r12)
jne 0x388d
cmpb $0x74, 0x2(%r12)
jne 0x388d
movb 0x3(%rdx,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x388d
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3e89
movl $0x4, %edx
movq %r12, %rdi
leaq 0x2c56(%rip), %rsi      # 0x64f2
callq 0x2090
movq 0x10(%rsp), %rdx
testl %eax, %eax
jne 0x38cd
movb 0x4(%rdx,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x38cd
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3d37
cmpb $0x68, %r13b
je 0x391c
movzbl %r13b, %eax
cmpl $0x70, %eax
jne 0x394f
cmpb $0x6f, 0x1(%r12)
jne 0x394f
cmpb $0x70, 0x2(%r12)
jne 0x394f
movb 0x3(%rdx,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x394f
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
jne 0x394f
movl $0x44, %edi
leaq 0x2be0(%rip), %rsi      # 0x64f7
jmp 0x3ecd
cmpb $0x6c, 0x1(%r12)
jne 0x394f
cmpb $0x74, 0x2(%r12)
jne 0x394f
movb 0x3(%rdx,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x394f
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3e7b
movl $0x7, %edx
movq %r12, %rdi
leaq 0x2ba9(%rip), %rsi      # 0x6507
callq 0x2090
movq 0x10(%rsp), %rdx
testl %eax, %eax
jne 0x398f
movb 0x7(%rdx,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x398f
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3d7a
cmpb $0x6e, (%r12)
jne 0x39c9
cmpb $0x6f, 0x1(%r12)
jne 0x39c9
cmpb $0x70, 0x2(%r12)
jne 0x39c9
movb 0x3(%rdx,%r14), %al
leal -0x7b(%rax), %ecx
cmpb $-0x1b, %cl
ja 0x39c9
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
cmpb $0x5f, %al
sete %al
orb %cl, %al
je 0x3e6d
leal -0x30(%r13), %eax
cmpb $0xa, %al
movq %rbp, 0x20(%rsp)
jae 0x3a07
cmpb $0x78, 0x1(%rdx,%r14)
jne 0x3a16
leal 0x2(%r15), %eax
movslq %eax, %rbp
decq %rbp
movb 0x1(%rdx,%rbp), %al
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
setb %cl
addb $-0x61, %al
cmpb $0x6, %al
setb %al
orb %cl, %al
incq %rbp
testb %al, %al
jne 0x39e8
jmp 0x3a2a
cmpb $0x2d, %r13b
jne 0x3a34
leal 0x1(%r15), %eax
movslq %eax, %rbp
jmp 0x3a1a
leaq 0x1(%r14), %rbp
decq %rbp
movb 0x1(%rdx,%rbp), %al
addb $-0x30, %al
incq %rbp
cmpb $0xa, %al
jb 0x3a1d
movslq %ebp, %rax
cmpb $0x78, -0x1(%rdx,%rax)
jne 0x3a83
leal -0x61(%r13), %eax
cmpb $0x19, %al
ja 0x3af1
leal 0x1(%r15), %eax
cltq
addq %rdx, %r14
leal 0x2(%r15), %r13d
addq %rdx, %rax
movl $0x1, %ebx
movb (%r14,%rbx), %cl
leal -0x61(%rcx), %edx
cmpb $0x1a, %dl
jb 0x3a78
leal -0x30(%rcx), %edx
cmpb $0xa, %dl
setb %dl
cmpb $0x5f, %cl
sete %cl
orb %dl, %cl
je 0x3b66
incq %rbx
incl %r13d
incq %rax
jmp 0x3a55
movl %ebp, %ebx
subl %r15d, %ebx
cmpl $0x40, %ebx
movl $0x40, %eax
cmovll %ebx, %eax
movslq %eax, %rdx
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x2080
movslq %ebx, %rax
xorl %ecx, %ecx
movb %cl, 0x30(%rsp,%rax)
movb %cl, 0x6f(%rsp)
movl $0x72, %edi
movq %r14, %rsi
movl 0xc(%rsp), %edx
callq 0x3f58
movq 0x10(%rsp), %rdi
movq %rax, %r12
movq %rax, %rbx
movl %ebp, %r15d
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x2f36
movq %r12, 0x10(%rax)
movq 0x20(%rsp), %rbx
movl %ebp, %r15d
jmp 0x2f36
cmpl $0x22, %ebx
jne 0x3f35
movl $0x1000, %edi           # imm = 0x1000
callq 0x21f0
movq 0x10(%rsp), %rsi
movq %rax, %r13
xorl %eax, %eax
movq 0x20(%rsp), %r14
movslq %r15d, %rcx
movzbl 0x1(%rsi,%rcx), %edx
cmpl $0x5c, %edx
je 0x3b36
cmpl $0x22, %edx
je 0x3bee
incq %rcx
movb %dl, (%r13,%rax)
movl %ecx, %r15d
jmp 0x3b61
movzbl 0x2(%rsi,%rcx), %edx
addq $0x2, %rcx
movl %ecx, %r15d
cmpl $0x74, %edx
je 0x3b54
cmpl $0x6e, %edx
jne 0x3b5c
movb $0xa, (%r13,%rax)
jmp 0x3b61
movb $0x9, (%r13,%rax)
jmp 0x3b61
movb %dl, (%r13,%rax)
incq %rax
jmp 0x3b13
leaq 0x30(%rsp), %r14
movzbl (%rax), %ebp
cmpl $0x20, %ebp
je 0x3b78
cmpl $0x9, %ebp
jne 0x3b80
incl %r13d
incq %rax
jmp 0x3b6b
cmpl $0x40, %ebx
movl $0x40, %eax
cmovll %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x2080
movslq %ebx, %rax
xorl %ecx, %ecx
movb %cl, 0x30(%rsp,%rax)
movb %cl, 0x6f(%rsp)
cmpb $0x3a, %bpl
jne 0x3ccc
movl $0x73, %edi
movq %r14, %rsi
movl 0xc(%rsp), %edx
callq 0x3f58
movq %rax, %r12
movq %rax, %rbx
movl %r13d, %r15d
movq 0x18(%rsp), %rax
testq %rax, %rax
movq 0x10(%rsp), %rdi
je 0x2f36
movq %r12, 0x10(%rax)
movq 0x20(%rsp), %rbx
movl %r13d, %r15d
jmp 0x2f36
movl %eax, %eax
movb $0x0, (%r13,%rax)
movl $0x75, %edi
movq %r13, %rsi
movl 0xc(%rsp), %edx
callq 0x3f58
movq %rax, %r12
movq %rax, %rbx
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x3c1e
movq %r12, 0x10(%rax)
movq %r14, %rbx
addl $0x2, %r15d
movq %r13, %rdi
callq 0x2040
movq 0x10(%rsp), %rdi
jmp 0x2f36
movl $0x27, %edi
leaq 0x28ca(%rip), %rsi      # 0x650a
jmp 0x3d43
movl $0x3, %edi
leaq 0x2830(%rip), %rsi      # 0x6481
jmp 0x3dc9
movl $0x32, %edi
leaq 0x2878(%rip), %rsi      # 0x64da
jmp 0x3c92
movl $0x4, %edi
leaq 0x2814(%rip), %rsi      # 0x6484
jmp 0x3dc9
movl $0x30, %edi
leaq 0x2854(%rip), %rsi      # 0x64d5
jmp 0x3d43
movl $0x36, %edi
leaq 0x2853(%rip), %rsi      # 0x64e5
movl 0xc(%rsp), %edx
callq 0x3f58
movq %rax, %r12
movq %rax, %rbx
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x3cb2
movq %r12, 0x10(%rax)
movq %rbp, %rbx
addq $0x5, %r14
jmp 0x3ef1
movl $0x5, %edi
leaq 0x27c0(%rip), %rsi      # 0x6487
jmp 0x3dc9
movl %r15d, %r15d
addq %rbx, %r15
movl $0x74, %edi
movq %r14, %rsi
movl 0xc(%rsp), %edx
callq 0x3f58
movq %rax, %r12
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x3e14
movq %r12, 0x10(%rax)
movq 0x20(%rsp), %rbx
movq 0x10(%rsp), %rdi
jmp 0x2f36
movl $0x34, %edi
leaq 0x27cd(%rip), %rsi      # 0x64e0
jmp 0x3d43
movl $0x6, %edi
leaq 0x2769(%rip), %rsi      # 0x648a
jmp 0x3dc9
movl $0x21, %edi
leaq 0x278a(%rip), %rsi      # 0x64bc
jmp 0x3dc9
movl $0x42, %edi
leaq 0x27af(%rip), %rsi      # 0x64f2
movl 0xc(%rsp), %edx
callq 0x3f58
movq %rax, %r12
movq %rax, %rbx
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x3d63
movq %r12, 0x10(%rax)
movq %rbp, %rbx
addq $0x4, %r14
jmp 0x3ef1
movl $0xa, %edi
leaq 0x2715(%rip), %rsi      # 0x648d
jmp 0x3dc9
movl $0x61, %edi
leaq 0x2781(%rip), %rsi      # 0x6507
movl 0xc(%rsp), %edx
callq 0x3f58
movq %rax, %r12
movq %rax, %rbx
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x3da6
movq %r12, 0x10(%rax)
movq %rbp, %rbx
addq $0x7, %r14
jmp 0x3ef1
movl $0x23, %edi
leaq 0x2708(%rip), %rsi      # 0x64c3
jmp 0x3dc9
movl $0x25, %edi
leaq 0x2701(%rip), %rsi      # 0x64ca
movl 0xc(%rsp), %edx
callq 0x3f58
movq %rax, %r12
movq %rax, %rbx
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x3de9
movq %r12, 0x10(%rax)
movq %rbp, %rbx
addq $0x2, %r14
jmp 0x3ef1
movl $0x20, %edi
leaq 0x26ba(%rip), %rsi      # 0x64b8
jmp 0x3ecd
movl $0x29, %edi
leaq 0x26c2(%rip), %rsi      # 0x64d1
jmp 0x3ecd
movq %r12, %rbx
movq 0x10(%rsp), %rdi
jmp 0x2f36
movl $0x22, %edi
leaq 0x2692(%rip), %rsi      # 0x64bf
jmp 0x3ecd
movl $0x24, %edi
leaq 0x2688(%rip), %rsi      # 0x64c6
jmp 0x3ecd
movl $0x9, %edi
leaq 0x2641(%rip), %rsi      # 0x6490
jmp 0x3ecd
movl $0x8, %edi
leaq 0x2637(%rip), %rsi      # 0x6494
jmp 0x3ecd
movl $0x26, %edi
leaq 0x2662(%rip), %rsi      # 0x64cd
jmp 0x3ecd
movl $0x90, %edi
leaq 0x2696(%rip), %rsi      # 0x650f
jmp 0x3ecd
movl $0x60, %edi
leaq 0x267c(%rip), %rsi      # 0x6503
jmp 0x3ecd
movl $0x41, %edi
leaq 0x2659(%rip), %rsi      # 0x64ee
jmp 0x3ecd
movl $0x10, %edi
leaq 0x25f9(%rip), %rsi      # 0x649c
jmp 0x3ecd
movl $0x51, %edi
leaq 0x264a(%rip), %rsi      # 0x64fb
jmp 0x3ecd
movl $0x14, %edi
leaq 0x25e5(%rip), %rsi      # 0x64a4
jmp 0x3ecd
movl $0x12, %edi
leaq 0x25d3(%rip), %rsi      # 0x64a0
movl 0xc(%rsp), %edx
callq 0x3f58
movq %rax, %r12
movq %rax, %rbx
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x3eed
movq %r12, 0x10(%rax)
movq %rbp, %rbx
addq $0x3, %r14
movl %r14d, %r15d
movq 0x10(%rsp), %rdi
jmp 0x2f36
testq %rax, %rax
je 0x3f21
cmpl $0x70, (%rax)
je 0x3f23
movl $0x70, %edi
xorl %esi, %esi
movl 0xc(%rsp), %edx
movq %rax, %rbx
callq 0x3f58
movq %rax, 0x10(%rbx)
jmp 0x3f23
xorl %ebp, %ebp
movq %rbp, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x50b4(%rip), %rax      # 0x8ff0
movq (%rax), %rdi
leaq 0x2632(%rip), %rsi      # 0x6578
xorl %ebp, %ebp
movl 0xc(%rsp), %edx
movl %r13d, %ecx
xorl %eax, %eax
callq 0x21c0
jmp 0x3f23