// File: /workspace/github_cpp_makefile_star2_O1/srajangarg[P]raytracer/src/core/stb_image.hpp
// Function: stbi__parse_png_file(stbi__png*, int, int)
static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
{
   stbi_uc palette[1024], pal_img_n=0;
   stbi_uc has_trans=0, tc[3];
   stbi__uint32 ioff=0, idata_limit=0, i, pal_len=0;
   int first=1,k,interlace=0, color=0, depth=0, is_iphone=0;
   stbi__context *s = z->s;

   z->expanded = NULL;
   z->idata = NULL;
   z->out = NULL;

   if (!stbi__check_png_header(s)) return 0;

   if (scan == STBI__SCAN_type) return 1;

   for (;;) {
      stbi__pngchunk c = stbi__get_chunk_header(s);
      switch (c.type) {
         case STBI__PNG_TYPE('C','g','B','I'):
            is_iphone = 1;
            stbi__skip(s, c.length);
            break;
         case STBI__PNG_TYPE('I','H','D','R'): {
            int comp,filter;
            if (!first) return stbi__err("multiple IHDR","Corrupt PNG");
            first = 0;
            if (c.length != 13) return stbi__err("bad IHDR len","Corrupt PNG");
            s->img_x = stbi__get32be(s); if (s->img_x > (1 << 24)) return stbi__err("too large","Very large image (corrupt?)");
            s->img_y = stbi__get32be(s); if (s->img_y > (1 << 24)) return stbi__err("too large","Very large image (corrupt?)");
            depth = stbi__get8(s);  if (depth != 1 && depth != 2 && depth != 4 && depth != 8)  return stbi__err("1/2/4/8-bit only","PNG not supported: 1/2/4/8-bit only");
            color = stbi__get8(s);  if (color > 6)         return stbi__err("bad ctype","Corrupt PNG");
            if (color == 3) pal_img_n = 3; else if (color & 1) return stbi__err("bad ctype","Corrupt PNG");
            comp  = stbi__get8(s);  if (comp) return stbi__err("bad comp method","Corrupt PNG");
            filter= stbi__get8(s);  if (filter) return stbi__err("bad filter method","Corrupt PNG");
            interlace = stbi__get8(s); if (interlace>1) return stbi__err("bad interlace method","Corrupt PNG");
            if (!s->img_x || !s->img_y) return stbi__err("0-pixel image","Corrupt PNG");
            if (!pal_img_n) {
               s->img_n = (color & 2 ? 3 : 1) + (color & 4 ? 1 : 0);
               if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err("too large", "Image too large to decode");
               if (scan == STBI__SCAN_header) return 1;
            } else {
               // if paletted, then pal_n is our final components, and
               // img_n is # components to decompress/filter.
               s->img_n = 1;
               if ((1 << 30) / s->img_x / 4 < s->img_y) return stbi__err("too large","Corrupt PNG");
               // if SCAN_header, have to scan to see if we have a tRNS
            }
            break;
         }

         case STBI__PNG_TYPE('P','L','T','E'):  {
            if (first) return stbi__err("first not IHDR", "Corrupt PNG");
            if (c.length > 256*3) return stbi__err("invalid PLTE","Corrupt PNG");
            pal_len = c.length / 3;
            if (pal_len * 3 != c.length) return stbi__err("invalid PLTE","Corrupt PNG");
            for (i=0; i < pal_len; ++i) {
               palette[i*4+0] = stbi__get8(s);
               palette[i*4+1] = stbi__get8(s);
               palette[i*4+2] = stbi__get8(s);
               palette[i*4+3] = 255;
            }
            break;
         }

         case STBI__PNG_TYPE('t','R','N','S'): {
            if (first) return stbi__err("first not IHDR", "Corrupt PNG");
            if (z->idata) return stbi__err("tRNS after IDAT","Corrupt PNG");
            if (pal_img_n) {
               if (scan == STBI__SCAN_header) { s->img_n = 4; return 1; }
               if (pal_len == 0) return stbi__err("tRNS before PLTE","Corrupt PNG");
               if (c.length > pal_len) return stbi__err("bad tRNS len","Corrupt PNG");
               pal_img_n = 4;
               for (i=0; i < c.length; ++i)
                  palette[i*4+3] = stbi__get8(s);
            } else {
               if (!(s->img_n & 1)) return stbi__err("tRNS with alpha","Corrupt PNG");
               if (c.length != (stbi__uint32) s->img_n*2) return stbi__err("bad tRNS len","Corrupt PNG");
               has_trans = 1;
               for (k=0; k < s->img_n; ++k)
                  tc[k] = (stbi_uc) (stbi__get16be(s) & 255) * stbi__depth_scale_table[depth]; // non 8-bit images will be larger
            }
            break;
         }

         case STBI__PNG_TYPE('I','D','A','T'): {
            if (first) return stbi__err("first not IHDR", "Corrupt PNG");
            if (pal_img_n && !pal_len) return stbi__err("no PLTE","Corrupt PNG");
            if (scan == STBI__SCAN_header) { s->img_n = pal_img_n; return 1; }
            if ((int)(ioff + c.length) < (int)ioff) return 0;
            if (ioff + c.length > idata_limit) {
               stbi__uint32 idata_limit_old = idata_limit;
               stbi_uc *p;
               if (idata_limit == 0) idata_limit = c.length > 4096 ? c.length : 4096;
               while (ioff + c.length > idata_limit)
                  idata_limit *= 2;
               STBI_NOTUSED(idata_limit_old);
               p = (stbi_uc *) STBI_REALLOC_SIZED(z->idata, idata_limit_old, idata_limit); if (p == NULL) return stbi__err("outofmem", "Out of memory");
               z->idata = p;
            }
            if (!stbi__getn(s, z->idata+ioff,c.length)) return stbi__err("outofdata","Corrupt PNG");
            ioff += c.length;
            break;
         }

         case STBI__PNG_TYPE('I','E','N','D'): {
            stbi__uint32 raw_len, bpl;
            if (first) return stbi__err("first not IHDR", "Corrupt PNG");
            if (scan != STBI__SCAN_load) return 1;
            if (z->idata == NULL) return stbi__err("no IDAT","Corrupt PNG");
            // initial guess for decoded data size to avoid unnecessary reallocs
            bpl = (s->img_x * depth + 7) / 8; // bytes per line, per component
            raw_len = bpl * s->img_y * s->img_n /* pixels */ + s->img_y /* filter mode per row */;
            z->expanded = (stbi_uc *) stbi_zlib_decode_malloc_guesssize_headerflag((char *) z->idata, ioff, raw_len, (int *) &raw_len, !is_iphone);
            if (z->expanded == NULL) return 0; // zlib should set error
            STBI_FREE(z->idata); z->idata = NULL;
            if ((req_comp == s->img_n+1 && req_comp != 3 && !pal_img_n) || has_trans)
               s->img_out_n = s->img_n+1;
            else
               s->img_out_n = s->img_n;
            if (!stbi__create_png_image(z, z->expanded, raw_len, s->img_out_n, depth, color, interlace)) return 0;
            if (has_trans)
               if (!stbi__compute_transparency(z, tc, s->img_out_n)) return 0;
            if (is_iphone && stbi__de_iphone_flag && s->img_out_n > 2)
               stbi__de_iphone(z);
            if (pal_img_n) {
               // pal_img_n == 3 or 4
               s->img_n = pal_img_n; // record the actual colors we had
               s->img_out_n = pal_img_n;
               if (req_comp >= 3) s->img_out_n = req_comp;
               if (!stbi__expand_png_palette(z, palette, pal_len, s->img_out_n))
                  return 0;
            }
            STBI_FREE(z->expanded); z->expanded = NULL;
            return 1;
         }

         default:
            // if critical, fail
            if (first) return stbi__err("first not IHDR", "Corrupt PNG");
            if ((c.type & (1 << 29)) == 0) {
               #ifndef STBI_NO_FAILURE_STRINGS
               // not threadsafe
               static char invalid_chunk[] = "XXXX PNG chunk not known";
               invalid_chunk[0] = STBI__BYTECAST(c.type >> 24);
               invalid_chunk[1] = STBI__BYTECAST(c.type >> 16);
               invalid_chunk[2] = STBI__BYTECAST(c.type >>  8);
               invalid_chunk[3] = STBI__BYTECAST(c.type >>  0);
               #endif
               return stbi__err(invalid_chunk, "PNG not supported: unknown PNG chunk type");
            }
            stbi__skip(s, c.length);
            break;
      }
      // end of PNG chunk, read and skip CRC
      stbi__get32be(s);
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4f8, %rsp            # imm = 0x4F8
movl %edx, %r14d
movl %esi, %ebx
movq (%rdi), %rbp
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movq %rdi, 0x20(%rsp)
movq $0x0, 0x18(%rdi)
movq %rbp, %rdi
callq 0x1ed60
testl %eax, %eax
je 0x20000
movl %r14d, 0x68(%rsp)
movl $0x1, 0x4(%rsp)
movl %ebx, 0x3c(%rsp)
cmpl $0x1, %ebx
je 0x20008
movq 0x20(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x58(%rsp)
leaq 0x38(%rbp), %r15
leaq 0x39(%rbp), %rax
movq %rax, 0x40(%rsp)
movl $0x1, 0x8(%rsp)
movq $0x0, 0xc0(%rsp)
movq $0x0, 0x78(%rsp)
xorl %r12d, %r12d
movl $0x0, 0x4c(%rsp)
movq $0x0, 0x60(%rsp)
xorl %r13d, %r13d
movq $0x0, 0x70(%rsp)
movq $0x0, 0x88(%rsp)
movl $0x0, 0xc(%rsp)
movq %rbp, 0x10(%rsp)
movq %r15, 0x90(%rsp)
movq %r12, 0x18(%rsp)
movq %r13, 0x28(%rsp)
movq %rbp, %rdi
callq 0x1e01c
movl %eax, %r13d
shll $0x10, %r13d
movq %rbp, %rdi
callq 0x1e01c
movl %eax, %r12d
leal (%r12,%r13), %r15d
movq %rbp, %rdi
callq 0x1e01c
movl %eax, %r14d
movl %eax, %ebx
shll $0x10, %ebx
movq %rbp, %rdi
callq 0x1e01c
orl %eax, %ebx
cmpl $0x49484451, %ebx       # imm = 0x49484451
jg 0x1ef8e
cmpl $0x43674249, %ebx       # imm = 0x43674249
je 0x1f030
cmpl $0x49444154, %ebx       # imm = 0x49444154
movq 0x10(%rsp), %rbp
movq 0x28(%rsp), %r13
movq 0x18(%rsp), %r12
je 0x1f0d1
cmpl $0x49454e44, %ebx       # imm = 0x49454E44
jne 0x1f07f
cmpl $0x0, 0x8(%rsp)
je 0x1f171
leaq 0xe4b8(%rip), %rax      # 0x2d432
movq %rax, 0x1942f(%rip)     # 0x383b0
movl $0x0, 0x4(%rsp)
jmp 0x1fe7b
cmpl $0x74524e53, %ebx       # imm = 0x74524E53
je 0x1f057
cmpl $0x504c5445, %ebx       # imm = 0x504C5445
je 0x1f101
cmpl $0x49484452, %ebx       # imm = 0x49484452
movq 0x10(%rsp), %rbp
movq 0x28(%rsp), %r13
movq 0x18(%rsp), %r12
jne 0x1f07f
cmpl $0x0, 0x8(%rsp)
je 0x1f189
cmpl $0xd, %r15d
jne 0x1f3aa
movq %rbp, %rdi
callq 0x1e01c
movl %eax, %ebx
shll $0x10, %ebx
movq %rbp, %rdi
callq 0x1e01c
orl %ebx, %eax
movl %eax, (%rbp)
cmpl $0x1000001, %eax        # imm = 0x1000001
movq 0x90(%rsp), %r15
jae 0x1f024
movq %rbp, %rdi
callq 0x1e01c
movl %eax, %ebx
shll $0x10, %ebx
movq %rbp, %rdi
callq 0x1e01c
orl %ebx, %eax
movl %eax, 0x4(%rbp)
cmpl $0x1000001, %eax        # imm = 0x1000001
jb 0x1f5a2
leaq 0xe1d4(%rip), %rax      # 0x2d1ff
jmp 0x1f3b1
movl $0x1, 0x4c(%rsp)
movq 0x10(%rsp), %rbp
movq 0x28(%rsp), %r13
movq 0x18(%rsp), %r12
movq %rbp, %rdi
movl %r15d, %esi
callq 0x1e25e
jmp 0x1f3d7
cmpl $0x0, 0x8(%rsp)
je 0x1f133
leaq 0xe3c9(%rip), %rax      # 0x2d432
movq %rax, 0x19340(%rip)     # 0x383b0
xorl %eax, %eax
movl $0x1, 0x8(%rsp)
jmp 0x1f15a
cmpl $0x0, 0x8(%rsp)
jne 0x1f0dc
movl $0x0, 0x8(%rsp)
btl $0xd, %r14d
jb 0x1f047
movl %ebx, %ecx
shrl $0x18, %ecx
movb %cl, 0x192d0(%rip)      # 0x38370
movl %ebx, %ecx
shrl $0x10, %ecx
movb %cl, 0x192c6(%rip)      # 0x38371
movb %bh, 0x192c1(%rip)      # 0x38372
movb %al, 0x192bc(%rip)      # 0x38373
leaq 0x192b2(%rip), %rax     # 0x38370
movq %rax, 0x192eb(%rip)     # 0x383b0
movl $0x0, 0x8(%rsp)
xorl %eax, %eax
jmp 0x1f0f4
cmpl $0x0, 0x8(%rsp)
je 0x1f195
leaq 0xe34f(%rip), %rax      # 0x2d432
movq %rax, 0x192c6(%rip)     # 0x383b0
xorl %eax, %eax
movl $0x1, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
jmp 0x1fe7d
cmpl $0x0, 0x8(%rsp)
movq 0x10(%rsp), %rbp
movq 0x28(%rsp), %r13
je 0x1f1d3
leaq 0xe315(%rip), %rax      # 0x2d432
movq %rax, 0x1928c(%rip)     # 0x383b0
xorl %eax, %eax
movl $0x1, 0x8(%rsp)
jmp 0x1f406
movq 0x58(%rsp), %rax
cmpq $0x0, (%rax)
je 0x1f440
leaq 0xe305(%rip), %rax      # 0x2d44e
movq %rax, 0x19260(%rip)     # 0x383b0
movl $0x0, 0x8(%rsp)
xorl %eax, %eax
movl $0x0, 0x4(%rsp)
movq 0x10(%rsp), %rbp
movq 0x28(%rsp), %r13
jmp 0x1f40e
cmpl $0x0, 0x3c(%rsp)
je 0x1f479
movl $0x1, 0x4(%rsp)
jmp 0x1fe7b
leaq 0xe227(%rip), %rax      # 0x2d3b7
jmp 0x1f3b1
cmpb $0x0, 0xc(%rsp)
movq 0x60(%rsp), %rax
je 0x1f418
testl %eax, %eax
jne 0x1f418
leaq 0xe2d8(%rip), %rax      # 0x2d48c
movq %rax, 0x191f5(%rip)     # 0x383b0
movl $0x0, 0x8(%rsp)
xorl %eax, %eax
movq $0x0, 0x60(%rsp)
jmp 0x1f0f4
cmpl $0x301, %r15d           # imm = 0x301
jae 0x1f3ee
movl %r12d, %eax
imulq $0x55555556, %rax, %rax # imm = 0x55555556
shrq $0x20, %rax
movq %rax, 0x60(%rsp)
leal (%rax,%rax,2), %eax
cmpl %r15d, %eax
jne 0x1f3ee
movl $0x0, 0x8(%rsp)
cmpl $0x3, %r12d
movq 0x90(%rsp), %r15
jb 0x1fe94
movl 0x60(%rsp), %ebx
xorl %r14d, %r14d
movq 0x18(%rsp), %r12
movq 0xb8(%rbp), %rax
cmpq 0xc0(%rbp), %rax
jb 0x1f28a
cmpl $0x0, 0x30(%rbp)
je 0x1f261
movq 0x28(%rbp), %rdi
movl 0x34(%rbp), %edx
movq %r15, %rsi
callq *0x10(%rbp)
testl %eax, %eax
je 0x1f265
movq %r15, 0xb8(%rbp)
cltq
addq %r15, %rax
movq %rax, 0xc0(%rbp)
jmp 0x1f283
xorl %eax, %eax
jmp 0x1f297
movl $0x0, 0x30(%rbp)
movq %r15, 0xb8(%rbp)
movq 0x40(%rsp), %rax
movq %rax, 0xc0(%rbp)
movb $0x0, 0x38(%rbp)
movq 0xb8(%rbp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%rbp)
movb (%rax), %al
movb %al, 0xf0(%rsp,%r14,4)
movq 0xb8(%rbp), %rax
cmpq 0xc0(%rbp), %rax
jb 0x1f304
cmpl $0x0, 0x30(%rbp)
je 0x1f2db
movq 0x28(%rbp), %rdi
movl 0x34(%rbp), %edx
movq %r15, %rsi
callq *0x10(%rbp)
testl %eax, %eax
je 0x1f2df
movq %r15, 0xb8(%rbp)
cltq
addq %r15, %rax
movq %rax, 0xc0(%rbp)
jmp 0x1f2fd
xorl %eax, %eax
jmp 0x1f311
movl $0x0, 0x30(%rbp)
movq %r15, 0xb8(%rbp)
movq 0x40(%rsp), %rax
movq %rax, 0xc0(%rbp)
movb $0x0, 0x38(%rbp)
movq 0xb8(%rbp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%rbp)
movb (%rax), %al
movb %al, 0xf1(%rsp,%r14,4)
movq 0xb8(%rbp), %rax
cmpq 0xc0(%rbp), %rax
jb 0x1f37e
cmpl $0x0, 0x30(%rbp)
je 0x1f355
movq 0x28(%rbp), %rdi
movl 0x34(%rbp), %edx
movq %r15, %rsi
callq *0x10(%rbp)
testl %eax, %eax
je 0x1f359
movq %r15, 0xb8(%rbp)
cltq
addq %r15, %rax
movq %rax, 0xc0(%rbp)
jmp 0x1f377
xorl %eax, %eax
jmp 0x1f38b
movl $0x0, 0x30(%rbp)
movq %r15, 0xb8(%rbp)
movq 0x40(%rsp), %rax
movq %rax, 0xc0(%rbp)
movb $0x0, 0x38(%rbp)
movq 0xb8(%rbp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%rbp)
movb (%rax), %al
movb %al, 0xf2(%rsp,%r14,4)
movb $-0x1, 0xf3(%rsp,%r14,4)
incq %r14
cmpq %r14, %rbx
jne 0x1f225
jmp 0x1f3d7
leaq 0xe014(%rip), %rax      # 0x2d3c5
movq %rax, 0x18ff8(%rip)     # 0x383b0
xorl %ecx, %ecx
movl $0x0, 0x4(%rsp)
movl $0x0, 0x8(%rsp)
movl $0x0, %eax
testb %cl, %cl
je 0x1fe7d
movq %rbp, %rdi
callq 0x1e01c
movq %rbp, %rdi
callq 0x1e01c
movb $0x1, %al
jmp 0x1fe7d
leaq 0xe04c(%rip), %rax      # 0x2d441
movq %rax, 0x18fb4(%rip)     # 0x383b0
movl $0x0, 0x8(%rsp)
xorl %eax, %eax
movl $0x0, 0x4(%rsp)
movq 0x18(%rsp), %r12
jmp 0x1fe7d
cmpl $0x2, 0x3c(%rsp)
jne 0x1f538
movzbl 0xc(%rsp), %eax
movl %eax, 0x8(%rbp)
movl $0x1, 0x4(%rsp)
movl $0x0, 0x8(%rsp)
jmp 0x1fe7b
cmpb $0x0, 0xc(%rsp)
je 0x1f5ed
cmpl $0x2, 0x3c(%rsp)
jne 0x1f621
movq 0x10(%rsp), %rbp
movl $0x4, 0x8(%rbp)
movl $0x1, 0x4(%rsp)
movl $0x0, 0x8(%rsp)
xorl %eax, %eax
jmp 0x1f167
movq 0x58(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x1f615
movl (%rbp), %eax
imull %r12d, %eax
addl $0x7, %eax
shrl $0x3, %eax
movl 0x4(%rbp), %ecx
movl 0x8(%rbp), %edx
imull %ecx, %edx
imull %eax, %edx
addl %ecx, %edx
movl %edx, 0x6c(%rsp)
xorl %r8d, %r8d
cmpl $0x0, 0x4c(%rsp)
sete %r8b
movq 0x70(%rsp), %rsi
leaq 0x6c(%rsp), %rcx
callq 0x159e9
movq 0x20(%rsp), %rcx
movq %rax, 0x10(%rcx)
movl $0x0, 0x4(%rsp)
testq %rax, %rax
je 0x1fe7b
movl 0x68(%rsp), %r12d
cmpl $0x3, %r12d
setne %bl
movq 0x58(%rsp), %r14
movq (%r14), %rdi
callq 0x4390
movq $0x0, (%r14)
movl 0x8(%rbp), %eax
leal 0x1(%rax), %ecx
cmpl %r12d, %ecx
sete %dl
cmpb $0x0, 0xc(%rsp)
sete %sil
andb %bl, %sil
andb %dl, %sil
cmpb $0x0, 0x88(%rsp)
setne %dl
orb %sil, %dl
cmpb $0x1, %dl
jne 0x1f643
movl %ecx, 0xc(%rbp)
jmp 0x1f646
movq 0x70(%rsp), %rax
leal (%r15,%rax), %ebp
movl $0x0, 0x8(%rsp)
cmpl %eax, %ebp
jl 0x1fd02
cmpl %r13d, %ebp
jbe 0x1fcb6
cmpl $0x1001, %r15d          # imm = 0x1001
movl $0x1000, %eax           # imm = 0x1000
cmovael %r15d, %eax
testl %r13d, %r13d
cmovnel %r13d, %eax
movl %eax, %r13d
leal (,%r13,2), %eax
cmpl %r13d, %ebp
ja 0x1f571
movq 0x58(%rsp), %rbx
movq (%rbx), %rdi
movl %r13d, %esi
callq 0x4520
testq %rax, %rax
je 0x1fc9b
movq %rax, (%rbx)
jmp 0x1fcb1
movq 0xb8(%rbp), %rax
cmpq 0xc0(%rbp), %rax
jb 0x1fc1f
cmpl $0x0, 0x30(%rbp)
je 0x1fa36
movq 0x28(%rbp), %rdi
movl 0x34(%rbp), %edx
movq %r15, %rsi
callq *0x10(%rbp)
testl %eax, %eax
je 0x1fbfa
movq %r15, 0xb8(%rbp)
cltq
addq %r15, %rax
movq %rax, 0xc0(%rbp)
jmp 0x1fc18
movq 0x10(%rsp), %rbp
movl 0x8(%rbp), %eax
testb $0x1, %al
leaq 0xd852(%rip), %r12      # 0x2ce50
movq 0x28(%rsp), %r13
jne 0x1f92b
leaq 0xde6c(%rip), %rax      # 0x2d47c
jmp 0x1fafc
leaq 0xde82(%rip), %rax      # 0x2d49e
jmp 0x1ef7a
movq 0x60(%rsp), %rax
testl %eax, %eax
je 0x1fa10
cmpl %r15d, %eax
jae 0x1fa3d
leaq 0xde31(%rip), %rax      # 0x2d46f
jmp 0x1f149
movl %eax, 0xc(%rbp)
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
movq 0x10(%rdi), %rsi
movl 0x6c(%rsp), %edx
movslq 0xc(%rbp), %rcx
movl (%rax), %r8d
movl 0x4(%rax), %r9d
cmpl $0x0, 0xc0(%rsp)
movq 0x18(%rsp), %r12
je 0x1f983
movq %rsi, 0xc8(%rsp)
movq %rcx, 0xa0(%rsp)
imull %ecx, %r8d
imull %r9d, %r8d
movq %r8, %rdi
movl %edx, 0x38(%rsp)
callq 0x4400
movl 0x38(%rsp), %r9d
movq 0x20(%rsp), %rdi
movq %rax, 0x80(%rsp)
xorl %r10d, %r10d
movq (%rdi), %rbx
leaq 0xd7a9(%rip), %rax      # 0x2ce60
movslq (%rax,%r10,4), %rcx
leaq 0xd7de(%rip), %rax      # 0x2cea0
movslq (%rax,%r10,4), %r11
movq %rcx, 0x98(%rsp)
movl %ecx, %esi
notl %esi
addl (%rbx), %esi
addl %r11d, %esi
movl %esi, %eax
xorl %edx, %edx
divl %r11d
movl %eax, 0x54(%rsp)
leaq 0xd797(%rip), %rax      # 0x2ce80
movl (%rax,%r10,4), %r8d
leaq 0xd7cc(%rip), %rax      # 0x2cec0
movl (%rax,%r10,4), %r14d
movl %r8d, %ecx
notl %ecx
addl 0x4(%rbx), %ecx
addl %r14d, %ecx
movl %ecx, %eax
xorl %edx, %edx
divl %r14d
movl %eax, 0x48(%rsp)
movb $0x1, %al
cmpl %esi, %r11d
ja 0x1f908
cmpl %ecx, %r14d
ja 0x1f908
movl %r14d, 0x50(%rsp)
movl %r8d, 0xb0(%rsp)
movq %r11, %r14
movq %r10, 0xd0(%rsp)
movl 0x54(%rsp), %r8d
movl %r8d, %eax
imull %r12d, %eax
imull 0x8(%rbx), %eax
movl %eax, 0xbc(%rsp)
movq 0xc8(%rsp), %rsi
movl %r9d, 0x38(%rsp)
movl %r9d, %edx
movq 0xa0(%rsp), %rcx
movl 0x48(%rsp), %ebx
movl %ebx, %r9d
pushq 0x78(%rsp)
pushq %r12
callq 0x2063a
addq $0x10, %rsp
testl %eax, %eax
je 0x1f8e7
testl %ebx, %ebx
movl 0xb0(%rsp), %ebp
movl 0x50(%rsp), %edx
jle 0x1f895
movslq 0x54(%rsp), %r12
movl 0x48(%rsp), %eax
movq %rax, 0xd8(%rsp)
movq 0xa0(%rsp), %rax
imull %eax, %ebp
imull %eax, %edx
movq 0x98(%rsp), %rbx
imulq %rax, %rbx
addq 0x80(%rsp), %rbx
movq %rbx, 0x98(%rsp)
imulq %rax, %r14
movq $0x0, 0xa8(%rsp)
movl %edx, 0x50(%rsp)
cmpl $0x0, 0x54(%rsp)
movq 0xa0(%rsp), %r15
jle 0x1f86e
movq 0x20(%rsp), %rax
movq (%rax), %rdx
movq %rdx, 0xb0(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0xe8(%rsp)
movq 0xa8(%rsp), %rax
imulq %r12, %rax
movq %rax, 0xe0(%rsp)
movq 0x98(%rsp), %rbx
xorl %r13d, %r13d
movq 0xb0(%rsp), %rax
movl (%rax), %edi
imull %ebp, %edi
addq %rbx, %rdi
movq 0xe0(%rsp), %rax
leaq (%rax,%r13), %rsi
imulq %r15, %rsi
addq 0xe8(%rsp), %rsi
movq %r15, %rdx
callq 0x42a0
incq %r13
addq %r14, %rbx
cmpq %r12, %r13
jl 0x1f833
movq 0xa8(%rsp), %rdi
incq %rdi
movl 0x50(%rsp), %edx
addl %edx, %ebp
movq %rdi, 0xa8(%rsp)
cmpq 0xd8(%rsp), %rdi
jb 0x1f7e9
movl 0xbc(%rsp), %ebp
addl $0x7, %ebp
sarl $0x3, %ebp
incl %ebp
imull 0x48(%rsp), %ebp
movq 0x20(%rsp), %rbx
movq 0x18(%rbx), %rdi
callq 0x4390
movq %rbx, %rdi
movl %ebp, %eax
addq %rax, 0xc8(%rsp)
movl 0x38(%rsp), %r9d
subl %ebp, %r9d
movq 0x10(%rsp), %rbp
movq 0x28(%rsp), %r13
movq 0x18(%rsp), %r12
movq 0xd0(%rsp), %r10
movb $0x1, %al
jmp 0x1f908
movq 0x80(%rsp), %rdi
callq 0x4390
xorl %eax, %eax
movq 0x20(%rsp), %rdi
movl 0x38(%rsp), %r9d
movq 0xd0(%rsp), %r10
testb %al, %al
je 0x1fe7b
incq %r10
cmpq $0x7, %r10
jne 0x1f6ad
movq 0x80(%rsp), %rax
movq %rax, 0x18(%rdi)
jmp 0x1f99f
addl %eax, %eax
cmpl %r15d, %eax
jne 0x1faf5
movb $0x1, %al
movq %rax, 0x88(%rsp)
cmpl $0x0, 0x8(%rbp)
jle 0x1f96e
movl 0x18(%rsp), %ebx
xorl %r14d, %r14d
movq %rbp, %rdi
callq 0x1e01c
movl %eax, %ecx
movb (%rbx,%r12), %al
mulb %cl
movb %al, 0x35(%rsp,%r14)
incq %r14
movslq 0x8(%rbp), %rax
cmpq %rax, %r14
jl 0x1f94d
movl $0x0, 0x8(%rsp)
movl $0x0, 0xc(%rsp)
jmp 0x1fe94
pushq 0x78(%rsp)
pushq %r12
callq 0x2063a
movq 0x30(%rsp), %rdi
addq $0x10, %rsp
testl %eax, %eax
je 0x1fe7b
cmpb $0x0, 0x88(%rsp)
je 0x1fb3c
movl 0xc(%rbp), %ecx
movq (%rdi), %rdx
movq 0x18(%rdi), %rax
movl 0x4(%rdx), %edi
imull (%rdx), %edi
cmpl $0x2, %ecx
je 0x1fb1a
cmpl $0x4, %ecx
jne 0x2001e
testl %edi, %edi
je 0x1fb3c
movb 0x35(%rsp), %cl
movb 0x36(%rsp), %dl
movb 0x37(%rsp), %sil
movl %edi, %edi
xorl %r8d, %r8d
cmpb %cl, (%rax,%r8,4)
jne 0x1fa03
cmpb %dl, 0x1(%rax,%r8,4)
jne 0x1fa03
cmpb %sil, 0x2(%rax,%r8,4)
jne 0x1fa03
movb $0x0, 0x3(%rax,%r8,4)
incq %r8
cmpl %r8d, %edi
jne 0x1f9e9
jmp 0x1fb3c
leaq 0xda47(%rip), %rax      # 0x2d45e
movq %rax, 0x18992(%rip)     # 0x383b0
movl $0x0, 0x8(%rsp)
xorl %eax, %eax
movq $0x0, 0x60(%rsp)
jmp 0x1f15a
xorl %eax, %eax
jmp 0x1fc2c
movb $0x4, %al
movl %eax, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
testl %r15d, %r15d
je 0x1fe8a
addl %r13d, %r12d
xorl %ebx, %ebx
movq 0x10(%rsp), %rbp
movq 0x90(%rsp), %r15
movq 0x28(%rsp), %r13
movq 0xb8(%rbp), %rax
cmpq 0xc0(%rbp), %rax
jb 0x1fad0
cmpl $0x0, 0x30(%rbp)
je 0x1faa7
movq 0x28(%rbp), %rdi
movl 0x34(%rbp), %edx
movq %r15, %rsi
callq *0x10(%rbp)
testl %eax, %eax
je 0x1faab
movq %r15, 0xb8(%rbp)
cltq
addq %r15, %rax
movq %rax, 0xc0(%rbp)
jmp 0x1fac9
xorl %eax, %eax
jmp 0x1fadd
movl $0x0, 0x30(%rbp)
movq %r15, 0xb8(%rbp)
movq 0x40(%rsp), %rax
movq %rax, 0xc0(%rbp)
movb $0x0, 0x38(%rbp)
movq 0xb8(%rbp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%rbp)
movb (%rax), %al
movb %al, 0xf3(%rsp,%rbx,4)
incq %rbx
cmpq %rbx, %r12
jne 0x1fa6b
jmp 0x1fe94
leaq 0xd973(%rip), %rax      # 0x2d46f
movq %rax, 0x188ad(%rip)     # 0x383b0
movl $0x0, 0x8(%rsp)
xorl %eax, %eax
movl $0x0, 0xc(%rsp)
jmp 0x1f406
testl %edi, %edi
je 0x1fb3c
movb 0x35(%rsp), %cl
movl %edi, %edx
xorl %esi, %esi
cmpb %cl, (%rax,%rsi,2)
setne %dil
negb %dil
movb %dil, 0x1(%rax,%rsi,2)
incq %rsi
cmpl %esi, %edx
jne 0x1fb26
cmpl $0x0, 0x4c(%rsp)
je 0x1fb5c
cmpl $0x0, 0x18876(%rip)     # 0x383c0
je 0x1fb5c
cmpl $0x3, 0xc(%rbp)
jl 0x1fb5c
movq 0x20(%rsp), %rdi
callq 0x20546
cmpb $0x0, 0xc(%rsp)
je 0x1fe60
movl 0x68(%rsp), %eax
cmpl $0x3, %eax
movzbl 0xc(%rsp), %r14d
movl %r14d, 0x8(%rbp)
cmovgel %eax, %r14d
movl %r14d, 0xc(%rbp)
movq 0x20(%rsp), %rcx
movq (%rcx), %rax
movq 0x18(%rcx), %rbx
movl 0x4(%rax), %ebp
imull (%rax), %ebp
movl %ebp, %edi
imull %r14d, %edi
callq 0x4400
movq %rax, %r12
testq %rax, %rax
je 0x1fdea
cmpl $0x3, %r14d
jne 0x1fdfa
testl %ebp, %ebp
je 0x1fe40
movl %ebp, %eax
xorl %ecx, %ecx
movq %r12, %rdx
movzbl (%rbx,%rcx), %esi
movb 0xf0(%rsp,%rsi,4), %dil
movb %dil, (%rdx)
movb 0xf1(%rsp,%rsi,4), %dil
movb %dil, 0x1(%rdx)
movb 0xf2(%rsp,%rsi,4), %sil
movb %sil, 0x2(%rdx)
addq $0x3, %rdx
incq %rcx
cmpq %rcx, %rax
jne 0x1fbc2
jmp 0x1fe40
movl $0x0, 0x30(%rbp)
movq %r15, 0xb8(%rbp)
movq 0x40(%rsp), %rax
movq %rax, 0xc0(%rbp)
movb $0x0, 0x38(%rbp)
movq 0xb8(%rbp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%rbp)
movb (%rax), %al
movzbl %al, %r12d
cmpb $0x8, %r12b
ja 0x1fc88
movl $0x116, %eax            # imm = 0x116
btl %r12d, %eax
jae 0x1fc88
movq 0xb8(%rbp), %rax
cmpq 0xc0(%rbp), %rax
jb 0x1fd47
cmpl $0x0, 0x30(%rbp)
je 0x1fc94
movq 0x28(%rbp), %rdi
movl 0x34(%rbp), %edx
movq %r15, %rsi
callq *0x10(%rbp)
testl %eax, %eax
je 0x1fd22
movq %r15, 0xb8(%rbp)
cltq
addq %r15, %rax
movq %rax, 0xc0(%rbp)
jmp 0x1fd40
leaq 0xd743(%rip), %rax      # 0x2d3d2
jmp 0x1f3b1
xorl %ebp, %ebp
jmp 0x1fd55
leaq 0xd567(%rip), %rcx      # 0x2d209
movq %rcx, 0x18707(%rip)     # 0x383b0
movl $0x0, 0x4(%rsp)
testq %rax, %rax
je 0x1fd16
movq 0x58(%rsp), %rax
movl 0x70(%rsp), %esi
addq (%rax), %rsi
movq 0x10(%rsp), %rdi
movl %r15d, %edx
callq 0x20499
testl %eax, %eax
je 0x1fcec
movl $0x0, 0x8(%rsp)
movl %ebp, %eax
movq %rax, 0x70(%rsp)
movq 0x10(%rsp), %rbp
jmp 0x1f3d7
leaq 0xd7a1(%rip), %rax      # 0x2d494
movq %rax, 0x186b6(%rip)     # 0x383b0
movl $0x0, 0x8(%rsp)
xorl %eax, %eax
movl $0x0, 0x4(%rsp)
movq 0x10(%rsp), %rbp
jmp 0x1fe7d
movl $0x0, 0x8(%rsp)
xorl %eax, %eax
jmp 0x1fd0c
movl $0x0, 0x30(%rbp)
movq %r15, 0xb8(%rbp)
movq 0x40(%rsp), %rax
movq %rax, 0xc0(%rbp)
movb $0x0, 0x38(%rbp)
movq 0xb8(%rbp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%rbp)
movb (%rax), %bpl
movzbl %bpl, %eax
cmpb $0x7, %al
movq %rax, 0x78(%rsp)
jb 0x1fd84
leaq 0xd67a(%rip), %rax      # 0x2d3e3
movq %rax, 0x18640(%rip)     # 0x383b0
xorl %ecx, %ecx
movl $0x0, 0x4(%rsp)
movq 0x10(%rsp), %rbp
jmp 0x1f3c2
movb $0x3, %bl
cmpl $0x3, %eax
je 0x1fd97
testb $0x1, %bpl
jne 0x1fd62
movl 0xc(%rsp), %ecx
movl %ecx, %ebx
movq 0x10(%rsp), %r14
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jb 0x1fec5
cmpl $0x0, 0x30(%r14)
je 0x1fee1
movq 0x28(%r14), %rdi
movl 0x34(%r14), %edx
movq %r15, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x1fe9e
movq %r15, 0xb8(%r14)
cltq
addq %r15, %rax
movq %rax, 0xc0(%r14)
jmp 0x1febe
leaq 0xd418(%rip), %rax      # 0x2d209
movq %rax, 0x185b8(%rip)     # 0x383b0
jmp 0x1fe51
testl %ebp, %ebp
je 0x1fe40
movl %ebp, %eax
xorl %ecx, %ecx
movzbl (%rbx,%rcx), %edx
movb 0xf0(%rsp,%rdx,4), %sil
movb %sil, (%r12,%rcx,4)
movb 0xf1(%rsp,%rdx,4), %sil
movb %sil, 0x1(%r12,%rcx,4)
movb 0xf2(%rsp,%rdx,4), %sil
movb %sil, 0x2(%r12,%rcx,4)
movb 0xf3(%rsp,%rdx,4), %dl
movb %dl, 0x3(%r12,%rcx,4)
incq %rcx
cmpq %rcx, %rax
jne 0x1fe02
movq %rbx, %rdi
callq 0x4390
movq 0x20(%rsp), %rax
movq %r12, 0x18(%rax)
testq %r12, %r12
movq 0x10(%rsp), %rbp
movq 0x18(%rsp), %r12
je 0x1fe7b
movq 0x20(%rsp), %rbx
movq 0x10(%rbx), %rdi
callq 0x4390
movq $0x0, 0x10(%rbx)
jmp 0x1f17c
xorl %eax, %eax
testb %al, %al
jne 0x1eeeb
jmp 0x20008
movq 0x10(%rsp), %rbp
movq 0x28(%rsp), %r13
movq 0x18(%rsp), %r12
jmp 0x1f3d7
movl $0x0, 0x30(%r14)
movq %r15, 0xb8(%r14)
movq 0x40(%rsp), %rax
movq %rax, 0xc0(%r14)
movb $0x0, 0x38(%r14)
movq 0xb8(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r14)
cmpb $0x0, (%rax)
je 0x1fee1
leaq 0xd511(%rip), %rax      # 0x2d3ed
jmp 0x1ff6b
movq %r14, %rdi
callq 0x1df98
testb %al, %al
je 0x1fef6
leaq 0xd509(%rip), %rax      # 0x2d3fd
jmp 0x1ff6b
movq %r14, %rdi
callq 0x1df98
movzbl %al, %eax
movq %rax, 0xc0(%rsp)
cmpb $0x2, %al
jb 0x1ff16
leaq 0xd4fb(%rip), %rax      # 0x2d40f
jmp 0x1ff6b
movl (%r14), %esi
testl %esi, %esi
je 0x1ff64
movl 0x4(%r14), %ecx
testl %ecx, %ecx
je 0x1ff64
testb %bl, %bl
je 0x1ff8a
movq 0x10(%rsp), %rbp
movl $0x1, 0x8(%rbp)
movl $0x40000000, %eax       # imm = 0x40000000
xorl %edx, %edx
divl %esi
shrl $0x2, %eax
cmpl %ecx, %eax
jae 0x1fff3
leaq 0xd2af(%rip), %rax      # 0x2d1ff
movq %rax, 0x18459(%rip)     # 0x383b0
xorl %ecx, %ecx
movl %ebx, %eax
movl %eax, 0xc(%rsp)
jmp 0x1f3ba
leaq 0xd4b9(%rip), %rax      # 0x2d424
movq %rax, 0x1843e(%rip)     # 0x383b0
xorl %ecx, %ecx
movl %ebx, %eax
movl %eax, 0xc(%rsp)
movl $0x0, 0x4(%rsp)
movq %r14, %rbp
jmp 0x1f3c2
movq 0x78(%rsp), %rax
andl $0x2, %eax
xorl %edx, %edx
cmpb $0x4, %bpl
setae %dl
leal 0x1(%rdx,%rax), %edi
movq 0x10(%rsp), %rbp
movl %edi, 0x8(%rbp)
movl $0x40000000, %eax       # imm = 0x40000000
xorl %edx, %edx
divl %esi
xorl %edx, %edx
divl %edi
cmpl %ecx, %eax
jae 0x1ffd5
leaq 0xd240(%rip), %rax      # 0x2d1ff
movq %rax, 0x183ea(%rip)     # 0x383b0
xorl %ecx, %ecx
movl $0x0, 0xc(%rsp)
jmp 0x1f3ba
cmpl $0x2, 0x3c(%rsp)
jne 0x1fff3
movl $0x1, 0x4(%rsp)
xorl %ecx, %ecx
movl $0x0, 0xc(%rsp)
jmp 0x1f3c2
movb $0x1, %cl
movl %ebx, %eax
movl %eax, 0xc(%rsp)
jmp 0x1f3c2
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
addq $0x4f8, %rsp            # imm = 0x4F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd56c(%rip), %rdi      # 0x2d591
leaq 0xd2ad(%rip), %rsi      # 0x2d2d9
leaq 0xd577(%rip), %rcx      # 0x2d5aa
movl $0x1070, %edx           # imm = 0x1070
callq 0x4200