// File: /workspace/github_cpp_makefile_star2_O3/lunasorcery[P]brailify/./stb/stb_image.h
// Function: stbi__load_and_postprocess_8bit(stbi__context*, int*, int*, int*, int)
static unsigned char *stbi__load_and_postprocess_8bit(stbi__context *s, int *x, int *y, int *comp, int req_comp)
{
   stbi__result_info ri;
   void *result = stbi__load_main(s, x, y, comp, req_comp, &ri, 8);

   if (result == NULL)
      return NULL;

   if (ri.bits_per_channel != 8) {
      STBI_ASSERT(ri.bits_per_channel == 16);
      result = stbi__convert_16_to_8((stbi__uint16 *) result, *x, *y, req_comp == 0 ? *comp : req_comp);
      ri.bits_per_channel = 8;
   }

   // @TODO: move stbi__convert_format to here

   if (stbi__vertically_flip_on_load) {
      int w = *x, h = *y;
      int channels = req_comp ? req_comp : *comp;
      int row,col,z;
      stbi_uc *image = (stbi_uc *) result;

      // @OPTIMIZE: use a bigger temp buffer and memcpy multiple pixels at once
      for (row = 0; row < (h>>1); row++) {
         for (col = 0; col < w; col++) {
            for (z = 0; z < channels; z++) {
               stbi_uc temp = image[(row * w + col) * channels + z];
               image[(row * w + col) * channels + z] = image[((h - row - 1) * w + col) * channels + z];
               image[((h - row - 1) * w + col) * channels + z] = temp;
            }
         }
      }
   }

   return (unsigned char *) result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r8d, %ebx
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %r15
movl $0x8, (%rsp)
leaq -0x44(%rbp), %r9
callq 0x4b2e
testq %rax, %rax
je 0x14e8
movq %rax, %r14
movl -0x44(%rbp), %eax
cmpl $0x8, %eax
movq %r12, -0x38(%rbp)
je 0x14f0
cmpl $0x10, %eax
jne 0x15b4
movq %r15, -0x30(%rbp)
movl (%r15), %eax
movl (%r13), %r15d
movl %ebx, %ecx
testl %ebx, %ebx
jne 0x14ab
movl (%r12), %ecx
imull %eax, %r15d
imull %ecx, %r15d
movslq %r15d, %rdi
callq 0x1120
movq %rax, %r12
testq %rax, %rax
je 0x14f5
testl %r15d, %r15d
jle 0x14de
movl %r15d, %eax
xorl %ecx, %ecx
movb 0x1(%r14,%rcx,2), %dl
movb %dl, (%r12,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x14cd
movq %r14, %rdi
callq 0x10f0
jmp 0x1503
xorl %r12d, %r12d
jmp 0x15a2
movq %r14, %r12
jmp 0x1507
leaq 0x15a2c(%rip), %rax     # 0x16f28
movq %rax, 0x1acbd(%rip)     # 0x1c1c0
movq -0x30(%rbp), %r15
cmpl $0x0, 0x1acba(%rip)     # 0x1c1c8
je 0x15a2
movl (%r13), %eax
testl %ebx, %ebx
jne 0x1522
movq -0x38(%rbp), %rcx
movl (%rcx), %ebx
movl %eax, %esi
sarl %esi
testl %esi, %esi
jle 0x15a2
movslq (%r15), %rcx
movslq %ebx, %rdx
movl %esi, %esi
movq %rsi, -0x38(%rbp)
movl %edx, %edi
decl %eax
imull %ecx, %eax
movq %rdx, %r8
imulq %rcx, %r8
xorl %r9d, %r9d
movq %r12, -0x30(%rbp)
movq %r12, %r10
testl %ecx, %ecx
jle 0x1590
movslq %eax, %r11
imulq %rdx, %r11
addq -0x30(%rbp), %r11
movq %r10, %r14
xorl %r15d, %r15d
testl %ebx, %ebx
jle 0x1582
xorl %r13d, %r13d
movb (%r14,%r13), %r12b
movb (%r11,%r13), %sil
movb %sil, (%r14,%r13)
movb %r12b, (%r11,%r13)
incq %r13
cmpq %r13, %rdi
jne 0x156a
incq %r15
addq %rdx, %r11
addq %rdx, %r14
cmpq %rcx, %r15
jne 0x1563
incq %r9
subl %ecx, %eax
addq %r8, %r10
cmpq -0x38(%rbp), %r9
jne 0x154e
movq -0x30(%rbp), %r12
movq %r12, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x157fd(%rip), %rdi     # 0x16db8
leaq 0x15810(%rip), %rsi     # 0x16dd2
leaq 0x1581b(%rip), %rcx     # 0x16de4
movl $0x45d, %edx            # imm = 0x45D
callq 0x1080