// File: /workspace/github_cpp_makefile_star2_O3/Mespyr[P]bop-lisp/src/parser.cpp
// Function: read_next(Reader&)
Node read_next(Reader& reader) 
{
    Token token = reader.next();


    // Detect EOF and raise error
    if (reader.eof == true) 
    {
        reader.error = ParsingError{"Unexpected EOF while parsing.", token};
        reader.error_found = true;
        return Node{ATOM};
    }

    if (token.value == "(") 
    {
        Node node{LIST};
        token = reader.peek();
        while (token.value != ")")
        {
            node.nodes.push_back(read_next(reader));
            if (reader.eof == true) 
            {
                reader.error = ParsingError{"Unexpected EOF while parsing.", token};
                reader.error_found = true;
                return node;
            }
            token = reader.peek();
        }
        reader.next();
        return node;
    } 
    else if (token.value == ")") 
    {
        reader.error = ParsingError{"Unexpected ')' token found while parsing.", token};
        reader.error_found = true;
        return Node{ATOM};
    } 

    Node node{ATOM};
    node.atom = create_atom(token);
    return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq -0xc0(%rbp), %rdi
callq 0x11518
cmpb $0x1, 0x1c(%r14)
jne 0x10b90
leaq -0x88(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x3438(%rip), %rsi      # 0x13ed1
leaq 0x344e(%rip), %rdx      # 0x13eee
leaq -0x98(%rbp), %rdi
callq 0x3774
movl -0xc0(%rbp), %eax
leaq -0x70(%rbp), %r15
movl %eax, -0x8(%r15)
leaq -0x60(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x3688
leaq -0x98(%rbp), %r12
movb $0x0, 0x48(%r12)
leaq 0x20(%r14), %rdi
movq %r12, %rsi
callq 0x22d0
movl 0x20(%r12), %eax
movl %eax, 0x40(%r14)
leaq 0x48(%r14), %rdi
movq %r15, %rsi
callq 0x22d0
movb 0x48(%r12), %al
movb %al, 0x68(%r14)
movq 0x28(%r12), %rdi
cmpq %r13, %rdi
je 0x10b28
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x10b4a
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x2240
movb $0x1, 0x70(%r14)
movl $0x1, (%rbx)
leaq 0x30(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
xorl %ecx, %ecx
movq %rcx, 0x18(%rbx)
movq %rax, 0x20(%rbx)
movq %rcx, 0x28(%rbx)
movb %cl, 0x30(%rbx)
movq %rcx, 0x40(%rbx)
movl $0x0, 0x48(%rbx)
leaq 0x60(%rbx), %rax
movq %rax, 0x50(%rbx)
movq %rcx, 0x58(%rbx)
movb %cl, 0x60(%rbx)
jmp 0x10f79
leaq -0xb8(%rbp), %r15
leaq 0x3331(%rip), %rsi      # 0x13ecf
movq %r15, %rdi
callq 0x20d0
testl %eax, %eax
je 0x10cce
leaq 0x31f7(%rip), %rsi      # 0x13dac
movq %r15, %rdi
callq 0x20d0
testl %eax, %eax
je 0x10e58
movl $0x1, (%rbx)
leaq 0x30(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
xorl %ecx, %ecx
movq %rcx, 0x18(%rbx)
movq %rax, 0x20(%rbx)
movq %rcx, 0x28(%rbx)
movb %cl, 0x30(%rbx)
movq %rcx, 0x40(%rbx)
movl $0x0, 0x48(%rbx)
leaq 0x60(%rbx), %rax
movq %rax, 0x50(%rbx)
movq %rcx, 0x58(%rbx)
movb %cl, 0x60(%rbx)
movl -0xc0(%rbp), %eax
leaq -0xe0(%rbp), %rdi
movl %eax, -0x8(%rdi)
leaq -0xd0(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
addq %rsi, %rdx
callq 0x3688
leaq -0x98(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x10978
leaq 0x20(%rbx), %rdi
leaq 0x50(%rbx), %r14
leaq -0x98(%rbp), %r15
movq %r15, %rsi
callq 0x22d0
movq 0x20(%r15), %rax
movq %rax, 0x40(%rbx)
movl 0x28(%r15), %eax
movl %eax, 0x48(%rbx)
leaq -0x68(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x22d0
movq (%r15), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x10c93
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0x88(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10cb2
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0xe0(%rbp), %rdi
cmpq %r12, %rdi
je 0x10f79
movq -0xd0(%rbp), %rsi
jmp 0x10e4b
xorl %eax, %eax
movl %eax, (%rbx)
leaq 0x30(%rbx), %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movq %rax, 0x18(%rbx)
movq %rcx, 0x20(%rbx)
movq %rax, 0x28(%rbx)
movb %al, 0x30(%rbx)
movq %rax, 0x40(%rbx)
movl %eax, 0x48(%rbx)
leaq 0x60(%rbx), %rcx
movq %rcx, 0x50(%rbx)
movq %rax, 0x58(%rbx)
movb %al, 0x60(%rbx)
leaq -0x98(%rbp), %rdi
movq %r14, %rsi
callq 0x11596
leaq -0x90(%rbp), %r12
movl -0x8(%r12), %eax
movl %eax, -0xc0(%rbp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x22d0
movq (%r12), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x10d47
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2240
leaq 0x305e(%rip), %rsi      # 0x13dac
movq %r15, %rdi
callq 0x20d0
testl %eax, %eax
je 0x10e21
leaq 0x8(%rbx), %r12
leaq -0x98(%rbp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x10a56
movq %r12, %rdi
movq %r13, %rsi
callq 0x118ba
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x10d98
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x10db1
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0x90(%rbp), %rdi
callq 0xe08a
cmpb $0x1, 0x1c(%r14)
je 0x10eb1
movq %r13, %rdi
movq %r14, %rsi
callq 0x11596
movl -0x98(%rbp), %eax
movl %eax, -0xc0(%rbp)
movq %r15, %rdi
leaq -0x90(%rbp), %rsi
callq 0x22d0
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x10e0a
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2240
movq %r15, %rdi
leaq 0x2f98(%rip), %rsi      # 0x13dac
callq 0x20d0
testl %eax, %eax
jne 0x10d69
leaq -0x110(%rbp), %rdi
movq %r14, %rsi
callq 0x11518
leaq -0xf8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10f79
movq -0xf8(%rbp), %rsi
incq %rsi
callq 0x2240
jmp 0x10f79
leaq -0x88(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x3085(%rip), %rsi      # 0x13eef
leaq 0x30a7(%rip), %rdx      # 0x13f18
leaq -0x98(%rbp), %rdi
callq 0x3774
movl -0xc0(%rbp), %eax
leaq -0x70(%rbp), %r15
movl %eax, -0x8(%r15)
leaq -0x60(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x3688
jmp 0x10adb
leaq -0x88(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x300e(%rip), %rsi      # 0x13ed1
leaq 0x3024(%rip), %rdx      # 0x13eee
leaq -0x98(%rbp), %rdi
callq 0x3774
movl -0xc0(%rbp), %eax
leaq -0x70(%rbp), %r15
movl %eax, -0x8(%r15)
leaq -0x60(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x3688
leaq -0x98(%rbp), %r12
movb $0x0, 0x48(%r12)
leaq 0x20(%r14), %rdi
movq %r12, %rsi
callq 0x22d0
movl 0x20(%r12), %eax
movl %eax, 0x40(%r14)
leaq 0x48(%r14), %rdi
movq %r15, %rsi
callq 0x22d0
movb 0x48(%r12), %al
movb %al, 0x68(%r14)
movq 0x28(%r12), %rdi
cmpq %r13, %rdi
je 0x10f52
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x10f74
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x2240
movb $0x1, 0x70(%r14)
leaq -0xa8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10f98
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x2240
movq %rbx, %rax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x1103a
movq -0x88(%rbp), %rsi
jmp 0x10fec
jmp 0x11037
jmp 0x10ff8
jmp 0x1101f
jmp 0x11037
jmp 0x11037
movq %rax, %r14
movq -0xe0(%rbp), %rdi
cmpq %r12, %rdi
je 0x1103a
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x2240
jmp 0x1103a
jmp 0x11037
movq %rax, %r14
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x11042
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x2240
jmp 0x11042
movq %rax, %r14
jmp 0x11042
jmp 0x11037
movq %rax, %r14
leaq -0x98(%rbp), %rdi
callq 0xdccc
jmp 0x1103a
movq %rax, %r14
movq %rbx, %rdi
callq 0xdccc
leaq -0xa8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11061
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x2240
movq %r14, %rdi
callq 0x23a0