// File: /workspace/github_cpp_makefile_star2_O1/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 $0x88, %rsp
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
movaps %xmm0, -0x90(%rbp)
movq %rsi, %rdi
callq 0x116f2
movq 0x10(%r14), %rax
cmpl $0x1, 0x7c(%rax)
jne 0x10a1f
movq %r14, %rdi
callq 0x116f2
movq %rbx, %rdi
callq 0x51b8
jmp 0x10ccf
movb $0x1, %r13b
movl %r15d, -0x44(%rbp)
movzbl %r15b, %eax
movl %eax, -0x74(%rbp)
movq 0x10(%r14), %rsi
movl 0x7c(%rsi), %eax
cmpl $0x1, %eax
je 0x10caa
xorps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
cmpl $0xa, %eax
je 0x10a65
testl %eax, %eax
jne 0x10b02
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
movl -0x74(%rbp), %edx
callq 0xfe61
jmp 0x10b93
movb $0x1, %r12b
testb $0x1, %r13b
je 0x10a8d
leaq -0xb0(%rbp), %rdi
movq %r14, %rsi
leaq -0x60(%rbp), %rdx
callq 0x10327
cmpq $0x0, -0xb0(%rbp)
sete %r12b
testb $0x1, %r13b
je 0x10aa4
movq -0xa8(%rbp), %rdi
testq %rdi, %rdi
je 0x10aa4
callq 0x4114
movl $0x3, %r15d
movl $0x29, %edx
leaq 0x2e51(%rip), %rsi      # 0x13907
testb %r12b, %r12b
je 0x10beb
movq 0x9522(%rip), %rdi      # 0x19fe8
callq 0x3210
movq 0x9516(%rip), %rcx      # 0x19fe8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq 0x94f8(%rip), %rdi      # 0x19fe8
callq 0x3030
movq %rax, %rdi
callq 0x3160
jmp 0x10bdf
movl %eax, %ecx
andl $-0x4, %ecx
cmpl $0x4, %ecx
jne 0x10b16
cmpb $0x0, -0x44(%rbp)
je 0x10b62
movb $0x1, %al
jmp 0x10b84
cmpl $0x9, %eax
je 0x10c0d
cmpl $0x8, %eax
jne 0x10c63
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
leaq -0x60(%rbp), %rdx
leaq -0x90(%rbp), %rcx
callq 0xffb1
movq -0x40(%rbp), %r12
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x10b51
callq 0x4114
movl $0x3, %r15d
testq %r12, %r12
jne 0x10beb
jmp 0x10bdf
movl %eax, %ecx
notl %ecx
movl $0x28, %edx
leaq 0x2dbf(%rip), %rsi      # 0x13931
testb $0x6, %cl
je 0x10abf
cmpl $0x5, %eax
sete %al
orb -0x44(%rbp), %al
movzbl %al, %edx
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
callq 0xfc18
movaps -0x40(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x40(%rbp)
movq -0x68(%rbp), %rdi
movaps %xmm0, -0x70(%rbp)
testq %rdi, %rdi
je 0x10bb0
callq 0x4114
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x10bbe
callq 0x4114
leaq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rsi
leaq -0x90(%rbp), %rdx
callq 0x60c4
xorl %r12d, %r12d
movl $0x0, %r15d
testb %al, %al
jne 0x10bee
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movl $0x1, %r15d
movl %r13d, %r12d
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x10bfc
callq 0x4114
movl %r12d, %r13d
testl %r15d, %r15d
je 0x10a2d
jmp 0x10ca4
movb $0x1, %r12b
testb $0x1, %r13b
je 0x10c35
leaq -0xa0(%rbp), %rdi
movq %r14, %rsi
leaq -0x60(%rbp), %rdx
callq 0x1011b
cmpq $0x0, -0xa0(%rbp)
sete %r12b
testb $0x1, %r13b
je 0x10c4c
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x10c4c
callq 0x4114
movl $0x3, %r15d
movl $0x1c, %edx
leaq 0x2cfc(%rip), %rsi      # 0x1395a
jmp 0x10ab6
leaq -0x40(%rbp), %rdi
callq 0x10f20
movaps -0x40(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x40(%rbp)
movq -0x68(%rbp), %rdi
movaps %xmm0, -0x70(%rbp)
testq %rdi, %rdi
je 0x10c89
callq 0x4114
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x10c97
callq 0x4114
movq %r14, %rdi
callq 0x116f2
jmp 0x10bbe
cmpl $0x3, %r15d
jne 0x10ccf
movq %r14, %rdi
callq 0x116f2
movq -0x60(%rbp), %rax
movq %rax, (%rbx)
xorl %eax, %eax
movq %rax, 0x8(%rbx)
movq -0x58(%rbp), %rcx
movq %rax, -0x58(%rbp)
movq %rcx, 0x8(%rbx)
movq %rax, -0x60(%rbp)
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x10ce0
callq 0x4114
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x10cee
callq 0x4114
movq %rbx, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x10d14
jmp 0x10d14
jmp 0x10d14
movq %rax, %rbx
jmp 0x10d25
jmp 0x10d14
jmp 0x10d14
jmp 0x10d14
movq %rax, %rbx
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x10d25
callq 0x4114
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x10d36
callq 0x4114
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x10d44
callq 0x4114
movq %rbx, %rdi
callq 0x3310