// File: /workspace/github_c_makefile_star2_O0/zhiyb[P]png2tlg/./stb_image.h
// Function: stbi__tga_test(stbi__context*)
static int stbi__tga_test(stbi__context *s)
{
   int res = 0;
   int sz, tga_color_type;
   stbi__get8(s);      //   discard Offset
   tga_color_type = stbi__get8(s);   //   color type
   if ( tga_color_type > 1 ) goto errorEnd;   //   only RGB or indexed allowed
   sz = stbi__get8(s);   //   image type
   if ( tga_color_type == 1 ) { // colormapped (paletted) image
      if (sz != 1 && sz != 9) goto errorEnd; // colortype 1 demands image type 1 or 9
      stbi__skip(s,4);       // skip index of first colormap entry and number of entries
      sz = stbi__get8(s);    //   check bits per palette color entry
      if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) goto errorEnd;
      stbi__skip(s,4);       // skip image x and y origin
   } else { // "normal" image w/o colormap
      if ( (sz != 2) && (sz != 3) && (sz != 10) && (sz != 11) ) goto errorEnd; // only RGB or grey allowed, +/- RLE
      stbi__skip(s,9); // skip colormap specification and image x/y origin
   }
   if ( stbi__get16le(s) < 1 ) goto errorEnd;      //   test width
   if ( stbi__get16le(s) < 1 ) goto errorEnd;      //   test height
   sz = stbi__get8(s);   //   bits per pixel
   if ( (tga_color_type == 1) && (sz != 8) && (sz != 16) ) goto errorEnd; // for colormapped images, bpp is size of an index
   if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) goto errorEnd;

   res = 1; // if we got this far, everything's good and we can return 1 instead of 0

errorEnd:
   stbi__rewind(s);
   return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x12e60
movq -0x8(%rbp), %rdi
callq 0x12e60
movzbl %al, %eax
movl %eax, -0x14(%rbp)
cmpl $0x1, -0x14(%rbp)
jle 0xb1a6
jmp 0xb2ae
movq -0x8(%rbp), %rdi
callq 0x12e60
movzbl %al, %eax
movl %eax, -0x10(%rbp)
cmpl $0x1, -0x14(%rbp)
jne 0xb21c
cmpl $0x1, -0x10(%rbp)
je 0xb1cc
cmpl $0x9, -0x10(%rbp)
je 0xb1cc
jmp 0xb2ae
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0x13350
movq -0x8(%rbp), %rdi
callq 0x12e60
movzbl %al, %eax
movl %eax, -0x10(%rbp)
cmpl $0x8, -0x10(%rbp)
je 0xb20c
cmpl $0xf, -0x10(%rbp)
je 0xb20c
cmpl $0x10, -0x10(%rbp)
je 0xb20c
cmpl $0x18, -0x10(%rbp)
je 0xb20c
cmpl $0x20, -0x10(%rbp)
je 0xb20c
jmp 0xb2ae
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0x13350
jmp 0xb244
cmpl $0x2, -0x10(%rbp)
je 0xb236
cmpl $0x3, -0x10(%rbp)
je 0xb236
cmpl $0xa, -0x10(%rbp)
je 0xb236
cmpl $0xb, -0x10(%rbp)
je 0xb236
jmp 0xb2ae
movq -0x8(%rbp), %rdi
movl $0x9, %esi
callq 0x13350
movq -0x8(%rbp), %rdi
callq 0x1a7d0
cmpl $0x1, %eax
jge 0xb254
jmp 0xb2ae
movq -0x8(%rbp), %rdi
callq 0x1a7d0
cmpl $0x1, %eax
jge 0xb264
jmp 0xb2ae
movq -0x8(%rbp), %rdi
callq 0x12e60
movzbl %al, %eax
movl %eax, -0x10(%rbp)
cmpl $0x1, -0x14(%rbp)
jne 0xb287
cmpl $0x8, -0x10(%rbp)
je 0xb287
cmpl $0x10, -0x10(%rbp)
je 0xb287
jmp 0xb2ae
cmpl $0x8, -0x10(%rbp)
je 0xb2a7
cmpl $0xf, -0x10(%rbp)
je 0xb2a7
cmpl $0x10, -0x10(%rbp)
je 0xb2a7
cmpl $0x18, -0x10(%rbp)
je 0xb2a7
cmpl $0x20, -0x10(%rbp)
je 0xb2a7
jmp 0xb2ae
movl $0x1, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0xbd40
movl -0xc(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq