// File: /workspace/github_c_makefile_star2_O3/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 0x40fde9
cmpl $0xdb, %esi
je 0x40ff15
cmpl $0xdd, %esi
je 0x40ffa6
cmpl $0xff, %esi
jne 0x40fff8
leaq 0xc8b15(%rip), %rax     # 0x4d88f9
jmp 0x41006f
cmpl $0xc2, %esi
je 0x40ffef
cmpl $0xc4, %esi
jne 0x40fff8
movq (%rbx), %r14
movq %r14, %rdi
callq 0x410442
movzbl %al, %r15d
shll $0x8, %r15d
movq %r14, %rdi
callq 0x410442
movzbl %al, %eax
addl %eax, %r15d
addl $-0x2, %r15d
testl %r15d, %r15d
jle 0x40ff0d
leaq 0x1a48(%rbx), %rax
movq %rax, 0x8(%rsp)
leaq 0x8(%rbx), %rax
movq %rax, (%rsp)
movq (%rbx), %rdi
callq 0x410442
cmpb $0x1f, %al
ja 0x41005f
movl %eax, %ebp
movl %eax, %r12d
andb $0xf, %r12b
cmpb $0x3, %r12b
ja 0x41005f
xorl %r13d, %r13d
xorl %r14d, %r14d
movq (%rbx), %rdi
callq 0x410442
movzbl %al, %eax
movl %eax, 0x10(%rsp,%r13,4)
addl %eax, %r14d
incq %r13
cmpq $0x10, %r13
jne 0x40fe6c
movzbl %r12b, %r12d
imulq $0x690, %r12, %rdi      # imm = 0x690
cmpb $0xf, %bpl
ja 0x40feae
addq (%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x4104bd
movl $0x8, %ecx
jmp 0x40fec2
addq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x4104bd
movl $0x1a48, %ecx           # imm = 0x1A48
testl %eax, %eax
je 0x410076
testl %r14d, %r14d
je 0x40fefd
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 0x410442
movb %al, (%r12,%rbp)
incq %rbp
cmpq %rbp, %r13
jne 0x40fee9
addl $-0x11, %r15d
subl %r14d, %r15d
testl %r15d, %r15d
jg 0x40fe43
testl %r15d, %r15d
jmp 0x410051
movq (%rbx), %r14
movq %r14, %rdi
callq 0x410442
movzbl %al, %r15d
shll $0x8, %r15d
movq %r14, %rdi
callq 0x410442
movzbl %al, %eax
leal (%rax,%r15), %r14d
addl $-0x2, %r14d
testl %r14d, %r14d
jle 0x41004c
leaq 0x3488(%rbx), %r15
leaq 0xc860e(%rip), %r12     # 0x4d8560
movq (%rbx), %rdi
callq 0x410442
cmpb $0x10, %al
jae 0x410056
andb $0xf, %al
cmpb $0x3, %al
ja 0x410068
movzbl %al, %r13d
shll $0x6, %r13d
addq %r15, %r13
xorl %ebp, %ebp
movq (%rbx), %rdi
callq 0x410442
movzbl (%rbp,%r12), %ecx
movb %al, (%rcx,%r13)
incq %rbp
cmpq $0x40, %rbp
jne 0x40ff79
leal -0x41(%r14), %eax
cmpl $0x41, %r14d
movl %eax, %r14d
jg 0x40ff52
jmp 0x41004f
movq (%rbx), %r14
movq %r14, %rdi
callq 0x410442
movzbl %al, %ebp
shll $0x8, %ebp
movq %r14, %rdi
callq 0x410442
movzbl %al, %eax
orl %ebp, %eax
cmpl $0x4, %eax
jne 0x410043
movq (%rbx), %r14
movq %r14, %rdi
callq 0x410442
movzbl %al, %ebp
shll $0x8, %ebp
movq %r14, %rdi
callq 0x410442
movzbl %al, %eax
orl %ebp, %eax
movl %eax, 0x36e4(%rbx)
jmp 0x41003f
leaq 0xc8913(%rip), %rax     # 0x4d8909
jmp 0x41006f
movl %esi, %eax
andl $-0x10, %eax
cmpl $0xe0, %eax
setne %al
cmpl $0xfe, %esi
setne %cl
testb %al, %cl
jne 0x410076
movq (%rbx), %rbx
movq %rbx, %rdi
callq 0x410442
movzbl %al, %r14d
shll $0x8, %r14d
movq %rbx, %rdi
callq 0x410442
movzbl %al, %eax
leal (%rax,%r14), %esi
addl $-0x2, %esi
movq %rbx, %rdi
callq 0x41060e
movb $0x1, %al
jmp 0x410078
leaq 0xc88d0(%rip), %rax     # 0x4d891a
jmp 0x41006f
movl %r14d, %eax
testl %eax, %eax
sete %al
jmp 0x410078
leaq 0xc88c9(%rip), %rax     # 0x4d8926
jmp 0x41006f
leaq 0xc88db(%rip), %rax     # 0x4d8941
jmp 0x41006f
leaq 0xc88c4(%rip), %rax     # 0x4d8933
movq %rax, 0x10c4aa(%rip)    # 0x51c520
xorl %eax, %eax
movzbl %al, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq