// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/tests/integer.c
// Function: verify_add_sub
static void verify_add_sub(int count)
{
	printf("Add & Sub...\n");

	struct tt_int *a = tt_int_alloc();
	struct tt_int *b = tt_int_alloc();
	struct tt_int *a2 = tt_int_alloc();
	struct tt_int *b2 = tt_int_alloc();
	struct tt_int *t = tt_int_alloc();

	for (int i = 1; i <= count; i++) {
		if (i % 100 == 0) {
			tt_int_free(a);
			tt_int_free(b);
			tt_int_free(a2);
			tt_int_free(b2);
			tt_int_free(t);

			a = tt_int_alloc();
			b = tt_int_alloc();
			a2 = tt_int_alloc();
			b2 = tt_int_alloc();
			t = tt_int_alloc();
		}

		int ret, radix;
		char *str;

		/* Generate a, b */
		str = gen_int_str(&radix);
		tt_int_from_string(a, str);
		free(str);
		str = gen_int_str(&radix);
		tt_int_from_string(b, str);
		free(str);

		/* a2 = a+a, b2 = b+b */
		ret = tt_int_add(a2, a, a);
		assert(ret == 0 && _tt_int_sanity(a2) == 0);
		ret = tt_int_add(b2, b, b);
		assert(ret == 0 && _tt_int_sanity(b2) == 0);

		/* t = a+b */
		ret = tt_int_add(t, a, b);
		assert(ret == 0 && _tt_int_sanity(t) == 0);

		/* a = a-b */
		ret = tt_int_sub(a, a, b);
		assert(ret == 0 && _tt_int_sanity(a) == 0);

		/* b = t-a ==> b2 */
		ret = tt_int_sub(b, t, a);
		assert(ret == 0 && _tt_int_sanity(b) == 0);

		/* a = t+a ==> a2 */
		ret = tt_int_add(a, t, a);
		assert(ret == 0 && _tt_int_sanity(a) == 0);

		if (tt_int_cmp(a, a2) || tt_int_cmp(b, b2)) {
			tt_error("mismatch");
			break;
		}
	}

	tt_int_free(a);
	tt_int_free(b);
	tt_int_free(a2);
	tt_int_free(b2);
	tt_int_free(t);
}

