// File: KJTang[P]SimpleCompiler/Lexer.cpp
// Function: Lexer::lexToken()
Token Lexer::lexToken() {
    char curChar = lexingStr[lexingPos++];
    // shift space and '\n'
    while (curChar == ' ' || curChar == '\n') {
        curChar = lexingStr[lexingPos++];
    }
    // identifier
    // def: start with [a-zA-Z_], follow by [a-zA-Z_0-9]
    if (isalpha(curChar) || curChar == '_') {
        std::string identifierName;
        identifierName += curChar;
        curChar = lexingStr[lexingPos++];
        while (isalnum(curChar) || curChar == '_') {
            identifierName += curChar;
            curChar = lexingStr[lexingPos++];
        }
        --lexingPos;
        if (identifierName == "if") {
            tokens.push_back(std::make_pair(Token::KEYWORD_IF, identifierName));
            return Token::KEYWORD_IF;
        } else if (identifierName == "else") {
            tokens.push_back(std::make_pair(Token::KEYWORD_ELSE, identifierName));
            return Token::KEYWORD_ELSE;
        } else if (identifierName == "while") {
            tokens.push_back(std::make_pair(Token::KEYWORD_WHILE, identifierName));
            return Token::KEYWORD_WHILE;
        } else if (identifierName == "int") {
            tokens.push_back(std::make_pair(Token::TYPE_INT, identifierName));
            return Token::TYPE_INT;
        } else if (identifierName == "return") {
            tokens.push_back(std::make_pair(Token::KEYWORD_RET, identifierName));
            return Token::KEYWORD_RET;
        }
        tokens.push_back(std::make_pair(Token::IDENTIFIER, identifierName));
        return Token::IDENTIFIER;
    }
    // number
    // def: start with [0-9.], follow by [0-9.]
    // number only has 'double' type
    if (isdigit(curChar) || curChar == '.') {
        std::string numberStr;
        numberStr += curChar;
        curChar = lexingStr[lexingPos++];
        while (isdigit(curChar) || curChar == '.') {
            numberStr += curChar;
            curChar = lexingStr[lexingPos++];
        }
        --lexingPos;
        tokens.push_back(std::make_pair(Token::NUMBER, numberStr));
        return Token::NUMBER;
    }
    switch (curChar) {
        // end of file
        case '\0': {
            tokens.push_back(std::make_pair(Token::END_OF_FILE, "\0"));
            return Token::END_OF_FILE;
        }
        case '>': {
            if (lexingStr[lexingPos] == '=') {
                tokens.push_back(std::make_pair(Token::OP_GTE, ">="));
                ++lexingPos;
                return Token::OP_GTE;
            }
            goto ASCII;
        }
        case '<': {
            if (lexingStr[lexingPos] == '=') {
                tokens.push_back(std::make_pair(Token::OP_LTE, "<="));
                ++lexingPos;
                return Token::OP_LTE;
            }
            goto ASCII;
        }
        case '=': {
            if (lexingStr[lexingPos] == '=') {
                tokens.push_back(std::make_pair(Token::OP_EQU, "=="));
                ++lexingPos;
                return Token::OP_EQU;
            }
            goto ASCII;
        }
        case '!': {
            if (lexingStr[lexingPos] == '=') {
                tokens.push_back(std::make_pair(Token::OP_NE, "!="));
                ++lexingPos;
                return Token::OP_NE;
            }
            goto ASCII;
        }
        // comment
        // def: start with "//", will comment one line
        case '/': {
            if (lexingStr[lexingPos] == '/') {
                do {
                    curChar = lexingStr[lexingPos++];
                } while (curChar != '\0' && curChar != '\n');
                if (curChar != '\0') {
                    return this->lexToken();
                } else {
                    tokens.push_back(std::make_pair(Token::END_OF_FILE, "\0"));
                    return Token::END_OF_FILE;
                }
            }
            // if not '//', jump to ascii
            goto ASCII;
        }
        // ascii
        default: {
            ASCII:
            tokens.push_back(std::make_pair((Token)curChar, std::string(1, curChar)));
            return (Token)curChar;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4d0, %rsp            # imm = 0x4D0
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x398(%rbp)
movl 0x20(%rdi), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x20(%rdi)
movslq %eax, %rsi
callq 0x34e0
movb (%rax), %al
movb %al, -0x11(%rbp)
movsbl -0x11(%rbp), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x399(%rbp)
je 0x9b43
movsbl -0x11(%rbp), %eax
cmpl $0xa, %eax
sete %al
movb %al, -0x399(%rbp)
movb -0x399(%rbp), %al
testb $0x1, %al
jne 0x9b4f
jmp 0x9b70
movq -0x398(%rbp), %rdi
movl 0x20(%rdi), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x20(%rdi)
movslq %eax, %rsi
callq 0x34e0
movb (%rax), %al
movb %al, -0x11(%rbp)
jmp 0x9b22
movsbl -0x11(%rbp), %edi
callq 0x3400
cmpl $0x0, %eax
jne 0x9b8b
movsbl -0x11(%rbp), %eax
cmpl $0x5f, %eax
jne 0xa05a
leaq -0x38(%rbp), %rdi
movq %rdi, -0x3a8(%rbp)
callq 0x33a0
movq -0x3a8(%rbp), %rdi
movsbl -0x11(%rbp), %esi
callq 0x31c0
jmp 0x9bad
movq -0x398(%rbp), %rdi
movslq 0x20(%rdi), %rsi
movl %esi, %eax
incl %eax
movl %eax, 0x20(%rdi)
callq 0x34e0
movq %rax, -0x3b0(%rbp)
jmp 0x9bcd
movq -0x3b0(%rbp), %rax
movb (%rax), %al
movb %al, -0x11(%rbp)
movsbl -0x11(%rbp), %edi
callq 0x32b0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x3b1(%rbp)
jne 0x9c01
movsbl -0x11(%rbp), %eax
cmpl $0x5f, %eax
sete %al
movb %al, -0x3b1(%rbp)
movb -0x3b1(%rbp), %al
testb $0x1, %al
jne 0x9c0d
jmp 0x9c5b
movsbl -0x11(%rbp), %esi
leaq -0x38(%rbp), %rdi
callq 0x31c0
jmp 0x9c1c
movq -0x398(%rbp), %rdi
movslq 0x20(%rdi), %rsi
movl %esi, %eax
incl %eax
movl %eax, 0x20(%rdi)
callq 0x34e0
movq %rax, -0x3c0(%rbp)
jmp 0x9c3c
movq -0x3c0(%rbp), %rax
movb (%rax), %al
movb %al, -0x11(%rbp)
jmp 0x9bd9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xa04c
movq -0x398(%rbp), %rax
movl 0x20(%rax), %ecx
decl %ecx
movl %ecx, 0x20(%rax)
leaq 0x1146f(%rip), %rsi     # 0x1b0e0
leaq -0x38(%rbp), %rdi
callq 0xa8e0
movb %al, -0x3c1(%rbp)
jmp 0x9c82
movb -0x3c1(%rbp), %al
testb $0x1, %al
jne 0x9c8e
jmp 0x9d02
movq -0x398(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x3d0(%rbp)
movl $0x6, -0x74(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x74(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0xa940
jmp 0x9cba
movq -0x3d0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xa910
jmp 0x9ccc
leaq -0x70(%rbp), %rdi
callq 0x55a0
movl $0x6, -0x4(%rbp)
movl $0x1, -0x78(%rbp)
jmp 0xa03e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x55a0
jmp 0xa04c
leaq 0x113da(%rip), %rsi     # 0x1b0e3
leaq -0x38(%rbp), %rdi
callq 0xa8e0
movb %al, -0x3d1(%rbp)
jmp 0x9d1a
movb -0x3d1(%rbp), %al
testb $0x1, %al
jne 0x9d29
jmp 0x9daf
movq -0x398(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x3e0(%rbp)
movl $0x7, -0xa4(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xa4(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0xa940
jmp 0x9d5e
movq -0x3e0(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0xa910
jmp 0x9d73
leaq -0xa0(%rbp), %rdi
callq 0x55a0
movl $0x7, -0x4(%rbp)
movl $0x1, -0x78(%rbp)
jmp 0xa03e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x55a0
jmp 0xa04c
leaq 0x11332(%rip), %rsi     # 0x1b0e8
leaq -0x38(%rbp), %rdi
callq 0xa8e0
movb %al, -0x3e1(%rbp)
jmp 0x9dc7
movb -0x3e1(%rbp), %al
testb $0x1, %al
jne 0x9dd6
jmp 0x9e5c
movq -0x398(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x3f0(%rbp)
movl $0x8, -0xd4(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0xd4(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0xa940
jmp 0x9e0b
movq -0x3f0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0xa910
jmp 0x9e20
leaq -0xd0(%rbp), %rdi
callq 0x55a0
movl $0x8, -0x4(%rbp)
movl $0x1, -0x78(%rbp)
jmp 0xa03e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x55a0
jmp 0xa04c
leaq 0x1128b(%rip), %rsi     # 0x1b0ee
leaq -0x38(%rbp), %rdi
callq 0xa8e0
movb %al, -0x3f1(%rbp)
jmp 0x9e74
movb -0x3f1(%rbp), %al
testb $0x1, %al
jne 0x9e83
jmp 0x9f09
movq -0x398(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x400(%rbp)
movl $0xa, -0x104(%rbp)
leaq -0x100(%rbp), %rdi
leaq -0x104(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0xa940
jmp 0x9eb8
movq -0x400(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0xa910
jmp 0x9ecd
leaq -0x100(%rbp), %rdi
callq 0x55a0
movl $0xa, -0x4(%rbp)
movl $0x1, -0x78(%rbp)
jmp 0xa03e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x55a0
jmp 0xa04c
leaq 0x111e2(%rip), %rsi     # 0x1b0f2
leaq -0x38(%rbp), %rdi
callq 0xa8e0
movb %al, -0x401(%rbp)
jmp 0x9f21
movb -0x401(%rbp), %al
testb $0x1, %al
jne 0x9f30
jmp 0x9fb6
movq -0x398(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x410(%rbp)
movl $0x9, -0x134(%rbp)
leaq -0x130(%rbp), %rdi
leaq -0x134(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0xa940
jmp 0x9f65
movq -0x410(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xa910
jmp 0x9f7a
leaq -0x130(%rbp), %rdi
callq 0x55a0
movl $0x9, -0x4(%rbp)
movl $0x1, -0x78(%rbp)
jmp 0xa03e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x55a0
jmp 0xa04c
jmp 0x9fb8
jmp 0x9fba
jmp 0x9fbc
jmp 0x9fbe
movq -0x398(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x418(%rbp)
movl $0x0, -0x164(%rbp)
leaq -0x160(%rbp), %rdi
leaq -0x164(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0xa940
jmp 0x9ff3
movq -0x418(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0xa910
jmp 0xa008
leaq -0x160(%rbp), %rdi
callq 0x55a0
movl $0x0, -0x4(%rbp)
movl $0x1, -0x78(%rbp)
jmp 0xa03e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x55a0
jmp 0xa04c
leaq -0x38(%rbp), %rdi
callq 0x34f8
jmp 0xa86e
leaq -0x38(%rbp), %rdi
callq 0x34f8
jmp 0xa87a
movsbl -0x11(%rbp), %edi
callq 0x3260
cmpl $0x0, %eax
jne 0xa075
movsbl -0x11(%rbp), %eax
cmpl $0x2e, %eax
jne 0xa1f4
leaq -0x188(%rbp), %rdi
movq %rdi, -0x420(%rbp)
callq 0x33a0
movq -0x420(%rbp), %rdi
movsbl -0x11(%rbp), %esi
callq 0x31c0
jmp 0xa09a
movq -0x398(%rbp), %rdi
movslq 0x20(%rdi), %rsi
movl %esi, %eax
incl %eax
movl %eax, 0x20(%rdi)
callq 0x34e0
movq %rax, -0x428(%rbp)
jmp 0xa0ba
movq -0x428(%rbp), %rax
movb (%rax), %al
movb %al, -0x11(%rbp)
movsbl -0x11(%rbp), %edi
callq 0x3260
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x429(%rbp)
jne 0xa0ee
movsbl -0x11(%rbp), %eax
cmpl $0x2e, %eax
sete %al
movb %al, -0x429(%rbp)
movb -0x429(%rbp), %al
testb $0x1, %al
jne 0xa0fa
jmp 0xa14b
movsbl -0x11(%rbp), %esi
leaq -0x188(%rbp), %rdi
callq 0x31c0
jmp 0xa10c
movq -0x398(%rbp), %rdi
movslq 0x20(%rdi), %rsi
movl %esi, %eax
incl %eax
movl %eax, 0x20(%rdi)
callq 0x34e0
movq %rax, -0x438(%rbp)
jmp 0xa12c
movq -0x438(%rbp), %rax
movb (%rax), %al
movb %al, -0x11(%rbp)
jmp 0xa0c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xa1e3
movq -0x398(%rbp), %rax
movl 0x20(%rax), %ecx
decl %ecx
movl %ecx, 0x20(%rax)
addq $0x28, %rax
movq %rax, -0x440(%rbp)
movl $0x1, -0x1b4(%rbp)
leaq -0x1b0(%rbp), %rdi
leaq -0x1b4(%rbp), %rsi
leaq -0x188(%rbp), %rdx
callq 0xa940
jmp 0xa18b
movq -0x440(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0xa910
jmp 0xa1a0
leaq -0x1b0(%rbp), %rdi
callq 0x55a0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x78(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x34f8
jmp 0xa86e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x55a0
leaq -0x188(%rbp), %rdi
callq 0x34f8
jmp 0xa87a
movsbl -0x11(%rbp), %eax
movl %eax, -0x444(%rbp)
testl %eax, %eax
je 0xa25c
jmp 0xa204
movl -0x444(%rbp), %eax
subl $0x21, %eax
je 0xa56f
jmp 0xa215
movl -0x444(%rbp), %eax
subl $0x2f, %eax
je 0xa640
jmp 0xa226
movl -0x444(%rbp), %eax
subl $0x3c, %eax
je 0xa3cd
jmp 0xa237
movl -0x444(%rbp), %eax
subl $0x3d, %eax
je 0xa49e
jmp 0xa248
movl -0x444(%rbp), %eax
subl $0x3e, %eax
je 0xa2fc
jmp 0xa767
movq -0x398(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x458(%rbp)
movl $0xffffffff, -0x1f4(%rbp) # imm = 0xFFFFFFFF
leaq 0x10ea0(%rip), %rsi     # 0x1b11f
leaq -0x1f4(%rbp), %rdi
callq 0xa980
movl %eax, -0x1f0(%rbp)
movq %rdx, -0x1e8(%rbp)
leaq -0x1e0(%rbp), %rdi
movq %rdi, -0x450(%rbp)
leaq -0x1f0(%rbp), %rsi
callq 0xa9c0
movq -0x458(%rbp), %rdi
movq -0x450(%rbp), %rsi
callq 0xa910
jmp 0xa2c7
leaq -0x1e0(%rbp), %rdi
callq 0x55a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa86e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x55a0
jmp 0xa87a
movq -0x398(%rbp), %rdi
movslq 0x20(%rdi), %rsi
callq 0x34e0
movsbl (%rax), %eax
cmpl $0x3d, %eax
jne 0xa3c8
movq -0x398(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x468(%rbp)
movl $0x2, -0x234(%rbp)
leaq 0x10dbe(%rip), %rsi     # 0x1b0f9
leaq -0x234(%rbp), %rdi
callq 0xaa40
movl %eax, -0x230(%rbp)
movq %rdx, -0x228(%rbp)
leaq -0x220(%rbp), %rdi
movq %rdi, -0x460(%rbp)
leaq -0x230(%rbp), %rsi
callq 0xa9c0
movq -0x468(%rbp), %rdi
movq -0x460(%rbp), %rsi
callq 0xa910
jmp 0xa383
leaq -0x220(%rbp), %rdi
callq 0x55a0
movq -0x398(%rbp), %rax
movl 0x20(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x20(%rax)
movl $0x2, -0x4(%rbp)
jmp 0xa86e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x55a0
jmp 0xa87a
jmp 0xa769
movq -0x398(%rbp), %rdi
movslq 0x20(%rdi), %rsi
callq 0x34e0
movsbl (%rax), %eax
cmpl $0x3d, %eax
jne 0xa499
movq -0x398(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x478(%rbp)
movl $0x3, -0x274(%rbp)
leaq 0x10cf0(%rip), %rsi     # 0x1b0fc
leaq -0x274(%rbp), %rdi
callq 0xaa40
movl %eax, -0x270(%rbp)
movq %rdx, -0x268(%rbp)
leaq -0x260(%rbp), %rdi
movq %rdi, -0x470(%rbp)
leaq -0x270(%rbp), %rsi
callq 0xa9c0
movq -0x478(%rbp), %rdi
movq -0x470(%rbp), %rsi
callq 0xa910
jmp 0xa454
leaq -0x260(%rbp), %rdi
callq 0x55a0
movq -0x398(%rbp), %rax
movl 0x20(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x20(%rax)
movl $0x3, -0x4(%rbp)
jmp 0xa86e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x55a0
jmp 0xa87a
jmp 0xa769
movq -0x398(%rbp), %rdi
movslq 0x20(%rdi), %rsi
callq 0x34e0
movsbl (%rax), %eax
cmpl $0x3d, %eax
jne 0xa56a
movq -0x398(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x488(%rbp)
movl $0x4, -0x2b4(%rbp)
leaq 0x10c22(%rip), %rsi     # 0x1b0ff
leaq -0x2b4(%rbp), %rdi
callq 0xaa40
movl %eax, -0x2b0(%rbp)
movq %rdx, -0x2a8(%rbp)
leaq -0x2a0(%rbp), %rdi
movq %rdi, -0x480(%rbp)
leaq -0x2b0(%rbp), %rsi
callq 0xa9c0
movq -0x488(%rbp), %rdi
movq -0x480(%rbp), %rsi
callq 0xa910
jmp 0xa525
leaq -0x2a0(%rbp), %rdi
callq 0x55a0
movq -0x398(%rbp), %rax
movl 0x20(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x20(%rax)
movl $0x4, -0x4(%rbp)
jmp 0xa86e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x55a0
jmp 0xa87a
jmp 0xa769
movq -0x398(%rbp), %rdi
movslq 0x20(%rdi), %rsi
callq 0x34e0
movsbl (%rax), %eax
cmpl $0x3d, %eax
jne 0xa63b
movq -0x398(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x498(%rbp)
movl $0x5, -0x2f4(%rbp)
leaq 0x10b54(%rip), %rsi     # 0x1b102
leaq -0x2f4(%rbp), %rdi
callq 0xaa40
movl %eax, -0x2f0(%rbp)
movq %rdx, -0x2e8(%rbp)
leaq -0x2e0(%rbp), %rdi
movq %rdi, -0x490(%rbp)
leaq -0x2f0(%rbp), %rsi
callq 0xa9c0
movq -0x498(%rbp), %rdi
movq -0x490(%rbp), %rsi
callq 0xa910
jmp 0xa5f6
leaq -0x2e0(%rbp), %rdi
callq 0x55a0
movq -0x398(%rbp), %rax
movl 0x20(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x20(%rax)
movl $0x5, -0x4(%rbp)
jmp 0xa86e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x2e0(%rbp), %rdi
callq 0x55a0
jmp 0xa87a
jmp 0xa769
movq -0x398(%rbp), %rdi
movslq 0x20(%rdi), %rsi
callq 0x34e0
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0xa765
jmp 0xa65e
movq -0x398(%rbp), %rdi
movl 0x20(%rdi), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x20(%rdi)
movslq %eax, %rsi
callq 0x34e0
movb (%rax), %al
movb %al, -0x11(%rbp)
movsbl -0x11(%rbp), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x499(%rbp)
je 0xa69e
movsbl -0x11(%rbp), %eax
cmpl $0xa, %eax
setne %al
movb %al, -0x499(%rbp)
movb -0x499(%rbp), %al
testb $0x1, %al
jne 0xa65e
movsbl -0x11(%rbp), %eax
cmpl $0x0, %eax
je 0xa6c5
movq -0x398(%rbp), %rdi
callq 0x9af0
movl %eax, -0x4(%rbp)
jmp 0xa86e
movq -0x398(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x4b0(%rbp)
movl $0xffffffff, -0x334(%rbp) # imm = 0xFFFFFFFF
leaq 0x10a37(%rip), %rsi     # 0x1b11f
leaq -0x334(%rbp), %rdi
callq 0xa980
movl %eax, -0x330(%rbp)
movq %rdx, -0x328(%rbp)
leaq -0x320(%rbp), %rdi
movq %rdi, -0x4a8(%rbp)
leaq -0x330(%rbp), %rsi
callq 0xa9c0
movq -0x4b0(%rbp), %rdi
movq -0x4a8(%rbp), %rsi
callq 0xa910
jmp 0xa730
leaq -0x320(%rbp), %rdi
callq 0x55a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa86e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x320(%rbp), %rdi
callq 0x55a0
jmp 0xa87a
jmp 0xa769
jmp 0xa769
movq -0x398(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x4c8(%rbp)
movsbl -0x11(%rbp), %eax
movl %eax, -0x364(%rbp)
movsbl -0x11(%rbp), %eax
movl %eax, -0x4bc(%rbp)
leaq -0x389(%rbp), %rdi
movq %rdi, -0x4b8(%rbp)
callq 0x3480
movl -0x4bc(%rbp), %edx
movq -0x4b8(%rbp), %rcx
leaq -0x388(%rbp), %rdi
movl $0x1, %esi
callq 0x31d0
jmp 0xa7c2
leaq -0x360(%rbp), %rdi
leaq -0x364(%rbp), %rsi
leaq -0x388(%rbp), %rdx
callq 0xaa80
jmp 0xa7de
movq -0x4c8(%rbp), %rdi
leaq -0x360(%rbp), %rsi
callq 0xa910
jmp 0xa7f3
leaq -0x360(%rbp), %rdi
callq 0x55a0
leaq -0x388(%rbp), %rdi
callq 0x34f8
leaq -0x389(%rbp), %rdi
callq 0x3300
movsbl -0x11(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xa86e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xa860
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xa854
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x360(%rbp), %rdi
callq 0x55a0
leaq -0x388(%rbp), %rdi
callq 0x34f8
leaq -0x389(%rbp), %rdi
callq 0x3300
jmp 0xa87a
movl -0x4(%rbp), %eax
addq $0x4d0, %rsp            # imm = 0x4D0
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x3470
nopw %cs:(%rax,%rax)