// File: /workspace/github_cpp_makefile_star2_O1/0x0584[P]scmin-plus/src/repl/parser.cpp
// Function: parse_cons_flavor(std::queue<token, std::deque<token, std::allocator<token>>>&, std::shared_ptr<sexpr>&)
sexpr_t parse_cons_flavor(queue<token>& q, sexpr_t& expr) {
    token tmp = tok;

    if (q.pop(); q.size() == 0 or tok.type == token::tok_r_paren) {
        cerr << "Err: malformed car/cdr" << endl;
        return nullptr;
    }
    sexpr_t e = parse_tokens(q);
    sexpr_t tail = nil();

    if (tmp.isset) {
        if ((q.size() == 0 or tok.type == token::tok_r_paren)) {
            cerr << "Err: malformed car/cdr" << endl;
            return nullptr;
        }
        tail = cons(parse_tokens(q), tail);
    }
    if (not e or e->isnil())
        return e;
    for (; tmp.cons_s.size() > 1; tmp.cons_s.pop())
        e = cons(symb(tmp.cons_s.top() == 'a' ? "car" : "cdr"),
                 cons(e, nil()));
    expr = cons(symb(tmp.cons_s.top() == 'a' ?
                     (tmp.isset ? "set-car!" : "car")
                     : (tmp.isset ? "set-cdr!" : "cdr")),
                cons(e, tail));
    return expr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r12
movq 0x10(%rsi), %r14
leaq -0x130(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x110ae
movb 0x50(%r14), %al
movb %al, 0x50(%r15)
leaq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %r15
movq %r15, -0x10(%r15)
movq 0x58(%r14), %rsi
movq 0x60(%r14), %rdx
addq %rsi, %rdx
callq 0x45ce
movq 0x78(%r14), %rax
movq %rax, -0xb8(%rbp)
movq %rbx, %rdi
callq 0x116f2
movq 0x48(%rbx), %rax
movq %rax, %rcx
subq 0x28(%rbx), %rcx
sarq $0x3, %rcx
cmpq $0x1, %rax
adcq $-0x1, %rcx
movq 0x30(%rbx), %rax
subq 0x38(%rbx), %rax
sarq $0x7, %rax
leaq (%rax,%rcx,4), %rcx
movq 0x10(%rbx), %rax
movq 0x20(%rbx), %rdx
subq %rax, %rdx
sarq $0x7, %rdx
addq %rcx, %rdx
je 0x103dc
cmpl $0x1, 0x7c(%rax)
jne 0x10466
movq 0x9c05(%rip), %rbx      # 0x19fe8
leaq 0x3506(%rip), %rsi      # 0x138f0
movl $0x16, %edx
movq %rbx, %rdi
callq 0x3210
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq 0x9bd3(%rip), %rdi      # 0x19fe8
callq 0x3030
movq %rax, %rdi
callq 0x3160
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
movq -0xd8(%rbp), %rdi
cmpq %r15, %rdi
je 0x10445
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x31f0
leaq -0x130(%rbp), %rdi
callq 0xdab6
movq %r12, %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0xfe61
leaq -0xa0(%rbp), %rdi
callq 0x51b8
cmpb $0x1, -0xe0(%rbp)
jne 0x10582
movq 0x48(%rbx), %rax
movq %rax, %rcx
subq 0x28(%rbx), %rcx
sarq $0x3, %rcx
cmpq $0x1, %rax
adcq $-0x1, %rcx
movq 0x30(%rbx), %rax
subq 0x38(%rbx), %rax
sarq $0x7, %rax
leaq (%rax,%rcx,4), %rcx
movq 0x10(%rbx), %rax
movq 0x20(%rbx), %rdx
subq %rax, %rdx
sarq $0x7, %rdx
addq %rcx, %rdx
je 0x104ce
cmpl $0x1, 0x7c(%rax)
jne 0x10521
movq 0x9b13(%rip), %rbx      # 0x19fe8
leaq 0x3414(%rip), %rsi      # 0x138f0
movl $0x16, %edx
movq %rbx, %rdi
callq 0x3210
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq 0x9ae1(%rip), %rdi      # 0x19fe8
callq 0x3030
movq %rax, %rdi
callq 0x3160
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
jmp 0x105b4
leaq -0x40(%rbp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0xfe61
leaq -0x70(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
callq 0x52f5
movaps -0x70(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x70(%rbp)
movq -0x98(%rbp), %rdi
movups %xmm0, -0xa0(%rbp)
testq %rdi, %rdi
je 0x10566
callq 0x4114
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x10574
callq 0x4114
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x10582
callq 0x4114
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x10594
callq 0x4c7c
testb %al, %al
je 0x105dc
movq -0x50(%rbp), %rax
movq %rax, (%r12)
xorl %eax, %eax
movq %rax, 0x8(%r12)
movq -0x48(%rbp), %rcx
movq %rax, -0x48(%rbp)
movq %rcx, 0x8(%r12)
movq %rax, -0x50(%rbp)
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x105c5
callq 0x4114
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x1042a
callq 0x4114
jmp 0x1042a
movq %r13, -0xa8(%rbp)
movq %r12, -0xb0(%rbp)
leaq 0x3312(%rip), %r15      # 0x13903
leaq -0x70(%rbp), %r12
leaq -0x90(%rbp), %r13
leaq -0x140(%rbp), %r14
leaq -0x80(%rbp), %rbx
movq -0xe8(%rbp), %rcx
movq %rcx, %rsi
subq -0x108(%rbp), %rsi
shrq $0x3, %rsi
cmpq $0x1, %rcx
adcq $-0x1, %rsi
shlq $0x9, %rsi
movq -0x100(%rbp), %rax
movq -0xf8(%rbp), %rdx
movq %rax, %rdi
subq %rdx, %rdi
addq -0x110(%rbp), %rdi
addq %rsi, %rdi
subq -0x120(%rbp), %rdi
cmpq $0x2, %rdi
jb 0x107a0
cmpq %rdx, %rax
jne 0x10668
movq -0x8(%rcx), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
cmpb $0x61, -0x1(%rax)
movq %r15, %rsi
leaq 0x313e(%rip), %rax      # 0x137b4
cmoveq %rax, %rsi
leaq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq 0x327d(%rip), %rdx      # 0x13906
leaq 0x3127(%rip), %rax      # 0x137b7
cmoveq %rax, %rdx
movq %r12, %rdi
callq 0x6ca4
movq %r13, %rdi
movq %r12, %rsi
callq 0x51e2
movq %r14, %rdi
callq 0x51b8
movq %rbx, %rdi
leaq -0x50(%rbp), %rsi
movq %r14, %rdx
callq 0x52f5
leaq -0x40(%rbp), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x52f5
movaps -0x40(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x40(%rbp)
movq -0x48(%rbp), %rdi
movups %xmm0, -0x50(%rbp)
testq %rdi, %rdi
je 0x106ea
callq 0x4114
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x106f8
callq 0x4114
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x10706
callq 0x4114
movq -0x138(%rbp), %rdi
testq %rdi, %rdi
je 0x10717
callq 0x4114
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x10728
callq 0x4114
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x10741
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x31f0
movq -0x100(%rbp), %rax
movq -0xf8(%rbp), %rdi
cmpq %rdi, %rax
je 0x10759
decq %rax
jmp 0x10794
movl $0x200, %esi            # imm = 0x200
callq 0x31f0
movq -0xe8(%rbp), %rax
leaq -0x8(%rax), %rcx
movq %rcx, -0xe8(%rbp)
movq -0x8(%rax), %rax
movq %rax, -0xf8(%rbp)
leaq 0x200(%rax), %rcx
movq %rcx, -0xf0(%rbp)
addq $0x1ff, %rax            # imm = 0x1FF
movq %rax, -0x100(%rbp)
jmp 0x10607
cmpq %rdx, %rax
jne 0x107ae
movl $0x200, %eax            # imm = 0x200
addq -0x8(%rcx), %rax
testb $0x1, -0xe0(%rbp)
leaq 0x3005(%rip), %rcx      # 0x137c1
leaq 0x2ff1(%rip), %rdx      # 0x137b4
cmovneq %rcx, %rdx
leaq 0x2fea(%rip), %rcx      # 0x137b8
cmovneq %rcx, %r15
cmpb $0x61, -0x1(%rax)
cmoveq %rdx, %r15
leaq -0x70(%rbp), %rbx
leaq -0x60(%rbp), %rax
movq %rax, (%rbx)
movq %r15, %rdi
callq 0x30e0
leaq (%rax,%r15), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6ca4
movq -0xb0(%rbp), %r12
movq -0xa8(%rbp), %rbx
leaq -0x90(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x51e2
leaq -0xc8(%rbp), %r15
leaq -0x80(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
callq 0x52f5
leaq -0x40(%rbp), %rdi
leaq -0x90(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x52f5
movaps -0x40(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x40(%rbp)
movq 0x8(%rbx), %rdi
movups %xmm0, (%rbx)
testq %rdi, %rdi
je 0x10865
callq 0x4114
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x10873
callq 0x4114
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x10881
callq 0x4114
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x10892
callq 0x4114
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x108ab
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x31f0
movq (%rbx), %rax
movq %rax, (%r12)
movq 0x8(%rbx), %rax
movq %rax, 0x8(%r12)
testq %rax, %rax
je 0x105b4
movq 0x96b5(%rip), %rcx      # 0x19f80
cmpb $0x0, (%rcx)
je 0x108d8
incl 0x8(%rax)
jmp 0x105b4
lock
incl 0x8(%rax)
jmp 0x105b4
movq %rax, %rbx
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x10995
callq 0x4114
jmp 0x10995
jmp 0x10992
movq %rax, %rbx
movq -0x78(%rbp), %rdi
jmp 0x10952
jmp 0x10963
jmp 0x1095e
jmp 0x10992
movq %rax, %rbx
jmp 0x109a6
jmp 0x109b6
jmp 0x10992
movq %rax, %rbx
leaq -0x130(%rbp), %rdi
callq 0xdab6
jmp 0x109c5
movq %rax, %rbx
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x1094b
callq 0x4114
jmp 0x1094b
movq %rax, %rbx
movq -0x138(%rbp), %rdi
testq %rdi, %rdi
je 0x10966
callq 0x4114
jmp 0x10966
movq %rax, %rbx
jmp 0x10977
movq %rax, %rbx
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x10977
callq 0x4114
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x10995
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x31f0
jmp 0x10995
movq %rax, %rbx
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x109a6
callq 0x4114
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x109b9
callq 0x4114
jmp 0x109b9
movq %rax, %rbx
leaq -0x130(%rbp), %rdi
callq 0x1107e
movq %rbx, %rdi
callq 0x3310