// File: /workspace/github_c_makefile_star2_O0/zhiyb[P]png2tlg/./stb_image.h
// Function: stbi__bmp_parse_header(stbi__context*, stbi__bmp_data*)
static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info)
{
   int hsz;
   if (stbi__get8(s) != 'B' || stbi__get8(s) != 'M') return stbi__errpuc("not BMP", "Corrupt BMP");
   stbi__get32le(s); // discard filesize
   stbi__get16le(s); // discard reserved
   stbi__get16le(s); // discard reserved
   info->offset = stbi__get32le(s);
   info->hsz = hsz = stbi__get32le(s);
   info->mr = info->mg = info->mb = info->ma = 0;

   if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108 && hsz != 124) return stbi__errpuc("unknown BMP", "BMP type not supported: unknown");
   if (hsz == 12) {
      s->img_x = stbi__get16le(s);
      s->img_y = stbi__get16le(s);
   } else {
      s->img_x = stbi__get32le(s);
      s->img_y = stbi__get32le(s);
   }
   if (stbi__get16le(s) != 1) return stbi__errpuc("bad BMP", "bad BMP");
   info->bpp = stbi__get16le(s);
   if (hsz != 12) {
      int compress = stbi__get32le(s);
      if (compress == 1 || compress == 2) return stbi__errpuc("BMP RLE", "BMP type not supported: RLE");
      stbi__get32le(s); // discard sizeof
      stbi__get32le(s); // discard hres
      stbi__get32le(s); // discard vres
      stbi__get32le(s); // discard colorsused
      stbi__get32le(s); // discard max important
      if (hsz == 40 || hsz == 56) {
         if (hsz == 56) {
            stbi__get32le(s);
            stbi__get32le(s);
            stbi__get32le(s);
            stbi__get32le(s);
         }
         if (info->bpp == 16 || info->bpp == 32) {
            if (compress == 0) {
               if (info->bpp == 32) {
                  info->mr = 0xffu << 16;
                  info->mg = 0xffu <<  8;
                  info->mb = 0xffu <<  0;
                  info->ma = 0xffu << 24;
                  info->all_a = 0; // if all_a is 0 at end, then we loaded alpha channel but it was all 0
               } else {
                  info->mr = 31u << 10;
                  info->mg = 31u <<  5;
                  info->mb = 31u <<  0;
               }
            } else if (compress == 3) {
               info->mr = stbi__get32le(s);
               info->mg = stbi__get32le(s);
               info->mb = stbi__get32le(s);
               // not documented, but generated by photoshop and handled by mspaint
               if (info->mr == info->mg && info->mg == info->mb) {
                  // ?!?!?
                  return stbi__errpuc("bad BMP", "bad BMP");
               }
            } else
               return stbi__errpuc("bad BMP", "bad BMP");
         }
      } else {
         int i;
         if (hsz != 108 && hsz != 124)
            return stbi__errpuc("bad BMP", "bad BMP");
         info->mr = stbi__get32le(s);
         info->mg = stbi__get32le(s);
         info->mb = stbi__get32le(s);
         info->ma = stbi__get32le(s);
         stbi__get32le(s); // discard color space
         for (i=0; i < 12; ++i)
            stbi__get32le(s); // discard color space parameters
         if (hsz == 124) {
            stbi__get32le(s); // discard rendering intent
            stbi__get32le(s); // discard offset of profile data
            stbi__get32le(s); // discard size of profile data
            stbi__get32le(s); // discard reserved
         }
      }
   }
   return (void *) 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x12e60
movzbl %al, %eax
cmpl $0x42, %eax
jne 0x1a842
movq -0x10(%rbp), %rdi
callq 0x12e60
movzbl %al, %eax
cmpl $0x4d, %eax
je 0x1a862
leaq 0x662c(%rip), %rdi      # 0x20e75
callq 0x2680
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, -0x8(%rbp)
jmp 0x1ac44
movq -0x10(%rbp), %rdi
callq 0x1a790
movq -0x10(%rbp), %rdi
callq 0x1a7d0
movq -0x10(%rbp), %rdi
callq 0x1a7d0
movq -0x10(%rbp), %rdi
callq 0x1a790
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rdi
callq 0x1a790
movl %eax, %ecx
movl %ecx, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x18(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x14(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0xc(%rax)
cmpl $0xc, -0x1c(%rbp)
je 0x1a90e
cmpl $0x28, -0x1c(%rbp)
je 0x1a90e
cmpl $0x38, -0x1c(%rbp)
je 0x1a90e
cmpl $0x6c, -0x1c(%rbp)
je 0x1a90e
cmpl $0x7c, -0x1c(%rbp)
je 0x1a90e
leaq 0x6588(%rip), %rdi      # 0x20e7d
callq 0x2680
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, -0x8(%rbp)
jmp 0x1ac44
cmpl $0xc, -0x1c(%rbp)
jne 0x1a939
movq -0x10(%rbp), %rdi
callq 0x1a7d0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
callq 0x1a7d0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
jmp 0x1a95c
movq -0x10(%rbp), %rdi
callq 0x1a790
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
callq 0x1a790
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rdi
callq 0x1a7d0
cmpl $0x1, %eax
je 0x1a98a
leaq 0x6518(%rip), %rdi      # 0x20e89
callq 0x2680
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, -0x8(%rbp)
jmp 0x1ac44
movq -0x10(%rbp), %rdi
callq 0x1a7d0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
cmpl $0xc, -0x1c(%rbp)
je 0x1ac3b
movq -0x10(%rbp), %rdi
callq 0x1a790
movl %eax, -0x20(%rbp)
cmpl $0x1, -0x20(%rbp)
je 0x1a9bd
cmpl $0x2, -0x20(%rbp)
jne 0x1a9dd
leaq 0x64cd(%rip), %rdi      # 0x20e91
callq 0x2680
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, -0x8(%rbp)
jmp 0x1ac44
movq -0x10(%rbp), %rdi
callq 0x1a790
movq -0x10(%rbp), %rdi
callq 0x1a790
movq -0x10(%rbp), %rdi
callq 0x1a790
movq -0x10(%rbp), %rdi
callq 0x1a790
movq -0x10(%rbp), %rdi
callq 0x1a790
cmpl $0x28, -0x1c(%rbp)
je 0x1aa1a
cmpl $0x38, -0x1c(%rbp)
jne 0x1ab6f
cmpl $0x38, -0x1c(%rbp)
jne 0x1aa44
movq -0x10(%rbp), %rdi
callq 0x1a790
movq -0x10(%rbp), %rdi
callq 0x1a790
movq -0x10(%rbp), %rdi
callq 0x1a790
movq -0x10(%rbp), %rdi
callq 0x1a790
movq -0x18(%rbp), %rax
cmpl $0x10, (%rax)
je 0x1aa5a
movq -0x18(%rbp), %rax
cmpl $0x20, (%rax)
jne 0x1ab6a
cmpl $0x0, -0x20(%rbp)
jne 0x1aac8
movq -0x18(%rbp), %rax
cmpl $0x20, (%rax)
jne 0x1aaa2
movq -0x18(%rbp), %rax
movl $0xff0000, 0xc(%rax)    # imm = 0xFF0000
movq -0x18(%rbp), %rax
movl $0xff00, 0x10(%rax)     # imm = 0xFF00
movq -0x18(%rbp), %rax
movl $0xff, 0x14(%rax)
movq -0x18(%rbp), %rax
movl $0xff000000, 0x18(%rax) # imm = 0xFF000000
movq -0x18(%rbp), %rax
movl $0x0, 0x1c(%rax)
jmp 0x1aac3
movq -0x18(%rbp), %rax
movl $0x7c00, 0xc(%rax)      # imm = 0x7C00
movq -0x18(%rbp), %rax
movl $0x3e0, 0x10(%rax)      # imm = 0x3E0
movq -0x18(%rbp), %rax
movl $0x1f, 0x14(%rax)
jmp 0x1ab68
cmpl $0x3, -0x20(%rbp)
jne 0x1ab46
movq -0x10(%rbp), %rdi
callq 0x1a790
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rdi
callq 0x1a790
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rdi
callq 0x1a790
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jne 0x1ab44
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jne 0x1ab44
leaq 0x635e(%rip), %rdi      # 0x20e89
callq 0x2680
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, -0x8(%rbp)
jmp 0x1ac44
jmp 0x1ab66
leaq 0x633c(%rip), %rdi      # 0x20e89
callq 0x2680
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, -0x8(%rbp)
jmp 0x1ac44
jmp 0x1ab68
jmp 0x1ab6a
jmp 0x1ac39
cmpl $0x6c, -0x1c(%rbp)
je 0x1ab9b
cmpl $0x7c, -0x1c(%rbp)
je 0x1ab9b
leaq 0x6307(%rip), %rdi      # 0x20e89
callq 0x2680
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, -0x8(%rbp)
jmp 0x1ac44
movq -0x10(%rbp), %rdi
callq 0x1a790
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rdi
callq 0x1a790
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rdi
callq 0x1a790
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x10(%rbp), %rdi
callq 0x1a790
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x10(%rbp), %rdi
callq 0x1a790
movl $0x0, -0x24(%rbp)
cmpl $0xc, -0x24(%rbp)
jge 0x1ac0d
movq -0x10(%rbp), %rdi
callq 0x1a790
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1abf3
cmpl $0x7c, -0x1c(%rbp)
jne 0x1ac37
movq -0x10(%rbp), %rdi
callq 0x1a790
movq -0x10(%rbp), %rdi
callq 0x1a790
movq -0x10(%rbp), %rdi
callq 0x1a790
movq -0x10(%rbp), %rdi
callq 0x1a790
jmp 0x1ac39
jmp 0x1ac3b
movl $0x1, %eax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop