// File: /workspace/github_cpp_makefile_star2_O3/srajangarg[P]raytracer/src/core/stb_image.hpp
// 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 0x21c68
leaq 0x1(%rdx), %rcx
movq %rcx, 0xb8(%r14)
movb (%rdx), %dl
jmp 0x21cba
cmpl $0x0, 0x30(%r14)
je 0x21f3a
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r12
movl 0x34(%r14), %edx
movq %r12, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x21c95
cltq
addq %r12, %rax
movb (%r12), %dl
jmp 0x21ca8
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 0x21f3a
cmpq %rax, %rcx
jae 0x21cd7
leaq 0x1(%rcx), %rdx
movq %rdx, 0xb8(%r14)
movb (%rcx), %cl
jmp 0x21d29
cmpl $0x0, 0x30(%r14)
je 0x21f3a
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r12
movl 0x34(%r14), %edx
movq %r12, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x21d04
cltq
addq %r12, %rax
movb (%r12), %cl
jmp 0x21d17
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 0x21f3a
cmpq %rax, %rdx
jae 0x21d46
leaq 0x1(%rdx), %rcx
movq %rcx, 0xb8(%r14)
movb (%rdx), %dl
jmp 0x21d98
cmpl $0x0, 0x30(%r14)
je 0x21f3a
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r12
movl 0x34(%r14), %edx
movq %r12, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x21d73
cltq
addq %r12, %rax
movb (%r12), %dl
jmp 0x21d86
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 0x21f3a
cmpq %rax, %rcx
jae 0x21db5
leaq 0x1(%rcx), %rdx
movq %rdx, 0xb8(%r14)
movb (%rcx), %cl
jmp 0x21e07
cmpl $0x0, 0x30(%r14)
je 0x21f3a
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r12
movl 0x34(%r14), %edx
movq %r12, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x21de2
cltq
addq %r12, %rax
movb (%r12), %cl
jmp 0x21df5
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 0x21f3a
cmpq %rax, %rdx
jae 0x21e24
leaq 0x1(%rdx), %rcx
movq %rcx, 0xb8(%r14)
movb (%rdx), %dl
jmp 0x21e76
cmpl $0x0, 0x30(%r14)
je 0x21f3a
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r12
movl 0x34(%r14), %edx
movq %r12, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x21e51
cltq
addq %r12, %rax
movb (%r12), %dl
jmp 0x21e64
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 0x21e87
movzbl %dl, %edx
cmpl $0x39, %edx
jne 0x21f3a
cmpq %rax, %rcx
jae 0x21e9b
leaq 0x1(%rcx), %rax
movq %rax, 0xb8(%r14)
movb (%rcx), %al
jmp 0x21eee
cmpl $0x0, 0x30(%r14)
je 0x21f3a
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r12
movl 0x34(%r14), %edx
movq %r12, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x21ec9
movslq %eax, %rcx
addq %r12, %rcx
movb (%r12), %al
jmp 0x21edc
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 0x21f3a
leaq 0x91ec(%rip), %rax      # 0x2b0e5
movq %rax, 0x15490(%rip)     # 0x37390
movq %r14, %rdi
callq 0x158c8
movl %eax, (%rbx)
movq %r14, %rdi
callq 0x158c8
movl %eax, 0x4(%rbx)
movq 0xb8(%r14), %rcx
movq 0xc0(%r14), %rax
cmpq %rax, %rcx
jae 0x21f57
leaq 0x1(%rcx), %rsi
movq %rsi, 0xb8(%r14)
movb (%rcx), %dl
movq %rsi, %rcx
jmp 0x21fa9
leaq 0xa892(%rip), %rax      # 0x2c7d3
movq %rax, 0x15448(%rip)     # 0x37390
xorl %r15d, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x30(%r14)
je 0x21f80
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r12
movl 0x34(%r14), %edx
movq %r12, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x21f84
cltq
addq %r12, %rax
movb (%r12), %dl
jmp 0x21f97
xorl %edx, %edx
jmp 0x21fa9
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, 0x18(%rbx)
cmpq %rax, %rcx
jae 0x21fc6
leaq 0x1(%rcx), %rsi
movq %rsi, 0xb8(%r14)
movb (%rcx), %dl
movq %rsi, %rcx
jmp 0x22018
cmpl $0x0, 0x30(%r14)
je 0x21fef
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r12
movl 0x34(%r14), %edx
movq %r12, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x21ff3
cltq
addq %r12, %rax
movb (%r12), %dl
jmp 0x22006
xorl %edx, %edx
jmp 0x22018
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, 0x1c(%rbx)
cmpq %rax, %rcx
jae 0x22032
leaq 0x1(%rcx), %rax
movq %rax, 0xb8(%r14)
movb (%rcx), %al
jmp 0x22085
cmpl $0x0, 0x30(%r14)
je 0x2205c
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r12
movl 0x34(%r14), %edx
movq %r12, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x22060
movslq %eax, %rcx
addq %r12, %rcx
movb (%r12), %al
jmp 0x22073
xorl %eax, %eax
jmp 0x22085
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, 0x20(%rbx)
movl $0xffffffff, 0x24(%rbx) # imm = 0xFFFFFFFF
testq %r15, %r15
je 0x2209e
movl $0x4, (%r15)
movl $0x1, %r15d
testl %ebp, %ebp
jne 0x21f4b
movl 0x18(%rbx), %ecx
testb %cl, %cl
jns 0x21f4b
addq $0x30, %rbx
andb $0x7, %cl
movl $0x2, %edx
shll %cl, %edx
movq %r14, %rdi
movq %rbx, %rsi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x2213f
jmp 0x21f4b