// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/include/stb_image.h
// Function: stbi__process_marker(stbi__jpeg*, int)
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 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, sixteen = (p != 0);
            int t = q & 15,i;
            if (p != 0 && p != 1) 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__uint16)(sixteen ? stbi__get16be(z->s) : stbi__get8(z->s));
            L -= (sixteen ? 129 : 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);
            if (tc != 0)
               stbi__build_fast_ac(z->fast_ac[th], z->huff_ac + th);
            L -= n;
         }
         return L==0;
   }

   // check for comment block or APP blocks
   if ((m >= 0xE0 && m <= 0xEF) || m == 0xFE) {
      L = stbi__get16be(z->s);
      if (L < 2) {
         if (m == 0xFE)
            return stbi__err("bad COM len","Corrupt JPEG");
         else
            return stbi__err("bad APP len","Corrupt JPEG");
      }
      L -= 2;

      if (m == 0xE0 && L >= 5) { // JFIF APP0 segment
         static const unsigned char tag[5] = {'J','F','I','F','\0'};
         int ok = 1;
         int i;
         for (i=0; i < 5; ++i)
            if (stbi__get8(z->s) != tag[i])
               ok = 0;
         L -= 5;
         if (ok)
            z->jfif = 1;
      } else if (m == 0xEE && L >= 12) { // Adobe APP14 segment
         static const unsigned char tag[6] = {'A','d','o','b','e','\0'};
         int ok = 1;
         int i;
         for (i=0; i < 6; ++i)
            if (stbi__get8(z->s) != tag[i])
               ok = 0;
         L -= 6;
         if (ok) {
            stbi__get8(z->s); // version
            stbi__get16be(z->s); // flags0
            stbi__get16be(z->s); // flags1
            z->app14_color_transform = stbi__get8(z->s); // color transform
            L -= 6;
         }
      }

      stbi__skip(z->s, L);
      return 1;
   }

   return stbi__err("unknown marker","Corrupt JPEG");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %esi, %r14d
