// File: /workspace/github_c_makefile_star2_O0/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
subq $0x802a0, %rsp          # imm = 0x802A0
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
movl %r9d, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x80260(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x22b0
movq $0x0, -0x58(%rbp)
movb $0x0, -0x50(%rbp)
movl $0x0, -0x4c(%rbp)
movq $0x0, -0x48(%rbp)
movl $0x0, -0x5c(%rbp)
movl $0xffffffff, -0x60(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0xf4(%rbp)
cmpl $0x11, -0xf4(%rbp)
jge 0x7470
movslq -0xf4(%rbp), %rax
movq $0x0, -0xf0(%rbp,%rax,8)
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0x7443
cmpl $0x0, -0xc(%rbp)
jne 0x74cf
movl $0x120, -0x5c(%rbp)     # imm = 0x120
movl $0x0, -0xf8(%rbp)
cmpl $0x120, -0xf8(%rbp)     # imm = 0x120
jge 0x74ca
movslq -0xf8(%rbp), %rcx
leaq 0x8d3f(%rip), %rax      # 0x101e0
movzbl (%rax,%rcx), %eax
movq -0xf0(%rbp,%rax,8), %rcx
addq $0x1, %rcx
movq %rcx, -0xf0(%rbp,%rax,8)
movl -0xf8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf8(%rbp)
jmp 0x7487
jmp 0x766e
cmpl $0x1, -0xc(%rbp)
jne 0x752b
movl $0x1e, -0x5c(%rbp)
movl $0x0, -0xfc(%rbp)
cmpl $0x1e, -0xfc(%rbp)
jge 0x7526
movslq -0xfc(%rbp), %rcx
leaq 0x8e03(%rip), %rax      # 0x10300
movzbl (%rax,%rcx), %eax
movq -0xf0(%rbp,%rax,8), %rcx
addq $0x1, %rcx
movq %rcx, -0xf0(%rbp,%rax,8)
movl -0xfc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xfc(%rbp)
jmp 0x74e6
jmp 0x766c
cmpl $0x2, -0xc(%rbp)
jne 0x7588
movl $0x13, -0x5c(%rbp)
movl $0x0, -0x100(%rbp)
cmpl $0x13, -0x100(%rbp)
jge 0x7583
movq -0x80260(%rbp), %rax
movslq -0x100(%rbp), %rcx
movzbl 0x5c(%rax,%rcx), %eax
movq -0xf0(%rbp,%rax,8), %rcx
addq $0x1, %rcx
movq %rcx, -0xf0(%rbp,%rax,8)
movl -0x100(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x100(%rbp)
jmp 0x7542
jmp 0x766a
cmpl $0x3, -0xc(%rbp)
jne 0x75ee
movq -0x80260(%rbp), %rax
movzwl 0x70(%rax), %eax
movl %eax, -0x5c(%rbp)
movl $0x0, -0x104(%rbp)
movl -0x104(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jge 0x75ec
movq -0x80260(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x104(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0xf0(%rbp,%rax,8), %rcx
addq $0x1, %rcx
movq %rcx, -0xf0(%rbp,%rax,8)
movl -0x104(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x104(%rbp)
jmp 0x75a6
jmp 0x7668
cmpl $0x4, -0xc(%rbp)
jne 0x7666
movq -0x80260(%rbp), %rcx
movzwl 0x70(%rcx), %eax
movzbl 0x72(%rcx), %edx
addl %edx, %eax
movzwl 0x70(%rcx), %ecx
subl %ecx, %eax
movl %eax, -0x5c(%rbp)
movl $0x0, -0x108(%rbp)
movl -0x108(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jge 0x7664
movq -0x80260(%rbp), %rcx
movq 0x78(%rcx), %rax
movzwl 0x70(%rcx), %ecx
addl -0x108(%rbp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq -0xf0(%rbp,%rax,8), %rcx
addq $0x1, %rcx
movq %rcx, -0xf0(%rbp,%rax,8)
movl -0x108(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x108(%rbp)
jmp 0x7618
jmp 0x7666
jmp 0x7668
jmp 0x766a
jmp 0x766c
jmp 0x766e
movl $0x1, -0x10c(%rbp)
movslq -0x10c(%rbp), %rax
cmpq $0x0, -0xf0(%rbp,%rax,8)
jne 0x769b
movl -0x10c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10c(%rbp)
jmp 0x7678
movl $0x10, -0x110(%rbp)
movslq -0x110(%rbp), %rax
cmpq $0x0, -0xf0(%rbp,%rax,8)
jne 0x76c8
movl -0x110(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x110(%rbp)
jmp 0x76a5
movl -0x1c(%rbp), %eax
cmpl -0x10c(%rbp), %eax
jge 0x76dc
movl -0x10c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x110(%rbp), %eax
jle 0x76f0
movl -0x110(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x10c(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
cltq
movq %rax, -0x118(%rbp)
movl -0x10c(%rbp), %eax
cmpl -0x110(%rbp), %eax
je 0x7761
movl -0x10c(%rbp), %eax
movl %eax, -0x11c(%rbp)
movl -0x11c(%rbp), %eax
cmpl -0x110(%rbp), %eax
jge 0x775f
movq -0x118(%rbp), %rax
movslq -0x11c(%rbp), %rcx
subq -0xf0(%rbp,%rcx,8), %rax
shlq %rax
movq %rax, -0x118(%rbp)
movl -0x11c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x11c(%rbp)
jmp 0x7720
jmp 0x7761
movslq -0x110(%rbp), %rax
movq -0xf0(%rbp,%rax,8), %rax
movl %eax, -0x120(%rbp)
movq -0x118(%rbp), %rcx
movslq -0x110(%rbp), %rax
movq %rcx, -0xf0(%rbp,%rax,8)
movq -0x118(%rbp), %rax
movslq -0x120(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x118(%rbp)
movl $0x0, -0x1b4(%rbp)
cmpl $0x11, -0x1b4(%rbp)
jge 0x77db
movslq -0x1b4(%rbp), %rax
movq $0x0, -0x1b0(%rbp,%rax,8)
movl -0x1b4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1b4(%rbp)
jmp 0x77ae
movl $0x0, -0x1b8(%rbp)
movl $0x1, -0x1bc(%rbp)
movl -0x1bc(%rbp), %eax
cmpl -0x110(%rbp), %eax
jge 0x7844
movslq -0x1b8(%rbp), %rax
movslq -0x1bc(%rbp), %rcx
addq -0xf0(%rbp,%rcx,8), %rax
movl %eax, -0x1b8(%rbp)
movslq -0x1b8(%rbp), %rcx
movl -0x1bc(%rbp), %eax
addl $0x1, %eax
cltq
movq %rcx, -0x1b0(%rbp,%rax,8)
movl -0x1bc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1bc(%rbp)
jmp 0x77ef
movslq -0x5c(%rbp), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x2030
movq %rax, -0x80268(%rbp)
jmp 0x786c
movq -0x80268(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movl $0x0, -0x1d8(%rbp)
movl $0x0, -0x1dc(%rbp)
movl $0x0, -0x1e0(%rbp)
movl -0x1e0(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jge 0x78ea
movq -0x1c8(%rbp), %rax
movslq -0x1e0(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movl -0x1e0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e0(%rbp)
jmp 0x7898
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1d0(%rbp)
movl %eax, -0x1d4(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x2120
jmp 0x8372
movl $0x0, -0x1e4(%rbp)
movl -0x1e4(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jge 0x7b87
cmpl $0x0, -0xc(%rbp)
jne 0x7977
movslq -0x1e4(%rbp), %rcx
leaq 0x88c9(%rip), %rax      # 0x101e0
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x7972
movslq -0x1dc(%rbp), %rdx
movq -0x1c8(%rbp), %rax
movslq -0x1e4(%rbp), %rsi
leaq 0x88a4(%rip), %rcx      # 0x101e0
movzbl (%rcx,%rsi), %ecx
movq -0x1b0(%rbp,%rcx,8), %rcx
movq %rdx, (%rax,%rcx,8)
movslq -0x1e4(%rbp), %rcx
leaq 0x8886(%rip), %rax      # 0x101e0
movzbl (%rax,%rcx), %eax
movq -0x1b0(%rbp,%rax,8), %rcx
addq $0x1, %rcx
movq %rcx, -0x1b0(%rbp,%rax,8)
jmp 0x7b64
cmpl $0x1, -0xc(%rbp)
jne 0x79eb
movslq -0x1e4(%rbp), %rcx
leaq 0x8975(%rip), %rax      # 0x10300
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x79e6
movslq -0x1dc(%rbp), %rdx
movq -0x1c8(%rbp), %rax
movslq -0x1e4(%rbp), %rsi
leaq 0x8950(%rip), %rcx      # 0x10300
movzbl (%rcx,%rsi), %ecx
movq -0x1b0(%rbp,%rcx,8), %rcx
movq %rdx, (%rax,%rcx,8)
movslq -0x1e4(%rbp), %rcx
leaq 0x8932(%rip), %rax      # 0x10300
movzbl (%rax,%rcx), %eax
movq -0x1b0(%rbp,%rax,8), %rcx
addq $0x1, %rcx
movq %rcx, -0x1b0(%rbp,%rax,8)
jmp 0x7b62
cmpl $0x2, -0xc(%rbp)
jne 0x7a5b
movq -0x80260(%rbp), %rax
movslq -0x1e4(%rbp), %rcx
movzbl 0x5c(%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x7a56
movq -0x80260(%rbp), %rax
movslq -0x1dc(%rbp), %rsi
movq -0x1c8(%rbp), %rcx
movslq -0x1e4(%rbp), %rdx
movzbl 0x5c(%rax,%rdx), %edx
movq -0x1b0(%rbp,%rdx,8), %rdx
movq %rsi, (%rcx,%rdx,8)
movslq -0x1e4(%rbp), %rcx
movzbl 0x5c(%rax,%rcx), %eax
movq -0x1b0(%rbp,%rax,8), %rcx
addq $0x1, %rcx
movq %rcx, -0x1b0(%rbp,%rax,8)
jmp 0x7b60
cmpl $0x3, -0xc(%rbp)
jne 0x7ad2
movq -0x80260(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x1e4(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x7acd
movq -0x80260(%rbp), %rax
movslq -0x1dc(%rbp), %rsi
movq -0x1c8(%rbp), %rcx
movq 0x78(%rax), %rdx
movslq -0x1e4(%rbp), %rdi
movq (%rdx,%rdi,8), %rdx
movq -0x1b0(%rbp,%rdx,8), %rdx
movq %rsi, (%rcx,%rdx,8)
movq 0x78(%rax), %rax
movslq -0x1e4(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x1b0(%rbp,%rax,8), %rcx
addq $0x1, %rcx
movq %rcx, -0x1b0(%rbp,%rax,8)
jmp 0x7b5e
cmpl $0x4, -0xc(%rbp)
jne 0x7b5c
movq -0x80260(%rbp), %rcx
movq 0x78(%rcx), %rax
movzwl 0x70(%rcx), %ecx
addl -0x1e4(%rbp), %ecx
movslq %ecx, %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x7b5a
movq -0x80260(%rbp), %rcx
movslq -0x1dc(%rbp), %rsi
movq -0x1c8(%rbp), %rax
movq 0x78(%rcx), %rdx
movzwl 0x70(%rcx), %edi
addl -0x1e4(%rbp), %edi
movslq %edi, %rdi
movq (%rdx,%rdi,8), %rdx
movq -0x1b0(%rbp,%rdx,8), %rdx
movq %rsi, (%rax,%rdx,8)
movq 0x78(%rcx), %rax
movzwl 0x70(%rcx), %ecx
addl -0x1e4(%rbp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq -0x1b0(%rbp,%rax,8), %rcx
addq $0x1, %rcx
movq %rcx, -0x1b0(%rbp,%rax,8)
jmp 0x7b5c
jmp 0x7b5e
jmp 0x7b60
jmp 0x7b62
jmp 0x7b64
movl -0x1dc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1dc(%rbp)
movl -0x1e4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e4(%rbp)
jmp 0x78f4
xorl %eax, %eax
subl -0x1c(%rbp), %eax
movl %eax, -0x1e8(%rbp)
movl $0xffffffff, -0x1ec(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x1f0(%rbp)
movl $0xffffffff, -0x801f4(%rbp) # imm = 0xFFFFFFFF
movq $0x0, -0x80200(%rbp)
movl $0x0, -0x80204(%rbp)
movl -0x10c(%rbp), %eax
movl %eax, -0x80208(%rbp)
movl -0x80208(%rbp), %eax
movl -0x110(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x82e6
movslq -0x80208(%rbp), %rax
movq -0xf0(%rbp,%rax,8), %rax
movl %eax, -0x8020c(%rbp)
movl -0x80208(%rbp), %ecx
subl $0x1, %ecx
movl $0x1, %eax
shll %cl, %eax
cltq
movq %rax, -0x80218(%rbp)
movl -0x5c(%rbp), %eax
movl %eax, -0x8021c(%rbp)
cmpl $0x0, -0x8020c(%rbp)
je 0x82d0
cmpl $0x0, -0x8020c(%rbp)
jge 0x7c3a
jmp 0x82d0
movl -0x1e8(%rbp), %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x1e8(%rbp)
movl -0x1e8(%rbp), %eax
cmpl -0x80208(%rbp), %eax
jge 0x7f86
movl -0x1ec(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1ec(%rbp)
movq $0x0, -0x80228(%rbp)
movl -0x1c(%rbp), %eax
movl -0x110(%rbp), %ecx
subl -0x1e8(%rbp), %ecx
cmpl %ecx, %eax
jge 0x7c95
movslq -0x1c(%rbp), %rax
movq %rax, -0x80228(%rbp)
jmp 0x7caa
movl -0x110(%rbp), %eax
subl -0x1e8(%rbp), %eax
cltq
movq %rax, -0x80228(%rbp)
movl -0x80208(%rbp), %eax
subl -0x1e8(%rbp), %eax
cltq
movq %rax, -0x80200(%rbp)
movl -0x8020c(%rbp), %eax
movq -0x80200(%rbp), %rcx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
cmpl %ecx, %eax
jge 0x7d90
movq -0x80200(%rbp), %rax
movl %eax, %ecx
movl $0x1, %eax
shll %cl, %eax
subl -0x8020c(%rbp), %eax
cltq
movq %rax, -0x80230(%rbp)
movq -0x80200(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80200(%rbp)
movl -0x80208(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1dc(%rbp)
movq -0x80200(%rbp), %rax
cmpq -0x80228(%rbp), %rax
jae 0x7d8e
movslq -0x1dc(%rbp), %rax
movq -0xf0(%rbp,%rax,8), %rax
movq -0x80230(%rbp), %rcx
shlq %rcx
cmpq %rcx, %rax
jae 0x7d7d
movq -0x80200(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80200(%rbp)
movq -0x80230(%rbp), %rax
shlq %rax
movslq -0x1dc(%rbp), %rcx
subq -0xf0(%rbp,%rcx,8), %rax
movq %rax, -0x80230(%rbp)
movl -0x1dc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1dc(%rbp)
jmp 0x7d1d
jmp 0x7d90
cmpl $-0x1, -0x60(%rbp)
jne 0x7da6
movq -0x80260(%rbp), %rax
movl 0x30(%rax), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
movq -0x80260(%rbp), %rax
movl -0x801f4(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x801f4(%rbp)
movl 0x30(%rax), %edx
addl $0x1, %edx
movslq -0x801f4(%rbp), %rcx
movl %edx, -0x801f0(%rbp,%rcx,4)
movl 0x30(%rax), %eax
addl $0x1, %eax
movl %eax, -0x80204(%rbp)
cmpl $0x0, -0x1ec(%rbp)
je 0x7f46
movq -0x80260(%rbp), %rax
movslq -0x1f0(%rbp), %rdx
movslq -0x1ec(%rbp), %rcx
movq %rdx, -0x1b0(%rbp,%rcx,8)
movslq -0x1c(%rbp), %rcx
movq %rcx, -0x58(%rbp)
movq -0x80200(%rbp), %rcx
addq $0x10, %rcx
movb %cl, -0x50(%rbp)
movl 0x30(%rax), %ecx
addl $0x1, %ecx
movl %ecx, -0x4c(%rbp)
movq $-0x1, -0x48(%rbp)
movq -0x58(%rbp), %rdx
movq 0x28(%rax), %rcx
movq %rcx, -0x80288(%rbp)
movl -0x1f0(%rbp), %esi
movl -0x1e8(%rbp), %ecx
subl -0x1c(%rbp), %ecx
sarl %cl, %esi
movq -0x80288(%rbp), %rcx
movl -0x1ec(%rbp), %edi
subl $0x1, %edi
movslq %edi, %rdi
addl -0x801f0(%rbp,%rdi,4), %esi
movslq %esi, %rsi
imulq $0x18, %rsi, %rsi
addq %rsi, %rcx
movq %rdx, (%rcx)
movb -0x50(%rbp), %dl
movq 0x28(%rax), %rcx
movq %rcx, -0x80280(%rbp)
movl -0x1f0(%rbp), %esi
movl -0x1e8(%rbp), %ecx
subl -0x1c(%rbp), %ecx
sarl %cl, %esi
movq -0x80280(%rbp), %rcx
movl -0x1ec(%rbp), %edi
subl $0x1, %edi
movslq %edi, %rdi
addl -0x801f0(%rbp,%rdi,4), %esi
movslq %esi, %rsi
imulq $0x18, %rsi, %rsi
addq %rsi, %rcx
movb %dl, 0x8(%rcx)
movq -0x48(%rbp), %rdx
movq 0x28(%rax), %rcx
movq %rcx, -0x80278(%rbp)
movl -0x1f0(%rbp), %esi
movl -0x1e8(%rbp), %ecx
subl -0x1c(%rbp), %ecx
sarl %cl, %esi
movq -0x80278(%rbp), %rcx
movl -0x1ec(%rbp), %edi
subl $0x1, %edi
movslq %edi, %rdi
addl -0x801f0(%rbp,%rdi,4), %esi
movslq %esi, %rsi
imulq $0x18, %rsi, %rsi
addq %rsi, %rcx
movq %rdx, 0x10(%rcx)
movl -0x4c(%rbp), %ecx
movl %ecx, -0x8026c(%rbp)
movq 0x28(%rax), %rax
movl -0x1f0(%rbp), %edx
movl -0x1e8(%rbp), %ecx
subl -0x1c(%rbp), %ecx
sarl %cl, %edx
movl -0x8026c(%rbp), %ecx
movl -0x1ec(%rbp), %esi
subl $0x1, %esi
movslq %esi, %rsi
addl -0x801f0(%rbp,%rsi,4), %edx
movslq %edx, %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movq -0x80260(%rbp), %rax
movl 0x30(%rax), %ecx
movl %ecx, -0x8028c(%rbp)
movq -0x80200(%rbp), %rcx
movl $0x1, %edx
shll %cl, %edx
movl -0x8028c(%rbp), %ecx
addl $0x1, %edx
addl %edx, %ecx
movl %ecx, 0x30(%rax)
movl -0x1c(%rbp), %eax
addl -0x1e8(%rbp), %eax
movl %eax, -0x1e8(%rbp)
jmp 0x7c49
movl -0x1e8(%rbp), %eax
subl -0x1c(%rbp), %eax
movl %eax, -0x1e8(%rbp)
movl -0x80208(%rbp), %eax
subl -0x1e8(%rbp), %eax
cltq
movq %rax, -0x58(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x1d8(%rbp), %eax
cmpl -0x8021c(%rbp), %eax
jl 0x7fc5
movb $0x63, -0x50(%rbp)
jmp 0x80e0
movq -0x1c8(%rbp), %rax
movslq -0x1d8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x80238(%rbp)
movq -0x80238(%rbp), %rax
movslq -0x10(%rbp), %rcx
cmpq %rcx, %rax
jae 0x8015
cmpq $0x100, -0x80238(%rbp) # imm = 0x100
jb 0x8001
movb $0xf, -0x50(%rbp)
jmp 0x8005
movb $0x10, -0x50(%rbp)
movq -0x80238(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x80d1
cmpl $0x0, -0x14(%rbp)
jne 0x806c
movq -0x1c8(%rbp), %rax
movslq -0x1d8(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movslq -0x10(%rbp), %rax
subq %rax, %rcx
leaq 0x8325(%rip), %rax      # 0x10360
movw (%rax,%rcx,2), %ax
movb %al, -0x50(%rbp)
movq -0x1c8(%rbp), %rax
movslq -0x1d8(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movslq -0x10(%rbp), %rax
subq %rax, %rcx
leaq 0x82be(%rip), %rax      # 0x10320
movzwl (%rax,%rcx,2), %eax
movq %rax, -0x48(%rbp)
jmp 0x80cf
cmpl $0x1, -0x14(%rbp)
jne 0x80c3
movq -0x1c8(%rbp), %rax
movslq -0x1d8(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movslq -0x10(%rbp), %rax
subq %rax, %rcx
leaq 0x834e(%rip), %rax      # 0x103e0
movw (%rax,%rcx,2), %ax
movb %al, -0x50(%rbp)
movq -0x1c8(%rbp), %rax
movslq -0x1d8(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movslq -0x10(%rbp), %rax
subq %rax, %rcx
leaq 0x82e7(%rip), %rax      # 0x103a0
movzwl (%rax,%rcx,2), %eax
movq %rax, -0x48(%rbp)
jmp 0x80cd
cmpl $0x2, -0x14(%rbp)
jne 0x80cb
jmp 0x80cb
jmp 0x80cd
jmp 0x80cf
jmp 0x80d1
movl -0x1d8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1d8(%rbp)
movl -0x1f0(%rbp), %eax
movl -0x1e8(%rbp), %ecx
sarl %cl, %eax
cltq
movq %rax, -0x80240(%rbp)
movl -0x80208(%rbp), %ecx
subl -0x1e8(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
cltq
movq %rax, -0x80248(%rbp)
movq -0x80200(%rbp), %rax
movl %eax, %ecx
movl $0x1, %eax
shll %cl, %eax
cltq
cmpq -0x80240(%rbp), %rax
jbe 0x8217
movslq -0x80204(%rbp), %rax
addq -0x80240(%rbp), %rax
cmpq $0xffff, %rax           # imm = 0xFFFF
jbe 0x8177
movq -0x1c8(%rbp), %rax
movq %rax, -0x80298(%rbp)
cmpq $0x0, %rax
je 0x8168
movq -0x80298(%rbp), %rdi
callq 0x2280
movl $0x1, -0x8024c(%rbp)
jmp 0x8360
movq -0x80260(%rbp), %rax
movq -0x58(%rbp), %rdx
movq 0x28(%rax), %rcx
movslq -0x80204(%rbp), %rsi
addq -0x80240(%rbp), %rsi
imulq $0x18, %rsi, %rsi
addq %rsi, %rcx
movq %rdx, (%rcx)
movb -0x50(%rbp), %dl
movq 0x28(%rax), %rcx
movslq -0x80204(%rbp), %rsi
addq -0x80240(%rbp), %rsi
imulq $0x18, %rsi, %rsi
addq %rsi, %rcx
movb %dl, 0x8(%rcx)
movq -0x48(%rbp), %rdx
movq 0x28(%rax), %rcx
movslq -0x80204(%rbp), %rsi
addq -0x80240(%rbp), %rsi
imulq $0x18, %rsi, %rsi
addq %rsi, %rcx
movq %rdx, 0x10(%rcx)
movl -0x4c(%rbp), %ecx
movq 0x28(%rax), %rax
movslq -0x80204(%rbp), %rdx
addq -0x80240(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movq -0x80240(%rbp), %rax
addq -0x80248(%rbp), %rax
movq %rax, -0x80240(%rbp)
jmp 0x8113
movq -0x80218(%rbp), %rax
movq %rax, -0x80258(%rbp)
movslq -0x1f0(%rbp), %rax
andq -0x80258(%rbp), %rax
cmpq $0x0, %rax
je 0x8260
movslq -0x1f0(%rbp), %rax
xorq -0x80258(%rbp), %rax
movl %eax, -0x1f0(%rbp)
movq -0x80258(%rbp), %rax
shrq %rax
movq %rax, -0x80258(%rbp)
jmp 0x8225
movslq -0x1f0(%rbp), %rax
xorq -0x80258(%rbp), %rax
movl %eax, -0x1f0(%rbp)
movl -0x1f0(%rbp), %eax
movl -0x1e8(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
andl %ecx, %eax
cltq
movslq -0x1ec(%rbp), %rcx
cmpq -0x1b0(%rbp,%rcx,8), %rax
je 0x82bc
movl -0x1ec(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x1ec(%rbp)
movl $0x0, -0x1e8(%rbp)
jmp 0x8274
movl -0x8020c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x8020c(%rbp)
jmp 0x7c1f
jmp 0x82d2
movl -0x80208(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80208(%rbp)
jmp 0x7bd1
movq -0x1c8(%rbp), %rax
movq %rax, -0x802a0(%rbp)
cmpq $0x0, %rax
je 0x8306
movq -0x802a0(%rbp), %rdi
callq 0x2280
cmpq $0x0, -0x118(%rbp)
jbe 0x833d
movl -0x110(%rbp), %ecx
xorl $0x1, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
setl %cl
movq 0x10(%rbp), %rax
andb $0x1, %cl
movb %cl, (%rax)
movl -0x1c(%rbp), %ecx
movq 0x18(%rbp), %rax
movl %ecx, (%rax)
movl -0x60(%rbp), %ecx
movq 0x20(%rbp), %rax
movl %ecx, (%rax)
jmp 0x8356
movq 0x10(%rbp), %rax
movb $0x0, (%rax)
movl -0x1c(%rbp), %ecx
movq 0x18(%rbp), %rax
movl %ecx, (%rax)
movl -0x60(%rbp), %ecx
movq 0x20(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x8024c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x2120
addq $0x802a0, %rsp          # imm = 0x802A0
popq %rbp
retq
movq -0x1d0(%rbp), %rdi
callq 0x2340
nop