// File: /workspace/github_c_makefile_star2_O0/zhiyb[P]png2tlg/./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, init_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 (init_code = 0; init_code < clear; init_code++) {
      g->codes[init_code].prefix = -1;
      g->codes[init_code].first = (stbi_uc) init_code;
      g->codes[init_code].suffix = (stbi_uc) init_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 > 8192) {
                  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:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x12e60
movb %al, -0x19(%rbp)
movzbl -0x19(%rbp), %eax
cmpl $0xc, %eax
jle 0x1b922
movq $0x0, -0x8(%rbp)
jmp 0x1bc47
movzbl -0x19(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x44(%rbp)
movl $0x1, -0x28(%rbp)
movzbl -0x19(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
movl %eax, -0x30(%rbp)
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x44(%rbp), %eax
jge 0x1b9b3
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movw $0xffff, 0x834(%rax,%rcx,4) # imm = 0xFFFF
movl -0x24(%rbp), %eax
movb %al, %dl
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb %dl, 0x836(%rax,%rcx,4)
movl -0x24(%rbp), %eax
movb %al, %dl
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb %dl, 0x837(%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1b966
movl -0x44(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x34(%rbp)
movl $0xffffffff, -0x38(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x20(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x1ba2e
cmpl $0x0, -0x20(%rbp)
jne 0x1ba00
movq -0x10(%rbp), %rdi
callq 0x12e60
movzbl %al, %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jne 0x1b9fe
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x1bc47
jmp 0x1ba00
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x12e60
movzbl %al, %eax
movl -0x40(%rbp), %ecx
shll %cl, %eax
orl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x40(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x40(%rbp)
jmp 0x1bc42
movl -0x3c(%rbp), %eax
andl -0x30(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x2c(%rbp), %ecx
movl -0x3c(%rbp), %eax
sarl %cl, %eax
movl %eax, -0x3c(%rbp)
movl -0x2c(%rbp), %ecx
movl -0x40(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x40(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x44(%rbp), %eax
jne 0x1ba8b
movzbl -0x19(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x44(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x34(%rbp)
movl $0xffffffff, -0x38(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x28(%rbp)
jmp 0x1bc40
movl -0x54(%rbp), %eax
movl -0x44(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1bad7
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0x13350
movq -0x10(%rbp), %rdi
callq 0x12e60
movzbl %al, %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, %eax
jle 0x1bac6
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0x13350
jmp 0x1baa4
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x1bc47
movl -0x54(%rbp), %eax
cmpl -0x34(%rbp), %eax
jg 0x1bc1f
cmpl $0x0, -0x28(%rbp)
je 0x1bb09
leaq 0x543e(%rip), %rdi      # 0x20f2e
callq 0x2680
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, -0x8(%rbp)
jmp 0x1bc47
cmpl $0x0, -0x38(%rbp)
jl 0x1bbb4
movq -0x18(%rbp), %rax
addq $0x834, %rax            # imm = 0x834
movl -0x34(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x34(%rbp)
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
cmpl $0x2000, -0x34(%rbp)    # imm = 0x2000
jle 0x1bb5f
leaq 0x53f6(%rip), %rdi      # 0x20f3c
callq 0x2680
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, -0x8(%rbp)
jmp 0x1bc47
movl -0x38(%rbp), %eax
movw %ax, %cx
movq -0x50(%rbp), %rax
movw %cx, (%rax)
movq -0x18(%rbp), %rax
movslq -0x38(%rbp), %rcx
movb 0x836(%rax,%rcx,4), %cl
movq -0x50(%rbp), %rax
movb %cl, 0x2(%rax)
movl -0x54(%rbp), %eax
cmpl -0x34(%rbp), %eax
jne 0x1bb96
movq -0x50(%rbp), %rax
movb 0x2(%rax), %al
movb %al, -0x55(%rbp)
jmp 0x1bba8
movq -0x18(%rbp), %rax
movslq -0x54(%rbp), %rcx
movb 0x836(%rax,%rcx,4), %al
movb %al, -0x55(%rbp)
movb -0x55(%rbp), %cl
movq -0x50(%rbp), %rax
movb %cl, 0x3(%rax)
jmp 0x1bbdb
movl -0x54(%rbp), %eax
cmpl -0x34(%rbp), %eax
jne 0x1bbd9
leaq 0x5388(%rip), %rdi      # 0x20f4b
callq 0x2680
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, -0x8(%rbp)
jmp 0x1bc47
jmp 0x1bbdb
movq -0x18(%rbp), %rdi
movl -0x54(%rbp), %eax
movzwl %ax, %esi
callq 0x1bc60
movl -0x34(%rbp), %eax
andl -0x30(%rbp), %eax
cmpl $0x0, %eax
jne 0x1bc17
cmpl $0xfff, -0x34(%rbp)     # imm = 0xFFF
jg 0x1bc17
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x54(%rbp), %eax
movl %eax, -0x38(%rbp)
jmp 0x1bc3c
leaq 0x5325(%rip), %rdi      # 0x20f4b
callq 0x2680
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, -0x8(%rbp)
jmp 0x1bc47
jmp 0x1bc3e
jmp 0x1bc40
jmp 0x1bc42
jmp 0x1b9ca
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)