// File: /workspace/github_cpp_makefile_star2_O3/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, %r14
movq %rdi, %rbx
movq 0x10(%rsi), %r15
leaq -0x128(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x10abe
movb 0x50(%r15), %al
movb %al, 0x50(%r12)
leaq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %r12
movq %r12, -0x10(%r12)
movq 0x58(%r15), %rsi
movq 0x60(%r15), %rdx
addq %rsi, %rdx
callq 0x45ca
movq 0x78(%r15), %rax
movq %rax, -0xb0(%rbp)
movq %r14, %rdi
callq 0x1110a
movq 0x48(%r14), %rax
movq %rax, %rcx
subq 0x28(%r14), %rcx
sarq $0x3, %rcx
cmpq $0x1, %rax
adcq $-0x1, %rcx
movq 0x30(%r14), %rax
subq 0x38(%r14), %rax
sarq $0x7, %rax
leaq (%rax,%rcx,4), %rcx
movq 0x10(%r14), %rax
movq 0x20(%r14), %rdx
subq %rax, %rdx
sarq $0x7, %rdx
addq %rcx, %rdx
je 0xfdf9
cmpl $0x1, 0x7c(%rax)
jne 0xfe81
movq 0xa1e8(%rip), %r14      # 0x19fe8
leaq 0x3ae9(%rip), %rsi      # 0x138f0
movl $0x16, %edx
movq %r14, %rdi
callq 0x3210
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq 0xa1b6(%rip), %rdi      # 0x19fe8
callq 0x3030
movq %rax, %rdi
callq 0x3160
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq -0xd0(%rbp), %rdi
cmpq %r12, %rdi
je 0xfe60
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x31f0
leaq -0x128(%rbp), %rdi
callq 0xd544
movq %rbx, %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x50(%rbp), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0xf87e
leaq -0xa0(%rbp), %rdi
callq 0x514c
cmpb $0x1, -0xd8(%rbp)
jne 0xff9b
movq 0x48(%r14), %rax
movq %rax, %rcx
subq 0x28(%r14), %rcx
sarq $0x3, %rcx
cmpq $0x1, %rax
adcq $-0x1, %rcx
movq 0x30(%r14), %rax
subq 0x38(%r14), %rax
sarq $0x7, %rax
leaq (%rax,%rcx,4), %rcx
movq 0x10(%r14), %rax
movq 0x20(%r14), %rdx
subq %rax, %rdx
sarq $0x7, %rdx
addq %rcx, %rdx
je 0xfee9
cmpl $0x1, 0x7c(%rax)
jne 0xff3a
movq 0xa0f8(%rip), %r14      # 0x19fe8
leaq 0x39f9(%rip), %rsi      # 0x138f0
movl $0x16, %edx
movq %r14, %rdi
callq 0x3210
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq 0xa0c6(%rip), %rdi      # 0x19fe8
callq 0x3030
movq %rax, %rdi
callq 0x3160
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
jmp 0xffca
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0xf87e
leaq -0x70(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
callq 0x5289
movaps -0x70(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x70(%rbp)
movq -0x98(%rbp), %rdi
movups %xmm0, -0xa0(%rbp)
testq %rdi, %rdi
je 0xff8d
callq 0x4104
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0xff8d
callq 0x4104
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0xff9b
callq 0x4104
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0xffb3
callq 0x4c74
testb %al, %al
je 0xfff2
movq -0x50(%rbp), %rax
jmp 0xffb5
xorl %eax, %eax
movq %rax, (%rbx)
movq -0x48(%rbp), %rax
xorl %ecx, %ecx
movq %rcx, -0x48(%rbp)
movq %rax, 0x8(%rbx)
movq %rcx, -0x50(%rbp)
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0xffdb
callq 0x4104
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0xfe45
callq 0x4104
jmp 0xfe45
movq %r13, -0xa8(%rbp)
movq -0xf8(%rbp), %rax
movq -0xf0(%rbp), %rdi
movq -0xe0(%rbp), %rcx
movq %rcx, %rdx
subq -0x100(%rbp), %rdx
shrq $0x3, %rdx
cmpq $0x1, %rcx
adcq $-0x1, %rdx
shlq $0x9, %rdx
movq %rax, %rsi
subq %rdi, %rsi
addq -0x108(%rbp), %rsi
addq %rdx, %rsi
subq -0x118(%rbp), %rsi
cmpq $0x2, %rsi
jb 0x101ea
leaq -0x70(%rbp), %r15
leaq -0x90(%rbp), %r12
leaq -0x138(%rbp), %r13
leaq -0x80(%rbp), %r14
cmpq %rdi, %rax
jne 0x10070
movq -0x8(%rcx), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
cmpb $0x61, -0x1(%rax)
leaq 0x3888(%rip), %rsi      # 0x13903
leaq 0x3732(%rip), %rax      # 0x137b4
cmoveq %rax, %rsi
leaq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq 0x3871(%rip), %rdx      # 0x13906
leaq 0x371b(%rip), %rax      # 0x137b7
cmoveq %rax, %rdx
movq %r15, %rdi
callq 0x6b44
movq %r12, %rdi
movq %r15, %rsi
callq 0x5176
movq %r13, %rdi
callq 0x514c
movq %r14, %rdi
leaq -0x50(%rbp), %rsi
movq %r13, %rdx
callq 0x5289
leaq -0x40(%rbp), %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x5289
movaps -0x40(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x40(%rbp)
movq -0x48(%rbp), %rdi
movups %xmm0, -0x50(%rbp)
testq %rdi, %rdi
je 0x10104
callq 0x4104
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x10104
callq 0x4104
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x10112
callq 0x4104
movq -0x130(%rbp), %rdi
testq %rdi, %rdi
je 0x10123
callq 0x4104
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x10134
callq 0x4104
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x1014d
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x31f0
movq -0xf8(%rbp), %rax
movq -0xf0(%rbp), %rdi
cmpq %rdi, %rax
je 0x10165
decq %rax
jmp 0x101a1
movl $0x200, %esi            # imm = 0x200
callq 0x31f0
movq -0xe0(%rbp), %rax
leaq -0x8(%rax), %rcx
movq %rcx, -0xe0(%rbp)
movq -0x8(%rax), %rdi
movq %rdi, -0xf0(%rbp)
leaq 0x200(%rdi), %rax
movq %rax, -0xe8(%rbp)
leaq 0x1ff(%rdi), %rax
movq %rax, -0xf8(%rbp)
movq -0xe0(%rbp), %rcx
movq %rcx, %rdx
subq -0x100(%rbp), %rdx
shrq $0x3, %rdx
cmpq $0x1, %rcx
adcq $-0x1, %rdx
shlq $0x9, %rdx
movq %rax, %rsi
subq %rdi, %rsi
addq -0x108(%rbp), %rsi
addq %rdx, %rsi
subq -0x118(%rbp), %rsi
cmpq $0x1, %rsi
ja 0x1005f
cmpq %rdi, %rax
jne 0x101f8
movl $0x200, %eax            # imm = 0x200
addq -0x8(%rcx), %rax
leaq 0x35c2(%rip), %rcx      # 0x137c1
leaq 0x35ae(%rip), %rdx      # 0x137b4
testb $0x1, -0xd8(%rbp)
cmovneq %rcx, %rdx
leaq 0x35a0(%rip), %rcx      # 0x137b8
leaq 0x36e4(%rip), %r14      # 0x13903
cmovneq %rcx, %r14
cmpb $0x61, -0x1(%rax)
cmoveq %rdx, %r14
leaq -0x70(%rbp), %r15
leaq -0x60(%rbp), %rax
movq %rax, (%r15)
movq %r14, %rdi
callq 0x30e0
leaq (%rax,%r14), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x6b44
leaq -0xc0(%rbp), %r12
movq -0xa8(%rbp), %r14
leaq -0x90(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x5176
leaq -0x80(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
callq 0x5289
leaq -0x40(%rbp), %rdi
leaq -0x90(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x5289
movaps -0x40(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x40(%rbp)
movq 0x8(%r14), %rdi
movups %xmm0, (%r14)
testq %rdi, %rdi
je 0x102be
callq 0x4104
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x102be
callq 0x4104
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x102cc
callq 0x4104
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x102dd
callq 0x4104
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x102f6
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x31f0
movq (%r14), %rax
movq %rax, (%rbx)
movq 0x8(%r14), %rax
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0xffca
movq 0x9c6c(%rip), %rcx      # 0x19f80
cmpb $0x0, (%rcx)
je 0x10321
incl 0x8(%rax)
jmp 0xffca
lock
incl 0x8(%rax)
jmp 0xffca
movq %rax, %rbx
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x103be
callq 0x4104
jmp 0x103be
jmp 0x1035e
movq %rax, %rbx
movq -0x78(%rbp), %rdi
jmp 0x1038a
jmp 0x10368
jmp 0x10363
jmp 0x1035e
movq %rax, %rbx
jmp 0x103cf
jmp 0x103f0
jmp 0x1035e
movq %rax, %rbx
jmp 0x103be
movq %rax, %rbx
jmp 0x103a5
movq %rax, %rbx
jmp 0x10394
movq %rax, %rbx
jmp 0x10383
movq %rax, %rbx
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x10383
callq 0x4104
movq -0x130(%rbp), %rdi
testq %rdi, %rdi
je 0x10394
callq 0x4104
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x103a5
callq 0x4104
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x103be
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x31f0
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x103cf
callq 0x4104
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x103f3
callq 0x4104
jmp 0x103f3
movq %rax, %rbx
leaq -0x128(%rbp), %rdi
callq 0xd544
jmp 0x103ff
movq %rax, %rbx
leaq -0x128(%rbp), %rdi
callq 0x10a8e
movq %rbx, %rdi
callq 0x3310