// File: /workspace/github_c_makefile_star2_O3/zhiyb[P]png2tlg/./stb_image.h
// Function: stbi__gif_header(stbi__context*, stbi__gif*, int*, int)
static int stbi__gif_header(stbi__context *s, stbi__gif *g, int *comp, int is_info)
{
   stbi_uc version;
   if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8')
      return stbi__err("not GIF", "Corrupt GIF");

   version = stbi__get8(s);
   if (version != '7' && version != '9')    return stbi__err("not GIF", "Corrupt GIF");
   if (stbi__get8(s) != 'a')                return stbi__err("not GIF", "Corrupt GIF");

   stbi__g_failure_reason = "";
   g->w = stbi__get16le(s);
   g->h = stbi__get16le(s);
   g->flags = stbi__get8(s);
   g->bgindex = stbi__get8(s);
   g->ratio = stbi__get8(s);
   g->transparent = -1;

   if (comp != 0) *comp = 4;  // can't actually tell whether it's 3 or 4 until we parse the comments

   if (is_info) return 1;

   if (g->flags & 0x80)
      stbi__gif_parse_colortable(s,g->pal, 2 << (g->flags & 7), -1);

   return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq 0xb8(%rdi), %rdx
movq 0xc0(%rdi), %rax
cmpq %rax, %rdx
jae 0x147eb
leaq 0x1(%rdx), %rcx
movq %rcx, 0xb8(%r14)
movb (%rdx), %dl
jmp 0x1483d
cmpl $0x0, 0x30(%r14)
je 0x14abd
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r12
movl 0x34(%r14), %edx
movq %r12, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x14818
cltq
addq %r12, %rax
movb (%r12), %dl
jmp 0x1482b
movl $0x0, 0x30(%r14)
leaq 0x39(%r14), %rax
movb $0x0, 0x38(%r14)
xorl %edx, %edx
movq %rax, 0xc0(%r14)
leaq 0x39(%r14), %rcx
movq %rcx, 0xb8(%r14)
cmpb $0x47, %dl
jne 0x14abd
cmpq %rax, %rcx
jae 0x1485a
leaq 0x1(%rcx), %rdx
movq %rdx, 0xb8(%r14)
movb (%rcx), %cl
jmp 0x148ac
cmpl $0x0, 0x30(%r14)
je 0x14abd
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r12
movl 0x34(%r14), %edx
movq %r12, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x14887
cltq
addq %r12, %rax
movb (%r12), %cl
jmp 0x1489a
movl $0x0, 0x30(%r14)
leaq 0x39(%r14), %rax
movb $0x0, 0x38(%r14)
xorl %ecx, %ecx
movq %rax, 0xc0(%r14)
leaq 0x39(%r14), %rdx
movq %rdx, 0xb8(%r14)
cmpb $0x49, %cl
jne 0x14abd
cmpq %rax, %rdx
jae 0x148c9
leaq 0x1(%rdx), %rcx
movq %rcx, 0xb8(%r14)
movb (%rdx), %dl
jmp 0x1491b
cmpl $0x0, 0x30(%r14)
je 0x14abd
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r12
movl 0x34(%r14), %edx
movq %r12, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x148f6
cltq
addq %r12, %rax
movb (%r12), %dl
jmp 0x14909
movl $0x0, 0x30(%r14)
leaq 0x39(%r14), %rax
movb $0x0, 0x38(%r14)
xorl %edx, %edx
movq %rax, 0xc0(%r14)
leaq 0x39(%r14), %rcx
movq %rcx, 0xb8(%r14)
cmpb $0x46, %dl
jne 0x14abd
cmpq %rax, %rcx
jae 0x14938
leaq 0x1(%rcx), %rdx
movq %rdx, 0xb8(%r14)
movb (%rcx), %cl
jmp 0x1498a
cmpl $0x0, 0x30(%r14)
je 0x14abd
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r12
movl 0x34(%r14), %edx
movq %r12, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x14965
cltq
addq %r12, %rax
movb (%r12), %cl
jmp 0x14978
movl $0x0, 0x30(%r14)
leaq 0x39(%r14), %rax
movb $0x0, 0x38(%r14)
xorl %ecx, %ecx
movq %rax, 0xc0(%r14)
leaq 0x39(%r14), %rdx
movq %rdx, 0xb8(%r14)
cmpb $0x38, %cl
jne 0x14abd
cmpq %rax, %rdx
jae 0x149a7
leaq 0x1(%rdx), %rcx
movq %rcx, 0xb8(%r14)
movb (%rdx), %dl
jmp 0x149f9
cmpl $0x0, 0x30(%r14)
je 0x14abd
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r12
movl 0x34(%r14), %edx
movq %r12, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x149d4
cltq
addq %r12, %rax
movb (%r12), %dl
jmp 0x149e7
movl $0x0, 0x30(%r14)
leaq 0x39(%r14), %rax
movb $0x0, 0x38(%r14)
xorl %edx, %edx
movq %rax, 0xc0(%r14)
leaq 0x39(%r14), %rcx
movq %rcx, 0xb8(%r14)
cmpb $0x37, %dl
je 0x14a0a
movzbl %dl, %edx
cmpl $0x39, %edx
jne 0x14abd
cmpq %rax, %rcx
jae 0x14a1e
leaq 0x1(%rcx), %rax
movq %rax, 0xb8(%r14)
movb (%rcx), %al
jmp 0x14a71
cmpl $0x0, 0x30(%r14)
je 0x14abd
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r12
movl 0x34(%r14), %edx
movq %r12, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x14a4c
movslq %eax, %rcx
addq %r12, %rcx
movb (%r12), %al
jmp 0x14a5f
movl $0x0, 0x30(%r14)
leaq 0x39(%r14), %rcx
movb $0x0, 0x38(%r14)
xorl %eax, %eax
movq %rcx, 0xc0(%r14)
leaq 0x39(%r14), %rcx
movq %rcx, 0xb8(%r14)
cmpb $0x61, %al
jne 0x14abd
leaq 0x4aaf(%rip), %rax      # 0x1952b
movq %rax, 0x8775(%rip)      # 0x1d1f8
movq %r14, %rdi
callq 0x136e6
movl %eax, (%rbx)
movq %r14, %rdi
callq 0x136e6
movl %eax, 0x4(%rbx)
movq 0xb8(%r14), %rcx
movq 0xc0(%r14), %rax
cmpq %rax, %rcx
jae 0x14ada
leaq 0x1(%rcx), %rsi
movq %rsi, 0xb8(%r14)
movb (%rcx), %dl
movq %rsi, %rcx
jmp 0x14b2c
leaq 0x46cd(%rip), %rax      # 0x19191
movq %rax, 0x872d(%rip)      # 0x1d1f8
xorl %r15d, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x30(%r14)
je 0x14b03
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r12
movl 0x34(%r14), %edx
movq %r12, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x14b07
cltq
addq %r12, %rax
movb (%r12), %dl
jmp 0x14b1a
xorl %edx, %edx
jmp 0x14b2c
movl $0x0, 0x30(%r14)
leaq 0x39(%r14), %rax
movb $0x0, 0x38(%r14)
xorl %edx, %edx
movq %rax, 0xc0(%r14)
leaq 0x39(%r14), %rcx
movq %rcx, 0xb8(%r14)
movzbl %dl, %edx
movl %edx, 0x20(%rbx)
cmpq %rax, %rcx
jae 0x14b49
leaq 0x1(%rcx), %rsi
movq %rsi, 0xb8(%r14)
movb (%rcx), %dl
movq %rsi, %rcx
jmp 0x14b9b
cmpl $0x0, 0x30(%r14)
je 0x14b72
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r12
movl 0x34(%r14), %edx
movq %r12, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x14b76
cltq
addq %r12, %rax
movb (%r12), %dl
jmp 0x14b89
xorl %edx, %edx
jmp 0x14b9b
movl $0x0, 0x30(%r14)
leaq 0x39(%r14), %rax
movb $0x0, 0x38(%r14)
xorl %edx, %edx
movq %rax, 0xc0(%r14)
leaq 0x39(%r14), %rcx
movq %rcx, 0xb8(%r14)
movzbl %dl, %edx
movl %edx, 0x24(%rbx)
cmpq %rax, %rcx
jae 0x14bb5
leaq 0x1(%rcx), %rax
movq %rax, 0xb8(%r14)
movb (%rcx), %al
jmp 0x14c08
cmpl $0x0, 0x30(%r14)
je 0x14bdf
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r12
movl 0x34(%r14), %edx
movq %r12, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x14be3
movslq %eax, %rcx
addq %r12, %rcx
movb (%r12), %al
jmp 0x14bf6
xorl %eax, %eax
jmp 0x14c08
movl $0x0, 0x30(%r14)
leaq 0x39(%r14), %rcx
movb $0x0, 0x38(%r14)
xorl %eax, %eax
movq %rcx, 0xc0(%r14)
leaq 0x39(%r14), %rcx
movq %rcx, 0xb8(%r14)
movzbl %al, %eax
movl %eax, 0x28(%rbx)
movl $0xffffffff, 0x2c(%rbx) # imm = 0xFFFFFFFF
testq %r15, %r15
je 0x14c21
movl $0x4, (%r15)
movl $0x1, %r15d
testl %ebp, %ebp
jne 0x14ace
movl 0x20(%rbx), %ecx
testb %cl, %cl
jns 0x14ace
addq $0x34, %rbx
andb $0x7, %cl
movl $0x2, %edx
shll %cl, %edx
movq %r14, %rdi
movq %rbx, %rsi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x14c5d
jmp 0x14ace