// File: /workspace/github_cpp_makefile_star2_O1/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, %r15
movq %rdx, %r13
movq %rsi, %r14
movl $0x8, (%rsp)
leaq -0x44(%rbp), %r9
callq 0x4a7b
testq %rax, %rax
je 0x1477
movq %rax, %r12
movl -0x44(%rbp), %eax
cmpl $0x8, %eax
je 0x14a2
movq %r15, -0x38(%rbp)
cmpl $0x10, %eax
jne 0x154c
movq %r14, -0x30(%rbp)
movl (%r14), %eax
movl (%r13), %r15d
movl %ebx, %ecx
testl %ebx, %ebx
jne 0x143a
movq -0x38(%rbp), %rcx
movl (%rcx), %ecx
imull %eax, %r15d
imull %ecx, %r15d
movslq %r15d, %rdi
callq 0x1120
testq %rax, %rax
je 0x147f
movq %rax, %r14
testl %r15d, %r15d
jle 0x146d
movl %r15d, %eax
xorl %ecx, %ecx
movb 0x1(%r12,%rcx,2), %dl
movb %dl, (%r14,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x145c
movq %r12, %rdi
callq 0x10f0
jmp 0x1490
xorl %r12d, %r12d
jmp 0x153a
leaq 0x16aa2(%rip), %rax     # 0x17f28
movq %rax, 0x1bd53(%rip)     # 0x1d1e0
xorl %r14d, %r14d
movl $0x8, -0x44(%rbp)
movq %r14, %r12
movq -0x30(%rbp), %r14
movq -0x38(%rbp), %r15
cmpl $0x0, 0x1bd3f(%rip)     # 0x1d1e8
je 0x153a
movl (%r13), %eax
testl %ebx, %ebx
jne 0x14ba
movl (%r15), %ebx
movl %eax, %esi
sarl %esi
testl %esi, %esi
jle 0x153a
movslq (%r14), %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 0x1528
movslq %eax, %r11
imulq %rdx, %r11
addq -0x30(%rbp), %r11
movq %r10, %r14
xorl %r15d, %r15d
testl %ebx, %ebx
jle 0x151a
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 0x1502
incq %r15
addq %rdx, %r11
addq %rdx, %r14
cmpq %rcx, %r15
jne 0x14fb
incq %r9
subl %ecx, %eax
addq %r8, %r10
cmpq -0x38(%rbp), %r9
jne 0x14e6
movq -0x30(%rbp), %r12
movq %r12, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x16865(%rip), %rdi     # 0x17db8
leaq 0x16878(%rip), %rsi     # 0x17dd2
leaq 0x16883(%rip), %rcx     # 0x17de4
movl $0x45d, %edx            # imm = 0x45D
callq 0x1090