// File: srajangarg[P]raytracer/src/core/stb_image.hpp
// Function: stbi__load_main(stbi__context*, int*, int*, int*, int)
static unsigned char *stbi__load_main(stbi__context *s, int *x, int *y, int *comp, int req_comp)
{
   #ifndef STBI_NO_JPEG
   if (stbi__jpeg_test(s)) return stbi__jpeg_load(s,x,y,comp,req_comp);
   #endif
   #ifndef STBI_NO_PNG
   if (stbi__png_test(s))  return stbi__png_load(s,x,y,comp,req_comp);
   #endif
   #ifndef STBI_NO_BMP
   if (stbi__bmp_test(s))  return stbi__bmp_load(s,x,y,comp,req_comp);
   #endif
   #ifndef STBI_NO_GIF
   if (stbi__gif_test(s))  return stbi__gif_load(s,x,y,comp,req_comp);
   #endif
   #ifndef STBI_NO_PSD
   if (stbi__psd_test(s))  return stbi__psd_load(s,x,y,comp,req_comp);
   #endif
   #ifndef STBI_NO_PIC
   if (stbi__pic_test(s))  return stbi__pic_load(s,x,y,comp,req_comp);
   #endif
   #ifndef STBI_NO_PNM
   if (stbi__pnm_test(s))  return stbi__pnm_load(s,x,y,comp,req_comp);
   #endif

   #ifndef STBI_NO_HDR
   if (stbi__hdr_test(s)) {
      float *hdr = stbi__hdr_load(s, x,y,comp,req_comp);
      return stbi__hdr_to_ldr(hdr, *x, *y, req_comp ? req_comp : *comp);
   }
   #endif

   #ifndef STBI_NO_TGA
   // test tga last because it's a crappy test!
   if (stbi__tga_test(s))
      return stbi__tga_load(s,x,y,comp,req_comp);
   #endif

   return stbi__errpuc("unknown image type", "Image not of any known type, or corrupt");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x289b0
cmpl $0x0, %eax
je 0x287bc
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl -0x2c(%rbp), %r8d
callq 0x28a00
movq %rax, -0x8(%rbp)
jmp 0x28998
movq -0x10(%rbp), %rdi
callq 0x28a60
cmpl $0x0, %eax
je 0x287ec
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl -0x2c(%rbp), %r8d
callq 0x28a90
movq %rax, -0x8(%rbp)
jmp 0x28998
movq -0x10(%rbp), %rdi
callq 0x28ae0
cmpl $0x0, %eax
je 0x2881c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl -0x2c(%rbp), %r8d
callq 0x28b10
movq %rax, -0x8(%rbp)
jmp 0x28998
movq -0x10(%rbp), %rdi
callq 0x29770
cmpl $0x0, %eax
je 0x2884c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl -0x2c(%rbp), %r8d
callq 0x297a0
movq %rax, -0x8(%rbp)
jmp 0x28998
movq -0x10(%rbp), %rdi
callq 0x29880
cmpl $0x0, %eax
je 0x2887c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl -0x2c(%rbp), %r8d
callq 0x298c0
movq %rax, -0x8(%rbp)
jmp 0x28998
movq -0x10(%rbp), %rdi
callq 0x29dd0
cmpl $0x0, %eax
je 0x288ac
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl -0x2c(%rbp), %r8d
callq 0x29e00
movq %rax, -0x8(%rbp)
jmp 0x28998
movq -0x10(%rbp), %rdi
callq 0x29f80
cmpl $0x0, %eax
je 0x288dc
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl -0x2c(%rbp), %r8d
callq 0x29ff0
movq %rax, -0x8(%rbp)
jmp 0x28998
movq -0x10(%rbp), %rdi
callq 0x27cd0
cmpl $0x0, %eax
je 0x28950
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl -0x2c(%rbp), %r8d
callq 0x2a130
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x2892f
movl -0x2c(%rbp), %eax
movl %eax, -0x4c(%rbp)
jmp 0x28938
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4c(%rbp)
movl -0x3c(%rbp), %edx
movl -0x40(%rbp), %esi
movq -0x48(%rbp), %rdi
movl -0x4c(%rbp), %ecx
callq 0x2a7c0
movq %rax, -0x8(%rbp)
jmp 0x28998
movq -0x10(%rbp), %rdi
callq 0x2a9c0
cmpl $0x0, %eax
je 0x2897d
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl -0x2c(%rbp), %r8d
callq 0x2ab10
movq %rax, -0x8(%rbp)
jmp 0x28998
leaq 0x1f577(%rip), %rdi     # 0x47efb
callq 0x275b0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)