// File: /workspace/github_cpp_makefile_star2_O1/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, -0x60(%rbp)
movq %rdi, -0x50(%rbp)
movq (%rsi), %r15
movq 0x8(%rsi), %r14
testq %r14, %r14
je 0x8ad3
movq 0x114bd(%rip), %rax     # 0x19f80
cmpb $0x0, (%rax)
je 0x8ace
incl 0x8(%r14)
jmp 0x8ad3
lock
incl 0x8(%r14)
xorl %r12d, %r12d
movq %r15, %rdi
movq %r14, -0x58(%rbp)
callq 0x4c7c
testb %al, %al
jne 0x8d1d
leaq -0x40(%rbp), %rdi
movq %r15, %rsi
callq 0x634a
movq -0x40(%rbp), %rdi
callq 0x4cf4
movl %eax, %ebx
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x8b0f
callq 0x4114
testb %bl, %bl
je 0x8d2b
leaq -0x40(%rbp), %rdi
movq %r15, %rsi
callq 0x634a
movq -0x40(%rbp), %r14
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
testq %r12, %r12
leaq -0x70(%rbp), %rbx
je 0x8b47
movq %r12, %rdi
callq 0x4114
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x8b55
callq 0x4114
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
callq 0x634a
movq -0x40(%rbp), %rdi
callq 0x4ef8
movl %eax, %r13d
testb %al, %al
je 0x8c09
leaq -0x90(%rbp), %rdi
movq %r14, %r12
movq %r14, %rsi
callq 0x634a
movq -0x90(%rbp), %rax
movq (%rax), %rdi
callq 0x4695
movq %rax, %r14
testq %rax, %rax
je 0x8de0
movq %r15, %rbx
leaq -0xa8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0xb8(%rbp), %r15
movq %r15, %rdi
callq 0x45ce
movb 0x20(%r14), %al
movb %al, -0x98(%rbp)
leaq -0xd8(%rbp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x38ac
movq %r14, %rdi
leaq 0xa8de(%rip), %rsi      # 0x134d0
callq 0x30a0
testl %eax, %eax
movq %rbx, %r15
leaq -0x70(%rbp), %rbx
movq %r12, %r14
je 0x8d10
movq %rbx, %rdi
movq %r14, %rsi
callq 0x634a
movq %r14, %r12
leaq -0x80(%rbp), %rdi
movq %rbx, %rsi
movq -0x60(%rbp), %rdx
callq 0xf8dd
movq -0x80(%rbp), %rdi
callq 0x4c7c
movl %eax, %r14d
xorb $0x1, %r14b
movb $0x1, %al
testb %al, %al
je 0x8c59
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x8c4b
callq 0x4114
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x8c59
callq 0x4114
testb %r13b, %r13b
je 0x8cb3
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0x8c80
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x31f0
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0x8ca2
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x31f0
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x8cb3
callq 0x4114
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x8cc1
callq 0x4114
testb %r14b, %r14b
jne 0x8d7d
leaq -0x40(%rbp), %rdi
movq %r15, %rsi
movq -0x58(%rbp), %r14
callq 0x627a
movq -0x40(%rbp), %r15
movq -0x38(%rbp), %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
testq %r14, %r14
je 0x8cf6
movq %r14, %rdi
callq 0x4114
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x8d04
callq 0x4114
movq %rbx, %r14
movq -0x48(%rbp), %r12
jmp 0x8ad6
movb $0x1, %r13b
xorl %eax, %eax
movb $0x1, %r14b
jmp 0x8c39
movq -0x50(%rbp), %rdi
callq 0x51b8
jmp 0x8db0
movq 0x112b6(%rip), %rbx     # 0x19fe8
leaq 0xa773(%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 0x11284(%rip), %rdi     # 0x19fe8
callq 0x3030
movq %rax, %rdi
callq 0x3160
xorps %xmm0, %xmm0
movq -0x50(%rbp), %rax
movups %xmm0, (%rax)
jmp 0x8db0
leaq -0x40(%rbp), %rdi
movq %r12, %rsi
movq -0x58(%rbp), %r14
callq 0x627a
leaq -0x40(%rbp), %rsi
movq -0x50(%rbp), %rdi
movq -0x60(%rbp), %rdx
callq 0x8902
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x8dac
callq 0x4114
movq -0x48(%rbp), %r12
testq %r12, %r12
je 0x8dbd
movq %r12, %rdi
callq 0x4114
testq %r14, %r14
je 0x8dca
movq %r14, %rdi
callq 0x4114
movq -0x50(%rbp), %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4667
jmp 0x8ec9
jmp 0x8ebe
jmp 0x8ee3
movq %rax, %rbx
movb $0x1, %r13b
jmp 0x8e6c
jmp 0x8e06
movq %rax, %rdi
callq 0x4085
movq %rax, %rbx
movb $0x1, %r13b
jmp 0x8e93
movq %rax, %rbx
movb $0x1, %r13b
jmp 0x8ea9
movq %rax, %rbx
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x8e32
callq 0x4114
jmp 0x8e32
movq %rax, %rbx
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x8e45
callq 0x4114
jmp 0x8e45
movq %rax, %rbx
testb %r13b, %r13b
je 0x8e6c
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0x8e6c
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x31f0
testb %r13b, %r13b
je 0x8e93
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0x8e93
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x31f0
testb %r13b, %r13b
je 0x8ea9
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x8ea9
callq 0x4114
testb %r13b, %r13b
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x8ec1
callq 0x4114
jmp 0x8ec1
jmp 0x8ebe
movq %rax, %rbx
movq -0x48(%rbp), %r12
jmp 0x8ee6
jmp 0x8ee3
movq %rax, %rbx
jmp 0x8eac
movq %rax, %rbx
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x8ee6
callq 0x4114
jmp 0x8ee6
jmp 0x8ee3
movq %rax, %rbx
testq %r12, %r12
je 0x8ef3
movq %r12, %rdi
callq 0x4114
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x8f01
callq 0x4114
movq %rbx, %rdi
callq 0x3310
nop