// File: 0x0584[P]scmin-plus/src/builtin/arithmetic.cpp
// Function: builtin::_div(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::_div(const sexpr_t& args, env_t& bindings) {
    (void)bindings;

    if (not args->car()->isnum()) {
        cerr << "fatal: operands are not numbers!" << endl;
        return nullptr;
    }
    double d = any_cast<sexpr_number>(*args->car()->blob).n;
    sexpr_t walk = args->cdr();
    while (not walk->isnil()) {
        if (not walk->car()->isnum()) {
            cerr << "fatal: operands are not numbers!" << endl;
            return nullptr;
        }
        d /= any_cast<sexpr_number>(*walk->car()->blob).n;
        walk = walk->cdr();
    }
    return num(d);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0xc8(%rbp)
movq %rdi, %rax
movq %rax, -0xc0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x28(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0xb520
movq -0xb8(%rbp), %rdi
callq 0x4400
movq %rax, %rdi
callq 0x7430
movb %al, -0xa9(%rbp)
jmp 0x143a0
movb -0xa9(%rbp), %al
xorb $-0x1, %al
movb %al, -0xc9(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x4450
movb -0xc9(%rbp), %al
testb $0x1, %al
jne 0x143c3
jmp 0x14414
movq 0x19c26(%rip), %rdi     # 0x2dff0
leaq 0xd287(%rip), %rsi      # 0x21658
callq 0x32c0
movq %rax, %rdi
movq 0x19bb0(%rip), %rsi     # 0x2df90
callq 0x32f0
movq -0xc8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4570
jmp 0x146be
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x4450
jmp 0x146ce
movq -0x10(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0xb520
movq -0xe0(%rbp), %rdi
callq 0x4400
movq %rax, %rdi
callq 0x4520
movq %rax, -0xd8(%rbp)
jmp 0x1444d
movq -0xd8(%rbp), %rdi
callq 0x10fa0
movsd %xmm0, -0xe8(%rbp)
jmp 0x14463
movsd -0xe8(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0xf0(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x4450
movsd -0xf0(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x68(%rbp), %rdi
callq 0xb440
leaq -0x68(%rbp), %rdi
callq 0x4400
movq %rax, %rdi
callq 0x7270
movb %al, -0xf1(%rbp)
jmp 0x144c1
movb -0xf1(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x144d2
jmp 0x1468e
leaq -0x68(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x78(%rbp), %rdi
callq 0xb520
jmp 0x144e9
leaq -0x78(%rbp), %rdi
callq 0x4400
movq %rax, %rdi
callq 0x7430
movb %al, -0xf2(%rbp)
jmp 0x14502
movb -0xf2(%rbp), %al
xorb $-0x1, %al
movb %al, -0xf3(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x4450
movb -0xf3(%rbp), %al
testb $0x1, %al
jne 0x14528
jmp 0x145ba
movq 0x19ac1(%rip), %rdi     # 0x2dff0
leaq 0xd122(%rip), %rsi      # 0x21658
callq 0x32c0
movq %rax, -0x100(%rbp)
jmp 0x14544
movq -0x100(%rbp), %rdi
movq 0x19a3e(%rip), %rsi     # 0x2df90
callq 0x32f0
jmp 0x14559
movq -0xc8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4570
movl $0x1, -0x7c(%rbp)
jmp 0x146a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x4450
jmp 0x146ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x146b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x4450
jmp 0x146b3
leaq -0x68(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0x98(%rbp), %rdi
callq 0xb520
jmp 0x145d4
leaq -0x98(%rbp), %rdi
callq 0x4400
movq %rax, %rdi
callq 0x4520
movq %rax, -0x108(%rbp)
jmp 0x145f1
movq -0x108(%rbp), %rdi
callq 0x10fa0
movsd %xmm0, -0x110(%rbp)
jmp 0x14607
movsd -0x110(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x88(%rbp), %xmm1
movsd -0x40(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x4450
leaq -0x68(%rbp), %rdi
callq 0x4400
movq %rax, %rsi
leaq -0xa8(%rbp), %rdi
callq 0xb440
jmp 0x14653
leaq -0x68(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x4420
leaq -0xa8(%rbp), %rdi
callq 0x4450
jmp 0x144a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x4450
jmp 0x146b3
movq -0xc8(%rbp), %rdi
movsd -0x40(%rbp), %xmm0
callq 0x7990
jmp 0x146a1
movl $0x1, -0x7c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x4450
jmp 0x146be
leaq -0x68(%rbp), %rdi
callq 0x4450
jmp 0x146ce
movq -0xc0(%rbp), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x34f0
nopw (%rax,%rax)