// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/misc/codecs.cpp
// Function: PCIIO::WriteLine(smooth::IO::OutStream*, int)
bool PCIIO::WriteLine(PCIOut out, int y)
{
	/* Check compression type.
	 */
	if (compression != PCI	 &&
	    compression != RLE	 &&
	    compression != BZIP2 &&
	    compression != UNCOMPRESSED) return false;

	/* Write image line.
	 */
	int	*line = new int [sizex];
	int	 ctsize;
	int	 maxpalentries;

	switch (colorspace)
	{
		case Color::RGB:
		case Color::YUV:
		case Color::HSV:
		case Color::CMY:
			ctsize = 3;
			maxpalentries = 338;

			break;
		case Color::CMYK:
			ctsize = 4;
			maxpalentries = 338;

			break;
		case Color::GRAY:
			ctsize = 1;
			maxpalentries = 338;

			break;
		default:
			ctsize = 3;
			maxpalentries = 338;

			break;
	}

	for (int x = 0; x < sizex; x++) line[x] = Color(bmp.GetPixel(Point(x, y))).ConvertTo(colorspace).Downsample(bpcc);

	switch (compression)
	{
		case BZIP2:
		case UNCOMPRESSED:
			for (int x = 0; x < sizex; x++) out->OutputBits(line[x], ctsize * bpcc);

			break;
		case RLE:
			for (int x = 0; x < sizex; x++)
			{
				int	 rle = GetRLE(line, sizex, x, rlebits);

				out->OutputBits(line[x], ctsize * bpcc);
				out->OutputBits(rle, rlebits);

				x += rle;
			}

			break;
		case PCI:
			if (GetSLAL(line, previousLine, sizex))
			{
				out->OutputBits(1, 1);
			}
			else
			{
				out->OutputBits(0, 1);

				ProbeComp(0, sizex, line, previousLine, sizex, ctsize, false, bits, bitssaa);
				ProbeComp(0, sizex, line, previousLine, sizex, ctsize, true, bitsnrle, bitssaanrle);

				int	 dorle = 0;
				int	 dosaa = 0;

				if (bitssaa < bits)
				{
					out->OutputBits(1, 1);
					dosaa = 1;

					if (bitssaa < bitssaanrle)
					{
						out->OutputBits(1, 1);
						dorle = 1;
					}
					else
					{
						out->OutputBits(0, 1);
						dorle = 0;
					}
				}
				else
				{
					out->OutputBits(0, 1);
					dosaa = 0;

					if (bits < bitsnrle)
					{
						out->OutputBits(1, 1);
						dorle = 1;
					}
					else
					{
						out->OutputBits(0, 1);
						dorle = 0;
					}
				}

				int	 allinpal = 0;
				int	 gallinpal = 0;
				int	 mod04 = 0;
				int	 mod16 = 0;

				for (int x = 0; x < sizex; x++)
				{
					int	 previousColor = (x > 0 ? line[x - 1] : 0);

					if ((x % 16) == mod16)
					{
						gallinpal = 1;

						for (int x2 = 0; x2 < 16; x2++)
						{
							if ((x + x2) < sizex && GetPaletteEntry(line[x + x2]) == -1) { gallinpal = 0; break; }
						}

						if (gallinpal == 1) out->OutputBits(1, 1);
						else		    out->OutputBits(0, 1);
					}

					if (((x % 4) == mod04) && !gallinpal)
					{
						allinpal = 1;

						for (int x2 = 0; x2 < 4; x2++)
						{
							if ((x + x2) < sizex && GetPaletteEntry(line[x + x2]) == -1) { allinpal = 0; break; }
						}

						if (allinpal == 1) out->OutputBits(1, 1);
						else		   out->OutputBits(0, 1);
					}

					if ((GetPaletteEntry(line[x]) == -1))
					{
						out->OutputBits(0, 1);

						if (GetDelta(line, previousLine, x, ctsize))
						{
							out->OutputBits(1, 1);

							CompressDelta(line, previousLine, x, ctsize, out);
						}
						else
						{
							out->OutputBits(0, 1);
							out->OutputBits(line[x], ctsize * bpcc);
						}

						if (palentries < maxpalentries)
						{
							palette[palentries] = line[x];
							palentries++;
						}
						else
						{
							RotatePalette(line[x]);
						}
					}
					else
					{
						if (!allinpal && !gallinpal) out->OutputBits(1, 1);

						if (GetSAA(line, previousLine, x) && dosaa)
						{
							out->OutputBits(1, 1);
						}
						else
						{
							if (dosaa) out->OutputBits(0, 1);

							if ((palentries - 1) - GetPaletteEntry(line[x]) < 2)
							{
								out->OutputBits(1, 1);
								out->OutputBits((palentries - 1) - GetPaletteEntry(line[x]), 1);
							}
							else
							{
								out->OutputBits(0, 1);

								if ((palentries - 1)-GetPaletteEntry(line[x]) < 18)
								{
									int	 lbits = Math::Min(GetMinimumBits(palentries - 2), 4);

									out->OutputBits(1, 1);
									out->OutputBits((palentries - 1) - GetPaletteEntry(line[x]) - 2, lbits);
								}
								else
								{
									out->OutputBits(0, 1);

									if ((palentries - 1) - GetPaletteEntry(line[x]) < 82)
									{
										int	 lbits = Math::Min(GetMinimumBits(palentries - 18), 6);

										out->OutputBits(1, 1);
										out->OutputBits((palentries - 1)-GetPaletteEntry(line[x]) - 18, lbits);
									}
									else
									{
										out->OutputBits(0, 1);
										out->OutputBits((palentries - 1)-GetPaletteEntry(line[x]) - 82, GetMinimumBits(palentries - 83));
									}
								}
							}
						}

						RotatePaletteEntry(GetPaletteEntry(line[x]));
					}

					if (line[x] == previousColor)
					{
						int	 pcirle = GetRLE(line, sizex, x, 8);

						if (pcirle >= 2)
						{
							out->OutputBits(1, 1);

							if (pcirle > 9)
							{
								out->OutputBits(1, 1);
								out->OutputBits(pcirle - 2, 8);
							}
							else
							{
								out->OutputBits(0, 1);
								out->OutputBits(pcirle - 2, 3);
							}

							x = x + pcirle;

							allinpal = 0;
							gallinpal = 0;

							mod04 = (x + 1) %  4;
							mod16 = (x + 1) % 16;
						}
						else
						{
							out->OutputBits(0, 1);
						}
					}
					else if ((line[x] == previousLine[x]) && dorle)
					{
						int	 pcirle = GetVRLE(line, previousLine, sizex, x, 8);

						if (pcirle >= 2)
						{
							out->OutputBits(1, 1);

							if (pcirle > 9)
							{
								out->OutputBits(1, 1);
								out->OutputBits(pcirle - 2, 8);
							}
							else
							{
								out->OutputBits(0, 1);
								out->OutputBits(pcirle - 2, 3);
							}

							x = x + pcirle;

							allinpal = 0;
							gallinpal = 0;

							mod04 = (x + 1) %  4;
							mod16 = (x + 1) % 16;
						}
						else
						{
							out->OutputBits(0, 1);
						}
					}
				}
			}

			for (int x = 0; x < sizex; x++) previousLine[x] = line[x];

			break;
	}

	delete [] line;

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xc0(%rbp)
cmpl $0x1, 0x50(%rax)
je 0x114927
movq -0xc0(%rbp), %rax
cmpl $0x3, 0x50(%rax)
je 0x114927
movq -0xc0(%rbp), %rax
cmpl $0x4, 0x50(%rax)
je 0x114927
movq -0xc0(%rbp), %rax
cmpl $0x0, 0x50(%rax)
je 0x114927
movb $0x0, -0x1(%rbp)
jmp 0x11566e
movq -0xc0(%rbp), %rax
movslq 0x10(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x5ab20
movq %rax, %rcx
movq -0xc0(%rbp), %rax
movq %rcx, -0x28(%rbp)
movl 0x58(%rax), %eax
movq %rax, -0xc8(%rbp)
subq $0x6, %rax
ja 0x1149b2
movq -0xc8(%rbp), %rax
leaq 0x91caf(%rip), %rcx     # 0x1a6628
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x3, -0x2c(%rbp)
movl $0x152, -0x30(%rbp)     # imm = 0x152
jmp 0x1149c0
movl $0x4, -0x2c(%rbp)
movl $0x152, -0x30(%rbp)     # imm = 0x152
jmp 0x1149c0
movl $0x1, -0x2c(%rbp)
movl $0x152, -0x30(%rbp)     # imm = 0x152
jmp 0x1149c0
movl $0x3, -0x2c(%rbp)
movl $0x152, -0x30(%rbp)     # imm = 0x152
movl $0x0, -0x34(%rbp)
movq -0xc0(%rbp), %rcx
movl -0x34(%rbp), %eax
cmpl 0x10(%rcx), %eax
jge 0x114a61
movq -0xc0(%rbp), %rax
addq $0x8, %rax
movq %rax, -0xd0(%rbp)
movl -0x34(%rbp), %esi
movl -0x1c(%rbp), %edx
leaq -0x70(%rbp), %rdi
callq 0x5c2c0
movq -0xd0(%rbp), %rsi
leaq -0x68(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x5a220
movq -0xc0(%rbp), %rax
movl 0x58(%rax), %edx
leaq -0x58(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x5c5e0
movq -0xc0(%rbp), %rax
movl 0x54(%rax), %edx
leaq -0x48(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x5b620
leaq -0x48(%rbp), %rdi
callq 0x59210
movl %eax, %edx
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1149c7
movq -0xc0(%rbp), %rax
movl 0x50(%rax), %eax
movq %rax, -0xd8(%rbp)
subq $0x4, %rax
ja 0x11564d
movq -0xd8(%rbp), %rax
leaq 0x91bba(%rip), %rcx     # 0x1a6644
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x0, -0x74(%rbp)
movq -0xc0(%rbp), %rcx
movl -0x74(%rbp), %eax
cmpl 0x10(%rcx), %eax
jge 0x114ad7
movq -0xc0(%rbp), %rax
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rcx
movslq -0x74(%rbp), %rdx
movslq (%rcx,%rdx,4), %rsi
movl -0x2c(%rbp), %edx
imull 0x54(%rax), %edx
callq 0x5c5a0
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x114a9a
jmp 0x11564d
movl $0x0, -0x78(%rbp)
movq -0xc0(%rbp), %rcx
movl -0x78(%rbp), %eax
cmpl 0x10(%rcx), %eax
jge 0x114b5e
movq -0xc0(%rbp), %rax
movq -0x28(%rbp), %rdi
movl 0x10(%rax), %esi
movl -0x78(%rbp), %edx
movl 0x60(%rax), %ecx
callq 0x116140
movl %eax, %ecx
movq -0xc0(%rbp), %rax
movl %ecx, -0x7c(%rbp)
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rcx
movslq -0x78(%rbp), %rdx
movslq (%rcx,%rdx,4), %rsi
movl -0x2c(%rbp), %edx
imull 0x54(%rax), %edx
callq 0x5c5a0
movq -0xc0(%rbp), %rax
movq -0x18(%rbp), %rdi
movslq -0x7c(%rbp), %rsi
movl 0x60(%rax), %edx
callq 0x5c5a0
movl -0x7c(%rbp), %eax
addl -0x78(%rbp), %eax
movl %eax, -0x78(%rbp)
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x114ae3
jmp 0x11564d
movq -0xc0(%rbp), %rax
movq -0x28(%rbp), %rdi
movq 0xff32b(%rip), %rsi     # 0x213ea0
movl 0x10(%rax), %edx
callq 0x116210
cmpl $0x0, %eax
je 0x114b9a
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x5c5a0
jmp 0x1155ff
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x5c5a0
movq -0xc0(%rbp), %rax
movl 0x10(%rax), %esi
movq -0x28(%rbp), %rdx
movq 0xff2df(%rip), %rcx     # 0x213ea0
movl 0x10(%rax), %r8d
movl -0x2c(%rbp), %r9d
xorl %edi, %edi
leaq 0xff8f2(%rip), %r10     # 0x2144c4
leaq 0xff8ef(%rip), %rax     # 0x2144c8
movl $0x0, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x116270
movq -0xc0(%rbp), %rax
movl 0x10(%rax), %esi
movq -0x28(%rbp), %rdx
movq 0xff29c(%rip), %rcx     # 0x213ea0
movl 0x10(%rax), %r8d
movl -0x2c(%rbp), %r9d
xorl %edi, %edi
leaq 0xff8b7(%rip), %r10     # 0x2144cc
leaq 0xff8b4(%rip), %rax     # 0x2144d0
movl $0x1, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x116270
movl $0x0, -0x80(%rbp)
movl $0x0, -0x84(%rbp)
movl 0xff87f(%rip), %eax     # 0x2144c8
cmpl 0xff875(%rip), %eax     # 0x2144c4
jge 0x114cb3
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x5c5a0
movl $0x1, -0x84(%rbp)
movl 0xff854(%rip), %eax     # 0x2144c8
cmpl 0xff856(%rip), %eax     # 0x2144d0
jge 0x114c98
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x5c5a0
movl $0x1, -0x80(%rbp)
jmp 0x114cb1
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x5c5a0
movl $0x0, -0x80(%rbp)
jmp 0x114d14
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x5c5a0
movl $0x0, -0x84(%rbp)
movl 0xff7ef(%rip), %eax     # 0x2144c4
cmpl 0xff7f1(%rip), %eax     # 0x2144cc
jge 0x114cf9
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x5c5a0
movl $0x1, -0x80(%rbp)
jmp 0x114d12
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x5c5a0
movl $0x0, -0x80(%rbp)
jmp 0x114d14
movl $0x0, -0x88(%rbp)
movl $0x0, -0x8c(%rbp)
movl $0x0, -0x90(%rbp)
movl $0x0, -0x94(%rbp)
movl $0x0, -0x98(%rbp)
movq -0xc0(%rbp), %rcx
movl -0x98(%rbp), %eax
cmpl 0x10(%rcx), %eax
jge 0x1155fd
cmpl $0x0, -0x98(%rbp)
jle 0x114d80
movq -0x28(%rbp), %rax
movl -0x98(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0xdc(%rbp)
jmp 0x114d8a
xorl %eax, %eax
movl %eax, -0xdc(%rbp)
jmp 0x114d8a
movl -0xdc(%rbp), %eax
movl %eax, -0x9c(%rbp)
movl -0x98(%rbp), %eax
movl $0x10, %ecx
cltd
idivl %ecx
cmpl -0x94(%rbp), %edx
jne 0x114e56
movl $0x1, -0x8c(%rbp)
movl $0x0, -0xa0(%rbp)
cmpl $0x10, -0xa0(%rbp)
jge 0x114e24
movq -0xc0(%rbp), %rcx
movl -0x98(%rbp), %eax
addl -0xa0(%rbp), %eax
cmpl 0x10(%rcx), %eax
jge 0x114e11
movq -0x28(%rbp), %rax
movl -0x98(%rbp), %ecx
addl -0xa0(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edi
callq 0x116910
cmpl $-0x1, %eax
jne 0x114e11
movl $0x0, -0x8c(%rbp)
jmp 0x114e24
jmp 0x114e13
movl -0xa0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa0(%rbp)
jmp 0x114dc4
cmpl $0x1, -0x8c(%rbp)
jne 0x114e42
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x5c5a0
jmp 0x114e54
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x5c5a0
jmp 0x114e56
movl -0x98(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
cmpl -0x90(%rbp), %edx
jne 0x114f23
cmpl $0x0, -0x8c(%rbp)
jne 0x114f23
movl $0x1, -0x88(%rbp)
movl $0x0, -0xa4(%rbp)
cmpl $0x4, -0xa4(%rbp)
jge 0x114ef1
movq -0xc0(%rbp), %rcx
movl -0x98(%rbp), %eax
addl -0xa4(%rbp), %eax
cmpl 0x10(%rcx), %eax
jge 0x114ede
movq -0x28(%rbp), %rax
movl -0x98(%rbp), %ecx
addl -0xa4(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edi
callq 0x116910
cmpl $-0x1, %eax
jne 0x114ede
movl $0x0, -0x88(%rbp)
jmp 0x114ef1
jmp 0x114ee0
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x114e91
cmpl $0x1, -0x88(%rbp)
jne 0x114f0f
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x5c5a0
jmp 0x114f21
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x5c5a0
jmp 0x114f23
movq -0x28(%rbp), %rax
movslq -0x98(%rbp), %rcx
movl (%rax,%rcx,4), %edi
callq 0x116910
cmpl $-0x1, %eax
jne 0x11502c
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x5c5a0
movq -0x28(%rbp), %rdi
movq 0xfef44(%rip), %rsi     # 0x213ea0
movl -0x98(%rbp), %edx
movl -0x2c(%rbp), %ecx
callq 0x116960
cmpl $0x0, %eax
je 0x114fa1
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x5c5a0
movq -0x28(%rbp), %rdi
movq 0xfef13(%rip), %rsi     # 0x213ea0
movl -0x98(%rbp), %edx
movl -0x2c(%rbp), %ecx
movq -0x18(%rbp), %r8
callq 0x1171e0
jmp 0x114fd9
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x5c5a0
movq -0xc0(%rbp), %rax
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rcx
movslq -0x98(%rbp), %rdx
movslq (%rcx,%rdx,4), %rsi
movl -0x2c(%rbp), %edx
imull 0x54(%rax), %edx
callq 0x5c5a0
movl 0xff4e1(%rip), %eax     # 0x2144c0
cmpl -0x30(%rbp), %eax
jge 0x115014
movq -0x28(%rbp), %rax
movslq -0x98(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movslq 0xff4c7(%rip), %rcx     # 0x2144c0
leaq 0xfeeb0(%rip), %rax     # 0x213eb0
movl %edx, (%rax,%rcx,4)
movl 0xff4b7(%rip), %eax     # 0x2144c0
addl $0x1, %eax
movl %eax, 0xff4ae(%rip)     # 0x2144c0
jmp 0x115027
movq -0x28(%rbp), %rax
movslq -0x98(%rbp), %rcx
movl (%rax,%rcx,4), %edi
callq 0x1186e0
jmp 0x11536d
cmpl $0x0, -0x88(%rbp)
jne 0x115051
cmpl $0x0, -0x8c(%rbp)
jne 0x115051
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x5c5a0
movq -0x28(%rbp), %rdi
movq 0xfee44(%rip), %rsi     # 0x213ea0
movl -0x98(%rbp), %edx
callq 0x118750
cmpl $0x0, %eax
je 0x11508d
cmpl $0x0, -0x84(%rbp)
je 0x11508d
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x5c5a0
jmp 0x115353
cmpl $0x0, -0x84(%rbp)
je 0x1150a8
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x5c5a0
movl 0xff412(%rip), %eax     # 0x2144c0
subl $0x1, %eax
movl %eax, -0xe0(%rbp)
movq -0x28(%rbp), %rax
movslq -0x98(%rbp), %rcx
movl (%rax,%rcx,4), %edi
callq 0x116910
movl %eax, %ecx
movl -0xe0(%rbp), %eax
subl %ecx, %eax
cmpl $0x2, %eax
jge 0x11513c
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x5c5a0
movq -0x18(%rbp), %rax
movq %rax, -0xf0(%rbp)
movl 0xff3c3(%rip), %eax     # 0x2144c0
subl $0x1, %eax
movl %eax, -0xe4(%rbp)
movq -0x28(%rbp), %rax
movslq -0x98(%rbp), %rcx
movl (%rax,%rcx,4), %edi
callq 0x116910
movq -0xf0(%rbp), %rdi
movl %eax, %ecx
movl -0xe4(%rbp), %eax
subl %ecx, %eax
movslq %eax, %rsi
movl $0x1, %edx
callq 0x5c5a0
jmp 0x115351
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x5c5a0
movl 0xff36c(%rip), %eax     # 0x2144c0
subl $0x1, %eax
movl %eax, -0xf4(%rbp)
movq -0x28(%rbp), %rax
movslq -0x98(%rbp), %rcx
movl (%rax,%rcx,4), %edi
callq 0x116910
movl %eax, %ecx
movl -0xf4(%rbp), %eax
subl %ecx, %eax
cmpl $0x12, %eax
jge 0x11520a
movl 0xff337(%rip), %edi     # 0x2144c0
subl $0x2, %edi
callq 0x118790
movl %eax, %edi
movl $0x4, %esi
callq 0x5ce90
movl %eax, -0xa8(%rbp)
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x5c5a0
movq -0x18(%rbp), %rax
movq %rax, -0x100(%rbp)
movl 0xff2f9(%rip), %eax     # 0x2144c0
subl $0x1, %eax
movl %eax, -0xf8(%rbp)
movq -0x28(%rbp), %rax
movslq -0x98(%rbp), %rcx
movl (%rax,%rcx,4), %edi
callq 0x116910
movq -0x100(%rbp), %rdi
movl %eax, %ecx
movl -0xf8(%rbp), %eax
subl %ecx, %eax
subl $0x2, %eax
movslq %eax, %rsi
movl -0xa8(%rbp), %edx
callq 0x5c5a0
jmp 0x11534f
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x5c5a0
movl 0xff29e(%rip), %eax     # 0x2144c0
subl $0x1, %eax
movl %eax, -0x104(%rbp)
movq -0x28(%rbp), %rax
movslq -0x98(%rbp), %rcx
movl (%rax,%rcx,4), %edi
callq 0x116910
movl %eax, %ecx
movl -0x104(%rbp), %eax
subl %ecx, %eax
cmpl $0x52, %eax
jge 0x1152d5
movl 0xff269(%rip), %edi     # 0x2144c0
subl $0x12, %edi
callq 0x118790
movl %eax, %edi
movl $0x6, %esi
callq 0x5ce90
movl %eax, -0xac(%rbp)
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x5c5a0
movq -0x18(%rbp), %rax
movq %rax, -0x110(%rbp)
movl 0xff22b(%rip), %eax     # 0x2144c0
subl $0x1, %eax
movl %eax, -0x108(%rbp)
movq -0x28(%rbp), %rax
movslq -0x98(%rbp), %rcx
movl (%rax,%rcx,4), %edi
callq 0x116910
movq -0x110(%rbp), %rdi
movl %eax, %ecx
movl -0x108(%rbp), %eax
subl %ecx, %eax
subl $0x12, %eax
movslq %eax, %rsi
movl -0xac(%rbp), %edx
callq 0x5c5a0
jmp 0x11534d
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x5c5a0
movq -0x18(%rbp), %rax
movq %rax, -0x120(%rbp)
movl 0xff1c8(%rip), %eax     # 0x2144c0
subl $0x1, %eax
movl %eax, -0x124(%rbp)
movq -0x28(%rbp), %rax
movslq -0x98(%rbp), %rcx
movl (%rax,%rcx,4), %edi
callq 0x116910
movl %eax, %ecx
movl -0x124(%rbp), %eax
subl %ecx, %eax
subl $0x52, %eax
cltq
movq %rax, -0x118(%rbp)
movl 0xff190(%rip), %edi     # 0x2144c0
subl $0x53, %edi
callq 0x118790
movq -0x120(%rbp), %rdi
movq -0x118(%rbp), %rsi
movl %eax, %edx
callq 0x5c5a0
jmp 0x11534f
jmp 0x115351
jmp 0x115353
movq -0x28(%rbp), %rax
movslq -0x98(%rbp), %rcx
movl (%rax,%rcx,4), %edi
callq 0x116910
movl %eax, %edi
callq 0x1187f0
movq -0x28(%rbp), %rax
movslq -0x98(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x9c(%rbp), %eax
jne 0x11549c
movq -0xc0(%rbp), %rax
movq -0x28(%rbp), %rdi
movl 0x10(%rax), %esi
movl -0x98(%rbp), %edx
movl $0x8, %ecx
callq 0x116140
movl %eax, -0xb0(%rbp)
cmpl $0x2, -0xb0(%rbp)
jl 0x115485
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x5c5a0
cmpl $0x9, -0xb0(%rbp)
jle 0x115403
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x5c5a0
movq -0x18(%rbp), %rdi
movl -0xb0(%rbp), %eax
subl $0x2, %eax
movslq %eax, %rsi
movl $0x8, %edx
callq 0x5c5a0
jmp 0x11542f
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x5c5a0
movq -0x18(%rbp), %rdi
movl -0xb0(%rbp), %eax
subl $0x2, %eax
movslq %eax, %rsi
movl $0x3, %edx
callq 0x5c5a0
movl -0x98(%rbp), %eax
addl -0xb0(%rbp), %eax
movl %eax, -0x98(%rbp)
movl $0x0, -0x88(%rbp)
movl $0x0, -0x8c(%rbp)
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %edx, -0x90(%rbp)
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl $0x10, %ecx
cltd
idivl %ecx
movl %edx, -0x94(%rbp)
jmp 0x115497
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x5c5a0
jmp 0x1155e7
movq -0x28(%rbp), %rax
movslq -0x98(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq 0xfe9ef(%rip), %rcx     # 0x213ea0
movslq -0x98(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jne 0x1155e5
cmpl $0x0, -0x80(%rbp)
je 0x1155e5
movq -0xc0(%rbp), %rax
movq -0x28(%rbp), %rdi
movq 0xfe9c3(%rip), %rsi     # 0x213ea0
movl 0x10(%rax), %edx
movl -0x98(%rbp), %ecx
movl $0x8, %r8d
callq 0x118870
movl %eax, -0xb4(%rbp)
cmpl $0x2, -0xb4(%rbp)
jl 0x1155d1
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x5c5a0
cmpl $0x9, -0xb4(%rbp)
jle 0x11554f
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x5c5a0
movq -0x18(%rbp), %rdi
movl -0xb4(%rbp), %eax
subl $0x2, %eax
movslq %eax, %rsi
movl $0x8, %edx
callq 0x5c5a0
jmp 0x11557b
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x5c5a0
movq -0x18(%rbp), %rdi
movl -0xb4(%rbp), %eax
subl $0x2, %eax
movslq %eax, %rsi
movl $0x3, %edx
callq 0x5c5a0
movl -0x98(%rbp), %eax
addl -0xb4(%rbp), %eax
movl %eax, -0x98(%rbp)
movl $0x0, -0x88(%rbp)
movl $0x0, -0x8c(%rbp)
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %edx, -0x90(%rbp)
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl $0x10, %ecx
cltd
idivl %ecx
movl %edx, -0x94(%rbp)
jmp 0x1155e3
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x5c5a0
jmp 0x1155e5
jmp 0x1155e7
jmp 0x1155e9
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
jmp 0x114d46
jmp 0x1155ff
movl $0x0, -0xb8(%rbp)
movq -0xc0(%rbp), %rcx
movl -0xb8(%rbp), %eax
cmpl 0x10(%rcx), %eax
jge 0x11564b
movq -0x28(%rbp), %rax
movslq -0xb8(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq 0xfe870(%rip), %rax     # 0x213ea0
movslq -0xb8(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0xb8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb8(%rbp)
jmp 0x115609
jmp 0x11564d
movq -0x28(%rbp), %rax
movq %rax, -0x130(%rbp)
cmpq $0x0, %rax
je 0x11566a
movq -0x130(%rbp), %rdi
callq 0x5a5e0
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopl (%rax)