LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: lodepng_add_itext_sized
static unsigned lodepng_add_itext_sized(LodePNGInfo* info, const char* key, const char* langtag,
                                        const char* transkey, const char* str, size_t size) {
  char** new_keys = (char**)(lodepng_realloc(info->itext_keys, sizeof(char*) * (info->itext_num + 1)));
  char** new_langtags = (char**)(lodepng_realloc(info->itext_langtags, sizeof(char*) * (info->itext_num + 1)));
  char** new_transkeys = (char**)(lodepng_realloc(info->itext_transkeys, sizeof(char*) * (info->itext_num + 1)));
  char** new_strings = (char**)(lodepng_realloc(info->itext_strings, sizeof(char*) * (info->itext_num + 1)));

  if(new_keys) info->itext_keys = new_keys;
  if(new_langtags) info->itext_langtags = new_langtags;
  if(new_transkeys) info->itext_transkeys = new_transkeys;
  if(new_strings) info->itext_strings = new_strings;

  if(!new_keys || !new_langtags || !new_transkeys || !new_strings) return 83; /*alloc fail*/

  ++info->itext_num;

  info->itext_keys[info->itext_num - 1] = alloc_string(key);
  info->itext_langtags[info->itext_num - 1] = alloc_string(langtag);
  info->itext_transkeys[info->itext_num - 1] = alloc_string(transkey);
  info->itext_strings[info->itext_num - 1] = alloc_string_sized(str, size);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %rbx
movq %r8, (%rsp)
movq %rcx, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq %rsi, %rbp
movq %rdi, %r14
movq 0x60(%rdi), %rax
movq 0x68(%rdi), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x1170
movq %rax, %r15
movq 0x60(%r14), %rax
movq 0x70(%r14), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x1170
movq %rax, %r12
movq 0x60(%r14), %rax
movq 0x78(%r14), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x1170
movq %rax, %r13
movq 0x60(%r14), %rax
movq 0x80(%r14), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x1170
movq %rax, %rcx
testq %r15, %r15
je 0x5f21
movq %r15, 0x68(%r14)
testq %r12, %r12
je 0x5f2a
movq %r12, 0x70(%r14)
testq %r13, %r13
je 0x5f33
movq %r13, 0x78(%r14)
movl $0x53, %eax
testq %rcx, %rcx
je 0x5fde
movq %rcx, 0x80(%r14)
testq %r15, %r15
je 0x5fde
testq %r12, %r12
je 0x5fde
testq %r13, %r13
je 0x5fde
incq 0x60(%r14)
movq %rbp, %rdi
callq 0xd291
movq 0x60(%r14), %rcx
movq 0x68(%r14), %rdx
movq %rax, -0x8(%rdx,%rcx,8)
movq 0x8(%rsp), %rdi
callq 0xd291
movq 0x60(%r14), %rcx
movq 0x70(%r14), %rdx
movq %rax, -0x8(%rdx,%rcx,8)
movq 0x10(%rsp), %rdi
callq 0xd291
movq 0x60(%r14), %r12
movq 0x78(%r14), %rcx
movq %rax, -0x8(%rcx,%r12,8)
leaq 0x1(%rbx), %rdi
callq 0x1140
movq %rax, %r15
testq %rax, %rax
je 0x5fd0
testq %rbx, %rbx
je 0x5fcb
movq %r15, %rdi
movq (%rsp), %rsi
movq %rbx, %rdx
callq 0x1130
movb $0x0, (%r15,%rbx)
movq 0x80(%r14), %rax
movq %r15, -0x8(%rax,%r12,8)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: lodepng_assign_icc
static unsigned lodepng_assign_icc(LodePNGInfo* info, const char* name, const unsigned char* profile, unsigned profile_size) {
  if(profile_size == 0) return 100; /*invalid ICC profile size*/

  info->iccp_name = alloc_string(name);
  info->iccp_profile = (unsigned char*)lodepng_malloc(profile_size);

  if(!info->iccp_name || !info->iccp_profile) return 83; /*alloc fail*/

  lodepng_memcpy(info->iccp_profile, profile, profile_size);
  info->iccp_profile_size = profile_size;

  return 0; /*ok*/
}

// Assembly:
testl %ecx, %ecx
je 0x6116
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %ecx, %ebx
movq %rdx, %r15
movq %rdi, %r14
movq %rsi, %rdi
callq 0xd291
movq %rax, %r13
movq %rax, 0xf0(%r14)
movl %ebx, %r12d
movq %r12, %rdi
callq 0x1140
movq %rax, 0xf8(%r14)
testq %r13, %r13
sete %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
movl $0x53, %ecx
jne 0x610b
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x1130
movl %ebx, 0x100(%r14)
xorl %ecx, %ecx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x611b
movl $0x64, %ecx
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: lodepng_info_copy
unsigned lodepng_info_copy(LodePNGInfo* dest, const LodePNGInfo* source) {
  lodepng_info_cleanup(dest);
  lodepng_memcpy(dest, source, sizeof(LodePNGInfo));
  lodepng_color_mode_init(&dest->color);
  CERROR_TRY_RETURN(lodepng_color_mode_copy(&dest->color, &source->color));

#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
  CERROR_TRY_RETURN(LodePNGText_copy(dest, source));
  CERROR_TRY_RETURN(LodePNGIText_copy(dest, source));
  if(source->iccp_defined) {
    CERROR_TRY_RETURN(lodepng_assign_icc(dest, source->iccp_name, source->iccp_profile, source->iccp_profile_size));
  }

  LodePNGUnknownChunks_init(dest);
  CERROR_TRY_RETURN(LodePNGUnknownChunks_copy(dest, source));
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x6198
movl $0x138, %edx            # imm = 0x138
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1130
leaq 0x10(%r14), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%r14)
movabsq $0x800000006, %rax      # imm = 0x800000006
movq %rax, 0x10(%r14)
movups %xmm0, 0x18(%r14)
leaq 0x10(%rbx), %rsi
callq 0x5a08
testl %eax, %eax
je 0x6277
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%r14)
movq $0x0, 0x58(%r14)
cmpq $0x0, 0x48(%rbx)
je 0x62c8
xorl %r15d, %r15d
movq 0x50(%rbx), %rax
movq 0x58(%rbx), %rcx
movq (%rax,%r15,8), %rsi
movq (%rcx,%r15,8), %rdx
movq $-0x1, %rcx
cmpb $0x0, 0x1(%rdx,%rcx)
leaq 0x1(%rcx), %rcx
jne 0x62a8
movq %r14, %rdi
callq 0x5c96
testl %eax, %eax
jne 0x626d
incq %r15
cmpq 0x48(%rbx), %r15
jne 0x6291
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%r14)
movups %xmm0, 0x60(%r14)
movq $0x0, 0x80(%r14)
cmpq $0x0, 0x60(%rbx)
je 0x6339
xorl %r15d, %r15d
movq 0x68(%rbx), %rax
movq 0x70(%rbx), %rcx
movq (%rax,%r15,8), %rsi
movq (%rcx,%r15,8), %rdx
movq 0x78(%rbx), %rax
movq (%rax,%r15,8), %rcx
movq 0x80(%rbx), %rax
movq (%rax,%r15,8), %r8
movq $-0x1, %r9
cmpb $0x0, 0x1(%r8,%r9)
leaq 0x1(%r9), %r9
jne 0x6314
movq %r14, %rdi
callq 0x5e90
testl %eax, %eax
jne 0x626d
incq %r15
cmpq 0x60(%rbx), %r15
jne 0x62ea
cmpl $0x0, 0xe8(%rbx)
je 0x6366
movq 0xf0(%rbx), %rsi
movq 0xf8(%rbx), %rdx
movl 0x100(%rbx), %ecx
movq %r14, %rdi
callq 0x60a6
testl %eax, %eax
jne 0x626d
leaq 0x108(%r14), %r12
xorps %xmm0, %xmm0
movups %xmm0, 0x128(%r14)
movups %xmm0, 0x118(%r14)
movups %xmm0, 0x108(%r14)
xorl %r15d, %r15d
movq (%r12,%r15,8), %rdi
callq 0x1030
incq %r15
cmpq $0x3, %r15
jne 0x638b
xorl %r13d, %r13d
movq 0x120(%rbx,%r13,8), %r15
movq %r15, 0x120(%r14,%r13,8)
movq %r15, %rdi
callq 0x1140
movq %rax, 0x108(%r14,%r13,8)
testq %rax, %rax
sete %al
testq %r15, %r15
setne %cl
testb %al, %cl
jne 0x6406
testq %r15, %r15
je 0x63f6
xorl %eax, %eax
movq 0x108(%rbx,%r13,8), %rcx
movb (%rcx,%rax), %cl
movq (%r12,%r13,8), %rdx
movb %cl, (%rdx,%rax)
incq %rax
cmpq 0x120(%rbx,%r13,8), %rax
jb 0x63d7
incq %r13
cmpq $0x3, %r13
jne 0x63a0
xorl %eax, %eax
jmp 0x626d
movl $0x53, %eax
jmp 0x626d
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: lodepng_color_mode_equal
static int lodepng_color_mode_equal(const LodePNGColorMode* a, const LodePNGColorMode* b) {
  size_t i;
  if(a->colortype != b->colortype) return 0;
  if(a->bitdepth != b->bitdepth) return 0;
  if(a->key_defined != b->key_defined) return 0;
  if(a->key_defined) {
    if(a->key_r != b->key_r) return 0;
    if(a->key_g != b->key_g) return 0;
    if(a->key_b != b->key_b) return 0;
  }
  if(a->palettesize != b->palettesize) return 0;
  for(i = 0; i != a->palettesize * 4; ++i) {
    if(a->palette[i] != b->palette[i]) return 0;
  }
  return 1;
}

