// File: /workspace/github_c_makefile_star2_O3/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 $0x5b8, %rsp            # imm = 0x5B8
xorl %edi, %edi
callq 0x2140
movl %eax, %edi
callq 0x20f0
movl $0x1, %edi
callq 0xae31
movl %eax, 0x60(%rsp)
xorl %edi, %edi
callq 0x43a0
movq %rax, 0x40(%rsp)
xorl %edi, %edi
callq 0x43a0
movq %rax, 0x10(%rsp)
xorl %edi, %edi
callq 0x43a0
movq %rax, 0x20(%rsp)
movl $0x10, %r12d
leaq 0x1ad7c(%rip), %rbx     # 0x1da90
leaq 0x1b0(%rsp), %rbp
movq 0x40(%rsp), %r14
movq 0x10(%rsp), %r15
movq -0x10(%r12,%rbx), %rsi
movq -0x8(%r12,%rbx), %r13
movq %r14, %rdi
movq %rsi, 0x38(%rsp)
callq 0x4bec
movq %r15, %rdi
movq %r13, 0x58(%rsp)
movq %r13, %rsi
callq 0x4bec
movq 0x20(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x5140
movq %r13, %rdi
movq %rbp, %rsi
movl $0x168, %edx            # imm = 0x168
callq 0x4ef1
movq %r13, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x311b
movq (%r12,%rbx), %rsi
movq %rbp, %rdi
callq 0x2110
testl %eax, %eax
jne 0x3134
addq $0x18, %r12
cmpq $0x100, %r12            # imm = 0x100
jne 0x2d26
movq 0x40(%rsp), %rdi
callq 0x447e
movq 0x10(%rsp), %rdi
callq 0x447e
movq 0x20(%rsp), %rdi
callq 0x447e
leaq 0xa5af(%rip), %rdi      # 0xd375
callq 0x2060
movl $0x1e, %edi
callq 0x43a0
movq %rax, %r12
movl $0x32, %edi
callq 0x43a0
movq %rax, %r15
movl $0x28, %edi
callq 0x43a0
movq %rax, %r14
movl $0x186a0, %ebx          # imm = 0x186A0
leaq 0xb0(%rsp), %r13
movq %r13, %rdi
callq 0x41a4
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x4bec
leaq 0x130(%rsp), %r13
movq %r13, %rdi
callq 0x41a4
fldt 0x10(%rsp)
faddp %st, %st(1)
fstpt 0x10(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x4bec
movzwl (%r12), %eax
xorl %r13d, %r13d
cmpw (%r15), %ax
sete %bpl
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x5140
movq %r15, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x5140
movq %r14, %rdi
leaq 0x68(%rsp), %rsi
callq 0x499e
movq %r15, %rdi
leaq 0x70(%rsp), %rsi
callq 0x499e
movq %r12, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x3178
movq %r15, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x3178
movq %r14, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x3178
movb %bpl, %r13b
leaq 0xa155(%rip), %rax      # 0xd010
movsd (%rax,%r13,8), %xmm2
fldt 0x10(%rsp)
fstpl 0xa8(%rsp)
movq 0xa8(%rsp), %xmm0
movsd 0x68(%rsp), %xmm1
movq %xmm0, 0x20(%rsp)
movsd %xmm1, 0x40(%rsp)
movsd %xmm2, 0x38(%rsp)
callq 0x425c
movsd 0x70(%rsp), %xmm1
testb %al, %al
je 0x2f23
movq 0x20(%rsp), %xmm0
movsd %xmm1, 0x20(%rsp)
movsd 0x20(%rsp), %xmm1
movsd 0x38(%rsp), %xmm2
callq 0x425c
movsd 0x20(%rsp), %xmm1
testb %al, %al
jne 0x2f5a
fldt 0x10(%rsp)
fstpt (%rsp)
movl $0x1, %edi
leaq 0xa159(%rip), %rsi      # 0xd08f
leaq 0xa178(%rip), %rdx      # 0xd0b5
leaq 0xb0(%rsp), %rcx
leaq 0x130(%rsp), %r8
movq 0x40(%rsp), %xmm0
movb $0x2, %al
callq 0xaca2
decl %ebx
jne 0x2df7
movq %r12, %rdi
callq 0x447e
movq %r15, %rdi
callq 0x447e
movq %r14, %rdi
callq 0x447e
leaq 0xa406(%rip), %rdi      # 0xd387
callq 0x2060
xorl %edi, %edi
callq 0x43a0
movq %rax, %r14
xorl %edi, %edi
callq 0x43a0
movq %rax, %r15
xorl %edi, %edi
callq 0x43a0
movq %rax, %r12
movl $0x186a0, %ebp          # imm = 0x186A0
movl $0x133, %edi            # imm = 0x133
callq 0x42e6
movq %xmm0, 0x10(%rsp)
movl $0x133, %edi            # imm = 0x133
callq 0x42e6
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 0x479b
movq %r15, %rdi
movsd 0x40(%rsp), %xmm0
callq 0x479b
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x5140
movq %r14, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x5140
movq %r14, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x40ed
movq %r15, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x40ed
movq %r12, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x40ed
movb %bl, %r13b
leaq 0x9fbe(%rip), %rax      # 0xd010
movsd (%rax,%r13,8), %xmm0
movsd %xmm0, 0x20(%rsp)
movq %r12, %rdi
leaq 0xb0(%rsp), %rsi
callq 0x499e
movq %r14, %rdi
leaq 0x130(%rsp), %rsi
callq 0x499e
movsd 0x10(%rsp), %xmm1
addsd 0x40(%rsp), %xmm1
movq 0xb0(%rsp), %xmm0
movq %xmm0, 0x58(%rsp)
movsd %xmm1, 0x38(%rsp)
movsd 0x20(%rsp), %xmm2
callq 0x425c
movq 0x130(%rsp), %xmm4
testb %al, %al
je 0x30dc
movdqa %xmm4, %xmm0
movsd 0x38(%rsp), %xmm1
movsd 0x20(%rsp), %xmm2
movq %xmm4, 0x20(%rsp)
callq 0x425c
movq 0x20(%rsp), %xmm4
testb %al, %al
jne 0x310e
movl $0x1, %edi
leaq 0x9fa7(%rip), %rsi      # 0xd08f
leaq 0xa005(%rip), %rdx      # 0xd0f4
movq 0x10(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
movsd 0x38(%rsp), %xmm2
movsd 0x58(%rsp), %xmm3
movb $0x5, %al
callq 0xaca2
decl %ebp
jne 0x2fa9
jmp 0x4104
leaq 0x9f6d(%rip), %rsi      # 0xd08f
leaq 0x9f71(%rip), %rdx      # 0xd09a
xorl %edi, %edi
xorl %eax, %eax
callq 0xaca2
jmp 0x315d
leaq 0x9f54(%rip), %rsi      # 0xd08f
leaq 0x9f65(%rip), %rdx      # 0xd0a7
leaq 0x1b0(%rsp), %r9
xorl %edi, %edi
movq 0x38(%rsp), %rcx
movq 0x58(%rsp), %r8
xorl %eax, %eax
callq 0xaca2
movq 0x40(%rsp), %rdi
callq 0x447e
movq 0x10(%rsp), %rdi
callq 0x447e
movq 0x20(%rsp), %rdi
jmp 0x31a2
leaq 0x9f10(%rip), %rsi      # 0xd08f
leaq 0x9f14(%rip), %rdx      # 0xd09a
xorl %edi, %edi
xorl %eax, %eax
callq 0xaca2
movq %r12, %rdi
callq 0x447e
movq %r15, %rdi
callq 0x447e
movq %r14, %rdi
callq 0x447e
movl $0x1, %edi
callq 0xae31
movl %eax, 0x60(%rsp)
leaq 0xa1d8(%rip), %rdi      # 0xd394
callq 0x2060
movl $0x1e, %edi
callq 0x43a0
movq %rax, %r12
movl $0x32, %edi
callq 0x43a0
movq %rax, %r15
movl $0x28, %edi
callq 0x43a0
movq %rax, %r14
movl $0x186a0, %ebx          # imm = 0x186A0
leaq 0x1b0(%rsp), %r13
movq %r13, %rdi
callq 0x41a4
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x4bec
leaq 0xb0(%rsp), %r13
movq %r13, %rdi
callq 0x41a4
fldt 0x10(%rsp)
fsubp %st, %st(1)
fstpt 0x10(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x4bec
movzwl (%r12), %eax
xorl %r13d, %r13d
cmpw (%r15), %ax
sete %bpl
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x567e
movq %r15, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x567e
movq %r14, %rdi
leaq 0x130(%rsp), %rsi
callq 0x499e
movq %r15, %rdi
leaq 0x68(%rsp), %rsi
callq 0x499e
movq %r12, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x3522
movq %r15, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x3522
movq %r14, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x3522
movb %bpl, %r13b
leaq 0x9d6c(%rip), %rax      # 0xd020
movsd (%rax,%r13,8), %xmm2
fldt 0x10(%rsp)
fstpl 0xa0(%rsp)
movq 0xa0(%rsp), %xmm0
movsd 0x130(%rsp), %xmm1
xorps 0x9d52(%rip), %xmm1     # 0xd030
movq %xmm0, 0x20(%rsp)
movaps %xmm1, 0x40(%rsp)
movsd %xmm2, 0x38(%rsp)
callq 0x425c
movsd 0x68(%rsp), %xmm1
testb %al, %al
je 0x3325
movq 0x20(%rsp), %xmm0
movsd %xmm1, 0x20(%rsp)
movsd 0x20(%rsp), %xmm1
movsd 0x38(%rsp), %xmm2
callq 0x425c
movsd 0x20(%rsp), %xmm1
testb %al, %al
jne 0x335c
fldt 0x10(%rsp)
fstpt (%rsp)
movl $0x1, %edi
leaq 0x9e02(%rip), %rsi      # 0xd13a
leaq 0x9e06(%rip), %rdx      # 0xd145
leaq 0x1b0(%rsp), %rcx
leaq 0xb0(%rsp), %r8
movdqa 0x40(%rsp), %xmm0
movb $0x2, %al
callq 0xaca2
decl %ebx
jne 0x31ed
movq %r12, %rdi
callq 0x447e
movq %r15, %rdi
callq 0x447e
movq %r14, %rdi
callq 0x447e
leaq 0xa028(%rip), %rdi      # 0xd3ab
callq 0x2060
xorl %edi, %edi
callq 0x43a0
movq %rax, %r14
xorl %edi, %edi
callq 0x43a0
movq %rax, %r15
xorl %edi, %edi
callq 0x43a0
movq %rax, %r12
movl $0x186a0, %ebp          # imm = 0x186A0
movl $0x133, %edi            # imm = 0x133
callq 0x42e6
movq %xmm0, 0x10(%rsp)
movl $0x133, %edi            # imm = 0x133
callq 0x42e6
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 0x479b
movq %r15, %rdi
movsd 0x40(%rsp), %xmm0
callq 0x479b
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x567e
movq %r14, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x567e
movq %r14, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x3553
movq %r15, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x3553
movq %r12, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x3553
movb %bl, %r13b
leaq 0x9bcc(%rip), %rax      # 0xd020
movsd (%rax,%r13,8), %xmm0
movsd %xmm0, 0x20(%rsp)
movq %r12, %rdi
leaq 0x1b0(%rsp), %rsi
callq 0x499e
movq %r14, %rdi
leaq 0xb0(%rsp), %rsi
callq 0x499e
movsd 0x10(%rsp), %xmm1
subsd 0x40(%rsp), %xmm1
movq 0x1b0(%rsp), %xmm0
movq %xmm0, 0x58(%rsp)
movsd %xmm1, 0x38(%rsp)
movsd 0x20(%rsp), %xmm2
callq 0x425c
movq 0xb0(%rsp), %xmm4
pxor 0x9b73(%rip), %xmm4     # 0xd030
testb %al, %al
je 0x34e6
movdqa %xmm4, %xmm0
movsd 0x38(%rsp), %xmm1
movsd 0x20(%rsp), %xmm2
movdqa %xmm4, 0x20(%rsp)
callq 0x425c
movdqa 0x20(%rsp), %xmm4
testb %al, %al
jne 0x3518
movl $0x1, %edi
leaq 0x9c48(%rip), %rsi      # 0xd13a
leaq 0x9c8b(%rip), %rdx      # 0xd184
movq 0x10(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
movsd 0x38(%rsp), %xmm2
movsd 0x58(%rsp), %xmm3
movb $0x5, %al
callq 0xaca2
decl %ebp
jne 0x33ab
jmp 0x356a
leaq 0x9c11(%rip), %rsi      # 0xd13a
leaq 0x9b6a(%rip), %rdx      # 0xd09a
xorl %edi, %edi
xorl %eax, %eax
callq 0xaca2
movq %r12, %rdi
callq 0x447e
movq %r15, %rdi
callq 0x447e
movq %r14, %rdi
callq 0x447e
jmp 0x358b
leaq 0x9be0(%rip), %rsi      # 0xd13a
leaq 0x9b39(%rip), %rdx      # 0xd09a
xorl %edi, %edi
xorl %eax, %eax
callq 0xaca2
movq %r14, %rdi
callq 0x447e
movq %r15, %rdi
callq 0x447e
movq %r12, %rdi
callq 0x447e
movl 0x60(%rsp), %edi
callq 0xae31
movl $0x1, %edi
callq 0xae31
movl %eax, 0x60(%rsp)
xorl %edi, %edi
callq 0x43a0
movq %rax, 0x40(%rsp)
xorl %edi, %edi
callq 0x43a0
movq %rax, 0x10(%rsp)
xorl %edi, %edi
callq 0x43a0
movq %rax, 0x20(%rsp)
movl $0x10, %r12d
leaq 0x1a5b6(%rip), %rbx     # 0x1db80
leaq 0x1b0(%rsp), %rbp
movq 0x40(%rsp), %r14
movq 0x10(%rsp), %r15
movq -0x10(%r12,%rbx), %rsi
movq -0x8(%r12,%rbx), %r13
movq %r14, %rdi
movq %rsi, 0x38(%rsp)
callq 0x4bec
movq %r15, %rdi
movq %r13, 0x58(%rsp)
movq %r13, %rsi
callq 0x4bec
movq 0x20(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x5688
movq %r13, %rdi
movq %rbp, %rsi
movl $0x168, %edx            # imm = 0x168
callq 0x4ef1
movq %r13, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x3988
movq (%r12,%rbx), %rsi
movq %rbp, %rdi
callq 0x2110
testl %eax, %eax
jne 0x39a1
addq $0x18, %r12
cmpq $0xa0, %r12
jne 0x35dc
movq 0x40(%rsp), %rdi
callq 0x447e
movq 0x10(%rsp), %rdi
callq 0x447e
movq 0x20(%rsp), %rdi
callq 0x447e
leaq 0x9d41(%rip), %rdi      # 0xd3bd
callq 0x2060
movl $0x1e, %edi
callq 0x43a0
movq %rax, %r12
movl $0x32, %edi
callq 0x43a0
movq %rax, %r15
movl $0x28, %edi
callq 0x43a0
movq %rax, %r14
movl $0x186a0, %ebx          # imm = 0x186A0
leaq 0xb0(%rsp), %r13
leaq 0x130(%rsp), %rbp
movq %r13, %rdi
callq 0x41a4
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x4bec
movq %rbp, %rdi
callq 0x41a4
fldt 0x10(%rsp)
fmulp %st, %st(1)
fstpt 0x10(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
callq 0x4bec
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x5688
movq %r15, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x5688
movq %r14, %rdi
leaq 0x68(%rsp), %rsi
callq 0x499e
movq %r15, %rdi
leaq 0x70(%rsp), %rsi
callq 0x499e
movq %r12, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x39e5
movq %r15, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x39e5
movq %r14, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x39e5
fldt 0x10(%rsp)
fstpl 0x98(%rsp)
movq 0x98(%rsp), %xmm0
movsd 0x68(%rsp), %xmm1
movq %xmm0, 0x20(%rsp)
movsd %xmm1, 0x40(%rsp)
movsd 0x98bb(%rip), %xmm2     # 0xd040
callq 0x425c
movsd 0x70(%rsp), %xmm1
testb %al, %al
je 0x37bd
movq 0x20(%rsp), %xmm0
movsd %xmm1, 0x20(%rsp)
movsd 0x20(%rsp), %xmm1
movsd 0x9892(%rip), %xmm2     # 0xd040
callq 0x425c
movsd 0x20(%rsp), %xmm1
testb %al, %al
jne 0x37ea
fldt 0x10(%rsp)
fstpt (%rsp)
movl $0x1, %edi
leaq 0x9a24(%rip), %rsi      # 0xd1f4
leaq 0x9a36(%rip), %rdx      # 0xd20d
movq %r13, %rcx
movq %rbp, %r8
movq 0x40(%rsp), %xmm0
movb $0x2, %al
callq 0xaca2
decl %ebx
jne 0x36bd
movq %r12, %rdi
callq 0x447e
movq %r15, %rdi
callq 0x447e
movq %r14, %rdi
callq 0x447e
leaq 0x9bbe(%rip), %rdi      # 0xd3cf
callq 0x2060
xorl %edi, %edi
callq 0x43a0
movq %rax, %r14
xorl %edi, %edi
callq 0x43a0
movq %rax, %r15
xorl %edi, %edi
callq 0x43a0
movq %rax, %r12
movl $0x186a0, %ebp          # imm = 0x186A0
leaq 0xb0(%rsp), %rbx
leaq 0x130(%rsp), %r13
movl $0x96, %edi
callq 0x42e6
movq %xmm0, 0x10(%rsp)
movl $0x96, %edi
callq 0x42e6
movq %xmm0, 0x40(%rsp)
movq %r14, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x479b
movq %r15, %rdi
movsd 0x40(%rsp), %xmm0
callq 0x479b
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x5688
movq %r14, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x5688
movq %r14, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x412a
movq %r15, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x412a
movq %r12, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x412a
movq %r12, %rdi
movq %rbx, %rsi
callq 0x499e
movq %r14, %rdi
movq %r13, %rsi
callq 0x499e
movsd 0x10(%rsp), %xmm1
mulsd 0x40(%rsp), %xmm1
movq 0xb0(%rsp), %xmm0
movq %xmm0, 0x38(%rsp)
movsd %xmm1, 0x20(%rsp)
movsd 0x9730(%rip), %xmm2     # 0xd040
callq 0x425c
movq 0x130(%rsp), %xmm4
testb %al, %al
je 0x3949
movdqa %xmm4, %xmm0
movsd 0x20(%rsp), %xmm1
movsd 0x970c(%rip), %xmm2     # 0xd040
movq %xmm4, 0x58(%rsp)
callq 0x425c
movq 0x58(%rsp), %xmm4
testb %al, %al
jne 0x397b
movl $0x1, %edi
leaq 0x989f(%rip), %rsi      # 0xd1f4
leaq 0x98f0(%rip), %rdx      # 0xd24c
movq 0x10(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
movsd 0x20(%rsp), %xmm2
movsd 0x38(%rsp), %xmm3
movb $0x5, %al
callq 0xaca2
decl %ebp
jne 0x3849
jmp 0x4141
leaq 0x9865(%rip), %rsi      # 0xd1f4
leaq 0x9704(%rip), %rdx      # 0xd09a
xorl %edi, %edi
xorl %eax, %eax
callq 0xaca2
jmp 0x39ca
leaq 0x984c(%rip), %rsi      # 0xd1f4
leaq 0x9850(%rip), %rdx      # 0xd1ff
leaq 0x1b0(%rsp), %r9
xorl %edi, %edi
movq 0x38(%rsp), %rcx
movq 0x58(%rsp), %r8
xorl %eax, %eax
callq 0xaca2
movq 0x40(%rsp), %rdi
callq 0x447e
movq 0x10(%rsp), %rdi
callq 0x447e
movq 0x20(%rsp), %rdi
jmp 0x3a0f
leaq 0x9808(%rip), %rsi      # 0xd1f4
leaq 0x96a7(%rip), %rdx      # 0xd09a
xorl %edi, %edi
xorl %eax, %eax
callq 0xaca2
movq %r12, %rdi
callq 0x447e
movq %r15, %rdi
callq 0x447e
movq %r14, %rdi
callq 0x447e
movl $0x1, %edi
callq 0xae31
movl %eax, 0x7c(%rsp)
xorl %r13d, %r13d
xorl %edi, %edi
callq 0x43a0
movq %rax, 0x20(%rsp)
xorl %edi, %edi
callq 0x43a0
movq %rax, 0x40(%rsp)
xorl %edi, %edi
callq 0x43a0
movq %rax, 0x38(%rsp)
movb $0x1, %cl
leaq 0x1a1be(%rip), %rax     # 0x1dc10
leaq 0x1b0(%rsp), %rbp
movq 0x20(%rsp), %rbx
movq 0x40(%rsp), %r14
movl %ecx, 0x10(%rsp)
leaq (,%r13,2), %r15
addq %r13, %r15
movq (%rax,%r15,8), %rsi
movq 0x8(%rax,%r15,8), %r12
movq %rax, %r13
movq %rbx, %rdi
movq %rsi, 0x58(%rsp)
callq 0x4bec
movq %r14, %rdi
movq %r12, 0x60(%rsp)
movq %r12, %rsi
callq 0x4bec
movq 0x38(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x5ebf
movq %r12, %rdi
movq %rbp, %rsi
movl $0x168, %edx            # imm = 0x168
callq 0x4ef1
movq %r12, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x3e38
leaq (,%r15,8), %rax
addq %r13, %rax
movq 0x10(%rax), %rsi
movq %rbp, %rdi
callq 0x2110
testl %eax, %eax
jne 0x3e51
movq %r13, %rax
movl $0x1, %r13d
testb $0x1, 0x10(%rsp)
movl $0x0, %ecx
jne 0x3a64
movq 0x20(%rsp), %rdi
callq 0x447e
movq 0x40(%rsp), %rdi
callq 0x447e
movq 0x38(%rsp), %rdi
callq 0x447e
leaq 0x98b0(%rip), %rdi      # 0xd3dc
callq 0x2060
movl $0x1e, %edi
callq 0x43a0
movq %rax, %r12
movl $0x32, %edi
callq 0x43a0
movq %rax, %r15
movl $0x28, %edi
callq 0x43a0
movq %rax, %r14
movl $0x186a0, %ebx          # imm = 0x186A0
leaq 0xb0(%rsp), %r13
leaq 0x130(%rsp), %rbp
movq %r13, %rdi
callq 0x41a4
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x4bec
movq %rbp, %rdi
callq 0x41a4
fldt 0x10(%rsp)
fdivp %st, %st(1)
fstpt 0x10(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
callq 0x4bec
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x5ebf
movq %r15, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x5ebf
movq %r14, %rdi
leaq 0x68(%rsp), %rsi
callq 0x499e
movq %r15, %rdi
leaq 0x70(%rsp), %rsi
callq 0x499e
movq %r12, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x3e95
movq %r15, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x3e95
movq %r14, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x3e95
fldt 0x10(%rsp)
fstpl 0x90(%rsp)
movq 0x90(%rsp), %xmm0
movsd 0x68(%rsp), %xmm1
movq %xmm0, 0x20(%rsp)
movsd %xmm1, 0x40(%rsp)
movsd 0x940b(%rip), %xmm2     # 0xd040
callq 0x425c
movsd 0x70(%rsp), %xmm1
testb %al, %al
je 0x3c6d
movq 0x20(%rsp), %xmm0
movsd %xmm1, 0x20(%rsp)
movsd 0x20(%rsp), %xmm1
movsd 0x93e2(%rip), %xmm2     # 0xd040
callq 0x425c
movsd 0x20(%rsp), %xmm1
testb %al, %al
jne 0x3c9a
fldt 0x10(%rsp)
fstpt (%rsp)
movl $0x1, %edi
leaq 0x9616(%rip), %rsi      # 0xd296
leaq 0x9628(%rip), %rdx      # 0xd2af
movq %r13, %rcx
movq %rbp, %r8
movq 0x40(%rsp), %xmm0
movb $0x2, %al
callq 0xaca2
decl %ebx
jne 0x3b6d
movq %r12, %rdi
callq 0x447e
movq %r15, %rdi
callq 0x447e
movq %r14, %rdi
callq 0x447e
leaq 0x972d(%rip), %rdi      # 0xd3ee
callq 0x2060
xorl %edi, %edi
callq 0x43a0
movq %rax, %r14
xorl %edi, %edi
callq 0x43a0
movq %rax, %r15
xorl %edi, %edi
callq 0x43a0
movq %rax, %r12
movl $0x186a0, %ebp          # imm = 0x186A0
leaq 0xb0(%rsp), %rbx
leaq 0x130(%rsp), %r13
movl $0x96, %edi
callq 0x42e6
movq %xmm0, 0x10(%rsp)
movl $0x96, %edi
callq 0x42e6
movq %xmm0, 0x40(%rsp)
movq %r14, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x479b
movq %r15, %rdi
movsd 0x40(%rsp), %xmm0
callq 0x479b
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x5ebf
movq %r14, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x5ebf
movq %r14, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x4167
movq %r15, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x4167
movq %r12, %rdi
callq 0x44b3
testl %eax, %eax
jne 0x4167
movq %r12, %rdi
movq %rbx, %rsi
callq 0x499e
movq %r14, %rdi
movq %r13, %rsi
callq 0x499e
movsd 0x10(%rsp), %xmm1
divsd 0x40(%rsp), %xmm1
movq 0xb0(%rsp), %xmm0
movq %xmm0, 0x38(%rsp)
movsd %xmm1, 0x20(%rsp)
movsd 0x9280(%rip), %xmm2     # 0xd040
callq 0x425c
movq 0x130(%rsp), %xmm4
testb %al, %al
je 0x3df9
movdqa %xmm4, %xmm0
movsd 0x20(%rsp), %xmm1
movsd 0x925c(%rip), %xmm2     # 0xd040
movq %xmm4, 0x58(%rsp)
callq 0x425c
movq 0x58(%rsp), %xmm4
testb %al, %al
jne 0x3e2b
movl $0x1, %edi
leaq 0x9491(%rip), %rsi      # 0xd296
leaq 0x94e2(%rip), %rdx      # 0xd2ee
movq 0x10(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
movsd 0x20(%rsp), %xmm2
movsd 0x38(%rsp), %xmm3
movb $0x5, %al
callq 0xaca2
decl %ebp
jne 0x3cf9
jmp 0x417e
leaq 0x9457(%rip), %rsi      # 0xd296
leaq 0x9254(%rip), %rdx      # 0xd09a
xorl %edi, %edi
xorl %eax, %eax
callq 0xaca2
jmp 0x3e7a
leaq 0x943e(%rip), %rsi      # 0xd296
leaq 0x9442(%rip), %rdx      # 0xd2a1
leaq 0x1b0(%rsp), %r9
xorl %edi, %edi
movq 0x58(%rsp), %rcx
movq 0x60(%rsp), %r8
xorl %eax, %eax
callq 0xaca2
movq 0x20(%rsp), %rdi
callq 0x447e
movq 0x40(%rsp), %rdi
callq 0x447e
movq 0x38(%rsp), %rdi
jmp 0x3ebf
leaq 0x93fa(%rip), %rsi      # 0xd296
leaq 0x91f7(%rip), %rdx      # 0xd09a
xorl %edi, %edi
xorl %eax, %eax
callq 0xaca2
movq %r12, %rdi
callq 0x447e
movq %r15, %rdi
callq 0x447e
movq %r14, %rdi
callq 0x447e
movl $0x1, %edi
callq 0xae31
movl %eax, %ebx
leaq 0x9524(%rip), %rdi      # 0xd3fb
callq 0x2060
movl $0x32, %edi
callq 0x43a0
movq %rax, %r15
movl $0x32, %edi
callq 0x43a0
movq %rax, %r14
movl $0x186a0, %ebp          # imm = 0x186A0
leaq 0x1b0(%rsp), %r12
leaq 0xb0(%rsp), %r13
movq %r12, %rdi
callq 0x41a4
fstpl 0x88(%rsp)
movsd 0x88(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x4bec
movq %r13, %rdi
callq 0x41a4
fstpl 0x80(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x4bec
movq %r15, %rdi
movq %r14, %rsi
callq 0x6890
movsd 0x10(%rsp), %xmm1
subsd 0x80(%rsp), %xmm1
testl %eax, %eax
jle 0x3f76
ucomisd 0x90d4(%rip), %xmm1     # 0xd048
ja 0x3fa0
testl %eax, %eax
jns 0x3f84
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
ja 0x3fa0
testl %eax, %eax
jne 0x406e
ucomisd 0x90b4(%rip), %xmm1     # 0xd048
jne 0x406e
jp 0x406e
decl %ebp
jne 0x3f0b
movq %r15, %rdi
callq 0x447e
movq %r14, %rdi
callq 0x447e
leaq 0x944e(%rip), %rdi      # 0xd40d
callq 0x2060
xorl %edi, %edi
callq 0x43a0
movq %rax, %r14
xorl %edi, %edi
callq 0x43a0
movq %rax, %r15
movl $0x186a0, %ebp          # imm = 0x186A0
movl $0x96, %edi
callq 0x42e6
movq %xmm0, 0x10(%rsp)
movl $0x96, %edi
callq 0x42e6
movq %xmm0, 0x40(%rsp)
movq %r14, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x479b
movq %r15, %rdi
movsd 0x40(%rsp), %xmm0
callq 0x479b
movq %r14, %rdi
movq %r15, %rsi
callq 0x6890
movsd 0x40(%rsp), %xmm3
movsd 0x10(%rsp), %xmm0
movapd %xmm0, %xmm2
subsd %xmm3, %xmm2
testl %eax, %eax
jle 0x4046
ucomisd 0x9004(%rip), %xmm2     # 0xd048
ja 0x4064
testl %eax, %eax
jns 0x4054
xorpd %xmm1, %xmm1
ucomisd %xmm2, %xmm1
ja 0x4064
testl %eax, %eax
jne 0x40a7
ucomisd 0x8fe8(%rip), %xmm2     # 0xd048
jne 0x40a7
jp 0x40a7
decl %ebp
jne 0x3fdd
jmp 0x40c2
leaq 0x92bf(%rip), %rsi      # 0xd334
leaq 0x92c3(%rip), %rdx      # 0xd33f
leaq 0x1b0(%rsp), %rcx
leaq 0xb0(%rsp), %r8
xorl %edi, %edi
xorl %eax, %eax
callq 0xaca2
movq %r15, %rdi
callq 0x447e
movq %r14, %rdi
callq 0x447e
jmp 0x40d9
leaq 0x9286(%rip), %rsi      # 0xd334
leaq 0x92a2(%rip), %rdx      # 0xd357
xorl %edi, %edi
movapd %xmm3, %xmm1
movb $0x2, %al
callq 0xaca2
movq %r14, %rdi
callq 0x447e
movq %r15, %rdi
callq 0x447e
movl %ebx, %edi
callq 0xae31
xorl %eax, %eax
addq $0x5b8, %rsp            # imm = 0x5B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8f9b(%rip), %rsi      # 0xd08f
leaq 0x8f9f(%rip), %rdx      # 0xd09a
xorl %edi, %edi
xorl %eax, %eax
callq 0xaca2
movq %r14, %rdi
callq 0x447e
movq %r15, %rdi
callq 0x447e
movq %r12, %rdi
callq 0x447e
movl 0x60(%rsp), %edi
callq 0xae31
jmp 0x31a7
leaq 0x90c3(%rip), %rsi      # 0xd1f4
leaq 0x8f62(%rip), %rdx      # 0xd09a
xorl %edi, %edi
xorl %eax, %eax
callq 0xaca2
movq %r14, %rdi
callq 0x447e
movq %r15, %rdi
callq 0x447e
movq %r12, %rdi
callq 0x447e
movl 0x60(%rsp), %edi
callq 0xae31
jmp 0x3a14
leaq 0x9128(%rip), %rsi      # 0xd296
leaq 0x8f25(%rip), %rdx      # 0xd09a
xorl %edi, %edi
xorl %eax, %eax
callq 0xaca2
movq %r14, %rdi
callq 0x447e
movq %r15, %rdi
callq 0x447e
movq %r12, %rdi
callq 0x447e
movl 0x7c(%rsp), %edi
callq 0xae31
jmp 0x3ec4