// File: /workspace/github_c_makefile_star2_O1/albinoloverats[P]hide/src/jpeg-save.c
// Function: jpeg_encode_data
extern void jpeg_encode_data(FILE *file, jpeg_message_t *msg, jpeg_image_t *info)
{
	message = msg;

	bitstring fillbits; // filling bitstring for the bit alignment of the EOI marker

	Ximage = info->width;
	Yimage = info->height;

	uint32_t Xdiv8 = (Ximage % 8) ? ((Ximage / 8) << 3) + 8 : Ximage;
	uint32_t Ydiv8 = (Yimage % 8) ? ((Yimage / 8) << 3) + 8 : Yimage;

	// The image we encode shall be filled with the last line and the last column
	// from the original bitmap, until Ximage and Yimage are divisible by 8
	// Load BMP image from disk and complete X
	RGB_buffer = calloc(Xdiv8 * Ydiv8, sizeof (colorRGB));

	//uint8_t nr_fillingbytes = (Ximage % 4) ? 4 - (Ximage % 4) : 0;
	for (uint32_t nrline = 0; nrline < Yimage; nrline++)
		memcpy(RGB_buffer + nrline * Xdiv8, info->rgb[nrline], Ximage * 3);
	Ximage = Xdiv8;
	Yimage = Ydiv8;


	fp_jpeg_stream = file;
	init_all();
	SOF0info.width = info->width;
	SOF0info.height = info->height;
	writeword(0xFFD8); // SOI
	write_APP0info();

	write_DQTinfo();
	write_SOF0info();
	write_DHTinfo();
	write_SOSinfo();

	bytenew = 0;
	bytepos = 7;
	main_encoder();
	// Do the bit alignment of the EOI marker
	if (bytepos >= 0)
	{
		fillbits.length = bytepos + 1;
		fillbits.value = (1 << (bytepos + 1)) - 1;
		writebits(fillbits);
	}
	writeword(0xFFD9); //EOI
	free(RGB_buffer);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x4506(%rip)      # 0x7140
movl 0x8(%rdx), %r12d
movl %r12d, 0x4503(%rip)     # 0x7148
movq %rdx, 0x10(%rsp)
movl 0xc(%rdx), %ebx
movl %ebx, 0x44f9(%rip)      # 0x714c
leal 0x7(%r12), %r15d
andl $-0x8, %r15d
leal 0x7(%rbx), %eax
andl $-0x8, %eax
movl %eax, 0x4(%rsp)
movl %eax, %edi
imull %r15d, %edi
movl $0x3, %esi
callq 0x10c0
movq %rax, 0x44d3(%rip)      # 0x7150
testq %rbx, %rbx
je 0x2cca
movq %rbx, %rcx
movq %rax, %r13
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
leal (%r12,%r12,2), %r12d
xorl %r14d, %r14d
xorl %ebx, %ebx
movl %r14d, %eax
leaq (%rax,%rax,2), %rdi
addq %r13, %rdi
movq 0x20(%rsp), %rax
movq (%rax,%rbx,8), %rsi
movq %r12, %rdx
movq %rcx, %rbp
callq 0x1100
movq %rbp, %rcx
incq %rbx
addl %r15d, %r14d
cmpq %rbx, %rbp
jne 0x2c9e
movl %r15d, 0x4477(%rip)     # 0x7148
movl 0x4(%rsp), %eax
movl %eax, 0x4471(%rip)      # 0x714c
movq 0x18(%rsp), %rax
movq %rax, 0x4471(%rip)      # 0x7158
movl $0x84ffdb, 0x4475(%rip) # imm = 0x84FFDB
movb $0x0, 0x4472(%rip)      # 0x716a
movb $0x1, 0x44ac(%rip)      # 0x71ab
xorl %eax, %eax
leaq 0x2518(%rip), %rcx      # 0x5220
movabsq $0x103070f1f1f3f, %rdx  # imm = 0x103070F1F1F3F
movl $0x1, %esi
leaq 0x2542(%rip), %r10      # 0x5260
leaq 0x4441(%rip), %r9       # 0x7166
movzbl (%rax,%rcx), %edi
imull $0x290, %edi, %edi      # imm = 0x290
addl $0x8020, %edi           # imm = 0x8020
shrl $0x10, %edi
btq %rax, %rdx
cmovbl %esi, %edi
movzbl (%rax,%r10), %r8d
movb %dil, 0x5(%r8,%r9)
incq %rax
cmpq $0x40, %rax
jne 0x2d25
xorl %eax, %eax
leaq 0x2545(%rip), %rcx      # 0x52a0
movl $0x103070f, %edx        # imm = 0x103070F
movl $0x1, %esi
movzbl (%rax,%rcx), %edi
imull $0x290, %edi, %edi      # imm = 0x290
addl $0x8020, %edi           # imm = 0x8020
shrl $0x10, %edi
btq %rax, %rdx
cmovbl %esi, %edi
movzbl (%rax,%r10), %r8d
movb %dil, 0x46(%r8,%r9)
incq %rax
cmpq $0x40, %rax
jne 0x2d65
movl $0x1a2ffc4, 0x4450(%rip) # imm = 0x1A2FFC4
movb $0x0, 0x444d(%rip)      # 0x71f0
movups 0x2537(%rip), %xmm0     # 0x52e1
movups %xmm0, 0x4440(%rip)     # 0x71f1
movabsq $0x706050403020100, %r14 # imm = 0x706050403020100
movq %r14, 0x443f(%rip)      # 0x7201
movl $0xb0a0908, %ebp        # imm = 0xB0A0908
movl %ebp, 0x443c(%rip)      # 0x7209
movb $0x10, 0x4439(%rip)     # 0x720d
movups 0x2526(%rip), %xmm0     # 0x5301
movups %xmm0, 0x442c(%rip)     # 0x720e
leaq 0x4435(%rip), %rdi      # 0x721e
leaq 0x2530(%rip), %r12      # 0x5320
movl $0xa2, %edx
movq %r12, %rsi
callq 0x1100
movb $0x1, 0x44bc(%rip)      # 0x72c0
movups 0x25c6(%rip), %xmm0     # 0x53d1
movups %xmm0, 0x44af(%rip)     # 0x72c1
movq %r14, 0x44b8(%rip)      # 0x72d1
movl %ebp, 0x44ba(%rip)      # 0x72d9
movb $0x11, 0x44b7(%rip)     # 0x72dd
movups 0x25c4(%rip), %xmm0     # 0x53f1
movups %xmm0, 0x44aa(%rip)     # 0x72de
leaq 0x44b3(%rip), %rdi      # 0x72ee
leaq 0x25ce(%rip), %r15      # 0x5410
movl $0xa2, %edx
movq %r15, %rsi
callq 0x1100
xorl %ecx, %ecx
movl $0x1, %edx
leaq 0x2483(%rip), %rsi      # 0x52e0
leaq 0x257d(%rip), %rax      # 0x53e1
leaq 0x4525(%rip), %rdi      # 0x7390
xorl %r8d, %r8d
leaq -0xa(%rdx), %r9
cmpq $-0x8, %r9
jb 0x2eac
movzbl (%rdx,%rsi), %r9d
cmpb $0x1, %r9b
adcl $0x0, %r9d
movslq %ecx, %rcx
movzbl %r9b, %r9d
leaq (%rax,%rcx), %r10
addl %r9d, %ecx
movzbl (%r10), %r11d
movw %r8w, 0x2(%rdi,%r11,4)
movb %dl, (%rdi,%r11,4)
incl %r8d
incq %r10
decl %r9d
jne 0x2e93
incq %rdx
addl %r8d, %r8d
cmpq $0x11, %rdx
jne 0x2e6e
xorl %ecx, %ecx
movl $0x1, %edx
leaq 0x250a(%rip), %rsi      # 0x53d0
leaq 0x44f3(%rip), %rdi      # 0x73c0
xorl %r8d, %r8d
leaq -0xc(%rdx), %r9
cmpq $-0xa, %r9
jb 0x2f0e
movzbl (%rdx,%rsi), %r9d
cmpb $0x1, %r9b
adcl $0x0, %r9d
movslq %ecx, %rcx
movzbl %r9b, %r9d
leaq (%rax,%rcx), %r10
addl %r9d, %ecx
movzbl (%r10), %r11d
movw %r8w, 0x2(%rdi,%r11,4)
movb %dl, (%rdi,%r11,4)
incl %r8d
incq %r10
decl %r9d
jne 0x2ef5
incq %rdx
addl %r8d, %r8d
cmpq $0x11, %rdx
jne 0x2ed0
xorl %eax, %eax
movl $0x1, %ecx
movl $0x6003, %edx           # imm = 0x6003
leaq 0x23d3(%rip), %rsi      # 0x5300
leaq 0x44bc(%rip), %rdi      # 0x73f0
xorl %r8d, %r8d
btq %rcx, %rdx
jb 0x2f70
movzbl (%rcx,%rsi), %r9d
cmpb $0x1, %r9b
adcl $0x0, %r9d
cltq
movzbl %r9b, %r9d
leaq (%r12,%rax), %r10
addl %r9d, %eax
movzbl (%r10), %r11d
movw %r8w, 0x2(%rdi,%r11,4)
movb %cl, (%rdi,%r11,4)
incl %r8d
incq %r10
decl %r9d
jne 0x2f57
incq %rcx
addl %r8d, %r8d
cmpq $0x11, %rcx
jne 0x2f37
xorl %eax, %eax
movl $0x1, %ecx
movl $0x2003, %edx           # imm = 0x2003
leaq 0x2461(%rip), %rsi      # 0x53f0
leaq 0x485a(%rip), %rdi      # 0x77f0
xorl %r8d, %r8d
btq %rcx, %rdx
jb 0x2fd2
movzbl (%rcx,%rsi), %r9d
cmpb $0x1, %r9b
adcl $0x0, %r9d
cltq
movzbl %r9b, %r9d
leaq (%r15,%rax), %r10
addl %r9d, %eax
movzbl (%r10), %r11d
movw %r8w, 0x2(%rdi,%r11,4)
movb %cl, (%rdi,%r11,4)
incl %r8d
incq %r10
decl %r9d
jne 0x2fb9
incq %rcx
addl %r8d, %r8d
cmpq $0x11, %rcx
jne 0x2f99
leaq 0xcc0a(%rip), %rax      # 0xfbef
movq %rax, 0x14c04(%rip)     # 0x17bf0
leaq 0x34c09(%rip), %rax     # 0x37bfc
movq %rax, 0x54c06(%rip)     # 0x57c00
movl $0x2, %r15d
movl $0x1, %ebp
leaq 0x14bf4(%rip), %r13     # 0x17c00
movl $0x1, %r12d
cmpl %r15d, %r12d
jae 0x305a
movl %r12d, %r14d
leaq 0x4bcf(%rip), %rax      # 0x7bf0
leaq (%r14,%rax), %rdi
addq $0x7fff, %rdi           # imm = 0x7FFF
movl %r12d, %edx
notl %edx
addl %r15d, %edx
incq %rdx
movl %ebp, %esi
callq 0x1090
movl %r15d, %eax
movb %bpl, 0x1fffc(%r13,%r14,4)
movw %r14w, 0x1fffe(%r13,%r14,4)
incq %r14
cmpq %r14, %rax
jne 0x3041
movl $0x1, %eax
subl %r15d, %eax
movl %r12d, %r14d
negl %r14d
cmpl %r14d, %eax
jg 0x30bd
movl %r15d, %eax
negl %eax
movslq %eax, %rbx
leaq 0x4b74(%rip), %rax      # 0x7bf0
leaq (%rbx,%rax), %rdi
addq $0x8000, %rdi           # imm = 0x8000
movl %r12d, %edx
notl %edx
addl %r15d, %edx
incq %rdx
movl %ebp, %esi
callq 0x1090
movslq %r14d, %rax
subq %rbx, %rax
leaq 0x20002(,%rbx,4), %rcx
addq %r13, %rcx
xorl %edx, %edx
movb %bpl, -0x2(%rcx,%rdx,4)
movw %dx, (%rcx,%rdx,4)
incq %rdx
cmpq %rdx, %rax
jne 0x30ac
addl %r12d, %r12d
addl %r15d, %r15d
incl %ebp
cmpl $0x10, %ebp
jne 0x3012
movq $-0x400, %rax           # imm = 0xFC00
xorl %ecx, %ecx
movsd 0x20d1(%rip), %xmm0     # 0x51b0
leaq 0x54b2a(%rip), %rbp     # 0x57c10
movsd 0x20ca(%rip), %xmm1     # 0x51b8
leaq 0x54f1b(%rip), %rdi     # 0x58010
leaq 0x55314(%rip), %r8      # 0x58410
movsd 0x20bc(%rip), %xmm2     # 0x51c0
leaq 0x55705(%rip), %r12     # 0x58810
movsd 0x20b5(%rip), %xmm3     # 0x51c8
leaq 0x55af6(%rip), %r9      # 0x58c10
movsd 0x20ae(%rip), %xmm4     # 0x51d0
leaq 0x55ee7(%rip), %r10     # 0x59010
movsd 0x20a7(%rip), %xmm5     # 0x51d8
leaq 0x562d8(%rip), %r11     # 0x59410
leaq 0x566d1(%rip), %rbx     # 0x59810
movsd 0x2099(%rip), %xmm6     # 0x51e0
leaq 0x56ac2(%rip), %r14     # 0x59c10
xorl %edx, %edx
xorps %xmm7, %xmm7
cvtsi2sd %ecx, %xmm7
movapd %xmm7, %xmm8
mulsd %xmm0, %xmm8
cvttsd2si %xmm8, %esi
movl %esi, 0x400(%rax,%rbp)
movapd %xmm7, %xmm8
mulsd %xmm1, %xmm8
cvttsd2si %xmm8, %esi
movl %esi, 0x400(%rax,%rdi)
movapd %xmm7, %xmm8
mulsd %xmm2, %xmm8
cvttsd2si %xmm8, %esi
movl %esi, 0x400(%rax,%r12)
movapd %xmm7, %xmm8
mulsd %xmm3, %xmm8
cvttsd2si %xmm8, %esi
movl %edx, 0x400(%rax,%r8)
movl %esi, 0x400(%rax,%r9)
movapd %xmm7, %xmm8
mulsd %xmm4, %xmm8
cvttsd2si %xmm8, %esi
movl %esi, 0x400(%rax,%r10)
movapd %xmm7, %xmm8
mulsd %xmm5, %xmm8
cvttsd2si %xmm8, %esi
movl %esi, 0x400(%rax,%r11)
movl %edx, 0x400(%rax,%rbx)
mulsd %xmm6, %xmm7
cvttsd2si %xmm7, %esi
movl %esi, 0x400(%rax,%r14)
addl $0x8000, %edx           # imm = 0x8000
incl %ecx
addq $0x4, %rax
jne 0x3150
xorl %eax, %eax
leaq 0x22a7(%rip), %rcx      # 0x54c0
movsd 0x1fc7(%rip), %xmm0     # 0x51e8
movsd 0x1e07(%rip), %xmm1     # 0x5030
leaq 0x56de0(%rip), %rdx     # 0x5a010
leaq 0x56fd9(%rip), %rsi     # 0x5a210
xorl %edi, %edi
leaq 0x3f26(%rip), %rbx      # 0x7166
leaq 0x2019(%rip), %r14      # 0x5260
movsd (%rcx,%rax,8), %xmm2
movslq %edi, %rdi
leaq (,%rdi,8), %r8
xorl %r9d, %r9d
movzbl (%rdi,%r14), %r10d
movzbl 0x5(%r10,%rbx), %r11d
xorps %xmm3, %xmm3
cvtsi2sd %r11d, %xmm3
mulsd %xmm2, %xmm3
movsd (%r9,%rcx), %xmm4
movzbl 0x46(%r10,%rbx), %r10d
mulsd %xmm4, %xmm3
xorps %xmm5, %xmm5
cvtsi2sd %r10d, %xmm5
mulsd %xmm2, %xmm5
mulsd %xmm0, %xmm3
mulsd %xmm4, %xmm5
movapd %xmm1, %xmm4
leaq (%r8,%r9), %r10
divsd %xmm3, %xmm4
mulsd %xmm0, %xmm5
movapd %xmm1, %xmm3
divsd %xmm5, %xmm3
movsd %xmm4, (%rdx,%r10)
movsd %xmm3, (%rsi,%r10)
incq %rdi
addq $0x8, %r9
cmpq $0x40, %r9
jne 0x325a
incq %rax
cmpq $0x8, %rax
jne 0x3247
movq 0x10(%rsp), %rcx
movzwl 0x8(%rcx), %eax
movw %ax, 0x3e7f(%rip)       # 0x7162
movzwl 0xc(%rcx), %eax
movw %ax, 0x3e72(%rip)       # 0x7160
movl $0xff, %edi
movq 0x18(%rsp), %rsi
callq 0x10b0
movq 0x3e54(%rip), %rsi      # 0x7158
movl $0xd8, %edi
callq 0x10b0
movzbl 0x3da0(%rip), %edi      # 0x70b5
movq 0x3e3c(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x3d8c(%rip), %edi      # 0x70b4
movq 0x3e29(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x3d7c(%rip), %edi      # 0x70b7
movq 0x3e16(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x3d68(%rip), %edi      # 0x70b6
movq 0x3e03(%rip), %rsi      # 0x7158
callq 0x10b0
movq 0x3df7(%rip), %rsi      # 0x7158
leaq 0x3d50(%rip), %rdi      # 0x70b8
callq 0x1080
movq 0x3de4(%rip), %rsi      # 0x7158
xorl %r14d, %r14d
xorl %edi, %edi
callq 0x10b0
movzbl 0x3d38(%rip), %edi      # 0x70bd
movq 0x3dcc(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x3d26(%rip), %edi      # 0x70be
movq 0x3db9(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x3d14(%rip), %edi      # 0x70bf
movq 0x3da6(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x3d03(%rip), %edi      # 0x70c1
movq 0x3d93(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x3cef(%rip), %edi      # 0x70c0
movq 0x3d80(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x3cdf(%rip), %edi      # 0x70c3
movq 0x3d6d(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x3ccb(%rip), %edi      # 0x70c2
movq 0x3d5a(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x3cba(%rip), %edi      # 0x70c4
movq 0x3d47(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x3ca8(%rip), %edi      # 0x70c5
movq 0x3d34(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x3d37(%rip), %edi      # 0x7167
movq 0x3d21(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x3d23(%rip), %edi      # 0x7166
movq 0x3d0e(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x3d13(%rip), %edi      # 0x7169
movq 0x3cfb(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x3cff(%rip), %edi      # 0x7168
movq 0x3ce8(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x3cee(%rip), %edi      # 0x716a
movq 0x3cd5(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x5(%r14,%rbx), %edi
movq 0x3cc3(%rip), %rsi      # 0x7158
callq 0x10b0
incq %r14
cmpq $0x40, %r14
jne 0x3488
movzbl 0x3d01(%rip), %edi      # 0x71ab
movq 0x3ca7(%rip), %rsi      # 0x7158
callq 0x10b0
xorl %r14d, %r14d
movzbl 0x46(%r14,%rbx), %edi
movq 0x3c92(%rip), %rsi      # 0x7158
callq 0x10b0
incq %r14
cmpq $0x40, %r14
jne 0x34b9
movq 0x3c7d(%rip), %rsi      # 0x7158
movl $0xff, %edi
callq 0x10b0
movq 0x3c6c(%rip), %rsi      # 0x7158
movl $0xc0, %edi
callq 0x10b0
movq 0x3c5b(%rip), %rsi      # 0x7158
xorl %r14d, %r14d
xorl %edi, %edi
callq 0x10b0
movq 0x3c4a(%rip), %rsi      # 0x7158
movl $0x11, %edi
callq 0x10b0
movq 0x3c39(%rip), %rsi      # 0x7158
movl $0x8, %edi
callq 0x10b0
movzbl 0x3c31(%rip), %edi      # 0x7161
movq 0x3c21(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x3c1d(%rip), %edi      # 0x7160
movq 0x3c0e(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x3c0d(%rip), %edi      # 0x7163
movq 0x3bfb(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x3bf9(%rip), %edi      # 0x7162
movq 0x3be8(%rip), %rsi      # 0x7158
callq 0x10b0
movq 0x3bdc(%rip), %rsi      # 0x7158
movl $0x3, %edi
callq 0x10b0
movq 0x3bcb(%rip), %rsi      # 0x7158
movl $0x1, %edi
callq 0x10b0
movq 0x3bba(%rip), %rsi      # 0x7158
movl $0x11, %edi
callq 0x10b0
movq 0x3ba9(%rip), %rsi      # 0x7158
xorl %edi, %edi
callq 0x10b0
movq 0x3b9b(%rip), %rsi      # 0x7158
movl $0x2, %edi
callq 0x10b0
movq 0x3b8a(%rip), %rsi      # 0x7158
movl $0x11, %edi
callq 0x10b0
movq 0x3b79(%rip), %rsi      # 0x7158
movl $0x1, %edi
callq 0x10b0
movq 0x3b68(%rip), %rsi      # 0x7158
movl $0x3, %edi
callq 0x10b0
movq 0x3b57(%rip), %rsi      # 0x7158
movl $0x11, %edi
callq 0x10b0
movq 0x3b46(%rip), %rsi      # 0x7158
movl $0x1, %edi
callq 0x10b0
movzbl 0x3bca(%rip), %edi      # 0x71ed
movq 0x3b2e(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x3bb6(%rip), %edi      # 0x71ec
movq 0x3b1b(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x3ba6(%rip), %edi      # 0x71ef
movq 0x3b08(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x3b92(%rip), %edi      # 0x71ee
movq 0x3af5(%rip), %rsi      # 0x7158
callq 0x10b0
movzbl 0x3b81(%rip), %edi      # 0x71f0
movq 0x3ae2(%rip), %rsi      # 0x7158
callq 0x10b0
leaq 0x3b6a(%rip), %rbx      # 0x71ec
movzbl 0x5(%r14,%rbx), %edi
movq 0x3ac9(%rip), %rsi      # 0x7158
callq 0x10b0
incq %r14
cmpq $0x10, %r14
jne 0x3682
movq $-0xc, %r14
movzbl 0x21(%r14,%rbx), %edi
movq 0x3aa7(%rip), %rsi      # 0x7158
callq 0x10b0
incq %r14
jne 0x36a4
movzbl 0x3b4b(%rip), %edi      # 0x720d
movq 0x3a8f(%rip), %rsi      # 0x7158
callq 0x10b0
xorl %r14d, %r14d
movzbl 0x22(%r14,%rbx), %edi
movq 0x3a7a(%rip), %rsi      # 0x7158
callq 0x10b0
incq %r14
cmpq $0x10, %r14
jne 0x36d1
movl $0x32, %r14d
movzbl (%r14,%rbx), %edi
movq 0x3a5a(%rip), %rsi      # 0x7158
callq 0x10b0
incq %r14
cmpq $0xd4, %r14
jne 0x36f2
movzbl 0x3baa(%rip), %edi      # 0x72c0
movq 0x3a3b(%rip), %rsi      # 0x7158
callq 0x10b0
xorl %r14d, %r14d
movzbl 0xd5(%r14,%rbx), %edi
movq 0x3a23(%rip), %rsi      # 0x7158
callq 0x10b0
incq %r14
cmpq $0x10, %r14
jne 0x3725
movq $-0xc, %r14
movzbl 0xf1(%r14,%rbx), %edi
movq 0x39fe(%rip), %rsi      # 0x7158
callq 0x10b0
incq %r14
jne 0x374a
movzbl 0x3b72(%rip), %edi      # 0x72dd
movq 0x39e6(%rip), %rsi      # 0x7158
callq 0x10b0
xorl %r14d, %r14d
movzbl 0xf2(%r14,%rbx), %edi
movq 0x39ce(%rip), %rsi      # 0x7158
callq 0x10b0
incq %r14
cmpq $0x10, %r14
jne 0x377a
movq $-0xa2, %r14
movzbl 0x1a4(%r14,%rbx), %edi
movq 0x39a9(%rip), %rsi      # 0x7158
callq 0x10b0
incq %r14
jne 0x379f
movq 0x3998(%rip), %rsi      # 0x7158
movl $0xff, %edi
callq 0x10b0
movq 0x3987(%rip), %rsi      # 0x7158
movl $0xda, %edi
callq 0x10b0
movq 0x3976(%rip), %rsi      # 0x7158
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x10b0
movq 0x3966(%rip), %rsi      # 0x7158
movl $0xc, %edi
callq 0x10b0
movq 0x3955(%rip), %rsi      # 0x7158
movl $0x3, %edi
callq 0x10b0
movq 0x3944(%rip), %rsi      # 0x7158
movl $0x1, %edi
callq 0x10b0
movq 0x3933(%rip), %rsi      # 0x7158
xorl %edi, %edi
callq 0x10b0
movq 0x3925(%rip), %rsi      # 0x7158
movl $0x2, %edi
callq 0x10b0
movq 0x3914(%rip), %rsi      # 0x7158
movl $0x11, %edi
callq 0x10b0
movq 0x3903(%rip), %rsi      # 0x7158
movl $0x3, %edi
callq 0x10b0
movq 0x38f2(%rip), %rsi      # 0x7158
movl $0x11, %edi
callq 0x10b0
movq 0x38e1(%rip), %rsi      # 0x7158
xorl %edi, %edi
callq 0x10b0
movq 0x38d3(%rip), %rsi      # 0x7158
movl $0x3f, %edi
callq 0x10b0
movq 0x38c2(%rip), %rsi      # 0x7158
xorl %edi, %edi
callq 0x10b0
movb $0x0, 0x38c0(%rip)      # 0x7164
movb $0x7, 0x3807(%rip)      # 0x70b2
movw %bx, 0xe(%rsp)
movw %bx, 0xc(%rsp)
movl $0x0, (%rsp)
movw %bx, 0xa(%rsp)
cmpl $0x0, 0x3884(%rip)      # 0x714c
je 0x3a91
leaq 0x56b3b(%rip), %r11     # 0x5a410
leaq 0x56bb4(%rip), %r14     # 0x5a490
movl 0x3866(%rip), %ecx      # 0x7148
testl %ecx, %ecx
je 0x3a7c
xorl %eax, %eax
movl %ecx, %r9d
imull (%rsp), %r9d
movl %eax, 0x4(%rsp)
addl %eax, %r9d
movq 0x384e(%rip), %rdx      # 0x7150
xorl %esi, %esi
xorl %eax, %eax
movl %ecx, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movl $0x8, %r8d
movl %r9d, 0x20(%rsp)
leaq 0x56b30(%rip), %rdi     # 0x5a450
movl %r9d, %eax
leaq (%rax,%rax,2), %r10
movq %r11, %rbx
movzbl (%rdx,%r10), %r11d
movzbl 0x1(%rdx,%r10), %r13d
shll $0x2, %r11d
shll $0x2, %r13d
movl (%r13,%r12), %eax
addl (%r11,%rbp), %eax
movq %r14, %r15
movq %r12, %r14
movq %rbp, %r12
leaq 0x552ba(%rip), %rcx     # 0x58c10
movl (%r13,%rcx), %ebp
leaq 0x546ae(%rip), %rcx     # 0x58010
addl (%r11,%rcx), %ebp
leaq 0x556a3(%rip), %rcx     # 0x59010
movl (%r13,%rcx), %r13d
leaq 0x54a97(%rip), %rcx     # 0x58410
addl (%r11,%rcx), %r13d
movq %rbx, %r11
movzbl 0x2(%rdx,%r10), %r10d
shll $0x2, %r10d
leaq 0x55a7f(%rip), %rcx     # 0x59410
addl (%r10,%rcx), %eax
shrl $0x10, %eax
addb $-0x80, %al
movzbl %sil, %esi
movb %al, (%rsi,%rbx)
leaq 0x55e68(%rip), %rax     # 0x59810
addl (%r10,%rax), %ebp
shrl $0x10, %ebp
movb %bpl, (%rsi,%rdi)
movq %r12, %rbp
movq %r14, %r12
movq %r15, %r14
leaq 0x5624d(%rip), %rax     # 0x59c10
addl (%r10,%rax), %r13d
shrl $0x10, %r13d
movb %r13b, (%rsi,%r15)
incl %r9d
incb %sil
decl %r8d
jne 0x3920
movl 0x10(%rsp), %ecx
movl 0x20(%rsp), %r9d
addl %ecx, %r9d
subl %r8d, %r9d
movl 0x18(%rsp), %eax
incl %eax
cmpl $0x8, %eax
jne 0x390a
movq %r11, %rdi
leaq 0x5660a(%rip), %rsi     # 0x5a010
leaq 0xe(%rsp), %rdx
leaq 0x397e(%rip), %rcx      # 0x7390
leaq 0x39d7(%rip), %r8       # 0x73f0
callq 0x3b80
leaq 0x56a2b(%rip), %rdi     # 0x5a450
leaq 0x567e4(%rip), %r15     # 0x5a210
movq %r15, %rsi
leaq 0xc(%rsp), %rdx
leaq 0x3985(%rip), %r13      # 0x73c0
movq %r13, %rcx
leaq 0x3dab(%rip), %r8       # 0x77f0
callq 0x3b80
movq %r14, %rdi
movq %r15, %rsi
leaq 0xa(%rsp), %rdx
movq %r13, %rcx
leaq 0x3d91(%rip), %r8       # 0x77f0
callq 0x3b80
movq %rbx, %r11
movl 0x4(%rsp), %eax
addl $0x8, %eax
movl 0x36d4(%rip), %ecx      # 0x7148
cmpl %ecx, %eax
jb 0x38ec
movl (%rsp), %eax
addl $0x8, %eax
movl %eax, (%rsp)
cmpl 0x36c1(%rip), %eax      # 0x714c
jb 0x38dc
movsbl 0x361a(%rip), %ecx      # 0x70b2
testl %ecx, %ecx
js 0x3ab4
movl $0x20000, %eax          # imm = 0x20000
shll %cl, %eax
movzbl %cl, %ecx
leal (%rax,%rcx), %edi
addl $0xffff0001, %edi       # imm = 0xFFFF0001
callq 0x3af0
movq 0x369d(%rip), %rsi      # 0x7158
movl $0xff, %edi
callq 0x10b0
movq 0x368c(%rip), %rsi      # 0x7158
movl $0xd9, %edi
callq 0x10b0
movq 0x3673(%rip), %rdi      # 0x7150
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1040