// File: /workspace/github_c_makefile_star2_O1/patriciogonzalezvivo[P]tprint/include/std/stb_image.h
// Function: stbi__tga_info(stbi__context*, int*, int*, int*)
static int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp)
{
    int tga_w, tga_h, tga_comp;
    int sz;
    stbi__get8(s);                   // discard Offset
    sz = stbi__get8(s);              // color type
    if( sz > 1 ) {
        stbi__rewind(s);
        return 0;      // only RGB or indexed allowed
    }
    sz = stbi__get8(s);              // image type
    // only RGB or grey allowed, +/- RLE
    if ((sz != 1) && (sz != 2) && (sz != 3) && (sz != 9) && (sz != 10) && (sz != 11)) return 0;
    stbi__skip(s,9);
    tga_w = stbi__get16le(s);
    if( tga_w < 1 ) {
        stbi__rewind(s);
        return 0;   // test width
    }
    tga_h = stbi__get16le(s);
    if( tga_h < 1 ) {
        stbi__rewind(s);
        return 0;   // test height
    }
    sz = stbi__get8(s);               // bits per pixel
    // only RGB or RGBA or grey allowed
    if ((sz != 8) && (sz != 16) && (sz != 24) && (sz != 32)) {
        stbi__rewind(s);
        return 0;
    }
    tga_comp = sz;
    if (x) *x = tga_w;
    if (y) *y = tga_h;
    if (comp) *comp = tga_comp / 8;
    return 1;                   // seems to have passed everything
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
movq 0xb8(%rdi), %rax
cmpq 0xc0(%rdi), %rax
jb 0x1fff2
cmpl $0x0, 0x30(%r15)
je 0x1fffc
movq 0x28(%r15), %rdi
leaq 0x38(%r15), %r13
movl 0x34(%r15), %edx
movq %r13, %rsi
callq *0x10(%r15)
testl %eax, %eax
je 0x1ffcc
movq %r13, 0xb8(%r15)
cltq
addq %r13, %rax
movq %rax, 0xc0(%r15)
jmp 0x1ffeb
movl $0x0, 0x30(%r15)
movq %r13, 0xb8(%r15)
leaq 0x39(%r15), %rax
movq %rax, 0xc0(%r15)
movb $0x0, 0x38(%r15)
movq 0xb8(%r15), %rax
incq %rax
movq %rax, 0xb8(%r15)
movq 0xb8(%r15), %rax
cmpq 0xc0(%r15), %rax
jb 0x20065
cmpl $0x0, 0x30(%r15)
je 0x20085
movq 0x28(%r15), %rdi
leaq 0x38(%r15), %r13
movl 0x34(%r15), %edx
movq %r13, %rsi
callq *0x10(%r15)
testl %eax, %eax
je 0x2003f
movq %r13, 0xb8(%r15)
cltq
addq %r13, %rax
movq %rax, 0xc0(%r15)
jmp 0x2005e
movl $0x0, 0x30(%r15)
movq %r13, 0xb8(%r15)
leaq 0x39(%r15), %rax
movq %rax, 0xc0(%r15)
movb $0x0, 0x38(%r15)
movq 0xb8(%r15), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r15)
cmpb $0x2, (%rax)
jb 0x20085
movq 0xc8(%r15), %rax
movq %rax, 0xb8(%r15)
jmp 0x200c8
movq 0xb8(%r15), %rax
cmpq 0xc0(%r15), %rax
jb 0x200f5
cmpl $0x0, 0x30(%r15)
je 0x200c8
movq 0x28(%r15), %rdi
leaq 0x38(%r15), %r13
movl 0x34(%r15), %edx
movq %r13, %rsi
callq *0x10(%r15)
testl %eax, %eax
je 0x200cf
movq %r13, 0xb8(%r15)
cltq
addq %r13, %rax
movq %rax, 0xc0(%r15)
jmp 0x200ee
xorl %ebp, %ebp
jmp 0x2023d
movl $0x0, 0x30(%r15)
movq %r13, 0xb8(%r15)
leaq 0x39(%r15), %rax
movq %rax, 0xc0(%r15)
movb $0x0, 0x38(%r15)
movq 0xb8(%r15), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r15)
movb (%rax), %al
andb $-0x9, %al
addb $-0x4, %al
xorl %ebp, %ebp
cmpb $-0x3, %al
jb 0x2023d
cmpq $0x0, 0x10(%r15)
je 0x20146
movq 0xc0(%r15), %rcx
movl 0xb8(%r15), %edx
movl %ecx, %eax
subl %edx, %eax
cmpl $0x8, %eax
jg 0x20146
movq %rcx, 0xb8(%r15)
movq 0x28(%r15), %rdi
movl $0x9, %esi
subl %eax, %esi
callq *0x18(%r15)
jmp 0x2014e
addq $0x9, 0xb8(%r15)
movq %r15, %rdi
callq 0x1e0d5
testl %eax, %eax
je 0x2022f
movl %eax, %r13d
movq %r15, %rdi
callq 0x1e0d5
testl %eax, %eax
je 0x2022f
movq 0xb8(%r15), %rdx
cmpq 0xc0(%r15), %rdx
jb 0x201f2
cmpl $0x0, 0x30(%r15)
je 0x201bf
movl %eax, 0xc(%rsp)
movq 0x28(%r15), %rdi
leaq 0x38(%r15), %rsi
movl 0x34(%r15), %edx
movq %rsi, 0x10(%rsp)
callq *0x10(%r15)
testl %eax, %eax
je 0x201c3
movq 0x10(%rsp), %rcx
movq %rcx, 0xb8(%r15)
cltq
addq %rcx, %rax
movq %rax, 0xc0(%r15)
jmp 0x201e7
xorl %edx, %edx
jmp 0x201ff
movl $0x0, 0x30(%r15)
movq 0x10(%rsp), %rax
movq %rax, 0xb8(%r15)
leaq 0x39(%r15), %rax
movq %rax, 0xc0(%r15)
movb $0x0, 0x38(%r15)
movl 0xc(%rsp), %eax
movq 0xb8(%r15), %rdx
leaq 0x1(%rdx), %rcx
movq %rcx, 0xb8(%r15)
movb (%rdx), %dl
leal -0x8(%rdx), %ecx
rolb $0x5, %cl
cmpb $0x4, %cl
jae 0x2022f
testq %r12, %r12
je 0x20213
movl %r13d, (%r12)
testq %r14, %r14
je 0x2021b
movl %eax, (%r14)
movl $0x1, %ebp
testq %rbx, %rbx
je 0x2023d
shrb $0x3, %dl
movzbl %dl, %eax
movl %eax, (%rbx)
jmp 0x2023d
movq 0xc8(%r15), %rax
movq %rax, 0xb8(%r15)
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq