// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/apn/integer/basic.c
// Function: sub_ints_abs
static int sub_ints_abs(struct tt_int *dst, const struct tt_int *src1,
		const struct tt_int *src2)
{
	/* Make sure dst buffer is large enough. TODO: It's overkill. */
	if (dst->_max < src1->msb) {
		int ret = _tt_int_realloc(dst, src1->msb);
		if (ret)
			return ret;
	}

	/* Sub array */
	int i, borrow = 0;
	for (i = 0; i < src2->msb; i++)
		dst->buf[i] = sub_int(src1->buf[i], src2->buf[i], &borrow);
	for (; i < src1->msb; i++) {
		if (borrow == 0) {
			if (dst != src1)
				memcpy(&dst->buf[i], &src1->buf[i],
						(src1->msb-i)*_tt_word_sz);
			break;
		}
		dst->buf[i] = src1->buf[i] - 1;
		borrow = !src1->buf[i];
	}

	/* Check new msb */
	dst->msb = src1->msb;
	while (dst->msb > 1 && dst->buf[dst->msb-1] == 0)
		dst->msb--;

	return 0;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq 0x28(%rsp), %rax
movl 0x4(%rax), %eax
movq 0x20(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jge 0xb6f1
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rax
movl 0x8(%rax), %esi
callq 0x68d0
movl %eax, 0x14(%rsp)
cmpl $0x0, 0x14(%rsp)
je 0xb6ef
movl 0x14(%rsp), %eax
movl %eax, 0x34(%rsp)
jmp 0xb888
jmp 0xb6f1
movl $0x0, 0xc(%rsp)
movl $0x0, 0x10(%rsp)
movl 0x10(%rsp), %eax
movq 0x18(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jge 0xb75f
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0xc(%rsp), %rdx
callq 0x8a70
movq %rax, %rdx
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x10(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0xb701
jmp 0xb761
movl 0x10(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jge 0xb822
cmpl $0x0, 0xc(%rsp)
jne 0xb7c9
movq 0x28(%rsp), %rax
cmpq 0x20(%rsp), %rax
je 0xb7c7
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rdi
movslq 0x10(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rsi
movslq 0x10(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq 0x20(%rsp), %rax
movl 0x8(%rax), %eax
subl 0x10(%rsp), %eax
shll $0x3, %eax
movslq %eax, %rdx
callq 0x1140
jmp 0xb822
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
subq $0x1, %rdx
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x10(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x10(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0xc(%rsp)
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0xb761
movq 0x20(%rsp), %rax
movl 0x8(%rax), %ecx
movq 0x28(%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x28(%rsp), %rcx
xorl %eax, %eax
cmpl $0x1, 0x8(%rcx)
movb %al, 0xb(%rsp)
jle 0xb866
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x28(%rsp), %rcx
movl 0x8(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
cmpq $0x0, (%rax,%rcx,8)
sete %al
movb %al, 0xb(%rsp)
movb 0xb(%rsp), %al
testb $0x1, %al
jne 0xb870
jmp 0xb880
movq 0x28(%rsp), %rax
movl 0x8(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x8(%rax)
jmp 0xb832
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)