// File: /workspace/github_cpp_makefile_star2_O3/0x0584[P]scmin-plus/src/builtin/cons.cpp
// Function: cons_flavor(bool, std::shared_ptr<sexpr> const&, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::shared_ptr<sexpr>, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::shared_ptr<sexpr>>>>&)
static sexpr_t _cons_flavor(bool cdr, const sexpr_t& args, env_t& bindings) {
    sexpr_t e, set;

    if (args->length() != 2) {
        cerr << "Err: operator expect two arguments" << endl;
        return nullptr;
    }
    if (e = ::eval(args->car(), bindings); not (e and e->iscons())) {
        cerr << "Err: cannot set constant!" << endl;
        return nil();
    }
    set = ::eval(args->cdr()->car(), bindings);
    if (cdr) e->setcdr(set);
    else e->setcar(set);
    sexpr_t walk = args->car();
    while (not walk->issymb())
        walk = walk->cdr()->car();
    return ::eval(walk, bindings);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, %r15
movq %rdx, %r12
movl %esi, %r13d
movq %rdi, -0x58(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
movq (%rdx), %rdi
xorl %ebx, %ebx
callq 0x4fb6
cmpq $0x2, %rax
jne 0xb8bf
movq (%r12), %rsi
leaq -0x50(%rbp), %rdi
callq 0x628e
leaq -0x40(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movq %r15, %rdx
callq 0xf373
movq -0x40(%rbp), %r14
movq -0x38(%rbp), %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0xb81b
callq 0x4104
testq %r14, %r14
je 0xb91e
movq %r14, %rdi
callq 0x4cb0
testb %al, %al
je 0xb91e
movq (%r12), %rsi
leaq -0x68(%rbp), %rdi
callq 0x61be
movq -0x68(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x628e
leaq -0x40(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movq %r15, %rdx
callq 0xf373
movaps -0x40(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x40(%rbp)
movq -0x78(%rbp), %rdi
movaps %xmm0, -0x80(%rbp)
testq %rdi, %rdi
je 0xb889
callq 0x4104
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0xb889
callq 0x4104
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0xb897
callq 0x4104
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0xb8a5
callq 0x4104
testb %r13b, %r13b
je 0xb972
leaq -0x80(%rbp), %rsi
movq %r14, %rdi
callq 0x615c
jmp 0xb97e
xorl %ebx, %ebx
movq 0xe720(%rip), %r14      # 0x19fe8
leaq 0x7d5e(%rip), %rsi      # 0x1362d
movl $0x22, %edx
movq %r14, %rdi
callq 0x3210
movq (%r14), %rax
addq -0x18(%rax), %r14
xorl %ebx, %ebx
movq %r14, %rdi
movl $0xa, %esi
callq 0x31d0
xorl %ebx, %ebx
movsbl %al, %esi
movq 0xe6ea(%rip), %rdi      # 0x19fe8
callq 0x3030
xorl %ebx, %ebx
movq %rax, %rdi
callq 0x3160
xorps %xmm0, %xmm0
movq -0x58(%rbp), %rax
movups %xmm0, (%rax)
xorl %ebx, %ebx
jmp 0xba11
movq 0xe6c3(%rip), %r14      # 0x19fe8
leaq 0x7d24(%rip), %rsi      # 0x13650
movl $0x19, %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 0xe691(%rip), %rdi      # 0x19fe8
callq 0x3030
movq %rax, %rdi
callq 0x3160
movq -0x58(%rbp), %rdi
callq 0x514c
jmp 0xba11
leaq -0x80(%rbp), %rsi
movq %r14, %rdi
callq 0x622e
movq (%r12), %rsi
leaq -0x40(%rbp), %rdi
callq 0x628e
leaq -0x68(%rbp), %r14
leaq -0x50(%rbp), %r12
movq -0x40(%rbp), %rdi
callq 0x4ed6
testb %al, %al
jne 0xb9f3
movq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x61be
movq -0x68(%rbp), %rsi
movq %r12, %rdi
callq 0x628e
movaps -0x50(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x50(%rbp)
movq -0x38(%rbp), %rdi
movups %xmm0, -0x40(%rbp)
testq %rdi, %rdi
je 0xb9e3
callq 0x4104
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0xb9e3
callq 0x4104
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0xb993
callq 0x4104
jmp 0xb993
leaq -0x40(%rbp), %rsi
movq -0x58(%rbp), %rdi
movq %r15, %rdx
callq 0xf373
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0xba11
callq 0x4104
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0xba1f
callq 0x4104
testq %rbx, %rbx
je 0xba2c
movq %rbx, %rdi
callq 0x4104
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xba8c
jmp 0xba9f
movq %rax, %r14
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0xba55
callq 0x4104
jmp 0xba55
movq %rax, %r14
movq -0x60(%rbp), %rdi
jmp 0xba93
jmp 0xba9f
movq %rax, %r14
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0xba73
callq 0x4104
jmp 0xba73
movq %rax, %r14
xorl %ebx, %ebx
jmp 0xbaa2
jmp 0xba8c
movq %rax, %r14
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0xba8f
callq 0x4104
jmp 0xba8f
movq %rax, %r14
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0xbaa2
callq 0x4104
jmp 0xbaa2
movq %rax, %r14
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0xbab0
callq 0x4104
testq %rbx, %rbx
je 0xbabd
movq %rbx, %rdi
callq 0x4104
movq %r14, %rdi
callq 0x3310
nop