// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/tests/decimal.c
// Function: main
int main(void)
{
#if 0
	struct tt_dec *dec = tt_dec_alloc(50);
	char s[3000];

	tt_dec_from_sint(dec, 1ULL << 63);
	tt_dec_to_string(dec, s, 100);
	printf("sint: %s == %lld\n", s, 1ULL << 63);

	tt_dec_from_uint(dec, 1234567890987654321);
	tt_dec_to_string(dec, s, 100);
	printf("uint: %s\n", s);

	uint64_t dmax;
	dmax = (2046ULL << 52) | ((1ULL << 52) - 1);	/* Max double */
	tt_dec_from_float(dec, *(double *)&dmax);
	tt_dec_to_string(dec, s, 100);
	printf("max double: %s\n", s);
	dmax = 1;
	tt_dec_from_float(dec, *(double *)&dmax);
	tt_dec_to_string(dec, s, 100);
	printf("min double: %s\n", s);

	double dv;
	struct tt_dec *dec3 = tt_dec_alloc(320);
	tt_dec_from_string(dec3, "1.218789511116565398");
	struct tt_dec *dec2 = tt_dec_alloc(320);
	tt_dec_from_string(dec2, "2.139450735390025820");
	tt_dec_add(dec2, dec3, dec2);
	tt_dec_to_string(dec2, s, 1000);
	tt_dec_to_float(dec2, &dv);
	printf("add: %s\n     %.18E\n", s, dv);
	if (_tt_dec_sanity(dec2))
		tt_error("DEC sanity error!");
	tt_dec_free(dec2);
	tt_dec_free(dec3);

	dec3 = tt_dec_alloc(320);
	tt_dec_from_string(dec3, "541295929775964129640116467012286");
	dec2 = tt_dec_alloc(320);
	tt_dec_from_string(dec2, "541295929775964129640116467012286");
	tt_dec_sub(dec2, dec3, dec2);
	tt_dec_to_string(dec2, s, 1000);
	tt_dec_to_float(dec2, &dv);
	printf("sub: %s\n     %.18E\n", s, dv);
	if (_tt_dec_sanity(dec2))
		tt_error("DEC sanity error!");
	tt_dec_free(dec2);
	tt_dec_free(dec3);

	dec3 = tt_dec_alloc(1000);
	#define M	"99999999999999999999999999999999999999999999999999"
	#define M1000	M M M M M M M M M M M M M M M M M M M M
	tt_dec_from_string(dec3, M1000);
	dec2 = tt_dec_alloc(2000);
	tt_dec_from_string(dec2, M1000);
	tt_dec_mul(dec2, dec2, dec3);
	tt_dec_to_string(dec2, s, 3000);
	printf("mul:\n%s\n", s);
	if (_tt_dec_sanity(dec2))
		tt_error("DEC sanity error!");
	tt_dec_free(dec2);
	tt_dec_free(dec3);

	const char *sci[] = {
#if 0
		"+123", "-1234", "0", "0.00", "1.23E3", "1.2345e+3", "12.E+7",
		"12.0", "12.3456", "0.001234567", "-.23E-12", "1234.E-4", "-0",
		"-0.00", "0E+7", "-0E-7", "inf", "-NaN",
		"-", "+E1", ".", ".E12", "1.2E3.", "-3#5", ".E", "3E", "1.1.E1",
#endif
		"123456789012345678901234567890123456789012345678935234567890",
		"-999999999999999999999999999999999999999999999999999999999999",
	};
	for (int i = 0; i < sizeof(sci) / sizeof(sci[0]); i++) {
		printf("%s --> ", sci[i]);
		int err = tt_dec_from_string(dec, sci[i]);
		if (err < 0) {
			printf("Error: %d\n", err);
		} else {
			if (tt_dec_to_string(dec, s, 100))
				printf("Buffer too small\n");
			else
				printf("%s\n", s);
		}
	}
#endif

#if 0
	int old_level = tt_log_set_level(TT_LOG_WARN);
	struct tt_dec *dec_fac = factorial(1, 100000);
	char s_fac[500000];
	tt_dec_to_string(dec_fac, s_fac, 500000);
	tt_dec_free(dec_fac);
	printf("100000! = %s\n", s_fac);
	tt_log_set_level(old_level);
	return 0;
#endif

#if 0
	struct tt_dec *dividend = tt_dec_alloc(50);
	struct tt_dec *divisor = tt_dec_alloc(50);
	struct tt_dec *quotient = tt_dec_alloc(50);
	char s[100];

	tt_dec_from_uint(dividend, 999999999990);
	tt_dec_from_uint(divisor, 2);
	tt_dec_div(quotient, dividend, divisor);
	tt_dec_div(dividend, dividend, divisor);

	tt_dec_to_string(quotient, s, 100);
	printf("div: %s\n", s);
	tt_dec_to_string(dividend, s, 100);
	printf("div: %s\n", s);

	tt_dec_free(dividend);
	tt_dec_free(divisor);
	tt_dec_free(quotient);
#endif

	srand(time(NULL));

	const int count = 100000;
	verify_add(count);
	verify_sub(count);
	verify_mul(count);
	verify_div(count);
	verify_cmp(count);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x5a8, %rsp            # imm = 0x5A8
xorl %edi, %edi
callq 0x2140
movl %eax, %edi
callq 0x20f0
pushq $0x1
popq %rdi
callq 0xa010
movl %eax, 0x54(%rsp)
xorl %edi, %edi
callq 0x3a14
movq %rax, 0x40(%rsp)
xorl %edi, %edi
callq 0x3a14
movq %rax, 0x10(%rsp)
xorl %edi, %edi
callq 0x3a14
movq %rax, 0x20(%rsp)
pushq $0x10
popq %r14
leaq 0x1a6c1(%rip), %r13     # 0x1ca90
movq 0x10(%rsp), %rbp
leaq 0x18(%r14), %r15
cmpq $0x118, %r15            # imm = 0x118
je 0x2491
movq -0x10(%r14,%r13), %rsi
movq -0x8(%r14,%r13), %r12
movq 0x40(%rsp), %rbx
movq %rbx, %rdi
movq %rsi, 0x38(%rsp)
callq 0x41f8
movq %rbp, %rdi
movq %r12, 0x58(%rsp)
movq %r12, %rsi
callq 0x41f8
movq 0x20(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
leaq 0x1a0(%rsp), %rbx
movq %rbp, %rdx
callq 0x4760
movq %r12, %rdi
movq %rbx, %rsi
movl $0x168, %edx            # imm = 0x168
callq 0x451d
movq %r12, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x2654
movq (%r14,%r13), %rsi
movq %rbx, %rdi
callq 0x2110
movq %r15, %r14
testl %eax, %eax
je 0x23d4
leaq 0x9c25(%rip), %rsi      # 0xc08f
leaq 0x9c36(%rip), %rdx      # 0xc0a7
leaq 0x1a0(%rsp), %r9
xorl %edi, %edi
movq 0x38(%rsp), %rcx
movq 0x58(%rsp), %r8
xorl %eax, %eax
callq 0x9de8
jmp 0x266b
movq 0x40(%rsp), %rdi
callq 0x3aeb
movq 0x10(%rsp), %rdi
callq 0x3aeb
movq 0x20(%rsp), %rdi
callq 0x3aeb
leaq 0x9ebf(%rip), %rdi      # 0xc375
callq 0x2060
pushq $0x1e
popq %rdi
callq 0x3a14
movq %rax, %r12
pushq $0x32
popq %rdi
callq 0x3a14
movq %rax, %r15
pushq $0x28
popq %rdi
callq 0x3a14
movq %rax, %r14
movl $0x186a0, %ebx          # imm = 0x186A0
subl $0x1, %ebx
jb 0x32aa
leaq 0xa0(%rsp), %r13
movq %r13, %rdi
callq 0x384f
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x41f8
leaq 0x120(%rsp), %r13
movq %r13, %rdi
callq 0x384f
fldt 0x10(%rsp)
faddp %st, %st(1)
fstpt 0x10(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x41f8
movzwl (%r12), %eax
xorl %r13d, %r13d
cmpw (%r15), %ax
sete %bpl
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x4760
movq %r15, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x4760
movq %r14, %rdi
leaq 0x60(%rsp), %rsi
callq 0x3fc0
movq %r15, %rdi
leaq 0x68(%rsp), %rsi
callq 0x3fc0
movq %r12, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x2686
movq %r15, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x2686
movq %r14, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x2686
movb %bpl, %r13b
leaq 0x9a62(%rip), %rax      # 0xc010
movsd (%rax,%r13,8), %xmm2
fldt 0x10(%rsp)
fstpl 0x98(%rsp)
movq 0x98(%rsp), %xmm0
movsd 0x60(%rsp), %xmm1
movq %xmm0, 0x20(%rsp)
movsd %xmm1, 0x40(%rsp)
movsd %xmm2, 0x38(%rsp)
callq 0x38d0
movsd 0x68(%rsp), %xmm1
testb %al, %al
je 0x261a
movq 0x20(%rsp), %xmm0
movsd %xmm1, 0x20(%rsp)
movsd 0x20(%rsp), %xmm1
movsd 0x38(%rsp), %xmm2
callq 0x38d0
movsd 0x20(%rsp), %xmm1
testb %al, %al
jne 0x24e1
fldt 0x10(%rsp)
fstpt (%rsp)
pushq $0x1
popq %rdi
leaq 0x9a64(%rip), %rsi      # 0xc08f
leaq 0x9a83(%rip), %rdx      # 0xc0b5
leaq 0xa0(%rsp), %rcx
leaq 0x120(%rsp), %r8
movq 0x40(%rsp), %xmm0
movb $0x2, %al
callq 0x9de8
jmp 0x24e1
leaq 0x9a34(%rip), %rsi      # 0xc08f
leaq 0x9a38(%rip), %rdx      # 0xc09a
xorl %edi, %edi
xorl %eax, %eax
callq 0x9de8
movq 0x40(%rsp), %rdi
callq 0x3aeb
movq 0x10(%rsp), %rdi
callq 0x3aeb
movq 0x20(%rsp), %rdi
jmp 0x26b0
leaq 0x9a02(%rip), %rsi      # 0xc08f
leaq 0x9a06(%rip), %rdx      # 0xc09a
xorl %edi, %edi
xorl %eax, %eax
callq 0x9de8
movq %r12, %rdi
callq 0x3aeb
movq %r15, %rdi
callq 0x3aeb
movq %r14, %rdi
callq 0x3aeb
pushq $0x1
popq %rdi
callq 0xa010
movl %eax, 0x54(%rsp)
leaq 0x9ccc(%rip), %rdi      # 0xc394
callq 0x2060
pushq $0x1e
popq %rdi
callq 0x3a14
movq %rax, %r12
pushq $0x32
popq %rdi
callq 0x3a14
movq %rax, %r15
pushq $0x28
popq %rdi
callq 0x3a14
movq %rax, %r14
movl $0x186a0, %ebp          # imm = 0x186A0
subl $0x1, %ebp
jb 0x28a5
leaq 0x1a0(%rsp), %rbx
movq %rbx, %rdi
callq 0x384f
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x41f8
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
callq 0x384f
fldt 0x10(%rsp)
fsubp %st, %st(1)
fstpt 0x10(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x41f8
movzwl (%r12), %eax
xorl %r13d, %r13d
cmpw (%r15), %ax
sete %bl
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x4c16
movq %r15, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x4c16
movq %r14, %rdi
leaq 0x120(%rsp), %rsi
callq 0x3fc0
movq %r15, %rdi
leaq 0x60(%rsp), %rsi
callq 0x3fc0
movq %r12, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x2871
movq %r15, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x2871
movq %r14, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x2871
movb %bl, %r13b
leaq 0x985e(%rip), %rax      # 0xc020
movsd (%rax,%r13,8), %xmm2
fldt 0x10(%rsp)
fstpl 0x90(%rsp)
movq 0x90(%rsp), %xmm0
movsd 0x120(%rsp), %xmm1
xorps 0x9844(%rip), %xmm1     # 0xc030
movq %xmm0, 0x20(%rsp)
movaps %xmm1, 0x40(%rsp)
movsd %xmm2, 0x38(%rsp)
callq 0x38d0
movsd 0x60(%rsp), %xmm1
testb %al, %al
je 0x2837
movq 0x20(%rsp), %xmm0
movsd %xmm1, 0x20(%rsp)
movsd 0x20(%rsp), %xmm1
movsd 0x38(%rsp), %xmm2
callq 0x38d0
movsd 0x20(%rsp), %xmm1
testb %al, %al
jne 0x26f3
fldt 0x10(%rsp)
fstpt (%rsp)
pushq $0x1
popq %rdi
leaq 0x98f2(%rip), %rsi      # 0xc13a
leaq 0x98f6(%rip), %rdx      # 0xc145
leaq 0x1a0(%rsp), %rcx
leaq 0xa0(%rsp), %r8
movdqa 0x40(%rsp), %xmm0
movb $0x2, %al
callq 0x9de8
jmp 0x26f3
leaq 0x98c2(%rip), %rsi      # 0xc13a
leaq 0x981b(%rip), %rdx      # 0xc09a
xorl %edi, %edi
xorl %eax, %eax
callq 0x9de8
movq %r12, %rdi
callq 0x3aeb
movq %r15, %rdi
callq 0x3aeb
movq %r14, %rdi
callq 0x3aeb
jmp 0x2aa0
movq %r12, %rdi
callq 0x3aeb
movq %r15, %rdi
callq 0x3aeb
movq %r14, %rdi
callq 0x3aeb
leaq 0x9ae7(%rip), %rdi      # 0xc3ab
callq 0x2060
xorl %edi, %edi
callq 0x3a14
movq %rax, %r14
xorl %edi, %edi
callq 0x3a14
movq %rax, %r15
xorl %edi, %edi
callq 0x3a14
movq %rax, %r12
movl $0x186a0, %ebp          # imm = 0x186A0
subl $0x1, %ebp
jb 0x2a7f
movl $0x133, %edi            # imm = 0x133
callq 0x395a
movq %xmm0, 0x10(%rsp)
movl $0x133, %edi            # imm = 0x133
callq 0x395a
movdqa %xmm0, %xmm1
movq %xmm0, 0x40(%rsp)
movq 0x10(%rsp), %xmm0
movq %xmm0, %rax
movq %xmm1, %rcx
xorl %ebx, %ebx
xorq %rax, %rcx
setns %r13b
movq %r14, %rdi
callq 0x3d8d
movq %r15, %rdi
movsd 0x40(%rsp), %xmm0
callq 0x3d8d
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4c16
movq %r14, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4c16
movq %r14, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x2a68
movq %r15, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x2a68
movq %r12, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x2a68
movb %r13b, %bl
leaq 0x9682(%rip), %rax      # 0xc020
movsd (%rax,%rbx,8), %xmm0
movsd %xmm0, 0x20(%rsp)
movq %r12, %rdi
leaq 0x1a0(%rsp), %rsi
callq 0x3fc0
movq %r14, %rdi
leaq 0xa0(%rsp), %rsi
callq 0x3fc0
movsd 0x10(%rsp), %xmm1
subsd 0x40(%rsp), %xmm1
movq 0x1a0(%rsp), %xmm0
movq %xmm0, 0x58(%rsp)
movsd %xmm1, 0x38(%rsp)
movsd 0x20(%rsp), %xmm2
callq 0x38d0
movq 0xa0(%rsp), %xmm4
pxor 0x962a(%rip), %xmm4     # 0xc030
testb %al, %al
je 0x2a33
movdqa %xmm4, %xmm0
movsd 0x38(%rsp), %xmm1
movsd 0x20(%rsp), %xmm2
movdqa %xmm4, 0x20(%rsp)
callq 0x38d0
movdqa 0x20(%rsp), %xmm4
testb %al, %al
jne 0x28ec
pushq $0x1
popq %rdi
leaq 0x96fd(%rip), %rsi      # 0xc13a
leaq 0x9740(%rip), %rdx      # 0xc184
movq 0x10(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
movsd 0x38(%rsp), %xmm2
movsd 0x58(%rsp), %xmm3
movb $0x5, %al
callq 0x9de8
jmp 0x28ec
leaq 0x96cb(%rip), %rsi      # 0xc13a
leaq 0x9624(%rip), %rdx      # 0xc09a
xorl %edi, %edi
xorl %eax, %eax
callq 0x9de8
movq %r14, %rdi
callq 0x3aeb
movq %r15, %rdi
callq 0x3aeb
movq %r12, %rdi
callq 0x3aeb
movl 0x54(%rsp), %edi
callq 0xa010
pushq $0x1
popq %rdi
callq 0xa010
movl %eax, 0x54(%rsp)
xorl %edi, %edi
callq 0x3a14
movq %rax, 0x40(%rsp)
xorl %edi, %edi
callq 0x3a14
movq %rax, 0x10(%rsp)
xorl %edi, %edi
callq 0x3a14
movq %rax, 0x20(%rsp)
pushq $0x10
popq %r14
leaq 0x1a0a5(%rip), %r13     # 0x1cb80
movq 0x10(%rsp), %rbp
leaq 0x18(%r14), %r15
cmpq $0xb8, %r15
je 0x2b9d
movq -0x10(%r14,%r13), %rsi
movq -0x8(%r14,%r13), %r12
movq 0x40(%rsp), %rbx
movq %rbx, %rdi
movq %rsi, 0x38(%rsp)
callq 0x41f8
movq %rbp, %rdi
movq %r12, 0x58(%rsp)
movq %r12, %rsi
callq 0x41f8
movq 0x20(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
leaq 0x1a0(%rsp), %rbx
movq %rbp, %rdx
callq 0x4c1e
movq %r12, %rdi
movq %rbx, %rsi
movl $0x168, %edx            # imm = 0x168
callq 0x451d
movq %r12, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x2d3a
movq (%r14,%r13), %rsi
movq %rbx, %rdi
callq 0x2110
movq %r15, %r14
testl %eax, %eax
je 0x2ae0
leaq 0x967e(%rip), %rsi      # 0xc1f4
leaq 0x9682(%rip), %rdx      # 0xc1ff
leaq 0x1a0(%rsp), %r9
xorl %edi, %edi
movq 0x38(%rsp), %rcx
movq 0x58(%rsp), %r8
xorl %eax, %eax
callq 0x9de8
jmp 0x2d51
movq 0x40(%rsp), %rdi
callq 0x3aeb
movq 0x10(%rsp), %rdi
callq 0x3aeb
movq 0x20(%rsp), %rdi
callq 0x3aeb
leaq 0x97fb(%rip), %rdi      # 0xc3bd
callq 0x2060
pushq $0x1e
popq %rdi
callq 0x3a14
movq %rax, %r12
pushq $0x32
popq %rdi
callq 0x3a14
movq %rax, %r15
pushq $0x28
popq %rdi
callq 0x3a14
movq %rax, %r14
movl $0x186a0, %ebx          # imm = 0x186A0
leaq 0xa0(%rsp), %r13
leaq 0x120(%rsp), %rbp
subl $0x1, %ebx
jb 0x3466
movq %r13, %rdi
callq 0x384f
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x41f8
movq %rbp, %rdi
callq 0x384f
fldt 0x10(%rsp)
fmulp %st, %st(1)
fstpt 0x10(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
callq 0x41f8
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x4c1e
movq %r15, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x4c1e
movq %r14, %rdi
leaq 0x60(%rsp), %rsi
callq 0x3fc0
movq %r15, %rdi
leaq 0x68(%rsp), %rsi
callq 0x3fc0
movq %r12, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x2d6c
movq %r15, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x2d6c
movq %r14, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x2d6c
fldt 0x10(%rsp)
fstpl 0x88(%rsp)
movq 0x88(%rsp), %xmm0
movsd 0x60(%rsp), %xmm1
movq %xmm0, 0x20(%rsp)
movsd %xmm1, 0x40(%rsp)
movsd 0x9372(%rip), %xmm2     # 0xc040
callq 0x38d0
movsd 0x68(%rsp), %xmm1
testb %al, %al
je 0x2d0a
movq 0x20(%rsp), %xmm0
movsd %xmm1, 0x20(%rsp)
movsd 0x20(%rsp), %xmm1
movsd 0x9349(%rip), %xmm2     # 0xc040
callq 0x38d0
movsd 0x20(%rsp), %xmm1
testb %al, %al
jne 0x2bfd
fldt 0x10(%rsp)
fstpt (%rsp)
pushq $0x1
popq %rdi
leaq 0x94d9(%rip), %rsi      # 0xc1f4
leaq 0x94eb(%rip), %rdx      # 0xc20d
movq %r13, %rcx
movq %rbp, %r8
movq 0x40(%rsp), %xmm0
movb $0x2, %al
callq 0x9de8
jmp 0x2bfd
leaq 0x94b3(%rip), %rsi      # 0xc1f4
leaq 0x9352(%rip), %rdx      # 0xc09a
xorl %edi, %edi
xorl %eax, %eax
callq 0x9de8
movq 0x40(%rsp), %rdi
callq 0x3aeb
movq 0x10(%rsp), %rdi
callq 0x3aeb
movq 0x20(%rsp), %rdi
jmp 0x2d96
leaq 0x9481(%rip), %rsi      # 0xc1f4
leaq 0x9320(%rip), %rdx      # 0xc09a
xorl %edi, %edi
xorl %eax, %eax
callq 0x9de8
movq %r12, %rdi
callq 0x3aeb
movq %r15, %rdi
callq 0x3aeb
movq %r14, %rdi
callq 0x3aeb
pushq $0x1
popq %rdi
callq 0xa010
movl %eax, 0x54(%rsp)
xorl %edi, %edi
callq 0x3a14
movq %rax, 0x40(%rsp)
xorl %edi, %edi
callq 0x3a14
movq %rax, 0x10(%rsp)
xorl %edi, %edi
callq 0x3a14
movq %rax, 0x20(%rsp)
pushq $0x10
popq %r14
leaq 0x19e3a(%rip), %r13     # 0x1cc10
movq 0x10(%rsp), %rbp
leaq 0x18(%r14), %r15
cmpq $0x58, %r15
je 0x2e95
movq -0x10(%r14,%r13), %rsi
movq -0x8(%r14,%r13), %r12
movq 0x40(%rsp), %rbx
movq %rbx, %rdi
movq %rsi, 0x38(%rsp)
callq 0x41f8
movq %rbp, %rdi
movq %r12, 0x58(%rsp)
movq %r12, %rsi
callq 0x41f8
movq 0x20(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
leaq 0x1a0(%rsp), %rbx
movq %rbp, %rdx
callq 0x53e6
movq %r12, %rdi
movq %rbx, %rsi
movl $0x168, %edx            # imm = 0x168
callq 0x451d
movq %r12, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x3032
movq (%r14,%r13), %rsi
movq %rbx, %rdi
callq 0x2110
movq %r15, %r14
testl %eax, %eax
je 0x2ddb
leaq 0x9428(%rip), %rsi      # 0xc296
leaq 0x942c(%rip), %rdx      # 0xc2a1
leaq 0x1a0(%rsp), %r9
xorl %edi, %edi
movq 0x38(%rsp), %rcx
movq 0x58(%rsp), %r8
xorl %eax, %eax
callq 0x9de8
jmp 0x3049
movq 0x40(%rsp), %rdi
callq 0x3aeb
movq 0x10(%rsp), %rdi
callq 0x3aeb
movq 0x20(%rsp), %rdi
callq 0x3aeb
leaq 0x9522(%rip), %rdi      # 0xc3dc
callq 0x2060
pushq $0x1e
popq %rdi
callq 0x3a14
movq %rax, %r12
pushq $0x32
popq %rdi
callq 0x3a14
movq %rax, %r15
pushq $0x28
popq %rdi
callq 0x3a14
movq %rax, %r14
movl $0x186a0, %ebx          # imm = 0x186A0
leaq 0xa0(%rsp), %r13
leaq 0x120(%rsp), %rbp
subl $0x1, %ebx
jb 0x35ff
movq %r13, %rdi
callq 0x384f
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x41f8
movq %rbp, %rdi
callq 0x384f
fldt 0x10(%rsp)
fdivp %st, %st(1)
fstpt 0x10(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
callq 0x41f8
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x53e6
movq %r15, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x53e6
movq %r14, %rdi
leaq 0x60(%rsp), %rsi
callq 0x3fc0
movq %r15, %rdi
leaq 0x68(%rsp), %rsi
callq 0x3fc0
movq %r12, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x3064
movq %r15, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x3064
movq %r14, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x3064
fldt 0x10(%rsp)
fstpl 0x80(%rsp)
movq 0x80(%rsp), %xmm0
movsd 0x60(%rsp), %xmm1
movq %xmm0, 0x20(%rsp)
movsd %xmm1, 0x40(%rsp)
movsd 0x907a(%rip), %xmm2     # 0xc040
callq 0x38d0
movsd 0x68(%rsp), %xmm1
testb %al, %al
je 0x3002
movq 0x20(%rsp), %xmm0
movsd %xmm1, 0x20(%rsp)
movsd 0x20(%rsp), %xmm1
movsd 0x9051(%rip), %xmm2     # 0xc040
callq 0x38d0
movsd 0x20(%rsp), %xmm1
testb %al, %al
jne 0x2ef5
fldt 0x10(%rsp)
fstpt (%rsp)
pushq $0x1
popq %rdi
leaq 0x9283(%rip), %rsi      # 0xc296
leaq 0x9295(%rip), %rdx      # 0xc2af
movq %r13, %rcx
movq %rbp, %r8
movq 0x40(%rsp), %xmm0
movb $0x2, %al
callq 0x9de8
jmp 0x2ef5
leaq 0x925d(%rip), %rsi      # 0xc296
leaq 0x905a(%rip), %rdx      # 0xc09a
xorl %edi, %edi
xorl %eax, %eax
callq 0x9de8
movq 0x40(%rsp), %rdi
callq 0x3aeb
movq 0x10(%rsp), %rdi
callq 0x3aeb
movq 0x20(%rsp), %rdi
jmp 0x308e
leaq 0x922b(%rip), %rsi      # 0xc296
leaq 0x9028(%rip), %rdx      # 0xc09a
xorl %edi, %edi
xorl %eax, %eax
callq 0x9de8
movq %r12, %rdi
callq 0x3aeb
movq %r15, %rdi
callq 0x3aeb
movq %r14, %rdi
callq 0x3aeb
pushq $0x1
popq %rdi
callq 0xa010
movl %eax, %ebx
leaq 0x9357(%rip), %rdi      # 0xc3fb
callq 0x2060
pushq $0x32
popq %rbp
movl %ebp, %edi
callq 0x3a14
movq %rax, %r15
movl %ebp, %edi
callq 0x3a14
movq %rax, %r14
movl $0x186a0, %ebp          # imm = 0x186A0
leaq 0x1a0(%rsp), %r12
leaq 0xa0(%rsp), %r13
subl $0x1, %ebp
jb 0x319b
movq %r12, %rdi
callq 0x384f
fstpl 0x78(%rsp)
movsd 0x78(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x41f8
movq %r13, %rdi
callq 0x384f
fstpl 0x70(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x41f8
movq %r15, %rdi
movq %r14, %rsi
callq 0x5dd6
movsd 0x10(%rsp), %xmm1
subsd 0x70(%rsp), %xmm1
testl %eax, %eax
jle 0x313d
ucomisd 0x8f0d(%rip), %xmm1     # 0xc048
ja 0x30d5
testl %eax, %eax
jns 0x314b
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
ja 0x30d5
testl %eax, %eax
jne 0x315f
ucomisd 0x8ef1(%rip), %xmm1     # 0xc048
jne 0x315f
jnp 0x30d5
leaq 0x91ce(%rip), %rsi      # 0xc334
leaq 0x91d2(%rip), %rdx      # 0xc33f
leaq 0x1a0(%rsp), %rcx
leaq 0xa0(%rsp), %r8
xorl %edi, %edi
xorl %eax, %eax
callq 0x9de8
movq %r15, %rdi
callq 0x3aeb
movq %r14, %rdi
callq 0x3aeb
jmp 0x3296
movq %r15, %rdi
callq 0x3aeb
movq %r14, %rdi
callq 0x3aeb
leaq 0x925b(%rip), %rdi      # 0xc40d
callq 0x2060
xorl %edi, %edi
callq 0x3a14
movq %rax, %r14
xorl %edi, %edi
callq 0x3a14
movq %rax, %r15
movl $0x186a0, %ebp          # imm = 0x186A0
subl $0x1, %ebp
jb 0x327f
movl $0x96, %edi
callq 0x395a
movq %xmm0, 0x10(%rsp)
movl $0x96, %edi
callq 0x395a
movq %xmm0, 0x40(%rsp)
movq %r14, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x3d8d
movq %r15, %rdi
movsd 0x40(%rsp), %xmm0
callq 0x3d8d
movq %r14, %rdi
movq %r15, %rsi
callq 0x5dd6
movsd 0x40(%rsp), %xmm3
movsd 0x10(%rsp), %xmm0
movapd %xmm0, %xmm2
subsd %xmm3, %xmm2
testl %eax, %eax
jle 0x3242
ucomisd 0x8e08(%rip), %xmm2     # 0xc048
ja 0x31d0
testl %eax, %eax
jns 0x3250
xorpd %xmm1, %xmm1
ucomisd %xmm2, %xmm1
ja 0x31d0
testl %eax, %eax
jne 0x3264
ucomisd 0x8dec(%rip), %xmm2     # 0xc048
jne 0x3264
jnp 0x31d0
leaq 0x90c9(%rip), %rsi      # 0xc334
leaq 0x90e5(%rip), %rdx      # 0xc357
xorl %edi, %edi
movapd %xmm3, %xmm1
movb $0x2, %al
callq 0x9de8
movq %r14, %rdi
callq 0x3aeb
movq %r15, %rdi
callq 0x3aeb
movl %ebx, %edi
callq 0xa010
xorl %eax, %eax
addq $0x5a8, %rsp            # imm = 0x5A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
callq 0x3aeb
movq %r15, %rdi
callq 0x3aeb
movq %r14, %rdi
callq 0x3aeb
leaq 0x90be(%rip), %rdi      # 0xc387
callq 0x2060
xorl %edi, %edi
callq 0x3a14
movq %rax, %r14
xorl %edi, %edi
callq 0x3a14
movq %rax, %r15
xorl %edi, %edi
callq 0x3a14
movq %rax, %r12
movl $0x186a0, %ebp          # imm = 0x186A0
subl $0x1, %ebp
jb 0x37af
movl $0x133, %edi            # imm = 0x133
callq 0x395a
movq %xmm0, 0x10(%rsp)
movl $0x133, %edi            # imm = 0x133
callq 0x395a
movdqa %xmm0, %xmm1
movq %xmm0, 0x40(%rsp)
movq 0x10(%rsp), %xmm0
movq %xmm0, %rax
movq %xmm1, %rcx
xorl %r13d, %r13d
xorq %rax, %rcx
setns %bl
movq %r14, %rdi
callq 0x3d8d
movq %r15, %rdi
movsd 0x40(%rsp), %xmm0
callq 0x3d8d
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4760
movq %r14, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4760
movq %r14, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x3798
movq %r15, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x3798
movq %r12, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x3798
movb %bl, %r13b
leaq 0x8c6d(%rip), %rax      # 0xc010
movsd (%rax,%r13,8), %xmm0
movsd %xmm0, 0x20(%rsp)
movq %r12, %rdi
leaq 0xa0(%rsp), %rsi
callq 0x3fc0
movq %r14, %rdi
leaq 0x120(%rsp), %rsi
callq 0x3fc0
movsd 0x10(%rsp), %xmm1
addsd 0x40(%rsp), %xmm1
movq 0xa0(%rsp), %xmm0
movq %xmm0, 0x58(%rsp)
movsd %xmm1, 0x38(%rsp)
movsd 0x20(%rsp), %xmm2
callq 0x38d0
movq 0x120(%rsp), %xmm4
testb %al, %al
je 0x3431
movdqa %xmm4, %xmm0
movsd 0x38(%rsp), %xmm1
movsd 0x20(%rsp), %xmm2
movq %xmm4, 0x20(%rsp)
callq 0x38d0
movq 0x20(%rsp), %xmm4
testb %al, %al
jne 0x32f1
pushq $0x1
popq %rdi
leaq 0x8c54(%rip), %rsi      # 0xc08f
leaq 0x8cb2(%rip), %rdx      # 0xc0f4
movq 0x10(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
movsd 0x38(%rsp), %xmm2
movsd 0x58(%rsp), %xmm3
movb $0x5, %al
callq 0x9de8
jmp 0x32f1
movq %r12, %rdi
callq 0x3aeb
movq %r15, %rdi
callq 0x3aeb
movq %r14, %rdi
callq 0x3aeb
leaq 0x8f4a(%rip), %rdi      # 0xc3cf
callq 0x2060
xorl %edi, %edi
callq 0x3a14
movq %rax, %r14
xorl %edi, %edi
callq 0x3a14
movq %rax, %r15
xorl %edi, %edi
callq 0x3a14
movq %rax, %r12
movl $0x186a0, %ebp          # imm = 0x186A0
leaq 0xa0(%rsp), %rbx
leaq 0x120(%rsp), %r13
subl $0x1, %ebp
jb 0x37ec
movl $0x96, %edi
callq 0x395a
movq %xmm0, 0x10(%rsp)
movl $0x96, %edi
callq 0x395a
movq %xmm0, 0x40(%rsp)
movq %r14, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x3d8d
movq %r15, %rdi
movsd 0x40(%rsp), %xmm0
callq 0x3d8d
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4c1e
movq %r14, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4c1e
movq %r14, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x37d5
movq %r15, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x37d5
movq %r12, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x37d5
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3fc0
movq %r14, %rdi
movq %r13, %rsi
callq 0x3fc0
movsd 0x10(%rsp), %xmm1
mulsd 0x40(%rsp), %xmm1
movq 0xa0(%rsp), %xmm0
movq %xmm0, 0x38(%rsp)
movsd %xmm1, 0x20(%rsp)
movsd 0x8ab3(%rip), %xmm2     # 0xc040
callq 0x38d0
movq 0x120(%rsp), %xmm4
testb %al, %al
je 0x35ca
movdqa %xmm4, %xmm0
movsd 0x20(%rsp), %xmm1
movsd 0x8a8f(%rip), %xmm2     # 0xc040
movq %xmm4, 0x58(%rsp)
callq 0x38d0
movq 0x58(%rsp), %xmm4
testb %al, %al
jne 0x34bd
pushq $0x1
popq %rdi
leaq 0x8c20(%rip), %rsi      # 0xc1f4
leaq 0x8c71(%rip), %rdx      # 0xc24c
movq 0x10(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
movsd 0x20(%rsp), %xmm2
movsd 0x38(%rsp), %xmm3
movb $0x5, %al
callq 0x9de8
jmp 0x34bd
movq %r12, %rdi
callq 0x3aeb
movq %r15, %rdi
callq 0x3aeb
movq %r14, %rdi
callq 0x3aeb
leaq 0x8dd0(%rip), %rdi      # 0xc3ee
callq 0x2060
xorl %edi, %edi
callq 0x3a14
movq %rax, %r14
xorl %edi, %edi
callq 0x3a14
movq %rax, %r15
xorl %edi, %edi
callq 0x3a14
movq %rax, %r12
movl $0x186a0, %ebp          # imm = 0x186A0
leaq 0xa0(%rsp), %rbx
leaq 0x120(%rsp), %r13
subl $0x1, %ebp
jb 0x3829
movl $0x96, %edi
callq 0x395a
movq %xmm0, 0x10(%rsp)
movl $0x96, %edi
callq 0x395a
movq %xmm0, 0x40(%rsp)
movq %r14, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x3d8d
movq %r15, %rdi
movsd 0x40(%rsp), %xmm0
callq 0x3d8d
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x53e6
movq %r14, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x53e6
movq %r14, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x3812
movq %r15, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x3812
movq %r12, %rdi
callq 0x3b1d
testl %eax, %eax
jne 0x3812
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3fc0
movq %r14, %rdi
movq %r13, %rsi
callq 0x3fc0
movsd 0x10(%rsp), %xmm1
divsd 0x40(%rsp), %xmm1
movq 0xa0(%rsp), %xmm0
movq %xmm0, 0x38(%rsp)
movsd %xmm1, 0x20(%rsp)
movsd 0x891a(%rip), %xmm2     # 0xc040
callq 0x38d0
movq 0x120(%rsp), %xmm4
testb %al, %al
je 0x3763
movdqa %xmm4, %xmm0
movsd 0x20(%rsp), %xmm1
movsd 0x88f6(%rip), %xmm2     # 0xc040
movq %xmm4, 0x58(%rsp)
callq 0x38d0
movq 0x58(%rsp), %xmm4
testb %al, %al
jne 0x3656
pushq $0x1
popq %rdi
leaq 0x8b29(%rip), %rsi      # 0xc296
leaq 0x8b7a(%rip), %rdx      # 0xc2ee
movq 0x10(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
movsd 0x20(%rsp), %xmm2
movsd 0x38(%rsp), %xmm3
movb $0x5, %al
callq 0x9de8
jmp 0x3656
leaq 0x88f0(%rip), %rsi      # 0xc08f
leaq 0x88f4(%rip), %rdx      # 0xc09a
xorl %edi, %edi
xorl %eax, %eax
callq 0x9de8
movq %r14, %rdi
callq 0x3aeb
movq %r15, %rdi
callq 0x3aeb
movq %r12, %rdi
callq 0x3aeb
movl 0x54(%rsp), %edi
callq 0xa010
jmp 0x26b5
leaq 0x8a18(%rip), %rsi      # 0xc1f4
leaq 0x88b7(%rip), %rdx      # 0xc09a
xorl %edi, %edi
xorl %eax, %eax
callq 0x9de8
movq %r14, %rdi
callq 0x3aeb
movq %r15, %rdi
callq 0x3aeb
movq %r12, %rdi
callq 0x3aeb
movl 0x54(%rsp), %edi
callq 0xa010
jmp 0x2d9b
leaq 0x8a7d(%rip), %rsi      # 0xc296
leaq 0x887a(%rip), %rdx      # 0xc09a
xorl %edi, %edi
xorl %eax, %eax
callq 0x9de8
movq %r14, %rdi
callq 0x3aeb
movq %r15, %rdi
callq 0x3aeb
movq %r12, %rdi
callq 0x3aeb
movl 0x54(%rsp), %edi
callq 0xa010
jmp 0x3093