// Assembly:
movl (%rdi), %ecx
xorl %eax, %eax
cmpl (%rsi), %ecx
jne 0x69fa
movl 0x4(%rdi), %ecx
cmpl 0x4(%rsi), %ecx
jne 0x69fa
movl 0x18(%rdi), %ecx
cmpl 0x18(%rsi), %ecx
jne 0x69fa
testl %ecx, %ecx
je 0x69c2
movl 0x1c(%rdi), %ecx
cmpl 0x1c(%rsi), %ecx
jne 0x69fa
movl 0x20(%rdi), %ecx
cmpl 0x20(%rsi), %ecx
jne 0x69fa
movl 0x24(%rdi), %ecx
cmpl 0x24(%rsi), %ecx
jne 0x69fa
movq 0x10(%rdi), %rcx
cmpq 0x10(%rsi), %rcx
jne 0x69fa
shlq $0x2, %rcx
movl $0x1, %eax
testq %rcx, %rcx
je 0x69fa
movq 0x8(%rdi), %rdx
movq 0x8(%rsi), %rsi
xorl %edi, %edi
movb (%rdx,%rdi), %r8b
cmpb (%rsi,%rdi), %r8b
jne 0x69f8
incq %rdi
cmpq %rdi, %rcx
jne 0x69e4
jmp 0x69fa
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: color_tree_add
static unsigned color_tree_add(ColorTree* tree,
                               unsigned char r, unsigned char g, unsigned char b, unsigned char a, unsigned index) {
  int bit;
  for(bit = 0; bit < 8; ++bit) {
    int i = 8 * ((r >> bit) & 1) + 4 * ((g >> bit) & 1) + 2 * ((b >> bit) & 1) + 1 * ((a >> bit) & 1);
    if(!tree->children[i]) {
      tree->children[i] = (ColorTree*)lodepng_malloc(sizeof(ColorTree));
      if(!tree->children[i]) return 83; /*alloc fail*/
      color_tree_init(tree->children[i]);
    }
    tree = tree->children[i];
  }
  tree->index = (int)index;
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, (%rsp)
movl %r8d, %r14d
movl %ecx, %r15d
movl %edx, %r12d
movq %rdi, %rbx
xorl %r13d, %r13d
movl %esi, 0x4(%rsp)
movl %esi, %eax
movl %r13d, %ecx
shrl %cl, %eax
movl %r12d, %edi
shrl %cl, %edi
andl $0x1, %eax
andl $0x1, %edi
movl %r15d, %r10d
shrl %cl, %r10d
andl $0x1, %r10d
xorl %ecx, %ecx
btl %r13d, %r14d
setb %cl
leal (%rcx,%rdi,4), %ecx
leal (%rcx,%rax,8), %eax
leal (%rax,%r10,2), %ebp
movq (%rbx,%rbp,8), %rax
testq %rax, %rax
jne 0x6a9c
movl $0x88, %edi
callq 0x1140
movq %rax, (%rbx,%rbp,8)
testq %rax, %rax
je 0x6ab9
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%rax)
movups %xmm0, 0x60(%rax)
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movl $0xffffffff, 0x80(%rax) # imm = 0xFFFFFFFF
movq (%rbx,%rbp,8), %rax
movl 0x4(%rsp), %esi
incl %r13d
movq %rax, %rbx
cmpl $0x8, %r13d
jne 0x6a1d
movl (%rsp), %ecx
movl %ecx, 0x80(%rax)
xorl %eax, %eax
jmp 0x6abe
movl $0x53, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: checkColorValidity
static unsigned checkColorValidity(LodePNGColorType colortype, unsigned bd) {
  switch(colortype) {
    case LCT_GREY:       if(!(bd == 1 || bd == 2 || bd == 4 || bd == 8 || bd == 16)) return 37; break;
    case LCT_RGB:        if(!(                                 bd == 8 || bd == 16)) return 37; break;
    case LCT_PALETTE:    if(!(bd == 1 || bd == 2 || bd == 4 || bd == 8            )) return 37; break;
    case LCT_GREY_ALPHA: if(!(                                 bd == 8 || bd == 16)) return 37; break;
    case LCT_RGBA:       if(!(                                 bd == 8 || bd == 16)) return 37; break;
    case LCT_MAX_OCTET_VALUE: return 31; /* invalid color type */
    default: return 31; /* invalid color type */
  }
  return 0; /*allowed color type / bits combination*/
}

// Assembly:
movl $0x1f, %eax
cmpl $0x6, %edi
ja 0x8494
movl %edi, %ecx
leaq 0x9eaf(%rip), %rdx      # 0x122fc
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
addl $-0x8, %esi
andl $-0x9, %esi
movl $0x25, %eax
cmovel %esi, %eax
retq
movl $0x25, %eax
cmpl $0x10, %esi
ja 0x8494
movl $0x10116, %ecx          # imm = 0x10116
btl %esi, %ecx
jae 0x8494
xorl %eax, %eax
retq
decl %esi
movl $0x25, %eax
cmpl $0x8, %esi
jae 0x8494
movl %esi, %eax
leaq 0xba1f(%rip), %rcx      # 0x13eb0
movl (%rcx,%rax,4), %eax
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: readChunk_PLTE
static unsigned readChunk_PLTE(LodePNGColorMode* color, const unsigned char* data, size_t chunkLength) {
  unsigned pos = 0, i;
  color->palettesize = chunkLength / 3u;
  if(color->palettesize == 0 || color->palettesize > 256) return 38; /*error: palette too small or big*/
  lodepng_color_mode_alloc_palette(color);
  if(!color->palette && color->palettesize) {
    color->palettesize = 0;
    return 83; /*alloc fail*/
  }

  for(i = 0; i != color->palettesize; ++i) {
    color->palette[4 * i + 0] = data[pos++]; /*R*/
    color->palette[4 * i + 1] = data[pos++]; /*G*/
    color->palette[4 * i + 2] = data[pos++]; /*B*/
    color->palette[4 * i + 3] = 255; /*alpha*/
  }

  return 0; /* OK */
}

// Assembly:
movq %rdx, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
movq %rcx, %rax
mulq %rdx
shrq %rdx
movq %rdx, 0x10(%rdi)
addq $-0x303, %rcx           # imm = 0xFCFD
movl $0x26, %eax
cmpq $-0x300, %rcx           # imm = 0xFD00
jb 0x881e
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x5b2c
cmpq $0x0, 0x8(%rbx)
movq 0x10(%rbx), %rcx
je 0x8801
xorl %eax, %eax
testq %rcx, %rcx
je 0x8817
movl $0x3, %ecx
movl $0x1, %edx
movl $0x1, %esi
leal -0x1(%rdx), %edi
movb (%r14,%rdi), %dil
movq 0x8(%rbx), %r8
leal -0x3(%rcx), %r9d
movb %dil, (%r8,%r9)
leal 0x1(%rdx), %edi
movl %edx, %r8d
movb (%r14,%r8), %r8b
movq 0x8(%rbx), %r9
leal -0x2(%rcx), %r10d
movb %r8b, (%r9,%r10)
movb (%r14,%rdi), %dil
movq 0x8(%rbx), %r8
leal -0x1(%rcx), %r9d
movb %dil, (%r8,%r9)
movq 0x8(%rbx), %rdi
movl %ecx, %r8d
movb $-0x1, (%rdi,%r8)
movl %esi, %edi
incl %esi
addl $0x4, %ecx
addl $0x3, %edx
cmpq %rdi, 0x10(%rbx)
jne 0x87aa
jmp 0x8817
testq %rcx, %rcx
je 0x8815
movq $0x0, 0x10(%rbx)
movl $0x53, %eax
jmp 0x8817
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: readChunk_tRNS
static unsigned readChunk_tRNS(LodePNGColorMode* color, const unsigned char* data, size_t chunkLength) {
  unsigned i;
  if(color->colortype == LCT_PALETTE) {
    /*error: more alpha values given than there are palette entries*/
    if(chunkLength > color->palettesize) return 39;

    for(i = 0; i != chunkLength; ++i) color->palette[4 * i + 3] = data[i];
  } else if(color->colortype == LCT_GREY) {
    /*error: this chunk must be 2 bytes for grayscale image*/
    if(chunkLength != 2) return 30;

    color->key_defined = 1;
    color->key_r = color->key_g = color->key_b = 256u * data[0] + data[1];
  } else if(color->colortype == LCT_RGB) {
    /*error: this chunk must be 6 bytes for RGB image*/
    if(chunkLength != 6) return 41;

    color->key_defined = 1;
    color->key_r = 256u * data[0] + data[1];
    color->key_g = 256u * data[2] + data[3];
    color->key_b = 256u * data[4] + data[5];
  }
  else return 42; /*error: tRNS chunk not allowed for other color models*/

  return 0; /* OK */
}

// Assembly:
movl (%rdi), %ecx
testl %ecx, %ecx
je 0x88b3
cmpl $0x2, %ecx
je 0x8874
movl $0x2a, %eax
cmpl $0x3, %ecx
jne 0x8873
movl $0x27, %eax
cmpq %rdx, 0x10(%rdi)
jb 0x8873
testq %rdx, %rdx
je 0x88dd
movl $0x3, %ecx
xorl %eax, %eax
xorl %r8d, %r8d
movb (%rsi,%r8), %r9b
movq 0x8(%rdi), %r10
movl %ecx, %r11d
movb %r9b, (%r10,%r11)
incq %r8
movl %r8d, %r9d
addl $0x4, %ecx
cmpq %rdx, %r9
jne 0x8856
retq
movl $0x29, %eax
cmpq $0x6, %rdx
jne 0x8873
movl $0x1, 0x18(%rdi)
movzwl (%rsi), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl %eax, 0x1c(%rdi)
movzwl 0x2(%rsi), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl %eax, 0x20(%rdi)
movzwl 0x4(%rsi), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl $0x24, %ecx
jmp 0x88da
movl $0x1e, %eax
cmpq $0x2, %rdx
jne 0x8873
movl $0x1, 0x18(%rdi)
movzwl (%rsi), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl %eax, 0x24(%rdi)
movl %eax, 0x20(%rdi)
movl $0x1c, %ecx
movl %eax, (%rdi,%rcx)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: readChunk_bKGD
static unsigned readChunk_bKGD(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) {
  if(info->color.colortype == LCT_PALETTE) {
    /*error: this chunk must be 1 byte for indexed color image*/
    if(chunkLength != 1) return 43;

    /*error: invalid palette index, or maybe this chunk appeared before PLTE*/
    if(data[0] >= info->color.palettesize) return 103;

    info->background_defined = 1;
    info->background_r = info->background_g = info->background_b = data[0];
  } else if(info->color.colortype == LCT_GREY || info->color.colortype == LCT_GREY_ALPHA) {
    /*error: this chunk must be 2 bytes for grayscale image*/
    if(chunkLength != 2) return 44;

    /*the values are truncated to bitdepth in the PNG file*/
    info->background_defined = 1;
    info->background_r = info->background_g = info->background_b = 256u * data[0] + data[1];
  } else if(info->color.colortype == LCT_RGB || info->color.colortype == LCT_RGBA) {
    /*error: this chunk must be 6 bytes for grayscale image*/
    if(chunkLength != 6) return 45;

    /*the values are truncated to bitdepth in the PNG file*/
    info->background_defined = 1;
    info->background_r = 256u * data[0] + data[1];
    info->background_g = 256u * data[2] + data[3];
    info->background_b = 256u * data[4] + data[5];
  }

  return 0; /* OK */
}

