// File: Alcaro[P]bridges/arlib/deflate-decomp.cpp
// Function: inflator::inflate()
inflator::ret_t inflator::inflate()
{
	enum {
		st_blockinit,
		st_litblock_head,
		st_litblock,
		st_huff1,
		st_huff2,
		st_huff3,
		st_mainloop,
		st_litbyte,
		st_copy
	};
	
	switch (m_state)
	{
		while (true)
		{
		[[fallthrough]];
		case st_blockinit:
			bits_refill_fast();
			if (UNLIKELY(m_in_nbits < 3+7)) // empty block with default huffman tables is 3+7 bits; literal can also use 3+7
			{
				assert_reached();
				m_state = st_blockinit;
				goto do_ret_more_input;
			}
			m_block_type = bits_extract(3);
			if (m_block_type < 1*2) // literal block
			{
				m_in_bits_buf >>= m_in_nbits&7;
				m_in_nbits &= ~7;
				
			[[fallthrough]];
			case st_litblock_head:
				bits_refill_fast();
				
				if (UNLIKELY(m_in_nbits < 32))
				{
					assert_reached();
					m_state = st_litblock_head;
					goto do_ret_more_input;
				}
				
				uint32_t len;
				{
					len = m_in_bits_buf; // this truncates to 32 bits
					len = len ^ ((~len)<<16);
					if (UNLIKELY(len >= 0x10000)) RET_FAIL();
					m_in_nbits -= 32;
					m_in_bits_buf >>= 32;
				}
				
				if(0) {
			case st_litblock:
					len = m_stlitblk_len;
				}
				while (m_in_nbits && len)
				{
					if (UNLIKELY(m_out_end == m_out_at))
					{
						assert_reached();
						m_state = st_litblock;
						m_stlitblk_len = len;
						return ret_more_output;
					}
					assert_reached();
					*m_out_at++ = bits_extract(8);
					len--;
				}
				
				uint32_t len_actual = min(len, m_in_end-m_in_at, m_out_end-m_out_at);
				memcpy(m_out_at, m_in_at, len_actual);
				len -= len_actual;
				m_in_at += len_actual;
				m_out_at += len_actual;
				
				if (UNLIKELY(len))
				{
					assert_reached();
					m_state = st_litblock;
					m_stlitblk_len = len;
					if (m_in_at == m_in_end) goto do_ret_more_input;
					else return ret_more_output;
				}
				
				if (m_in_nbits) assert_reached();
			}
			else if (LIKELY(m_block_type < 3*2))
			{
				if (m_block_type & 4)
				{
				[[fallthrough]];
				case st_huff1:
					bits_refill_fast();
					if (UNLIKELY(m_in_nbits < 5+5+4))
					{
						assert_reached();
						m_state = st_huff1;
						goto do_ret_more_input;
					}
					// if we run out of bits, we'll read infinite zeroes, which will either error out or emit nonsense tables
					// in both cases, it will terminate, so it's safe to defer the underflow check to later
					
					// dynamic huffman
					uint32_t huff_sizes;
					huff_sizes = bits_extract(5+5+4);
					if(0) {
				case st_huff2:
						huff_sizes = m_sthuff2_sizes;
					}
					
					uint32_t hlit;
					uint32_t hdist;
					{
						hlit = (huff_sizes&31) + 257;
						hdist = ((huff_sizes>>5)&31) + 1;
						uint32_t hclen = (huff_sizes>>10) + 4;
						
						// DEFLATE can represent 288 symbols and 32 distance codes, but only 286 resp. 30 are valid. why
						// RFC 1951 seems to explicitly allow HDIST > 30 (though using them is forbidden), but zlib rejects it
						if (UNLIKELY(hlit > 286 || hdist > 30)) RET_FAIL();
						
						bits_refill_all();
						if (UNLIKELY(m_in_nbits < hclen*3))
						{
							assert_reached();
							m_state = st_huff2;
							m_sthuff2_sizes = huff_sizes;
							goto do_ret_more_input;
						}
						
						static const uint8_t huff_al_order[19] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 };
						uint8_t huff_al_len[19];
						memset(huff_al_len, 0, 16); // last 3 are guaranteed overwritten by below loop, no point clearing them
						// first is guaranteed overwritten too, but 16 optimizes better than 15
						
						for (uint32_t i=0;i<hclen;i++) huff_al_len[huff_al_order[i]] = bits_extract(3);
						
						bool ok = unpack_huffman_dfl(m_huff_symbol, huff_al_len, 19, 19);
						if (UNLIKELY(!ok)) RET_FAIL();
					}
					
					uint32_t i;
					i = 0;
					if(0) {
				case st_huff3:
						huff_sizes = m_sthuff2_sizes;
						hlit = (m_sthuff2_sizes&31) + 257;
						hdist = ((m_sthuff2_sizes>>5)&31) + 1;
						i = m_sthuff3_iter;
					}
					while (i < hlit+hdist)
					{
						bits_refill_fast();
						if (UNLIKELY(m_in_nbits < 15+7 && !m_in_last))
						{
							assert_reached();
							m_state = st_huff3;
							m_sthuff2_sizes = huff_sizes;
							m_sthuff3_iter = i;
							goto do_ret_more_input;
						}
						
						int sym = bits_read_huffman(m_huff_symbol); // takes 15 bits
						if (UNLIKELY((int32_t)m_in_nbits < 0)) RET_FAIL();
						
						if (sym <= 15)
						{
							m_symbol_lengths[i++] = sym;
						}
						else if (sym == 16) // repeat last length
						{
							uint32_t n_rep = bits_extract(2) + 3;
							if (UNLIKELY(i == 0)) RET_FAIL();
							if (UNLIKELY(i+n_rep > hlit+hdist)) RET_FAIL();
							int last = m_symbol_lengths[i-1];
							for (uint32_t j=0;j<n_rep;j++)
								m_symbol_lengths[i++] = last;
						}
						else // sym 17 or 18 (invalid symbols are impossible)
						{
							uint32_t n_rep = bits_extract((sym-17)*4+3) + (sym-17)*8+3; // takes 7 bits
							if (UNLIKELY(i+n_rep > hlit+hdist)) RET_FAIL();
							for (uint32_t j=0;j<n_rep;j++)
								m_symbol_lengths[i++] = 0;
						}
					}
					
					if (UNLIKELY(!unpack_huffman_dfl(m_huff_symbol, m_symbol_lengths, hlit, 287))) RET_FAIL();
					uint8_t tmp[32];
					memcpy(tmp, m_symbol_lengths+hlit, 32); // copy it - m_symbol_lengths is a union with m_huff_distance
					if (UNLIKELY(!unpack_huffman_dfl(m_huff_distance, tmp, hdist, 31))) RET_FAIL();
				}
				else
				{
					// static huffman
					uint8_t len[288];
					for (int i=0 ; i<=32; i++) len[i] = 5;
					unpack_huffman_dfl(m_huff_distance, len, 32, 0);
					for (int i=0 ; i<=143;i++) len[i] = 8;
					for (int i=144;i<=255;i++) len[i] = 9;
					for (int i=256;i<=279;i++) len[i] = 7;
					for (int i=280;i<=287;i++) len[i] = 8;
					unpack_huffman_dfl(m_huff_symbol, len, 288, 0);
				}
				
				m_state = st_mainloop;
			[[fallthrough]];
			case st_mainloop:
			case st_copy:
			case st_litbyte:
				// moving these to locals drops runtime to ~75% of using members directly
				const uint8_t * out_prev = m_out_prev;
				uint8_t * out_start = m_out_start;
				uint8_t * out_at = m_out_at;
				uint8_t * out_end = m_out_end;
				const uint8_t * in_at = m_in_at;
				const uint8_t * in_end = m_in_end;
				uint64_t bits_buf = m_in_bits_buf;
				uint32_t nbits = m_in_nbits;
				
				ret_t ret_state = ret_done;
				
				if (m_state != st_mainloop)
				{
					if (m_state == st_copy) goto st_copy_inner;
					else if (m_state == st_litbyte) goto st_litbyte_inner;
					else __builtin_unreachable();
				}
				
				while (true)
				{
					// max bits needed per symbol: 15 (huff_symbol) + 5 (length bits) + 15 (huff_distance) + 13 (distance bits) = 48
					
					if (LIKELY(in_end-in_at >= 8))
					{
						if (nbits <= 32)
						{
							bits_buf |= (uint64_t)readu_le32(in_at) << nbits;
							nbits += 32;
							in_at += 4;
						}
					}
					else
					{
						while (nbits <= 56 && in_at != in_end)
						{
							assert_reached();
							bits_buf |= (uint64_t)*in_at++ << nbits;
							nbits += 8;
						}
						
						if (nbits < 48 && !m_in_last)
						{
							assert_reached();
							ret_state = ret_more_input;
							goto inner_return;
						}
					}
					
					// at this point, we know that either
					// - there are at least 32 bits in the bit buffer, and at least 32 bits in the byte buffer
					//    -> a 32bit refill without bounds check is safe
					// - there are at least 48 bits in the bit buffer
					//    -> there's no need to refill
					// - we're at EOF
					//    -> comp_at == in_end
					// -> either comp_at == in_end, a 32bit refill is safe, or there's no need to refill
					// -> can do a 32bit refill if comp_at != in_end
					// TODO: investigate performance of adding a 16bit refill up there and not refilling further down
					
					int symbol;
					HUFF_READ_FAST(m_huff_symbol, symbol); // takes 15 bits
					if (UNLIKELY((int32_t)nbits < 0)) RET_FAIL();
					
					if (symbol < 256)
					{
						if (0)
						{
					st_litbyte_inner:
							symbol = m_stlitby_val;
						}
						if (UNLIKELY(out_at == out_end))
						{
							assert_reached();
							ret_state = ret_more_output;
							m_state = st_litbyte;
							m_stlitby_val = symbol;
							goto inner_return;
						}
						*out_at++ = symbol;
					}
					else if (LIKELY(symbol <= 285))
					{
						size_t len;
						size_t dist;
						
						{
							static const uint16_t sym_detail[] = {
								  3+(0<<12),  4+(0<<12),  5+(0<<12),  6+(0<<12),   7+(0<<12), 8+(0<<12), 9+(0<<12), 10+(0<<12),
								 11+(1<<12), 13+(1<<12), 15+(1<<12), 17+(1<<12),  19+(2<<12),23+(2<<12),27+(2<<12), 31+(2<<12),
								 35+(3<<12), 43+(3<<12), 51+(3<<12), 59+(3<<12),  67+(4<<12),83+(4<<12),99+(4<<12),115+(4<<12),
								131+(5<<12),163+(5<<12),195+(5<<12),227+(5<<12), 258+(0<<12)
							};
							uint16_t detail = sym_detail[symbol-257];
							
							BITS_FAST(detail>>12, len); // takes 5 bits
							len += (detail&511);
							
							// do not refill after underflow, shift by huge is UB
							if (LIKELY((uint32_t)nbits >= 15+13)) assert_reached();
							else if (LIKELY(in_at != in_end))
							{
								assert_reached();
								bits_buf |= (uint64_t)readu_le32(in_at) << nbits;
								nbits += 32;
								in_at += 4;
							}
							else assert_reached();
							
							int dist_key;
							HUFF_READ_FAST(m_huff_distance, dist_key); // takes 15 bits
							
							int dist_base = ((2+(dist_key&1)) << (dist_key>>1) >> 1) + (dist_key!=0);
							int dist_bits = (dist_key>>1) - (dist_key >= 2);
							
							BITS_FAST(dist_bits, dist); // takes 13 bits
							dist += dist_base;
							
							if (dist == 32768) assert_reached();
							if (UNLIKELY(dist > 32768)) RET_FAIL(); // dist_key >= 30 ends up here
							// no need to check earlier, underflow just yields endless zeroes
							if (UNLIKELY((int32_t)nbits < 0)) RET_FAIL();
						}
						
						if(0) {
					st_copy_inner:
							len = m_stcopy_len;
							dist = m_stcopy_dist;
						}
						
						if (dist > (size_t)(out_at-out_start))
						{
							if (!out_prev) RET_FAIL();
							assert_reached();
							
							size_t dist_prev = dist-(out_at-out_start);
							
							const uint8_t * src = out_prev-dist_prev;
							size_t len_actual = min(len, dist_prev);
							rep_movsb(out_at, src, len_actual);
							len -= len_actual;
						}
						
						const uint8_t * src = out_at-dist;
						size_t len_actual = min(len, out_end-out_at);
						rep_movsb(out_at, src, len_actual);
						
						len -= len_actual;
						if (UNLIKELY(len))
						{
							assert_reached();
							m_stcopy_len = len;
							m_stcopy_dist = dist;
							m_state = st_copy;
							ret_state = ret_more_output;
							goto inner_return;
						}
					}
					else if (LIKELY(symbol == 384))
						break;
					else
						RET_FAIL();
				}
				
			inner_return:
				// most of the variables don't change, no need to write them back
				m_in_at = in_at;
				m_in_bits_buf = bits_buf;
				m_in_nbits = nbits;
				m_out_at = out_at;
				
				if (ret_state != ret_done)
					return ret_state;
			}
			else RET_FAIL();
			
			if (m_block_type&1) return ret_done;
		}
	default: __builtin_unreachable();
	}
