// File: /workspace/github_cpp_makefile_star2_O3/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 0xf46b
xorl %ebx, %ebx
callq 0x4cec
testb %al, %al
je 0xf46b
movq (%r12), %rsi
leaq -0x38(%rbp), %rdi
callq 0x628e
leaq -0xd0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movq %r15, %rdx
callq 0xf373
movq -0xd0(%rbp), %r13
movq -0xc8(%rbp), %rbx
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0xf3ee
callq 0x4104
testq %r13, %r13
je 0xf480
movq %r13, %rdi
callq 0x4f7a
testb %al, %al
je 0xf480
movq (%r13), %rsi
leaq -0xd0(%rbp), %rdi
callq 0xab41
leaq -0xd0(%rbp), %rdi
callq 0x3e60
testb %al, %al
je 0xf51f
movq (%r12), %rsi
leaq -0x70(%rbp), %rdi
callq 0x61be
leaq -0x38(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movq %r15, %rdx
callq 0xf174
movq -0x38(%rbp), %r12
movq -0x30(%rbp), %rax
movq %r12, -0x50(%rbp)
movq %rax, -0x48(%rbp)
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0xf53c
callq 0x4104
jmp 0xf53c
xorl %ebx, %ebx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0xd734
jmp 0xf593
movq 0xab61(%rip), %rdi      # 0x19fe8
leaq 0x43a9(%rip), %rsi      # 0x13837
movl $0xe, %edx
callq 0x3210
movq %r13, -0x60(%rbp)
movq %rbx, -0x58(%rbp)
testq %rbx, %rbx
je 0xf4ba
movq 0xaad4(%rip), %rax      # 0x19f80
cmpb $0x0, (%rax)
je 0xf4b6
incl 0x8(%rbx)
jmp 0xf4ba
lock
incl 0x8(%rbx)
movq 0xab27(%rip), %rdi      # 0x19fe8
leaq -0x60(%rbp), %rsi
callq 0xa61c
movq %rax, %r15
leaq 0x4372(%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 0xf516
callq 0x4104
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
jmp 0xf593
movq (%r12), %rsi
leaq -0x38(%rbp), %rdi
callq 0x61be
movq -0x38(%rbp), %r12
movq -0x30(%rbp), %rax
movq %r12, -0x50(%rbp)
movq %rax, -0x48(%rbp)
testq %r12, %r12
je 0xf55e
leaq -0x38(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
leaq -0x50(%rbp), %rdx
movq %r15, %rcx
callq 0x3f10
movups -0x38(%rbp), %xmm0
jmp 0xf561
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
leaq -0xb0(%rbp), %r15
movq %r15, %rdi
callq 0x4004
movq -0x8(%r15), %rdi
testq %rdi, %rdi
je 0xf582
callq 0x4104
movq -0xc8(%rbp), %rdi
testq %rdi, %rdi
je 0xf593
callq 0x4104
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0xf5a1
callq 0x4104
testq %rbx, %rbx
je 0xf5ae
movq %rbx, %rdi
callq 0x4104
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 0xf5df
callq 0x4104
jmp 0xf5df
jmp 0xf5dc
jmp 0xf5dc
jmp 0xf5dc
movq %rax, %r14
leaq -0xd0(%rbp), %rdi
callq 0x5972
jmp 0xf61f
jmp 0xf61c
movq %rax, %r14
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0xf605
callq 0x4104
jmp 0xf605
movq %rax, %r14
xorl %ebx, %ebx
jmp 0xf61f
movq %rax, %r14
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0xf61f
callq 0x4104
jmp 0xf61f
movq %rax, %r14
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0xf62d
callq 0x4104
testq %rbx, %rbx
je 0xf63a
movq %rbx, %rdi
callq 0x4104
movq %r14, %rdi
callq 0x3310
nop