// File: /workspace/github_c_makefile_star2_O1/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
movl $0x1, %edi
callq 0xad09
movl %eax, 0x3c(%rsp)
xorl %edi, %edi
callq 0x4380
movq %rax, 0x20(%rsp)
xorl %edi, %edi
callq 0x4380
movq %rax, 0x18(%rsp)
xorl %edi, %edi
callq 0x4380
movq %rax, 0x40(%rsp)
movl $0x10, %r12d
leaq 0x1acfc(%rip), %r15     # 0x1da90
leaq 0x1a0(%rsp), %rbp
movq 0x20(%rsp), %r14
movq 0x18(%rsp), %rbx
movq -0x10(%r12,%r15), %rsi
movq -0x8(%r12,%r15), %r13
movq %r14, %rdi
movq %rsi, 0x30(%rsp)
callq 0x4bc8
movq %rbx, %rdi
movq %r13, 0x58(%rsp)
movq %r13, %rsi
callq 0x4bc8
movq 0x40(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x5148
movq %r13, %rdi
movq %rbp, %rsi
movl $0x168, %edx            # imm = 0x168
callq 0x4ef6
movq %r13, %rdi
callq 0x4493
testl %eax, %eax
jne 0x2e1d
movq (%r12,%r15), %rsi
movq %rbp, %rdi
callq 0x2110
testl %eax, %eax
jne 0x2e36
addq $0x18, %r12
cmpq $0x100, %r12            # imm = 0x100
jne 0x2da6
xorl %ebx, %ebx
jmp 0x2e61
leaq 0xa26b(%rip), %rsi      # 0xd08f
leaq 0xa26f(%rip), %rdx      # 0xd09a
xorl %edi, %edi
xorl %eax, %eax
callq 0xab7a
jmp 0x2e5f
leaq 0xa252(%rip), %rsi      # 0xd08f
leaq 0xa263(%rip), %rdx      # 0xd0a7
leaq 0x1a0(%rsp), %r9
xorl %edi, %edi
movq 0x30(%rsp), %rcx
movq 0x58(%rsp), %r8
xorl %eax, %eax
callq 0xab7a
movb $0x1, %bl
movq 0x20(%rsp), %rdi
callq 0x445e
movq 0x18(%rsp), %rdi
callq 0x445e
movq 0x40(%rsp), %rdi
callq 0x445e
testb %bl, %bl
jne 0x3241
movl %ebx, 0x18(%rsp)
leaq 0xa4e3(%rip), %rdi      # 0xd375
callq 0x2060
movl $0x1e, %edi
callq 0x4380
movq %rax, %r14
movl $0x32, %edi
callq 0x4380
movq %rax, %r15
movl $0x28, %edi
callq 0x4380
movq %rax, %r12
movl $0x1869f, %ebx          # imm = 0x1869F
leaq 0xa0(%rsp), %r13
movq %r13, %rdi
callq 0x4182
fstpt 0x20(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x4bc8
leaq 0x120(%rsp), %r13
movq %r13, %rdi
callq 0x4182
fldt 0x20(%rsp)
faddp %st, %st(1)
fstpt 0x20(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x4bc8
movzwl (%r14), %eax
xorl %r13d, %r13d
cmpw (%r15), %ax
sete %bpl
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x5148
movq %r15, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x5148
movq %r12, %rdi
leaq 0x68(%rsp), %rsi
callq 0x4982
movq %r15, %rdi
leaq 0x60(%rsp), %rsi
callq 0x4982
movq %r14, %rdi
callq 0x4493
testl %eax, %eax
jne 0x2f70
movq %r15, %rdi
callq 0x4493
testl %eax, %eax
jne 0x2f70
movq %r12, %rdi
callq 0x4493
testl %eax, %eax
je 0x2faa
xorl %edi, %edi
leaq 0xa116(%rip), %rsi      # 0xd08f
leaq 0xa11a(%rip), %rdx      # 0xd09a
xorl %eax, %eax
callq 0xab7a
movb $0x1, %al
movb $0x1, %cl
movl %ecx, 0x18(%rsp)
subl $0x1, %ebx
setb %cl
testb %al, %al
jne 0x304e
testb %cl, %cl
je 0x2ec3
jmp 0x304e
movb %bpl, %r13b
leaq 0xa05c(%rip), %rax      # 0xd010
movsd (%rax,%r13,8), %xmm2
fldt 0x20(%rsp)
fstpl 0x98(%rsp)
movq 0x98(%rsp), %xmm0
movsd 0x68(%rsp), %xmm1
movq %xmm0, 0x58(%rsp)
movsd %xmm1, 0x40(%rsp)
movsd %xmm2, 0x30(%rsp)
callq 0x423a
testb %al, %al
je 0x300a
movsd 0x60(%rsp), %xmm1
movq 0x58(%rsp), %xmm0
movsd 0x30(%rsp), %xmm2
callq 0x423a
testb %al, %al
jne 0x3047
movsd 0x60(%rsp), %xmm1
fldt 0x20(%rsp)
fstpt (%rsp)
movl $0x1, %edi
leaq 0xa06c(%rip), %rsi      # 0xd08f
leaq 0xa08b(%rip), %rdx      # 0xd0b5
leaq 0xa0(%rsp), %rcx
leaq 0x120(%rsp), %r8
movq 0x40(%rsp), %xmm0
movb $0x2, %al
callq 0xab7a
xorl %eax, %eax
jmp 0x2f8f
movq %r14, %rdi
callq 0x445e
movq %r15, %rdi
callq 0x445e
movq %r12, %rdi
callq 0x445e
testb $0x1, 0x18(%rsp)
jne 0x3241
leaq 0xa30f(%rip), %rdi      # 0xd387
callq 0x2060
xorl %edi, %edi
callq 0x4380
movq %rax, %rbx
xorl %edi, %edi
callq 0x4380
movq %rax, %r14
xorl %edi, %edi
callq 0x4380
movq %rax, %r15
movl $0x186a0, %ebp          # imm = 0x186A0
movl $0x133, %edi            # imm = 0x133
callq 0x42c4
movq %xmm0, 0x20(%rsp)
movl $0x133, %edi            # imm = 0x133
callq 0x42c4
movdqa %xmm0, %xmm1
movq %xmm0, 0x18(%rsp)
movq 0x20(%rsp), %xmm0
movq %xmm0, %rax
movq %xmm1, %rcx
xorl %r12d, %r12d
xorq %rax, %rcx
setns %r13b
movq %rbx, %rdi
callq 0x477f
movq %r14, %rdi
movsd 0x18(%rsp), %xmm0
callq 0x477f
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x5148
movq %rbx, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x5148
movq %rbx, %rdi
callq 0x4493
testl %eax, %eax
jne 0x3209
movq %r14, %rdi
callq 0x4493
testl %eax, %eax
jne 0x3209
movq %r15, %rdi
callq 0x4493
testl %eax, %eax
jne 0x3209
movb %r13b, %r12b
leaq 0x9ec6(%rip), %rax      # 0xd010
movsd (%rax,%r12,8), %xmm0
movsd %xmm0, 0x40(%rsp)
movq %r15, %rdi
leaq 0xa0(%rsp), %rsi
callq 0x4982
movq %rbx, %rdi
leaq 0x120(%rsp), %rsi
callq 0x4982
movsd 0x20(%rsp), %xmm1
addsd 0x18(%rsp), %xmm1
movq 0xa0(%rsp), %xmm0
movq %xmm0, 0x58(%rsp)
movsd %xmm1, 0x30(%rsp)
movsd 0x40(%rsp), %xmm2
callq 0x423a
testb %al, %al
je 0x31c4
movq 0x120(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
movsd 0x40(%rsp), %xmm2
callq 0x423a
testb %al, %al
jne 0x31ff
movsd 0x120(%rsp), %xmm4
movl $0x1, %edi
leaq 0x9eb6(%rip), %rsi      # 0xd08f
leaq 0x9f14(%rip), %rdx      # 0xd0f4
movq 0x20(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movsd 0x30(%rsp), %xmm2
movsd 0x58(%rsp), %xmm3
movb $0x5, %al
callq 0xab7a
decl %ebp
jne 0x30a0
jmp 0x3220
leaq 0x9e7f(%rip), %rsi      # 0xd08f
leaq 0x9e83(%rip), %rdx      # 0xd09a
xorl %edi, %edi
xorl %eax, %eax
callq 0xab7a
movq %rbx, %rdi
callq 0x445e
movq %r14, %rdi
callq 0x445e
movq %r15, %rdi
callq 0x445e
movl 0x3c(%rsp), %edi
callq 0xad09
movl $0x1, %edi
callq 0xad09
movl %eax, 0x3c(%rsp)
leaq 0xa13e(%rip), %rdi      # 0xd394
callq 0x2060
movl $0x1e, %edi
callq 0x4380
movq %rax, %r14
movl $0x32, %edi
callq 0x4380
movq %rax, %r15
movl $0x28, %edi
callq 0x4380
movq %rax, %r12
movl $0x1869f, %ebx          # imm = 0x1869F
movl $0x0, 0x18(%rsp)
leaq 0x1a0(%rsp), %r13
movq %r13, %rdi
callq 0x4182
fstpt 0x20(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x4bc8
leaq 0xa0(%rsp), %r13
movq %r13, %rdi
callq 0x4182
fldt 0x20(%rsp)
fsubp %st, %st(1)
fstpt 0x20(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x4bc8
movzwl (%r14), %eax
xorl %r13d, %r13d
cmpw (%r15), %ax
sete %bpl
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x5625
movq %r15, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x5625
movq %r12, %rdi
leaq 0x120(%rsp), %rsi
callq 0x4982
movq %r15, %rdi
leaq 0x68(%rsp), %rsi
callq 0x4982
movq %r14, %rdi
callq 0x4493
testl %eax, %eax
jne 0x333f
movq %r15, %rdi
callq 0x4493
testl %eax, %eax
jne 0x333f
movq %r12, %rdi
callq 0x4493
testl %eax, %eax
je 0x3379
xorl %edi, %edi
leaq 0x9df2(%rip), %rsi      # 0xd13a
leaq 0x9d4b(%rip), %rdx      # 0xd09a
xorl %eax, %eax
callq 0xab7a
movb $0x1, %al
movb $0x1, %cl
movl %ecx, 0x18(%rsp)
subl $0x1, %ebx
setb %cl
testb %al, %al
jne 0x3428
testb %cl, %cl
je 0x328f
jmp 0x3428
movb %bpl, %r13b
leaq 0x9c9d(%rip), %rax      # 0xd020
movsd (%rax,%r13,8), %xmm2
fldt 0x20(%rsp)
fstpl 0x90(%rsp)
movq 0x90(%rsp), %xmm0
movsd 0x120(%rsp), %xmm1
xorpd 0x9c82(%rip), %xmm1     # 0xd030
movq %xmm0, 0x58(%rsp)
movapd %xmm1, 0x40(%rsp)
movsd %xmm2, 0x30(%rsp)
callq 0x423a
testb %al, %al
je 0x33e4
movsd 0x68(%rsp), %xmm1
movq 0x58(%rsp), %xmm0
movsd 0x30(%rsp), %xmm2
callq 0x423a
testb %al, %al
jne 0x3421
movsd 0x68(%rsp), %xmm1
fldt 0x20(%rsp)
fstpt (%rsp)
movl $0x1, %edi
leaq 0x9d3d(%rip), %rsi      # 0xd13a
leaq 0x9d41(%rip), %rdx      # 0xd145
leaq 0x1a0(%rsp), %rcx
leaq 0xa0(%rsp), %r8
movdqa 0x40(%rsp), %xmm0
movb $0x2, %al
callq 0xab7a
xorl %eax, %eax
jmp 0x335e
movq %r14, %rdi
callq 0x445e
movq %r15, %rdi
callq 0x445e
movq %r12, %rdi
callq 0x445e
testb $0x1, 0x18(%rsp)
jne 0x362a
leaq 0x9f59(%rip), %rdi      # 0xd3ab
callq 0x2060
xorl %edi, %edi
callq 0x4380
movq %rax, %r14
xorl %edi, %edi
callq 0x4380
movq %rax, %rbx
xorl %edi, %edi
callq 0x4380
movq %rax, %r15
movl $0x186a0, %ebp          # imm = 0x186A0
movl $0x133, %edi            # imm = 0x133
callq 0x42c4
movq %xmm0, 0x20(%rsp)
movl $0x133, %edi            # imm = 0x133
callq 0x42c4
movdqa %xmm0, %xmm1
movq %xmm0, 0x18(%rsp)
movq 0x20(%rsp), %xmm0
movq %xmm0, %rax
movq %xmm1, %rcx
xorl %r12d, %r12d
xorq %rax, %rcx
setns %r13b
movq %r14, %rdi
callq 0x477f
movq %rbx, %rdi
movsd 0x18(%rsp), %xmm0
callq 0x477f
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x5625
movq %r14, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x5625
movq %r14, %rdi
callq 0x4493
testl %eax, %eax
jne 0x35f2
movq %rbx, %rdi
callq 0x4493
testl %eax, %eax
jne 0x35f2
movq %r15, %rdi
callq 0x4493
testl %eax, %eax
jne 0x35f2
movb %r13b, %r12b
leaq 0x9afc(%rip), %rax      # 0xd020
movsd (%rax,%r12,8), %xmm0
movsd %xmm0, 0x40(%rsp)
movq %r15, %rdi
leaq 0x1a0(%rsp), %rsi
callq 0x4982
movq %r14, %rdi
leaq 0xa0(%rsp), %rsi
callq 0x4982
movsd 0x20(%rsp), %xmm1
subsd 0x18(%rsp), %xmm1
movq 0x1a0(%rsp), %xmm0
movq %xmm0, 0x58(%rsp)
movsd %xmm1, 0x30(%rsp)
movsd 0x40(%rsp), %xmm2
callq 0x423a
testb %al, %al
je 0x35a6
movq 0xa0(%rsp), %xmm0
pxor 0x9a9f(%rip), %xmm0     # 0xd030
movsd 0x30(%rsp), %xmm1
movsd 0x40(%rsp), %xmm2
callq 0x423a
testb %al, %al
jne 0x35e8
movsd 0xa0(%rsp), %xmm4
xorps 0x9a7a(%rip), %xmm4     # 0xd030
movl $0x1, %edi
leaq 0x9b78(%rip), %rsi      # 0xd13a
leaq 0x9bbb(%rip), %rdx      # 0xd184
movq 0x20(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movsd 0x30(%rsp), %xmm2
movsd 0x58(%rsp), %xmm3
movb $0x5, %al
callq 0xab7a
decl %ebp
jne 0x347a
jmp 0x3609
leaq 0x9b41(%rip), %rsi      # 0xd13a
leaq 0x9a9a(%rip), %rdx      # 0xd09a
xorl %edi, %edi
xorl %eax, %eax
callq 0xab7a
movq %r14, %rdi
callq 0x445e
movq %rbx, %rdi
callq 0x445e
movq %r15, %rdi
callq 0x445e
movl 0x3c(%rsp), %edi
callq 0xad09
movl $0x1, %edi
callq 0xad09
movl %eax, 0x3c(%rsp)
xorl %edi, %edi
callq 0x4380
movq %rax, 0x20(%rsp)
xorl %edi, %edi
callq 0x4380
movq %rax, 0x18(%rsp)
xorl %edi, %edi
callq 0x4380
movq %rax, 0x40(%rsp)
movl $0x10, %r12d
leaq 0x1a517(%rip), %r15     # 0x1db80
leaq 0x1a0(%rsp), %rbp
movq 0x20(%rsp), %r14
movq 0x18(%rsp), %rbx
movq -0x10(%r12,%r15), %rsi
movq -0x8(%r12,%r15), %r13
movq %r14, %rdi
movq %rsi, 0x30(%rsp)
callq 0x4bc8
movq %rbx, %rdi
movq %r13, 0x58(%rsp)
movq %r13, %rsi
callq 0x4bc8
movq 0x40(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x562f
movq %r13, %rdi
movq %rbp, %rsi
movl $0x168, %edx            # imm = 0x168
callq 0x4ef6
movq %r13, %rdi
callq 0x4493
testl %eax, %eax
jne 0x36f2
movq (%r12,%r15), %rsi
movq %rbp, %rdi
callq 0x2110
testl %eax, %eax
jne 0x370b
addq $0x18, %r12
cmpq $0xa0, %r12
jne 0x367b
xorl %ebx, %ebx
jmp 0x3736
leaq 0x9afb(%rip), %rsi      # 0xd1f4
leaq 0x999a(%rip), %rdx      # 0xd09a
xorl %edi, %edi
xorl %eax, %eax
callq 0xab7a
jmp 0x3734
leaq 0x9ae2(%rip), %rsi      # 0xd1f4
leaq 0x9ae6(%rip), %rdx      # 0xd1ff
leaq 0x1a0(%rsp), %r9
xorl %edi, %edi
movq 0x30(%rsp), %rcx
movq 0x58(%rsp), %r8
xorl %eax, %eax
callq 0xab7a
movb $0x1, %bl
movq 0x20(%rsp), %rdi
callq 0x445e
movq 0x18(%rsp), %rdi
callq 0x445e
movq 0x40(%rsp), %rdi
callq 0x445e
testb %bl, %bl
jne 0x3acd
movl %ebx, 0x18(%rsp)
leaq 0x9c56(%rip), %rdi      # 0xd3bd
callq 0x2060
movl $0x1e, %edi
callq 0x4380
movq %rax, %r14
movl $0x32, %edi
callq 0x4380
movq %rax, %r15
movl $0x28, %edi
callq 0x4380
movq %rax, %r12
movl $0x1869f, %ebx          # imm = 0x1869F
leaq 0xa0(%rsp), %r13
leaq 0x120(%rsp), %rbp
movq %r13, %rdi
callq 0x4182
fstpt 0x20(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x4bc8
movq %rbp, %rdi
callq 0x4182
fldt 0x20(%rsp)
fmulp %st, %st(1)
fstpt 0x20(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
callq 0x4bc8
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x562f
movq %r15, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x562f
movq %r12, %rdi
leaq 0x68(%rsp), %rsi
callq 0x4982
movq %r15, %rdi
leaq 0x60(%rsp), %rsi
callq 0x4982
movq %r14, %rdi
callq 0x4493
testl %eax, %eax
jne 0x3836
movq %r15, %rdi
callq 0x4493
testl %eax, %eax
jne 0x3836
movq %r12, %rdi
callq 0x4493
testl %eax, %eax
je 0x3870
xorl %edi, %edi
leaq 0x99b5(%rip), %rsi      # 0xd1f4
leaq 0x9854(%rip), %rdx      # 0xd09a
xorl %eax, %eax
callq 0xab7a
movb $0x1, %al
movb $0x1, %cl
movl %ecx, 0x18(%rsp)
subl $0x1, %ebx
setb %cl
testb %al, %al
jne 0x38fe
testb %cl, %cl
je 0x37a8
jmp 0x38fe
fldt 0x20(%rsp)
fstpl 0x88(%rsp)
movq 0x88(%rsp), %xmm0
movsd 0x68(%rsp), %xmm1
movq %xmm0, 0x30(%rsp)
movsd %xmm1, 0x40(%rsp)
movsd 0x97a2(%rip), %xmm2     # 0xd040
callq 0x423a
testb %al, %al
je 0x38c4
movsd 0x60(%rsp), %xmm1
movq 0x30(%rsp), %xmm0
movsd 0x9785(%rip), %xmm2     # 0xd040
callq 0x423a
testb %al, %al
jne 0x38f7
movsd 0x60(%rsp), %xmm1
fldt 0x20(%rsp)
fstpt (%rsp)
movl $0x1, %edi
leaq 0x9917(%rip), %rsi      # 0xd1f4
leaq 0x9929(%rip), %rdx      # 0xd20d
movq %r13, %rcx
movq %rbp, %r8
movq 0x40(%rsp), %xmm0
movb $0x2, %al
callq 0xab7a
xorl %eax, %eax
jmp 0x3855
movq %r14, %rdi
callq 0x445e
movq %r15, %rdi
callq 0x445e
movq %r12, %rdi
callq 0x445e
testb $0x1, 0x18(%rsp)
jne 0x3acd
leaq 0x9aa7(%rip), %rdi      # 0xd3cf
callq 0x2060
xorl %edi, %edi
callq 0x4380
movq %rax, %rbx
xorl %edi, %edi
callq 0x4380
movq %rax, %r14
xorl %edi, %edi
callq 0x4380
movq %rax, %r15
movl $0x186a0, %ebp          # imm = 0x186A0
leaq 0xa0(%rsp), %r12
leaq 0x120(%rsp), %r13
movl $0x96, %edi
callq 0x42c4
movq %xmm0, 0x20(%rsp)
movl $0x96, %edi
callq 0x42c4
movq %xmm0, 0x18(%rsp)
movq %rbx, %rdi
movsd 0x20(%rsp), %xmm0
callq 0x477f
movq %r14, %rdi
movsd 0x18(%rsp), %xmm0
callq 0x477f
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x562f
movq %rbx, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x562f
movq %rbx, %rdi
callq 0x4493
testl %eax, %eax
jne 0x3a95
movq %r14, %rdi
callq 0x4493
testl %eax, %eax
jne 0x3a95
movq %r15, %rdi
callq 0x4493
testl %eax, %eax
jne 0x3a95
movq %r15, %rdi
movq %r12, %rsi
callq 0x4982
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4982
movsd 0x20(%rsp), %xmm1
mulsd 0x18(%rsp), %xmm1
movq 0xa0(%rsp), %xmm0
movq %xmm0, 0x30(%rsp)
movsd %xmm1, 0x40(%rsp)
movsd 0x9619(%rip), %xmm2     # 0xd040
callq 0x423a
testb %al, %al
je 0x3a50
movq 0x120(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
movsd 0x95f9(%rip), %xmm2     # 0xd040
callq 0x423a
testb %al, %al
jne 0x3a8b
movsd 0x120(%rsp), %xmm4
movl $0x1, %edi
leaq 0x978f(%rip), %rsi      # 0xd1f4
leaq 0x97e0(%rip), %rdx      # 0xd24c
movq 0x20(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movsd 0x40(%rsp), %xmm2
movsd 0x30(%rsp), %xmm3
movb $0x5, %al
callq 0xab7a
decl %ebp
jne 0x3960
jmp 0x3aac
leaq 0x9758(%rip), %rsi      # 0xd1f4
leaq 0x95f7(%rip), %rdx      # 0xd09a
xorl %edi, %edi
xorl %eax, %eax
callq 0xab7a
movq %rbx, %rdi
callq 0x445e
movq %r14, %rdi
callq 0x445e
movq %r15, %rdi
callq 0x445e
movl 0x3c(%rsp), %edi
callq 0xad09
movl $0x1, %edi
callq 0xad09
movl %eax, 0x3c(%rsp)
xorl %r12d, %r12d
xorl %edi, %edi
callq 0x4380
movq %rax, 0x20(%rsp)
xorl %edi, %edi
callq 0x4380
movq %rax, 0x18(%rsp)
xorl %edi, %edi
callq 0x4380
movq %rax, 0x40(%rsp)
leaq 0x1a107(%rip), %r15     # 0x1dc10
leaq 0x1a0(%rsp), %rbp
movq 0x20(%rsp), %r14
movq 0x18(%rsp), %rbx
movq (%r12,%r15), %rsi
movq 0x8(%r12,%r15), %r13
movq %r14, %rdi
movq %rsi, 0x30(%rsp)
callq 0x4bc8
movq %rbx, %rdi
movq %r13, 0x58(%rsp)
movq %r13, %rsi
callq 0x4bc8
movq 0x40(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x5e75
movq %r13, %rdi
movq %rbp, %rsi
movl $0x168, %edx            # imm = 0x168
callq 0x4ef6
movq %r13, %rdi
callq 0x4493
testl %eax, %eax
jne 0x3b8f
movq 0x10(%r12,%r15), %rsi
movq %rbp, %rdi
callq 0x2110
testl %eax, %eax
jne 0x3ba8
addq $0x18, %r12
cmpq $0x18, %r12
je 0x3b1b
xorl %ebx, %ebx
jmp 0x3bd3
leaq 0x9700(%rip), %rsi      # 0xd296
leaq 0x94fd(%rip), %rdx      # 0xd09a
xorl %edi, %edi
xorl %eax, %eax
callq 0xab7a
jmp 0x3bd1
leaq 0x96e7(%rip), %rsi      # 0xd296
leaq 0x96eb(%rip), %rdx      # 0xd2a1
leaq 0x1a0(%rsp), %r9
xorl %edi, %edi
movq 0x30(%rsp), %rcx
movq 0x58(%rsp), %r8
xorl %eax, %eax
callq 0xab7a
movb $0x1, %bl
movq 0x20(%rsp), %rdi
callq 0x445e
movq 0x18(%rsp), %rdi
callq 0x445e
movq 0x40(%rsp), %rdi
callq 0x445e
testb %bl, %bl
jne 0x3f6a
movl %ebx, 0x18(%rsp)
leaq 0x97d8(%rip), %rdi      # 0xd3dc
callq 0x2060
movl $0x1e, %edi
callq 0x4380
movq %rax, %r14
movl $0x32, %edi
callq 0x4380
movq %rax, %r15
movl $0x28, %edi
callq 0x4380
movq %rax, %r12
movl $0x1869f, %ebx          # imm = 0x1869F
leaq 0xa0(%rsp), %r13
leaq 0x120(%rsp), %rbp
movq %r13, %rdi
callq 0x4182
fstpt 0x20(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x4bc8
movq %rbp, %rdi
callq 0x4182
fldt 0x20(%rsp)
fdivp %st, %st(1)
fstpt 0x20(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
callq 0x4bc8
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x5e75
movq %r15, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x5e75
movq %r12, %rdi
leaq 0x68(%rsp), %rsi
callq 0x4982
movq %r15, %rdi
leaq 0x60(%rsp), %rsi
callq 0x4982
movq %r14, %rdi
callq 0x4493
testl %eax, %eax
jne 0x3cd3
movq %r15, %rdi
callq 0x4493
testl %eax, %eax
jne 0x3cd3
movq %r12, %rdi
callq 0x4493
testl %eax, %eax
je 0x3d0d
xorl %edi, %edi
leaq 0x95ba(%rip), %rsi      # 0xd296
leaq 0x93b7(%rip), %rdx      # 0xd09a
xorl %eax, %eax
callq 0xab7a
movb $0x1, %al
movb $0x1, %cl
movl %ecx, 0x18(%rsp)
subl $0x1, %ebx
setb %cl
testb %al, %al
jne 0x3d9b
testb %cl, %cl
je 0x3c45
jmp 0x3d9b
fldt 0x20(%rsp)
fstpl 0x80(%rsp)
movq 0x80(%rsp), %xmm0
movsd 0x68(%rsp), %xmm1
movq %xmm0, 0x30(%rsp)
movsd %xmm1, 0x40(%rsp)
movsd 0x9305(%rip), %xmm2     # 0xd040
callq 0x423a
testb %al, %al
je 0x3d61
movsd 0x60(%rsp), %xmm1
movq 0x30(%rsp), %xmm0
movsd 0x92e8(%rip), %xmm2     # 0xd040
callq 0x423a
testb %al, %al
jne 0x3d94
movsd 0x60(%rsp), %xmm1
fldt 0x20(%rsp)
fstpt (%rsp)
movl $0x1, %edi
leaq 0x951c(%rip), %rsi      # 0xd296
leaq 0x952e(%rip), %rdx      # 0xd2af
movq %r13, %rcx
movq %rbp, %r8
movq 0x40(%rsp), %xmm0
movb $0x2, %al
callq 0xab7a
xorl %eax, %eax
jmp 0x3cf2
movq %r14, %rdi
callq 0x445e
movq %r15, %rdi
callq 0x445e
movq %r12, %rdi
callq 0x445e
testb $0x1, 0x18(%rsp)
jne 0x3f6a
leaq 0x9629(%rip), %rdi      # 0xd3ee
callq 0x2060
xorl %edi, %edi
callq 0x4380
movq %rax, %rbx
xorl %edi, %edi
callq 0x4380
movq %rax, %r14
xorl %edi, %edi
callq 0x4380
movq %rax, %r15
movl $0x186a0, %ebp          # imm = 0x186A0
leaq 0xa0(%rsp), %r12
leaq 0x120(%rsp), %r13
movl $0x96, %edi
callq 0x42c4
movq %xmm0, 0x20(%rsp)
movl $0x96, %edi
callq 0x42c4
movq %xmm0, 0x18(%rsp)
movq %rbx, %rdi
movsd 0x20(%rsp), %xmm0
callq 0x477f
movq %r14, %rdi
movsd 0x18(%rsp), %xmm0
callq 0x477f
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x5e75
movq %rbx, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x5e75
movq %rbx, %rdi
callq 0x4493
testl %eax, %eax
jne 0x3f32
movq %r14, %rdi
callq 0x4493
testl %eax, %eax
jne 0x3f32
movq %r15, %rdi
callq 0x4493
testl %eax, %eax
jne 0x3f32
movq %r15, %rdi
movq %r12, %rsi
callq 0x4982
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4982
movsd 0x20(%rsp), %xmm1
divsd 0x18(%rsp), %xmm1
movq 0xa0(%rsp), %xmm0
movq %xmm0, 0x30(%rsp)
movsd %xmm1, 0x40(%rsp)
movsd 0x917c(%rip), %xmm2     # 0xd040
callq 0x423a
testb %al, %al
je 0x3eed
movq 0x120(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
movsd 0x915c(%rip), %xmm2     # 0xd040
callq 0x423a
testb %al, %al
jne 0x3f28
movsd 0x120(%rsp), %xmm4
movl $0x1, %edi
leaq 0x9394(%rip), %rsi      # 0xd296
leaq 0x93e5(%rip), %rdx      # 0xd2ee
movq 0x20(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movsd 0x40(%rsp), %xmm2
movsd 0x30(%rsp), %xmm3
movb $0x5, %al
callq 0xab7a
decl %ebp
jne 0x3dfd
jmp 0x3f49
leaq 0x935d(%rip), %rsi      # 0xd296
leaq 0x915a(%rip), %rdx      # 0xd09a
xorl %edi, %edi
xorl %eax, %eax
callq 0xab7a
movq %rbx, %rdi
callq 0x445e
movq %r14, %rdi
callq 0x445e
movq %r15, %rdi
callq 0x445e
movl 0x3c(%rsp), %edi
callq 0xad09
movl $0x1, %edi
callq 0xad09
movl %eax, 0x40(%rsp)
leaq 0x947c(%rip), %rdi      # 0xd3fb
callq 0x2060
movl $0x32, %edi
callq 0x4380
movq %rax, %r14
movl $0x32, %edi
callq 0x4380
movq %rax, %r15
movl $0x1869f, %ebp          # imm = 0x1869F
xorl %ebx, %ebx
leaq 0x1a0(%rsp), %r12
leaq 0xa0(%rsp), %r13
movq %r12, %rdi
callq 0x4182
fstpl 0x78(%rsp)
movsd 0x78(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x4bc8
movq %r13, %rdi
callq 0x4182
fstpl 0x70(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x4bc8
movq %r14, %rdi
movq %r15, %rsi
callq 0x67b8
movsd 0x20(%rsp), %xmm1
subsd 0x70(%rsp), %xmm1
testl %eax, %eax
jle 0x4014
ucomisd 0x9036(%rip), %xmm1     # 0xd048
ja 0x4032
testl %eax, %eax
jns 0x4022
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
ja 0x4032
testl %eax, %eax
jne 0x4048
ucomisd 0x901a(%rip), %xmm1     # 0xd048
jne 0x4048
jp 0x4048
xorl %eax, %eax
subl $0x1, %ebp
setb %cl
testb %al, %al
jne 0x406b
testb %cl, %cl
je 0x3fb5
jmp 0x406b
xorl %edi, %edi
leaq 0x92e3(%rip), %rsi      # 0xd334
leaq 0x92e7(%rip), %rdx      # 0xd33f
movq %r12, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0xab7a
movb $0x1, %al
movb $0x1, %bl
jmp 0x4034
movq %r14, %rdi
callq 0x445e
movq %r15, %rdi
callq 0x445e
testb $0x1, %bl
jne 0x416e
leaq 0x9382(%rip), %rdi      # 0xd40d
callq 0x2060
xorl %edi, %edi
callq 0x4380
movq %rax, %rbx
xorl %edi, %edi
callq 0x4380
movq %rax, %r14
movl $0x186a0, %ebp          # imm = 0x186A0
movl $0x96, %edi
callq 0x42c4
movq %xmm0, 0x20(%rsp)
movl $0x96, %edi
callq 0x42c4
movq %xmm0, 0x18(%rsp)
movq %rbx, %rdi
movsd 0x20(%rsp), %xmm0
callq 0x477f
movq %r14, %rdi
movsd 0x18(%rsp), %xmm0
callq 0x477f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x67b8
movsd 0x18(%rsp), %xmm3
movsd 0x20(%rsp), %xmm0
movapd %xmm0, %xmm2
subsd %xmm3, %xmm2
testl %eax, %eax
jle 0x4112
ucomisd 0x8f38(%rip), %xmm2     # 0xd048
ja 0x4130
testl %eax, %eax
jns 0x4120
xorpd %xmm1, %xmm1
ucomisd %xmm2, %xmm1
ja 0x4130
testl %eax, %eax
jne 0x413a
ucomisd 0x8f1c(%rip), %xmm2     # 0xd048
jne 0x413a
jp 0x413a
decl %ebp
jne 0x40a9
jmp 0x4155
leaq 0x91f3(%rip), %rsi      # 0xd334
leaq 0x920f(%rip), %rdx      # 0xd357
xorl %edi, %edi
movapd %xmm3, %xmm1
movb $0x2, %al
callq 0xab7a
movq %rbx, %rdi
callq 0x445e
movq %r14, %rdi
callq 0x445e
movl 0x40(%rsp), %edi
callq 0xad09
xorl %eax, %eax
addq $0x5a8, %rsp            # imm = 0x5A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq