// File: /workspace/github_cpp_makefile_star2_O2/alan0201tw[P]RayTracer/include/stb_image.h
// Function: stbi__decode_jpeg_header(stbi__jpeg*, int)
static int stbi__decode_jpeg_header(stbi__jpeg *z, int scan)
{
   int m;
   z->jfif = 0;
   z->app14_color_transform = -1; // valid values are 0,1,2
   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 $0x48, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rax, 0x4848(%rdi)
movb $-0x1, 0x4828(%rdi)
callq 0x28686
cmpb $-0x28, %al
jne 0x277c4
pushq $0x1
popq %r14
cmpl $0x1, %ebp
je 0x277d5
movq %rbx, %rdi
callq 0x28686
movzbl %al, %esi
cmpb $-0x3e, %sil
je 0x277e7
movl %esi, %eax
andl $-0x2, %eax
cmpl $0xc0, %eax
je 0x277e7
movq %rbx, %rdi
callq 0x286be
testl %eax, %eax
je 0x277d2
movq %rbx, %rdi
callq 0x28686
cmpb $-0x1, %al
jne 0x27782
movq (%rbx), %rdi
callq 0x28b28
testl %eax, %eax
je 0x277a3
leaq 0xbfe1(%rip), %rax      # 0x337a3
jmp 0x277cb
leaq 0xbfd1(%rip), %rax      # 0x3379c
movq %rax, 0x20d46(%rip)     # 0x48518
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
cmpl $0xc2, %esi
sete %al
movl %eax, 0x4830(%rbx)
movq (%rbx), %r12
movq %r12, %rdi
callq 0x28be3
cmpl $0xa, %eax
ja 0x27811
leaq 0xc024(%rip), %rax      # 0x33833
jmp 0x277cb
movl %eax, %r15d
movq %r12, %rdi
callq 0x28b62
cmpb $0x8, %al
jne 0x2788e
movq %r12, %rdi
callq 0x28be3
movl %eax, 0x4(%r12)
testl %eax, %eax
je 0x2789a
movq %r12, %rdi
callq 0x28be3
movl %eax, (%r12)
testl %eax, %eax
je 0x27960
movq %r12, %rdi
callq 0x28b62
cmpb $0x4, %al
ja 0x2796c
movzbl %al, %eax
pushq $0x1a
popq %rcx
btl %eax, %ecx
jae 0x2796c
movl %eax, 0x8(%r12)
movl %eax, %ecx
imulq $0x60, %rcx, %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x278a6
andq $0x0, 0x46d0(%rbx,%rdx)
andq $0x0, 0x46e8(%rbx,%rdx)
addq $0x60, %rdx
jmp 0x27871
leaq 0xbfaa(%rip), %rax      # 0x3383f
jmp 0x277cb
leaq 0xbfa9(%rip), %rax      # 0x3384a
jmp 0x277cb
leal (%rax,%rax,2), %eax
addl $0x8, %eax
cmpl %eax, %r15d
jne 0x27808
andl $0x0, 0x4850(%rbx)
leaq 0x46ac(%rbx), %r13
xorl %ecx, %ecx
movslq 0x8(%r12), %r15
cmpq %r15, %rcx
jge 0x27978
movq %rcx, %r15
movq %r12, %rdi
callq 0x28b62
movzbl %al, %ecx
movl %ecx, -0xc(%r13)
cmpl $0x3, 0x8(%r12)
jne 0x27900
leaq 0x9f2b(%rip), %rcx      # 0x3181f
cmpb (%r15,%rcx), %al
jne 0x27900
incl 0x4850(%rbx)
movq %r12, %rdi
callq 0x28b62
movzbl %al, %eax
movl %eax, %ecx
shrl $0x4, %ecx
movl %ecx, -0x8(%r13)
leal -0x50(%rax), %ecx
cmpb $-0x41, %cl
jbe 0x279e0
andl $0xf, %eax
movl %eax, -0x4(%r13)
addl $-0x5, %eax
cmpl $-0x5, %eax
jbe 0x279ec
movq %r12, %rdi
callq 0x28b62
movzbl %al, %eax
movl %eax, (%r13)
movq %r15, %rcx
incq %rcx
addq $0x60, %r13
cmpb $0x4, %al
jb 0x278c5
leaq 0xbf28(%rip), %rax      # 0x33883
jmp 0x277cb
leaq 0xbef4(%rip), %rax      # 0x3385b
jmp 0x277cb
leaq 0xbef0(%rip), %rax      # 0x33863
jmp 0x277cb
testl %ebp, %ebp
jne 0x277d5
movl (%r12), %edi
movl 0x4(%r12), %esi
xorl %r14d, %r14d
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movl %r15d, %edx
xorl %ecx, %ecx
callq 0x28daf
testl %eax, %eax
je 0x27ba9
testl %r15d, %r15d
cmovlel %r14d, %r15d
imulq $0x60, %r15, %rdx
pushq $0x1
popq %rdi
movl %edi, %r8d
cmpq %r14, %rdx
je 0x279f8
movl 0x46a4(%rbx,%r14), %eax
movl 0x46a8(%rbx,%r14), %ecx
cmpl %edi, %eax
cmovgl %eax, %edi
cmpl %r8d, %ecx
cmovgl %ecx, %r8d
addq $0x60, %r14
jmp 0x279b9
leaq 0xbe90(%rip), %rax      # 0x33877
jmp 0x277cb
leaq 0xbe8a(%rip), %rax      # 0x3387d
jmp 0x277cb
movq %rdx, 0x40(%rsp)
movl %edi, 0x4688(%rbx)
movl %r8d, 0x468c(%rbx)
leal (,%rdi,8), %ecx
movl %ecx, 0x4698(%rbx)
leal (,%r8,8), %esi
movl %esi, 0x469c(%rbx)
movq 0x28(%rsp), %rax
leal (%rax,%rdi,8), %eax
decl %eax
xorl %r13d, %r13d
xorl %edx, %edx
divl %ecx
movl %eax, 0x18(%rsp)
movl %eax, 0x4690(%rbx)
movq 0x20(%rsp), %rax
leal (%rax,%r8,8), %eax
decl %eax
xorl %edx, %edx
divl %esi
movl %eax, 0x14(%rsp)
movl %eax, 0x4694(%rbx)
movq %rdi, 0x38(%rsp)
leal -0x1(%rdi), %eax
movl %eax, 0x10(%rsp)
movq %r8, 0x30(%rsp)
leal -0x1(%r8), %eax
movl %eax, 0xc(%rsp)
pushq $0x1
popq %r14
movl %r14d, 0x8(%rsp)
cmpq %r13, 0x40(%rsp)
je 0x277d5
movl 0x46a4(%rbx,%r13), %r15d
movl 0x46a8(%rbx,%r13), %r12d
movl %r15d, %eax
imull 0x28(%rsp), %eax
addl 0x10(%rsp), %eax
xorl %edx, %edx
divl 0x38(%rsp)
movl %eax, 0x46bc(%rbx,%r13)
movl %r12d, %eax
imull 0x20(%rsp), %eax
addl 0xc(%rsp), %eax
xorl %edx, %edx
divl 0x30(%rsp)
movl %eax, 0x46c0(%rbx,%r13)
imull 0x18(%rsp), %r15d
leal (,%r15,8), %edi
movl %edi, 0x46c4(%rbx,%r13)
imull 0x14(%rsp), %r12d
leal (,%r12,8), %ebp
movl %ebp, 0x46c8(%rbx,%r13)
movl %edi, 0x1c(%rsp)
movl %ebp, %esi
pushq $0xf
popq %rdx
callq 0x28e0c
andq $0x0, 0x46f0(%rbx,%r13)
xorps %xmm0, %xmm0
movups %xmm0, 0x46e0(%rbx,%r13)
movq %rax, 0x46d8(%rbx,%r13)
testq %rax, %rax
je 0x27b8a
addq $0xf, %rax
andq $-0x10, %rax
movq %rax, 0x46d0(%rbx,%r13)
cmpl $0x0, 0x4830(%rbx)
je 0x27b7d
movl %r15d, 0x46f8(%rbx,%r13)
movl %r12d, 0x46fc(%rbx,%r13)
movl 0x1c(%rsp), %edi
movl %ebp, %esi
pushq $0x2
popq %rdx
pushq $0xf
popq %rcx
callq 0x28eb4
movq %rax, 0x46e0(%rbx,%r13)
testq %rax, %rax
je 0x27b8a
addq $0xf, %rax
andq $-0x10, %rax
movq %rax, 0x46f0(%rbx,%r13)
incl 0x8(%rsp)
addq $0x60, %r13
jmp 0x27a7b
leaq 0xbd03(%rip), %rax      # 0x33894
movq %rax, 0x20980(%rip)     # 0x48518
movq %rbx, %rdi
movl 0x8(%rsp), %esi
callq 0x28e40
jmp 0x277d2
leaq 0xbcda(%rip), %rax      # 0x3388a
movq %rax, 0x20961(%rip)     # 0x48518
jmp 0x277d5