// File: /workspace/github_c_makefile_star2_O1/zhiyb[P]png2tlg/./stb_image.h
// Function: stbi__process_frame_header(stbi__jpeg*, int)
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 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 && c != 4) return stbi__err("bad component count","Corrupt JPEG");
   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 SOF len","Corrupt JPEG");

   z->rgb = 0;
   for (i=0; i < s->img_n; ++i) {
      static const unsigned char rgb[3] = { 'R', 'G', 'B' };
      z->img_comp[i].id = stbi__get8(s);
      if (s->img_n == 3 && z->img_comp[i].id == rgb[i])
         ++z->rgb;
      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 != STBI__SCAN_load) return 1;

   if (!stbi__mad3sizes_valid(s->img_x, s->img_y, s->img_n, 0)) 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;
   // these sizes can't be more than 17 bits
   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
      //
      // img_mcu_x, img_mcu_y: <=17 bits; comp[i].h and .v are <=4 (checked earlier)
      // so these muls can't overflow with 32-bit ints (which we require)
      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].coeff = 0;
      z->img_comp[i].raw_coeff = 0;
      z->img_comp[i].linebuf = NULL;
      z->img_comp[i].raw_data = stbi__malloc_mad2(z->img_comp[i].w2, z->img_comp[i].h2, 15);
      if (z->img_comp[i].raw_data == NULL)
         return stbi__free_jpeg_components(z, i+1, stbi__err("outofmem", "Out of memory"));
      // align blocks for idct using mmx/sse
      z->img_comp[i].data = (stbi_uc*) (((size_t) z->img_comp[i].raw_data + 15) & ~15);
      if (z->progressive) {
         // w2, h2 are multiples of 8 (see above)
         z->img_comp[i].coeff_w = z->img_comp[i].w2 / 8;
         z->img_comp[i].coeff_h = z->img_comp[i].h2 / 8;
         z->img_comp[i].raw_coeff = stbi__malloc_mad3(z->img_comp[i].w2, z->img_comp[i].h2, sizeof(short), 15);
         if (z->img_comp[i].raw_coeff == NULL)
            return stbi__free_jpeg_components(z, i+1, stbi__err("outofmem", "Out of memory"));
         z->img_comp[i].coeff = (short*) (((size_t) z->img_comp[i].raw_coeff + 15) & ~15);
      }
   }

   return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movq (%rdi), %r14