// Assembly:
movl 0x10(%rdi), %ecx
xorl %eax, %eax
cmpq $0x6, %rcx
ja 0x8966
leaq 0x9a26(%rip), %r8       # 0x12318
movslq (%r8,%rcx,4), %rcx
addq %r8, %rcx
jmpq *%rcx
movl $0x2c, %eax
cmpq $0x2, %rdx
jne 0x8966
movl $0x1, 0x38(%rdi)
movzwl (%rsi), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl %eax, 0x44(%rdi)
movl %eax, 0x40(%rdi)
movl $0x3c, %ecx
jmp 0x8961
movl $0x2d, %eax
cmpq $0x6, %rdx
jne 0x8966
movl $0x1, 0x38(%rdi)
movzwl (%rsi), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl %eax, 0x3c(%rdi)
movzwl 0x2(%rsi), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl %eax, 0x40(%rdi)
movzwl 0x4(%rsi), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl $0x44, %ecx
movl %eax, (%rdi,%rcx)
xorl %eax, %eax
retq
movl $0x2b, %eax
cmpq $0x1, %rdx
jne 0x8966
movzbl (%rsi), %ecx
movl $0x67, %eax
cmpq %rcx, 0x20(%rdi)
jbe 0x8966
movl $0x1, 0x38(%rdi)
movzbl (%rsi), %eax
jmp 0x8917
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: readChunk_tEXt
static unsigned readChunk_tEXt(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) {
  unsigned error = 0;
  char *key = 0, *str = 0;

  while(!error) /*not really a while loop, only used to break on error*/ {
    unsigned length, string2_begin;

    length = 0;
    while(length < chunkLength && data[length] != 0) ++length;
    /*even though it's not allowed by the standard, no error is thrown if
    there's no null termination char, if the text is empty*/
    if(length < 1 || length > 79) CERROR_BREAK(error, 89); /*keyword too short or long*/

    key = (char*)lodepng_malloc(length + 1);
    if(!key) CERROR_BREAK(error, 83); /*alloc fail*/

    lodepng_memcpy(key, data, length);
    key[length] = 0;

    string2_begin = length + 1; /*skip keyword null terminator*/

    length = (unsigned)(chunkLength < string2_begin ? 0 : chunkLength - string2_begin);
    str = (char*)lodepng_malloc(length + 1);
    if(!str) CERROR_BREAK(error, 83); /*alloc fail*/

    lodepng_memcpy(str, data + string2_begin, length);
    str[length] = 0;

    error = lodepng_add_text(info, key, str);

    break;
  }

  lodepng_free(key);
  lodepng_free(str);

  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0x59, %ebx
xorl %ebp, %ebp
testq %rdx, %rdx
je 0x8a5d
movq %rdx, %r12
movq %rsi, %r13
xorl %r14d, %r14d
cmpb $0x0, (%r13,%r14)
je 0x89c2
incl %ebp
movq %rbp, %r14
cmpq %r12, %rbp
jb 0x89b0
leal -0x50(%rbp), %eax
cmpl $-0x4f, %eax
jb 0x8a5d
movq %rdi, (%rsp)
incl %ebp
movq %rbp, %rdi
callq 0x1140
movl $0x53, %ebx
testq %rax, %rax
je 0x8a5d
movq %rax, %r15
movq %rax, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x1130
movb $0x0, (%r15,%r14)
xorl %eax, %eax
subq %rbp, %r12
cmovbq %rax, %r12
leal 0x1(%r12), %edi
callq 0x1140
testq %rax, %rax
je 0x8a60
movq %rax, %r14
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
andq %rax, %r12
je 0x8a32
addq %rbp, %r13
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x1130
movb $0x0, (%r14,%r12)
movq $-0x1, %rcx
cmpb $0x0, 0x1(%r14,%rcx)
leaq 0x1(%rcx), %rcx
jne 0x8a3e
movq (%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x5c96
movl %eax, %ebx
jmp 0x8a63
xorl %r15d, %r15d
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: readChunk_zTXt
static unsigned readChunk_zTXt(LodePNGInfo* info, const LodePNGDecompressSettings* zlibsettings,
                               const unsigned char* data, size_t chunkLength) {
  unsigned error = 0;

  unsigned length, string2_begin;
  char *key = 0;
  unsigned char* str = 0;
  size_t size = 0;

  while(!error) /*not really a while loop, only used to break on error*/ {
    for(length = 0; length < chunkLength && data[length] != 0; ++length) ;
    if(length + 2 >= chunkLength) CERROR_BREAK(error, 75); /*no null termination, corrupt?*/
    if(length < 1 || length > 79) CERROR_BREAK(error, 89); /*keyword too short or long*/

    key = (char*)lodepng_malloc(length + 1);
    if(!key) CERROR_BREAK(error, 83); /*alloc fail*/

    lodepng_memcpy(key, data, length);
    key[length] = 0;

    if(data[length + 1] != 0) CERROR_BREAK(error, 72); /*the 0 byte indicating compression must be 0*/

    string2_begin = length + 2;
    if(string2_begin > chunkLength) CERROR_BREAK(error, 75); /*no null termination, corrupt?*/

    length = (unsigned)chunkLength - string2_begin;
    /*will fail if zlib error, e.g. if length is too small*/
    error = zlib_decompress(&str, &size, 0, &data[string2_begin],
                            length, zlibsettings);
    if(error) break;
    error = lodepng_add_text_sized(info, key, (char*)str, size);

    break;
  }

  lodepng_free(key);
  lodepng_free(str);

  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r14
movq %rdx, %r12
xorl %eax, %eax
movq %rax, 0x10(%rsp)
movq %rax, 0x8(%rsp)
movl $0x0, %ebp
testq %rcx, %rcx
je 0x8ac3
xorl %ebp, %ebp
xorl %eax, %eax
cmpb $0x0, (%r12,%rbp)
je 0x8ac3
incl %eax
movq %rax, %rbp
cmpq %r14, %rax
jb 0x8ab2
leal 0x2(%rax), %r15d
cmpq %r14, %r15
jae 0x8adb
leal -0x50(%rax), %ecx
cmpl $-0x4f, %ecx
jae 0x8b07
movl $0x59, %ebp
jmp 0x8ae0
movl $0x4b, %ebp
xorl %r14d, %r14d
xorl %r13d, %r13d
movq %r13, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, 0x20(%rsp)
movq %rdi, 0x18(%rsp)
movl %eax, %ebx
incq %rbx
movq %rbx, %rdi
callq 0x1140
testq %rax, %rax
je 0x8b4b
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x1130
movb $0x0, (%r13,%rbp)
cmpb $0x0, (%r12,%rbx)
je 0x8b52
movl $0x48, %ebp
xorl %r14d, %r14d
jmp 0x8ae6
movl $0x53, %ebp
jmp 0x8ae0
subl %r15d, %r14d
addq %r15, %r12
leaq 0x10(%rsp), %rbx
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
movq %r12, %rcx
movq %r14, %r8
movq 0x20(%rsp), %r9
callq 0xd38d
movq (%rbx), %r14
testl %eax, %eax
je 0x8b85
movl %eax, %ebp
jmp 0x8ae6
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x5c96
movl %eax, %ebp
movq 0x10(%rsp), %r14
jmp 0x8ae6
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: readChunk_cHRM
static unsigned readChunk_cHRM(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) {
  if(chunkLength != 32) return 97; /*invalid cHRM chunk size*/

  info->chrm_defined = 1;
  info->chrm_white_x = 16777216u * data[ 0] + 65536u * data[ 1] + 256u * data[ 2] + data[ 3];
  info->chrm_white_y = 16777216u * data[ 4] + 65536u * data[ 5] + 256u * data[ 6] + data[ 7];
  info->chrm_red_x   = 16777216u * data[ 8] + 65536u * data[ 9] + 256u * data[10] + data[11];
  info->chrm_red_y   = 16777216u * data[12] + 65536u * data[13] + 256u * data[14] + data[15];
  info->chrm_green_x = 16777216u * data[16] + 65536u * data[17] + 256u * data[18] + data[19];
  info->chrm_green_y = 16777216u * data[20] + 65536u * data[21] + 256u * data[22] + data[23];
  info->chrm_blue_x  = 16777216u * data[24] + 65536u * data[25] + 256u * data[26] + data[27];
  info->chrm_blue_y  = 16777216u * data[28] + 65536u * data[29] + 256u * data[30] + data[31];

  return 0; /* OK */
}

// Assembly:
movl $0x61, %eax
cmpq $0x20, %rdx
jne 0x8f1c
movl $0x1, 0xbc(%rdi)
movl (%rsi), %eax
bswapl %eax
movl %eax, 0xc0(%rdi)
movl 0x4(%rsi), %eax
bswapl %eax
movl %eax, 0xc4(%rdi)
movl 0x8(%rsi), %eax
bswapl %eax
movl %eax, 0xc8(%rdi)
movl 0xc(%rsi), %eax
bswapl %eax
movl %eax, 0xcc(%rdi)
movl 0x10(%rsi), %eax
bswapl %eax
movl %eax, 0xd0(%rdi)
movl 0x14(%rsi), %eax
bswapl %eax
movl %eax, 0xd4(%rdi)
movl 0x18(%rsi), %eax
bswapl %eax
movl %eax, 0xd8(%rdi)
movl 0x1c(%rsi), %eax
bswapl %eax
movl %eax, 0xdc(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: readChunk_iCCP
static unsigned readChunk_iCCP(LodePNGInfo* info, const LodePNGDecompressSettings* zlibsettings,
                               const unsigned char* data, size_t chunkLength) {
  unsigned error = 0;
  unsigned i;
  size_t size = 0;

  unsigned length, string2_begin;

  info->iccp_defined = 1;
  if(info->iccp_name) lodepng_clear_icc(info);

  for(length = 0; length < chunkLength && data[length] != 0; ++length) ;
  if(length + 2 >= chunkLength) return 75; /*no null termination, corrupt?*/
  if(length < 1 || length > 79) return 89; /*keyword too short or long*/

  info->iccp_name = (char*)lodepng_malloc(length + 1);
  if(!info->iccp_name) return 83; /*alloc fail*/

  info->iccp_name[length] = 0;
  for(i = 0; i != length; ++i) info->iccp_name[i] = (char)data[i];

  if(data[length + 1] != 0) return 72; /*the 0 byte indicating compression must be 0*/

  string2_begin = length + 2;
  if(string2_begin > chunkLength) return 75; /*no null termination, corrupt?*/

  length = (unsigned)chunkLength - string2_begin;
  error = zlib_decompress(&info->iccp_profile, &size, 0,
                          &data[string2_begin],
                          length, zlibsettings);
  info->iccp_profile_size = size;
  if(!error && !info->iccp_profile_size) error = 100; /*invalid ICC profile size*/
  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
movq $0x0, 0x10(%rsp)
movl $0x1, 0xe8(%rdi)
movq 0xf0(%rdi), %rdi
testq %rdi, %rdi
je 0x8f86
callq 0x1030
xorl %r15d, %r15d
movq %r15, 0xf0(%rbx)
movq 0xf8(%rbx), %rdi
callq 0x1030
movq %r15, 0xf8(%rbx)
movl %r15d, 0x100(%rbx)
movl %r15d, 0xe8(%rbx)
testq %r14, %r14
je 0x8fa3
xorl %r15d, %r15d
xorl %ecx, %ecx
cmpb $0x0, (%r12,%r15)
je 0x8fa8
incl %ecx
movq %rcx, %r15
cmpq %r14, %rcx
jb 0x8f90
jmp 0x8fa8
xorl %ecx, %ecx
xorl %r15d, %r15d
leal 0x2(%rcx), %ebp
movl $0x4b, %eax
cmpq %r14, %rbp
jae 0x9065
leal -0x50(%rcx), %edx
movl $0x59, %eax
cmpl $-0x4f, %edx
jb 0x9065
movq %r13, 0x8(%rsp)
movl %ecx, %r13d
leaq 0x1(%r13), %rdi
movq %rdi, (%rsp)
callq 0x1140
movq %rax, 0xf0(%rbx)
testq %rax, %rax
je 0x9060
movb $0x0, (%rax,%r15)
xorl %eax, %eax
movb (%r12,%rax), %cl
movq 0xf0(%rbx), %rdx
movb %cl, (%rdx,%rax)
incq %rax
cmpq %rax, %r13
jne 0x8ff2
movl $0x48, %eax
movq (%rsp), %rcx
cmpb $0x0, (%r12,%rcx)
movq 0x8(%rsp), %r9
jne 0x9065
subl %ebp, %r14d
leaq 0xf8(%rbx), %rdi
addq %rbp, %r12
xorl %r15d, %r15d
leaq 0x10(%rsp), %r13
movq %r13, %rsi
xorl %edx, %edx
movq %r12, %rcx
movq %r14, %r8
callq 0xd38d
movl (%r13), %ecx
movl %ecx, 0x100(%rbx)
testl %eax, %eax
jne 0x9065
testl %ecx, %ecx
movl $0x64, %eax
cmovel %eax, %r15d
movl %r15d, %eax
jmp 0x9065
movl $0x53, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: lodepng_decode_file
unsigned lodepng_decode_file(unsigned char** out, unsigned* w, unsigned* h, const char* filename,
                             LodePNGColorType colortype, unsigned bitdepth) {
  unsigned char* buffer = 0;
  size_t buffersize;
  unsigned error;
  /* safe output values in case error happens */
  *out = 0;
  *w = *h = 0;
  error = lodepng_load_file(&buffer, &buffersize, filename);
  if(!error) error = lodepng_decode_memory(out, w, h, buffer, buffersize, colortype, bitdepth);
  lodepng_free(buffer);
  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, %ebp
movl %r8d, 0x14(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %eax, %eax
leaq 0x20(%rsp), %r13
movq %rax, (%r13)
movq %rax, (%rdi)
movl %eax, (%rdx)
movl %eax, (%rsi)
leaq 0x18(%rsp), %rsi
movq %r13, %rdi
movq %rcx, %rdx
callq 0x27f8
movl %eax, %ebx
movq (%r13), %r13
testl %eax, %eax
jne 0xa1b2
movq 0x18(%rsp), %r8
movl %ebp, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r13, %rcx
movl 0x14(%rsp), %r9d
callq 0x9e92
movl %eax, %ebx
movq %r13, %rdi
callq 0x1030
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: lodepng_color_stats_add
static unsigned lodepng_color_stats_add(LodePNGColorStats* stats,
                                        unsigned r, unsigned g, unsigned b, unsigned a) {
  unsigned error = 0;
  unsigned char image[8];
  LodePNGColorMode mode;
  lodepng_color_mode_init(&mode);
  image[0] = r >> 8; image[1] = r; image[2] = g >> 8; image[3] = g;
  image[4] = b >> 8; image[5] = b; image[6] = a >> 8; image[7] = a;
  mode.bitdepth = 16;
  mode.colortype = LCT_RGBA;
  error = lodepng_compute_color_stats(stats, image, 1, 1, &mode);
  lodepng_color_mode_cleanup(&mode);
  return error;
}

// Assembly:
subq $0x38, %rsp
movl %esi, %eax
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r8
movups %xmm0, 0x18(%r8)
movups %xmm0, 0x8(%r8)
movb %ah, 0x8(%rsp)
leaq 0x8(%rsp), %rsi
movb %al, 0x1(%rsi)
movb %dh, 0xa(%rsp)
movb %dl, 0x3(%rsi)
movb %ch, 0xc(%rsp)
movb %cl, 0x5(%rsi)
movw $0xffff, 0x6(%rsi)      # imm = 0xFFFF
movabsq $0x1000000006, %rax     # imm = 0x1000000006
movq %rax, (%r8)
movl $0x1, %edx
movl $0x1, %ecx
callq 0x77de
addq $0x38, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: addChunk_IHDR
static unsigned addChunk_IHDR(ucvector* out, unsigned w, unsigned h,
                              LodePNGColorType colortype, unsigned bitdepth, unsigned interlace_method) {
  unsigned char *chunk, *data;
  CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 13, "IHDR"));
  data = chunk + 8;

  lodepng_set32bitInt(data + 0, w); /*width*/
  lodepng_set32bitInt(data + 4, h); /*height*/
  data[8] = (unsigned char)bitdepth; /*bit depth*/
  data[9] = (unsigned char)colortype; /*color type*/
  data[10] = 0; /*compression method*/
  data[11] = 0; /*filter method*/
  data[12] = interlace_method; /*interlace method*/

  lodepng_chunk_generate_crc(chunk);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %r12d
movl %r8d, %r14d
movl %ecx, %ebp
movl %edx, %r13d
movl %esi, %ebx
movq %rdi, %rsi
leaq 0x7659(%rip), %rcx      # 0x12c88
movq %rsp, %rdi
movl $0xd, %edx
callq 0xd210
movl %eax, %r15d
testl %eax, %eax
jne 0xb68f
movq (%rsp), %rdi
movl %ebx, %eax
shrl $0x18, %eax
movb %al, 0x8(%rdi)
movl %ebx, %eax
shrl $0x10, %eax
movb %al, 0x9(%rdi)
movb %bh, 0xa(%rdi)
movb %bl, 0xb(%rdi)
movl %r13d, %ecx
movl %r13d, %eax
shrl $0x18, %eax
movb %al, 0xc(%rdi)
movl %r13d, %eax
shrl $0x10, %eax
movb %al, 0xd(%rdi)
movb %ch, 0xe(%rdi)
movb %cl, 0xf(%rdi)
movb %r14b, 0x10(%rdi)
movb %bpl, 0x11(%rdi)
movw $0x0, 0x12(%rdi)
movb %r12b, 0x14(%rdi)
callq 0x568d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: addUnknownChunks
static unsigned addUnknownChunks(ucvector* out, unsigned char* data, size_t datasize) {
  unsigned char* inchunk = data;
  while((size_t)(inchunk - data) < datasize) {
    CERROR_TRY_RETURN(lodepng_chunk_append(&out->data, &out->size, inchunk));
    out->allocsize = out->size; /*fix the allocsize again*/
    inchunk = lodepng_chunk_next(inchunk, data + datasize);
  }
  return 0;
}

// Assembly:
xorl %eax, %eax
testq %rdx, %rdx
je 0xb709
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r12
leaq 0x8(%rdi), %r13
leaq (%rsi,%rdx), %rbp
movq %rsi, %r15
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x58a4
testl %eax, %eax
jne 0xb6fb
movq 0x8(%r12), %rax
movq %rax, 0x10(%r12)
movq %r15, %rdi
movq %rbp, %rsi
callq 0x56ce
movq %rax, %r15
subq %rbx, %rax
cmpq %r14, %rax
jb 0xb6c7
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: addChunk_iCCP
static unsigned addChunk_iCCP(ucvector* out, const LodePNGInfo* info, LodePNGCompressSettings* zlibsettings) {
  unsigned error = 0;
  unsigned char* chunk = 0;
  unsigned char* compressed = 0;
  size_t compressedsize = 0;
  size_t keysize = lodepng_strlen(info->iccp_name);

  if(keysize < 1 || keysize > 79) return 89; /*error: invalid keyword size*/
  error = zlib_compress(&compressed, &compressedsize,
                        info->iccp_profile, info->iccp_profile_size, zlibsettings);
  if(!error) {
    size_t size = keysize + 2 + compressedsize;
    error = lodepng_chunk_init(&chunk, out, size, "iCCP");
  }
  if(!error) {
    lodepng_memcpy(chunk + 8, info->iccp_name, keysize);
    chunk[8 + keysize] = 0; /*null termination char*/
    chunk[9 + keysize] = 0; /*compression method: 0*/
    lodepng_memcpy(chunk + 10 + keysize, compressed, compressedsize);
    lodepng_chunk_generate_crc(chunk);
  }

  lodepng_free(compressed);
  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r8
movq %rsi, %r14
movq %rdi, %r15
xorl %eax, %eax
movq %rax, 0x10(%rsp)
movq %rax, 0x8(%rsp)
movq %rax, (%rsp)
movq 0xf0(%rsi), %rax
movq $-0x1, %rbx
cmpb $0x0, 0x1(%rax,%rbx)
leaq 0x1(%rbx), %rbx
jne 0xb73b
leaq -0x50(%rbx), %rax
movl $0x59, %ebp
cmpq $-0x4f, %rax
jb 0xb7f9
movq 0xf8(%r14), %rdx
movl 0x100(%r14), %ecx
movq 0x18(%r8), %rax
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
testq %rax, %rax
je 0xb77c
callq *%rax
jmp 0xb781
callq 0x53d7
movl %eax, %ebp
testl %eax, %eax
jne 0xb7ef
movl (%rsp), %eax
leal (%rax,%rbx), %edx
addl $0x2, %edx
leaq 0x752d(%rip), %rcx      # 0x12cc4
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0xd210
movl %eax, %ebp
testl %eax, %eax
jne 0xb7ef
movq 0x10(%rsp), %r15
leaq 0x8(%r15), %rdi
movq 0xf0(%r14), %rsi
movq %rbx, %rdx
callq 0x1130
movw $0x0, 0x8(%r15,%rbx)
movq (%rsp), %rdx
testq %rdx, %rdx
je 0xb7e5
movq 0x8(%rsp), %rsi
leaq (%r15,%rbx), %rdi
addq $0xa, %rdi
callq 0x1130
movq %r15, %rdi
callq 0x568d
xorl %ebp, %ebp
movq 0x8(%rsp), %rdi
callq 0x1030
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: addChunk_gAMA
static unsigned addChunk_gAMA(ucvector* out, const LodePNGInfo* info) {
  unsigned char* chunk;
  CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 4, "gAMA"));
  lodepng_set32bitInt(chunk + 8, info->gama_gamma);
  lodepng_chunk_generate_crc(chunk);
  return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %rsi
leaq 0x749f(%rip), %rcx      # 0x12cb5
movq %rsp, %rdi
movl $0x4, %edx
callq 0xd210
movl %eax, %ebp
testl %eax, %eax
jne 0xb83d
movq (%rsp), %rdi
movl 0xb8(%rbx), %eax
bswapl %eax
movl %eax, 0x8(%rdi)
callq 0x568d
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: addChunk_cHRM
static unsigned addChunk_cHRM(ucvector* out, const LodePNGInfo* info) {
  unsigned char* chunk;
  CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 32, "cHRM"));
  lodepng_set32bitInt(chunk + 8, info->chrm_white_x);
  lodepng_set32bitInt(chunk + 12, info->chrm_white_y);
  lodepng_set32bitInt(chunk + 16, info->chrm_red_x);
  lodepng_set32bitInt(chunk + 20, info->chrm_red_y);
  lodepng_set32bitInt(chunk + 24, info->chrm_green_x);
  lodepng_set32bitInt(chunk + 28, info->chrm_green_y);
  lodepng_set32bitInt(chunk + 32, info->chrm_blue_x);
  lodepng_set32bitInt(chunk + 36, info->chrm_blue_y);
  lodepng_chunk_generate_crc(chunk);
  return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %rsi
leaq 0x7464(%rip), %rcx      # 0x12cba
movq %rsp, %rdi
movl $0x20, %edx
callq 0xd210
movl %eax, %ebp
testl %eax, %eax
jne 0xb8ca
movq (%rsp), %rdi
movl 0xc0(%rbx), %eax
bswapl %eax
movl %eax, 0x8(%rdi)
movl 0xc4(%rbx), %eax
bswapl %eax
movl %eax, 0xc(%rdi)
movl 0xc8(%rbx), %eax
bswapl %eax
movl %eax, 0x10(%rdi)
movl 0xcc(%rbx), %eax
bswapl %eax
movl %eax, 0x14(%rdi)
movl 0xd0(%rbx), %eax
bswapl %eax
movl %eax, 0x18(%rdi)
movl 0xd4(%rbx), %eax
bswapl %eax
movl %eax, 0x1c(%rdi)
movl 0xd8(%rbx), %eax
bswapl %eax
movl %eax, 0x20(%rdi)
movl 0xdc(%rbx), %eax
bswapl %eax
movl %eax, 0x24(%rdi)
callq 0x568d
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: addChunk_PLTE
static unsigned addChunk_PLTE(ucvector* out, const LodePNGColorMode* info) {
  unsigned char* chunk;
  size_t i, j = 8;

  CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, info->palettesize * 3, "PLTE"));

  for(i = 0; i != info->palettesize; ++i) {
    /*add all channels except alpha channel*/
    chunk[j++] = info->palette[i * 4 + 0];
    chunk[j++] = info->palette[i * 4 + 1];
    chunk[j++] = info->palette[i * 4 + 2];
  }

  lodepng_chunk_generate_crc(chunk);
  return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %rsi
movl 0x10(%rbx), %eax
leal (%rax,%rax,2), %edx
leaq 0x73a2(%rip), %rcx      # 0x12c8d
leaq 0x8(%rsp), %rdi
callq 0xd210
testl %eax, %eax
jne 0xb93e
cmpq $0x0, 0x10(%rbx)
movq 0x8(%rsp), %rdi
je 0xb937
leaq 0xa(%rdi), %rax
xorl %ecx, %ecx
movq 0x8(%rbx), %rdx
movb (%rdx,%rcx,4), %dl
movb %dl, -0x2(%rax)
movq 0x8(%rbx), %rdx
movb 0x1(%rdx,%rcx,4), %dl
movb %dl, -0x1(%rax)
movq 0x8(%rbx), %rdx
movb 0x2(%rdx,%rcx,4), %dl
movb %dl, (%rax)
incq %rcx
addq $0x3, %rax
cmpq 0x10(%rbx), %rcx
jne 0xb90b
callq 0x568d
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: addChunk_tRNS
static unsigned addChunk_tRNS(ucvector* out, const LodePNGColorMode* info) {
  unsigned char* chunk = 0;

  if(info->colortype == LCT_PALETTE) {
    size_t i, amount = info->palettesize;
    /*the tail of palette values that all have 255 as alpha, does not have to be encoded*/
    for(i = info->palettesize; i != 0; --i) {
      if(info->palette[4 * (i - 1) + 3] != 255) break;
      --amount;
    }
    if(amount) {
      CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, amount, "tRNS"));
      /*add the alpha channel values from the palette*/
      for(i = 0; i != amount; ++i) chunk[8 + i] = info->palette[4 * i + 3];
    }
  } else if(info->colortype == LCT_GREY) {
    if(info->key_defined) {
      CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 2, "tRNS"));
      chunk[8] = (unsigned char)(info->key_r >> 8);
      chunk[9] = (unsigned char)(info->key_r & 255);
    }
  } else if(info->colortype == LCT_RGB) {
    if(info->key_defined) {
      CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 6, "tRNS"));
      chunk[8] = (unsigned char)(info->key_r >> 8);
      chunk[9] = (unsigned char)(info->key_r & 255);
      chunk[10] = (unsigned char)(info->key_g >> 8);
      chunk[11] = (unsigned char)(info->key_g & 255);
      chunk[12] = (unsigned char)(info->key_b >> 8);
      chunk[13] = (unsigned char)(info->key_b & 255);
    }
  }

  if(chunk) lodepng_chunk_generate_crc(chunk);
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rsi
movq $0x0, 0x8(%rsp)
movl (%r14), %eax
xorl %ebx, %ebx
testl %eax, %eax
je 0xb9f4
cmpl $0x2, %eax
je 0xb99e
cmpl $0x3, %eax
jne 0xba66
movq 0x10(%r14), %r15
testq %r15, %r15
je 0xba66
movq 0x8(%r14), %rax
cmpb $-0x1, -0x1(%rax,%r15,4)
jne 0xba2a
decq %r15
jne 0xb988
jmp 0xba66
cmpl $0x0, 0x18(%r14)
je 0xba66
leaq 0x72e2(%rip), %rcx      # 0x12c92
leaq 0x8(%rsp), %rdi
movl $0x6, %edx
callq 0xd210
testl %eax, %eax
jne 0xba42
movb 0x1d(%r14), %al
movq 0x8(%rsp), %rdi
movb %al, 0x8(%rdi)
movb 0x1c(%r14), %al
movb %al, 0x9(%rdi)
movb 0x21(%r14), %al
movb %al, 0xa(%rdi)
movb 0x20(%r14), %al
movb %al, 0xb(%rdi)
movb 0x25(%r14), %al
movb %al, 0xc(%rdi)
movb 0x24(%r14), %al
movb %al, 0xd(%rdi)
jmp 0xba61
cmpl $0x0, 0x18(%r14)
je 0xba66
leaq 0x7290(%rip), %rcx      # 0x12c92
leaq 0x8(%rsp), %rdi
movl $0x2, %edx
callq 0xd210
testl %eax, %eax
jne 0xba42
movb 0x1d(%r14), %al
movq 0x8(%rsp), %rdi
movb %al, 0x8(%rdi)
movb 0x1c(%r14), %al
movb %al, 0x9(%rdi)
jmp 0xba61
leaq 0x7261(%rip), %rcx      # 0x12c92
leaq 0x8(%rsp), %rdi
movl %r15d, %edx
callq 0xd210
testl %eax, %eax
je 0xba46
movl %eax, %ebx
jmp 0xba66
movq 0x8(%rsp), %rdi
xorl %eax, %eax
movq 0x8(%r14), %rcx
movb 0x3(%rcx,%rax,4), %cl
movb %cl, 0x8(%rdi,%rax)
incq %rax
cmpq %rax, %r15
jne 0xba4d
callq 0x568d
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: addChunk_bKGD
static unsigned addChunk_bKGD(ucvector* out, const LodePNGInfo* info) {
  unsigned char* chunk = 0;
  if(info->color.colortype == LCT_GREY || info->color.colortype == LCT_GREY_ALPHA) {
    CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 2, "bKGD"));
    chunk[8] = (unsigned char)(info->background_r >> 8);
    chunk[9] = (unsigned char)(info->background_r & 255);
  } else if(info->color.colortype == LCT_RGB || info->color.colortype == LCT_RGBA) {
    CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 6, "bKGD"));
    chunk[8] = (unsigned char)(info->background_r >> 8);
    chunk[9] = (unsigned char)(info->background_r & 255);
    chunk[10] = (unsigned char)(info->background_g >> 8);
    chunk[11] = (unsigned char)(info->background_g & 255);
    chunk[12] = (unsigned char)(info->background_b >> 8);
    chunk[13] = (unsigned char)(info->background_b & 255);
  } else if(info->color.colortype == LCT_PALETTE) {
    CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 1, "bKGD"));
    chunk[8] = (unsigned char)(info->background_r & 255); /*palette index*/
  }
  if(chunk) lodepng_chunk_generate_crc(chunk);
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq $0x0, (%rsp)
movl 0x10(%rsi), %eax
xorl %ebx, %ebx
cmpq $0x6, %rax
ja 0xbb43
movq %rdi, %rsi
leaq 0x689a(%rip), %rcx      # 0x12334
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x71ed(%rip), %rcx      # 0x12c97
movq %rsp, %rdi
movl $0x2, %edx
callq 0xd210
testl %eax, %eax
jne 0xbb2f
movb 0x3d(%r14), %al
movq (%rsp), %rdi
movb %al, 0x8(%rdi)
movb 0x3c(%r14), %al
movb %al, 0x9(%rdi)
jmp 0xbb3e
leaq 0x71c1(%rip), %rcx      # 0x12c97
movq %rsp, %rdi
movl $0x6, %edx
callq 0xd210
testl %eax, %eax
jne 0xbb2f
movb 0x3d(%r14), %al
movq (%rsp), %rdi
movb %al, 0x8(%rdi)
movb 0x3c(%r14), %al
movb %al, 0x9(%rdi)
movb 0x41(%r14), %al
movb %al, 0xa(%rdi)
movb 0x40(%r14), %al
movb %al, 0xb(%rdi)
movb 0x45(%r14), %al
movb %al, 0xc(%rdi)
movb 0x44(%r14), %al
movb %al, 0xd(%rdi)
jmp 0xbb3e
leaq 0x7179(%rip), %rcx      # 0x12c97
movq %rsp, %rdi
movl $0x1, %edx
callq 0xd210
testl %eax, %eax
je 0xbb33
movl %eax, %ebx
jmp 0xbb43
movb 0x3c(%r14), %al
movq (%rsp), %rdi
movb %al, 0x8(%rdi)
callq 0x568d
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: addChunk_pHYs
static unsigned addChunk_pHYs(ucvector* out, const LodePNGInfo* info) {
  unsigned char* chunk;
  CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 9, "pHYs"));
  lodepng_set32bitInt(chunk + 8, info->phys_x);
  lodepng_set32bitInt(chunk + 12, info->phys_y);
  chunk[16] = info->phys_unit;
  lodepng_chunk_generate_crc(chunk);
  return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %rsi
