// File: /workspace/github_cpp_makefile_star2_O2/0x0584[P]scmin-plus/src/builtin/builtin.cpp
// Function: builtin::_define(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>>>>&)
sexpr_t builtin::_define(const sexpr_t& args, env_t& bindings) {
    if (args->length() != 2) {
        cerr << "Err: define expects two arguments" << endl;
        return nullptr;
    }
    bool is_lambda = args->car()->islist();
    sexpr_t def = is_lambda ? args->car() : args;
    if (not def->car()->issymb()) {
        cerr << "Err: define is mal-formatted" << endl;
        return nullptr;
    }
    auto sy = any_cast<sexpr_text>(*def->car()->blob).text();
    if (bindings.find(sy) != end(bindings)) {
        cerr << "Err: symbol is already defined, use set! instead" << endl;
        return nil();
    }
    bindings[sy] = ::eval(is_lambda ? lambda(args->car()->cdr(),
                                             args->cdr()->car()) :
                          args->cdr()->car(), bindings);
    return def->car();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq (%rsi), %rdi
callq 0x4b80
cmpq $0x2, %rax
jne 0x6747
movq (%r12), %rsi
leaq -0x80(%rbp), %r14
movq %r14, %rdi
callq 0x5fc6
movq (%r14), %rdi
callq 0x49e0
movl %eax, %r14d
leaq -0x78(%rbp), %rdi
callq 0x3e82
testb %r14b, %r14b
je 0x676d
movq (%r12), %rsi
leaq -0x58(%rbp), %rdi
callq 0x5fc6
jmp 0x6779
movq 0x1189a(%rip), %rdi     # 0x17fe8
leaq 0x9b1e(%rip), %rsi      # 0x10273
callq 0x31f0
movq %rax, %rdi
callq 0x3100
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
jmp 0x694f
leaq -0x58(%rbp), %rdi
movq %r12, %rsi
callq 0x3e44
movq -0x58(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x5fc6
movq -0x80(%rbp), %rdi
callq 0x4b10
movl %eax, %r13d
leaq -0x78(%rbp), %rdi
callq 0x3e82
testb %r13b, %r13b
je 0x681b
movq -0x58(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x5fc6
movq -0x38(%rbp), %rax
movq (%rax), %rsi
leaq -0x80(%rbp), %rdi
callq 0x3d07
leaq -0xd0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x37cc
leaq -0x80(%rbp), %rdi
callq 0x30f0
leaq -0x30(%rbp), %rdi
callq 0x3e82
leaq -0xd0(%rbp), %rsi
movq %r15, %rdi
callq 0x9438
testq %rax, %rax
je 0x6841
movq 0x117ee(%rip), %rdi     # 0x17fe8
leaq 0x9ab1(%rip), %rsi      # 0x102b2
callq 0x31f0
movq %rax, %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x4d18
jmp 0x693a
movq 0x117c6(%rip), %rdi     # 0x17fe8
leaq 0x9a6c(%rip), %rsi      # 0x10295
callq 0x31f0
movq %rax, %rdi
callq 0x3100
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
jmp 0x6946
testb %r14b, %r14b
je 0x689f
movq (%r12), %rsi
leaq -0xb0(%rbp), %rdi
callq 0x5fc6
movq -0xb0(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x5f48
movq (%r12), %rsi
leaq -0x90(%rbp), %rdi
callq 0x5f48
movq -0x90(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x5fc6
leaq -0x38(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
callq 0x4d87
jmp 0x68b9
movq (%r12), %rsi
leaq -0x48(%rbp), %rdi
callq 0x5f48
movq -0x48(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x5fc6
leaq -0x80(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movq %r15, %rdx
callq 0xc9d5
leaq -0xd0(%rbp), %rsi
movq %r15, %rdi
callq 0x9466
leaq -0x80(%rbp), %rsi
movq %rax, %rdi
callq 0x4354
leaq -0x78(%rbp), %rdi
callq 0x3e82
leaq -0x30(%rbp), %rdi
callq 0x3e82
testb %r14b, %r14b
je 0x6925
leaq -0x98(%rbp), %rdi
callq 0x3e82
leaq -0x88(%rbp), %rdi
callq 0x3e82
leaq -0x40(%rbp), %rdi
callq 0x3e82
leaq -0xa8(%rbp), %rdi
jmp 0x6929
leaq -0x40(%rbp), %rdi
callq 0x3e82
movq -0x58(%rbp), %rsi
movq %rbx, %rdi
callq 0x5fc6
leaq -0xd0(%rbp), %rdi
callq 0x30f0
leaq -0x50(%rbp), %rdi
callq 0x3e82
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x69a6
movq %rax, %rbx
jmp 0x69b2
movq %rax, %rbx
jmp 0x69be
movq %rax, %rbx
jmp 0x69d0
movq %rax, %rbx
jmp 0x69c7
jmp 0x6a14
jmp 0x6a14
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x3e82
jmp 0x6998
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x3e82
testb %r14b, %r14b
je 0x69d0
leaq -0x98(%rbp), %rdi
callq 0x3e82
leaq -0x88(%rbp), %rdi
callq 0x3e82
leaq -0x40(%rbp), %rdi
callq 0x3e82
leaq -0xa8(%rbp), %rdi
jmp 0x69d4
leaq -0x40(%rbp), %rdi
callq 0x3e82
jmp 0x6a17
jmp 0x6a14
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x30f0
jmp 0x69ee
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
jmp 0x69ff
jmp 0x6a06
jmp 0x6a06
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x3e82
jmp 0x6a23
movq %rax, %rbx
jmp 0x6a23
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
jmp 0x6a27
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x30f0
leaq -0x50(%rbp), %rdi
callq 0x3e82
movq %rbx, %rdi
callq 0x3330