// File: /workspace/github_c_makefile_star2_O2/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:
cmpl $0xc2, %esi
je 0x40dd01
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
cmpl $0xc4, %esi
je 0x40db4f
cmpl $0xdb, %esi
je 0x40dc60
cmpl $0xdd, %esi
je 0x40dc3c
cmpl $0xff, %esi
jne 0x40dccd
leaq 0xc6c1f(%rip), %rax     # 0x4d4769
jmp 0x40dd3a
movq (%rbx), %rdi
callq 0x40de10
movl %eax, %ebp
addl $-0x2, %ebp
leaq 0x1a48(%rbx), %rax
movq %rax, 0x8(%rsp)
leaq 0x8(%rbx), %rax
movq %rax, (%rsp)
testl %ebp, %ebp
jle 0x40dd13
movq (%rbx), %rdi
callq 0x40dd8f
cmpb $0x1f, %al
ja 0x40dd21
movl %eax, %r15d
movl %eax, %r12d
andb $0xf, %r12b
cmpb $0x3, %r12b
ja 0x40dd21
xorl %r13d, %r13d
xorl %r14d, %r14d
cmpq $0x10, %r13
je 0x40dbc0
movq (%rbx), %rdi
callq 0x40dd8f
movzbl %al, %eax
movl %eax, 0x10(%rsp,%r13,4)
addl %eax, %r14d
incq %r13
jmp 0x40dba2
movzbl %r12b, %r12d
imulq $0x690, %r12, %rdi      # imm = 0x690
cmpb $0xf, %r15b
ja 0x40dbe4
addq (%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x40de35
pushq $0x8
popq %rcx
jmp 0x40dbf8
addq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x40de35
movl $0x1a48, %ecx           # imm = 0x1A48
testl %eax, %eax
je 0x40dd41
addl $-0x11, %ebp
addq %rbx, %rcx
imulq $0x690, %r12, %rax      # imm = 0x690
leaq (%rax,%rcx), %r15
addq $0x400, %r15            # imm = 0x400
movl %r14d, %r12d
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x40dc34
movq (%rbx), %rdi
callq 0x40dd8f
movb %al, (%r15,%r13)
incq %r13
jmp 0x40dc1e
subl %r14d, %ebp
jmp 0x40db70
movq (%rbx), %rdi
callq 0x40de10
cmpl $0x4, %eax
jne 0x40dd18
movq (%rbx), %rdi
callq 0x40de10
movl %eax, 0x36e4(%rbx)
jmp 0x40dcfd
movq (%rbx), %rdi
callq 0x40de10
movl %eax, %ebp
addl $-0x2, %ebp
leaq 0x3488(%rbx), %r14
leaq 0xc6755(%rip), %r15     # 0x4d43d0
testl %ebp, %ebp
jle 0x40dd13
movq (%rbx), %rdi
callq 0x40dd8f
cmpb $0x10, %al
jae 0x40dd2a
andb $0xf, %al
cmpb $0x3, %al
ja 0x40dd33
movzbl %al, %r12d
shll $0x6, %r12d
addq %r14, %r12
xorl %r13d, %r13d
cmpq $0x40, %r13
je 0x40dcc8
movq (%rbx), %rdi
callq 0x40dd8f
movzbl (%r13,%r15), %ecx
movb %al, (%rcx,%r12)
incq %r13
jmp 0x40dcab
addl $-0x41, %ebp
jmp 0x40dc7b
movl %esi, %eax
andl $-0x10, %eax
cmpl $0xe0, %eax
setne %al
cmpl $0xfe, %esi
setne %cl
testb %al, %cl
jne 0x40dd41
movq (%rbx), %rbx
movq %rbx, %rdi
callq 0x40de10
leal -0x2(%rax), %esi
movq %rbx, %rdi
callq 0x40df66
movb $0x1, %al
jmp 0x40dd43
leaq 0xc6a71(%rip), %rax     # 0x4d4779
movq %rax, 0x10b831(%rip)    # 0x519540
xorl %eax, %eax
jmp 0x40dd51
sete %al
jmp 0x40dd43
leaq 0xc6a6b(%rip), %rax     # 0x4d478a
jmp 0x40dd3a
leaq 0xc6a89(%rip), %rax     # 0x4d47b1
jmp 0x40dd3a
leaq 0xc6a65(%rip), %rax     # 0x4d4796
jmp 0x40dd3a
leaq 0xc6a69(%rip), %rax     # 0x4d47a3
movq %rax, 0x10b7ff(%rip)    # 0x519540
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
movzbl %al, %eax
retq