// File: /workspace/github_cpp_makefile_star2_O2/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, %r14d
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r13
movl $0x8, (%rsp)
leaq -0x44(%rbp), %r9
callq 0x45ad
testq %rax, %rax
je 0x147b
movq %rax, %r15
movl -0x44(%rbp), %eax
cmpl $0x8, %eax
je 0x1482
cmpl $0x10, %eax
jne 0x156f
movl (%r13), %eax
movq %r12, -0x30(%rbp)
movl (%r12), %r12d
movl %r14d, %ecx
testl %r14d, %r14d
jne 0x144b
movl (%rbx), %ecx
imull %eax, %r12d
imull %ecx, %r12d
movslq %r12d, %rdi
callq 0x1130
testq %rax, %rax
je 0x149d
xorl %edx, %edx
testl %r12d, %r12d
cmovlel %edx, %r12d
cmpq %rdx, %r12
je 0x1487
movb 0x1(%r15,%rdx,2), %cl
movb %cl, (%rax,%rdx)
incq %rdx
jmp 0x1469
xorl %eax, %eax
jmp 0x1560
movq %r15, %rax
jmp 0x14af
movq %r15, %rdi
movq %rbx, %r15
movq %rax, %rbx
callq 0x1100
movq %rbx, %rax
movq %r15, %rbx
jmp 0x14ab
leaq 0xf9a4(%rip), %rcx      # 0x10e48
movq %rcx, 0x14d45(%rip)     # 0x161f0
movq -0x30(%rbp), %r12
cmpl $0x0, 0x14d42(%rip)     # 0x161f8
je 0x1560
movslq (%r13), %r10
movl (%r12), %ecx
testl %r14d, %r14d
jne 0x14cc
movl (%rbx), %r14d
movl %ecx, %edx
sarl %edx
xorl %esi, %esi
testl %r14d, %r14d
movl $0x0, %edi
cmovgl %r14d, %edi
movslq %r14d, %r8
testl %r10d, %r10d
movl $0x0, %r9d
cmovgl %r10d, %r9d
testl %edx, %edx
cmovlel %esi, %edx
movq %rdx, -0x30(%rbp)
movq %r10, %rdx
imulq %r8, %rdx
movq %rdx, -0x38(%rbp)
decl %ecx
imull %r10d, %ecx
movq %rax, %rdx
movq %rax, %r11
cmpq -0x30(%rbp), %rsi
je 0x155d
movslq %ecx, %r14
imulq %r8, %r14
addq %rdx, %r14
movq %r11, %r15
xorl %r12d, %r12d
cmpq %r9, %r12
je 0x1551
xorl %r13d, %r13d
cmpq %r13, %rdi
je 0x1546
movb (%r15,%r13), %al
movb (%r14,%r13), %bl
movb %bl, (%r15,%r13)
movb %al, (%r14,%r13)
incq %r13
jmp 0x152c
incq %r12
addq %r8, %r15
addq %r8, %r14
jmp 0x1524
incq %rsi
addq -0x38(%rbp), %r11
subl %r10d, %ecx
jmp 0x150e
movq %rdx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xf762(%rip), %rdi      # 0x10cd8
leaq 0xf775(%rip), %rsi      # 0x10cf2
leaq 0xf780(%rip), %rcx      # 0x10d04
movl $0x45d, %edx            # imm = 0x45D
callq 0x1080