// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/tests/decimal.c
// Function: verify_sub
static void verify_sub(int count)
{
	bool fail = false;
	struct tt_dec *dec1, *dec2, *dec3;

	int old_level = tt_log_set_level(TT_LOG_WARN);

	/* Big number */
	printf("Subtract big number...\n");
	dec1 = tt_dec_alloc(30);
	dec2 = tt_dec_alloc(50);
	dec3 = tt_dec_alloc(40);
	for (int i = 0; i < count; i++) {
		double d1, d2;
		long double ld;
		char s1[128], s2[128];
		ld = get_num(s1, 1, 100);
		tt_dec_from_string(dec1, s1);
		ld -= get_num(s2, 1, 100);
		tt_dec_from_string(dec2, s2);
		double prec = 1E-15;
		if (dec1->_sign == dec2->_sign)
			prec = 1E-14;
		tt_dec_sub(dec3, dec2, dec1);
		tt_dec_sub(dec2, dec1, dec2);
		tt_dec_to_float(dec3, &d1);
		tt_dec_to_float(dec2, &d2);

		if (_tt_dec_sanity(dec1) || _tt_dec_sanity(dec2) ||
				_tt_dec_sanity(dec3)) {
			tt_error("Sanity error");
			fail = true;
			break;
		}

		if (!deq(ld, -d1, prec) || !deq(ld, d2, prec)) {
			tt_warn("Num sub mismatch: %s - %s\nMach: %.18LE\n"
					"DEC:  %.18E\nDEC:  %.18E",
					s1, s2, ld, -d1, d2);
		}
	}

	tt_dec_free(dec1);
	tt_dec_free(dec2);
	tt_dec_free(dec3);
	if (fail)
		return;

#ifdef __STDC_IEC_559__
	/* Random float */
	printf("Subtract float...\n");
	dec1 = tt_dec_alloc(0);
	dec2 = tt_dec_alloc(0);
	dec3 = tt_dec_alloc(0);

	for (int i = 0; i < count; i++) {
		double d1 = gen_float(307);
		double d2 = gen_float(307);
		double prec = 1E-15;
		if (signbit(d1) == signbit(d2))
			prec = 1E-14;

		tt_dec_from_float(dec1, d1);
		tt_dec_from_float(dec2, d2);

		tt_dec_sub(dec3, dec1, dec2);
		tt_dec_sub(dec1, dec2, dec1);

		if (_tt_dec_sanity(dec1) || _tt_dec_sanity(dec2) ||
				_tt_dec_sanity(dec3)) {
			tt_error("Sanity error");
			fail = true;
			break;
		}

		double vd1, vd2;
		tt_dec_to_float(dec3, &vd1);
		tt_dec_to_float(dec1, &vd2);

		double ds = d1 - d2;
		if (!deq(vd1, ds, prec) || !deq(-vd2, ds, prec)) {
			tt_warn("Float sub mismatch: %.18E - %.18E\n"
					"Mach: %.18E\nDEC:  %.18E\nDEC:  %.18E",
					d1, d2, ds, vd1, -vd2);
		}
	}
	tt_dec_free(dec1);
	tt_dec_free(dec2);
	tt_dec_free(dec3);
#endif

	tt_log_set_level(old_level);
}