movq %rdi, %rbx
cmpl $0xdc, %esi
movq %rdi, 0x10(%rsp)
jg 0x30e6a
cmpl $0xc4, %r14d
je 0x30ed6
cmpl $0xdb, %r14d
jne 0x30e8c
movq (%rbx), %rdi
callq 0x31b23
leal -0x2(%rax), %r12d
cmpl $0x3, %eax
jb 0x30e62
leaq 0x3488(%rbx), %rax
movq %rax, 0x8(%rsp)
movq (%rbx), %r15
movq 0xb8(%r15), %rax
cmpq 0xc0(%r15), %rax
jae 0x30cf9
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r15)
movb (%rax), %al
jmp 0x30d55
cmpl $0x0, 0x30(%r15)
je 0x30d22
movq 0x28(%r15), %rdi
leaq 0x38(%r15), %r14
movl 0x34(%r15), %edx
movq %r14, %rsi
callq *0x10(%r15)
testl %eax, %eax
je 0x30d30
movslq %eax, %rcx
addq %r14, %rcx
movb (%r14), %al
jmp 0x30d43
xorl %r13d, %r13d
xorl %eax, %eax
leaq 0xcba2(%rip), %r15      # 0x3d8d0
jmp 0x30d87
movl $0x0, 0x30(%r15)
leaq 0x39(%r15), %rcx
movb $0x0, 0x38(%r15)
xorl %eax, %eax
movq %rcx, 0xc0(%r15)
leaq 0x39(%r15), %rcx
movq %rcx, 0xb8(%r15)
movzbl %al, %eax
cmpb $0x10, %al
setae %r13b
setb %cl
movl %eax, %edx
andl $-0x10, %edx
cmpl $0x10, %edx
sete %dl
orb %cl, %dl
leaq 0xcb5b(%rip), %r15      # 0x3d8d0
je 0x31320
andl $0xf, %eax
cmpl $0x3, %eax
ja 0x31329
movq %r12, 0x10(%rsp)
movl %eax, %r12d
shll $0x7, %r12d
addq 0x8(%rsp), %r12
xorl %ebp, %ebp
movq (%rbx), %r14
testb %r13b, %r13b
je 0x30dac
movq %r14, %rdi
callq 0x31b23
jmp 0x30e27
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jae 0x30dcb
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r14)
movb (%rax), %al
jmp 0x30e24
cmpl $0x0, 0x30(%r14)
je 0x30df4
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r15
movl 0x34(%r14), %edx
movq %r15, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x30df8
movslq %eax, %rcx
addq %r15, %rcx
movb (%r15), %al
jmp 0x30e0b
xorl %eax, %eax
jmp 0x30e24
movl $0x0, 0x30(%r14)
leaq 0x39(%r14), %rcx
movb $0x0, 0x38(%r14)
xorl %eax, %eax
leaq 0xcabe(%rip), %r15      # 0x3d8d0
movq %rcx, 0xc0(%r14)
leaq 0x39(%r14), %rcx
movq %rcx, 0xb8(%r14)
movzbl %al, %eax
movzbl (%rbp,%r15), %ecx
movw %ax, (%r12,%rcx,2)
incq %rbp
cmpq $0x40, %rbp
jne 0x30d9a
xorb $0x1, %r13b
movzbl %r13b, %eax
shll $0x6, %eax
movq 0x10(%rsp), %r12
addl %eax, %r12d
addl $0xffffff7f, %r12d      # imm = 0xFFFFFF7F
testl %r12d, %r12d
jg 0x30cd7
testl %r12d, %r12d
jmp 0x311fe
cmpl $0xdd, %r14d
je 0x31206
cmpl $0xff, %r14d
jne 0x30e8c
leaq 0xea1b(%rip), %rax      # 0x3f8a2
jmp 0x31339
movl %r14d, %eax
andl $-0x10, %eax
cmpl $0xe0, %eax
setne %al
cmpl $0xfe, %r14d
setne %cl
testb %al, %cl
jne 0x31226
movq (%rbx), %rdi
callq 0x31b23
cmpl $0x1, %eax
ja 0x3123e
cmpl $0xfe, %r14d
jne 0x31332
leaq 0xea17(%rip), %rax      # 0x3f8e8
jmp 0x31339
movq (%rbx), %rdi
callq 0x31b23
leal -0x2(%rax), %ebp
cmpl $0x3, %eax
jb 0x311fc
leaq 0x1a48(%rbx), %rax
movq %rax, 0x20(%rsp)
leaq 0x8(%rbx), %rax
movq %rax, 0x38(%rsp)
leaq 0x3688(%rbx), %rax
movq %rax, 0x30(%rsp)
movq (%rbx), %r14
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jae 0x30f2d
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r14)
movb (%rax), %cl
jmp 0x30f7e
cmpl $0x0, 0x30(%r14)
je 0x30f55
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r15
movl 0x34(%r14), %edx
movq %r15, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x30f59
cltq
addq %r15, %rax
movb (%r15), %cl
jmp 0x30f6c
xorl %ecx, %ecx
jmp 0x30f7e
movl $0x0, 0x30(%r14)
leaq 0x39(%r14), %rax
movb $0x0, 0x38(%r14)
xorl %ecx, %ecx
movq %rax, 0xc0(%r14)
leaq 0x39(%r14), %rax
movq %rax, 0xb8(%r14)
cmpb $0x1f, %cl
ja 0x31317
movl %ecx, %r14d
andb $0xf, %r14b
cmpb $0x3, %r14b
ja 0x31317
movl %ecx, 0x8(%rsp)
movl %ebp, 0x1c(%rsp)
xorl %r12d, %r12d
xorl %r13d, %r13d
movq (%rbx), %rbp
movq 0xb8(%rbp), %rax
cmpq 0xc0(%rbp), %rax
jae 0x30fc8
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%rbp)
movb (%rax), %al
jmp 0x31015
cmpl $0x0, 0x30(%rbp)
je 0x30fee
movq 0x28(%rbp), %rdi
leaq 0x38(%rbp), %r15
movl 0x34(%rbp), %edx
movq %r15, %rsi
callq *0x10(%rbp)
testl %eax, %eax
je 0x30ff2
movslq %eax, %rcx
addq %r15, %rcx
movb (%r15), %al
jmp 0x31003
xorl %eax, %eax
jmp 0x31015
movl $0x0, 0x30(%rbp)
leaq 0x39(%rbp), %rcx
movb $0x0, 0x38(%rbp)
xorl %eax, %eax
movq %rcx, 0xc0(%rbp)
leaq 0x39(%rbp), %rcx
movq %rcx, 0xb8(%rbp)
movzbl %al, %eax
movl %eax, 0x40(%rsp,%r12,4)
addl %eax, %r13d
incq %r12
cmpq $0x10, %r12
jne 0x30fa6
movzbl %r14b, %r14d
cmpb $0xf, 0x8(%rsp)
ja 0x31055
imulq $0x690, %r14, %rdi      # imm = 0x690
addq 0x38(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x31c0e
movl $0x8, %ecx
jmp 0x31070
imulq $0x690, %r14, %rdi      # imm = 0x690
addq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x31c0e
movl $0x1a48, %ecx           # imm = 0x1A48
testl %eax, %eax
je 0x31340
movq %r14, 0x28(%rsp)
testl %r13d, %r13d
je 0x31122
addq %rbx, %rcx
imulq $0x690, 0x28(%rsp), %rax # imm = 0x690
leaq (%rax,%rcx), %r12
addq $0x400, %r12            # imm = 0x400
movl %r13d, %r14d
xorl %ebp, %ebp
movq (%rbx), %rbx
movq 0xb8(%rbx), %rax
cmpq 0xc0(%rbx), %rax
jae 0x310c4
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%rbx)
movb (%rax), %al
jmp 0x31111
cmpl $0x0, 0x30(%rbx)
je 0x310ea
movq 0x28(%rbx), %rdi
leaq 0x38(%rbx), %r15
movl 0x34(%rbx), %edx
movq %r15, %rsi
callq *0x10(%rbx)
testl %eax, %eax
je 0x310ee
movslq %eax, %rcx
addq %r15, %rcx
movb (%r15), %al
jmp 0x310ff
xorl %eax, %eax
jmp 0x31111
movl $0x0, 0x30(%rbx)
leaq 0x39(%rbx), %rcx
movb $0x0, 0x38(%rbx)
xorl %eax, %eax
movq %rcx, 0xc0(%rbx)
leaq 0x39(%rbx), %rcx
movq %rcx, 0xb8(%rbx)
movb %al, (%r12,%rbp)
incq %rbp
cmpq %rbp, %r14
movq 0x10(%rsp), %rbx
jne 0x310a2
cmpb $0x10, 0x8(%rsp)
movl 0x1c(%rsp), %ebp
movl $0x0, %r14d
jb 0x311ee
movq 0x28(%rsp), %rax
movl %eax, %edx
shll $0xa, %edx
addq 0x30(%rsp), %rdx
imulq $0x690, %rax, %rsi      # imm = 0x690
addq 0x20(%rsp), %rsi
xorl %edi, %edi
movzbl (%rsi,%rdi), %ecx
movw $0x0, (%rdx,%rdi,2)
cmpq $0xff, %rcx
je 0x311de
movzbl 0x400(%rsi,%rcx), %r8d
movl %r8d, %eax
andl $0xf, %eax
je 0x311de
movzbl 0x500(%rsi,%rcx), %ecx
leal (%rax,%rcx), %r9d
cmpl $0x9, %r9d
ja 0x311de
movl %edi, %r11d
shll %cl, %r11d
andl $0x1ff, %r11d           # imm = 0x1FF
movb $0x9, %cl
subb %al, %cl
movl %r11d, %ebx
shrl %cl, %ebx
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
movl %eax, %ecx
shll %cl, %r10d
orl $0x1, %r10d
cmpl $0x100, %r11d           # imm = 0x100
cmovael %r14d, %r10d
addl %ebx, %r10d
movq 0x10(%rsp), %rbx
movsbl %r10b, %eax
cmpl %r10d, %eax
jne 0x311de
andl $-0x10, %r8d
shll $0x8, %r10d
orl %r8d, %r10d
orl %r9d, %r10d
movw %r10w, (%rdx,%rdi,2)
incq %rdi
cmpq $0x200, %rdi            # imm = 0x200
jne 0x31154
addl $-0x11, %ebp
subl %r13d, %ebp
testl %ebp, %ebp
jg 0x30f0b
testl %ebp, %ebp
sete %al
jmp 0x3144c
movq (%rbx), %rdi
callq 0x31b23
cmpl $0x4, %eax
jne 0x31232
movq (%rbx), %rdi
callq 0x31b23
movl %eax, 0x4868(%rbx)
jmp 0x3144a
leaq 0xe6de(%rip), %rax      # 0x3f90b
jmp 0x31339
leaq 0xe679(%rip), %rax      # 0x3f8b2
jmp 0x31339
movl %eax, %esi
cmpl $0xe0, %r14d
setne %al
cmpl $0x7, %esi
setb %cl
orb %al, %cl
jne 0x31347
movl %esi, 0x8(%rsp)
movl $0x1, %r15d
xorl %r12d, %r12d
leaq 0xe694(%rip), %r13      # 0x3f900
xorl %ebp, %ebp
movq (%rbx), %rbx
movq 0xb8(%rbx), %rax
cmpq 0xc0(%rbx), %rax
jae 0x31290
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%rbx)
movb (%rax), %al
jmp 0x312dd
cmpl $0x0, 0x30(%rbx)
je 0x312b6
movq 0x28(%rbx), %rdi
leaq 0x38(%rbx), %r14
movl 0x34(%rbx), %edx
movq %r14, %rsi
callq *0x10(%rbx)
testl %eax, %eax
je 0x312ba
movslq %eax, %rcx
addq %r14, %rcx
movb (%r14), %al
jmp 0x312cb
xorl %eax, %eax
jmp 0x312dd
movl $0x0, 0x30(%rbx)
leaq 0x39(%rbx), %rcx
movb $0x0, 0x38(%rbx)
xorl %eax, %eax
movq %rcx, 0xc0(%rbx)
leaq 0x39(%rbx), %rcx
movq %rcx, 0xb8(%rbx)
cmpb (%rbp,%r13), %al
cmovnel %r12d, %r15d
incq %rbp
cmpq $0x5, %rbp
movq 0x10(%rsp), %rbx
jne 0x3126e
movl 0x8(%rsp), %esi
addl $-0x7, %esi
testl %r15d, %r15d
je 0x31442
movl $0x1, 0x4848(%rbx)
jmp 0x31442
leaq 0xe5bb(%rip), %rax      # 0x3f8d9
jmp 0x31339
leaq 0xe597(%rip), %rax      # 0x3f8be
jmp 0x31339
leaq 0xe59b(%rip), %rax      # 0x3f8cb
jmp 0x31339
leaq 0xe5bb(%rip), %rax      # 0x3f8f4
movq %rax, 0x1e188(%rip)     # 0x4f4c8
xorl %eax, %eax
jmp 0x3144c
cmpl $0xee, %r14d
setne %al
cmpl $0xe, %esi
setb %cl
orb %al, %cl
jne 0x31436
movl %esi, 0x8(%rsp)
movl $0x1, %r15d
xorl %r12d, %r12d
leaq 0xe592(%rip), %r13      # 0x3f905
xorl %ebp, %ebp
movq (%rbx), %rbx
movq 0xb8(%rbx), %rax
cmpq 0xc0(%rbx), %rax
jae 0x31397
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%rbx)
movb (%rax), %al
jmp 0x313e4
cmpl $0x0, 0x30(%rbx)
je 0x313bd
movq 0x28(%rbx), %rdi
leaq 0x38(%rbx), %r14
movl 0x34(%rbx), %edx
movq %r14, %rsi
callq *0x10(%rbx)
testl %eax, %eax
je 0x313c1
movslq %eax, %rcx
addq %r14, %rcx
movb (%r14), %al
jmp 0x313d2
xorl %eax, %eax
jmp 0x313e4
movl $0x0, 0x30(%rbx)
leaq 0x39(%rbx), %rcx
movb $0x0, 0x38(%rbx)
xorl %eax, %eax
movq %rcx, 0xc0(%rbx)
leaq 0x39(%rbx), %rcx
movq %rcx, 0xb8(%rbx)
cmpb (%rbp,%r13), %al
cmovnel %r12d, %r15d
incq %rbp
cmpq $0x6, %rbp
movq 0x10(%rsp), %rbx
jne 0x31375
testl %r15d, %r15d
je 0x3143b
movq (%rbx), %rdi
callq 0x31aa8
movq (%rbx), %rdi
callq 0x31b23
movq (%rbx), %rdi
callq 0x31b23
movq (%rbx), %rdi
callq 0x31aa8
movzbl %al, %eax
movl %eax, 0x484c(%rbx)
movl 0x8(%rsp), %esi
addl $-0xe, %esi
jmp 0x31442
addl $-0x2, %esi
jmp 0x31442
movl 0x8(%rsp), %esi
addl $-0x8, %esi
movq (%rbx), %rdi
callq 0x31d5a
movb $0x1, %al
movzbl %al, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq