// File: /workspace/github_cpp_makefile_star2_O1/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 0x114ec
cmpb $0x1, 0x1c(%r14)
jne 0x10b87
leaq -0x88(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x3435(%rip), %rsi      # 0x13ed1
leaq 0x344b(%rip), %rdx      # 0x13eee
leaq -0x98(%rbp), %rdi
callq 0x3766
movl -0xc0(%rbp), %eax
leaq -0x70(%rbp), %rdi
movl %eax, -0x8(%rdi)
leaq -0x60(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
addq %rsi, %rdx
callq 0x367e
leaq -0x98(%rbp), %r15
movb $0x0, 0x48(%r15)
leaq 0x20(%r14), %rdi
movq %r15, %rsi
callq 0x22d0
movl 0x20(%r15), %eax
movl %eax, 0x40(%r14)
leaq 0x48(%r14), %rdi
leaq -0x70(%rbp), %r15
movq %r15, %rsi
callq 0x22d0
movb 0x20(%r15), %al
movb %al, 0x68(%r14)
movq (%r15), %rdi
cmpq %r13, %rdi
je 0x10b26
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x98(%rbp), %rdi
cmpq %r12, %rdi
je 0x10b41
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 0x10f5e
leaq -0xb8(%rbp), %r15
leaq 0x333a(%rip), %rsi      # 0x13ecf
movq %r15, %rdi
callq 0x20d0
testl %eax, %eax
je 0x10cc1
leaq 0x3200(%rip), %rsi      # 0x13dac
movq %r15, %rdi
callq 0x20d0
testl %eax, %eax
je 0x10e4b
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), %r15
movq %r15, -0x10(%r15)
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
addq %rsi, %rdx
callq 0x367e
leaq -0x98(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x1097a
leaq 0x20(%rbx), %rdi
leaq -0x98(%rbp), %r14
movq %r14, %rsi
callq 0x22d0
movq 0x20(%r14), %rax
movq %rax, 0x40(%rbx)
movl 0x28(%r14), %eax
movl %eax, 0x48(%rbx)
leaq 0x50(%rbx), %rdi
leaq -0x68(%rbp), %r14
movq %r14, %rsi
callq 0x22d0
movq (%r14), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x10c86
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0x88(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10ca5
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0xe0(%rbp), %rdi
cmpq %r15, %rdi
je 0x10f5e
movq -0xd0(%rbp), %rsi
jmp 0x10e3e
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 0x1156a
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 0x10d3a
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2240
leaq 0x306b(%rip), %rsi      # 0x13dac
movq %r15, %rdi
callq 0x20d0
testl %eax, %eax
je 0x10e14
leaq 0x8(%rbx), %r12
leaq -0x98(%rbp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x10a58
movq %r12, %rdi
movq %r13, %rsi
callq 0x118c4
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x10d8b
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x10da4
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0x90(%rbp), %rdi
callq 0xe0cc
cmpb $0x1, 0x1c(%r14)
je 0x10ea1
movq %r13, %rdi
movq %r14, %rsi
callq 0x1156a
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 0x10dfd
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2240
movq %r15, %rdi
leaq 0x2fa5(%rip), %rsi      # 0x13dac
callq 0x20d0
testl %eax, %eax
jne 0x10d5c
leaq -0x110(%rbp), %rdi
movq %r14, %rsi
callq 0x114ec
leaq -0xf8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10f5e
movq -0xf8(%rbp), %rsi
incq %rsi
callq 0x2240
jmp 0x10f5e
leaq -0x88(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x3091(%rip), %rsi      # 0x13eef
leaq 0x30b3(%rip), %rdx      # 0x13f18
leaq -0x98(%rbp), %rdi
callq 0x3766
movl -0xc0(%rbp), %eax
leaq -0x70(%rbp), %rdi
movl %eax, -0x8(%rdi)
leaq -0x60(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
addq %rsi, %rdx
callq 0x367e
jmp 0x10ada
leaq -0x88(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x301d(%rip), %rsi      # 0x13ed1
leaq 0x3033(%rip), %rdx      # 0x13eee
leaq -0x98(%rbp), %rdi
callq 0x3766
movl -0xc0(%rbp), %eax
leaq -0x70(%rbp), %rdi
movl %eax, -0x8(%rdi)
leaq -0x60(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
addq %rsi, %rdx
callq 0x367e
leaq -0x98(%rbp), %r15
movb $0x0, 0x48(%r15)
leaq 0x20(%r14), %rdi
movq %r15, %rsi
callq 0x22d0
movl 0x20(%r15), %eax
movl %eax, 0x40(%r14)
leaq 0x48(%r14), %rdi
leaq -0x70(%rbp), %r15
movq %r15, %rsi
callq 0x22d0
movb 0x20(%r15), %al
movb %al, 0x68(%r14)
movq (%r15), %rdi
cmpq %r13, %rdi
je 0x10f3e
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x98(%rbp), %rdi
cmpq %r12, %rdi
je 0x10f59
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x2240
movb $0x1, 0x70(%r14)
leaq -0xa8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10f7d
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
cmpq %r12, %rdi
je 0x11011
movq -0x88(%rbp), %rsi
jmp 0x10fca
jmp 0x1100e
jmp 0x10fd6
jmp 0x10ff6
jmp 0x1100e
jmp 0x1100e
movq %rax, %r14
movq -0xe0(%rbp), %rdi
cmpq %r15, %rdi
je 0x11011
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x2240
jmp 0x11011
jmp 0x1100e
movq %rax, %r14
movq -0x98(%rbp), %rdi
cmpq %r12, %rdi
je 0x11019
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x2240
jmp 0x11019
movq %rax, %r14
jmp 0x11019
jmp 0x1100e
movq %rax, %r14
leaq -0x98(%rbp), %rdi
callq 0xdd46
jmp 0x11011
movq %rax, %r14
movq %rbx, %rdi
callq 0xdd46
leaq -0xa8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11038
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x2240
movq %r14, %rdi
callq 0x23a0