// Assembly:
subq $0x1b8, %rsp            # imm = 0x1B8
movl %edi, 0x1b4(%rsp)
movb $0x0, 0x1b3(%rsp)
movl $0x1, %edi
callq 0x10ac0
movl %eax, 0x194(%rsp)
leaq 0x12591(%rip), %rdi     # 0x1513f
movb $0x0, %al
callq 0x20c0
movl $0x1e, %edi
callq 0x4660
movq %rax, 0x1a8(%rsp)
movl $0x32, %edi
callq 0x4660
movq %rax, 0x1a0(%rsp)
movl $0x28, %edi
callq 0x4660
movq %rax, 0x198(%rsp)
movl $0x0, 0x190(%rsp)
movl 0x190(%rsp), %eax
cmpl 0x1b4(%rsp), %eax
jge 0x2e4e
leaq 0xf0(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movl $0x1, %esi
movl %esi, 0x18(%rsp)
movl $0x64, %edx
movl %edx, 0x1c(%rsp)
callq 0x4230
movq 0x10(%rsp), %rsi
fstpt 0x170(%rsp)
movq 0x1a8(%rsp), %rdi
callq 0x5690
movl 0x18(%rsp), %esi
movl 0x1c(%rsp), %edx
leaq 0x70(%rsp), %rdi
callq 0x4230
fldt 0x170(%rsp)
fsubp %st, %st(1)
fstpt 0x170(%rsp)
movq 0x1a0(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x5690
movsd 0x12385(%rip), %xmm0    # 0x15008
movsd %xmm0, 0x68(%rsp)
movq 0x1a8(%rsp), %rax
movswl (%rax), %eax
movq 0x1a0(%rsp), %rcx
movswl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x2cb1
movsd 0x12365(%rip), %xmm0    # 0x15010
movsd %xmm0, 0x68(%rsp)
movq 0x198(%rsp), %rdi
movq 0x1a0(%rsp), %rsi
movq 0x1a8(%rsp), %rdx
callq 0x6b50
movq 0x1a0(%rsp), %rdi
movq 0x1a8(%rsp), %rsi
movq 0x1a0(%rsp), %rdx
callq 0x6b50
movq 0x198(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x52a0
movq 0x1a0(%rsp), %rdi
leaq 0x180(%rsp), %rsi
callq 0x52a0
movq 0x1a8(%rsp), %rdi
callq 0x4850
cmpl $0x0, %eax
jne 0x2d4b
movq 0x1a0(%rsp), %rdi
callq 0x4850
cmpl $0x0, %eax
jne 0x2d4b
movq 0x198(%rsp), %rdi
callq 0x4850
cmpl $0x0, %eax
je 0x2d6f
xorl %edi, %edi
leaq 0x12403(%rip), %rsi     # 0x15157
leaq 0x12323(%rip), %rdx     # 0x1507e
movb $0x0, %al
callq 0x10770
movb $0x1, 0x1b3(%rsp)
jmp 0x2e4e
fldt 0x170(%rsp)
fstpl 0x28(%rsp)
movsd 0x28(%rsp), %xmm0
movsd 0x188(%rsp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
movsd 0x68(%rsp), %xmm2
callq 0x4360
testb $0x1, %al
jne 0x2db1
jmp 0x2dda
fldt 0x170(%rsp)
fstpl 0x20(%rsp)
movsd 0x20(%rsp), %xmm0
movsd 0x180(%rsp), %xmm1
movsd 0x68(%rsp), %xmm2
callq 0x4360
testb $0x1, %al
jne 0x2e36
leaq 0xf0(%rsp), %rcx
leaq 0x70(%rsp), %r8
fldt 0x170(%rsp)
movsd 0x188(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rax
movq %rax, %xmm0
movsd 0x180(%rsp), %xmm1
movq %rsp, %rax
fstpt (%rax)
leaq 0x12334(%rip), %rsi     # 0x15157
leaq 0x12338(%rip), %rdx     # 0x15162
movl $0x1, %edi
movb $0x2, %al
callq 0x10770
jmp 0x2e38
movl 0x190(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x190(%rsp)
jmp 0x2bf6
movq 0x1a8(%rsp), %rdi
callq 0x47e0
movq 0x1a0(%rsp), %rdi
callq 0x47e0
movq 0x198(%rsp), %rdi
callq 0x47e0
testb $0x1, 0x1b3(%rsp)
je 0x2e84
jmp 0x311a
leaq 0x12316(%rip), %rdi     # 0x151a1
movb $0x0, %al
callq 0x20c0
xorl %edi, %edi
callq 0x4660
movq %rax, 0x1a8(%rsp)
xorl %edi, %edi
callq 0x4660
movq %rax, 0x1a0(%rsp)
xorl %edi, %edi
callq 0x4660
movq %rax, 0x198(%rsp)
movl $0x0, 0x64(%rsp)
movl 0x64(%rsp), %eax
cmpl 0x1b4(%rsp), %eax
jge 0x30e7
movl $0x133, %edi            # imm = 0x133
callq 0x44f0
movsd %xmm0, 0x58(%rsp)
movl $0x133, %edi            # imm = 0x133
callq 0x44f0
movsd %xmm0, 0x50(%rsp)
movsd 0x12108(%rip), %xmm0    # 0x15008
movsd %xmm0, 0x48(%rsp)
movsd 0x58(%rsp), %xmm0
movq %xmm0, %rax
cmpq $0x0, %rax
setl %al
andb $0x1, %al
movzbl %al, %eax
movsd 0x50(%rsp), %xmm0
movq %xmm0, %rcx
cmpq $0x0, %rcx
setl %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x2f47
movsd 0x120cf(%rip), %xmm0    # 0x15010
movsd %xmm0, 0x48(%rsp)
movq 0x1a8(%rsp), %rdi
movsd 0x58(%rsp), %xmm0
callq 0x4e10
movq 0x1a0(%rsp), %rdi
movsd 0x50(%rsp), %xmm0
callq 0x4e10
movq 0x198(%rsp), %rdi
movq 0x1a8(%rsp), %rsi
movq 0x1a0(%rsp), %rdx
callq 0x6b50
movq 0x1a8(%rsp), %rdi
movq 0x1a0(%rsp), %rsi
movq 0x1a8(%rsp), %rdx
callq 0x6b50
movq 0x1a8(%rsp), %rdi
callq 0x4850
cmpl $0x0, %eax
jne 0x2fdd
movq 0x1a0(%rsp), %rdi
callq 0x4850
cmpl $0x0, %eax
jne 0x2fdd
movq 0x198(%rsp), %rdi
callq 0x4850
cmpl $0x0, %eax
je 0x3001
xorl %edi, %edi
leaq 0x12171(%rip), %rsi     # 0x15157
leaq 0x12091(%rip), %rdx     # 0x1507e
movb $0x0, %al
callq 0x10770
movb $0x1, 0x1b3(%rsp)
jmp 0x30e7
movq 0x198(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x52a0
movq 0x1a8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x52a0
movsd 0x58(%rsp), %xmm0
subsd 0x50(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x40(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
movsd 0x48(%rsp), %xmm2
callq 0x4360
testb $0x1, %al
jne 0x3054
jmp 0x3086
movsd 0x38(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x30(%rsp), %xmm1
movsd 0x48(%rsp), %xmm2
callq 0x4360
testb $0x1, %al
jne 0x30d5
movsd 0x58(%rsp), %xmm0
movsd 0x50(%rsp), %xmm1
movsd 0x30(%rsp), %xmm2
movsd 0x40(%rsp), %xmm3
movsd 0x38(%rsp), %xmm4
movq %xmm4, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm4
movl $0x1, %edi
leaq 0x12090(%rip), %rsi     # 0x15157
leaq 0x120e6(%rip), %rdx     # 0x151b4
movb $0x5, %al
callq 0x10770
jmp 0x30d7
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0x2ec7
movq 0x1a8(%rsp), %rdi
callq 0x47e0
movq 0x1a0(%rsp), %rdi
callq 0x47e0
movq 0x198(%rsp), %rdi
callq 0x47e0
movl 0x194(%rsp), %edi
callq 0x10ac0
addq $0x1b8, %rsp            # imm = 0x1B8
retq
nopw %cs:(%rax,%rax)