// File: /workspace/github_c_makefile_star2_O3/azhai[P]mlite/mlite.c
// Function: x_bignum_subtract
cell x_bignum_subtract(cell a, cell b) {
	cell	fa, fb, result, r;
	int	borrow;

	if (x_bignum_negative_p(a)) {
		if (x_bignum_negative_p(b)) {
			/* -A--B --> -A+|B| --> |B|-|A| */
			a = bignum_abs(a);
			save(a);
			a = bignum_subtract(bignum_abs(b), a);
			unsave(1);
			return a;
		}
		else {
			/* -A-B --> -(|A|+B) */
			return bignum_negate(bignum_add(bignum_abs(a), b));
		}
	}
	else if (x_bignum_negative_p(b)) {
		/* A--B --> A+|B| */
		return bignum_add(a, bignum_abs(b));
	}
	/* A-B, A<B --> -(B-A) */
	if (bignum_less_p(a, b))
		return bignum_negate(bignum_subtract(b, a));
	/* A-B, A>=B */
	a = reverse_segments(cdr(a));
	save(a);
	b = reverse_segments(cdr(b));
	save(b);
	borrow = 0;
	result = NIL;
	save(result);
	while (a != NIL || b != NIL || borrow) {
		fa = a == NIL? 0: car(a);
		fb = b == NIL? 0: car(b);
		r = fa - fb - borrow;
		borrow = 0;
		if (r < 0) {
			r += INT_SEG_LIMIT;
			borrow = 1;
		}
		result = new_atom(r, result);
		car(Stack) = result;
		if (a != NIL) a = cdr(a);
		if (b != NIL) b = cdr(b);
	}
	unsave(3);
	while (car(result) == 0 && cdr(result) != NIL)
		result = cdr(result);
	return new_atom(T_INTEGER, result);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movq 0x197c2(%rip), %rax     # 0x1e170
movq 0x19c0b(%rip), %rcx     # 0x1e5c0
movq (%rcx,%rdi,8), %rdx
cmpq $0x0, (%rax,%rdx,8)
movq (%rcx,%rsi,8), %rcx
movq (%rax,%rcx,8), %r14
js 0x49e9
testq %r14, %r14
js 0x4a1e
movq %rbx, %rdi
movq %r15, %rsi
callq 0x47fe
testl %eax, %eax
je 0x4a3f
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4796
jmp 0x4a08
movq %rbx, %rdi
callq 0x4392
movq %rax, %rbx
testq %r14, %r14
js 0x4c60
movq %rbx, %rdi
movq %r15, %rsi
callq 0x472e
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x43d9
movq %r15, %rdi
callq 0x4392
movq %rbx, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x472e
movq 0x19b7a(%rip), %rax     # 0x1e5c0
movq (%rax,%rbx,8), %r12
movq $-0x1, %rbx
movq $-0x1, %r14
cmpq $-0x1, %r12
je 0x4a86
movq 0x1970b(%rip), %rax     # 0x1e170
movq (%rax,%r12,8), %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x36e8
movq %rax, %r14
movq 0x19b40(%rip), %rax     # 0x1e5c0
movq (%rax,%r12,8), %r12
jmp 0x4a58
movq 0x1969b(%rip), %rsi     # 0x1e128
movq %r14, %rdi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x1968a(%rip)     # 0x1e128
movq 0x19b1b(%rip), %rcx     # 0x1e5c0
movq (%rcx,%r15,8), %r15
cmpq $-0x1, %r15
je 0x4ae9
movq $-0x1, %rbx
movq 0x196b3(%rip), %rax     # 0x1e170
movq (%rax,%r15,8), %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x36e8
movq %rax, %rbx
movq 0x19ae8(%rip), %rax     # 0x1e5c0
movq (%rax,%r15,8), %r15
cmpq $-0x1, %r15
jne 0x4ab6
movq 0x1963f(%rip), %rax     # 0x1e128
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x1962b(%rip)     # 0x1e128
movq $-0x1, %r15
movq $-0x1, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x1960c(%rip)     # 0x1e128
movq %r14, %rax
andq %rbx, %rax
cmpq $-0x1, %rax
je 0x4c15
cmpq $-0x1, %rbx
setne %sil
cmpq $-0x1, %r14
setne %r12b
xorl %eax, %eax
cmpq $-0x1, %r14
je 0x4b51
movq 0x19625(%rip), %rcx     # 0x1e170
movq (%rcx,%r14,8), %r13
jmp 0x4b54
xorl %r13d, %r13d
cmpq $-0x1, %rbx
movb %sil, -0x29(%rbp)
je 0x4b6b
movq 0x1960b(%rip), %rcx     # 0x1e170
movq (%rcx,%rbx,8), %rcx
jmp 0x4b6d
xorl %ecx, %ecx
addq %rax, %r13
subq %rcx, %r13
leaq 0x3b9aca00(%r13), %rdi
testq %r13, %r13
cmovnsq %r13, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x36e8
movq %rax, %r15
movq 0x195d8(%rip), %rax     # 0x1e170
movq 0x19589(%rip), %rcx     # 0x1e128
movq %r15, (%rax,%rcx,8)
movq $-0x1, %rcx
movq $-0x1, %rdx
testb $0x1, %r12b
je 0x4bc2
movq 0x19a02(%rip), %rax     # 0x1e5c0
movq (%rax,%r14,8), %rdx
testb $0x1, -0x29(%rbp)
je 0x4bd3
movq 0x199f1(%rip), %rax     # 0x1e5c0
movq (%rax,%rbx,8), %rcx
movq %r13, %rax
sarq $0x3f, %rax
cmpq $-0x1, %rcx
setne %sil
movq %rdx, %r14
movq %rcx, %rbx
cmpq $-0x1, %rdx
setne %r12b
jne 0x4b3e
movq %rdx, %r14
movq %rcx, %rbx
cmpq $-0x1, %rcx
jne 0x4b3e
movq %rdx, %r14
movq %rcx, %rbx
testq %r13, %r13
js 0x4b3e
movl $0x3, %edi
callq 0x384f
movq 0x1954a(%rip), %rax     # 0x1e170
movq 0x19993(%rip), %rcx     # 0x1e5c0
movq %r15, %rsi
cmpq $0x0, (%rax,%r15,8)
jne 0x4c41
movq (%rcx,%rsi,8), %r15
cmpq $-0x1, %r15
jne 0x4c2d
movq $-0x18, %rdi
movl $0x1, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x36e8
movq 0x194c1(%rip), %rsi     # 0x1e128
movq %rbx, %rdi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x194b0(%rip)     # 0x1e128
movq %r15, %rdi
callq 0x4392
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4796
movq %rax, %rbx
movl $0x1, %edi
callq 0x384f
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq