// File: srajangarg[P]raytracer/src/core/stb_image_write.hpp
// Function: stbi_write_png_to_mem(unsigned char*, int, int, int, int, int*)
unsigned char *stbi_write_png_to_mem(unsigned char *pixels, int stride_bytes, int x, int y, int n, int *out_len)
{
   int ctype[5] = { -1, 0, 4, 2, 6 };
   unsigned char sig[8] = { 137,80,78,71,13,10,26,10 };
   unsigned char *out,*o, *filt, *zlib;
   signed char *line_buffer;
   int i,j,k,p,zlen;

   if (stride_bytes == 0)
      stride_bytes = x * n;

   filt = (unsigned char *) STBIW_MALLOC((x*n+1) * y); if (!filt) return 0;
   line_buffer = (signed char *) STBIW_MALLOC(x * n); if (!line_buffer) { STBIW_FREE(filt); return 0; }
   for (j=0; j < y; ++j) {
      static int mapping[] = { 0,1,2,3,4 };
      static int firstmap[] = { 0,1,0,5,6 };
      int *mymap = j ? mapping : firstmap;
      int best = 0, bestval = 0x7fffffff;
      for (p=0; p < 2; ++p) {
         for (k= p?best:0; k < 5; ++k) {
            int type = mymap[k],est=0;
            unsigned char *z = pixels + stride_bytes*j;
            for (i=0; i < n; ++i)
               switch (type) {
                  case 0: line_buffer[i] = z[i]; break;
                  case 1: line_buffer[i] = z[i]; break;
                  case 2: line_buffer[i] = z[i] - z[i-stride_bytes]; break;
                  case 3: line_buffer[i] = z[i] - (z[i-stride_bytes]>>1); break;
                  case 4: line_buffer[i] = (signed char) (z[i] - stbiw__paeth(0,z[i-stride_bytes],0)); break;
                  case 5: line_buffer[i] = z[i]; break;
                  case 6: line_buffer[i] = z[i]; break;
               }
            for (i=n; i < x*n; ++i) {
               switch (type) {
                  case 0: line_buffer[i] = z[i]; break;
                  case 1: line_buffer[i] = z[i] - z[i-n]; break;
                  case 2: line_buffer[i] = z[i] - z[i-stride_bytes]; break;
                  case 3: line_buffer[i] = z[i] - ((z[i-n] + z[i-stride_bytes])>>1); break;
                  case 4: line_buffer[i] = z[i] - stbiw__paeth(z[i-n], z[i-stride_bytes], z[i-stride_bytes-n]); break;
                  case 5: line_buffer[i] = z[i] - (z[i-n]>>1); break;
                  case 6: line_buffer[i] = z[i] - stbiw__paeth(z[i-n], 0,0); break;
               }
            }
            if (p) break;
            for (i=0; i < x*n; ++i)
               est += abs((signed char) line_buffer[i]);
            if (est < bestval) { bestval = est; best = k; }
         }
      }
      // when we get here, best contains the filter type, and line_buffer contains the data
      filt[j*(x*n+1)] = (unsigned char) best;
      STBIW_MEMMOVE(filt+j*(x*n+1)+1, line_buffer, x*n);
   }
   STBIW_FREE(line_buffer);
   zlib = stbi_zlib_compress(filt, y*( x*n+1), &zlen, 8); // increase 8 to get smaller but use more memory
   STBIW_FREE(filt);
   if (!zlib) return 0;

   // each tag requires 12 bytes of overhead
   out = (unsigned char *) STBIW_MALLOC(8 + 12+13 + 12+zlen + 12);
   if (!out) return 0;
   *out_len = 8 + 12+13 + 12+zlen + 12;

   o=out;
   STBIW_MEMMOVE(o,sig,8); o+= 8;
   stbiw__wp32(o, 13); // header length
   stbiw__wptag(o, "IHDR");
   stbiw__wp32(o, x);
   stbiw__wp32(o, y);
   *o++ = 8;
   *o++ = STBIW_UCHAR(ctype[n]);
   *o++ = 0;
   *o++ = 0;
   *o++ = 0;
   stbiw__wpcrc(&o,13);

   stbiw__wp32(o, zlen);
   stbiw__wptag(o, "IDAT");
   STBIW_MEMMOVE(o, zlib, zlen);
   o += zlen;
   STBIW_FREE(zlib);
   stbiw__wpcrc(&o, zlen);

   stbiw__wp32(o,0);
   stbiw__wptag(o, "IEND");
   stbiw__wpcrc(&o,0);

   STBIW_ASSERT(o == out + *out_len);

   return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movq 0xf209(%rip), %rax      # 0x48910
movq %rax, -0x40(%rbp)
movq 0xf206(%rip), %rax      # 0x48918
movq %rax, -0x38(%rbp)
movl 0xf204(%rip), %eax      # 0x48920
movl %eax, -0x30(%rbp)
movq 0xf463(%rip), %rax      # 0x48b89
movq %rax, -0x48(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x3973a
movl -0x18(%rbp), %eax
imull -0x20(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x18(%rbp), %eax
imull -0x20(%rbp), %eax
addl $0x1, %eax
imull -0x1c(%rbp), %eax
movslq %eax, %rdi
callq 0x5550
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x39768
movq $0x0, -0x8(%rbp)
jmp 0x3a136
movl -0x18(%rbp), %eax
imull -0x20(%rbp), %eax
movslq %eax, %rdi
callq 0x5550
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x70(%rbp)
jne 0x39798
movq -0x60(%rbp), %rdi
callq 0x54c0
movq $0x0, -0x8(%rbp)
jmp 0x3a136
movl $0x0, -0x78(%rbp)
movl -0x78(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x39cff
cmpl $0x0, -0x78(%rbp)
je 0x397c1
leaq 0x23058(%rip), %rax     # 0x5c810
movq %rax, -0xb0(%rbp)
jmp 0x397d1
leaq 0x23068(%rip), %rax     # 0x5c830
movq %rax, -0xb0(%rbp)
jmp 0x397d1
movq -0xb0(%rbp), %rax
movq %rax, -0x90(%rbp)
movl $0x0, -0x94(%rbp)
movl $0x7fffffff, -0x98(%rbp) # imm = 0x7FFFFFFF
movl $0x0, -0x80(%rbp)
cmpl $0x2, -0x80(%rbp)
jge 0x39c9f
cmpl $0x0, -0x80(%rbp)
je 0x39818
movl -0x94(%rbp), %eax
movl %eax, -0xb4(%rbp)
jmp 0x39822
xorl %eax, %eax
movl %eax, -0xb4(%rbp)
jmp 0x39822
movl -0xb4(%rbp), %eax
movl %eax, -0x7c(%rbp)
cmpl $0x5, -0x7c(%rbp)
jge 0x39c8f
movq -0x90(%rbp), %rax
movslq -0x7c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x9c(%rbp)
movl $0x0, -0xa0(%rbp)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
imull -0x78(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0xa8(%rbp)
movl $0x0, -0x74(%rbp)
movl -0x74(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x399ea
movl -0x9c(%rbp), %eax
movq %rax, -0xc0(%rbp)
subq $0x6, %rax
ja 0x399da
movq -0xc0(%rbp), %rax
leaq 0xefe9(%rip), %rcx      # 0x4888c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0xa8(%rbp), %rax
movslq -0x74(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x70(%rbp), %rax
movslq -0x74(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x399da
movq -0xa8(%rbp), %rax
movslq -0x74(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x70(%rbp), %rax
movslq -0x74(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x399da
movq -0xa8(%rbp), %rax
movslq -0x74(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movq -0xa8(%rbp), %rcx
movl -0x74(%rbp), %edx
subl -0x14(%rbp), %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
subl %ecx, %eax
movb %al, %dl
movq -0x70(%rbp), %rax
movslq -0x74(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x399da
movq -0xa8(%rbp), %rax
movslq -0x74(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movq -0xa8(%rbp), %rcx
movl -0x74(%rbp), %edx
subl -0x14(%rbp), %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
sarl %ecx
subl %ecx, %eax
movb %al, %dl
movq -0x70(%rbp), %rax
movslq -0x74(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x399da
movq -0xa8(%rbp), %rax
movslq -0x74(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0xc4(%rbp)
movq -0xa8(%rbp), %rax
movl -0x74(%rbp), %ecx
subl -0x14(%rbp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %esi
xorl %edx, %edx
movl %edx, %edi
callq 0x3a150
movb %al, %cl
movl -0xc4(%rbp), %eax
movzbl %cl, %ecx
subl %ecx, %eax
movb %al, %dl
movq -0x70(%rbp), %rax
movslq -0x74(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x399da
movq -0xa8(%rbp), %rax
movslq -0x74(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x70(%rbp), %rax
movslq -0x74(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x399da
movq -0xa8(%rbp), %rax
movslq -0x74(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x70(%rbp), %rax
movslq -0x74(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x399dc
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x39872
movl -0x20(%rbp), %eax
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %eax
movl -0x18(%rbp), %ecx
imull -0x20(%rbp), %ecx
cmpl %ecx, %eax
jge 0x39c15
movl -0x9c(%rbp), %eax
movq %rax, -0xd0(%rbp)
subq $0x6, %rax
ja 0x39c05
movq -0xd0(%rbp), %rax
leaq 0xee49(%rip), %rcx      # 0x48870
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0xa8(%rbp), %rax
movslq -0x74(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x70(%rbp), %rax
movslq -0x74(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x39c05
movq -0xa8(%rbp), %rax
movslq -0x74(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movq -0xa8(%rbp), %rcx
movl -0x74(%rbp), %edx
subl -0x20(%rbp), %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
subl %ecx, %eax
movb %al, %dl
movq -0x70(%rbp), %rax
movslq -0x74(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x39c05
movq -0xa8(%rbp), %rax
movslq -0x74(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movq -0xa8(%rbp), %rcx
movl -0x74(%rbp), %edx
subl -0x14(%rbp), %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
subl %ecx, %eax
movb %al, %dl
movq -0x70(%rbp), %rax
movslq -0x74(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x39c05
movq -0xa8(%rbp), %rax
movslq -0x74(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movq -0xa8(%rbp), %rcx
movl -0x74(%rbp), %edx
subl -0x20(%rbp), %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
movq -0xa8(%rbp), %rdx
movl -0x74(%rbp), %esi
subl -0x14(%rbp), %esi
movslq %esi, %rsi
movzbl (%rdx,%rsi), %edx
addl %edx, %ecx
sarl %ecx
subl %ecx, %eax
movb %al, %dl
movq -0x70(%rbp), %rax
movslq -0x74(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x39c05
movq -0xa8(%rbp), %rax
movslq -0x74(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0xd4(%rbp)
movq -0xa8(%rbp), %rax
movl -0x74(%rbp), %ecx
subl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edi
movq -0xa8(%rbp), %rax
movl -0x74(%rbp), %ecx
subl -0x14(%rbp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %esi
movq -0xa8(%rbp), %rax
movl -0x74(%rbp), %ecx
subl -0x14(%rbp), %ecx
subl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
callq 0x3a150
movb %al, %cl
movl -0xd4(%rbp), %eax
movzbl %cl, %ecx
subl %ecx, %eax
movb %al, %dl
movq -0x70(%rbp), %rax
movslq -0x74(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x39c05
movq -0xa8(%rbp), %rax
movslq -0x74(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movq -0xa8(%rbp), %rcx
movl -0x74(%rbp), %edx
subl -0x20(%rbp), %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
sarl %ecx
subl %ecx, %eax
movb %al, %dl
movq -0x70(%rbp), %rax
movslq -0x74(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x39c05
movq -0xa8(%rbp), %rax
movslq -0x74(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0xd8(%rbp)
movq -0xa8(%rbp), %rax
movl -0x74(%rbp), %ecx
subl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edi
xorl %edx, %edx
movl %edx, %esi
callq 0x3a150
movb %al, %cl
movl -0xd8(%rbp), %eax
movzbl %cl, %ecx
subl %ecx, %eax
movb %al, %dl
movq -0x70(%rbp), %rax
movslq -0x74(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x39c07
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x399f0
cmpl $0x0, -0x80(%rbp)
je 0x39c1d
jmp 0x39c8f
movl $0x0, -0x74(%rbp)
movl -0x74(%rbp), %eax
movl -0x18(%rbp), %ecx
imull -0x20(%rbp), %ecx
cmpl %ecx, %eax
jge 0x39c5c
movq -0x70(%rbp), %rax
movslq -0x74(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
addl -0xa0(%rbp), %eax
movl %eax, -0xa0(%rbp)
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x39c24
movl -0xa0(%rbp), %eax
cmpl -0x98(%rbp), %eax
jge 0x39c7f
movl -0xa0(%rbp), %eax
movl %eax, -0x98(%rbp)
movl -0x7c(%rbp), %eax
movl %eax, -0x94(%rbp)
jmp 0x39c81
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x3982b
jmp 0x39c91
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x397fa
movl -0x94(%rbp), %eax
movb %al, %dl
movq -0x60(%rbp), %rax
movl -0x78(%rbp), %ecx
movl -0x18(%rbp), %esi
imull -0x20(%rbp), %esi
addl $0x1, %esi
imull %esi, %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x60(%rbp), %rdi
movl -0x78(%rbp), %eax
movl -0x18(%rbp), %ecx
imull -0x20(%rbp), %ecx
addl $0x1, %ecx
imull %ecx, %eax
cltq
addq %rax, %rdi
addq $0x1, %rdi
movq -0x70(%rbp), %rsi
movl -0x18(%rbp), %eax
imull -0x20(%rbp), %eax
movslq %eax, %rdx
callq 0x5650
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x3979f
movq -0x70(%rbp), %rdi
callq 0x54c0
movq -0x60(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x18(%rbp), %eax
imull -0x20(%rbp), %eax
addl $0x1, %eax
imull %eax, %esi
leaq -0x84(%rbp), %rdx
movl $0x8, %ecx
callq 0x38790
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rdi
callq 0x54c0
cmpq $0x0, -0x68(%rbp)
jne 0x39d4e
movq $0x0, -0x8(%rbp)
jmp 0x3a136
movl -0x84(%rbp), %eax
addl $0x2d, %eax
addl $0xc, %eax
movslq %eax, %rdi
callq 0x5550
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x39d7a
movq $0x0, -0x8(%rbp)
jmp 0x3a136
movl -0x84(%rbp), %ecx
addl $0x2d, %ecx
addl $0xc, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
leaq -0x48(%rbp), %rcx
movq (%rcx), %rcx
movq %rcx, (%rax)
movq -0x58(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movb $0x0, (%rax)
movq -0x58(%rbp), %rax
movb $0x0, 0x1(%rax)
movq -0x58(%rbp), %rax
movb $0x0, 0x2(%rax)
movq -0x58(%rbp), %rax
movb $0xd, 0x3(%rax)
movq -0x58(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x58(%rbp)
movsbl 0xe3bc(%rip), %eax      # 0x4819c
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, (%rax)
movsbl 0xe3a9(%rip), %eax      # 0x4819d
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, 0x1(%rax)
movsbl 0xe395(%rip), %eax      # 0x4819e
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, 0x2(%rax)
movsbl 0xe381(%rip), %eax      # 0x4819f
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0x58(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x58(%rbp)
movl -0x18(%rbp), %eax
sarl $0x18, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, (%rax)
movl -0x18(%rbp), %eax
sarl $0x10, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, 0x1(%rax)
movl -0x18(%rbp), %eax
sarl $0x8, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, 0x2(%rax)
movl -0x18(%rbp), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0x58(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x58(%rbp)
movl -0x1c(%rbp), %eax
sarl $0x18, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, (%rax)
movl -0x1c(%rbp), %eax
sarl $0x10, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, 0x1(%rax)
movl -0x1c(%rbp), %eax
sarl $0x8, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, 0x2(%rax)
movl -0x1c(%rbp), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0x58(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x58(%rbp)
movb $0x8, (%rax)
movslq -0x20(%rbp), %rax
movl -0x40(%rbp,%rax,4), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x58(%rbp)
movb %cl, (%rax)
movq -0x58(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x58(%rbp)
movb $0x0, (%rax)
movq -0x58(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x58(%rbp)
movb $0x0, (%rax)
movq -0x58(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x58(%rbp)
movb $0x0, (%rax)
leaq -0x58(%rbp), %rdi
movl $0xd, %esi
callq 0x3a1e0
movl -0x84(%rbp), %eax
sarl $0x18, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, (%rax)
movl -0x84(%rbp), %eax
sarl $0x10, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, 0x1(%rax)
movl -0x84(%rbp), %eax
sarl $0x8, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, 0x2(%rax)
movl -0x84(%rbp), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0x58(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x58(%rbp)
movsbl 0xe2b4(%rip), %eax      # 0x4827d
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, (%rax)
movsbl 0xe2a1(%rip), %eax      # 0x4827e
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, 0x1(%rax)
movsbl 0xe28d(%rip), %eax      # 0x4827f
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, 0x2(%rax)
movsbl 0xe279(%rip), %eax      # 0x48280
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0x58(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
movq -0x68(%rbp), %rsi
movslq -0x84(%rbp), %rdx
callq 0x5650
movl -0x84(%rbp), %ecx
movq -0x58(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x68(%rbp), %rdi
callq 0x54c0
movl -0x84(%rbp), %esi
leaq -0x58(%rbp), %rdi
callq 0x3a1e0
movq -0x58(%rbp), %rax
movb $0x0, (%rax)
movq -0x58(%rbp), %rax
movb $0x0, 0x1(%rax)
movq -0x58(%rbp), %rax
movb $0x0, 0x2(%rax)
movq -0x58(%rbp), %rax
movb $0x0, 0x3(%rax)
movq -0x58(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x58(%rbp)
movsbl 0xe9be(%rip), %eax      # 0x48a51
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, (%rax)
movsbl 0xe9ab(%rip), %eax      # 0x48a52
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, 0x1(%rax)
movsbl 0xe997(%rip), %eax      # 0x48a53
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, 0x2(%rax)
movsbl 0xe983(%rip), %eax      # 0x48a54
andl $0xff, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0x58(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x58(%rbp)
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
callq 0x3a1e0
movq -0x58(%rbp), %rax
movq -0x50(%rbp), %rcx
movq -0x28(%rbp), %rdx
movslq (%rdx), %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jne 0x3a10f
jmp 0x3a12e
leaq 0xe940(%rip), %rdi      # 0x48a56
leaq 0xe81c(%rip), %rsi      # 0x48939
movl $0x3d8, %edx            # imm = 0x3D8
leaq 0xe941(%rip), %rcx      # 0x48a6a
callq 0x52c0
movq -0x50(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)