// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
movq %rdx, %rbx
movq %rdi, 0x10(%rsp)
movq %rsi, 0x18(%rsp)
andq $0x0, (%rdx)
movq %rcx, %r14
movq %rsi, %rax
shrq $0x38, %rax
testq %rsi, %rsi
js 0x15e79
movl %eax, %ecx
xorb $0xf, %cl
movzbl %cl, %esi
leaq (%rsp,%rsi), %rdx
addq $0x10, %rdx
leaq 0x10(%rsp), %r12
jmp 0x15e8d
cmpl $0x2710, %esi           # imm = 0x2710
ja 0x164b0
movl %esi, %edx
addq %rdi, %rdx
movq %rdi, %r12
xorl %r15d, %r15d
testl %esi, %esi
je 0x15ea0
cmpb $0x2d, (%r12)
sete %r15b
addq %r15, %r12
movzbl (%r12), %ecx
leaq 0x12de4(%rip), %r9      # 0x28c90
testb $0x40, (%r9,%rcx)
je 0x16137
cmpq %rdx, %r12
je 0x16137
leaq 0x1(%r12), %r13
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
xorl %edi, %edi
xorl %esi, %esi
xorl %ecx, %ecx
movsbl -0x1(%r13), %eax
movslq %eax, %r10
addq $-0x30, %r10
movl %r10d, %r11d
andl $0xfe, %r11d
cmpl $0x9, %r11d
ja 0x15efe
imulq $0xa, %rcx, %rcx
addq %r10, %rcx
orq %rcx, %rsi
decl %r8d
incl %edi
jmp 0x15f24
cmpb $0x2e, %al
jne 0x15fec
xorl %eax, %eax
testl %r8d, %r8d
jle 0x164b2
movzbl (%r13), %r8d
testb $0x40, (%r9,%r8)
je 0x164b2
xorl %r8d, %r8d
leaq 0x1(%r13), %rax
cmpq %rdx, %r13
movq %rax, %r13
jne 0x15ed1
movl %r8d, %ebp
sarl $0x1f, %ebp
andl %r8d, %ebp
movq %rdx, %r13
movl %ebp, %eax
negl %eax
cmovsl %ebp, %eax
movzbl 0x8(%r14), %edx
cmpl %edx, %eax
ja 0x160c9
cmpq (%r14), %rcx
ja 0x160c9
cmpl $0x12, %edi
jg 0x160c9
xorl %edx, %edx
testb $0x1, %al
sete %dl
leaq 0x12e60(%rip), %rsi     # 0x28dd0
movsd (%rsi,%rdx,8), %xmm0
testb $0x2, %al
je 0x15f81
mulsd 0x12e17(%rip), %xmm0    # 0x28d98
testb $0x4, %al
je 0x15f8d
mulsd 0x12e13(%rip), %xmm0    # 0x28da0
testb $0x8, %al
je 0x15f99
mulsd 0x12e0f(%rip), %xmm0    # 0x28da8
testb $0x10, %al
je 0x15fa5
mulsd 0x12e0b(%rip), %xmm0    # 0x28db0
movq %rcx, %xmm2
punpckldq 0x12e2e(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x12e36(%rip), %xmm2    # 0x28df0
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
testl %ebp, %ebp
js 0x15fd0
mulsd %xmm0, %xmm1
jmp 0x15fd4
divsd %xmm0, %xmm1
testb %r15b, %r15b
je 0x15fe1
xorpd 0x12ddf(%rip), %xmm1    # 0x28dc0
movsd %xmm1, (%rbx)
movb $0x1, %al
jmp 0x164b2
andl $-0x21, %eax
cmpl $0x45, %eax
jne 0x164b0
movb (%r13), %r9b
leaq 0x1(%r13), %rax
cmpb $0x2b, %r9b
movq %r13, %r11
cmoveq %rax, %r11
cmpb $0x2d, %r9b
cmoveq %rax, %r11
xorl %eax, %eax
cmpq %rdx, %r11
je 0x164b2
movq %r14, 0x8(%rsp)
decq %r13
movl %r8d, %r10d
sarl $0x1f, %r10d
andl %r8d, %r10d
xorl %r8d, %r8d
cmpq %rdx, %r11
jae 0x1605d
movzbl (%r11), %ebp
leal -0x3a(%rbp), %r14d
cmpb $-0xa, %r14b
jb 0x164b0
imull $0xa, %r8d, %r8d
addl %ebp, %r8d
addl $-0x30, %r8d
orl %r8d, %eax
incq %r11
jmp 0x16033
cmpl $0x4000, %eax           # imm = 0x4000
jb 0x160af
xorpd %xmm0, %xmm0
cmpb $0x2d, %r9b
je 0x16088
testq %rsi, %rsi
je 0x16088
movabsq $0x7ff0000000000000, %rax # imm = 0x7FF0000000000000
movq %rax, (%rbx)
movsd 0x12d08(%rip), %xmm0    # 0x28d90
testb %r15b, %r15b
je 0x16099
xorpd 0x12d2b(%rip), %xmm0    # 0x28dc0
movlpd %xmm0, (%rbx)
xorpd %xmm1, %xmm1
cmpeqsd %xmm0, %xmm1
movq %xmm1, %rax
andl $0x1, %eax
jmp 0x164b2
movl %r8d, %ebp
negl %ebp
cmpb $0x2d, %r9b
cmovnel %r8d, %ebp
addl %r10d, %ebp
movq 0x8(%rsp), %r14
jmp 0x15f3c
testq %rsi, %rsi
je 0x164c4
decq %r12
cmpb $0x31, 0x1(%r12)
leaq 0x1(%r12), %r12
jl 0x160d5
leaq 0x20(%rsp), %rdi
movl $0x190, %edx            # imm = 0x190
xorl %esi, %esi
callq 0x3170
xorl %edi, %edi
xorl %eax, %eax
cmpl $0x31f, %edi            # imm = 0x31F
ja 0x16184
cmpq %r13, %r12
jae 0x16184
movsbl (%r12), %ecx
cmpl $0x2e, %ecx
jne 0x16117
incq %r12
jmp 0x160f7
imull $0xa, %eax, %eax
addl %ecx, %eax
addl $-0x30, %eax
movl %edi, %ecx
notl %ecx
testb $0x7, %cl
jne 0x16133
movl %edi, %ecx
shrl $0x3, %ecx
movl %eax, 0x20(%rsp,%rcx,4)
xorl %eax, %eax
incl %edi
jmp 0x16112
movl %edi, %ecx
shrl $0x10, %ecx
cmpl $0xc, %eax
jne 0x1615c
movl %edi, %edx
xorl $0x6e69, %edx           # imm = 0x6E69
movl %ecx, %esi
xorb $0x66, %sil
movzbl %sil, %esi
orw %dx, %si
je 0x164da
movq %rax, %rdx
xorq $0xb, %rdx
movl %edi, %esi
xorq $0x666e692d, %rsi       # imm = 0x666E692D
orq %rdx, %rsi
jne 0x1649a
movabsq $-0x10000000000000, %rax # imm = 0xFFF0000000000000
jmp 0x1651f
testl %eax, %eax
je 0x161b4
pushq $0x8
popq %rcx
subl %edi, %ecx
imull $0x2710, %eax, %edx     # imm = 0x2710
testb $0x4, %cl
cmovel %eax, %edx
imull $0x64, %edx, %eax
testb $0x2, %cl
cmovel %edx, %eax
imull $0xa, %eax, %edx
testb $0x1, %cl
cmovel %eax, %edx
movl %edi, %eax
shrl $0x3, %eax
movl %edx, 0x20(%rsp,%rax,4)
addl %ebp, %edi
movl 0x1ac(%rsp), %eax
cmpq %r13, %r12
jae 0x161e7
cmpb $0x31, (%r12)
jl 0x161d3
orl $0x1, %eax
movl %eax, 0x1ac(%rsp)
xorl %ecx, %ecx
cmpb $0x2e, 0x1(%r12)
leaq 0x1(%r12), %r12
setne %cl
addl %ecx, %edi
jmp 0x161bd
leal -0x12(%rdi), %esi
pushq $0x1
popq %r8
testb $0x7, %sil
je 0x1625c
testb $0x4, %sil
movl $0x2710, %eax           # imm = 0x2710
cmoveq %r8, %rax
imulq $0x64, %rax, %rdx
testb $0x2, %sil
cmoveq %rax, %rdx
imulq $0xa, %rdx, %rcx
testb $0x1, %dil
cmoveq %rdx, %rcx
andl $-0x8, %esi
xorl %edi, %edi
movl $0x5f5e100, %r9d        # imm = 0x5F5E100
xorl %edx, %edx
cmpq $0x64, %rdi
je 0x1624c
movl 0x20(%rsp,%rdi,4), %eax
imulq %rcx, %rax
addq %rdx, %rax
xorl %edx, %edx
divq %r9
movl %eax, 0x20(%rsp,%rdi,4)
imulq $0x5f5e100, %rdx, %rdx  # imm = 0x5F5E100
incq %rdi
jmp 0x16226
addl $0x8, %esi
testq %rdx, %rdx
je 0x1625c
orb $0x1, 0x1ac(%rsp)
xorl %edi, %edi
pushq $-0x1
popq %r9
movl $0x5f5e100, %r10d       # imm = 0x5F5E100
pushq $0x63
popq %r11
pushq $0x63
popq %rbp
testl %esi, %esi
jg 0x162d5
setne %cl
movl 0x20(%rsp), %eax
cmpl $0x2, %eax
setae %dl
andb %cl, %dl
cmpb $0x1, %dl
je 0x16333
movl %eax, %ecx
cmpl $0x1312cff, %ecx        # imm = 0x1312CFF
ja 0x1638d
bsrl %ecx, %ecx
notl %ecx
addl $0x1a, %ecx
xorl %eax, %eax
movl %ebp, %r12d
testl %r12d, %r12d
js 0x162d1
movq %r14, %r13
movl %r12d, %r14d
movl 0x20(%rsp,%r14,4), %edx
shlq %cl, %rdx
addq %rax, %rdx
movq %rdx, %rax
xorl %edx, %edx
divq %r10
movl %edx, 0x20(%rsp,%r14,4)
movq %r13, %r14
decl %r12d
jmp 0x162a6
subl %ecx, %edi
jmp 0x1626f
movq %r14, %r13
movl 0x20(%rsp), %eax
bsrl %eax, %ecx
xorl $0x1f, %ecx
movb $0x20, %r14b
subb %cl, %r14b
negb %cl
movl %r9d, %edx
shll %cl, %edx
movzbl %r14b, %ecx
addl %ecx, %edi
notl %edx
movq %r8, %r12
cmpq $0x64, %r12
je 0x16321
movl 0x20(%rsp,%r12,4), %r14d
imulq $0x5f5e100, %rax, %rax  # imm = 0x5F5E100
addq %r14, %rax
movq %rax, %r14
shrq %cl, %r14
movl %r14d, 0x1c(%rsp,%r12,4)
andl %edx, %eax
incq %r12
jmp 0x162fa
addl $-0x8, %esi
movl %eax, 0x1ac(%rsp)
movq %r13, %r14
jmp 0x1626f
movl 0x1ac(%rsp), %eax
shlq $0x1a, %rax
xorl %edx, %edx
divq %r10
movq %rax, %rcx
addl $-0x1a, %edi
xorl %eax, %eax
testq %rdx, %rdx
setne %al
orq %rcx, %rax
movq %r11, %r12
leaq -0x1(%r12), %r13
testl %r13d, %r13d
js 0x16381
movl %r13d, %ecx
movl 0x20(%rsp,%rcx,4), %ecx
shlq $0x1a, %rcx
addq %rax, %rcx
movq %rcx, %rax
xorl %edx, %edx
divq %r10
movl %edx, 0x20(%rsp,%r12,4)
movq %r13, %r12
jmp 0x16357
addl $0x8, %esi
movl %eax, 0x20(%rsp)
jmp 0x1626f
movl 0x24(%rsp), %r8d
movl 0x28(%rsp), %eax
movl $0xf4240, %esi          # imm = 0xF4240
xorl %edx, %edx
divl %esi
movl %eax, %esi
movabsq $0x2540be400, %rax      # imm = 0x2540BE400
imulq %rax, %rcx
imulq $0x64, %r8, %r8
addq %rcx, %r8
movb $0x1, %al
pxor %xmm0, %xmm0
addq %r8, %rsi
je 0x1653e
bsrq %rsi, %rcx
notl %ecx
addl $0x3d, %ecx
subl %ecx, %edi
cmpl $0xfffffb8b, %edi       # imm = 0xFFFFFB8B
jl 0x1653e
leal 0x43a(%rdi), %r8d
negl %r8d
xorl %r9d, %r9d
cmpl $0xfffffbc6, %edi       # imm = 0xFFFFFBC6
cmovll %r8d, %r9d
shlq %cl, %rsi
movl $0xffffff63, %r8d       # imm = 0xFFFFFF63
subl %edi, %r8d
cmpl $0xffffff47, %edi       # imm = 0xFFFFFF47
pushq $0x1d
popq %rcx
cmovll %r8d, %ecx
movq %r14, %r11
cmpb $0x34, 0x9(%r14)
cmovel %r9d, %ecx
movq %rsi, %r9
shrq %cl, %r9
movl %ecx, %r8d
addl %edi, %r8d
movq %r9, %r10
shlq %cl, %r10
xorl %edi, %edi
cmpq %rsi, %r10
setne %dil
orq %r9, %rdi
testb %r9b, %r9b
jns 0x16461
testl %edx, %edx
jne 0x1645d
movl %edi, %ecx
andl $0x17f, %ecx            # imm = 0x17F
jne 0x1645d
pushq $0x3
popq %rcx
cmpq $0x64, %rcx
je 0x16461
cmpl $0x0, 0x20(%rsp,%rcx,4)
leaq 0x1(%rcx), %rcx
je 0x1644c
subq $-0x80, %rdi
bsrq %rdi, %rcx
movl %ecx, %edx
notb %cl
addb $0x3e, %cl
shlq %cl, %rdi
xorl $0x3f, %edx
subl %edx, %r8d
leal 0x2(%r8), %ecx
cmpl $0xfffffbc4, %ecx       # imm = 0xFFFFFBC4
jg 0x164e6
movb $-0x3e, %cl
subb %r8b, %cl
shrq %cl, %rdi
shrq $0xa, %rdi
movq %rdi, (%rbx)
movq %rdi, %xmm0
jmp 0x1653e
cmpl $0xc, %eax
jne 0x164b0
xorl $0x616e, %edi           # imm = 0x616E
xorb $0x6e, %cl
movzbl %cl, %eax
orw %di, %ax
je 0x16515
xorl %eax, %eax
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %al
testb %r15b, %r15b
je 0x164b2
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
movq %rcx, (%rbx)
jmp 0x164b2
movabsq $0x7ff0000000000000, %rax # imm = 0x7FF0000000000000
jmp 0x1651f
cmpl 0xc(%r11), %ecx
jge 0x16527
addl $0x43e, %r8d            # imm = 0x43E
shlq $0x34, %r8
shrq $0x9, %rdi
movabsq $0xfffffffffffff, %rcx  # imm = 0xFFFFFFFFFFFFF
andq %rdi, %rcx
orq %r8, %rcx
movq %rcx, (%rbx)
movq %rcx, %xmm0
jmp 0x1653e
movabsq $0x7ff8000000000000, %rax # imm = 0x7FF8000000000000
movq %rax, (%rbx)
jmp 0x15fe5
movabsq $0x7ff0000000000000, %rax # imm = 0x7FF0000000000000
movq %rax, (%rbx)
movq 0x12854(%rip), %xmm0    # 0x28d90
xorl %eax, %eax
testb %r15b, %r15b
je 0x164b2
pxor 0x12871(%rip), %xmm0    # 0x28dc0
movq %xmm0, (%rbx)
jmp 0x164b2