// File: 0x0584[P]scmin-plus/src/builtin/builtin.cpp
// Function: builtin::_let_astrk(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::_let_astrk(const sexpr_t& args, env_t& bindings) {
    if (args->length() < 2) {
        cerr << "Err: let requires an env and sexpr(s)" << endl;
        return nullptr;
    }

    env_t local = bindings;
    sexpr_t walk = args->car(), curr;
    unordered_set<string> seen;

    while (not walk->isnil()) {
        curr = walk->car();
        if (not curr->islist() or curr->length() != 2) {
            cerr << "Err: let bound is mal formatted" << endl;
            return nullptr;
        }
        if (not curr->car()->issymb()) {
            cerr << "Err: cannot bind constant" << endl;
            return nullptr;
        }
        auto sy = any_cast<sexpr_text>(*curr->car()->blob).text();
        if (not seen.insert(sy).second) {
            cerr << "Err: variable appeared twice!" << endl;
            return nil();
        }
        local[sy] = ::eval(curr->cdr()->car(), local);
        walk = walk->cdr();
    }
    return builtin::_begin(args->cdr(), local);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x220, %rsp            # imm = 0x220
movq %rdi, -0x1b8(%rbp)
movq %rdi, %rax
movq %rax, -0x1b0(%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
jae 0xfc36
movq 0x1e3ea(%rip), %rdi     # 0x2dff0
leaq 0x118aa(%rip), %rsi     # 0x214b7
callq 0x32c0
movq %rax, %rdi
movq 0x1e374(%rip), %rsi     # 0x2df90
callq 0x32f0
movq -0x1b8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4570
jmp 0x101f9
movq -0x18(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0xa1d0
movq -0x10(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x60(%rbp), %rdi
callq 0xb520
jmp 0xfc5a
leaq -0x80(%rbp), %rdi
callq 0x6ef0
leaq -0xb8(%rbp), %rdi
callq 0x10ec0
leaq -0x60(%rbp), %rdi
callq 0x4400
movq %rax, %rdi
callq 0x7270
movb %al, -0x1b9(%rbp)
jmp 0xfc88
movb -0x1b9(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xfc99
jmp 0x10142
leaq -0x60(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0xc8(%rbp), %rdi
callq 0xb520
jmp 0xfcb3
leaq -0x80(%rbp), %rdi
movq %rdi, -0x1c8(%rbp)
leaq -0xc8(%rbp), %rsi
movq %rsi, -0x1d0(%rbp)
callq 0x4420
movq -0x1d0(%rbp), %rdi
callq 0x4450
movq -0x1c8(%rbp), %rdi
callq 0x4400
movq %rax, %rdi
callq 0x72f0
movb %al, -0x1ba(%rbp)
jmp 0xfcf9
movb -0x1ba(%rbp), %al
testb $0x1, %al
jne 0xfd05
jmp 0xfd2c
leaq -0x80(%rbp), %rdi
callq 0x4400
movq %rax, %rdi
callq 0x75d0
movq %rax, -0x1d8(%rbp)
jmp 0xfd1f
movq -0x1d8(%rbp), %rax
cmpq $0x2, %rax
je 0xfd9e
movq 0x1e2bd(%rip), %rdi     # 0x2dff0
leaq 0x117bd(%rip), %rsi     # 0x214f7
callq 0x32c0
movq %rax, -0x1e0(%rbp)
jmp 0xfd48
movq -0x1e0(%rbp), %rdi
movq 0x1e23a(%rip), %rsi     # 0x2df90
callq 0x32f0
jmp 0xfd5d
movq -0x1b8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4570
movl $0x1, -0xcc(%rbp)
jmp 0x101a7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x101ee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x101d0
leaq -0x80(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0xe0(%rbp), %rdi
callq 0xb520
jmp 0xfdb8
leaq -0xe0(%rbp), %rdi
callq 0x4400
movq %rax, %rdi
callq 0x7500
movb %al, -0x1e1(%rbp)
jmp 0xfdd4
movb -0x1e1(%rbp), %al
xorb $-0x1, %al
movb %al, -0x1e2(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x4450
movb -0x1e2(%rbp), %al
testb $0x1, %al
jne 0xfdfa
jmp 0xfe67
movq 0x1e1ef(%rip), %rdi     # 0x2dff0
leaq 0x1170f(%rip), %rsi     # 0x21517
callq 0x32c0
movq %rax, -0x1f0(%rbp)
jmp 0xfe16
movq -0x1f0(%rbp), %rdi
movq 0x1e16c(%rip), %rsi     # 0x2df90
callq 0x32f0
jmp 0xfe2b
movq -0x1b8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4570
movl $0x1, -0xcc(%rbp)
jmp 0x101a7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x4450
jmp 0x101d0
leaq -0x80(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x138(%rbp), %rdi
callq 0xb520
jmp 0xfe81
leaq -0x138(%rbp), %rdi
callq 0x4400
movq %rax, %rdi
callq 0x4520
movq %rax, -0x1f8(%rbp)
jmp 0xfe9e
movq -0x1f8(%rbp), %rsi
leaq -0x128(%rbp), %rdi
callq 0x44d0
jmp 0xfeb3
leaq -0x100(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x3a60
jmp 0xfec8
leaq -0x128(%rbp), %rdi
callq 0x4550
leaq -0x138(%rbp), %rdi
callq 0x4450
leaq -0xb8(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x10ee0
movb %dl, -0x201(%rbp)
movq %rax, -0x200(%rbp)
jmp 0xff02
movb -0x201(%rbp), %al
movq -0x200(%rbp), %rcx
movq %rcx, -0x158(%rbp)
movb %al, -0x150(%rbp)
movq -0x158(%rbp), %rax
movq %rax, -0x148(%rbp)
movb -0x150(%rbp), %al
movb %al, -0x140(%rbp)
movb -0x140(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xff47
jmp 0xffdd
movq 0x1e0a2(%rip), %rdi     # 0x2dff0
leaq 0x115dc(%rip), %rsi     # 0x21531
callq 0x32c0
movq %rax, -0x210(%rbp)
jmp 0xff63
movq -0x210(%rbp), %rdi
movq 0x1e01f(%rip), %rsi     # 0x2df90
callq 0x32f0
jmp 0xff78
movq -0x1b8(%rbp), %rdi
callq 0x78f0
jmp 0xff86
movl $0x1, -0xcc(%rbp)
jmp 0x100c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0xffbb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x4550
leaq -0x138(%rbp), %rdi
callq 0x4450
jmp 0x101d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x10131
leaq -0x80(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x188(%rbp), %rdi
callq 0xb440
jmp 0xfff7
leaq -0x188(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x178(%rbp), %rdi
callq 0xb520
jmp 0x10014
leaq -0x168(%rbp), %rdi
leaq -0x178(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x19aa0
jmp 0x1002d
leaq -0x50(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x10b60
movq %rax, -0x218(%rbp)
jmp 0x10046
movq -0x218(%rbp), %rdi
leaq -0x168(%rbp), %rsi
movq %rsi, -0x220(%rbp)
callq 0x4420
movq -0x220(%rbp), %rdi
callq 0x4450
leaq -0x178(%rbp), %rdi
callq 0x4450
leaq -0x188(%rbp), %rdi
callq 0x4450
leaq -0x60(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x198(%rbp), %rdi
callq 0xb440
jmp 0x1009e
leaq -0x60(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x4420
leaq -0x198(%rbp), %rdi
callq 0x4450
movl $0x0, -0xcc(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x31d0
movl -0xcc(%rbp), %eax
testl %eax, %eax
jne 0x101a7
jmp 0x100e0
jmp 0xfc6f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x10125
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x10119
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x4450
leaq -0x178(%rbp), %rdi
callq 0x4450
leaq -0x188(%rbp), %rdi
callq 0x4450
leaq -0x100(%rbp), %rdi
callq 0x31d0
jmp 0x101d0
movq -0x10(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x1a8(%rbp), %rdi
callq 0xb440
jmp 0x1015c
movq -0x1b8(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0xe780
jmp 0x10175
leaq -0x1a8(%rbp), %rdi
callq 0x4450
movl $0x1, -0xcc(%rbp)
jmp 0x101a7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x4450
jmp 0x101d0
leaq -0xb8(%rbp), %rdi
callq 0x10f20
leaq -0x80(%rbp), %rdi
callq 0x4450
leaq -0x60(%rbp), %rdi
callq 0x4450
leaq -0x50(%rbp), %rdi
callq 0x4250
jmp 0x101f9
leaq -0xb8(%rbp), %rdi
callq 0x10f20
leaq -0x80(%rbp), %rdi
callq 0x4450
leaq -0x60(%rbp), %rdi
callq 0x4450
leaq -0x50(%rbp), %rdi
callq 0x4250
jmp 0x10209
movq -0x1b0(%rbp), %rax
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x34f0
nopw %cs:(%rax,%rax)