// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/stb_image.c
// Function: stbi__process_scan_header
static int stbi__process_scan_header(stbi__jpeg *z)
{
   int i;
   int Ls = stbi__get16be(z->s);
   z->scan_n = stbi__get8(z->s);
   if (z->scan_n < 1 || z->scan_n > 4 || z->scan_n > (int) z->s->img_n) return stbi__err("bad stbi__SOS component count","Corrupt JPEG");
   if (Ls != 6+2*z->scan_n) return stbi__err("bad stbi__SOS len","Corrupt JPEG");
   for (i=0; i < z->scan_n; ++i) {
      int id = stbi__get8(z->s), which;
      int q = stbi__get8(z->s);
      for (which = 0; which < z->s->img_n; ++which)
         if (z->img_comp[which].id == id)
            break;
      if (which == z->s->img_n) return 0;
      z->img_comp[which].hd = q >> 4;   if (z->img_comp[which].hd > 3) return stbi__err("bad DC huff","Corrupt JPEG");
      z->img_comp[which].ha = q & 15;   if (z->img_comp[which].ha > 3) return stbi__err("bad AC huff","Corrupt JPEG");
      z->order[i] = which;
   }
   if (stbi__get8(z->s) != 0) return stbi__err("bad stbi__SOS","Corrupt JPEG");
   stbi__get8(z->s); // should be 63, but might be 0
   if (stbi__get8(z->s) != 0) return stbi__err("bad stbi__SOS","Corrupt JPEG");

   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x415aa0
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x415960
movzbl %al, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x36d0(%rax)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x36d0(%rax)
jl 0x416d34
movq -0x10(%rbp), %rax
cmpl $0x4, 0x36d0(%rax)
jg 0x416d34
movq -0x10(%rbp), %rax
movl 0x36d0(%rax), %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x8(%rcx), %eax
jle 0x416d48
leaq 0xce7b6(%rip), %rdi     # 0x4e54f1
callq 0x411080
movl %eax, -0x4(%rbp)
jmp 0x416f20
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x36d0(%rcx), %ecx
shll %ecx
addl $0x6, %ecx
cmpl %ecx, %eax
je 0x416d72
leaq 0xce7aa(%rip), %rdi     # 0x4e550f
callq 0x411080
movl %eax, -0x4(%rbp)
jmp 0x416f20
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x36d0(%rcx), %eax
jge 0x416ec3
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x415960
movzbl %al, %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x415960
movzbl %al, %eax
movl %eax, -0x24(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x8(%rcx), %eax
jge 0x416df1
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x20(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
cmpl -0x1c(%rbp), %eax
jne 0x416de4
jmp 0x416df1
jmp 0x416de6
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x416db7
movl -0x20(%rbp), %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x8(%rcx), %eax
jne 0x416e0c
movl $0x0, -0x4(%rbp)
jmp 0x416f20
movl -0x24(%rbp), %ecx
sarl $0x4, %ecx
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x20(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x20(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $0x3, 0x10(%rax)
jle 0x416e59
leaq 0xce6d5(%rip), %rdi     # 0x4e5521
callq 0x411080
movl %eax, -0x4(%rbp)
jmp 0x416f20
movl -0x24(%rbp), %ecx
andl $0xf, %ecx
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x20(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x14(%rax)
movq -0x10(%rbp), %rax
addq $0x35a0, %rax           # imm = 0x35A0
movslq -0x20(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $0x3, 0x14(%rax)
jle 0x416ea3
leaq 0xce694(%rip), %rdi     # 0x4e552d
callq 0x411080
movl %eax, -0x4(%rbp)
jmp 0x416f20
movl -0x20(%rbp), %edx
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl %edx, 0x36d4(%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x416d79
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x415960
movzbl %al, %eax
cmpl $0x0, %eax
je 0x416ee8
leaq 0xce65b(%rip), %rdi     # 0x4e5539
callq 0x411080
movl %eax, -0x4(%rbp)
jmp 0x416f20
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x415960
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x415960
movzbl %al, %eax
cmpl $0x0, %eax
je 0x416f19
leaq 0xce62a(%rip), %rdi     # 0x4e5539
callq 0x411080
movl %eax, -0x4(%rbp)
jmp 0x416f20
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)