// File: 0x0584[P]scmin-plus/src/builtin/builtin.cpp
// Function: builtin::_set(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::_set(const sexpr_t& args, env_t& bindings) {
    if (args->length() != 2) {
        cerr << "Err: expecting two arguments!" << endl;
        return nil();
    }
    if (not args->car()->issymb()) {
        cerr << "Err: cannot set constant values!" << endl;
        return nil();
    }
    auto itr = bindings.find(any_cast<sexpr_text>(*args->car()->blob).text());
    if (itr == end(bindings)) {
        cerr << "Err: symbol is not defined, use define instead" << endl;
        return nil();
    }
    itr->second = ::eval(args->cdr()->car(), bindings);
    return itr->second;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0xe0(%rbp)
movq %rdi, %rax
movq %rax, -0xd8(%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 0xdc62
movq 0x203ba(%rip), %rdi     # 0x2dff0
leaq 0x1372f(%rip), %rsi     # 0x2136c
callq 0x32c0
movq %rax, %rdi
movq 0x20344(%rip), %rsi     # 0x2df90
callq 0x32f0
movq -0xe0(%rbp), %rdi
callq 0x78f0
jmp 0xdf4e
movq -0x10(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x28(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0xb520
movq -0xf0(%rbp), %rdi
callq 0x4400
movq %rax, %rdi
callq 0x7500
movb %al, -0xe1(%rbp)
jmp 0xdc9a
movb -0xe1(%rbp), %al
xorb $-0x1, %al
movb %al, -0xf1(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x4450
movb -0xf1(%rbp), %al
testb $0x1, %al
jne 0xdcbd
jmp 0xdd0a
movq 0x2032c(%rip), %rdi     # 0x2dff0
leaq 0x136bf(%rip), %rsi     # 0x2138a
callq 0x32c0
movq %rax, %rdi
movq 0x202b6(%rip), %rsi     # 0x2df90
callq 0x32f0
movq -0xe0(%rbp), %rdi
callq 0x78f0
jmp 0xdf4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x4450
jmp 0xdf5e
movq -0x18(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x98(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0xb520
movq -0x108(%rbp), %rdi
callq 0x4400
movq %rax, %rdi
callq 0x4520
movq %rax, -0x100(%rbp)
jmp 0xdd51
movq -0x100(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x44d0
jmp 0xdd66
leaq -0x60(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3a60
jmp 0xdd78
movq -0x110(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x10b00
movq %rax, -0x118(%rbp)
jmp 0xdd91
movq -0x118(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x31d0
leaq -0x88(%rbp), %rdi
callq 0x4550
leaq -0x98(%rbp), %rdi
callq 0x4450
movq -0x18(%rbp), %rdi
callq 0x10b30
movq %rax, -0xa0(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x10e50
testb $0x1, %al
jne 0xdde6
jmp 0xde67
movq 0x20203(%rip), %rdi     # 0x2dff0
leaq 0x135b7(%rip), %rsi     # 0x213ab
callq 0x32c0
movq %rax, %rdi
movq 0x2018d(%rip), %rsi     # 0x2df90
callq 0x32f0
movq -0xe0(%rbp), %rdi
callq 0x78f0
jmp 0xdf4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0xde56
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0xde4a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x31d0
leaq -0x88(%rbp), %rdi
callq 0x4550
leaq -0x98(%rbp), %rdi
callq 0x4450
jmp 0xdf5e
movq -0x10(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0xd0(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0xb440
movq -0x120(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0xc0(%rbp), %rdi
callq 0xb520
jmp 0xdea3
movq -0x18(%rbp), %rdx
leaq -0xb0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x19aa0
jmp 0xdebc
leaq -0x40(%rbp), %rdi
callq 0x66f0
movq %rax, %rdi
addq $0x20, %rdi
leaq -0xb0(%rbp), %rsi
callq 0x4420
leaq -0xb0(%rbp), %rdi
callq 0x4450
leaq -0xc0(%rbp), %rdi
callq 0x4450
leaq -0xd0(%rbp), %rdi
callq 0x4450
leaq -0x40(%rbp), %rdi
callq 0x66f0
movq -0xe0(%rbp), %rdi
movq %rax, %rsi
addq $0x20, %rsi
callq 0x43d0
jmp 0xdf4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0xdf40
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x4450
leaq -0xd0(%rbp), %rdi
callq 0x4450
jmp 0xdf5e
movq -0xd8(%rbp), %rax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x34f0
nopw (%rax,%rax)