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

	struct tt_int *ti = tt_int_alloc();
	char *s = NULL;
	int ret;

	/* Special case */
	const struct {
		const char *str;
		int radix;
		const char *_int;
	} cases[] = {
		{ "0", 10, "0", },
		{ "0000000000000000000000000000000000", 16, "0", },
		{ "-000000000000000000000000000000000", 8, "-0", },
		{ "0x000000000000000000000000000", 2, "0", },
		{ "000006", 16, "0x6", },
		{ "-0x000F", 8, "-017", },
	};

	for (int i = 0; i < sizeof(cases)/sizeof(cases[0]); i++) {
		ret = tt_int_from_string(ti, cases[i].str);
		assert(ret == 0 && _tt_int_sanity(ti) == 0);

		ret = tt_int_to_string(ti, &s, cases[i].radix);
		assert(ret == 0);
		if (strcmp(s, cases[i]._int)) {
			tt_error("%s => %s (%s)",
					cases[i].str, s, cases[i]._int);
			return;
		}
		free(s);
		s = NULL;
	}

	while (count--) {
		int radix;
		char *str = gen_int_str(&radix);

		ret = tt_int_from_string(ti, str);
		assert(ret == 0 && _tt_int_sanity(ti) == 0);
		ret = tt_int_to_string(ti, &s, radix);
		assert(ret == 0);

		if (strcmp(s, str)) {
			tt_error("%s => %s", str, s);
			break;
		}

		free(str);
		free(s);
		s = NULL;
	}

	tt_int_free(ti);
}

// Assembly:
subq $0xc8, %rsp
movl %edi, 0xc4(%rsp)
leaq 0x109d6(%rip), %rdi     # 0x1305b
movb $0x0, %al
callq 0x20c0
callq 0x7a50
movq %rax, 0xb8(%rsp)
movq $0x0, 0xb0(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x2052f(%rip), %rsi     # 0x22be0
movl $0x90, %edx
callq 0x2160
movl $0x0, 0xc(%rsp)
movslq 0xc(%rsp), %rax
cmpq $0x6, %rax
jae 0x282f
movq 0xb8(%rsp), %rdi
movslq 0xc(%rsp), %rcx
leaq 0x10(%rsp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0x82e0
movl %eax, 0xac(%rsp)
cmpl $0x0, 0xac(%rsp)
jne 0x2718
movq 0xb8(%rsp), %rdi
callq 0x7dc0
cmpl $0x0, %eax
jne 0x2718
jmp 0x2737
leaq 0x109c7(%rip), %rdi     # 0x130e6
leaq 0x109e4(%rip), %rsi     # 0x1310a
movl $0x4a, %edx
leaq 0x109e8(%rip), %rcx     # 0x1311a
callq 0x20e0
movq 0xb8(%rsp), %rdi
movslq 0xc(%rsp), %rcx
leaq 0x10(%rsp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %edx
leaq 0xb0(%rsp), %rsi
callq 0x8b30
movl %eax, 0xac(%rsp)
cmpl $0x0, 0xac(%rsp)
jne 0x2773
jmp 0x2792
leaq 0x109b6(%rip), %rdi     # 0x13130
leaq 0x10989(%rip), %rsi     # 0x1310a
movl $0x4d, %edx
leaq 0x1098d(%rip), %rcx     # 0x1311a
callq 0x20e0
movq 0xb0(%rsp), %rdi
movslq 0xc(%rsp), %rcx
leaq 0x10(%rsp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rsi
callq 0x2130
cmpl $0x0, %eax
je 0x2806
movslq 0xc(%rsp), %rcx
leaq 0x10(%rsp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq 0xb0(%rsp), %r8
movslq 0xc(%rsp), %rdx
leaq 0x10(%rsp), %rax
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq 0x10(%rax), %r9
xorl %edi, %edi
leaq 0x10946(%rip), %rsi     # 0x13139
leaq 0x1094b(%rip), %rdx     # 0x13145
movb $0x0, %al
callq 0xf260
jmp 0x296a
movq 0xb0(%rsp), %rdi
callq 0x2030
movq $0x0, 0xb0(%rsp)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x26c3
jmp 0x2831
movl 0xc4(%rsp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, 0xc4(%rsp)
cmpl $0x0, %eax
je 0x295d
leaq 0x8(%rsp), %rdi
callq 0x2f80
movq %rax, (%rsp)
movq 0xb8(%rsp), %rdi
movq (%rsp), %rsi
callq 0x82e0
movl %eax, 0xac(%rsp)
cmpl $0x0, 0xac(%rsp)
jne 0x2891
movq 0xb8(%rsp), %rdi
callq 0x7dc0
cmpl $0x0, %eax
jne 0x2891
jmp 0x28b0
leaq 0x1084e(%rip), %rdi     # 0x130e6
leaq 0x1086b(%rip), %rsi     # 0x1310a
movl $0x5c, %edx
leaq 0x1086f(%rip), %rcx     # 0x1311a
callq 0x20e0
movq 0xb8(%rsp), %rdi
movl 0x8(%rsp), %edx
leaq 0xb0(%rsp), %rsi
callq 0x8b30
movl %eax, 0xac(%rsp)
cmpl $0x0, 0xac(%rsp)
jne 0x28dc
jmp 0x28fb
leaq 0x1084d(%rip), %rdi     # 0x13130
leaq 0x10820(%rip), %rsi     # 0x1310a
movl $0x5e, %edx
leaq 0x10824(%rip), %rcx     # 0x1311a
callq 0x20e0
movq 0xb0(%rsp), %rdi
movq (%rsp), %rsi
callq 0x2130
cmpl $0x0, %eax
je 0x2936
movq (%rsp), %rcx
movq 0xb0(%rsp), %r8
xorl %edi, %edi
leaq 0x10813(%rip), %rsi     # 0x13139
leaq 0x10826(%rip), %rdx     # 0x13153
movb $0x0, %al
callq 0xf260
jmp 0x295d
movq (%rsp), %rdi
callq 0x2030
movq 0xb0(%rsp), %rdi
callq 0x2030
movq $0x0, 0xb0(%rsp)
jmp 0x2831
movq 0xb8(%rsp), %rdi
callq 0x7b00
addq $0xc8, %rsp
retq
nopw %cs:(%rax,%rax)