// File: Alcaro[P]bridges/arlib/stringconv-float.cpp
// Function: fromstring_float(cstring, double&, floatinf const*)
static bool fromstring_float(cstring s, double& out, const floatinf * fi)
{
	out = 0;
	
	const char * start = (const char*)s.bytes().ptr();
	const char * end = start + s.length();
	const char * digits_end = end;
	if (end-start > 10000) return false; // 0.(9999 zeroes)1e+10000 is technically equal to 1, but it's also stupid.
	// TODO: should allow it anyways
	
	bool neg = false;
	if (start < end && *start == '-')
	{
		neg = true;
		start++;
	}
	
	if (UNLIKELY(!isdigit(*start) || start==end))
	{
		if (s == "inf") { out = HUGE_VAL; return true; }
		if (s == "-inf") { out = -HUGE_VAL; return true; }
		if (s == "nan") { out = NAN; return true; }
		return false;
	}
	
	const char * iter = start;
	
	int exponent = INT_MAX;
	uint64_t significand = 0;
	uint64_t significand_sum = 0;
	int n_digits = 0;
	
	while (true)
	{
		if ((uint8_t)(*iter-'0') <= 9)
		{
			significand *= 10;
			significand += *iter-'0';
			significand_sum |= significand; // make it sticky, so input 2^64 doesn't overflow significand back to zero
			exponent--;
			n_digits++;
		}
		else if (*iter == '.')
		{
			if (exponent <= 0) return false;
			if (iter == end || !isdigit(iter[1])) return false;
			exponent = 0;
		}
		else if ((0x20|*iter) == 'e')
		{
			digits_end = iter;
			if (exponent > 0) exponent = 0;
			iter++;
			
			bool exp_neg = false;
			if (*iter == '-') { exp_neg = true; iter++; }
			else if (*iter == '+') iter++;
			
			uint32_t newexp = 0;
			uint32_t newexp_sum = 0;
			if (iter == end) return false;
			while (iter < end)
			{
				if (UNLIKELY((uint8_t)(*iter-'0') > 9)) return false;
				newexp = newexp*10 + *iter-'0';
				newexp_sum |= newexp; // another sticky
				iter++;
			}
			if (newexp_sum >= 16384)
			{
				// if the exponent is crazy, ignore the digits; it's either zero or infinite
				if (!exp_neg && significand_sum != 0) out = HUGE_VAL;
				if (neg) out = -out;
				if (out == 0) return true;
				return false;
			}
			if (exp_neg) exponent -= newexp;
			else exponent += newexp;
			break;
		}
		else return false;
		iter++;
		if (iter == end)
		{
			if (exponent > 0) exponent = 0;
			break;
		}
	}
	
	// for small numbers, the correct answer can be calculated with a multiplication or division of two float-representable integers
	// there are some numbers where the mul or div rounds to exactly halfway between two floats, but to my knowledge,
	//  they all have significand or exponent out of range for floats and need the slow path
	// same may happen on i386 if fpcw is set to float80 rather than float64; I did not investigate this either
	if (LIKELY(abs(exponent) <= fi->max_int_exp && significand <= fi->max_sig && n_digits < ilog10(UINT64_MAX)))
	{
		bool neg_exp = (exponent < 0);
		exponent = abs(exponent);
		
		double exp_adjust = 1;
		if (exponent & 1) exp_adjust *= 10.0;
		if (exponent & 2) exp_adjust *= 100.0;
		if (exponent & 4) exp_adjust *= 10000.0;
		if (exponent & 8) exp_adjust *= 100000000.0;
		if (exponent & 16) exp_adjust *= 10000000000000000.0;
		
		double ret;
		if (!neg_exp)
			ret = (double)significand * exp_adjust;
		else
			ret = (double)significand / exp_adjust;
		if (neg) out = -ret;
		else out = ret;
		return true;
	}
	
	// for large numbers, use a slower algorithm
	// some float parser implementations have three different algorithms with different speed and limitations, but two's enough for me
	
	if (significand_sum == 0) // 0e+999 will go here, as will 0.000000000000000000000000 (it exceeds n_digits)
	{
		if (neg) out = -out;
		return true;
	}
	// inputs:
	// - start .. digits_end - digits of the input. The dot, if any, should be ignored.
	//    Contains at least one nonzero digit. Contains nothing but digits and the dot.
	// - exponent - Number of steps to shift the given digits.
	// - n_digits - Number of digits, though some may be leading or trailing zeroes. Not useful anymore.
	// - neg - Whether the input is negative.
	// - fi - Information about the float format.
	// Other variables should be ignored or discarded.
	
	// the digits need to be multiplied or divided such that the exponent is zero, then take the leftmost bits
	// for subnormals, the number of digits to round to is variable
	
	iter = start;
	while (*iter <= '0') iter++; // the only possible non-digit, ., is 0x2E <= '0' (0x30), and there's known to be a nonzero digit
	
	uint32_t limbs[100] = {}; // the traditional implementation is u8[800], but that's just wasteful. better pack eight digits in a u32
	// 9 would fit, but 8 makes the math easier
	// I could count how many limbs I'm using, but that'd be a lot more complexity for no reasonable benefit
	
	int limb_at = 0;
	uint32_t tmp = 0;
	while (limb_at < 800 && iter < digits_end)
	{
		if (*iter == '.') { iter++; continue; }
		tmp = tmp*10 + *iter-'0';
		if (limb_at%8 == 7)
		{
			limbs[limb_at/8] = tmp;
			tmp = 0;
		}
		limb_at++;
		iter++;
	}
	exponent += limb_at;
	if (tmp)
	{
		if ((8-limb_at)&4) tmp *= 10000;
		if ((8-limb_at)&2) tmp *= 100;
		if ((8-limb_at)&1) tmp *= 10;
		limbs[limb_at/8] = tmp;
	}
	
	while (iter < digits_end)
	{
		if (*iter > '0') limbs[99] |= 1; // some algorithms maintain an 'is truncated' bit, but it's easier to round up
		iter++;
		if (*iter != '.') exponent++;
	}
	
	// at the end of this process, I need
	// - limbs[0] concat limbs[1] concat limbs[2]/1000000 to be the output bits of the double
	// - limbs[0] >= 20000000
	// - every limb <= 99999999
	// - bin_exponent to tell how many bits it was shifted
	// min     4503599627370496
	// max 18446744073709551616
	// if output is 10.0, the limbs must be 10 << n such that 10<<n >= 200000000000000000, <= 999999999999999999
	// there two allowed limb values are
	// n=56 72057594 03792793 60+000000
	// n=55 36028797 01896396 80+000000
	// same limbs for 5, 20, 40, 80, 160, etc, just different bin_exponent
	
	int bin_exponent = 0;
	
	exponent -= 18; // need 18 decimal digits of mantissa
	if (exponent & 7)
	{
		// first limb is known >= 10000000, so multiplying by any power of ten will make it overflow and require shifting the limbs
		
		uint64_t mul = 1;
		if (exponent&4) mul *= 10000;
		if (exponent&2) mul *= 100;
		if (exponent&1) mul *= 10;
		exponent &= ~7;
		exponent += 8;
		
		uint64_t carry = 0;
		for (int i=0;i<100;i++)
		{
			uint64_t cur = carry + limbs[i]*mul;
			limbs[i] = cur/100000000;
			carry = cur%100000000*100000000;
		}
		if (carry) limbs[99] |= 1; // sticky overflow
	}
	
	// the top limb must be nonzero at all times
	while (true)
	{
		if (exponent > 0)
		{
			// divide by the smallest power of 2 that zeroes the top limb, and multiply by 1e8 (shift the limbs one step)
			int shift_bits = ilog2(limbs[0])+1;
			bin_exponent += shift_bits;
			exponent -= 8;
			
			uint32_t carry_mask = (1<<shift_bits)-1;
			
			// 64bit multiplication and division everywhere... sucks for 32bit cpus
			// I could change it to uint16[200], but not much point. 32bit is on its way out
			uint64_t carry = limbs[0]; // carry is NOT divided by shift_bits
			for (int i=1;i<100;i++)
			{
				uint64_t cur = (uint64_t)limbs[i] + carry*100000000;
				limbs[i-1] = cur >> shift_bits;
				carry = cur & carry_mask;
			}
			limbs[99] = carry; // this is too much, but it won't affect the result
		}
		else if (exponent < 0 && limbs[0] >= 2)
		{
			// multiply by 1<<26, and divide by 1e8
			int shift_bits = 26;
			bin_exponent -= shift_bits;
			exponent += 8;
			
			uint64_t cur = ((uint64_t)limbs[99] << shift_bits);
			
			uint64_t carry = cur/100000000 | (cur%100000000 ? 1 : 0);
			for (int i=98;i>=0;i--)
			{
				uint64_t cur = ((uint64_t)limbs[i] << shift_bits) + carry;
				limbs[i+1] = cur%100000000;
				carry = cur/100000000;
			}
			limbs[0] = carry;
		}
		else if (limbs[0] < 20000000)
		{
			// multiply by a low power of 2 so the top limb goes a bit higher
			int shift_bits = 25-ilog2(limbs[0]);
			bin_exponent -= shift_bits;
			
			uint64_t carry = 0;
			for (int i=99;i>=0;i--)
			{
				uint64_t cur = ((uint64_t)limbs[i] << shift_bits) + carry;
				limbs[i] = cur%100000000;
				carry = cur/100000000;
			}
		}
		else break;
	}
	
	bool ret = true;
	
	uint64_t mantissa = (uint64_t)limbs[0]*10000000000 + (uint64_t)limbs[1]*100 + limbs[2]/1000000;
	if (mantissa == 0)
		goto done;
	
	{
		int error = 60-ilog2(mantissa);
		mantissa <<= error;
		bin_exponent -= error;
	}
	
	if (bin_exponent+1023+60-1 <= -60) // too small, round to zero
		goto done;
	
	{
		uint64_t prev_mantissa = mantissa;
		int shift = 0;
		if (bin_exponent+1023+60-1 < 0)
		{
			shift = -(bin_exponent+1023+60-1);
		}
		if (fi->bits_mantissa != 52)
		{
			if (bin_exponent+209 <= 23)
				shift = 52-(bin_exponent+209);
			else
				shift = 52-23;
		}
		
		mantissa >>= shift;
		bin_exponent += shift;
		
		if (mantissa << shift != prev_mantissa)
			mantissa |= 1;
	}
	
	// if it's at least halfway to next number,
	if (mantissa & 0x80)
	{
		// and if bottom bit of output mantissa is set, any bit below half-mantissa is set,
		// or if any bit in the limbs outside the mantissa is set,
		// then round up (bits below that will be discarded)
		if ((mantissa & 0x017F) || limbs[2]%1000000)
		{
			mantissa += 0x80;
		}
		else
		{
			for (int i=3;i<100;i++)
			{
				if (limbs[i])
				{
					mantissa += 0x80;
					break;
				}
			}
		}
	}
	
	{
		int error = 61-ilog2(mantissa); // it's probably same power of two as last time, but not guaranteed; must renormalize
		mantissa <<= error;
		bin_exponent -= error;
	}
	
	if (bin_exponent+1023+61 <= 0) // subnormal (or rounded to zero)
	{
		mantissa >>= -(bin_exponent+1023+61);
		out = reinterpret<double>(mantissa>>10);
	}
	else if (bin_exponent >= fi->max_bin_exp) // infinite
	{
		out = HUGE_VAL;
		ret = false;
	}
	else // normal (or subnormal float - the double/float cast will handle that)
	{
		out = reinterpret<double>(((uint64_t)(bin_exponent+1023+61)<<52) | (mantissa<<3>>12));
	}
	
done:
	if (neg) out = -out;
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x6d0, %rsp            # imm = 0x6D0
movq %rdi, -0x390(%rbp)
movq %rsi, -0x388(%rbp)
movq %rdx, -0x398(%rbp)
movq %rcx, -0x3a0(%rbp)
movq -0x398(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
leaq -0x390(%rbp), %rax
movq %rax, -0x368(%rbp)
movq -0x368(%rbp), %rax
leaq -0x378(%rbp), %rcx
movq %rcx, -0x190(%rbp)
movq %rax, -0x198(%rbp)
movq -0x198(%rbp), %rax
movq %rax, -0x680(%rbp)
movq %rax, -0x188(%rbp)
movq -0x188(%rbp), %rdi
callq 0x5cc0
movsbl %al, %eax
cmpl $0x0, %eax
jl 0x3ddf2
movq -0x680(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x148(%rbp), %rdi
callq 0x5cc0
movq -0x680(%rbp), %rsi
movsbl %al, %eax
xorl $0xf, %eax
movzbl %al, %eax
movl %eax, %edx
leaq -0x378(%rbp), %rdi
callq 0x5ed0
jmp 0x3de0d
movq -0x680(%rbp), %rax
movq (%rax), %rsi
movl 0x8(%rax), %eax
movl %eax, %edx
leaq -0x378(%rbp), %rdi
callq 0x5ed0
movups -0x378(%rbp), %xmm0
movaps %xmm0, -0x360(%rbp)
movq -0x360(%rbp), %rcx
movq -0x358(%rbp), %rax
movq %rcx, -0x3b8(%rbp)
movq %rax, -0x3b0(%rbp)
leaq -0x3b8(%rbp), %rdi
callq 0x62c0
movq %rax, -0x3a8(%rbp)
movq -0x3a8(%rbp), %rax
movq %rax, -0x690(%rbp)
leaq -0x390(%rbp), %rax
movq %rax, -0x348(%rbp)
movq -0x348(%rbp), %rax
movq %rax, -0x688(%rbp)
movq %rax, -0x150(%rbp)
movq -0x150(%rbp), %rdi
callq 0x5cc0
movsbl %al, %eax
cmpl $0x0, %eax
jl 0x3deba
movq -0x688(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rdi
callq 0x5cc0
movsbl %al, %eax
xorl $0xf, %eax
movzbl %al, %eax
movl %eax, -0x33c(%rbp)
jmp 0x3deca
movq -0x688(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x33c(%rbp)
movq -0x690(%rbp), %rax
movl -0x33c(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x3c0(%rbp)
movq -0x3c0(%rbp), %rax
movq %rax, -0x3c8(%rbp)
movq -0x3c0(%rbp), %rax
movq -0x3a8(%rbp), %rcx
subq %rcx, %rax
cmpq $0x2710, %rax           # imm = 0x2710
jle 0x3df14
movb $0x0, -0x379(%rbp)
jmp 0x3f462
movb $0x0, -0x3c9(%rbp)
movq -0x3a8(%rbp), %rax
cmpq -0x3c0(%rbp), %rax
jae 0x3df53
movq -0x3a8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x3df53
movb $0x1, -0x3c9(%rbp)
movq -0x3a8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x3a8(%rbp)
movq -0x3a8(%rbp), %rax
movzbl (%rax), %edi
callq 0x3f540
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x691(%rbp)
jne 0x3df73
jmp 0x3df8a
movq -0x3a8(%rbp), %rax
cmpq -0x3c0(%rbp), %rax
sete %al
movb %al, -0x691(%rbp)
movb -0x691(%rbp), %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x3df9d
jmp 0x3e3de
leaq -0x390(%rbp), %rax
movq %rax, -0x228(%rbp)
leaq 0x25f07(%rip), %rax     # 0x63eb9
movq %rax, -0x230(%rbp)
movq -0x230(%rbp), %rdi
callq 0x40f0
movq %rax, -0x238(%rbp)
movq -0x228(%rbp), %rax
movq %rax, -0x208(%rbp)
movq -0x208(%rbp), %rax
leaq -0x218(%rbp), %rcx
movq %rcx, -0x1c0(%rbp)
movq %rax, -0x1c8(%rbp)
movq -0x1c8(%rbp), %rax
movq %rax, -0x6a0(%rbp)
movq %rax, -0x170(%rbp)
movq -0x170(%rbp), %rdi
callq 0x5cc0
movsbl %al, %eax
cmpl $0x0, %eax
jl 0x3e059
movq -0x6a0(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x130(%rbp), %rdi
callq 0x5cc0
movq -0x6a0(%rbp), %rsi
movsbl %al, %eax
xorl $0xf, %eax
movzbl %al, %eax
movl %eax, %edx
leaq -0x218(%rbp), %rdi
callq 0x5ed0
jmp 0x3e074
movq -0x6a0(%rbp), %rax
movq (%rax), %rsi
movl 0x8(%rax), %eax
movl %eax, %edx
leaq -0x218(%rbp), %rdi
callq 0x5ed0
movups -0x218(%rbp), %xmm0
movaps %xmm0, -0x200(%rbp)
movq -0x200(%rbp), %rcx
movq -0x1f8(%rbp), %rax
movq %rcx, -0x248(%rbp)
movq %rax, -0x240(%rbp)
movq -0x230(%rbp), %rsi
movq -0x238(%rbp), %rdx
leaq -0x258(%rbp), %rdi
callq 0x5d70
movq -0x258(%rbp), %rsi
movq -0x250(%rbp), %rdx
leaq -0x248(%rbp), %rdi
callq 0x60c0
andb $0x1, %al
movb %al, -0x219(%rbp)
testb $0x1, -0x219(%rbp)
jne 0x3e0e5
jmp 0x3e104
movq -0x398(%rbp), %rax
movsd 0x25d04(%rip), %xmm0    # 0x63df8
movsd %xmm0, (%rax)
movb $0x1, -0x379(%rbp)
jmp 0x3f462
leaq -0x390(%rbp), %rax
movq %rax, -0x298(%rbp)
leaq 0x25d9f(%rip), %rax     # 0x63eb8
movq %rax, -0x2a0(%rbp)
movq -0x2a0(%rbp), %rdi
callq 0x40f0
movq %rax, -0x2a8(%rbp)
movq -0x298(%rbp), %rax
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rax
leaq -0x288(%rbp), %rcx
movq %rcx, -0x1b0(%rbp)
movq %rax, -0x1b8(%rbp)
movq -0x1b8(%rbp), %rax
movq %rax, -0x6a8(%rbp)
movq %rax, -0x178(%rbp)
movq -0x178(%rbp), %rdi
callq 0x5cc0
movsbl %al, %eax
cmpl $0x0, %eax
jl 0x3e1c0
movq -0x6a8(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x138(%rbp), %rdi
callq 0x5cc0
movq -0x6a8(%rbp), %rsi
movsbl %al, %eax
xorl $0xf, %eax
movzbl %al, %eax
movl %eax, %edx
leaq -0x288(%rbp), %rdi
callq 0x5ed0
jmp 0x3e1db
movq -0x6a8(%rbp), %rax
movq (%rax), %rsi
movl 0x8(%rax), %eax
movl %eax, %edx
leaq -0x288(%rbp), %rdi
callq 0x5ed0
movups -0x288(%rbp), %xmm0
movaps %xmm0, -0x270(%rbp)
movq -0x270(%rbp), %rcx
movq -0x268(%rbp), %rax
movq %rcx, -0x2b8(%rbp)
movq %rax, -0x2b0(%rbp)
movq -0x2a0(%rbp), %rsi
movq -0x2a8(%rbp), %rdx
leaq -0x2c8(%rbp), %rdi
callq 0x5d70
movq -0x2c8(%rbp), %rsi
movq -0x2c0(%rbp), %rdx
leaq -0x2b8(%rbp), %rdi
callq 0x60c0
andb $0x1, %al
movb %al, -0x289(%rbp)
testb $0x1, -0x289(%rbp)
jne 0x3e24c
jmp 0x3e26b
movq -0x398(%rbp), %rax
movsd 0x25bdd(%rip), %xmm0    # 0x63e38
movsd %xmm0, (%rax)
movb $0x1, -0x379(%rbp)
jmp 0x3f462
leaq -0x390(%rbp), %rax
movq %rax, -0x308(%rbp)
leaq 0x25c3d(%rip), %rax     # 0x63ebd
movq %rax, -0x310(%rbp)
movq -0x310(%rbp), %rdi
callq 0x40f0
movq %rax, -0x318(%rbp)
movq -0x308(%rbp), %rax
movq %rax, -0x2e8(%rbp)
movq -0x2e8(%rbp), %rax
leaq -0x2f8(%rbp), %rcx
movq %rcx, -0x1a0(%rbp)
movq %rax, -0x1a8(%rbp)
movq -0x1a8(%rbp), %rax
movq %rax, -0x6b0(%rbp)
movq %rax, -0x180(%rbp)
movq -0x180(%rbp), %rdi
callq 0x5cc0
movsbl %al, %eax
cmpl $0x0, %eax
jl 0x3e327
movq -0x6b0(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rdi
callq 0x5cc0
movq -0x6b0(%rbp), %rsi
movsbl %al, %eax
xorl $0xf, %eax
movzbl %al, %eax
movl %eax, %edx
leaq -0x2f8(%rbp), %rdi
callq 0x5ed0
jmp 0x3e342
movq -0x6b0(%rbp), %rax
movq (%rax), %rsi
movl 0x8(%rax), %eax
movl %eax, %edx
leaq -0x2f8(%rbp), %rdi
callq 0x5ed0
movups -0x2f8(%rbp), %xmm0
movaps %xmm0, -0x2e0(%rbp)
movq -0x2e0(%rbp), %rcx
movq -0x2d8(%rbp), %rax
movq %rcx, -0x328(%rbp)
movq %rax, -0x320(%rbp)
movq -0x310(%rbp), %rsi
movq -0x318(%rbp), %rdx
leaq -0x338(%rbp), %rdi
callq 0x5d70
movq -0x338(%rbp), %rsi
movq -0x330(%rbp), %rdx
leaq -0x328(%rbp), %rdi
callq 0x60c0
andb $0x1, %al
movb %al, -0x2f9(%rbp)
testb $0x1, -0x2f9(%rbp)
jne 0x3e3b3
jmp 0x3e3d2
movq -0x398(%rbp), %rax
movsd 0x25a6e(%rip), %xmm0    # 0x63e30
movsd %xmm0, (%rax)
movb $0x1, -0x379(%rbp)
jmp 0x3f462
movb $0x0, -0x379(%rbp)
jmp 0x3f462
movq -0x3a8(%rbp), %rax
movq %rax, -0x3d8(%rbp)
movl $0x7fffffff, -0x3dc(%rbp) # imm = 0x7FFFFFFF
movq $0x0, -0x3e8(%rbp)
movq $0x0, -0x3f0(%rbp)
movl $0x0, -0x3f4(%rbp)
movq -0x3d8(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
movzbl %al, %eax
cmpl $0x9, %eax
jg 0x3e48f
imulq $0xa, -0x3e8(%rbp), %rax
movq %rax, -0x3e8(%rbp)
movq -0x3d8(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
cltq
addq -0x3e8(%rbp), %rax
movq %rax, -0x3e8(%rbp)
movq -0x3e8(%rbp), %rax
orq -0x3f0(%rbp), %rax
movq %rax, -0x3f0(%rbp)
movl -0x3dc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3dc(%rbp)
movl -0x3f4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3f4(%rbp)
jmp 0x3e71a
movq -0x3d8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x3e4f2
cmpl $0x0, -0x3dc(%rbp)
jg 0x3e4b3
movb $0x0, -0x379(%rbp)
jmp 0x3f462
movq -0x3d8(%rbp), %rax
cmpq -0x3c0(%rbp), %rax
je 0x3e4d7
movq -0x3d8(%rbp), %rax
movzbl 0x1(%rax), %edi
callq 0x3f540
testb $0x1, %al
jne 0x3e4e3
movb $0x0, -0x379(%rbp)
jmp 0x3f462
movl $0x0, -0x3dc(%rbp)
jmp 0x3e718
movq -0x3d8(%rbp), %rax
movsbl (%rax), %eax
orl $0x20, %eax
cmpl $0x65, %eax
jne 0x3e70c
movq -0x3d8(%rbp), %rax
movq %rax, -0x3c8(%rbp)
cmpl $0x0, -0x3dc(%rbp)
jle 0x3e529
movl $0x0, -0x3dc(%rbp)
movq -0x3d8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x3d8(%rbp)
movb $0x0, -0x3f5(%rbp)
movq -0x3d8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x3e56c
movb $0x1, -0x3f5(%rbp)
movq -0x3d8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x3d8(%rbp)
jmp 0x3e58f
movq -0x3d8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
jne 0x3e58d
movq -0x3d8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x3d8(%rbp)
jmp 0x3e58f
movl $0x0, -0x3fc(%rbp)
movl $0x0, -0x400(%rbp)
movq -0x3d8(%rbp), %rax
cmpq -0x3c0(%rbp), %rax
jne 0x3e5bf
movb $0x0, -0x379(%rbp)
jmp 0x3f462
jmp 0x3e5c1
movq -0x3d8(%rbp), %rax
cmpq -0x3c0(%rbp), %rax
jae 0x3e63f
movq -0x3d8(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
movzbl %al, %eax
cmpl $0x9, %eax
setg %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x3e5f1
jmp 0x3e5fd
movb $0x0, -0x379(%rbp)
jmp 0x3f462
imull $0xa, -0x3fc(%rbp), %eax
movq -0x3d8(%rbp), %rcx
movsbl (%rcx), %ecx
addl %ecx, %eax
subl $0x30, %eax
movl %eax, -0x3fc(%rbp)
movl -0x3fc(%rbp), %eax
orl -0x400(%rbp), %eax
movl %eax, -0x400(%rbp)
movq -0x3d8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x3d8(%rbp)
jmp 0x3e5c1
cmpl $0x4000, -0x400(%rbp)   # imm = 0x4000
jb 0x3e6d9
testb $0x1, -0x3f5(%rbp)
jne 0x3e675
cmpq $0x0, -0x3f0(%rbp)
je 0x3e675
movq -0x398(%rbp), %rax
movsd 0x25787(%rip), %xmm0    # 0x63df8
movsd %xmm0, (%rax)
testb $0x1, -0x3c9(%rbp)
je 0x3e6ab
movq -0x398(%rbp), %rax
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq -0x398(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x398(%rbp), %rax
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x3e6cd
jp 0x3e6cd
movb $0x1, -0x379(%rbp)
jmp 0x3f462
movb $0x0, -0x379(%rbp)
jmp 0x3f462
testb $0x1, -0x3f5(%rbp)
je 0x3e6f8
movl -0x3fc(%rbp), %ecx
movl -0x3dc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x3dc(%rbp)
jmp 0x3e70a
movl -0x3fc(%rbp), %eax
addl -0x3dc(%rbp), %eax
movl %eax, -0x3dc(%rbp)
jmp 0x3e756
movb $0x0, -0x379(%rbp)
jmp 0x3f462
jmp 0x3e71a
movq -0x3d8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x3d8(%rbp)
movq -0x3d8(%rbp), %rax
cmpq -0x3c0(%rbp), %rax
jne 0x3e751
cmpl $0x0, -0x3dc(%rbp)
jle 0x3e74f
movl $0x0, -0x3dc(%rbp)
jmp 0x3e756
jmp 0x3e416
movl -0x3dc(%rbp), %ecx
movl %ecx, %eax
negl %eax
cmovnsl %eax, %ecx
movq -0x3a0(%rbp), %rax
movzbl 0x8(%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x6b1(%rbp)
jg 0x3e7c3
movq -0x3e8(%rbp), %rcx
movq -0x3a0(%rbp), %rdx
xorl %eax, %eax
cmpq (%rdx), %rcx
movb %al, -0x6b1(%rbp)
ja 0x3e7c3
movl -0x3f4(%rbp), %eax
movl %eax, -0x6b8(%rbp)
movq $-0x1, %rdi
callq 0x3f570
movb %al, %cl
movl -0x6b8(%rbp), %eax
movzbl %cl, %ecx
cmpl %ecx, %eax
setl %al
movb %al, -0x6b1(%rbp)
movb -0x6b1(%rbp), %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x3e7d6
jmp 0x3e99c
cmpl $0x0, -0x3dc(%rbp)
setl %al
andb $0x1, %al
movb %al, -0x401(%rbp)
movl -0x3dc(%rbp), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movl %eax, -0x3dc(%rbp)
movsd 0x255fd(%rip), %xmm0    # 0x63e00
movsd %xmm0, -0x410(%rbp)
movl -0x3dc(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x3e831
movsd 0x255e7(%rip), %xmm0    # 0x63e08
mulsd -0x410(%rbp), %xmm0
movsd %xmm0, -0x410(%rbp)
movl -0x3dc(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x3e857
movsd 0x255c9(%rip), %xmm0    # 0x63e10
mulsd -0x410(%rbp), %xmm0
movsd %xmm0, -0x410(%rbp)
movl -0x3dc(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x3e87d
movsd 0x255ab(%rip), %xmm0    # 0x63e18
mulsd -0x410(%rbp), %xmm0
movsd %xmm0, -0x410(%rbp)
movl -0x3dc(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x3e8a3
movsd 0x2558d(%rip), %xmm0    # 0x63e20
mulsd -0x410(%rbp), %xmm0
movsd %xmm0, -0x410(%rbp)
movl -0x3dc(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x3e8c9
movsd 0x2556f(%rip), %xmm0    # 0x63e28
mulsd -0x410(%rbp), %xmm0
movsd %xmm0, -0x410(%rbp)
testb $0x1, -0x401(%rbp)
jne 0x3e90e
movaps 0x25577(%rip), %xmm1    # 0x63e50
movq -0x3e8(%rbp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x25573(%rip), %xmm1    # 0x63e60
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
mulsd -0x410(%rbp), %xmm0
movsd %xmm0, -0x418(%rbp)
jmp 0x3e948
movaps 0x2553b(%rip), %xmm1    # 0x63e50
movq -0x3e8(%rbp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x25537(%rip), %xmm1    # 0x63e60
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
divsd -0x410(%rbp), %xmm0
movsd %xmm0, -0x418(%rbp)
testb $0x1, -0x3c9(%rbp)
je 0x3e97d
movsd -0x418(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq -0x398(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0x3e990
movsd -0x418(%rbp), %xmm0
movq -0x398(%rbp), %rax
movsd %xmm0, (%rax)
movb $0x1, -0x379(%rbp)
jmp 0x3f462
cmpq $0x0, -0x3f0(%rbp)
jne 0x3e9e8
testb $0x1, -0x3c9(%rbp)
je 0x3e9dc
movq -0x398(%rbp), %rax
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq -0x398(%rbp), %rax
movsd %xmm0, (%rax)
movb $0x1, -0x379(%rbp)
jmp 0x3f462
movq -0x3a8(%rbp), %rax
movq %rax, -0x3d8(%rbp)
movq -0x3d8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jg 0x3ea19
movq -0x3d8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x3d8(%rbp)
jmp 0x3e9f6
leaq -0x5b0(%rbp), %rdi
xorl %esi, %esi
movl $0x190, %edx            # imm = 0x190
callq 0x4170
movl $0x0, -0x5b4(%rbp)
movl $0x0, -0x5b8(%rbp)
xorl %eax, %eax
cmpl $0x320, -0x5b4(%rbp)    # imm = 0x320
movb %al, -0x6b9(%rbp)
jge 0x3ea6b
movq -0x3d8(%rbp), %rax
cmpq -0x3c8(%rbp), %rax
setb %al
movb %al, -0x6b9(%rbp)
movb -0x6b9(%rbp), %al
testb $0x1, %al
jne 0x3ea7a
jmp 0x3eb19
movq -0x3d8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x3ea9d
movq -0x3d8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x3d8(%rbp)
jmp 0x3ea40
imull $0xa, -0x5b8(%rbp), %eax
movq -0x3d8(%rbp), %rcx
movsbl (%rcx), %ecx
addl %ecx, %eax
subl $0x30, %eax
movl %eax, -0x5b8(%rbp)
movl -0x5b4(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x7, %edx
jne 0x3eaf3
movl -0x5b8(%rbp), %ecx
movl -0x5b4(%rbp), %eax
movl $0x8, %esi
cltd
idivl %esi
cltq
movl %ecx, -0x5b0(%rbp,%rax,4)
movl $0x0, -0x5b8(%rbp)
movl -0x5b4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5b4(%rbp)
movq -0x3d8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x3d8(%rbp)
jmp 0x3ea40
movl -0x5b4(%rbp), %eax
addl -0x3dc(%rbp), %eax
movl %eax, -0x3dc(%rbp)
cmpl $0x0, -0x5b8(%rbp)
je 0x3ebb8
movl $0x8, %eax
subl -0x5b4(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x3eb5b
imull $0x2710, -0x5b8(%rbp), %eax # imm = 0x2710
movl %eax, -0x5b8(%rbp)
movl $0x8, %eax
subl -0x5b4(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x3eb7b
imull $0x64, -0x5b8(%rbp), %eax
movl %eax, -0x5b8(%rbp)
movl $0x8, %eax
subl -0x5b4(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x3eb9b
imull $0xa, -0x5b8(%rbp), %eax
movl %eax, -0x5b8(%rbp)
movl -0x5b8(%rbp), %ecx
movl -0x5b4(%rbp), %eax
movl $0x8, %esi
cltd
idivl %esi
cltq
movl %ecx, -0x5b0(%rbp,%rax,4)
jmp 0x3ebba
movq -0x3d8(%rbp), %rax
cmpq -0x3c8(%rbp), %rax
jae 0x3ec1a
movq -0x3d8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jle 0x3ebe8
movl -0x424(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x424(%rbp)
movq -0x3d8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x3d8(%rbp)
movq -0x3d8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
je 0x3ec18
movl -0x3dc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3dc(%rbp)
jmp 0x3ebba
movl $0x0, -0x5bc(%rbp)
movl -0x3dc(%rbp), %eax
subl $0x12, %eax
movl %eax, -0x3dc(%rbp)
movl -0x3dc(%rbp), %eax
andl $0x7, %eax
cmpl $0x0, %eax
je 0x3ed7c
movq $0x1, -0x5c8(%rbp)
movl -0x3dc(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x3ec70
imulq $0x2710, -0x5c8(%rbp), %rax # imm = 0x2710
movq %rax, -0x5c8(%rbp)
movl -0x3dc(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x3ec8d
imulq $0x64, -0x5c8(%rbp), %rax
movq %rax, -0x5c8(%rbp)
movl -0x3dc(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x3ecaa
imulq $0xa, -0x5c8(%rbp), %rax
movq %rax, -0x5c8(%rbp)
movl -0x3dc(%rbp), %eax
andl $-0x8, %eax
movl %eax, -0x3dc(%rbp)
movl -0x3dc(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x3dc(%rbp)
movq $0x0, -0x5d0(%rbp)
movl $0x0, -0x5d4(%rbp)
cmpl $0x64, -0x5d4(%rbp)
jge 0x3ed61
movq -0x5d0(%rbp), %rax
movslq -0x5d4(%rbp), %rcx
movl -0x5b0(%rbp,%rcx,4), %ecx
imulq -0x5c8(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x5e0(%rbp)
movq -0x5e0(%rbp), %rax
movl $0x5f5e100, %ecx        # imm = 0x5F5E100
xorl %edx, %edx
divq %rcx
movl %eax, %ecx
movslq -0x5d4(%rbp), %rax
movl %ecx, -0x5b0(%rbp,%rax,4)
movq -0x5e0(%rbp), %rax
movl $0x5f5e100, %ecx        # imm = 0x5F5E100
xorl %edx, %edx
divq %rcx
imulq $0x5f5e100, %rdx, %rax  # imm = 0x5F5E100
movq %rax, -0x5d0(%rbp)
movl -0x5d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5d4(%rbp)
jmp 0x3ecdd
cmpq $0x0, -0x5d0(%rbp)
je 0x3ed7a
movl -0x424(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x424(%rbp)
jmp 0x3ed7c
jmp 0x3ed7e
cmpl $0x0, -0x3dc(%rbp)
jle 0x3ee7a
movl -0x5b0(%rbp), %edi
callq 0x3f5d0
movzbl %al, %eax
addl $0x1, %eax
movl %eax, -0x5e4(%rbp)
movl -0x5e4(%rbp), %eax
addl -0x5bc(%rbp), %eax
movl %eax, -0x5bc(%rbp)
movl -0x3dc(%rbp), %eax
subl $0x8, %eax
movl %eax, -0x3dc(%rbp)
movl -0x5e4(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
movl %eax, -0x5e8(%rbp)
movl -0x5b0(%rbp), %eax
movq %rax, -0x5f0(%rbp)
movl $0x1, -0x5f4(%rbp)
cmpl $0x64, -0x5f4(%rbp)
jge 0x3ee68
movslq -0x5f4(%rbp), %rax
movl -0x5b0(%rbp,%rax,4), %eax
imulq $0x5f5e100, -0x5f0(%rbp), %rcx # imm = 0x5F5E100
addq %rcx, %rax
movq %rax, -0x600(%rbp)
movq -0x600(%rbp), %rax
movl -0x5e4(%rbp), %ecx
shrq %cl, %rax
movl %eax, %ecx
movl -0x5f4(%rbp), %eax
subl $0x1, %eax
cltq
movl %ecx, -0x5b0(%rbp,%rax,4)
movq -0x600(%rbp), %rax
movl -0x5e8(%rbp), %ecx
andq %rcx, %rax
movq %rax, -0x5f0(%rbp)
movl -0x5f4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5f4(%rbp)
jmp 0x3edf0
movq -0x5f0(%rbp), %rax
movl %eax, -0x424(%rbp)
jmp 0x3f091
cmpl $0x0, -0x3dc(%rbp)
jge 0x3efbd
cmpl $0x2, -0x5b0(%rbp)
jb 0x3efbd
movl $0x1a, -0x604(%rbp)
movl -0x604(%rbp), %ecx
movl -0x5bc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x5bc(%rbp)
movl -0x3dc(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x3dc(%rbp)
movl -0x424(%rbp), %eax
movl -0x604(%rbp), %ecx
shlq %cl, %rax
movq %rax, -0x610(%rbp)
movq -0x610(%rbp), %rax
movl $0x5f5e100, %ecx        # imm = 0x5F5E100
xorl %edx, %edx
divq %rcx
movq %rax, -0x6c8(%rbp)
movq -0x610(%rbp), %rax
movl $0x5f5e100, %ecx        # imm = 0x5F5E100
xorl %edx, %edx
divq %rcx
movq -0x6c8(%rbp), %rax
movq %rdx, %rsi
xorl %ecx, %ecx
movl $0x1, %edx
cmpq $0x0, %rsi
cmovnel %edx, %ecx
movslq %ecx, %rcx
orq %rcx, %rax
movq %rax, -0x618(%rbp)
movl $0x62, -0x61c(%rbp)
cmpl $0x0, -0x61c(%rbp)
jl 0x3efab
movslq -0x61c(%rbp), %rax
movl -0x5b0(%rbp,%rax,4), %eax
movl -0x604(%rbp), %ecx
shlq %cl, %rax
addq -0x618(%rbp), %rax
movq %rax, -0x628(%rbp)
movq -0x628(%rbp), %rax
movl $0x5f5e100, %ecx        # imm = 0x5F5E100
xorl %edx, %edx
divq %rcx
movl %edx, %ecx
movl -0x61c(%rbp), %eax
addl $0x1, %eax
cltq
movl %ecx, -0x5b0(%rbp,%rax,4)
movq -0x628(%rbp), %rax
movl $0x5f5e100, %ecx        # imm = 0x5F5E100
xorl %edx, %edx
divq %rcx
movq %rax, -0x618(%rbp)
movl -0x61c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x61c(%rbp)
jmp 0x3ef2f
movq -0x618(%rbp), %rax
movl %eax, -0x5b0(%rbp)
jmp 0x3f08f
cmpl $0x1312d00, -0x5b0(%rbp) # imm = 0x1312D00
jae 0x3f08b
movl -0x5b0(%rbp), %edi
callq 0x3f5d0
movzbl %al, %ecx
movl $0x19, %eax
subl %ecx, %eax
movl %eax, -0x62c(%rbp)
movl -0x62c(%rbp), %ecx
movl -0x5bc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x5bc(%rbp)
movq $0x0, -0x638(%rbp)
movl $0x63, -0x63c(%rbp)
cmpl $0x0, -0x63c(%rbp)
jl 0x3f089
movslq -0x63c(%rbp), %rax
movl -0x5b0(%rbp,%rax,4), %eax
movl -0x62c(%rbp), %ecx
shlq %cl, %rax
addq -0x638(%rbp), %rax
movq %rax, -0x648(%rbp)
movq -0x648(%rbp), %rax
movl $0x5f5e100, %ecx        # imm = 0x5F5E100
xorl %edx, %edx
divq %rcx
movl %edx, %ecx
movslq -0x63c(%rbp), %rax
movl %ecx, -0x5b0(%rbp,%rax,4)
movq -0x648(%rbp), %rax
movl $0x5f5e100, %ecx        # imm = 0x5F5E100
xorl %edx, %edx
divq %rcx
movq %rax, -0x638(%rbp)
movl -0x63c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x63c(%rbp)
jmp 0x3f011
jmp 0x3f08d
jmp 0x3f096
jmp 0x3f08f
jmp 0x3f091
jmp 0x3ed7e
movb $0x1, -0x649(%rbp)
movl -0x5b0(%rbp), %eax
movabsq $0x2540be400, %rcx      # imm = 0x2540BE400
imulq %rcx, %rax
movl -0x5ac(%rbp), %ecx
imulq $0x64, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x6d0(%rbp)
movl -0x5a8(%rbp), %eax
movl $0xf4240, %ecx          # imm = 0xF4240
xorl %edx, %edx
divl %ecx
movl %eax, %ecx
movq -0x6d0(%rbp), %rax
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x658(%rbp)
cmpq $0x0, -0x658(%rbp)
jne 0x3f0f8
jmp 0x3f41e
movq -0x658(%rbp), %rdi
callq 0x3f5f0
movzbl %al, %ecx
movl $0x3c, %eax
subl %ecx, %eax
movl %eax, -0x65c(%rbp)
movl -0x65c(%rbp), %ecx
movq -0x658(%rbp), %rax
movl %ecx, %ecx
shlq %cl, %rax
movq %rax, -0x658(%rbp)
movl -0x65c(%rbp), %ecx
movl -0x5bc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x5bc(%rbp)
movl -0x5bc(%rbp), %eax
addl $0x3ff, %eax            # imm = 0x3FF
addl $0x3c, %eax
subl $0x1, %eax
cmpl $-0x3c, %eax
jg 0x3f15c
jmp 0x3f41e
movq -0x658(%rbp), %rax
movq %rax, -0x668(%rbp)
movl $0x0, -0x66c(%rbp)
movl -0x5bc(%rbp), %eax
addl $0x3ff, %eax            # imm = 0x3FF
addl $0x3c, %eax
subl $0x1, %eax
cmpl $0x0, %eax
jge 0x3f1a6
movl -0x5bc(%rbp), %ecx
addl $0x3ff, %ecx            # imm = 0x3FF
addl $0x3c, %ecx
subl $0x1, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x66c(%rbp)
movq -0x3a0(%rbp), %rax
movzbl 0x9(%rax), %eax
cmpl $0x34, %eax
je 0x3f1ed
movl -0x5bc(%rbp), %eax
addl $0xd1, %eax
cmpl $0x17, %eax
jg 0x3f1e1
movl -0x5bc(%rbp), %ecx
addl $0xd1, %ecx
movl $0x34, %eax
subl %ecx, %eax
movl %eax, -0x66c(%rbp)
jmp 0x3f1eb
movl $0x1d, -0x66c(%rbp)
jmp 0x3f1ed
movl -0x66c(%rbp), %ecx
movq -0x658(%rbp), %rax
movl %ecx, %ecx
shrq %cl, %rax
movq %rax, -0x658(%rbp)
movl -0x66c(%rbp), %eax
addl -0x5bc(%rbp), %eax
movl %eax, -0x5bc(%rbp)
movq -0x658(%rbp), %rax
movl -0x66c(%rbp), %ecx
shlq %cl, %rax
cmpq -0x668(%rbp), %rax
je 0x3f243
movq -0x658(%rbp), %rax
orq $0x1, %rax
movq %rax, -0x658(%rbp)
movq -0x658(%rbp), %rax
andq $0x80, %rax
cmpq $0x0, %rax
je 0x3f2e8
movq -0x658(%rbp), %rax
andq $0x17f, %rax            # imm = 0x17F
cmpq $0x0, %rax
jne 0x3f281
movl -0x5a8(%rbp), %eax
movl $0xf4240, %ecx          # imm = 0xF4240
xorl %edx, %edx
divl %ecx
cmpl $0x0, %edx
je 0x3f297
movq -0x658(%rbp), %rax
addq $0x80, %rax
movq %rax, -0x658(%rbp)
jmp 0x3f2e6
movl $0x3, -0x670(%rbp)
cmpl $0x64, -0x670(%rbp)
jge 0x3f2e4
movslq -0x670(%rbp), %rax
cmpl $0x0, -0x5b0(%rbp,%rax,4)
je 0x3f2d1
movq -0x658(%rbp), %rax
addq $0x80, %rax
movq %rax, -0x658(%rbp)
jmp 0x3f2e4
jmp 0x3f2d3
movl -0x670(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x670(%rbp)
jmp 0x3f2a1
jmp 0x3f2e6
jmp 0x3f2e8
movq -0x658(%rbp), %rdi
callq 0x3f5f0
movzbl %al, %ecx
movl $0x3d, %eax
subl %ecx, %eax
movl %eax, -0x674(%rbp)
movl -0x674(%rbp), %ecx
movq -0x658(%rbp), %rax
movl %ecx, %ecx
shlq %cl, %rax
movq %rax, -0x658(%rbp)
movl -0x674(%rbp), %ecx
movl -0x5bc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x5bc(%rbp)
movl -0x5bc(%rbp), %eax
addl $0x3ff, %eax            # imm = 0x3FF
addl $0x3d, %eax
cmpl $0x0, %eax
jg 0x3f39e
movl -0x5bc(%rbp), %eax
addl $0x3ff, %eax            # imm = 0x3FF
addl $0x3d, %eax
xorl %ecx, %ecx
subl %eax, %ecx
movq -0x658(%rbp), %rax
movl %ecx, %ecx
shrq %cl, %rax
movq %rax, -0x658(%rbp)
movq -0x658(%rbp), %rax
shrq $0xa, %rax
movq %rax, -0x1d0(%rbp)
movq -0x1d0(%rbp), %rax
movq %rax, -0x1d8(%rbp)
movsd -0x1d8(%rbp), %xmm0
movq -0x398(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0x3f41c
movl -0x5bc(%rbp), %eax
movq -0x3a0(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jl 0x3f3cc
movq -0x398(%rbp), %rax
movsd 0x24a39(%rip), %xmm0    # 0x63df8
movsd %xmm0, (%rax)
movb $0x0, -0x649(%rbp)
jmp 0x3f41a
movl -0x5bc(%rbp), %eax
addl $0x3ff, %eax            # imm = 0x3FF
addl $0x3d, %eax
cltq
shlq $0x34, %rax
movq -0x658(%rbp), %rcx
shlq $0x3, %rcx
shrq $0xc, %rcx
orq %rcx, %rax
movq %rax, -0x1e0(%rbp)
movq -0x1e0(%rbp), %rax
movq %rax, -0x1e8(%rbp)
movsd -0x1e8(%rbp), %xmm0
movq -0x398(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0x3f41c
jmp 0x3f41e
testb $0x1, -0x3c9(%rbp)
je 0x3f454
movq -0x398(%rbp), %rax
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq -0x398(%rbp), %rax
movsd %xmm0, (%rax)
movb -0x649(%rbp), %al
andb $0x1, %al
movb %al, -0x379(%rbp)
movb -0x379(%rbp), %al
andb $0x1, %al
addq $0x6d0, %rsp            # imm = 0x6D0
popq %rbp
retq
nopw %cs:(%rax,%rax)