// File: /workspace/github_cpp_makefile_star2_O3/0x0584[P]scmin-plus/src/repl/parser.cpp
// Function: parse_list(std::queue<token, std::deque<token, std::allocator<token>>>&, bool)
sexpr_t parse_list(queue<token>& q, bool quasi) {
    sexpr_t e, tail;
    bool op = true;

    if (q.pop(); tok.type == token::tok_r_paren) {
        q.pop();
        return nil();
    }
    while (tok.type != token::tok_r_paren) {
        sexpr_t tmp;

        if (tok.type == token::tok_l_paren)
            tmp = parse_tokens(q, quasi);
        else if (tok.type == token::tok_cons_flavor) {
            if (not (op and parse_cons_flavor(q, e))) {
                cerr << "Err: car/cdr must be called as operators!" << endl;
                return nullptr;
            }
            break;
        } else if (is_quote(tok.type)) {
            if (not quasi and is_unquote(tok.type)) {
                cerr << "Err: unquote appeared without quasiquote" << endl;
                return nullptr;
            }
            tmp = parse_quote(q, quasi or tok.type == token::tok_quasi);
        } else if (tok.type == token::tok_pair) {
            if (not parse_pair(q, e, tail))
                return nullptr;
            break;
        } else if (tok.type == token::tok_lambda) {
            if (not (op and parse_lambda(q, e))) {
                cerr << "Err: Lambda is mal formatted" << endl;
                return nullptr;
            }
            break;
        } else {
            tmp = tok; q.pop();
        }
        if (not cons_append(tmp, e, tail))
            return nullptr;
        op = false;
    }
    q.pop();
    return e;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movaps %xmm0, -0x80(%rbp)
movq %rsi, %rdi
callq 0x1110a
movq 0x10(%r14), %rax
cmpl $0x1, 0x7c(%rax)
jne 0x10453
movq %r14, %rdi
callq 0x1110a
movq %rbx, %rdi
callq 0x514c
jmp 0x10706
movb $0x1, %r12b
movl %r15d, -0x6c(%rbp)
movzbl %r15b, %eax
movl %eax, -0x70(%rbp)
movq %rbx, -0x68(%rbp)
movq 0x10(%r14), %rsi
movl 0x7c(%rsi), %eax
cmpl $0x1, %eax
je 0x106e5
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
cmpl $0xa, %eax
je 0x104d5
testl %eax, %eax
jne 0x1051b
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
movl -0x70(%rbp), %edx
callq 0xf87e
movups -0x40(%rbp), %xmm0
movq -0x58(%rbp), %rdi
movaps %xmm0, -0x60(%rbp)
testq %rdi, %rdi
je 0x104ae
callq 0x4104
leaq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x6010
xorl %r13d, %r13d
movl $0x0, %r15d
testb %al, %al
je 0x10582
jmp 0x10591
movl $0x29, %r13d
testb $0x1, %r12b
je 0x1053a
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
leaq -0x50(%rbp), %rdx
callq 0xfd42
movq -0x40(%rbp), %rbx
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x10503
callq 0x4104
movl $0x3, %r15d
leaq 0x33f7(%rip), %rsi      # 0x13907
testq %rbx, %rbx
movq -0x68(%rbp), %rbx
jne 0x1058e
jmp 0x10541
movl %eax, %ecx
andl $-0x4, %ecx
cmpl $0x4, %ecx
jne 0x105b0
cmpb $0x0, -0x6c(%rbp)
je 0x105f9
movb $0x1, %al
jmp 0x10619
leaq 0x33c6(%rip), %rsi      # 0x13907
movq 0x9aa0(%rip), %rdi      # 0x19fe8
movq %r13, %rdx
callq 0x3210
movq 0x9a91(%rip), %rcx      # 0x19fe8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq 0x9a73(%rip), %rdi      # 0x19fe8
callq 0x3030
movq %rax, %rdi
callq 0x3160
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movl $0x1, %r15d
movl %r12d, %r13d
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x1059f
callq 0x4104
movl %r13d, %r12d
testl %r15d, %r15d
je 0x10465
jmp 0x106df
cmpl $0x9, %eax
je 0x10652
cmpl $0x8, %eax
jne 0x10692
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
leaq -0x50(%rbp), %rdx
leaq -0x80(%rbp), %rcx
callq 0xf9c5
movq -0x40(%rbp), %rbx
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x105e8
callq 0x4104
movl $0x3, %r15d
testq %rbx, %rbx
movq -0x68(%rbp), %rbx
jne 0x1058e
jmp 0x10582
movl %eax, %ecx
notl %ecx
movl $0x28, %r13d
leaq 0x3327(%rip), %rsi      # 0x13931
testb $0x6, %cl
je 0x10541
cmpl $0x5, %eax
sete %al
movzbl %al, %edx
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
callq 0xf644
movaps -0x40(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x40(%rbp)
movq -0x58(%rbp), %rdi
movaps %xmm0, -0x60(%rbp)
testq %rdi, %rdi
je 0x104ae
callq 0x4104
movq -0x38(%rbp), %rdi
jmp 0x104a4
movl $0x1c, %r13d
testb $0x1, %r12b
je 0x106d3
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
leaq -0x50(%rbp), %rdx
callq 0xfb2f
movq -0x40(%rbp), %rbx
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x10680
callq 0x4104
movl $0x3, %r15d
leaq 0x32cd(%rip), %rsi      # 0x1395a
jmp 0x10510
leaq -0x40(%rbp), %rdi
callq 0x1092c
movaps -0x40(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x40(%rbp)
movq -0x58(%rbp), %rdi
movaps %xmm0, -0x60(%rbp)
testq %rdi, %rdi
je 0x106c6
callq 0x4104
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x106c6
callq 0x4104
movq %r14, %rdi
callq 0x1110a
jmp 0x104ae
leaq 0x3280(%rip), %rsi      # 0x1395a
jmp 0x10541
cmpl $0x3, %r15d
jne 0x10706
movq %r14, %rdi
callq 0x1110a
movq -0x50(%rbp), %rax
movq %rax, (%rbx)
movq -0x48(%rbp), %rax
xorl %ecx, %ecx
movq %rcx, -0x48(%rbp)
movq %rax, 0x8(%rbx)
movq %rcx, -0x50(%rbp)
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x10714
callq 0x4104
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x10722
callq 0x4104
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x10745
jmp 0x10745
jmp 0x10745
movq %rax, %rbx
jmp 0x10756
jmp 0x10745
jmp 0x10745
jmp 0x10745
movq %rax, %rbx
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x10756
callq 0x4104
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x10764
callq 0x4104
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x10772
callq 0x4104
movq %rbx, %rdi
callq 0x3310