// File: 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
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x168(%rbp)
movq %rdi, %rax
movq %rax, -0x160(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4400
movq %rax, %rdi
callq 0x75d0
cmpq $0x2, %rax
je 0xc516
movq 0x21b0a(%rip), %rdi     # 0x2dff0
leaq 0x14d86(%rip), %rsi     # 0x21273
callq 0x32c0
movq %rax, %rdi
movq 0x21a94(%rip), %rsi     # 0x2df90
callq 0x32f0
movq -0x168(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4570
jmp 0xcb1f
movq -0x10(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x30(%rbp), %rdi
movq %rdi, -0x178(%rbp)
callq 0xb520
movq -0x178(%rbp), %rdi
callq 0x4400
movq %rax, %rdi
callq 0x72f0
movb %al, -0x169(%rbp)
jmp 0xc54e
leaq -0x30(%rbp), %rdi
callq 0x4450
movb -0x169(%rbp), %al
andb $0x1, %al
movb %al, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
je 0xc57f
movq -0x10(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x50(%rbp), %rdi
callq 0xb520
jmp 0xc58c
movq -0x10(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x43d0
leaq -0x50(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x60(%rbp), %rdi
callq 0xb520
jmp 0xc5a3
leaq -0x60(%rbp), %rdi
callq 0x4400
movq %rax, %rdi
callq 0x7500
movb %al, -0x179(%rbp)
jmp 0xc5bc
movb -0x179(%rbp), %al
xorb $-0x1, %al
movb %al, -0x17a(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x4450
movb -0x17a(%rbp), %al
testb $0x1, %al
jne 0xc5e2
jmp 0xc674
movq 0x21a07(%rip), %rdi     # 0x2dff0
leaq 0x14ca5(%rip), %rsi     # 0x21295
callq 0x32c0
movq %rax, -0x188(%rbp)
jmp 0xc5fe
movq -0x188(%rbp), %rdi
movq 0x21984(%rip), %rsi     # 0x2df90
callq 0x32f0
jmp 0xc613
movq -0x168(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4570
movl $0x1, -0x64(%rbp)
jmp 0xcb09
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x4450
jmp 0xcb2f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xcb14
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x4450
jmp 0xcb14
leaq -0x50(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0xc0(%rbp), %rdi
callq 0xb520
jmp 0xc68e
leaq -0xc0(%rbp), %rdi
callq 0x4400
movq %rax, %rdi
callq 0x4520
movq %rax, -0x190(%rbp)
jmp 0xc6ab
movq -0x190(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
callq 0x44d0
jmp 0xc6c0
leaq -0x88(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x3a60
jmp 0xc6d5
leaq -0xb0(%rbp), %rdi
callq 0x4550
leaq -0xc0(%rbp), %rdi
callq 0x4450
movq -0x18(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x10b00
movq %rax, -0x198(%rbp)
jmp 0xc706
movq -0x198(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x18(%rbp), %rdi
callq 0x10b30
movq %rax, -0x1a0(%rbp)
jmp 0xc726
movq -0x1a0(%rbp), %rax
movq %rax, -0xd0(%rbp)
leaq -0xc8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x10ad0
testb $0x1, %al
jne 0xc750
jmp 0xc7e3
movq 0x21899(%rip), %rdi     # 0x2dff0
leaq 0x14b54(%rip), %rsi     # 0x212b2
callq 0x32c0
movq %rax, -0x1a8(%rbp)
jmp 0xc76c
movq -0x1a8(%rbp), %rdi
movq 0x21816(%rip), %rsi     # 0x2df90
callq 0x32f0
jmp 0xc781
movq -0x168(%rbp), %rdi
callq 0x78f0
jmp 0xc78f
movl $0x1, -0x64(%rbp)
jmp 0xcaed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xc7c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x4550
leaq -0xc0(%rbp), %rdi
callq 0x4450
jmp 0xcb14
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xcafb
movb -0x19(%rbp), %al
movb $0x0, -0x111(%rbp)
movb $0x0, -0x112(%rbp)
movb $0x0, -0x139(%rbp)
movb $0x0, -0x13a(%rbp)
movb $0x0, -0x151(%rbp)
testb $0x1, %al
je 0xc8b9
movq -0x10(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x110(%rbp), %rdi
callq 0xb520
jmp 0xc82b
movb $0x1, -0x111(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x100(%rbp), %rdi
callq 0xb440
jmp 0xc84f
movb $0x1, -0x112(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x138(%rbp), %rdi
callq 0xb440
jmp 0xc870
movb $0x1, -0x139(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x128(%rbp), %rdi
callq 0xb520
jmp 0xc894
movb $0x1, -0x13a(%rbp)
leaq -0xf0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
leaq -0x128(%rbp), %rdx
callq 0x79c0
jmp 0xc8b7
jmp 0xc8f9
movq -0x10(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x150(%rbp), %rdi
callq 0xb440
jmp 0xc8d3
movb $0x1, -0x151(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0xf0(%rbp), %rdi
callq 0xb520
jmp 0xc8f7
jmp 0xc8f9
movq -0x18(%rbp), %rdx
leaq -0xe0(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x19aa0
jmp 0xc912
movq -0x18(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x10b60
movq %rax, -0x1b0(%rbp)
jmp 0xc92b
movq -0x1b0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x4420
leaq -0xe0(%rbp), %rdi
callq 0x4450
leaq -0xf0(%rbp), %rdi
callq 0x4450
testb $0x1, -0x151(%rbp)
jne 0xc961
jmp 0xc96d
leaq -0x150(%rbp), %rdi
callq 0x4450
testb $0x1, -0x13a(%rbp)
jne 0xc978
jmp 0xc984
leaq -0x128(%rbp), %rdi
callq 0x4450
testb $0x1, -0x139(%rbp)
jne 0xc98f
jmp 0xc99b
leaq -0x138(%rbp), %rdi
callq 0x4450
testb $0x1, -0x112(%rbp)
jne 0xc9a6
jmp 0xc9b2
leaq -0x100(%rbp), %rdi
callq 0x4450
testb $0x1, -0x111(%rbp)
jne 0xc9bd
jmp 0xc9c9
leaq -0x110(%rbp), %rdi
callq 0x4450
leaq -0x50(%rbp), %rdi
callq 0x4400
movq -0x168(%rbp), %rdi
movq %rax, %rsi
callq 0xb520
jmp 0xc9e3
movl $0x1, -0x64(%rbp)
jmp 0xcaed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xcad4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xcabb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xcaa2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xca89
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xca70
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xca64
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x4450
leaq -0xf0(%rbp), %rdi
callq 0x4450
testb $0x1, -0x151(%rbp)
jne 0xca7b
jmp 0xca87
leaq -0x150(%rbp), %rdi
callq 0x4450
jmp 0xca89
testb $0x1, -0x13a(%rbp)
jne 0xca94
jmp 0xcaa0
leaq -0x128(%rbp), %rdi
callq 0x4450
jmp 0xcaa2
testb $0x1, -0x139(%rbp)
jne 0xcaad
jmp 0xcab9
leaq -0x138(%rbp), %rdi
callq 0x4450
jmp 0xcabb
testb $0x1, -0x112(%rbp)
jne 0xcac6
jmp 0xcad2
leaq -0x100(%rbp), %rdi
callq 0x4450
jmp 0xcad4
testb $0x1, -0x111(%rbp)
jne 0xcadf
jmp 0xcaeb
leaq -0x110(%rbp), %rdi
callq 0x4450
jmp 0xcafb
leaq -0x88(%rbp), %rdi
callq 0x31d0
jmp 0xcb09
leaq -0x88(%rbp), %rdi
callq 0x31d0
jmp 0xcb14
leaq -0x50(%rbp), %rdi
callq 0x4450
jmp 0xcb1f
leaq -0x50(%rbp), %rdi
callq 0x4450
jmp 0xcb2f
movq -0x160(%rbp), %rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x34f0
nopl (%rax,%rax)