// File: /workspace/github_c_makefile_star2_O2/azhai[P]mlite/mlite.c
// Function: x_bignum_divide
cell x_bignum_divide(cell a, cell b) {
	int	neg, neg_a;
	cell	result, f;
	int	i;
	cell	c, c0;

	neg_a = x_bignum_negative_p(a);
	neg = neg_a != x_bignum_negative_p(b);
	a = bignum_abs(a);
	save(a);
	b = bignum_abs(b);
	save(b);
	if (bignum_less_p(a, b)) {
		if (neg_a)
			a = bignum_negate(a);
		Tmp = a;
		f = make_integer(0);
		Tmp = NIL;
		unsave(2);
		return node(f, a);
	}
	b = bignum_equalize(b, a);
	cadr(Stack) = b; /* cadr+cddddr */
	car(Stack) = a;	/* car+cddddr */
	c = NIL;
	save(c);	/* cadddr */
	c0 = NIL;
	save(c0);	/* caddr */
	f = cdr(b);
	b = car(b);
	cadddr(Stack) = b;
	save(f);	/* cadr */
	result = make_integer(0);
	save(result);	/* car */
	while (!x_bignum_zero_p(f)) {
		if (Error_flag)
			break;
		c = make_integer(0);
		cadddr(Stack) = c;
		caddr(Stack) = c0 = c;
		i = 0;
		while (!bignum_less_p(a, c)) {
			if (Error_flag)
				break;
			caddr(Stack) = c0 = c;
			c = bignum_add(c, b);
			cadddr(Stack) = c;
			i++;
		}
		result = bignum_shift_left(result, i-1);
		car(Stack) = result;
		a = bignum_subtract(a, c0);
		car(cddddr(Stack)) = a;
		f = bignum_shift_right(f);
		f = car(f);
		cadr(Stack) = f;
		b = bignum_shift_right(b);
		b = car(b);
		cadr(cddddr(Stack)) = b;
	}
	if (neg)
		result = bignum_negate(result);
	car(Stack) = result;
	if (neg_a)
		a = bignum_negate(a);
	unsave(6);
	return node(result, a);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq 0x172e8(%rip), %rax     # 0x1c170
movq 0x17731(%rip), %rcx     # 0x1c5c0
movq (%rcx,%rdi,8), %rdx
movq (%rax,%rdx,8), %r15
movq (%rcx,%rsi,8), %rcx
movq (%rax,%rcx,8), %r12
xorq %r15, %r12
callq 0x4228
movq %rax, %rbx
movq 0x17277(%rip), %rsi     # 0x1c128
movq %rax, %rdi
xorl %edx, %edx
callq 0x3613
movq %rax, 0x17266(%rip)     # 0x1c128
movq %r14, %rdi
callq 0x4228
movq %rax, %r14
movq 0x17254(%rip), %rsi     # 0x1c128
movq %rax, %rdi
xorl %edx, %edx
callq 0x3613
movq %rax, 0x17243(%rip)     # 0x1c128
movq %rbx, %rdi
movq %r14, %rsi
callq 0x45c4
testl %eax, %eax
je 0x4f24
testq %r15, %r15
jns 0x4f04
movq %rbx, %rdi
callq 0x426f
movq %rax, %rbx
movq %rbx, 0x17205(%rip)     # 0x1c110
xorl %edi, %edi
callq 0x35ed
movq %rax, %r14
orq $-0x1, 0x171f3(%rip)    # 0x1c110
pushq $0x2
jmp 0x51df
movq %r12, -0x38(%rbp)
movq %r15, -0x30(%rbp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4d23
movq %rax, %r14
movq 0x1722f(%rip), %rax     # 0x1c170
movq 0x17678(%rip), %rcx     # 0x1c5c0
movq 0x171d9(%rip), %rdx     # 0x1c128
movq (%rcx,%rdx,8), %rcx
movq %r14, (%rax,%rcx,8)
movq 0x171ca(%rip), %rcx     # 0x1c128
movq %rbx, (%rax,%rcx,8)
movq 0x171bf(%rip), %rsi     # 0x1c128
pushq $-0x1
popq %r15
movq %r15, %rdi
xorl %edx, %edx
callq 0x3613
movq %rax, 0x171aa(%rip)     # 0x1c128
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x3613
movq %rax, 0x17196(%rip)     # 0x1c128
movq 0x17627(%rip), %rcx     # 0x1c5c0
movq (%rcx,%r14,8), %r15
movq 0x171cc(%rip), %rdx     # 0x1c170
movq (%rdx,%r14,8), %r12
movq (%rcx,%rax,8), %rax
movq (%rcx,%rax,8), %rax
movq (%rcx,%rax,8), %rax
movq %r12, (%rdx,%rax,8)
movq 0x17169(%rip), %rsi     # 0x1c128
movq %r15, %rdi
xorl %edx, %edx
callq 0x3613
movq %rax, 0x17158(%rip)     # 0x1c128
xorl %edi, %edi
callq 0x35ed
movq %rax, %r14
movq 0x17147(%rip), %rsi     # 0x1c128
movq %rax, %rdi
xorl %edx, %edx
callq 0x3613
movq %rax, 0x17136(%rip)     # 0x1c128
movq 0x17177(%rip), %rcx     # 0x1c170
movq 0x175c0(%rip), %rax     # 0x1c5c0
movq (%rax,%r15,8), %rdx
cmpq $0x0, (%rcx,%rdx,8)
jne 0x5016
cmpq $-0x1, (%rax,%rdx,8)
je 0x51a5
cmpl $0x0, 0x17597(%rip)     # 0x1c5b4
jne 0x51a5
movq %r15, -0x40(%rbp)
movq %r14, -0x48(%rbp)
xorl %edi, %edi
callq 0x35ed
movq 0x17137(%rip), %rcx     # 0x1c170
movq 0x17580(%rip), %rdx     # 0x1c5c0
movq 0x170e1(%rip), %rsi     # 0x1c128
movq (%rdx,%rsi,8), %rsi
movq (%rdx,%rsi,8), %rsi
movq (%rdx,%rsi,8), %rsi
movq %rax, (%rcx,%rsi,8)
movq 0x170ca(%rip), %rsi     # 0x1c128
movq (%rdx,%rsi,8), %rsi
movq (%rdx,%rsi,8), %rdx
movq %rax, (%rcx,%rdx,8)
pushq $-0x1
popq %r13
movq %rax, %r15
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x45c4
testl %eax, %eax
jne 0x50e5
cmpl $0x0, 0x1752a(%rip)     # 0x1c5b4
jne 0x50e5
movq 0x170dd(%rip), %rax     # 0x1c170
movq 0x17526(%rip), %rcx     # 0x1c5c0
movq 0x17087(%rip), %rdx     # 0x1c128
movq (%rcx,%rdx,8), %rdx
movq (%rcx,%rdx,8), %rcx
movq %r14, (%rax,%rcx,8)
movq %r14, %rdi
movq %r12, %rsi
callq 0x44fe
movq 0x170b1(%rip), %rcx     # 0x1c170
movq 0x174fa(%rip), %rdx     # 0x1c5c0
movq 0x1705b(%rip), %rsi     # 0x1c128
movq (%rdx,%rsi,8), %rsi
movq (%rdx,%rsi,8), %rsi
movq (%rdx,%rsi,8), %rdx
movq %rax, (%rcx,%rdx,8)
incl %r13d
movq %r14, %r15
jmp 0x5071
movq -0x48(%rbp), %rdi
movl %r13d, %esi
callq 0x4986
movq %rax, %r14
movq 0x17075(%rip), %rax     # 0x1c170
movq 0x17026(%rip), %rcx     # 0x1c128
movq %r14, (%rax,%rcx,8)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4561
movq %rax, %rbx
movq 0x17055(%rip), %rax     # 0x1c170
movq 0x1749e(%rip), %rcx     # 0x1c5c0
movq 0x16fff(%rip), %rdx     # 0x1c128
movq (%rcx,%rdx,8), %rdx
movq (%rcx,%rdx,8), %rdx
movq (%rcx,%rdx,8), %rdx
movq (%rcx,%rdx,8), %rcx
movq %rbx, (%rax,%rcx,8)
movq -0x40(%rbp), %rdi
callq 0x4a81
movq 0x17023(%rip), %rcx     # 0x1c170
movq (%rcx,%rax,8), %r15
movq 0x17468(%rip), %rax     # 0x1c5c0
movq 0x16fc9(%rip), %rdx     # 0x1c128
movq (%rax,%rdx,8), %rax
movq %r15, (%rcx,%rax,8)
movq %r12, %rdi
callq 0x4a81
movq 0x16ffa(%rip), %rcx     # 0x1c170
movq (%rcx,%rax,8), %r12
movq 0x1743f(%rip), %rax     # 0x1c5c0
movq 0x16fa0(%rip), %rdx     # 0x1c128
movq (%rax,%rdx,8), %rdx
movq (%rax,%rdx,8), %rdx
movq (%rax,%rdx,8), %rdx
movq (%rax,%rdx,8), %rdx
movq (%rax,%rdx,8), %rdx
movq %r12, (%rcx,%rdx,8)
jmp 0x5000
cmpq $0x0, -0x38(%rbp)
jns 0x51be
movq %r14, %rdi
callq 0x426f
movq %rax, %r14
movq 0x16fb2(%rip), %rcx     # 0x1c170
movq -0x30(%rbp), %rdx
movq 0x16f5f(%rip), %rax     # 0x1c128
movq %r14, (%rcx,%rax,8)
testq %rdx, %rdx
jns 0x51dd
movq %rbx, %rdi
callq 0x426f
movq %rax, %rbx
pushq $0x6
popq %rdi
callq 0x3775
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3613