// File: /workspace/github_c_makefile_star2_O1/BernardTatin[P]s7sh/s7.c
// Function: g_divide
static s7_pointer g_divide(s7_scheme *sc, s7_pointer args)
    {
#define H_divide "(/ x1 ...) divides its first argument by the rest, or inverts the first if there is only one argument"
#define Q_divide sc->pcl_n

        s7_pointer x, y, p;

        x = car(args);
        p = cdr(args);

        if (is_null(p))            /* (/ x) */
        {
            if (!is_number(x))
                return(method_or_bust_with_type_one_arg(sc, x, sc->divide_symbol, args, a_number_string));
            if (s7_is_zero(x))     /* (/ 0) */
                return(division_by_zero_error(sc, sc->divide_symbol, args));
            return(s7_invert(sc, x));
        }
        if (is_null(cdr(p)))
            return(g_divide_xy(sc, x, cadr(args), args));

        y = g_multiply_1(sc, p, sc->divide_symbol); /* in some schemes (/ 1 0 +nan.0) is not equal to (/ 1 (* 0 +nan.0)), in s7 they're both +nan.0 */
#if WITH_GMP
        if (s7_is_bignum(y))
            return(big_divide(sc, set_plist_2(sc, x, y)));
#endif
        return(g_divide_xy(sc, x, y, args));
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x8(%rsi), %r14
movq 0x10(%rsi), %rsi
movq 0x110(%rdi), %rax
cmpq %rax, %rsi
je 0x70719
cmpq %rax, 0x10(%rsi)
je 0x70750
movq 0xe88(%rbx), %rdx
movq %rbx, %rdi
callq 0x103a6d
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
jmp 0x7075a
movzbl (%r14), %eax
leaq 0xe224c(%rip), %rcx     # 0x152970
cmpb $0x0, (%rax,%rcx)
je 0x7076b
addl $-0xb, %eax
cmpl $0x3, %eax
ja 0x70859
leaq 0xa0327(%rip), %rcx     # 0x110a64
movslq (%rcx,%rax,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
cmpq $0x0, 0x8(%r14)
sete %cl
jmp 0x707a3
movq 0x8(%rsi), %rdx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rcx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x10488c
movq 0xe88(%rbx), %rdx
movq 0xecc27(%rip), %r8      # 0x15d3a0
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rcx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x103001
xorpd %xmm0, %xmm0
cmpeqsd 0x8(%r14), %xmm0
movq %xmm0, %rcx
andl $0x1, %ecx
testb %cl, %cl
je 0x707c2
movq 0xe88(%rbx), %rsi
movq %rbx, %rdi
movq %r15, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xe1ae
cmpl $0x3, %eax
ja 0x70859
leaq 0xa02a2(%rip), %rcx     # 0x110a74
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%r14), %r14
cmpq $-0x1, %r14
je 0x708e6
cmpq $0x1, %r14
jne 0x70925
movq 0xde15e(%rip), %rax     # 0x14e958
jmp 0x709a3
movsd 0x8(%r14), %xmm0
movsd 0x10(%r14), %xmm1
movapd %xmm1, %xmm2
mulsd %xmm1, %xmm2
movapd %xmm0, %xmm3
mulsd %xmm0, %xmm3
addsd %xmm2, %xmm3
divsd %xmm3, %xmm0
xorpd 0xa2595(%rip), %xmm1    # 0x112dc0
divsd %xmm3, %xmm1
movq %rbx, %rdi
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xe101
movq 0x8(%r14), %rdx
movq 0x10(%r14), %rsi
movq %rbx, %rdi
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x103338
movq 0xe88(%rbx), %rax
movq 0x8(%rax), %rsi
movq 0xde0ed(%rip), %rdx     # 0x14e958
movq 0x140(%rbx), %r8
movq 0xecb27(%rip), %r9      # 0x15d3a0
movq %rbx, %rdi
movq %r14, %rcx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xb31d
movsd 0x9e79b(%rip), %xmm0    # 0x10f030
divsd 0x8(%r14), %xmm0
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x708bf
movq %rbx, %rdi
movsd %xmm0, 0x8(%rsp)
callq 0xb389
movsd 0x8(%rsp), %xmm0
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0xd, (%rax)
movsd %xmm0, 0x8(%rax)
jmp 0x709a3
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x708fe
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0xb, (%rax)
movq $-0x1, 0x8(%rax)
jmp 0x709a3
movl 0xe20fd(%rip), %eax     # 0x152a28
shlq $0x3f, %rax
cmpq %r14, %rax
jne 0x70950
movq %r14, 0x18(%rsp)
fildll 0x18(%rsp)
fld1
fdivp %st, %st(1)
fstpl 0x10(%rsp)
movsd 0x10(%rsp), %xmm0
jmp 0x7089b
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x70968
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0xc, (%rax)
testq %r14, %r14
js 0x70994
movq $0x1, 0x8(%rax)
jmp 0x7099f
movq $-0x1, 0x8(%rax)
negq %r14
movq %r14, 0x10(%rax)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq