// File: /workspace/github_cpp_makefile_star2_O3/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
movb 0x10(%rdi), %r14b
testb %r14b, %r14b
je 0x24a1
movq %rdi, %rbx
movsbl %r14b, %ebp
movl %ebp, %edi
callq 0x2050
testl %eax, %eax
je 0x24fd
movq %rbx, %rdi
callq 0x27a2
movb 0x10(%rbx), %r14b
testb %r14b, %r14b
jne 0x2481
movl $0x0, 0x8(%rsp)
xorl %ebx, %ebx
xorl %ebp, %ebp
leaq 0x8(%rsp), %rsi
movq %rbx, 0x8(%rsi)
movq 0x2b33(%rip), %r14      # 0x4ff0
movq %r14, %rdi
callq 0x23f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movl %ebp, %eax
movq %rbx, %rdx
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r14
popq %rbp
retq
addl $-0x30, %ebp
cmpl $0x9, %ebp
ja 0x251f
movq %rbx, %rdi
callq 0x27f4
movq %rax, %rbx
movl $0x1, 0x8(%rsp)
movl $0x1, %ebp
jmp 0x24ad
movzbl %r14b, %eax
addl $-0x28, %eax
cmpl $0x7, %eax
ja 0x26dd
leaq 0xad2(%rip), %rcx       # 0x3008
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%rbx), %rcx
movq 0x8(%rbx), %rax
incq %rax
movq %rax, 0x8(%rbx)
movq 0x8(%rcx), %rdx
decq %rdx
cmpq %rdx, %rax
jbe 0x265d
xorl %eax, %eax
jmp 0x2663
movq (%rbx), %rcx
movq 0x8(%rbx), %rax
incq %rax
movq %rax, 0x8(%rbx)
movq 0x8(%rcx), %rdx
decq %rdx
cmpq %rdx, %rax
jbe 0x261d
xorl %eax, %eax
jmp 0x2623
movq (%rbx), %rcx
movq 0x8(%rbx), %rax
incq %rax
movq %rax, 0x8(%rbx)
movq 0x8(%rcx), %rdx
decq %rdx
cmpq %rdx, %rax
jbe 0x263d
xorl %eax, %eax
jmp 0x2643
movq (%rbx), %rcx
movq 0x8(%rbx), %rax
incq %rax
movq %rax, 0x8(%rbx)
movq 0x8(%rcx), %rdx
decq %rdx
cmpq %rdx, %rax
jbe 0x267d
xorl %eax, %eax
jmp 0x2683
movq (%rbx), %rcx
movq 0x8(%rbx), %rax
incq %rax
movq %rax, 0x8(%rbx)
movq 0x8(%rcx), %rdx
decq %rdx
cmpq %rdx, %rax
jbe 0x269d
xorl %eax, %eax
jmp 0x26a3
movq (%rbx), %rcx
movq 0x8(%rbx), %rax
incq %rax
movq %rax, 0x8(%rbx)
movq 0x8(%rcx), %rdx
decq %rdx
cmpq %rdx, %rax
jbe 0x26bd
xorl %eax, %eax
jmp 0x26c3
movq (%rcx), %rcx
movb (%rcx,%rax), %al
movb %al, 0x10(%rbx)
movl $0x3, 0x8(%rsp)
movl $0x3, %ebp
movl $0x2d, %ebx
jmp 0x24ad
movq (%rcx), %rcx
movb (%rcx,%rax), %al
movb %al, 0x10(%rbx)
movl $0x7, 0x8(%rsp)
movl $0x7, %ebp
movl $0x29, %ebx
jmp 0x24ad
movq (%rcx), %rcx
movb (%rcx,%rax), %al
movb %al, 0x10(%rbx)
movl $0x6, 0x8(%rsp)
movl $0x6, %ebp
movl $0x28, %ebx
jmp 0x24ad
movq (%rcx), %rcx
movb (%rcx,%rax), %al
movb %al, 0x10(%rbx)
movl $0x5, 0x8(%rsp)
movl $0x5, %ebp
movl $0x2f, %ebx
jmp 0x24ad
movq (%rcx), %rcx
movb (%rcx,%rax), %al
movb %al, 0x10(%rbx)
movl $0x4, 0x8(%rsp)
movl $0x4, %ebp
movl $0x2a, %ebx
jmp 0x24ad
movq (%rcx), %rcx
movb (%rcx,%rax), %al
movb %al, 0x10(%rbx)
movl $0x2, 0x8(%rsp)
movl $0x2, %ebp
movl $0x2b, %ebx
jmp 0x24ad
leaq 0x38(%rsp), %r14
movq %r14, %rdi
callq 0x2170
leaq 0x9d5(%rip), %rsi       # 0x30c6
movl $0x1a, %edx
movq %r14, %rdi
callq 0x2160
movb 0x10(%rbx), %al
leaq 0x18(%rsp), %rsi
movb %al, (%rsi)
leaq 0x38(%rsp), %rdi
movl $0x1, %edx
callq 0x2160
movl $0x8, %edi
callq 0x2090
movq %rax, %r14
leaq 0x40(%rsp), %rsi
leaq 0x18(%rsp), %rdi
callq 0x21c0
movq 0x18(%rsp), %rax
movq %rax, (%r14)
movq 0x286e(%rip), %rsi      # 0x4fb0
movq %r14, %rdi
xorl %edx, %edx
callq 0x21e0
movq %rax, %rbx
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x277c
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2150
jmp 0x277c
movq %rax, %rbx
movq %r14, %rdi
callq 0x20e0
jmp 0x277c
movq %rax, %rbx
movq 0x283d(%rip), %rsi      # 0x4fc0
leaq 0x38(%rsp), %rdi
callq 0x20a0
leaq 0xa8(%rsp), %rdi
callq 0x2060
movq %rbx, %rdi
callq 0x21f0