movq %r14, %rdi
callq 0xf497
cmpl $0xa, %eax
ja 0xedbd
leaq 0x8ce0(%rip), %rax      # 0x17a98
jmp 0xf3b0
movl %eax, %r15d
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jb 0xee2d
cmpl $0x0, 0x30(%r14)
je 0xeea3
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r12
movl 0x34(%r14), %edx
movq %r12, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0xee07
movq %r12, 0xb8(%r14)
cltq
addq %r12, %rax
movq %rax, 0xc0(%r14)
jmp 0xee26
movl $0x0, 0x30(%r14)
movq %r12, 0xb8(%r14)
leaq 0x39(%r14), %rax
movq %rax, 0xc0(%r14)
movb $0x0, 0x38(%r14)
movq 0xb8(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r14)
cmpb $0x8, (%rax)
jne 0xeea3
movq %r14, %rdi
callq 0xf497
movl %eax, 0x4(%r14)
testl %eax, %eax
je 0xeeaf
movq %r14, %rdi
callq 0xf497
movl %eax, (%r14)
testl %eax, %eax
je 0xeebb
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jb 0xeef1
cmpl $0x0, 0x30(%r14)
je 0xeec7
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r12
movl 0x34(%r14), %edx
movq %r12, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0xeecb
movq %r12, 0xb8(%r14)
cltq
addq %r12, %rax
movq %rax, 0xc0(%r14)
jmp 0xeeea
leaq 0x8bfa(%rip), %rax      # 0x17aa4
jmp 0xf3b0
leaq 0x8bf9(%rip), %rax      # 0x17aaf
jmp 0xf3b0
leaq 0x8bfe(%rip), %rax      # 0x17ac0
jmp 0xf3b0
xorl %eax, %eax
jmp 0xeefe
movl $0x0, 0x30(%r14)
movq %r12, 0xb8(%r14)
leaq 0x39(%r14), %rax
movq %rax, 0xc0(%r14)
movb $0x0, 0x38(%r14)
movq 0xb8(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r14)
movb (%rax), %al
cmpb $0x4, %al
ja 0xf3a9
movzbl %al, %eax
movl $0x1a, %ecx
btl %eax, %ecx
jae 0xf3a9
movl %eax, 0x8(%r14)
testl %eax, %eax
je 0xef45
movl %eax, %ecx
shll $0x5, %ecx
leaq (%rcx,%rcx,2), %rcx
xorl %edx, %edx
xorl %esi, %esi
movq %rdx, 0x46d0(%rbx,%rsi)
movq %rdx, 0x46e8(%rbx,%rsi)
addq $0x60, %rsi
cmpq %rsi, %rcx
jne 0xef2c
leal (%rax,%rax,2), %eax
addl $0x8, %eax
cmpl %eax, %r15d
jne 0xedb1
movl $0x0, 0x4850(%rbx)
movl 0x8(%r14), %r13d
testl %r13d, %r13d
jle 0xf162
leaq 0x38(%r14), %rsi
leaq 0x39(%r14), %rax
movq %rax, 0x8(%rsp)
leaq 0x46ac(%rbx), %r12
xorl %r15d, %r15d
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jb 0xefef
cmpl $0x0, 0x30(%r14)
je 0xefc1
movq 0x28(%r14), %rdi
movl 0x34(%r14), %edx
movq %rsi, %r13
callq *0x10(%r14)
testl %eax, %eax
je 0xefc5
movq %r13, 0xb8(%r14)
cltq
addq %r13, %rax
movq %rax, 0xc0(%r14)
jmp 0xefe5
xorl %eax, %eax
jmp 0xeffc
movl $0x0, 0x30(%r14)
movq %r13, 0xb8(%r14)
movq 0x8(%rsp), %rax
movq %rax, 0xc0(%r14)
movb $0x0, 0x38(%r14)
movq %r13, %rsi
movq 0xb8(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r14)
movb (%rax), %al
movzbl %al, %ecx
movl %ecx, -0xc(%r12)
cmpl $0x3, 0x8(%r14)
jne 0xf01e
leaq 0x840d(%rip), %rcx      # 0x1741f
cmpb (%r15,%rcx), %al
jne 0xf01e
incl 0x4850(%rbx)
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jb 0xf08b
cmpl $0x0, 0x30(%r14)
je 0xf05d
movq 0x28(%r14), %rdi
movl 0x34(%r14), %edx
movq %rsi, %r13
callq *0x10(%r14)
testl %eax, %eax
je 0xf061
movq %r13, 0xb8(%r14)
cltq
addq %r13, %rax
movq %rax, 0xc0(%r14)
jmp 0xf081
xorl %eax, %eax
jmp 0xf098
movl $0x0, 0x30(%r14)
movq %r13, 0xb8(%r14)
movq 0x8(%rsp), %rax
movq %rax, 0xc0(%r14)
movb $0x0, 0x38(%r14)
movq %r13, %rsi
movq 0xb8(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r14)
movb (%rax), %al
movzbl %al, %eax
movl %eax, %ecx
shrl $0x4, %ecx
movl %ecx, -0x8(%r12)
leal -0x50(%rax), %ecx
cmpb $-0x41, %cl
jbe 0xf3cc
andl $0xf, %eax
movl %eax, -0x4(%r12)
addl $-0x5, %eax
cmpl $-0x5, %eax
jbe 0xf3d5
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jb 0xf132
cmpl $0x0, 0x30(%r14)
je 0xf104
movq 0x28(%r14), %rdi
movl 0x34(%r14), %edx
movq %rsi, %r13
callq *0x10(%r14)
testl %eax, %eax
je 0xf108
movq %r13, 0xb8(%r14)
cltq
addq %r13, %rax
movq %rax, 0xc0(%r14)
jmp 0xf128
xorl %eax, %eax
jmp 0xf13f
movl $0x0, 0x30(%r14)
movq %r13, 0xb8(%r14)
movq 0x8(%rsp), %rax
movq %rax, 0xc0(%r14)
movb $0x0, 0x38(%r14)
movq %r13, %rsi
movq 0xb8(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r14)
movb (%rax), %al
movzbl %al, %eax
movl %eax, (%r12)
cmpb $0x4, %al
jae 0xf3de
incq %r15
movslq 0x8(%r14), %r13
addq $0x60, %r12
cmpq %r13, %r15
jl 0xef82
movl $0x1, %r12d
testl %ebp, %ebp
jne 0xf3ba
movl (%r14), %edi
movl 0x4(%r14), %esi
xorl %r12d, %r12d
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movl %r13d, %edx
xorl %ecx, %ecx
callq 0xf725
testl %eax, %eax
je 0xf3e7
movl $0x1, %r12d
movl %r13d, %ecx
movl $0x1, %r15d
movl $0x1, %r8d
testl %r13d, %r13d
jle 0xf1ee
movq %rcx, %rax
shlq $0x5, %rax
leaq (%rax,%rax,2), %rax
movl $0x1, %r8d
xorl %edx, %edx
movl $0x1, %r15d
movl 0x46a4(%rbx,%rdx), %esi
movl 0x46a8(%rbx,%rdx), %edi
cmpl %r15d, %esi
cmovgl %esi, %r15d
cmpl %r8d, %edi
cmovgl %edi, %r8d
addq $0x60, %rdx
cmpq %rdx, %rax
jne 0xf1c9
movl %r15d, 0x4688(%rbx)
movl %r8d, 0x468c(%rbx)
leal (,%r15,8), %esi
movl %esi, 0x4698(%rbx)
leal (,%r8,8), %edi
movl %edi, 0x469c(%rbx)
movq 0x30(%rsp), %rax
leal (%rax,%r15,8), %eax
decl %eax
xorl %edx, %edx
divl %esi
movl %eax, 0x20(%rsp)
movl %eax, 0x4690(%rbx)
movq 0x28(%rsp), %rax
leal (%rax,%r8,8), %eax
decl %eax
xorl %edx, %edx
divl %edi
movl %eax, 0x1c(%rsp)
movl %eax, 0x4694(%rbx)
testl %r13d, %r13d
jle 0xf3ba
leal -0x1(%r15), %eax
movl %eax, 0x18(%rsp)
leal -0x1(%r8), %eax
movl %eax, 0x14(%rsp)
shlq $0x5, %rcx
leaq (%rcx,%rcx,2), %rax
movq %rax, 0x38(%rsp)
movl $0x1, %eax
xorl %r13d, %r13d
movq %r8, 0x40(%rsp)
movl %eax, 0x8(%rsp)
movl 0x46a4(%rbx,%r13), %r12d
movl 0x46a8(%rbx,%r13), %ebp
movl %r12d, %eax
imull 0x30(%rsp), %eax
addl 0x18(%rsp), %eax
xorl %edx, %edx
divl %r15d
movl %eax, 0x46bc(%rbx,%r13)
movl %ebp, %eax
imull 0x28(%rsp), %eax
addl 0x14(%rsp), %eax
xorl %edx, %edx
divl %r8d
movl %eax, 0x46c0(%rbx,%r13)
imull 0x20(%rsp), %r12d
leal (,%r12,8), %edi
movl %edi, 0x46c4(%rbx,%r13)
imull 0x1c(%rsp), %ebp
leal (,%rbp,8), %r14d
movl %r14d, 0x46c8(%rbx,%r13)
movl %edi, 0x24(%rsp)
movl %r14d, %esi
movl $0xf, %edx
callq 0xf782
xorps %xmm0, %xmm0
movups %xmm0, 0x46e0(%rbx,%r13)
movq $0x0, 0x46f0(%rbx,%r13)
movq %rax, 0x46d8(%rbx,%r13)
testq %rax, %rax
je 0xf3f7
addq $0xf, %rax
andq $-0x10, %rax
movq %rax, 0x46d0(%rbx,%r13)
cmpl $0x0, 0x4830(%rbx)
je 0xf387
movl %r12d, 0x46f8(%rbx,%r13)
movl %ebp, 0x46fc(%rbx,%r13)
movl 0x24(%rsp), %edi
movl %r14d, %esi
movl $0x2, %edx
movl $0xf, %ecx
callq 0xf848
movq %rax, 0x46e0(%rbx,%r13)
testq %rax, %rax
je 0xf3f7
addq $0xf, %rax
andq $-0x10, %rax
movq %rax, 0x46f0(%rbx,%r13)
movl 0x8(%rsp), %eax
incl %eax
addq $0x60, %r13
movl $0x1, %r12d
cmpq %r13, 0x38(%rsp)
movq 0x40(%rsp), %r8
jne 0xf27d
jmp 0xf3ba
leaq 0x8718(%rip), %rax      # 0x17ac8
movq %rax, 0xce71(%rip)      # 0x1c228
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8709(%rip), %rax      # 0x17adc
jmp 0xf3b0
leaq 0x8706(%rip), %rax      # 0x17ae2
jmp 0xf3b0
leaq 0x8703(%rip), %rax      # 0x17ae8
jmp 0xf3b0
leaq 0x8701(%rip), %rax      # 0x17aef
movq %rax, 0xce33(%rip)      # 0x1c228
jmp 0xf3ba
leaq 0x86fb(%rip), %rax      # 0x17af9
movq %rax, 0xce23(%rip)      # 0x1c228
movq %rbx, %rdi
movl 0x8(%rsp), %esi
callq 0xf7c5
jmp 0xf3b7