do_ret_more_input:
	if (m_in_last) RET_FAIL();
	else return ret_more_input;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x310, %rsp            # imm = 0x310
movq %rdi, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x2f8(%rbp)
movzbl (%rax), %eax
movq %rax, -0x2f0(%rbp)
movq -0x2f0(%rbp), %rax
leaq 0x54fce(%rip), %rcx     # 0x633b0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0xe3ed
movq -0x2f8(%rbp), %rdi
callq 0xe180
movq -0x2f8(%rbp), %rax
cmpl $0xa, 0x4(%rax)
setb %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe411
jmp 0xe420
movq -0x2f8(%rbp), %rax
movb $0x0, (%rax)
jmp 0xf6e8
movq -0x2f8(%rbp), %rdi
movl $0x3, %esi
callq 0xe290
movl %eax, %ecx
movq -0x2f8(%rbp), %rax
movb %cl, 0x1(%rax)
movzbl 0x1(%rax), %eax
cmpl $0x2, %eax
jge 0xe680
movq -0x2f8(%rbp), %rax
movl 0x4(%rax), %ecx
andl $0x7, %ecx
movq 0x8(%rax), %rdx
movl %ecx, %ecx
shrq %cl, %rdx
movq %rdx, %rcx
movq %rcx, 0x8(%rax)
movl 0x4(%rax), %ecx
andl $-0x8, %ecx
movl %ecx, 0x4(%rax)
movq -0x2f8(%rbp), %rdi
callq 0xe180
movq -0x2f8(%rbp), %rax
cmpl $0x20, 0x4(%rax)
setb %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe494
jmp 0xe4a3
movq -0x2f8(%rbp), %rax
movb $0x1, (%rax)
jmp 0xf6e8
movq -0x2f8(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movl -0x7c(%rbp), %ecx
xorl $-0x1, %ecx
shll $0x10, %ecx
xorl %ecx, %eax
movl %eax, -0x7c(%rbp)
cmpl $0x10000, -0x7c(%rbp)   # imm = 0x10000
setae %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe4d6
jmp 0xe4e4
jmp 0xe4d8
movl $0x1, -0x70(%rbp)
jmp 0xf707
movq -0x2f8(%rbp), %rax
movl 0x4(%rax), %ecx
subl $0x20, %ecx
movl %ecx, 0x4(%rax)
movq 0x8(%rax), %rcx
shrq $0x20, %rcx
movq %rcx, 0x8(%rax)
xorl %eax, %eax
testb $0x1, %al
jne 0xe508
jmp 0xe518
jmp 0xe50a
movq -0x2f8(%rbp), %rax
movzwl 0x40(%rax), %eax
movl %eax, -0x7c(%rbp)
jmp 0xe51a
movq -0x2f8(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0x4(%rcx)
movb %al, -0x2f9(%rbp)
je 0xe53c
cmpl $0x0, -0x7c(%rbp)
setne %al
movb %al, -0x2f9(%rbp)
movb -0x2f9(%rbp), %al
testb $0x1, %al
jne 0xe548
jmp 0xe5ba
movq -0x2f8(%rbp), %rcx
movq 0x38(%rcx), %rax
cmpq 0x30(%rcx), %rax
sete %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe564
jmp 0xe581
movq -0x2f8(%rbp), %rax
movb $0x2, (%rax)
movl -0x7c(%rbp), %ecx
movw %cx, 0x40(%rax)
movl $0x3, -0x70(%rbp)
jmp 0xf707
movq -0x2f8(%rbp), %rdi
movl $0x8, %esi
callq 0xe290
movq -0x2f8(%rbp), %rdx
movb %al, %cl
movq 0x30(%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, 0x30(%rdx)
movb %cl, (%rax)
movl -0x7c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0xe51a
movq -0x2f8(%rbp), %rax
movl -0x7c(%rbp), %edi
movq 0x18(%rax), %rsi
movq 0x10(%rax), %rcx
subq %rcx, %rsi
movq 0x38(%rax), %rdx
movq 0x30(%rax), %rax
subq %rax, %rdx
callq 0xf720
movl %eax, %ecx
movq -0x2f8(%rbp), %rax
movl %ecx, -0x80(%rbp)
movq 0x30(%rax), %rdi
movq 0x10(%rax), %rsi
movl -0x80(%rbp), %eax
movl %eax, %edx
callq 0x4280
movq -0x2f8(%rbp), %rax
movl -0x80(%rbp), %edx
movl -0x7c(%rbp), %ecx
subl %edx, %ecx
movl %ecx, -0x7c(%rbp)
movl -0x80(%rbp), %edx
movq 0x10(%rax), %rcx
movl %edx, %edx
addq %rdx, %rcx
movq %rcx, 0x10(%rax)
movl -0x80(%rbp), %edx
movq 0x30(%rax), %rcx
movl %edx, %edx
addq %rdx, %rcx
movq %rcx, 0x30(%rax)
cmpl $0x0, -0x7c(%rbp)
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe640
jmp 0xe66c
movq -0x2f8(%rbp), %rcx
movb $0x2, (%rcx)
movl -0x7c(%rbp), %eax
movw %ax, 0x40(%rcx)
movq 0x10(%rcx), %rax
cmpq 0x18(%rcx), %rax
jne 0xe660
jmp 0xf6e8
movl $0x3, -0x70(%rbp)
jmp 0xf707
movq -0x2f8(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0xe67b
jmp 0xe67b
jmp 0xf6c7
movq -0x2f8(%rbp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x6, %eax
setl %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe69e
jmp 0xf6ba
movq -0x2f8(%rbp), %rax
movzbl 0x1(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0xec41
jmp 0xe6b7
movq -0x2f8(%rbp), %rdi
callq 0xe180
movq -0x2f8(%rbp), %rax
cmpl $0xe, 0x4(%rax)
setb %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe6db
jmp 0xe6ea
movq -0x2f8(%rbp), %rax
movb $0x3, (%rax)
jmp 0xf6e8
movq -0x2f8(%rbp), %rdi
movl $0xe, %esi
callq 0xe290
movl %eax, -0x84(%rbp)
xorl %eax, %eax
testb $0x1, %al
jne 0xe709
jmp 0xe71c
jmp 0xe70b
movq -0x2f8(%rbp), %rax
movzwl 0x40(%rax), %eax
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %eax
andl $0x1f, %eax
addl $0x101, %eax            # imm = 0x101
movl %eax, -0x88(%rbp)
movl -0x84(%rbp), %eax
shrl $0x5, %eax
andl $0x1f, %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
movl -0x84(%rbp), %eax
shrl $0xa, %eax
addl $0x4, %eax
movl %eax, -0x90(%rbp)
movb $0x1, %al
cmpl $0x11e, -0x88(%rbp)     # imm = 0x11E
movb %al, -0x2fa(%rbp)
ja 0xe77b
cmpl $0x1e, -0x8c(%rbp)
seta %al
movb %al, -0x2fa(%rbp)
movb -0x2fa(%rbp), %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe78b
jmp 0xe799
jmp 0xe78d
movl $0x1, -0x70(%rbp)
jmp 0xf707
movq -0x2f8(%rbp), %rdi
callq 0xe220
movq -0x2f8(%rbp), %rax
movl 0x4(%rax), %eax
imull $0x3, -0x90(%rbp), %ecx
cmpl %ecx, %eax
setb %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe7c5
jmp 0xe7de
movq -0x2f8(%rbp), %rax
movb $0x4, (%rax)
movl -0x84(%rbp), %ecx
movw %cx, 0x40(%rax)
jmp 0xf6e8
leaq -0xb0(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x4170
movl $0x0, -0xb4(%rbp)
movl -0xb4(%rbp), %eax
cmpl -0x90(%rbp), %eax
jae 0xe847
movq -0x2f8(%rbp), %rdi
movl $0x3, %esi
callq 0xe290
movb %al, %cl
movl -0xb4(%rbp), %eax
movl %eax, %edx
leaq 0x54bb5(%rip), %rax     # 0x633e0
movzbl (%rax,%rdx), %eax
movb %cl, -0xb0(%rbp,%rax)
movl -0xb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb4(%rbp)
jmp 0xe7fb
movq -0x2f8(%rbp), %rdi
addq $0x504, %rdi            # imm = 0x504
leaq -0xb0(%rbp), %rsi
movl $0x13, %ecx
movq %rcx, %rdx
callq 0xf770
andb $0x1, %al
movb %al, -0xb5(%rbp)
movb -0xb5(%rbp), %al
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe883
jmp 0xe891
jmp 0xe885
movl $0x1, -0x70(%rbp)
jmp 0xf707
movl $0x0, -0xbc(%rbp)
xorl %eax, %eax
testb $0x1, %al
jne 0xe8a3
jmp 0xe8e6
jmp 0xe8a5
movq -0x2f8(%rbp), %rax
movzwl 0x40(%rax), %ecx
movl %ecx, -0x84(%rbp)
movzwl 0x40(%rax), %ecx
andl $0x1f, %ecx
addl $0x101, %ecx            # imm = 0x101
movl %ecx, -0x88(%rbp)
movzwl 0x40(%rax), %ecx
sarl $0x5, %ecx
andl $0x1f, %ecx
addl $0x1, %ecx
movl %ecx, -0x8c(%rbp)
movzwl 0x42(%rax), %eax
movl %eax, -0xbc(%rbp)
jmp 0xe8e8
movl -0xbc(%rbp), %eax
movl -0x88(%rbp), %ecx
addl -0x8c(%rbp), %ecx
cmpl %ecx, %eax
jae 0xeb87
movq -0x2f8(%rbp), %rdi
callq 0xe180
movq -0x2f8(%rbp), %rcx
xorl %eax, %eax
cmpl $0x16, 0x4(%rcx)
movb %al, -0x2fb(%rbp)
jae 0xe935
movq -0x2f8(%rbp), %rax
movb 0x2(%rax), %al
xorb $-0x1, %al
movb %al, -0x2fb(%rbp)
movb -0x2fb(%rbp), %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe945
jmp 0xe968
movq -0x2f8(%rbp), %rax
movb $0x5, (%rax)
movl -0x84(%rbp), %ecx
movw %cx, 0x40(%rax)
movl -0xbc(%rbp), %ecx
movw %cx, 0x42(%rax)
jmp 0xf6e8
movq -0x2f8(%rbp), %rdi
movq %rdi, %rsi
addq $0x504, %rsi            # imm = 0x504
callq 0xe2f0
movl %eax, %ecx
movq -0x2f8(%rbp), %rax
movl %ecx, -0xc0(%rbp)
cmpl $0x0, 0x4(%rax)
setl %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe99e
jmp 0xe9ac
jmp 0xe9a0
movl $0x1, -0x70(%rbp)
jmp 0xf707
cmpl $0xf, -0xc0(%rbp)
jg 0xe9e0
movq -0x2f8(%rbp), %rax
movl -0xc0(%rbp), %ecx
movb %cl, %dl
movl -0xbc(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0xbc(%rbp)
movl %ecx, %ecx
movb %dl, 0x44(%rax,%rcx)
jmp 0xeb82
cmpl $0x10, -0xc0(%rbp)
jne 0xeacf
movq -0x2f8(%rbp), %rdi
movl $0x2, %esi
callq 0xe290
addl $0x3, %eax
movl %eax, -0xc4(%rbp)
cmpl $0x0, -0xbc(%rbp)
sete %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xea1b
jmp 0xea29
jmp 0xea1d
movl $0x1, -0x70(%rbp)
jmp 0xf707
movl -0xbc(%rbp), %eax
addl -0xc4(%rbp), %eax
movl -0x88(%rbp), %ecx
addl -0x8c(%rbp), %ecx
cmpl %ecx, %eax
seta %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xea50
jmp 0xea5e
jmp 0xea52
movl $0x1, -0x70(%rbp)
jmp 0xf707
movq -0x2f8(%rbp), %rax
movl -0xbc(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movzbl 0x44(%rax,%rcx), %eax
movl %eax, -0xc8(%rbp)
movl $0x0, -0xcc(%rbp)
movl -0xcc(%rbp), %eax
cmpl -0xc4(%rbp), %eax
jae 0xeaca
movq -0x2f8(%rbp), %rax
movl -0xc8(%rbp), %ecx
movb %cl, %dl
movl -0xbc(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0xbc(%rbp)
movl %ecx, %ecx
movb %dl, 0x44(%rax,%rcx)
movl -0xcc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xcc(%rbp)
jmp 0xea85
jmp 0xeb80
movq -0x2f8(%rbp), %rdi
movl -0xc0(%rbp), %esi
subl $0x11, %esi
shll $0x2, %esi
addl $0x3, %esi
callq 0xe290
movl -0xc0(%rbp), %ecx
subl $0x11, %ecx
shll $0x3, %ecx
addl %ecx, %eax
addl $0x3, %eax
movl %eax, -0xd0(%rbp)
movl -0xbc(%rbp), %eax
addl -0xd0(%rbp), %eax
movl -0x88(%rbp), %ecx
addl -0x8c(%rbp), %ecx
cmpl %ecx, %eax
seta %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xeb28
jmp 0xeb36
jmp 0xeb2a
movl $0x1, -0x70(%rbp)
jmp 0xf707
movl $0x0, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
cmpl -0xd0(%rbp), %eax
jae 0xeb7e
movq -0x2f8(%rbp), %rax
movl -0xbc(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xbc(%rbp)
movl %ecx, %ecx
movb $0x0, 0x44(%rax,%rcx)
movl -0xd4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd4(%rbp)
jmp 0xeb40
jmp 0xeb80
jmp 0xeb82
jmp 0xe8e8
movq -0x2f8(%rbp), %rsi
movq %rsi, %rdi
addq $0x504, %rdi            # imm = 0x504
addq $0x44, %rsi
movl -0x88(%rbp), %eax
movl %eax, %edx
movl $0x11f, %ecx            # imm = 0x11F
callq 0xf770
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xebba
jmp 0xebc8
jmp 0xebbc
movl $0x1, -0x70(%rbp)
jmp 0xf707
movq -0x2f8(%rbp), %rdi
movl -0x88(%rbp), %eax
movq 0x44(%rdi,%rax), %rcx
movq %rcx, -0x100(%rbp)
movq 0x4c(%rdi,%rax), %rcx
movq %rcx, -0xf8(%rbp)
movq 0x54(%rdi,%rax), %rcx
movq %rcx, -0xf0(%rbp)
movq 0x5c(%rdi,%rax), %rax
movq %rax, -0xe8(%rbp)
addq $0x44, %rdi
leaq -0x100(%rbp), %rsi
movl -0x8c(%rbp), %eax
movl %eax, %edx
movl $0x1f, %ecx
callq 0xf770
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xec2e
jmp 0xec3c
jmp 0xec30
movl $0x1, -0x70(%rbp)
jmp 0xf707
jmp 0xed8f
movl $0x0, -0x224(%rbp)
cmpl $0x20, -0x224(%rbp)
jg 0xec74
movslq -0x224(%rbp), %rax
movb $0x5, -0x220(%rbp,%rax)
movl -0x224(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x224(%rbp)
jmp 0xec4b
movq -0x2f8(%rbp), %rdi
addq $0x44, %rdi
leaq -0x220(%rbp), %rsi
movl $0x20, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0xf770
movl $0x0, -0x228(%rbp)
cmpl $0x8f, -0x228(%rbp)
jg 0xecca
movslq -0x228(%rbp), %rax
movb $0x8, -0x220(%rbp,%rax)
movl -0x228(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x228(%rbp)
jmp 0xec9e
movl $0x90, -0x22c(%rbp)
cmpl $0xff, -0x22c(%rbp)
jg 0xed00
movslq -0x22c(%rbp), %rax
movb $0x9, -0x220(%rbp,%rax)
movl -0x22c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x22c(%rbp)
jmp 0xecd4
movl $0x100, -0x230(%rbp)    # imm = 0x100
cmpl $0x117, -0x230(%rbp)    # imm = 0x117
jg 0xed36
movslq -0x230(%rbp), %rax
movb $0x7, -0x220(%rbp,%rax)
movl -0x230(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x230(%rbp)
jmp 0xed0a
movl $0x118, -0x234(%rbp)    # imm = 0x118
cmpl $0x11f, -0x234(%rbp)    # imm = 0x11F
jg 0xed6c
movslq -0x234(%rbp), %rax
movb $0x8, -0x220(%rbp,%rax)
movl -0x234(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x234(%rbp)
jmp 0xed40
movq -0x2f8(%rbp), %rdi
addq $0x504, %rdi            # imm = 0x504
leaq -0x220(%rbp), %rsi
movl $0x120, %edx            # imm = 0x120
xorl %eax, %eax
movl %eax, %ecx
callq 0xf770
movq -0x2f8(%rbp), %rax
movb $0x6, (%rax)
movq -0x2f8(%rbp), %rax
movq 0x20(%rax), %rcx
movq %rcx, -0x240(%rbp)
movq 0x28(%rax), %rcx
movq %rcx, -0x248(%rbp)
movq 0x30(%rax), %rcx
movq %rcx, -0x250(%rbp)
movq 0x38(%rax), %rcx
movq %rcx, -0x258(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0x260(%rbp)
movq 0x18(%rax), %rcx
movq %rcx, -0x268(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x270(%rbp)
movl 0x4(%rax), %ecx
movl %ecx, -0x274(%rbp)
movl $0x0, -0x278(%rbp)
movzbl (%rax), %eax
cmpl $0x6, %eax
je 0xee30
movq -0x2f8(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x8, %eax
jne 0xee1c
jmp 0xf418
movq -0x2f8(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x7, %eax
jne 0xee30
jmp 0xf067
jmp 0xee32
movq -0x268(%rbp), %rax
movq -0x260(%rbp), %rcx
subq %rcx, %rax
cmpq $0x8, %rax
setge %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xee54
jmp 0xeeb1
cmpl $0x20, -0x274(%rbp)
ja 0xeeac
movq -0x260(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movl -0x274(%rbp), %ecx
shlq %cl, %rax
orq -0x270(%rbp), %rax
movq %rax, -0x270(%rbp)
movl -0x274(%rbp), %eax
addl $0x20, %eax
movl %eax, -0x274(%rbp)
movq -0x260(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x260(%rbp)
jmp 0xef4e
jmp 0xeeb3
xorl %eax, %eax
cmpl $0x38, -0x274(%rbp)
movb %al, -0x2fc(%rbp)
ja 0xeedb
movq -0x260(%rbp), %rax
cmpq -0x268(%rbp), %rax
setne %al
movb %al, -0x2fc(%rbp)
movb -0x2fc(%rbp), %al
testb $0x1, %al
jne 0xeee7
jmp 0xef27
movq -0x260(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x260(%rbp)
movzbl (%rax), %eax
movl -0x274(%rbp), %ecx
shlq %cl, %rax
orq -0x270(%rbp), %rax
movq %rax, -0x270(%rbp)
movl -0x274(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x274(%rbp)
jmp 0xeeb3
cmpl $0x30, -0x274(%rbp)
jae 0xef4c
movq -0x2f8(%rbp), %rax
testb $0x1, 0x2(%rax)
jne 0xef4c
movl $0x2, -0x278(%rbp)
jmp 0xf673
jmp 0xef4e
movq -0x2f8(%rbp), %rax
movq -0x270(%rbp), %rcx
andq $0x1ff, %rcx            # imm = 0x1FF
movw 0x504(%rax,%rcx,2), %ax
movw %ax, -0x27e(%rbp)
movzwl -0x27e(%rbp), %eax
andl $0x8000, %eax           # imm = 0x8000
cmpl $0x0, %eax
je 0xefdc
movq -0x2f8(%rbp), %rax
movzwl -0x27e(%rbp), %ecx
andl $0x7ff, %ecx            # imm = 0x7FF
movslq %ecx, %rcx
movq %rcx, -0x308(%rbp)
movq -0x270(%rbp), %rdx
movzwl -0x27e(%rbp), %ecx
andl $0x7800, %ecx           # imm = 0x7800
sarl $0xb, %ecx
movl %ecx, %ecx
shrq %cl, %rdx
movq -0x308(%rbp), %rcx
andq $0x7, %rdx
orq %rdx, %rcx
movw 0x504(%rax,%rcx,2), %ax
movw %ax, -0x27e(%rbp)
jmp 0xef72
movzwl -0x27e(%rbp), %eax
sarl $0xb, %eax
cltq
movq %rax, -0x288(%rbp)
movq -0x288(%rbp), %rcx
movl -0x274(%rbp), %eax
subq %rcx, %rax
movl %eax, -0x274(%rbp)
movq -0x288(%rbp), %rcx
movq -0x270(%rbp), %rax
shrq %cl, %rax
movq %rax, -0x270(%rbp)
movzwl -0x27e(%rbp), %eax
andl $0x1ff, %eax            # imm = 0x1FF
movl %eax, -0x27c(%rbp)
cmpl $0x0, -0x274(%rbp)
setl %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xf043
jmp 0xf051
jmp 0xf045
movl $0x1, -0x70(%rbp)
jmp 0xf707
cmpl $0x100, -0x27c(%rbp)    # imm = 0x100
jge 0xf0d9
xorl %eax, %eax
testb $0x1, %al
jne 0xf065
jmp 0xf078
jmp 0xf067
movq -0x2f8(%rbp), %rax
movzbl 0x40(%rax), %eax
movl %eax, -0x27c(%rbp)
movq -0x250(%rbp), %rax
cmpq -0x258(%rbp), %rax
sete %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xf093
jmp 0xf0b5
movq -0x2f8(%rbp), %rax
movl $0x3, -0x278(%rbp)
movb $0x7, (%rax)
movl -0x27c(%rbp), %ecx
movb %cl, 0x40(%rax)
jmp 0xf673
movl -0x27c(%rbp), %eax
movb %al, %cl
movq -0x250(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x250(%rbp)
movb %cl, (%rax)
jmp 0xf66c
cmpl $0x11d, -0x27c(%rbp)    # imm = 0x11D
setle %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xf0f3
jmp 0xf643
movl -0x27c(%rbp), %eax
subl $0x101, %eax            # imm = 0x101
movslq %eax, %rcx
leaq 0x542f8(%rip), %rax     # 0x63400
movw (%rax,%rcx,2), %ax
movw %ax, -0x29a(%rbp)
movzwl -0x29a(%rbp), %eax
sarl $0xc, %eax
movl %eax, -0x2a0(%rbp)
movq -0x270(%rbp), %rax
movl -0x2a0(%rbp), %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
subq $0x1, %rcx
andq %rcx, %rax
movq %rax, -0x290(%rbp)
movl -0x2a0(%rbp), %ecx
movl -0x274(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x274(%rbp)
movl -0x2a0(%rbp), %ecx
movq -0x270(%rbp), %rax
movl %ecx, %ecx
shrq %cl, %rax
movq %rax, -0x270(%rbp)
movzwl -0x29a(%rbp), %eax
andl $0x1ff, %eax            # imm = 0x1FF
cltq
addq -0x290(%rbp), %rax
movq %rax, -0x290(%rbp)
cmpl $0x1c, -0x274(%rbp)
setae %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xf1a6
jmp 0xf1a8
jmp 0xf218
movq -0x260(%rbp), %rax
cmpq -0x268(%rbp), %rax
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xf1c3
jmp 0xf214
movq -0x260(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movl -0x274(%rbp), %ecx
shlq %cl, %rax
orq -0x270(%rbp), %rax
movq %rax, -0x270(%rbp)
movl -0x274(%rbp), %eax
addl $0x20, %eax
movl %eax, -0x274(%rbp)
movq -0x260(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x260(%rbp)
jmp 0xf216
jmp 0xf216
jmp 0xf218
movq -0x2f8(%rbp), %rax
movq -0x270(%rbp), %rcx
andq $0x1ff, %rcx            # imm = 0x1FF
movw 0x44(%rax,%rcx,2), %ax
movw %ax, -0x2a6(%rbp)
movzwl -0x2a6(%rbp), %eax
andl $0x8000, %eax           # imm = 0x8000
cmpl $0x0, %eax
je 0xf2a0
movq -0x2f8(%rbp), %rax
movzwl -0x2a6(%rbp), %ecx
andl $0x7ff, %ecx            # imm = 0x7FF
movslq %ecx, %rcx
movq %rcx, -0x310(%rbp)
movq -0x270(%rbp), %rdx
movzwl -0x2a6(%rbp), %ecx
andl $0x7800, %ecx           # imm = 0x7800
sarl $0xb, %ecx
movl %ecx, %ecx
shrq %cl, %rdx
movq -0x310(%rbp), %rcx
andq $0x7, %rdx
orq %rdx, %rcx
movw 0x44(%rax,%rcx,2), %ax
movw %ax, -0x2a6(%rbp)
jmp 0xf239
movzwl -0x2a6(%rbp), %eax
sarl $0xb, %eax
cltq
movq %rax, -0x2b0(%rbp)
movq -0x2b0(%rbp), %rcx
movl -0x274(%rbp), %eax
subq %rcx, %rax
movl %eax, -0x274(%rbp)
movq -0x2b0(%rbp), %rcx
movq -0x270(%rbp), %rax
shrq %cl, %rax
movq %rax, -0x270(%rbp)
movzwl -0x2a6(%rbp), %eax
andl $0x1ff, %eax            # imm = 0x1FF
movl %eax, -0x2a4(%rbp)
movl -0x2a4(%rbp), %eax
andl $0x1, %eax
addl $0x2, %eax
movl -0x2a4(%rbp), %ecx
sarl %ecx
shll %cl, %eax
sarl %eax
cmpl $0x0, -0x2a4(%rbp)
setne %cl
andb $0x1, %cl
movzbl %cl, %ecx
addl %ecx, %eax
movl %eax, -0x2b4(%rbp)
movl -0x2a4(%rbp), %eax
sarl %eax
cmpl $0x2, -0x2a4(%rbp)
setge %cl
andb $0x1, %cl
movzbl %cl, %ecx
subl %ecx, %eax
movl %eax, -0x2b8(%rbp)
movl -0x2b8(%rbp), %eax
movl %eax, -0x2bc(%rbp)
movq -0x270(%rbp), %rax
movl -0x2bc(%rbp), %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
subq $0x1, %rcx
andq %rcx, %rax
movq %rax, -0x298(%rbp)
movl -0x2bc(%rbp), %ecx
movl -0x274(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x274(%rbp)
movl -0x2bc(%rbp), %ecx
movq -0x270(%rbp), %rax
movl %ecx, %ecx
shrq %cl, %rax
movq %rax, -0x270(%rbp)
movslq -0x2b4(%rbp), %rax
addq -0x298(%rbp), %rax
movq %rax, -0x298(%rbp)
cmpq $0x8000, -0x298(%rbp) # imm = 0x8000
jne 0xf3c6
jmp 0xf3c6
cmpq $0x8000, -0x298(%rbp) # imm = 0x8000
seta %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xf3de
jmp 0xf3ec
jmp 0xf3e0
movl $0x1, -0x70(%rbp)
jmp 0xf707
cmpl $0x0, -0x274(%rbp)
setl %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xf400
jmp 0xf40e
jmp 0xf402
movl $0x1, -0x70(%rbp)
jmp 0xf707
xorl %eax, %eax
testb $0x1, %al
jne 0xf416
jmp 0xf435
jmp 0xf418
movq -0x2f8(%rbp), %rax
movzwl 0x40(%rax), %ecx
movq %rcx, -0x290(%rbp)
movzwl 0x42(%rax), %eax
movq %rax, -0x298(%rbp)
movq -0x298(%rbp), %rax
movq -0x250(%rbp), %rcx
movq -0x248(%rbp), %rdx
subq %rdx, %rcx
cmpq %rcx, %rax
jbe 0xf543
cmpq $0x0, -0x240(%rbp)
jne 0xf46e
jmp 0xf462
movl $0x1, -0x70(%rbp)
jmp 0xf707
movq -0x298(%rbp), %rax
movq -0x250(%rbp), %rcx
movq -0x248(%rbp), %rdx
subq %rdx, %rcx
subq %rcx, %rax
movq %rax, -0x2c8(%rbp)
movq -0x240(%rbp), %rax
xorl %ecx, %ecx
subq -0x2c8(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x2d0(%rbp)
movq -0x290(%rbp), %rdi
movq -0x2c8(%rbp), %rsi
callq 0xfc00
movq %rax, -0x2d8(%rbp)
movq -0x2d8(%rbp), %rax
leaq -0x250(%rbp), %rcx
movq %rcx, -0x8(%rbp)
leaq -0x2d0(%rbp), %rcx
movq %rcx, -0x10(%rbp)
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rcx
rep  movsb (%rsi), %es:(%rdi)
movq %rsi, -0x20(%rbp)
movq %rdi, -0x28(%rbp)
movq %rcx, -0x18(%rbp)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x2d8(%rbp), %rcx
movq -0x290(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x290(%rbp)
movq -0x250(%rbp), %rax
xorl %ecx, %ecx
subq -0x298(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x2e0(%rbp)
movq -0x290(%rbp), %rdi
movq -0x258(%rbp), %rsi
movq -0x250(%rbp), %rax
subq %rax, %rsi
callq 0xfc50
movq %rax, -0x2e8(%rbp)
movq -0x2e8(%rbp), %rax
leaq -0x250(%rbp), %rcx
movq %rcx, -0x30(%rbp)
leaq -0x2e0(%rbp), %rcx
movq %rcx, -0x38(%rbp)
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdi
movq -0x40(%rbp), %rcx
rep  movsb (%rsi), %es:(%rdi)
movq %rsi, -0x48(%rbp)
movq %rdi, -0x50(%rbp)
movq %rcx, -0x40(%rbp)
movq -0x48(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movq -0x50(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x2e8(%rbp), %rcx
movq -0x290(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x290(%rbp)
cmpq $0x0, -0x290(%rbp)
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xf615
jmp 0xf641
movq -0x2f8(%rbp), %rax
movq -0x290(%rbp), %rcx
movw %cx, 0x40(%rax)
movq -0x298(%rbp), %rcx
movw %cx, 0x42(%rax)
movb $0x8, (%rax)
movl $0x3, -0x278(%rbp)
jmp 0xf673
jmp 0xf66a
cmpl $0x180, -0x27c(%rbp)    # imm = 0x180
sete %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xf65a
jmp 0xf65c
jmp 0xf671
jmp 0xf65e
movl $0x1, -0x70(%rbp)
jmp 0xf707
jmp 0xf66c
jmp 0xee32
jmp 0xf673
movq -0x2f8(%rbp), %rax
movq -0x260(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x270(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl -0x274(%rbp), %ecx
movl %ecx, 0x4(%rax)
movq -0x250(%rbp), %rcx
movq %rcx, 0x30(%rax)
cmpl $0x0, -0x278(%rbp)
je 0xf6b8
movl -0x278(%rbp), %eax
movl %eax, -0x70(%rbp)
jmp 0xf707
jmp 0xf6c5
jmp 0xf6bc
movl $0x1, -0x70(%rbp)
jmp 0xf707
jmp 0xf6c7
movq -0x2f8(%rbp), %rax
movzbl 0x1(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xf6e3
movl $0x0, -0x70(%rbp)
jmp 0xf707
jmp 0xe3eb
movq -0x2f8(%rbp), %rax
testb $0x1, 0x2(%rax)
je 0xf700
jmp 0xf6f7
movl $0x1, -0x70(%rbp)
jmp 0xf707
movl $0x2, -0x70(%rbp)
movl -0x70(%rbp), %eax
addq $0x310, %rsp            # imm = 0x310
popq %rbp
retq
nopw %cs:(%rax,%rax)