// File: /workspace/github_cpp_makefile_star2_O3/0x0584[P]scmin-plus/src/builtin/builtin.cpp
// Function: builtin::_cond(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::_cond(const sexpr_t& args, env_t& bindings) {
    sexpr_t walk = args;
    sexpr_t curr;

    while (not walk->isnil()) {
        if (not walk->car()->islist()) {
            cerr << "Err: cond clauses need to be a list" << endl;
            return nullptr;
        }
        curr = walk->car();
        if ((curr->car()->issymb() and
             any_cast<sexpr_text>(*curr->car()->blob).text() == "else")
            or not ::eval(curr->car(), bindings)->isnil()) {
            return builtin::_begin(curr->cdr(), bindings);
        }
        walk = walk->cdr();
    }
    return nil();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdx, -0x58(%rbp)
movq %rdi, -0x50(%rbp)
movq (%rsi), %r15
movq 0x8(%rsi), %rax
movq %rax, -0x48(%rbp)
testq %rax, %rax
je 0x8887
movq 0x1170f(%rip), %rax     # 0x19f80
cmpb $0x0, (%rax)
je 0x887f
movq -0x48(%rbp), %rax
incl 0x8(%rax)
jmp 0x8887
movq -0x48(%rbp), %rax
lock
incl 0x8(%rax)
xorl %r14d, %r14d
leaq -0x40(%rbp), %r12
movq %r15, %rdi
callq 0x4c74
testb %al, %al
jne 0x8aad
movq %r12, %rdi
movq %r15, %rsi
callq 0x628e
movq -0x40(%rbp), %rdi
callq 0x4cec
movl %eax, %ebx
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x88c2
callq 0x4104
testb %bl, %bl
je 0x8abb
movq %r12, %rdi
movq %r15, -0x60(%rbp)
movq %r15, %rsi
callq 0x628e
movq -0x40(%rbp), %r13
movq -0x38(%rbp), %r15
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
testq %r14, %r14
leaq -0x70(%rbp), %rbx
je 0x8907
movq %r14, %rdi
callq 0x4104
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x8907
callq 0x4104
leaq -0x40(%rbp), %rdi
movq %r13, %rsi
callq 0x628e
movq -0x40(%rbp), %rdi
callq 0x4ed6
movl %eax, %r14d
testb %al, %al
je 0x89aa
leaq -0x90(%rbp), %rdi
movq %r13, %rsi
callq 0x628e
movq -0x90(%rbp), %rax
movq (%rax), %rdi
callq 0x4696
movq %rax, %rbx
testq %rax, %rax
je 0x8b6c
leaq -0xa8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0xb8(%rbp), %r12
movq %r12, %rdi
callq 0x45ca
movb 0x20(%rbx), %al
movb %al, -0x98(%rbp)
leaq -0xd8(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x389c
movq %rbx, %rdi
leaq 0xab33(%rip), %rsi      # 0x134d0
callq 0x30a0
testl %eax, %eax
leaq -0x70(%rbp), %rbx
je 0x89f6
movq %rbx, %rdi
movq %r13, %rsi
callq 0x628e
leaq -0x80(%rbp), %rdi
movq %rbx, %rsi
movq -0x58(%rbp), %rdx
callq 0xf373
movq -0x80(%rbp), %rdi
callq 0x4c74
movl %eax, %ebx
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x89de
callq 0x4104
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x89ec
callq 0x4104
xorb $0x1, %bl
testb %r14b, %r14b
jne 0x89f8
jmp 0x8a4d
movb $0x1, %bl
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0x8a1a
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x31f0
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0x8a3c
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x31f0
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x8a4d
callq 0x4104
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x8a5b
callq 0x4104
testb %bl, %bl
jne 0x8b0d
leaq -0x40(%rbp), %r12
movq %r12, %rdi
movq -0x60(%rbp), %rsi
callq 0x61be
movq -0x40(%rbp), %r13
movq -0x38(%rbp), %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x8a9e
callq 0x4104
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x8a9e
callq 0x4104
movq %rbx, -0x48(%rbp)
movq %r15, %r14
movq %r13, %r15
jmp 0x888e
movq -0x50(%rbp), %rdi
callq 0x514c
jmp 0x8b3b
movq 0x11526(%rip), %rbx     # 0x19fe8
leaq 0xa9e3(%rip), %rsi      # 0x134ac
movl $0x23, %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 0x114f4(%rip), %rdi     # 0x19fe8
callq 0x3030
movq %rax, %rdi
callq 0x3160
xorps %xmm0, %xmm0
movq -0x50(%rbp), %rax
movups %xmm0, (%rax)
jmp 0x8b3b
leaq -0x40(%rbp), %rdi
movq %r13, %rsi
movq %r15, %r14
callq 0x61be
leaq -0x40(%rbp), %rsi
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rdx
callq 0x86ba
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x8b3b
callq 0x4104
testq %r14, %r14
je 0x8b48
movq %r14, %rdi
callq 0x4104
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x8b56
callq 0x4104
movq -0x50(%rbp), %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4668
jmp 0x8c27
jmp 0x8c20
jmp 0x8c52
movq %rax, %rbx
jmp 0x8be9
jmp 0x8b8f
movq %rax, %rdi
callq 0x4075
movq %rax, %rbx
jmp 0x8c0b
jmp 0x8c27
movq %rax, %rbx
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x8baf
callq 0x4104
jmp 0x8baf
movq %rax, %rbx
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x8bc2
callq 0x4104
jmp 0x8bc2
movq %rax, %rbx
testb %r14b, %r14b
je 0x8c2a
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0x8be9
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x31f0
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0x8c0b
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x31f0
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x8c2a
callq 0x4104
jmp 0x8c2a
jmp 0x8c20
movq %rax, %rbx
jmp 0x8c38
jmp 0x8c52
movq %rax, %rbx
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x8c38
callq 0x4104
movq %r15, %r14
jmp 0x8c55
movq %rax, %rbx
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x8c55
callq 0x4104
jmp 0x8c55
jmp 0x8c52
movq %rax, %rbx
testq %r14, %r14
je 0x8c62
movq %r14, %rdi
callq 0x4104
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x8c70
callq 0x4104
movq %rbx, %rdi
callq 0x3310