// File: /workspace/github_cpp_makefile_star2_O2/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 $0xc8, %rsp
movq %rdx, -0x70(%rbp)
movq %rdi, -0x58(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x3e44
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rax
movaps %xmm0, (%rax)
leaq -0x38(%rbp), %r12
leaq -0xa0(%rbp), %r15
movq -0x68(%rbp), %rdi
callq 0x49a8
testb %al, %al
jne 0x7cf8
movq -0x68(%rbp), %rsi
movq %r12, %rdi
callq 0x5fc6
movq -0x38(%rbp), %rdi
callq 0x49e0
movl %eax, %r14d
leaq -0x30(%rbp), %rdi
callq 0x3e82
testb %r14b, %r14b
je 0x7d06
movq -0x68(%rbp), %rsi
movq %r12, %rdi
callq 0x5fc6
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
callq 0x4354
leaq -0x30(%rbp), %rdi
callq 0x3e82
movq -0x50(%rbp), %rsi
movq %r12, %rbx
movq %r12, %rdi
callq 0x5fc6
movq -0x38(%rbp), %rdi
callq 0x4b10
movl %eax, %r12d
testb %al, %al
je 0x7c54
movq -0x50(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x5fc6
movq -0x90(%rbp), %rax
movq (%rax), %rsi
leaq -0xe8(%rbp), %r14
movq %r14, %rdi
callq 0x3d07
leaq -0xc0(%rbp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x37cc
movq %r13, %rdi
leaq 0x886a(%rip), %rsi      # 0x104b2
callq 0x8ffa
movb $0x1, %r14b
testb %al, %al
jne 0x7c9d
movq -0x50(%rbp), %rsi
movq %r15, %r14
movq %r15, %rdi
callq 0x5fc6
leaq -0x80(%rbp), %rdi
movq %r14, %rsi
movq -0x70(%rbp), %rdx
callq 0xc9d5
movq -0x80(%rbp), %rdi
callq 0x49a8
movl %eax, %r14d
xorb $0x1, %r14b
leaq -0x78(%rbp), %rdi
callq 0x3e82
leaq -0x98(%rbp), %rdi
callq 0x3e82
testb %r12b, %r12b
je 0x7cc1
leaq -0xc0(%rbp), %rdi
callq 0x30f0
leaq -0xe8(%rbp), %rdi
callq 0x30f0
leaq -0x88(%rbp), %rdi
callq 0x3e82
leaq -0x30(%rbp), %rdi
callq 0x3e82
testb %r14b, %r14b
jne 0x7d2d
movq -0x68(%rbp), %rsi
movq %rbx, %r12
movq %rbx, %rdi
callq 0x5f48
leaq -0x68(%rbp), %rdi
movq %r12, %rsi
callq 0x4354
leaq -0x30(%rbp), %rdi
callq 0x3e82
jmp 0x7b88
movq -0x58(%rbp), %rbx
movq %rbx, %rdi
callq 0x4d18
jmp 0x7d57
movq 0x102db(%rip), %rdi     # 0x17fe8
leaq 0x877a(%rip), %rsi      # 0x1048e
callq 0x31f0
movq -0x58(%rbp), %rbx
movq %rax, %rdi
callq 0x3100
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
jmp 0x7d57
movq -0x50(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x5f48
leaq -0x38(%rbp), %rsi
movq -0x58(%rbp), %rbx
movq %rbx, %rdi
movq -0x70(%rbp), %rdx
callq 0x7a26
leaq -0x30(%rbp), %rdi
callq 0x3e82
leaq -0x48(%rbp), %rdi
callq 0x3e82
leaq -0x60(%rbp), %rdi
callq 0x3e82
movq %rbx, %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7de5
jmp 0x7df5
jmp 0x7df5
movq %rax, %rbx
jmp 0x7dc3
movq %rax, %rbx
jmp 0x7dcf
jmp 0x7de5
movq %rax, %rbx
jmp 0x7da6
movq %rax, %rbx
jmp 0x7db2
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x3e82
leaq -0x98(%rbp), %rdi
callq 0x3e82
testb %r12b, %r12b
je 0x7de8
leaq -0xc0(%rbp), %rdi
callq 0x30f0
leaq -0xe8(%rbp), %rdi
callq 0x30f0
leaq -0x88(%rbp), %rdi
callq 0x3e82
jmp 0x7de8
jmp 0x7df5
jmp 0x7de5
jmp 0x7df5
jmp 0x7df5
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x3e82
jmp 0x7df8
jmp 0x7df5
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x3e82
leaq -0x60(%rbp), %rdi
callq 0x3e82
movq %rbx, %rdi
callq 0x3330