// File: /workspace/github_cpp_makefile_star2_O2/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 $0x68, %rsp
movq %rcx, %r13
movq %rdx, %r15
movl %esi, %r12d
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
movaps %xmm0, -0x70(%rbp)
movq (%rdx), %rdi
callq 0x4b80
cmpq $0x2, %rax
jne 0x9efc
movq (%r15), %rsi
leaq -0x48(%rbp), %rdi
callq 0x5fc6
leaq -0x38(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movq %r13, %rdx
callq 0xc9d5
leaq -0x80(%rbp), %rbx
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
callq 0x4354
leaq -0x30(%rbp), %rdi
callq 0x3e82
leaq -0x40(%rbp), %rdi
callq 0x3e82
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x9f23
callq 0x49c4
testb %al, %al
je 0x9f23
movq (%r15), %rsi
leaq -0x58(%rbp), %rdi
callq 0x5f48
movq -0x58(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x5fc6
leaq -0x38(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movq %r13, %rdx
callq 0xc9d5
leaq -0x70(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x4354
leaq -0x30(%rbp), %rdi
callq 0x3e82
leaq -0x40(%rbp), %rdi
callq 0x3e82
leaq -0x50(%rbp), %rdi
callq 0x3e82
movq -0x80(%rbp), %rdi
testb %r12b, %r12b
je 0x9f4b
leaq -0x70(%rbp), %rsi
callq 0x5f06
jmp 0x9f54
movq 0xe0e5(%rip), %rdi      # 0x17fe8
leaq 0x6705(%rip), %rsi      # 0x1060f
callq 0x31f0
movq %rax, %rdi
callq 0x3100
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
jmp 0x9fe7
movq 0xe0be(%rip), %rdi      # 0x17fe8
leaq 0x6701(%rip), %rsi      # 0x10632
callq 0x31f0
movq %rax, %rdi
callq 0x3100
movq %r14, %rdi
callq 0x4d18
jmp 0x9fe7
leaq -0x70(%rbp), %rsi
callq 0x5f86
movq %r13, -0x88(%rbp)
movq %r14, -0x90(%rbp)
movq (%r15), %rsi
leaq -0x38(%rbp), %rdi
callq 0x5fc6
leaq -0x40(%rbp), %r12
leaq -0x50(%rbp), %r15
leaq -0x58(%rbp), %r13
leaq -0x48(%rbp), %r14
leaq -0x38(%rbp), %rbx
movq -0x38(%rbp), %rdi
callq 0x4b10
testb %al, %al
jne 0x9fc4
movq -0x38(%rbp), %rsi
movq %r13, %rdi
callq 0x5f48
movq -0x58(%rbp), %rsi
movq %r14, %rdi
callq 0x5fc6
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4354
movq %r12, %rdi
callq 0x3e82
movq %r15, %rdi
callq 0x3e82
jmp 0x9f82
leaq -0x38(%rbp), %rsi
movq -0x90(%rbp), %r14
movq %r14, %rdi
movq -0x88(%rbp), %rdx
callq 0xc9d5
leaq -0x30(%rbp), %rdi
callq 0x3e82
leaq -0x68(%rbp), %rdi
callq 0x3e82
leaq -0x78(%rbp), %rdi
callq 0x3e82
movq %r14, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa047
jmp 0xa033
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x3e82
jmp 0xa020
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
jmp 0xa04e
jmp 0xa033
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
jmp 0xa04e
jmp 0xa033
movq %rax, %rbx
jmp 0xa053
jmp 0xa047
movq %rax, %rbx
movq %r15, %rdi
callq 0x3e82
jmp 0xa04a
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x3e82
leaq -0x68(%rbp), %rdi
callq 0x3e82
leaq -0x78(%rbp), %rdi
callq 0x3e82
movq %rbx, %rdi
callq 0x3330
nop