// File: /workspace/github_c_makefile_star2_O2/archer1357[P]Offline-Raytracer/stb_image.c
// Function: decode_jpeg_header
static int 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 stbi__SOI","Corrupt JPEG");
   if (scan == 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 stbi__SOF", "Corrupt JPEG");
         m = stbi__get_marker(z);
      }
   }
   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 $0x28, %rsp
movl %esi, %r14d
movq %rdi, %rbx
movb $-0x1, 0x36c8(%rdi)
callq 0x40dac2
cmpb $-0x28, %al
jne 0x40d76c
pushq $0x1
popq %rbp
cmpl $0x1, %r14d
je 0x40d77c
movq %rbx, %rdi
callq 0x40dac2
leaq 0xc7025(%rip), %r13     # 0x4d475c
movzbl %al, %esi
movl %esi, %eax
andl $-0x2, %eax
cmpl $0xc0, %eax
je 0x40d78d
movq %rbx, %rdi
callq 0x40dafa
testl %eax, %eax
je 0x40d77a
movq %rbx, %rdi
callq 0x40dac2
cmpb $-0x1, %al
jne 0x40d737
movq (%rbx), %rdi
callq 0x40dd55
testl %eax, %eax
je 0x40d752
jmp 0x40d773
leaq 0xc6fdc(%rip), %r13     # 0x4d474f
movq %r13, 0x10bdc6(%rip)    # 0x519540
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx), %r15
movq %r15, %rdi
callq 0x40de10
leaq 0xc7032(%rip), %r13     # 0x4d47d1
cmpl $0xb, %eax
jb 0x40d773
movl %eax, %r12d
movq %r15, %rdi
callq 0x40dd8f
cmpb $0x8, %al
jne 0x40d810
movq %r15, %rdi
callq 0x40de10
movl %eax, 0x4(%r15)
testl %eax, %eax
je 0x40d81c
movq %r15, %rdi
callq 0x40de10
movl %eax, (%r15)
testl %eax, %eax
je 0x40d828
movq %r15, %rdi
callq 0x40dd8f
movl %eax, %ecx
andb $-0x3, %cl
cmpb $0x1, %cl
jne 0x40d834
movzbl %al, %eax
movl %eax, 0x8(%r15)
movl %eax, %ecx
imulq $0x48, %rcx, %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x40d840
andq $0x0, 0x35d0(%rbx,%rdx)
andq $0x0, 0x35e0(%rbx,%rdx)
addq $0x48, %rdx
jmp 0x40d7f3
leaq 0xc6fcc(%rip), %r13     # 0x4d47e3
jmp 0x40d773
leaq 0xc6fcb(%rip), %r13     # 0x4d47ee
jmp 0x40d773
leaq 0xc6fd0(%rip), %r13     # 0x4d47ff
jmp 0x40d773
leaq 0xc6fcc(%rip), %r13     # 0x4d4807
jmp 0x40d773
leal (%rax,%rax,2), %eax
addl $0x8, %eax
cmpl %eax, %r12d
jne 0x40d773
leaq 0x35ac(%rbx), %rax
movq %rax, (%rsp)
xorl %ecx, %ecx
leaq 0xc6fb8(%rip), %r13     # 0x4d481b
movslq 0x8(%r15), %rsi
movq %rcx, 0x10(%rsp)
cmpq %rsi, %rcx
jge 0x40d908
movq %r15, %rdi
callq 0x40dd8f
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 0x40d773
movq %r15, %rdi
callq 0x40dd8f
movzbl %al, %eax
movl %eax, %ecx
shrl $0x4, %ecx
movl %ecx, -0x8(%r12)
leal -0x50(%rax), %ecx
cmpb $-0x40, %cl
jb 0x40d941
andl $0xf, %eax
movl %eax, -0x4(%r12)
addl $-0x5, %eax
cmpl $-0x4, %eax
jb 0x40d94d
movq %r15, %rdi
callq 0x40dd8f
movzbl %al, %eax
movl %eax, (%r12)
addq $0x48, %r12
movq %r12, (%rsp)
movq 0x8(%rsp), %rcx
cmpb $0x3, %al
jbe 0x40d863
leaq 0xc6f35(%rip), %r13     # 0x4d4838
jmp 0x40d773
testl %r14d, %r14d
jne 0x40d77c
movl (%r15), %edi
movl 0x4(%r15), %r8d
xorl %ecx, %ecx
movl $0x40000000, %eax       # imm = 0x40000000
xorl %edx, %edx
movq %rdi, (%rsp)
divl %edi
xorl %edx, %edx
divl %esi
movq %r8, 0x10(%rsp)
cmpl %r8d, %eax
jae 0x40d959
leaq 0xd0ea3(%rip), %r13     # 0x4de7df
jmp 0x40d773
leaq 0xc6ee4(%rip), %r13     # 0x4d482c
jmp 0x40d773
leaq 0xc6ede(%rip), %r13     # 0x4d4832
jmp 0x40d773
testl %esi, %esi
cmovlel %ecx, %esi
movq %rsi, 0x8(%rsp)
imulq $0x48, %rsi, %rax
pushq $0x1
popq %r14
movl %r14d, %r13d
cmpq %rcx, %rax
je 0x40d995
movl 0x35a4(%rbx,%rcx), %edx
movl 0x35a8(%rbx,%rcx), %esi
cmpl %r14d, %edx
cmovgl %edx, %r14d
cmpl %r13d, %esi
cmovgl %esi, %r13d
addq $0x48, %rcx
jmp 0x40d96e
movl %r14d, 0x3588(%rbx)
movl %r13d, 0x358c(%rbx)
leal (,%r14,8), %ecx
movl %ecx, 0x3598(%rbx)
leal (,%r13,8), %esi
movl %esi, 0x359c(%rbx)
movq (%rsp), %rax
leal (%rax,%r14,8), %eax
decl %eax
xorl %edi, %edi
xorl %edx, %edx
divl %ecx
movl %eax, %ecx
leaq 0x3590(%rbx), %r15
movl %eax, 0x3590(%rbx)
movq 0x10(%rsp), %rax
leal (%rax,%r13,8), %eax
decl %eax
xorl %edx, %edx
divl %esi
movl %eax, %r12d
movl %eax, 0x3594(%rbx)
leal -0x1(%r14), %edx
movl %edx, 0x20(%rsp)
leal -0x1(%r13), %edx
movl %edx, 0x1c(%rsp)
shll $0x3, %ecx
movl %ecx, 0x24(%rsp)
shll $0x3, %r12d
pushq $0x1
popq %rbp
movq 0x8(%rsp), %rax
cmpq %rdi, %rax
je 0x40d77c
movq %rdi, %rbx
movl 0x14(%r15), %esi
movl 0x18(%r15), %ecx
movl %esi, %eax
imull (%rsp), %eax
addl 0x20(%rsp), %eax
xorl %edx, %edx
divl %r14d
movl %eax, 0x2c(%r15)
movl %ecx, %eax
imull 0x10(%rsp), %eax
addl 0x1c(%rsp), %eax
xorl %edx, %edx
divl %r13d
movl %eax, 0x30(%r15)
imull 0x24(%rsp), %esi
movl %esi, 0x34(%r15)
imull %r12d, %ecx
movl %ecx, 0x38(%r15)
imull %esi, %ecx
orl $0xf, %ecx
movslq %ecx, %rdi
callq 0x442160
movq %rax, 0x48(%r15)
testq %rax, %rax
je 0x40da9c
addq $0xf, %rax
andq $-0x10, %rax
movq %rax, 0x40(%r15)
andq $0x0, 0x50(%r15)
movq %rbx, %rdi
incq %rdi
addq $0x48, %r15
jmp 0x40da14
leaq 0xc6d9c(%rip), %r13     # 0x4d483f
testq %rbx, %rbx
jle 0x40d773
decq %rbx
movq (%r15), %rdi
callq 0x4424a0
andq $0x0, -0x8(%r15)
addq $-0x48, %r15
jmp 0x40daa3