// File: /workspace/github_cpp_makefile_star2_O2/srajangarg[P]raytracer/src/core/stb_image.hpp
// Function: stbi__decode_jpeg_header(stbi__jpeg*, int)
static int stbi__decode_jpeg_header(stbi__jpeg *z, int scan)
{
   int m;
   z->marker = STBI__MARKER_none; // initialize cached marker to empty
   m = stbi__get_marker(z);
   if (!stbi__SOI(m)) return stbi__err("no SOI","Corrupt JPEG");
   if (scan == STBI__SCAN_type) return 1;
   m = stbi__get_marker(z);
   while (!stbi__SOF(m)) {
      if (!stbi__process_marker(z,m)) return 0;
      m = stbi__get_marker(z);
      while (m == STBI__MARKER_none) {
         // some files have extra padding after their blocks, so ok, we'll scan
         if (stbi__at_eof(z->s)) return stbi__err("no SOF", "Corrupt JPEG");
         m = stbi__get_marker(z);
      }
   }
   z->progressive = stbi__SOF_progressive(m);
   if (!stbi__process_frame_header(z, scan)) return 0;
   return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %r14d
movq %rdi, %rbx
movb $-0x1, 0x4728(%rdi)
callq 0x176aa
cmpb $-0x28, %al
jne 0x16d49
pushq $0x1
popq %rbp
cmpl $0x1, %r14d
je 0x16d59
movq %rbx, %rdi
callq 0x176aa
leaq 0xb3eb(%rip), %r13      # 0x220f9
movzbl %al, %esi
cmpb $-0x3e, %sil
je 0x16d6a
movl %esi, %eax
andl $-0x2, %eax
cmpl $0xc0, %eax
je 0x16d6a
movq %rbx, %rdi
callq 0x176e2
testl %eax, %eax
je 0x16d57
movq %rbx, %rdi
callq 0x176aa
cmpb $-0x1, %al
jne 0x16d0e
movq (%rbx), %rdi
callq 0x179fc
testl %eax, %eax
je 0x16d2f
jmp 0x16d50
leaq 0xb3a2(%rip), %r13      # 0x220f2
movq %r13, 0x18679(%rip)     # 0x2f3d0
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
cmpl $0xc2, %esi
sete %al
movl %eax, 0x4730(%rbx)
movq (%rbx), %r15
movq %r15, %rdi
callq 0x17ab7
leaq 0xb3ca(%rip), %r13      # 0x22157
cmpl $0xb, %eax
jb 0x16d50
movl %eax, %r12d
movq %r15, %rdi
callq 0x17a36
cmpb $0x8, %al
jne 0x16dfe
movq %r15, %rdi
callq 0x17ab7
movl %eax, 0x4(%r15)
testl %eax, %eax
je 0x16e0a
movq %r15, %rdi
callq 0x17ab7
movl %eax, (%r15)
testl %eax, %eax
je 0x16e16
movq %r15, %rdi
callq 0x17a36
movl %eax, %ecx
andb $-0x3, %cl
cmpb $0x1, %cl
jne 0x16e22
movzbl %al, %eax
movl %eax, 0x8(%r15)
movl %eax, %ecx
imulq $0x60, %rcx, %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x16e2e
andq $0x0, 0x45d0(%rbx,%rdx)
andq $0x0, 0x45e8(%rbx,%rdx)
addq $0x60, %rdx
jmp 0x16de1
leaq 0xb35e(%rip), %r13      # 0x22163
jmp 0x16d50
leaq 0xb35d(%rip), %r13      # 0x2216e
jmp 0x16d50
leaq 0xb362(%rip), %r13      # 0x2217f
jmp 0x16d50
leaq 0xb35e(%rip), %r13      # 0x22187
jmp 0x16d50
leal (%rax,%rax,2), %eax
addl $0x8, %eax
cmpl %eax, %r12d
jne 0x16d50
leaq 0x45ac(%rbx), %rax
movq %rax, (%rsp)
xorl %ecx, %ecx
leaq 0xb34a(%rip), %r13      # 0x2219b
movslq 0x8(%r15), %rsi
movq %rcx, 0x10(%rsp)
cmpq %rsi, %rcx
jge 0x16ef6
movq %r15, %rdi
callq 0x17a36
movzbl %al, %eax
movq (%rsp), %r12
movl %eax, -0xc(%r12)
movq 0x10(%rsp), %rdx
leaq 0x1(%rdx), %rcx
movq %rcx, 0x8(%rsp)
cmpq %rax, %rcx
setne %cl
cmpq %rax, %rdx
setne %al
testb %al, %cl
jne 0x16d50
movq %r15, %rdi
callq 0x17a36
movzbl %al, %eax
movl %eax, %ecx
shrl $0x4, %ecx
movl %ecx, -0x8(%r12)
leal -0x50(%rax), %ecx
cmpb $-0x40, %cl
jb 0x16f30
andl $0xf, %eax
movl %eax, -0x4(%r12)
addl $-0x5, %eax
cmpl $-0x4, %eax
jb 0x16f3c
movq %r15, %rdi
callq 0x17a36
movzbl %al, %eax
movl %eax, (%r12)
addq $0x60, %r12
movq %r12, (%rsp)
movq 0x8(%rsp), %rcx
cmpb $0x3, %al
jbe 0x16e51
leaq 0xb2c7(%rip), %r13      # 0x221b8
jmp 0x16d50
testl %r14d, %r14d
jne 0x16d59
movl (%r15), %edi
movl 0x4(%r15), %r8d
xorl %ecx, %ecx
movl $0x40000000, %eax       # imm = 0x40000000
xorl %edx, %edx
movq %rdi, 0x10(%rsp)
divl %edi
xorl %edx, %edx
divl %esi
movq %r8, 0x8(%rsp)
cmpl %r8d, %eax
jae 0x16f48
leaq 0xb294(%rip), %r13      # 0x221bf
jmp 0x16d50
leaq 0xb275(%rip), %r13      # 0x221ac
jmp 0x16d50
leaq 0xb26f(%rip), %r13      # 0x221b2
jmp 0x16d50
testl %esi, %esi
cmovlel %ecx, %esi
movq %rsi, 0x30(%rsp)
imulq $0x60, %rsi, %rax
pushq $0x1
popq %rdi
movl %edi, %r13d
cmpq %rcx, %rax
je 0x16f81
movl 0x45a4(%rbx,%rcx), %edx
movl 0x45a8(%rbx,%rcx), %esi
cmpl %edi, %edx
cmovgl %edx, %edi
cmpl %r13d, %esi
cmovgl %esi, %r13d
addq $0x60, %rcx
jmp 0x16f5c
movl %edi, 0x4588(%rbx)
movl %r13d, 0x458c(%rbx)
leal (,%rdi,8), %ecx
movl %ecx, 0x4598(%rbx)
leal (,%r13,8), %esi
movl %esi, 0x459c(%rbx)
movq 0x10(%rsp), %rax
leal (%rax,%rdi,8), %eax
decl %eax
xorl %r8d, %r8d
xorl %edx, %edx
divl %ecx
movl %eax, 0x24(%rsp)
movl %eax, 0x4590(%rbx)
movq 0x8(%rsp), %rax
leal (%rax,%r13,8), %eax
decl %eax
xorl %edx, %edx
divl %esi
movl %eax, 0x20(%rsp)
movl %eax, 0x4594(%rbx)
leal -0x1(%rdi), %eax
movl %eax, 0x1c(%rsp)
leal -0x1(%r13), %eax
movl %eax, 0x18(%rsp)
leaq 0x4578(%rbx), %r15
pushq $0x1
popq %rbp
movq %rdi, 0x28(%rsp)
movq %r8, (%rsp)
cmpq %r8, 0x30(%rsp)
je 0x16d59
movl 0x2c(%r15), %r12d
movl 0x30(%r15), %r14d
movl %r12d, %eax
imull 0x10(%rsp), %eax
addl 0x1c(%rsp), %eax
xorl %edx, %edx
divl %edi
movl %eax, 0x44(%r15)
movl %r14d, %eax
imull 0x8(%rsp), %eax
addl 0x18(%rsp), %eax
xorl %edx, %edx
divl %r13d
movl %eax, 0x48(%r15)
imull 0x24(%rsp), %r12d
leal (,%r12,8), %eax
movl %eax, 0x4c(%r15)
imull 0x20(%rsp), %r14d
leal (,%r14,8), %ecx
movl %ecx, 0x50(%r15)
imull %eax, %ecx
orl $0xf, %ecx
movslq %ecx, %rdi
callq 0x4420
movq %rax, 0x60(%r15)
testq %rax, %rax
je 0x170e4
addq $0xf, %rax
andq $-0x10, %rax
movq %rax, 0x58(%r15)
andq $0x0, 0x70(%r15)
cmpl $0x0, 0x4730(%rbx)
je 0x170c3
movl %r12d, 0x80(%r15)
movl %r14d, 0x84(%r15)
imull %r14d, %r12d
shll $0x6, %r12d
movslq %r12d, %rax
leaq 0xf(,%rax,2), %rdi
callq 0x4420
movq %rax, %rcx
addq $0xf, %rcx
andq $-0x10, %rcx
jmp 0x170c7
xorl %ecx, %ecx
xorl %eax, %eax
movq %rcx, 0x78(%r15)
movq %rax, 0x68(%r15)
movq (%rsp), %r8
incq %r8
addq $0x60, %r15
movq 0x28(%rsp), %rdi
jmp 0x16ffb
leaq 0xb0de(%rip), %r13      # 0x221c9
movq (%rsp), %rbx
testq %rbx, %rbx
jle 0x16d50
decq %rbx
movq (%r15), %rdi
callq 0x43a0
andq $0x0, (%r15)
addq $-0x60, %r15
jmp 0x170ef