// File: /workspace/github_cpp_makefile_star2_O3/srajangarg[P]raytracer/src/core/stb_image.hpp
// 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;
            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);
            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);
            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) {
      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 $0x88, %rsp
movq %rdi, %rbx
cmpl $0xdc, %esi
jg 0x1da88
cmpl $0xc4, %esi
je 0x1dae1
cmpl $0xdb, %esi
jne 0x1daa8
movq (%rbx), %rdi
callq 0x1e517
leal -0x2(%rax), %r15d
cmpl $0x3, %eax
jb 0x1de2f
leaq 0x3488(%rbx), %rax
movq %rax, 0x8(%rsp)
leaq 0xe4ef(%rip), %r13      # 0x2be30
movq (%rbx), %r12
movq 0xb8(%r12), %rax
cmpq 0xc0(%r12), %rax
jae 0x1d966
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r12)
movb (%rax), %al
jmp 0x1d9c3
cmpl $0x0, 0x30(%r12)
je 0x1d994
movq 0x28(%r12), %rdi
leaq 0x38(%r12), %r14
movl 0x34(%r12), %edx
movq %r14, %rsi
callq *0x10(%r12)
testl %eax, %eax
je 0x1d998
movslq %eax, %rcx
addq %r14, %rcx
movb (%r14), %al
jmp 0x1d9ae
xorl %eax, %eax
jmp 0x1d9d3
movl $0x0, 0x30(%r12)
leaq 0x39(%r12), %rcx
movb $0x0, 0x38(%r12)
xorl %eax, %eax
movq %rcx, 0xc0(%r12)
leaq 0x39(%r12), %rcx
movq %rcx, 0xb8(%r12)
cmpb $0x10, %al
jae 0x1de4b
cmpb $0x3, %al
ja 0x1de54
movq %r15, 0x10(%rsp)
movzbl %al, %ebp
shll $0x6, %ebp
addq 0x8(%rsp), %rbp
xorl %r12d, %r12d
movq (%rbx), %r15
movq 0xb8(%r15), %rax
cmpq 0xc0(%r15), %rax
jae 0x1da08
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r15)
movb (%rax), %al
jmp 0x1da5a
cmpl $0x0, 0x30(%r15)
je 0x1da31
movq 0x28(%r15), %rdi
leaq 0x38(%r15), %r14
movl 0x34(%r15), %edx
movq %r14, %rsi
callq *0x10(%r15)
testl %eax, %eax
je 0x1da35
movslq %eax, %rcx
addq %r14, %rcx
movb (%r14), %al
jmp 0x1da48
xorl %eax, %eax
jmp 0x1da5a
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 (%r12,%r13), %ecx
movb %al, (%rcx,%rbp)
incq %r12
cmpq $0x40, %r12
jne 0x1d9e6
movq 0x10(%rsp), %rcx
leal -0x41(%rcx), %eax
cmpl $0x41, %ecx
movl %eax, %r15d
jg 0x1d941
jmp 0x1de32
cmpl $0xdd, %esi
je 0x1de10
cmpl $0xff, %esi
jne 0x1daa8
leaq 0xe75d(%rip), %rax      # 0x2c200
jmp 0x1de5b
movl %esi, %eax
andl $-0x10, %eax
cmpl $0xe0, %eax
setne %al
cmpl $0xfe, %esi
setne %cl
testb %al, %cl
jne 0x1de62
movq (%rbx), %rbx
movq %rbx, %rdi
callq 0x1e517
leal -0x2(%rax), %esi
movq %rbx, %rdi
callq 0x1e753
jmp 0x1de2b
movq (%rbx), %rdi
callq 0x1e517
leal -0x2(%rax), %ebp
cmpl $0x3, %eax
jb 0x1de0c
leaq 0x1a48(%rbx), %rax
movq %rax, 0x20(%rsp)
leaq 0x8(%rbx), %rax
movq %rax, 0x38(%rsp)
leaq 0x3588(%rbx), %rax
movq %rax, 0x30(%rsp)
movq %rbx, 0x10(%rsp)
movq (%rbx), %r14
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jae 0x1db3d
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r14)
movb (%rax), %cl
jmp 0x1db8e
cmpl $0x0, 0x30(%r14)
je 0x1db65
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r15
movl 0x34(%r14), %edx
movq %r15, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x1db69
cltq
addq %r15, %rax
movb (%r15), %cl
jmp 0x1db7c
xorl %ecx, %ecx
jmp 0x1db8e
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 0x1de42
movl %ecx, %r14d
andb $0xf, %r14b
cmpb $0x3, %r14b
ja 0x1de42
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 0x1dbd8
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%rbp)
movb (%rax), %al
jmp 0x1dc25
cmpl $0x0, 0x30(%rbp)
je 0x1dbfe
movq 0x28(%rbp), %rdi
leaq 0x38(%rbp), %r15
movl 0x34(%rbp), %edx
movq %r15, %rsi
callq *0x10(%rbp)
testl %eax, %eax
je 0x1dc02
movslq %eax, %rcx
addq %r15, %rcx
movb (%r15), %al
jmp 0x1dc13
xorl %eax, %eax
jmp 0x1dc25
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 0x1dbb6
movzbl %r14b, %r14d
cmpb $0xf, 0x8(%rsp)
ja 0x1dc65
imulq $0x690, %r14, %rdi      # imm = 0x690
addq 0x38(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x1e602
movl $0x8, %ecx
jmp 0x1dc80
imulq $0x690, %r14, %rdi      # imm = 0x690
addq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x1e602
movl $0x1a48, %ecx           # imm = 0x1A48
testl %eax, %eax
je 0x1de62
movq %r14, 0x28(%rsp)
testl %r13d, %r13d
je 0x1dd32
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 0x1dcd4
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%rbx)
movb (%rax), %al
jmp 0x1dd21
cmpl $0x0, 0x30(%rbx)
je 0x1dcfa
movq 0x28(%rbx), %rdi
leaq 0x38(%rbx), %r15
movl 0x34(%rbx), %edx
movq %r15, %rsi
callq *0x10(%rbx)
testl %eax, %eax
je 0x1dcfe
movslq %eax, %rcx
addq %r15, %rcx
movb (%r15), %al
jmp 0x1dd0f
xorl %eax, %eax
jmp 0x1dd21
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 0x1dcb2
cmpb $0x10, 0x8(%rsp)
movl 0x1c(%rsp), %ebp
movl $0x0, %r14d
jb 0x1ddfe
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 0x1ddee
movzbl 0x400(%rsi,%rcx), %r8d
movl %r8d, %eax
andl $0xf, %eax
je 0x1ddee
movzbl 0x500(%rsi,%rcx), %ecx
leal (%rax,%rcx), %r9d
cmpl $0x9, %r9d
ja 0x1ddee
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 0x1ddee
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 0x1dd64
addl $-0x11, %ebp
subl %r13d, %ebp
testl %ebp, %ebp
jg 0x1db1b
testl %ebp, %ebp
jmp 0x1de34
movq (%rbx), %rdi
callq 0x1e517
cmpl $0x4, %eax
jne 0x1de39
movq (%rbx), %rdi
callq 0x1e517
movl %eax, 0x475c(%rbx)
movb $0x1, %al
jmp 0x1de64
movl %r15d, %eax
testl %eax, %eax
sete %al
jmp 0x1de64
leaq 0xe3d0(%rip), %rax      # 0x2c210
jmp 0x1de5b
leaq 0xe3ee(%rip), %rax      # 0x2c237
jmp 0x1de5b
leaq 0xe3ca(%rip), %rax      # 0x2c21c
jmp 0x1de5b
leaq 0xe3ce(%rip), %rax      # 0x2c229
movq %rax, 0x1952e(%rip)     # 0x37390
xorl %eax, %eax
movzbl %al, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq