// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r13
movq (%rsi), %rdi
callq 0x4fb6
cmpq $0x1, %rax
ja 0x98be
movq 0x10772(%rip), %rbx     # 0x19fe8
leaq 0x9c58(%rip), %rsi      # 0x134d5
movl $0x25, %edx
movq %rbx, %rdi
callq 0x3210
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3160
xorps %xmm0, %xmm0
movups %xmm0, (%r13)
jmp 0x9cde
xorl %eax, %eax
leaq -0x128(%rbp), %rdi
movq %rax, (%rdi)
movq 0x8(%rbx), %rcx
movq %rcx, 0x8(%rdi)
movq %rax, 0x10(%rdi)
movq 0x18(%rbx), %rcx
movq %rcx, 0x18(%rdi)
movups 0x20(%rbx), %xmm0
movups %xmm0, 0x20(%rdi)
movq %rax, 0x30(%rdi)
leaq -0xf0(%rbp), %rdx
movq %rdi, (%rdx)
movq %rbx, %rsi
callq 0x5bc0
movq %r14, -0xa8(%rbp)
movq (%r14), %rsi
leaq -0x70(%rbp), %rdi
callq 0x628e
leaq -0xc0(%rbp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
leaq -0x50(%rbp), %r15
xorl %ebx, %ebx
leaq -0x60(%rbp), %r14
movq $0x0, -0x30(%rbp)
movq -0x70(%rbp), %rdi
callq 0x4c74
testb %al, %al
jne 0x9c22
movq -0x70(%rbp), %rsi
movq %r14, %rdi
callq 0x628e
movq -0x60(%rbp), %r12
movq -0x58(%rbp), %rax
movq %rax, -0x30(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
testq %rbx, %rbx
je 0x9991
movq %rbx, %rdi
callq 0x4104
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x9991
callq 0x4104
movq %r12, %rdi
callq 0x4cec
testb %al, %al
je 0x9bd7
movq %r12, %rdi
callq 0x4fb6
cmpq $0x2, %rax
jne 0x9bd7
movq %r14, %rdi
movq %r12, %rsi
callq 0x628e
movq -0x60(%rbp), %rdi
callq 0x4ed6
movl %eax, %ebx
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x99d7
callq 0x4104
testb %bl, %bl
je 0x9c5c
leaq -0x80(%rbp), %rdi
movq %r12, %rsi
callq 0x628e
movq -0x80(%rbp), %rax
movq (%rax), %rdi
callq 0x4696
movq %rax, %rbx
testq %rax, %rax
je 0x9cf3
movq %r15, -0x60(%rbp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x45ca
movb 0x20(%rbx), %al
movb %al, -0x40(%rbp)
leaq -0xa0(%rbp), %rdi
movq %r14, %rsi
callq 0x389c
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
leaq -0x80(%rbp), %rbx
je 0x9a47
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x31f0
movq %r13, %r14
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x9a58
callq 0x4104
leaq -0xf0(%rbp), %rdi
movq %rdi, -0x60(%rbp)
leaq -0xa0(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0xafec
leaq -0x128(%rbp), %r13
movl %edx, %r15d
testb $0x1, %dl
je 0x9b45
leaq -0xb8(%rbp), %rdi
movq %r12, %rsi
callq 0x61be
movq -0xb8(%rbp), %rsi
movq %rbx, %rdi
callq 0x628e
leaq -0x60(%rbp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0xf373
movq %r13, %rdi
leaq -0xa0(%rbp), %rsi
callq 0xadda
movaps -0x60(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x60(%rbp)
movq 0x8(%rax), %rdi
movups %xmm0, (%rax)
testq %rdi, %rdi
je 0x9ade
callq 0x4104
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x9aec
callq 0x4104
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x9afa
callq 0x4104
movq -0xb0(%rbp), %rdi
testq %rdi, %rdi
je 0x9b0b
callq 0x4104
movq -0x70(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x61be
movaps -0x60(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x60(%rbp)
movq -0x68(%rbp), %rdi
movups %xmm0, -0x70(%rbp)
testq %rdi, %rdi
je 0x9b97
callq 0x4104
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x9b97
callq 0x4104
jmp 0x9b97
movl $0x1d, %edx
movq 0x10497(%rip), %rdi     # 0x19fe8
leaq 0x99f7(%rip), %rsi      # 0x1354f
callq 0x3210
movq 0x10484(%rip), %rcx     # 0x19fe8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq 0x10466(%rip), %rdi     # 0x19fe8
callq 0x3030
movq %rax, %rdi
callq 0x3160
movq %r14, %rdi
callq 0x514c
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x9bb9
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x31f0
movq -0x30(%rbp), %rbx
testb $0x1, %r15b
movq %r14, %r13
leaq -0x50(%rbp), %r15
leaq -0x60(%rbp), %r14
jne 0x9946
jmp 0x9caa
movq 0x1040a(%rip), %rbx     # 0x19fe8
leaq 0x9930(%rip), %rsi      # 0x13515
movl $0x1f, %edx
movq %rbx, %rdi
callq 0x3210
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq 0x103d8(%rip), %rdi     # 0x19fe8
callq 0x3030
movq %rax, %rdi
callq 0x3160
jmp 0x9ca2
movq -0xa8(%rbp), %rax
movq (%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x61be
leaq -0x60(%rbp), %rsi
leaq -0x128(%rbp), %rdx
movq %r13, %rdi
callq 0x86ba
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x9c56
callq 0x4104
movq %rbx, -0x30(%rbp)
jmp 0x9caa
movq 0x10385(%rip), %rbx     # 0x19fe8
leaq 0x98cb(%rip), %rsi      # 0x13535
movl $0x19, %edx
movq %rbx, %rdi
callq 0x3210
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq 0x10353(%rip), %rdi     # 0x19fe8
callq 0x3030
movq %rax, %rdi
callq 0x3160
xorps %xmm0, %xmm0
movups %xmm0, (%r13)
leaq -0xf0(%rbp), %rdi
callq 0xace0
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x9cc4
callq 0x4104
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x9cd2
callq 0x4104
leaq -0x128(%rbp), %rdi
callq 0x4004
movq %r13, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4668
movq %rax, %r14
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x9db3
callq 0x4104
jmp 0x9db3
jmp 0x9db0
movq %rax, %r14
jmp 0x9e0d
jmp 0x9de0
movq %rax, %r14
jmp 0x9d49
movq %rax, %r14
jmp 0x9d57
jmp 0x9db9
jmp 0x9db9
movq %rax, %r14
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x9d49
callq 0x4104
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x9d57
callq 0x4104
movq -0xb0(%rbp), %rdi
testq %rdi, %rdi
je 0x9dbc
callq 0x4104
jmp 0x9dbc
jmp 0x9d76
jmp 0x9db9
movq %rax, %rdi
callq 0x4075
movq %rax, %r14
jmp 0x9d93
movq %rax, %r14
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0x9d93
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x31f0
movq -0x78(%rbp), %rdi
jmp 0x9da2
jmp 0x9de0
movq %rax, %r14
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x9de3
callq 0x4104
jmp 0x9de3
jmp 0x9de0
movq %rax, %r14
movq %rbx, -0x30(%rbp)
jmp 0x9de3
movq %rax, %r14
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x9de3
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x31f0
jmp 0x9de3
movq %rax, %r14
leaq -0xf0(%rbp), %rdi
callq 0xace0
cmpq $0x0, -0x30(%rbp)
je 0x9dff
movq -0x30(%rbp), %rdi
callq 0x4104
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x9e0d
callq 0x4104
leaq -0x128(%rbp), %rdi
callq 0x4004
movq %r14, %rdi
callq 0x3310
nop