// File: /workspace/github_c_makefile_star2_O1/archer1357[P]Offline-Raytracer/stb_image.c
// Function: stbi__process_marker
static int stbi__process_marker(stbi__jpeg *z, int m)
{
   int L;
   switch (m) {
      case STBI__MARKER_none: // no marker found
         return stbi__err("expected marker","Corrupt JPEG");

      case 0xC2: // stbi__SOF - progressive
         return stbi__err("progressive jpeg","JPEG format not supported (progressive)");

      case 0xDD: // DRI - specify restart interval
         if (stbi__get16be(z->s) != 4) return stbi__err("bad DRI len","Corrupt JPEG");
         z->restart_interval = stbi__get16be(z->s);
         return 1;

      case 0xDB: // DQT - define quantization table
         L = stbi__get16be(z->s)-2;
         while (L > 0) {
            int q = stbi__get8(z->s);
            int p = q >> 4;
            int t = q & 15,i;
            if (p != 0) return stbi__err("bad DQT type","Corrupt JPEG");
            if (t > 3) return stbi__err("bad DQT table","Corrupt JPEG");
            for (i=0; i < 64; ++i)
               z->dequant[t][stbi__jpeg_dezigzag[i]] = stbi__get8(z->s);
            #ifdef STBI_SIMD
            for (i=0; i < 64; ++i)
               z->dequant2[t][i] = z->dequant[t][i];
            #endif
            L -= 65;
         }
         return L==0;

      case 0xC4: // DHT - define huffman table
         L = stbi__get16be(z->s)-2;
         while (L > 0) {
            stbi_uc *v;
            int sizes[16],i,n=0;
            int q = stbi__get8(z->s);
            int tc = q >> 4;
            int th = q & 15;
            if (tc > 1 || th > 3) return stbi__err("bad DHT header","Corrupt JPEG");
            for (i=0; i < 16; ++i) {
               sizes[i] = stbi__get8(z->s);
               n += sizes[i];
            }
            L -= 17;
            if (tc == 0) {
               if (!stbi__build_huffman(z->huff_dc+th, sizes)) return 0;
               v = z->huff_dc[th].values;
            } else {
               if (!stbi__build_huffman(z->huff_ac+th, sizes)) return 0;
               v = z->huff_ac[th].values;
            }
            for (i=0; i < n; ++i)
               v[i] = stbi__get8(z->s);
            L -= n;
         }
         return L==0;
   }
   // check for comment block or APP blocks
   if ((m >= 0xE0 && m <= 0xEF) || m == 0xFE) {
      stbi__skip(z->s, stbi__get16be(z->s)-2);
      return 1;
   }
   return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
cmpl $0xda, %esi
jle 0x40f046
cmpl $0xdb, %esi
je 0x40f181
cmpl $0xdd, %esi
je 0x40f230
cmpl $0xff, %esi
jne 0x40f282
leaq 0xc8748(%rip), %rax     # 0x4d7789
jmp 0x40f2d4
cmpl $0xc2, %esi
je 0x40f279
cmpl $0xc4, %esi
jne 0x40f282
movq (%rbx), %r14
movq %r14, %rdi
callq 0x40f6b6
movzbl %al, %r15d
shll $0x8, %r15d
movq %r14, %rdi
callq 0x40f6b6
movzbl %al, %eax
addl %eax, %r15d
addl $-0x2, %r15d
leaq 0x1a48(%rbx), %rax
movq %rax, (%rsp)
leaq 0x8(%rbx), %rax
movq %rax, 0x8(%rsp)
testl %r15d, %r15d
jle 0x40f228
movq (%rbx), %rdi
callq 0x40f6b6
movl %eax, %ebp
movl %eax, %r12d
andb $0xf, %r12b
cmpb $0x20, %al
setae %al
cmpb $0x4, %r12b
setae %cl
orb %al, %cl
je 0x40f0d4
leaq 0xc8709(%rip), %rax     # 0x4d77d1
movq %rax, 0x10c471(%rip)    # 0x51b540
jmp 0x40f172
xorl %r13d, %r13d
xorl %r14d, %r14d
movq (%rbx), %rdi
callq 0x40f6b6
movzbl %al, %eax
movl %eax, 0x10(%rsp,%r13,4)
addl %eax, %r14d
incq %r13
cmpq $0x10, %r13
jne 0x40f0da
addl $-0x11, %r15d
movzbl %r12b, %r12d
imulq $0x690, %r12, %rdi      # imm = 0x690
cmpb $0xf, %bpl
ja 0x40f121
addq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x40f73a
movl $0x8, %ecx
jmp 0x40f134
addq (%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x40f73a
movl $0x1a48, %ecx           # imm = 0x1A48
testl %eax, %eax
je 0x40f172
testl %r14d, %r14d
je 0x40f16b
addq %rbx, %rcx
imulq $0x690, %r12, %rax      # imm = 0x690
leaq (%rax,%rcx), %r12
addq $0x400, %r12            # imm = 0x400
movl %r14d, %r13d
xorl %ebp, %ebp
movq (%rbx), %rdi
callq 0x40f6b6
movb %al, (%r12,%rbp)
incq %rbp
cmpq %rbp, %r13
jne 0x40f157
subl %r14d, %r15d
movb $0x1, %al
jmp 0x40f174
xorl %eax, %eax
testb %al, %al
jne 0x40f097
jmp 0x40f2db
movq (%rbx), %r14
movq %r14, %rdi
callq 0x40f6b6
movzbl %al, %r15d
shll $0x8, %r15d
movq %r14, %rdi
callq 0x40f6b6
movzbl %al, %eax
leal (%rax,%r15), %ebp
addl $-0x2, %ebp
leaq 0x3488(%rbx), %rax
movq %rax, (%rsp)
leaq 0xc8238(%rip), %r12     # 0x4d73f0
leaq 0xc85f7(%rip), %r14     # 0x4d77b6
testl %ebp, %ebp
jle 0x40f228
movq (%rbx), %rdi
callq 0x40f6b6
cmpb $0x10, %al
jae 0x40f1e5
andb $0xf, %al
cmpb $0x3, %al
jbe 0x40f1f0
leaq 0xc85e7(%rip), %rax     # 0x4d77c3
movq %rax, 0x10c35d(%rip)    # 0x51b540
jmp 0x40f1ec
movq %r14, 0x10c354(%rip)    # 0x51b540
xorl %eax, %eax
jmp 0x40f21f
movzbl %al, %r15d
shll $0x6, %r15d
addq (%rsp), %r15
xorl %r13d, %r13d
movq (%rbx), %rdi
callq 0x40f6b6
movzbl (%r13,%r12), %ecx
movb %al, (%rcx,%r15)
incq %r13
cmpq $0x40, %r13
jne 0x40f1ff
addl $-0x41, %ebp
movb $0x1, %al
testb %al, %al
jne 0x40f1bf
jmp 0x40f2db
sete %al
jmp 0x40f2dd
movq (%rbx), %r14
movq %r14, %rdi
callq 0x40f6b6
movzbl %al, %ebp
shll $0x8, %ebp
movq %r14, %rdi
callq 0x40f6b6
movzbl %al, %eax
orl %ebp, %eax
cmpl $0x4, %eax
jne 0x40f2cd
movq (%rbx), %r14
movq %r14, %rdi
callq 0x40f6b6
movzbl %al, %ebp
shll $0x8, %ebp
movq %r14, %rdi
callq 0x40f6b6
movzbl %al, %eax
orl %ebp, %eax
movl %eax, 0x36e4(%rbx)
jmp 0x40f2c9
leaq 0xc8519(%rip), %rax     # 0x4d7799
jmp 0x40f2d4
movl %esi, %eax
andl $-0x10, %eax
cmpl $0xe0, %eax
setne %al
cmpl $0xfe, %esi
setne %cl
testb %al, %cl
jne 0x40f2db
movq (%rbx), %rbx
movq %rbx, %rdi
callq 0x40f6b6
movzbl %al, %r14d
shll $0x8, %r14d
movq %rbx, %rdi
callq 0x40f6b6
movzbl %al, %eax
leal (%rax,%r14), %esi
addl $-0x2, %esi
movq %rbx, %rdi
callq 0x40f87d
movb $0x1, %al
jmp 0x40f2dd
leaq 0xc84d6(%rip), %rax     # 0x4d77aa
movq %rax, 0x10c265(%rip)    # 0x51b540
xorl %eax, %eax
movzbl %al, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq