// File: /workspace/github_cpp_makefile_star2_O1/0x0584[P]scmin-plus/src/repl/eval.cpp
// Function: eval(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 eval(const sexpr_t& expr, env_t& parent) {
    sexpr_t op, args, res;

    if (not (expr and expr->islist()))
        return sexpr::resolve(expr, parent);
    op = eval(expr->car(), parent);
    if (not op or not op->islambda()) {
        cerr << "Err: operator " << op << " is not a lambda" << endl;
        return nullptr;
    }
    auto lamb = any_cast<sexpr::sexpr_lambda>(*op->blob);
    if (not lamb.require_evaled_args()) args = expr->cdr();
    else args = eval_args(expr->cdr(), parent);
    if (not args) return nullptr;
    res = lamb.eval(args, parent);
    return res;
}

// 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, %r14
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq (%rsi), %rdi
testq %rdi, %rdi
je 0xfa01
xorl %ebx, %ebx
callq 0x4cf4
testb %al, %al
je 0xfa01
movq (%r12), %rsi
leaq -0x40(%rbp), %rdi
callq 0x634a
leaq -0xd0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movq %r15, %rdx
callq 0xf8dd
movq -0xd0(%rbp), %r13
movq -0xc8(%rbp), %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0xd0(%rbp)
movq -0xc8(%rbp), %rdi
testq %rdi, %rdi
je 0xf965
callq 0x4114
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0xf973
callq 0x4114
testq %r13, %r13
je 0xfa16
movq %r13, %rdi
callq 0x4fb8
testb %al, %al
je 0xfa16
movq (%r13), %rsi
leaq -0xd0(%rbp), %rdi
callq 0xae15
leaq -0xd0(%rbp), %rdi
callq 0x3e70
testb %al, %al
je 0xfab8
movq (%r12), %rsi
leaq -0x70(%rbp), %rdi
callq 0x627a
leaq -0x40(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movq %r15, %rdx
callq 0xf6de
movaps -0x40(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x40(%rbp)
movq -0x48(%rbp), %rdi
movaps %xmm0, -0x50(%rbp)
testq %rdi, %rdi
je 0xf9ea
callq 0x4114
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0xf9f8
callq 0x4114
movq -0x68(%rbp), %rdi
jmp 0xfae6
xorl %ebx, %ebx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0xdc9c
jmp 0xfb69
movq 0xa5cb(%rip), %rdi      # 0x19fe8
leaq 0x3e13(%rip), %rsi      # 0x13837
movl $0xe, %edx
callq 0x3210
movq %r13, -0x60(%rbp)
movq %rbx, -0x58(%rbp)
testq %rbx, %rbx
je 0xfa50
movq 0xa53e(%rip), %rax      # 0x19f80
cmpb $0x0, (%rax)
je 0xfa4c
incl 0x8(%rbx)
jmp 0xfa50
lock
incl 0x8(%rbx)
movq 0xa591(%rip), %rdi      # 0x19fe8
leaq -0x60(%rbp), %rsi
callq 0xa8f0
movq %rax, %r15
leaq 0x3ddc(%rip), %rsi      # 0x13846
movl $0x10, %edx
movq %rax, %rdi
callq 0x3210
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq %r15, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3160
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0xfaac
callq 0x4114
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
jmp 0xfb69
movq (%r12), %rsi
leaq -0x40(%rbp), %rdi
callq 0x627a
movaps -0x40(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x40(%rbp)
movq -0x48(%rbp), %rdi
movaps %xmm0, -0x50(%rbp)
testq %rdi, %rdi
je 0xfae2
callq 0x4114
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0xfaf0
callq 0x4114
cmpq $0x0, -0x50(%rbp)
je 0xfb34
leaq -0x40(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
leaq -0x50(%rbp), %rdx
movq %r15, %rcx
callq 0x3f20
movq -0x40(%rbp), %r15
movq -0x38(%rbp), %r12
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0xfb2b
callq 0x4114
movq %r15, (%r14)
movq %r12, 0x8(%r14)
jmp 0xfb3b
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
leaq -0xb0(%rbp), %r15
movq %r15, %rdi
callq 0x4014
movq -0x8(%r15), %rdi
testq %rdi, %rdi
je 0xfb58
callq 0x4114
movq -0xc8(%rbp), %rdi
testq %rdi, %rdi
je 0xfb69
callq 0x4114
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0xfb77
callq 0x4114
testq %rbx, %rbx
je 0xfb84
movq %rbx, %rdi
callq 0x4114
movq %r14, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0xfbb5
callq 0x4114
jmp 0xfbb5
jmp 0xfbb2
jmp 0xfbb2
jmp 0xfbb2
movq %rax, %r14
leaq -0xd0(%rbp), %rdi
callq 0x5a14
jmp 0xfbf5
jmp 0xfbf2
movq %rax, %r14
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0xfbdb
callq 0x4114
jmp 0xfbdb
movq %rax, %r14
xorl %ebx, %ebx
jmp 0xfbf5
movq %rax, %r14
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0xfbf5
callq 0x4114
jmp 0xfbf5
movq %rax, %r14
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0xfc03
callq 0x4114
testq %rbx, %rbx
je 0xfc10
movq %rbx, %rdi
callq 0x4114
movq %r14, %rdi
callq 0x3310