// File: /workspace/github_cpp_makefile_star2_O2/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 $0x68, %rsp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movaps %xmm0, -0x90(%rbp)
movq %rsi, %rdi
callq 0xe554
movq 0x10(%r15), %rsi
movl 0x7c(%rsi), %eax
cmpl $0x1, %eax
jne 0xd5bb
movq %r15, %rdi
callq 0xe554
movq %rbx, %rdi
callq 0x4d18
jmp 0xd797
movq %rbx, -0x78(%rbp)
movb $0x1, %cl
movl %r14d, -0x5c(%rbp)
movzbl %r14b, %r14d
leaq -0x50(%rbp), %r12
leaq -0x70(%rbp), %rbx
leaq -0x90(%rbp), %r13
leaq 0x334b(%rip), %rdx      # 0x1092a
movq %rdx, -0x58(%rbp)
cmpl $0x1, %eax
je 0xd772
xorps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
testl %eax, %eax
je 0xd614
cmpl $0xa, %eax
je 0xd6bf
movl %eax, %edx
andl $-0x4, %edx
cmpl $0x4, %edx
jne 0xd624
cmpb $0x0, -0x5c(%rbp)
je 0xd65c
movb $0x1, %al
jmp 0xd66f
movq %r12, %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0xcdf2
jmp 0xd67d
cmpl $0x9, %eax
je 0xd6e1
cmpl $0x8, %eax
je 0xd740
movq %r12, %rdi
callq 0xd916
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4354
leaq -0x48(%rbp), %rdi
callq 0x3e82
movq %r15, %rdi
callq 0xe554
jmp 0xd691
movl %eax, %ecx
notl %ecx
testb $0x6, %cl
je 0xd713
cmpl $0x5, %eax
sete %al
movzbl %al, %edx
movq %r12, %rdi
movq %r15, %rsi
callq 0xcc5c
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4354
leaq -0x48(%rbp), %rdi
callq 0x3e82
movq %rbx, %rdi
leaq -0x40(%rbp), %rsi
movq %r13, %rdx
callq 0x5e00
testb %al, %al
je 0xd72b
leaq -0x68(%rbp), %rdi
callq 0x3e82
movq 0x10(%r15), %rsi
movl 0x7c(%rsi), %eax
xorl %ecx, %ecx
jmp 0xd5e3
leaq 0x323a(%rip), %rax      # 0x10900
movq %rax, -0x58(%rbp)
testb $0x1, %cl
je 0xd713
leaq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rdx
movq %r15, %rsi
callq 0xd170
jmp 0xd701
leaq 0x326b(%rip), %rax      # 0x10953
movq %rax, -0x58(%rbp)
testb $0x1, %cl
je 0xd713
leaq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rdx
movq %r15, %rsi
callq 0xd02f
leaq -0x48(%rbp), %rdi
movq -0x8(%rdi), %rbx
callq 0x3e82
testq %rbx, %rbx
jne 0xd769
movq 0xa8ce(%rip), %rdi      # 0x17fe8
movq -0x58(%rbp), %rsi
callq 0x31f0
movq %rax, %rdi
callq 0x3100
xorps %xmm0, %xmm0
movq -0x78(%rbp), %rbx
movups %xmm0, (%rbx)
leaq -0x68(%rbp), %rdi
callq 0x3e82
jmp 0xd797
leaq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rdx
leaq -0x90(%rbp), %rcx
movq %r15, %rsi
callq 0xcf41
leaq -0x48(%rbp), %rdi
movq -0x8(%rdi), %rbx
callq 0x3e82
testq %rbx, %rbx
je 0xd72b
leaq -0x68(%rbp), %rdi
callq 0x3e82
movq %r15, %rdi
callq 0xe554
movq -0x40(%rbp), %rax
movq -0x78(%rbp), %rbx
movq %rax, (%rbx)
movq -0x38(%rbp), %rax
andq $0x0, -0x38(%rbp)
movq %rax, 0x8(%rbx)
andq $0x0, -0x40(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x3e82
leaq -0x38(%rbp), %rdi
callq 0x3e82
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd7d1
jmp 0xd7d1
jmp 0xd7d1
jmp 0xd7d1
movq %rax, %rbx
jmp 0xd7dd
jmp 0xd7d1
jmp 0xd7d1
jmp 0xd7d1
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x3e82
leaq -0x88(%rbp), %rdi
callq 0x3e82
leaq -0x38(%rbp), %rdi
callq 0x3e82
movq %rbx, %rdi
callq 0x3330