// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/stb_image.c
// Function: stbi__process_frame_header
static int stbi__process_frame_header(stbi__jpeg *z, int scan)
{
   stbi__context *s = z->s;
   int Lf,p,i,q, h_max=1,v_max=1,c;
   Lf = stbi__get16be(s);         if (Lf < 11) return stbi__err("bad stbi__SOF len","Corrupt JPEG"); // JPEG
   p  = stbi__get8(s);          if (p != 8) return stbi__err("only 8-bit","JPEG format not supported: 8-bit only"); // JPEG baseline
   s->img_y = stbi__get16be(s);   if (s->img_y == 0) return stbi__err("no header height", "JPEG format not supported: delayed height"); // Legal, but we don't handle it--but neither does IJG
   s->img_x = stbi__get16be(s);   if (s->img_x == 0) return stbi__err("0 width","Corrupt JPEG"); // JPEG requires
   c = stbi__get8(s);
   if (c != 3 && c != 1) return stbi__err("bad component count","Corrupt JPEG");    // JFIF requires
   s->img_n = c;
   for (i=0; i < c; ++i) {
      z->img_comp[i].data = NULL;
      z->img_comp[i].linebuf = NULL;
   }

   if (Lf != 8+3*s->img_n) return stbi__err("bad stbi__SOF len","Corrupt JPEG");

   for (i=0; i < s->img_n; ++i) {
      z->img_comp[i].id = stbi__get8(s);
      if (z->img_comp[i].id != i+1)   // JFIF requires
         if (z->img_comp[i].id != i)  // some version of jpegtran outputs non-JFIF-compliant files!
            return stbi__err("bad component ID","Corrupt JPEG");
      q = stbi__get8(s);
      z->img_comp[i].h = (q >> 4);  if (!z->img_comp[i].h || z->img_comp[i].h > 4) return stbi__err("bad H","Corrupt JPEG");
      z->img_comp[i].v = q & 15;    if (!z->img_comp[i].v || z->img_comp[i].v > 4) return stbi__err("bad V","Corrupt JPEG");
      z->img_comp[i].tq = stbi__get8(s);  if (z->img_comp[i].tq > 3) return stbi__err("bad TQ","Corrupt JPEG");
   }

   if (scan != SCAN_load) return 1;

   if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err("too large", "Image too large to decode");

   for (i=0; i < s->img_n; ++i) {
      if (z->img_comp[i].h > h_max) h_max = z->img_comp[i].h;
      if (z->img_comp[i].v > v_max) v_max = z->img_comp[i].v;
   }

   // compute interleaved mcu info
   z->img_h_max = h_max;
   z->img_v_max = v_max;
   z->img_mcu_w = h_max * 8;
   z->img_mcu_h = v_max * 8;
   z->img_mcu_x = (s->img_x + z->img_mcu_w-1) / z->img_mcu_w;
   z->img_mcu_y = (s->img_y + z->img_mcu_h-1) / z->img_mcu_h;

   for (i=0; i < s->img_n; ++i) {
      // number of effective pixels (e.g. for non-interleaved MCU)
      z->img_comp[i].x = (s->img_x * z->img_comp[i].h + h_max-1) / h_max;
      z->img_comp[i].y = (s->img_y * z->img_comp[i].v + v_max-1) / v_max;
      // to simplify generation, we'll allocate enough memory to decode
      // the bogus oversized data from using interleaved MCUs and their
      // big blocks (e.g. a 16x16 iMCU on an image of width 33); we won't
      // discard the extra data until colorspace conversion
      z->img_comp[i].w2 = z->img_mcu_x * z->img_comp[i].h * 8;
      z->img_comp[i].h2 = z->img_mcu_y * z->img_comp[i].v * 8;
      z->img_comp[i].raw_data = stbi__malloc(z->img_comp[i].w2 * z->img_comp[i].h2+15);
      if (z->img_comp[i].raw_data == NULL) {
         for(--i; i >= 0; --i) {
            free(z->img_comp[i].raw_data);
            z->img_comp[i].data = NULL;
         }
         return stbi__err("outofmem", "Out of memory");
      }
      // align blocks for installable-idct using mmx/sse
      z->img_comp[i].data = (stbi_uc*) (((size_t) z->img_comp[i].raw_data + 15) & ~15);
      z->img_comp[i].linebuf = NULL;
   }

   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movl $0x1, -0x34(%rbp)
movl $0x1, -0x38(%rbp)
movq -0x20(%rbp), %rdi
callq 0x415aa0
movl %eax, -0x24(%rbp)
cmpl $0xb, -0x24(%rbp)
jge 0x41526e
leaq 0xd020c(%rip), %rdi     # 0x4e546d
callq 0x411080
movl %eax, -0x4(%rbp)
jmp 0x415949
movq -0x20(%rbp), %rdi
callq 0x415960
movzbl %al, %eax
movl %eax, -0x28(%rbp)
cmpl $0x8, -0x28(%rbp)
je 0x415297
leaq 0xd01f5(%rip), %rdi     # 0x4e547f
callq 0x411080
movl %eax, -0x4(%rbp)
jmp 0x415949
movq -0x20(%rbp), %rdi
callq 0x415aa0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jne 0x4152c7
leaq 0xd01d0(%rip), %rdi     # 0x4e548a
callq 0x411080
movl %eax, -0x4(%rbp)
jmp 0x415949
movq -0x20(%rbp), %rdi
callq 0x415aa0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x4152f5
leaq 0xd01b3(%rip), %rdi     # 0x4e549b
callq 0x411080
movl %eax, -0x4(%rbp)
jmp 0x415949
movq -0x20(%rbp), %rdi
callq 0x415960
movzbl %al, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x3, -0x3c(%rbp)
je 0x415324
cmpl $0x1, -0x3c(%rbp)
je 0x415324
leaq 0xd018c(%rip), %rdi     # 0x4e54a3
callq 0x411080
movl %eax, -0x4(%rbp)
jmp 0x415949
movl -0x3c(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x8(%rax)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x415382
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x30(%rax)
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x40(%rax)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x415335
movl -0x24(%rbp), %eax
movq -0x20(%rbp), %rcx
imull $0x3, 0x8(%rcx), %ecx
addl $0x8, %ecx
cmpl %ecx, %eax
je 0x4153a8
leaq 0xd00d2(%rip), %rdi     # 0x4e546d
callq 0x411080
movl %eax, -0x4(%rbp)
jmp 0x415949
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x415577
movq -0x20(%rbp), %rdi
callq 0x415960
movzbl %al, %ecx
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
je 0x415435
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
cmpl -0x2c(%rbp), %eax
je 0x415433
leaq 0xd0091(%rip), %rdi     # 0x4e54b7
callq 0x411080
movl %eax, -0x4(%rbp)
jmp 0x415949
jmp 0x415435
movq -0x20(%rbp), %rdi
callq 0x415960
movzbl %al, %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %ecx
sarl $0x4, %ecx
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x4(%rax)
je 0x415498
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $0x4, 0x4(%rax)
jle 0x4154ac
leaq 0xd0029(%rip), %rdi     # 0x4e54c8
callq 0x411080
movl %eax, -0x4(%rbp)
jmp 0x415949
movl -0x30(%rbp), %ecx
andl $0xf, %ecx
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x8(%rax)
je 0x415500
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $0x4, 0x8(%rax)
jle 0x415514
leaq 0xcffc7(%rip), %rdi     # 0x4e54ce
callq 0x411080
movl %eax, -0x4(%rbp)
jmp 0x415949
movq -0x20(%rbp), %rdi
callq 0x415960
movzbl %al, %ecx
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $0x3, 0xc(%rax)
jle 0x415567
leaq 0xcff7a(%rip), %rdi     # 0x4e54d4
callq 0x411080
movl %eax, -0x4(%rbp)
jmp 0x415949
jmp 0x415569
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x4153af
cmpl $0x0, -0x14(%rbp)
je 0x415589
movl $0x1, -0x4(%rbp)
jmp 0x415949
movq -0x20(%rbp), %rcx
movl $0x40000000, %eax       # imm = 0x40000000
xorl %edx, %edx
divl (%rcx)
movq -0x20(%rbp), %rcx
xorl %edx, %edx
divl 0x8(%rcx)
movq -0x20(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x4155bc
leaq 0xd9dd0(%rip), %rdi     # 0x4ef37f
callq 0x411080
movl %eax, -0x4(%rbp)
jmp 0x415949
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x415653
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
cmpl -0x34(%rbp), %eax
jle 0x41560b
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0x38(%rbp), %eax
jle 0x415643
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x38(%rbp)
jmp 0x415645
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x4155c3
movl -0x34(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x3588(%rax)
movl -0x38(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x358c(%rax)
movl -0x34(%rbp), %ecx
shll $0x3, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x3598(%rax)
movl -0x38(%rbp), %ecx
shll $0x3, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x359c(%rax)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
addl 0x3598(%rcx), %eax
subl $0x1, %eax
movq -0x10(%rbp), %rcx
xorl %edx, %edx
divl 0x3598(%rcx)
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x3590(%rax)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x10(%rbp), %rcx
addl 0x359c(%rcx), %eax
subl $0x1, %eax
movq -0x10(%rbp), %rcx
xorl %edx, %edx
divl 0x359c(%rcx)
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x3594(%rax)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x415942
movq -0x20(%rbp), %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
addq $0x35a0, %rcx           # imm = 0x35A0
movslq -0x2c(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rcx
imull 0x4(%rcx), %eax
addl -0x34(%rbp), %eax
subl $0x1, %eax
xorl %edx, %edx
divl -0x34(%rbp)
movl %eax, %ecx
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x1c(%rax)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x10(%rbp), %rcx
addq $0x35a0, %rcx           # imm = 0x35A0
movslq -0x2c(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rcx
imull 0x8(%rcx), %eax
addl -0x38(%rbp), %eax
subl $0x1, %eax
xorl %edx, %edx
divl -0x38(%rbp)
movl %eax, %ecx
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x20(%rax)
movq -0x10(%rbp), %rax
movl 0x3590(%rax), %ecx
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rax
imull 0x4(%rax), %ecx
shll $0x3, %ecx
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x24(%rax)
movq -0x10(%rbp), %rax
movl 0x3594(%rax), %ecx
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rax
imull 0x8(%rax), %ecx
shll $0x3, %ecx
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x28(%rax)
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x24(%rax), %eax
movq -0x10(%rbp), %rcx
addq $0x35a0, %rcx           # imm = 0x35A0
movslq -0x2c(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rcx
imull 0x28(%rcx), %eax
addl $0xf, %eax
movslq %eax, %rdi
callq 0x412250
movq %rax, %rcx
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x38(%rax)
jne 0x4158dd
movl -0x2c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jl 0x4158cc
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq 0x38(%rax), %rdi
callq 0x453060
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x30(%rax)
movl -0x2c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x415880
leaq 0xcfc08(%rip), %rdi     # 0x4e54db
callq 0x411080
movl %eax, -0x4(%rbp)
jmp 0x415949
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq 0x38(%rax), %rcx
addq $0xf, %rcx
andq $-0x10, %rcx
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x2c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x40(%rax)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x4156eb
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)