// File: /workspace/github_c_makefile_star2_O2/DavidSM64[P]DKR-Decompressor/GECompression.cpp
// Function: GECompression::CreateGlobalDecompressionTable(int, int, int, int, int, bool&, int&, int&)
void GECompression::CreateGlobalDecompressionTable(int bit1TableChoice, int size2, int bit12STableSChoice, int bit12BTableChoice, int numBits, bool& returnValue, int& numReturnBits, int& returnStartIndex)
{
	//if (bit1TableChoice == 0) bt1Table1 else bt1Table2
	//if (bit12STableSChoice == 0) bt12Table1S else bt12Table2S
	//if (bit12BTableChoice == 0) bt12Table1B else bt12Table2B
	CString temp; // temp var del later

	tableEntry localTableEntry;
	localTableEntry.bits = 0;
	localTableEntry.flags = 0;
	localTableEntry.nextIndex = 0;
	localTableEntry.wordValue = 0;

	int table1Size = 0;

	int returnIndex = -1;

	unsigned long seventeenints1[17];
	for (int x = 0; x < 17; x++)
		seventeenints1[x] = 0;

	if (bit1TableChoice == TABLE1)
	{
		table1Size = 288;
		for (int x = 0; x < 288; x++)
		{
			seventeenints1[bt1Table1[x]]++;
		}
	}
	else if (bit1TableChoice == TABLE2)
	{
		table1Size = 30;
		for (int x = 0; x < 30; x++)
		{
			seventeenints1[bt1Table2[x]]++;
		}
	}
	else if (bit1TableChoice == VARIABLETABLE)
	{
		table1Size = 0x13;		
		for (int x = 0; x < 0x13; x++)
		{
			seventeenints1[variableTable[x]]++;			
		}
	}
	else if (bit1TableChoice == WORDTABLEBEGIN)
	{
		table1Size = tableSize;		
		for (int x = 0; x < table1Size; x++)
		{
			seventeenints1[wordTable[x]]++;			
		}
	}
	else if (bit1TableChoice == WORDTABLEEND)
	{
		table1Size = ((tableSize + fiveBits) - tableSize);
		for (int x = 0; x < table1Size; x++)
		{
			seventeenints1[wordTable[tableSize + x]]++;			
		}
	}

	int firstBit = 1;
	while (seventeenints1[firstBit] == 0)
		firstBit++;

	int lastBit = 16;	
	while (seventeenints1[lastBit] == 0)
		lastBit--;

	if (numBits < firstBit)
		numBits = firstBit;
	if (numBits > lastBit)
		numBits = lastBit;

	unsigned long v1temp = (1<<firstBit);
	if (firstBit != lastBit)
	{
		for (int bitNum = firstBit; bitNum < lastBit; bitNum++)
		{
			v1temp = ((v1temp - seventeenints1[bitNum])*2);
		}	
	}

	int oldLastBitCount = seventeenints1[lastBit];
	seventeenints1[lastBit] = v1temp;
	v1temp = v1temp - oldLastBitCount;

	unsigned long seventeenints2[17];
	for (int x = 0; x < 17; x++)
		seventeenints2[x] = 0;

	int accumulator = 0;
	for (int index = 1; index < lastBit; index++)
	{
		accumulator = accumulator + seventeenints1[index];
		seventeenints2[index+1] = accumulator;
	}


	unsigned long* moreWords;
	moreWords = new unsigned long[table1Size];
	int moreWordsIndex = 0;
	int index = 0;

	for (int x = 0; x < table1Size; x++)
	{
		moreWords[x] = 0;
	}

	for (int x = 0; x < table1Size; x++)
	{

		if (bit1TableChoice == TABLE1)
		{
			if ((bt1Table1[x]) != 0)
			{
				moreWords[seventeenints2[bt1Table1[x]]] = index;
				seventeenints2[bt1Table1[x]]++;
			}
		}
		else if (bit1TableChoice == TABLE2)
		{
			if ((bt1Table2[x]) != 0)
			{
				moreWords[seventeenints2[bt1Table2[x]]] = index;
				seventeenints2[bt1Table2[x]]++;
			}
		}
		else if (bit1TableChoice == VARIABLETABLE)
		{
			if ((variableTable[x]) != 0)
			{
				moreWords[seventeenints2[variableTable[x]]] = index;
				seventeenints2[variableTable[x]]++;	
			}
		}
		else if (bit1TableChoice == WORDTABLEBEGIN)
		{
			if ((wordTable[x]) != 0)
			{
				moreWords[seventeenints2[wordTable[x]]] = index;
				seventeenints2[wordTable[x]]++;
			}
		}
		else if (bit1TableChoice == WORDTABLEEND)
		{
			if ((wordTable[tableSize + x]) != 0)
			{
				moreWords[seventeenints2[wordTable[tableSize + x]]] = index;
				seventeenints2[wordTable[tableSize + x]]++;
			}
		}
		index++;
	}

	int stemp2_v1 = -numBits;
	int blockNum = -1;
	int bitPattern = 0;

	int unpackTableStarts[0x20000];
	int unpackTableStartsIndex = -1;

	unsigned long temp_a3 = 0;
	int thisTableStart = 0;

	for (int bitNum = firstBit; bitNum < (lastBit+1); bitNum++)
	{
		int iterationsLeft = seventeenints1[bitNum];
		unsigned long lv34 = (1<<(bitNum-1));
		int moreWordsIndex2 = table1Size;

		while (iterationsLeft)
		{
			if (iterationsLeft < 0)
				break;
			stemp2_v1 = stemp2_v1 + numBits;
			while (stemp2_v1 < bitNum)
			{
				blockNum++;

				unsigned long temp_t0 = 0;

				if (numBits < (lastBit-stemp2_v1))
					temp_t0=numBits;
				else
					temp_t0 = lastBit-stemp2_v1;

				temp_a3 = bitNum - stemp2_v1;

				if (iterationsLeft < (1<<temp_a3))
				{
					unsigned long another_var_v1= ((1 << temp_a3) - iterationsLeft);
					temp_a3++;

					index = bitNum + 1;
					while (temp_a3 < temp_t0)
					{
						if (seventeenints1[index] < (another_var_v1*2))
						{
							temp_a3++;
							another_var_v1 = another_var_v1*2 - seventeenints1[index];
						}
						index++;
					}
				}
				if (returnIndex==-1)
					returnIndex=unpackTableIndex + 1;
				
				unpackTableStartsIndex++;
				unpackTableStarts[unpackTableStartsIndex] = (unpackTableIndex+1);
				
				thisTableStart = unpackTableIndex + 1;

				if (blockNum != 0)
				{
					seventeenints2[blockNum] = bitPattern;
					localTableEntry.bits = numBits;
					localTableEntry.flags = temp_a3 + 0x10;
					localTableEntry.nextIndex= unpackTableIndex + 1;
					localTableEntry.wordValue = -1;
					unpackTable[(bitPattern>>(stemp2_v1-numBits))+unpackTableStarts[blockNum-1]].bits = localTableEntry.bits;
					unpackTable[(bitPattern>>(stemp2_v1-numBits))+unpackTableStarts[blockNum-1]].flags = localTableEntry.flags;
					unpackTable[(bitPattern>>(stemp2_v1-numBits))+unpackTableStarts[blockNum-1]].wordValue = localTableEntry.wordValue;
					unpackTable[(bitPattern>>(stemp2_v1-numBits))+unpackTableStarts[blockNum-1]].nextIndex = localTableEntry.nextIndex;
				}

				unpackTableIndex=unpackTableIndex + ((1<<temp_a3)+1);
				stemp2_v1+=numBits;
			}
			stemp2_v1 = stemp2_v1 - numBits;

			localTableEntry.bits = bitNum - stemp2_v1;
			localTableEntry.nextIndex = 0;
			if (moreWordsIndex >= moreWordsIndex2)
				localTableEntry.flags = 0x63;
			else
			{
				unsigned long tempWord = moreWords[moreWordsIndex];
				if (tempWord<size2)
				{
					if (tempWord >= 0x100)
						localTableEntry.flags = 0xf;
					else
						localTableEntry.flags = 0x10;
					localTableEntry.wordValue = tempWord;
				}
				else
				{
					if (bit12STableSChoice == TABLE1)
					{
						localTableEntry.flags = bt12Table1B[moreWords[moreWordsIndex]-size2];
						localTableEntry.wordValue = bt12Table1S[moreWords[moreWordsIndex]-size2];
					}
					else if (bit12STableSChoice == TABLE2)
					{
						localTableEntry.flags = bt12Table2B[moreWords[moreWordsIndex]-size2];
						localTableEntry.wordValue = bt12Table2S[moreWords[moreWordsIndex]-size2];
					}
					else if (bit12STableSChoice == VARIABLETABLE)
					{
						// shouldn't happen

					}
				}
				moreWordsIndex++;
			}
		
			unsigned long nu_accum_a3 = (bitPattern >> stemp2_v1);
			unsigned long stride_v0 = (1<<(bitNum - stemp2_v1));
			/*if (thisTableStart==744)
			{
				if thisTableStart+nu_accum_a3==758
				{
					if stride_v0==16:
					{
						debugIt=1
					}
				}
			}*/
			while ((1<<temp_a3) > nu_accum_a3)
			{
				if ((thisTableStart+nu_accum_a3) > 0xFFFF)
				{
					delete [] moreWords;
					return;
				}
				unpackTable[thisTableStart+nu_accum_a3].bits = localTableEntry.bits;
				unpackTable[thisTableStart+nu_accum_a3].flags = localTableEntry.flags;
				unpackTable[thisTableStart+nu_accum_a3].wordValue = localTableEntry.wordValue;
				unpackTable[thisTableStart+nu_accum_a3].nextIndex = localTableEntry.nextIndex;
				nu_accum_a3 = nu_accum_a3 + stride_v0;
			}

			unsigned long tempLv=lv34;
			
			while (bitPattern & tempLv)
			{
				bitPattern = bitPattern ^ tempLv;
				tempLv = tempLv >> 1;
			}
			bitPattern = bitPattern ^ tempLv;
			while((bitPattern & ((1 << stemp2_v1)-1)) != seventeenints2[blockNum])
			{
				blockNum = blockNum- 1;
				stemp2_v1=0;
			}

			iterationsLeft = iterationsLeft - 1;
		}
	}
	delete [] moreWords;
	if (v1temp > 0)
	{
		returnValue = (0<(lastBit^1));
		numReturnBits = numBits;
		returnStartIndex = returnIndex;
	}
	else
	{
		returnValue = 0;
		numReturnBits = numBits;
		returnStartIndex = returnIndex;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x801f8, %rsp          # imm = 0x801F8
movl %r9d, %r12d
movl %ecx, -0x74(%rbp)
leaq -0xf0(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorl %eax, %eax
cmpq $0x11, %rax
je 0x3d2f
andq $0x0, -0x190(%rbp,%rax,8)
incq %rax
jmp 0x3d1b
leaq 0x643a(%rip), %r8       # 0xa170
testl %esi, %esi
movl %edx, -0x48(%rbp)
je 0x3d82
leal -0x1(%rsi), %eax
cmpl $0x3, %eax
ja 0x3e0d
leaq 0x34cc(%rip), %rcx      # 0x721c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %eax, %eax
pushq $0x1e
popq %r15
leaq 0x652a(%rip), %rcx      # 0xa290
cmpq $0x1e, %rax
je 0x3e10
movzbl (%rax,%rcx), %r8d
incq -0x190(%rbp,%r8,8)
incq %rax
jmp 0x3d66
xorl %eax, %eax
cmpq $0x120, %rax            # imm = 0x120
je 0x3d9e
movzbl (%rax,%r8), %ecx
incq -0x190(%rbp,%rcx,8)
incq %rax
jmp 0x3d84
movl $0x120, %r15d           # imm = 0x120
jmp 0x3e10
movzwl 0x70(%rdi), %r15d
movq 0x78(%rdi), %rax
xorl %ecx, %ecx
cmpq %rcx, %r15
je 0x3e10
movq (%rax,%rcx,8), %r8
incq -0x190(%rbp,%r8,8)
incq %rcx
jmp 0x3db1
movzbl 0x72(%rdi), %r15d
movzwl 0x70(%rdi), %eax
shll $0x3, %eax
addq 0x78(%rdi), %rax
xorl %ecx, %ecx
cmpq %rcx, %r15
je 0x3e10
movq (%rax,%rcx,8), %r8
incq -0x190(%rbp,%r8,8)
incq %rcx
jmp 0x3dd9
pushq $-0x13
popq %rax
pushq $0x13
popq %r15
testq %rax, %rax
je 0x3e10
movzbl 0x6f(%rdi,%rax), %ecx
incq -0x190(%rbp,%rcx,8)
incq %rax
jmp 0x3df6
xorl %r15d, %r15d
leaq -0x188(%rbp), %rax
xorl %r13d, %r13d
incq %r13
cmpq $0x0, (%rax)
leaq 0x8(%rax), %rax
je 0x3e1a
movq %rax, -0x88(%rbp)
pushq $0x10
popq %rax
movq %rax, %rbx
movq -0x190(%rbp,%rax,8), %r14
decq %rax
testq %r14, %r14
je 0x3e31
cmpl %r12d, %r13d
movl %r12d, %eax
cmovgl %r13d, %eax
cmpl %ebx, %eax
cmovgel %ebx, %eax
movl %eax, -0x3c(%rbp)
pushq $0x1
popq %rax
movl %r13d, %ecx
shll %cl, %eax
movslq %eax, %r10
cmpq %rbx, %r13
jne 0x4385
movq %r10, -0x190(%rbp,%rbx,8)
shlq $0x20, %r14
xorl %eax, %eax
cmpq $0x11, %rax
je 0x3e8c
andq $0x0, -0x220(%rbp,%rax,8)
incq %rax
jmp 0x3e78
movslq %ebx, %r8
pushq $0x1
popq %rax
xorl %ecx, %ecx
cmpq %r8, %rax
jge 0x3eb4
movslq %ecx, %rcx
addq -0x190(%rbp,%rax,8), %rcx
movslq %ecx, %rdx
movq %rdx, -0x218(%rbp,%rax,8)
incq %rax
jmp 0x3e94
movq %rsi, -0x50(%rbp)
movq %r8, -0xc0(%rbp)
movq %r10, -0xa8(%rbp)
movq %rdi, -0x68(%rbp)
leal (,%r15,8), %edi
callq 0x2030
sarq $0x20, %r14
movq %r15, -0xc8(%rbp)
movl %r15d, %r9d
xorl %ecx, %ecx
movq -0x68(%rbp), %r10
movq -0x50(%rbp), %r15
cmpq %rcx, %r9
je 0x3efe
andq $0x0, (%rax,%rcx,8)
incq %rcx
jmp 0x3eef
movq %rax, -0x38(%rbp)
movq %r14, -0xa0(%rbp)
movq 0x78(%r10), %rcx
movzwl 0x70(%r10), %edx
leaq (%rcx,%rdx,8), %rdx
xorl %esi, %esi
leal -0x1(%r15), %edi
leaq 0x3309(%rip), %r8       # 0x722c
leaq 0x6366(%rip), %rax      # 0xa290
cmpq %rsi, %r9
je 0x3fe3
testl %r15d, %r15d
je 0x3f52
cmpl $0x3, %edi
ja 0x3fd7
movslq (%r8,%rdi,4), %r10
addq %r8, %r10
jmpq *%r10
movzbl (%rsi,%rax), %r10d
jmp 0x3fb6
leaq 0x6217(%rip), %r10      # 0xa170
movzbl (%rsi,%r10), %r10d
jmp 0x3fb6
movq (%rcx,%rsi,8), %r10
testq %r10, %r10
je 0x3fd7
movq -0x220(%rbp,%r10,8), %r10
movq -0x38(%rbp), %r11
movq %rsi, (%r11,%r10,8)
movq (%rcx,%rsi,8), %r10
jmp 0x3f9c
movq (%rdx,%rsi,8), %r10
testq %r10, %r10
je 0x3fd7
movq -0x220(%rbp,%r10,8), %r10
movq -0x38(%rbp), %r11
movq %rsi, (%r11,%r10,8)
movq (%rdx,%rsi,8), %r10
leaq -0x220(,%r10,8), %r10
addq %rbp, %r10
movq (%r10), %r11
jmp 0x3fd1
movq -0x68(%rbp), %r10
movzbl 0x5c(%r10,%rsi), %r10d
testq %r10, %r10
je 0x3fd7
leaq -0x220(,%r10,8), %r10
addq %rbp, %r10
movq (%r10), %r11
movq -0x38(%rbp), %r14
movq %rsi, (%r14,%r11,8)
incq %r11
movq %r11, (%r10)
incq %rsi
movq -0x68(%rbp), %r10
jmp 0x3f2a
movl -0x3c(%rbp), %eax
movl %eax, %edi
negl %edi
cmpl %r13d, %r12d
cmovlel %r13d, %r12d
cltq
movq %rax, -0xd0(%rbp)
cmpq %r12, %rbx
cmovlq %rbx, %r12
movslq -0x48(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq $0x0, -0x80(%rbp)
pushq $-0x1
popq %rax
movl %eax, -0x50(%rbp)
movl %eax, %r9d
xorl %r11d, %r11d
movq %rax, -0x48(%rbp)
xorl %edx, %edx
xorl %eax, %eax
movl $0x0, -0x2c(%rbp)
movq $0x0, -0x60(%rbp)
movq %r12, -0x90(%rbp)
movq %rbx, -0x98(%rbp)
cmpq -0xc0(%rbp), %r13
jg 0x43a4
movl -0x190(%rbp,%r13,8), %r8d
leal -0x1(%r13), %ecx
pushq $0x1
popq %rsi
shll %cl, %esi
movslq %esi, %rcx
movq %rcx, -0xb8(%rbp)
movq %r13, -0x70(%rbp)
testl %r8d, %r8d
jle 0x434e
movl %r8d, -0x54(%rbp)
movslq %r11d, %rcx
movq %rcx, -0xe0(%rbp)
movq 0x28(%r10), %rcx
movq %rcx, -0xd8(%rbp)
movslq %edi, %r8
movslq %r9d, %r14
movq -0x48(%rbp), %rcx
movslq %ecx, %rcx
movq %rcx, -0x48(%rbp)
leal 0x1(%r14), %r9d
leaq -0x220(,%r14,8), %rbx
addq %rbp, %rbx
movq -0x60(%rbp), %r13
leaq (%r8,%r12), %rsi
movq -0x70(%rbp), %rcx
subq %rsi, %rcx
jle 0x41d8
movq -0x98(%rbp), %rax
subl %esi, %eax
movl -0x3c(%rbp), %edx
cmpl %eax, %edx
cmovll %edx, %eax
pushq $0x1
popq %rdx
shll %cl, %edx
subl -0x54(%rbp), %edx
jle 0x4116
cltq
movslq %edx, %rdi
incq %rcx
movq -0x88(%rbp), %r12
movq %rcx, %rdx
cmpq %rax, %rdx
jae 0x411b
leaq (%rdi,%rdi), %rcx
xorl %r15d, %r15d
subq (%r12), %rcx
cmovaq %rcx, %rdi
seta %r15b
addq %r15, %rdx
addq $0x8, %r12
jmp 0x40f5
movq %rcx, %rdx
jmp 0x4122
movq -0x90(%rbp), %r12
leaq 0x1(%r14), %rdi
movl 0x30(%r10), %eax
incl %eax
movl -0x50(%rbp), %ecx
cmpl $-0x1, %ecx
cmovel %eax, %ecx
movl %ecx, -0x50(%rbp)
movq -0x48(%rbp), %rcx
movl %eax, -0x8021c(%rbp,%rcx,4)
testq %rdi, %rdi
je 0x41b2
movq -0xe0(%rbp), %rcx
movq %rcx, -0x220(%rbp,%rdi,8)
movl %r9d, %r13d
movq %r10, %r9
movq %r12, %r10
leal 0x10(%rdx), %r12d
movl %r11d, %r15d
movl %r8d, %ecx
sarl %cl, %r15d
movslq -0x80220(%rbp,%r14,4), %rcx
movslq %r15d, %r8
addq %rcx, %r8
imulq $0x18, %r8, %rcx
movq -0xd0(%rbp), %r8
movq -0xd8(%rbp), %r14
movq %r8, (%r14,%rcx)
movl %r12d, -0x2c(%rbp)
movb %r12b, 0x8(%r14,%rcx)
movq %r10, %r12
movq %r9, %r10
movl %r13d, %r9d
orq $-0x1, 0x10(%r14,%rcx)
movl %eax, 0xc(%r14,%rcx)
pushq $-0x1
popq %r13
pushq $0x1
popq %r8
movl %edx, %ecx
shll %cl, %r8d
incq -0x48(%rbp)
addl %eax, %r8d
movl %r8d, 0x30(%r10)
incl %r9d
addq $0x8, %rbx
movq %rdi, %r14
movq %rsi, %r8
jmp 0x40b7
movq -0x80(%rbp), %r14
cmpl -0xc8(%rbp), %r14d
jge 0x4217
movslq %r14d, %rcx
movq -0x38(%rbp), %rsi
movq (%rsi,%rcx,8), %rsi
movq %rsi, %rcx
subq -0xb0(%rbp), %rcx
movq -0x70(%rbp), %rdi
jae 0x4226
cmpq $0x100, %rsi            # imm = 0x100
movl $0x0, %ecx
adcb $0xf, %cl
movl %ecx, -0x2c(%rbp)
movq %rsi, %r13
jmp 0x4263
movq %r13, -0x60(%rbp)
movb $0x63, %cl
movl %ecx, -0x2c(%rbp)
movq -0x70(%rbp), %rdi
jmp 0x426e
movl -0x74(%rbp), %esi
cmpl $0x1, %esi
je 0x4249
testl %esi, %esi
jne 0x4263
leaq 0x60b7(%rip), %rsi      # 0xa2f0
movb (%rsi,%rcx,2), %sil
movl %esi, -0x2c(%rbp)
leaq 0x6069(%rip), %rsi      # 0xa2b0
jmp 0x425e
leaq 0x6120(%rip), %rsi      # 0xa370
movb (%rsi,%rcx,2), %sil
movl %esi, -0x2c(%rbp)
leaq 0x60d2(%rip), %rsi      # 0xa330
movzwl (%rsi,%rcx,2), %r13d
movq %r13, -0x60(%rbp)
incl %r14d
movq %r14, -0x80(%rbp)
movl %edi, %esi
subl %r8d, %esi
movl %r11d, %r14d
movl %r8d, %ecx
sarl %cl, %r14d
movslq %esi, %rdi
movslq %r14d, %rsi
pushq $0x1
popq %r15
movl %r15d, %r14d
movl %edi, %ecx
shll %cl, %r14d
movl %edx, %ecx
shll %cl, %r15d
movslq %r14d, %rcx
movslq %r15d, %r14
movslq %eax, %r13
movq 0x28(%r10), %r15
leaq (%rsi,%r13), %r12
imulq $0x18, %r12, %r12
addq %r15, %r12
addq $0x10, %r12
imulq $0x18, %rcx, %r15
cmpq %r14, %rsi
jae 0x42f1
leaq (%rsi,%r13), %r10
cmpq $0x10000, %r10          # imm = 0x10000
jae 0x435e
movq %rdi, -0x10(%r12)
movl -0x2c(%rbp), %r10d
movb %r10b, -0x8(%r12)
movq -0x60(%rbp), %r10
movq %r10, (%r12)
andl $0x0, -0x4(%r12)
addq %rcx, %rsi
addq %r15, %r12
movq -0x68(%rbp), %r10
jmp 0x42b3
movq -0xb8(%rbp), %rcx
movq -0x90(%rbp), %r12
movq -0x70(%rbp), %r13
pushq $-0x1
popq %r14
movslq %r11d, %rsi
movl %esi, %r11d
xorl %ecx, %r11d
testq %rsi, %rcx
je 0x431a
shrq %rcx
jmp 0x4307
movl %r8d, %edi
movl %r14d, %esi
movl %edi, %ecx
shll %cl, %esi
notl %esi
andl %r11d, %esi
decl %r9d
leaq -0x8(%rbx), %rcx
xorl %r8d, %r8d
cmpq %rsi, (%rbx)
movq %rcx, %rbx
jne 0x431a
movl -0x54(%rbp), %r8d
decl %r8d
movq -0x98(%rbp), %rbx
jmp 0x4071
incq %r13
addq $0x8, -0x88(%rbp)
jmp 0x4045
movq -0x38(%rbp), %rdi
callq 0x21c0
leaq -0x100(%rbp), %rdi
callq 0x20c0
addq $0x801f8, %rsp          # imm = 0x801F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movslq %ebx, %rax
movq %r13, %rcx
cmpq %rax, %rcx
jge 0x3e6a
subq -0x190(%rbp,%rcx,8), %r10
addq %r10, %r10
incq %rcx
jmp 0x438b
movq -0x38(%rbp), %rdi
callq 0x21c0
movq -0xa8(%rbp), %rax
cmpq -0xa0(%rbp), %rax
setne %al
xorl $0x1, %ebx
setg %cl
andb %al, %cl
movq 0x10(%rbp), %rax
movb %cl, (%rax)
movq 0x18(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl %ecx, (%rax)
movq 0x20(%rbp), %rax
movl -0x50(%rbp), %ecx
movl %ecx, (%rax)
jmp 0x4367
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x2280
nop