// Assembly:
subq $0x48, %rsp
movl %edi, 0x44(%rsp)
leaq 0x107d3(%rip), %rdi     # 0x13162
movb $0x0, %al
callq 0x20c0
callq 0x7a50
movq %rax, 0x38(%rsp)
callq 0x7a50
movq %rax, 0x30(%rsp)
callq 0x7a50
movq %rax, 0x28(%rsp)
callq 0x7a50
movq %rax, 0x20(%rsp)
callq 0x7a50
movq %rax, 0x18(%rsp)
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x44(%rsp), %eax
jg 0x2cca
movl 0x14(%rsp), %eax
movl $0x64, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x2a53
movq 0x38(%rsp), %rdi
callq 0x7b00
movq 0x30(%rsp), %rdi
callq 0x7b00
movq 0x28(%rsp), %rdi
callq 0x7b00
movq 0x20(%rsp), %rdi
callq 0x7b00
movq 0x18(%rsp), %rdi
callq 0x7b00
callq 0x7a50
movq %rax, 0x38(%rsp)
callq 0x7a50
movq %rax, 0x30(%rsp)
callq 0x7a50
movq %rax, 0x28(%rsp)
callq 0x7a50
movq %rax, 0x20(%rsp)
callq 0x7a50
movq %rax, 0x18(%rsp)
leaq 0xc(%rsp), %rdi
callq 0x2f80
movq %rax, (%rsp)
movq 0x38(%rsp), %rdi
movq (%rsp), %rsi
callq 0x82e0
movq (%rsp), %rdi
callq 0x2030
leaq 0xc(%rsp), %rdi
callq 0x2f80
movq %rax, (%rsp)
movq 0x30(%rsp), %rdi
movq (%rsp), %rsi
callq 0x82e0
movq (%rsp), %rdi
callq 0x2030
movq 0x28(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x38(%rsp), %rdx
callq 0xb9a0
movl %eax, 0x10(%rsp)
cmpl $0x0, 0x10(%rsp)
jne 0x2acd
movq 0x28(%rsp), %rdi
callq 0x7dc0
cmpl $0x0, %eax
jne 0x2acd
jmp 0x2aec
leaq 0x1069c(%rip), %rdi     # 0x13170
leaq 0x1062f(%rip), %rsi     # 0x1310a
movl $0x93, %edx
leaq 0x106ad(%rip), %rcx     # 0x13194
callq 0x20e0
movq 0x20(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x30(%rsp), %rdx
callq 0xb9a0
movl %eax, 0x10(%rsp)
cmpl $0x0, 0x10(%rsp)
jne 0x2b1c
movq 0x20(%rsp), %rdi
callq 0x7dc0
cmpl $0x0, %eax
jne 0x2b1c
jmp 0x2b3b
leaq 0x1068a(%rip), %rdi     # 0x131ad
leaq 0x105e0(%rip), %rsi     # 0x1310a
movl $0x95, %edx
leaq 0x1065e(%rip), %rcx     # 0x13194
callq 0x20e0
movq 0x18(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %rdx
callq 0xb9a0
movl %eax, 0x10(%rsp)
cmpl $0x0, 0x10(%rsp)
jne 0x2b6b
movq 0x18(%rsp), %rdi
callq 0x7dc0
cmpl $0x0, %eax
jne 0x2b6b
jmp 0x2b8a
leaq 0x1065f(%rip), %rdi     # 0x131d1
leaq 0x10591(%rip), %rsi     # 0x1310a
movl $0x99, %edx
leaq 0x1060f(%rip), %rcx     # 0x13194
callq 0x20e0
movq 0x38(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %rdx
callq 0xbae0
movl %eax, 0x10(%rsp)
cmpl $0x0, 0x10(%rsp)
jne 0x2bba
movq 0x38(%rsp), %rdi
callq 0x7dc0
cmpl $0x0, %eax
jne 0x2bba
jmp 0x2bd9
leaq 0x10633(%rip), %rdi     # 0x131f4
leaq 0x10542(%rip), %rsi     # 0x1310a
movl $0x9d, %edx
leaq 0x105c0(%rip), %rcx     # 0x13194
callq 0x20e0
movq 0x30(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x38(%rsp), %rdx
callq 0xbae0
movl %eax, 0x10(%rsp)
cmpl $0x0, 0x10(%rsp)
jne 0x2c09
movq 0x30(%rsp), %rdi
callq 0x7dc0
cmpl $0x0, %eax
jne 0x2c09
jmp 0x2c28
leaq 0x10607(%rip), %rdi     # 0x13217
leaq 0x104f3(%rip), %rsi     # 0x1310a
movl $0xa1, %edx
leaq 0x10571(%rip), %rcx     # 0x13194
callq 0x20e0
movq 0x38(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x38(%rsp), %rdx
callq 0xb9a0
movl %eax, 0x10(%rsp)
cmpl $0x0, 0x10(%rsp)
jne 0x2c58
movq 0x38(%rsp), %rdi
callq 0x7dc0
cmpl $0x0, %eax
jne 0x2c58
jmp 0x2c77
leaq 0x10595(%rip), %rdi     # 0x131f4
leaq 0x104a4(%rip), %rsi     # 0x1310a
movl $0xa5, %edx
leaq 0x10522(%rip), %rcx     # 0x13194
callq 0x20e0
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0xc270
cmpl $0x0, %eax
jne 0x2c9f
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0xc270
cmpl $0x0, %eax
je 0x2cb8
xorl %edi, %edi
leaq 0x10592(%rip), %rsi     # 0x1323a
leaq 0x1059a(%rip), %rdx     # 0x13249
movb $0x0, %al
callq 0xf260
jmp 0x2cca
jmp 0x2cba
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x29d0
movq 0x38(%rsp), %rdi
callq 0x7b00
movq 0x30(%rsp), %rdi
callq 0x7b00
movq 0x28(%rsp), %rdi
callq 0x7b00
movq 0x20(%rsp), %rdi
callq 0x7b00
movq 0x18(%rsp), %rdi
callq 0x7b00
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)