// File: /workspace/github_cpp_makefile_star2_O2/jaldhar[P]Lets-Build-a-Simple-Interpreter/calc6.cc
// Function: Lexer::get_next_token()
Token Lexer::get_next_token() {

    while (_current_char != '\0') {

        if (isspace(_current_char)) {
            skip_whitespace();
            continue;
        }

        if (isdigit(_current_char)) {
            Token token(TOKENTYPE::INTEGER, integer());
            cerr << token << endl;
            return token;
        }

        if (_current_char == '*') {
            advance();
            Token token(TOKENTYPE::MUL, '*');
            cerr << token << endl;
            return token;
        }

        if (_current_char == '/') {
            advance();
            Token token(TOKENTYPE::DIV, '/');
            cerr << token << endl;
            return token;
        }

        if (_current_char == '+') {
            advance();
            Token token(TOKENTYPE::PLUS, '+');
            cerr << token << endl;
            return token;
        }

        if (_current_char == '-') {
            advance();
            Token token(TOKENTYPE::MINUS, '-');
            cerr << token << endl;
            return token;
        }

        if (_current_char == '(') {
            advance();
            Token token(TOKENTYPE::LPAREN, '(');
            cerr << token << endl;
            return token;
        }

        if (_current_char == ')') {
            advance();
            Token token(TOKENTYPE::RPAREN, ')');
            cerr << token << endl;
            return token;
        }

        ostringstream out;
        out << "Error parsing input. Got: " << _current_char;
        throw(out.str().c_str());
    }

    Token token(TOKENTYPE::ENDOFFILE, '\0');
    cerr << token << endl;
    return token;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, %rbx
movsbl 0x10(%rbx), %r14d
testl %r14d, %r14d
je 0x241a
movl %r14d, %edi
callq 0x2040
testl %eax, %eax
je 0x2428
movq %rbx, %rdi
callq 0x25b2
jmp 0x23fa
andl $0x0, 0x8(%rsp)
xorl %ebx, %ebx
xorl %ebp, %ebp
jmp 0x24f5
leal -0x30(%r14), %eax
cmpl $0x9, %eax
ja 0x244c
movq %rbx, %rdi
callq 0x25d4
movq %rax, %rbx
movl $0x1, 0x8(%rsp)
pushq $0x1
popq %rbp
jmp 0x24f5
movzbl %r14b, %eax
addl $-0x28, %eax
cmpl $0x7, %eax
ja 0x2526
leaq 0xba1(%rip), %rcx       # 0x3004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x2656
movl $0x6, 0x8(%rsp)
pushq $0x6
popq %rbp
pushq $0x28
jmp 0x24f4
movq %rbx, %rdi
callq 0x2656
movl $0x3, 0x8(%rsp)
pushq $0x3
popq %rbp
pushq $0x2d
jmp 0x24f4
movq %rbx, %rdi
callq 0x2656
movl $0x7, 0x8(%rsp)
pushq $0x7
popq %rbp
pushq $0x29
jmp 0x24f4
movq %rbx, %rdi
callq 0x2656
movl $0x5, 0x8(%rsp)
pushq $0x5
popq %rbp
pushq $0x2f
jmp 0x24f4
movq %rbx, %rdi
callq 0x2656
movl $0x4, 0x8(%rsp)
pushq $0x4
popq %rbp
pushq $0x2a
jmp 0x24f4
movq %rbx, %rdi
callq 0x2656
movl $0x2, 0x8(%rsp)
pushq $0x2
popq %rbp
pushq $0x2b
popq %rbx
leaq 0x8(%rsp), %rsi
movq %rbx, 0x8(%rsi)
movq 0x2aeb(%rip), %r14      # 0x4ff0
movq %r14, %rdi
callq 0x2382
movq %r14, %rdi
callq 0x20a0
movl %ebp, %eax
movq %rbx, %rdx
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x38(%rsp), %r14
movq %r14, %rdi
callq 0x2160
leaq 0xb48(%rip), %rsi       # 0x3082
movq %r14, %rdi
callq 0x2140
movsbl 0x10(%rbx), %esi
movq %rax, %rdi
callq 0x2150
pushq $0x8
popq %rdi
callq 0x20b0
movq %rax, %r14
leaq 0x40(%rsp), %rsi
leaq 0x18(%rsp), %rdi
callq 0x2190
movq 0x18(%rsp), %rax
movq %rax, (%r14)
movq 0x2a39(%rip), %rsi      # 0x4fb0
movq %r14, %rdi
xorl %edx, %edx
callq 0x21b0
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x2090
jmp 0x25a0
movq %rax, %rbx
movq %r14, %rdi
callq 0x20e0
jmp 0x25a0
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x2060
movq %rbx, %rdi
callq 0x21c0