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

    while (_current_char != '\0') {

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

        if (isdigit(_current_char)) {
            Token token(TOKENTYPE::INTEGER, integer());
            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;
        }

        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 %r14
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, %rbx
movsbl 0x10(%rdi), %edi
testl %edi, %edi
je 0x2526
callq 0x2050
testl %eax, %eax
je 0x2506
movq %rbx, %rdi
callq 0x27f4
movsbl 0x10(%rbx), %eax
leal -0x30(%rax), %ecx
cmpl $0x9, %ecx
ja 0x2531
movq %rbx, %rdi
callq 0x2844
movl $0x1, (%rsp)
jmp 0x25aa
movl $0x0, (%rsp)
xorl %eax, %eax
jmp 0x25aa
movzbl %al, %eax
cmpl $0x2d, %eax
je 0x2560
cmpl $0x2b, %eax
jne 0x25fb
movq (%rbx), %rcx
movq 0x8(%rbx), %rax
incq %rax
movq %rax, 0x8(%rbx)
movq 0x8(%rcx), %rdx
decq %rdx
cmpq %rdx, %rax
jbe 0x2595
xorl %eax, %eax
jmp 0x259b
movq (%rbx), %rcx
movq 0x8(%rbx), %rax
incq %rax
movq %rax, 0x8(%rbx)
movq 0x8(%rcx), %rdx
decq %rdx
cmpq %rdx, %rax
jbe 0x257e
xorl %eax, %eax
jmp 0x2584
movq (%rcx), %rcx
movb (%rcx,%rax), %al
movb %al, 0x10(%rbx)
movl $0x3, (%rsp)
movl $0x2d, %eax
jmp 0x25aa
movq (%rcx), %rcx
movb (%rcx,%rax), %al
movb %al, 0x10(%rbx)
movl $0x2, (%rsp)
movl $0x2b, %eax
movq %rsp, %rbx
movq %rax, 0x8(%rbx)
movq 0x2a38(%rip), %r14      # 0x4ff0
movq %r14, %rdi
movq %rbx, %rsi
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 (%rbx), %eax
movq 0x8(%rbx), %rdx
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r14
retq
leaq 0x30(%rsp), %r14
movq %r14, %rdi
callq 0x2170
leaq 0xa3b(%rip), %rsi       # 0x304a
movl $0x1a, %edx
movq %r14, %rdi
callq 0x2160
movb 0x10(%rbx), %al
leaq 0x10(%rsp), %rsi
movb %al, (%rsi)
leaq 0x30(%rsp), %rdi
movl $0x1, %edx
callq 0x2160
movl $0x8, %edi
callq 0x2090
movq %rax, %rbx
leaq 0x38(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x21c0
movq 0x10(%rsp), %rax
movq %rax, (%rbx)
movq 0x2950(%rip), %rsi      # 0x4fb0
movq %rbx, %rdi
xorl %edx, %edx
callq 0x21e0
movq %rax, %r14
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2688
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2150
xorl %eax, %eax
jmp 0x2691
movq %rax, %r14
movb $0x1, %al
testb %al, %al
je 0x26a2
movq %rbx, %rdi
callq 0x20e0
jmp 0x26a2
movq %rax, %r14
movq 0x2917(%rip), %rsi      # 0x4fc0
leaq 0x30(%rsp), %rdi
callq 0x20a0
leaq 0xa0(%rsp), %rdi
callq 0x2060
movq %r14, %rdi
callq 0x21f0