leaq 0x7153(%rip), %rcx      # 0x12cb0
movq %rsp, %rdi
movl $0x9, %edx
callq 0xd210
movl %eax, %ebp
testl %eax, %eax
jne 0xbb98
movq (%rsp), %rdi
movl 0xa8(%rbx), %eax
bswapl %eax
movl %eax, 0x8(%rdi)
movl 0xac(%rbx), %eax
bswapl %eax
movl %eax, 0xc(%rdi)
movb 0xb0(%rbx), %al
movb %al, 0x10(%rdi)
callq 0x568d
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: addChunk_IDAT
static unsigned addChunk_IDAT(ucvector* out, const unsigned char* data, size_t datasize,
                              LodePNGCompressSettings* zlibsettings) {
  unsigned error = 0;
  unsigned char* zlib = 0;
  size_t zlibsize = 0;

  error = zlib_compress(&zlib, &zlibsize, data, datasize, zlibsettings);
  if(!error) {
    error = lodepng_chunk_createv(out, zlibsize, "IDAT", zlib);
  }
  lodepng_free(zlib);
  return error;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r8
movq %rdx, %rcx
movq %rsi, %rdx
movq %rdi, %rbx
xorl %eax, %eax
movq %rax, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movq 0x18(%r8), %rax
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
testq %rax, %rax
je 0xbbd6
callq *%rax
jmp 0xbbdb
callq 0x53d7
movl %eax, %ebp
testl %eax, %eax
jne 0xbbfb
movl 0x10(%rsp), %esi
movq 0x8(%rsp), %rcx
leaq 0x82b3(%rip), %rdx      # 0x13ea4
movq %rbx, %rdi
callq 0x5962
movl %eax, %ebp
movq 0x8(%rsp), %rdi
callq 0x1030
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: addChunk_tIME
static unsigned addChunk_tIME(ucvector* out, const LodePNGTime* time) {
  unsigned char* chunk;
  CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 7, "tIME"));
  chunk[8] = (unsigned char)(time->year >> 8);
  chunk[9] = (unsigned char)(time->year & 255);
  chunk[10] = (unsigned char)time->month;
  chunk[11] = (unsigned char)time->day;
  chunk[12] = (unsigned char)time->hour;
  chunk[13] = (unsigned char)time->minute;
  chunk[14] = (unsigned char)time->second;
  lodepng_chunk_generate_crc(chunk);
  return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %rsi
leaq 0x708d(%rip), %rcx      # 0x12cab
movq %rsp, %rdi
movl $0x7, %edx
callq 0xd210
movl %eax, %ebp
testl %eax, %eax
jne 0xbc63
movb 0x1(%rbx), %al
movq (%rsp), %rdi
movb %al, 0x8(%rdi)
movb (%rbx), %al
movb %al, 0x9(%rdi)
movb 0x4(%rbx), %al
movb %al, 0xa(%rdi)
movb 0x8(%rbx), %al
movb %al, 0xb(%rdi)
movb 0xc(%rbx), %al
movb %al, 0xc(%rdi)
movb 0x10(%rbx), %al
movb %al, 0xd(%rdi)
movb 0x14(%rbx), %al
movb %al, 0xe(%rdi)
callq 0x568d
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq