// File: /workspace/github_c_makefile_star2_O0/patriciogonzalezvivo[P]tprint/include/std/stb_image.h
// Function: stbi__process_gif_raster(stbi__context*, stbi__gif*)
static stbi_uc *stbi__process_gif_raster(stbi__context *s, stbi__gif *g)
{
   stbi_uc lzw_cs;
   stbi__int32 len, code;
   stbi__uint32 first;
   stbi__int32 codesize, codemask, avail, oldcode, bits, valid_bits, clear;
   stbi__gif_lzw *p;

   lzw_cs = stbi__get8(s);
   if (lzw_cs > 12) return NULL;
   clear = 1 << lzw_cs;
   first = 1;
   codesize = lzw_cs + 1;
   codemask = (1 << codesize) - 1;
   bits = 0;
   valid_bits = 0;
   for (code = 0; code < clear; code++) {
      g->codes[code].prefix = -1;
      g->codes[code].first = (stbi_uc) code;
      g->codes[code].suffix = (stbi_uc) code;
   }

   // support no starting clear code
   avail = clear+2;
   oldcode = -1;

   len = 0;
   for(;;) {
      if (valid_bits < codesize) {
         if (len == 0) {
            len = stbi__get8(s); // start new block
            if (len == 0)
               return g->out;
         }
         --len;
         bits |= (stbi__int32) stbi__get8(s) << valid_bits;
         valid_bits += 8;
      } else {
         stbi__int32 code = bits & codemask;
         bits >>= codesize;
         valid_bits -= codesize;
         // @OPTIMIZE: is there some way we can accelerate the non-clear path?
         if (code == clear) {  // clear code
            codesize = lzw_cs + 1;
            codemask = (1 << codesize) - 1;
            avail = clear + 2;
            oldcode = -1;
            first = 0;
         } else if (code == clear + 1) { // end of stream code
            stbi__skip(s, len);
            while ((len = stbi__get8(s)) > 0)
               stbi__skip(s,len);
            return g->out;
         } else if (code <= avail) {
            if (first) return stbi__errpuc("no clear code", "Corrupt GIF");

            if (oldcode >= 0) {
               p = &g->codes[avail++];
               if (avail > 4096)        return stbi__errpuc("too many codes", "Corrupt GIF");
               p->prefix = (stbi__int16) oldcode;
               p->first = g->codes[oldcode].first;
               p->suffix = (code == avail) ? p->first : g->codes[code].first;
            } else if (code == avail)
               return stbi__errpuc("illegal code in raster", "Corrupt GIF");

            stbi__out_gif_code(g, (stbi__uint16) code);

            if ((avail & codemask) == 0 && avail <= 0x0FFF) {
               codesize++;
               codemask = (1 << codesize) - 1;
            }

            oldcode = code;
         } else {
            return stbi__errpuc("illegal code in raster", "Corrupt GIF");
         }
      }
   }
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq 0x48(%rsp), %rdi
callq 0x21530
movb %al, 0x3f(%rsp)
movzbl 0x3f(%rsp), %eax
cmpl $0xc, %eax
jle 0x29584
movq $0x0, 0x50(%rsp)
jmp 0x29918
movzbl 0x3f(%rsp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, 0x14(%rsp)
movl $0x1, 0x30(%rsp)
movzbl 0x3f(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
movl 0x2c(%rsp), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
movl %eax, 0x28(%rsp)
movl $0x0, 0x1c(%rsp)
movl $0x0, 0x18(%rsp)
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x14(%rsp), %eax
jge 0x2962b
movq 0x40(%rsp), %rax
movslq 0x34(%rsp), %rcx
movw $0xffff, 0x824(%rax,%rcx,4) # imm = 0xFFFF
movl 0x34(%rsp), %eax
movb %al, %dl
movq 0x40(%rsp), %rax
movslq 0x34(%rsp), %rcx
movb %dl, 0x826(%rax,%rcx,4)
movl 0x34(%rsp), %eax
movb %al, %dl
movq 0x40(%rsp), %rax
movslq 0x34(%rsp), %rcx
movb %dl, 0x827(%rax,%rcx,4)
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x295d2
movl 0x14(%rsp), %eax
addl $0x2, %eax
movl %eax, 0x24(%rsp)
movl $0xffffffff, 0x20(%rsp) # imm = 0xFFFFFFFF
movl $0x0, 0x38(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x2c(%rsp), %eax
jge 0x296ba
cmpl $0x0, 0x38(%rsp)
jne 0x29684
movq 0x48(%rsp), %rdi
callq 0x21530
movzbl %al, %eax
movl %eax, 0x38(%rsp)
cmpl $0x0, 0x38(%rsp)
jne 0x29682
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x50(%rsp)
jmp 0x29918
jmp 0x29684
movl 0x38(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x38(%rsp)
movq 0x48(%rsp), %rdi
callq 0x21530
movzbl %al, %eax
movl 0x18(%rsp), %ecx
shll %cl, %eax
orl 0x1c(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl 0x18(%rsp), %eax
addl $0x8, %eax
movl %eax, 0x18(%rsp)
jmp 0x29913
movl 0x1c(%rsp), %eax
andl 0x28(%rsp), %eax
movl %eax, 0x4(%rsp)
movl 0x2c(%rsp), %ecx
movl 0x1c(%rsp), %eax
sarl %cl, %eax
movl %eax, 0x1c(%rsp)
movl 0x2c(%rsp), %ecx
movl 0x18(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x18(%rsp)
movl 0x4(%rsp), %eax
cmpl 0x14(%rsp), %eax
jne 0x2972a
movzbl 0x3f(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
movl 0x2c(%rsp), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
movl %eax, 0x28(%rsp)
movl 0x14(%rsp), %eax
addl $0x2, %eax
movl %eax, 0x24(%rsp)
movl $0xffffffff, 0x20(%rsp) # imm = 0xFFFFFFFF
movl $0x0, 0x30(%rsp)
jmp 0x29911
movl 0x4(%rsp), %eax
movl 0x14(%rsp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0x29780
movq 0x48(%rsp), %rdi
movl 0x38(%rsp), %esi
callq 0x21ab0
movq 0x48(%rsp), %rdi
callq 0x21530
movzbl %al, %eax
movl %eax, 0x38(%rsp)
cmpl $0x0, %eax
jle 0x2976d
movq 0x48(%rsp), %rdi
movl 0x38(%rsp), %esi
callq 0x21ab0
jmp 0x29747
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x50(%rsp)
jmp 0x29918
movl 0x4(%rsp), %eax
cmpl 0x24(%rsp), %eax
jg 0x298ef
cmpl $0x0, 0x30(%rsp)
je 0x297b6
leaq 0x4916(%rip), %rdi      # 0x2e0b2
callq 0x1a190
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, 0x50(%rsp)
jmp 0x29918
cmpl $0x0, 0x20(%rsp)
jl 0x29876
movq 0x40(%rsp), %rax
addq $0x824, %rax            # imm = 0x824
movl 0x24(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x24(%rsp)
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
cmpl $0x1000, 0x24(%rsp)     # imm = 0x1000
jle 0x29813
leaq 0x48c7(%rip), %rdi      # 0x2e0c0
callq 0x1a190
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, 0x50(%rsp)
jmp 0x29918
movl 0x20(%rsp), %eax
movw %ax, %cx
movq 0x8(%rsp), %rax
movw %cx, (%rax)
movq 0x40(%rsp), %rax
movslq 0x20(%rsp), %rcx
movb 0x826(%rax,%rcx,4), %cl
movq 0x8(%rsp), %rax
movb %cl, 0x2(%rax)
movl 0x4(%rsp), %eax
cmpl 0x24(%rsp), %eax
jne 0x29853
movq 0x8(%rsp), %rax
movb 0x2(%rax), %al
movb %al, 0x3(%rsp)
jmp 0x29868
movq 0x40(%rsp), %rax
movslq 0x4(%rsp), %rcx
movb 0x826(%rax,%rcx,4), %al
movb %al, 0x3(%rsp)
movb 0x3(%rsp), %cl
movq 0x8(%rsp), %rax
movb %cl, 0x3(%rax)
jmp 0x298a0
movl 0x4(%rsp), %eax
cmpl 0x24(%rsp), %eax
jne 0x2989e
leaq 0x4848(%rip), %rdi      # 0x2e0cf
callq 0x1a190
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, 0x50(%rsp)
jmp 0x29918
jmp 0x298a0
movq 0x40(%rsp), %rdi
movl 0x4(%rsp), %eax
movzwl %ax, %esi
callq 0x29930
movl 0x24(%rsp), %eax
andl 0x28(%rsp), %eax
cmpl $0x0, %eax
jne 0x298e5
cmpl $0xfff, 0x24(%rsp)      # imm = 0xFFF
jg 0x298e5
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
movl 0x2c(%rsp), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
movl %eax, 0x28(%rsp)
movl 0x4(%rsp), %eax
movl %eax, 0x20(%rsp)
jmp 0x2990d
leaq 0x47d9(%rip), %rdi      # 0x2e0cf
callq 0x1a190
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, 0x50(%rsp)
jmp 0x29918
jmp 0x2990f
jmp 0x29911
jmp 0x29913
jmp 0x29646
movq 0x50(%rsp), %rax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)