LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: lodepng_chunk_createv
static unsigned lodepng_chunk_createv(ucvector* out,
                                      unsigned length, const char* type, const unsigned char* data) {
  unsigned char* chunk;
  CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, length, type));

  /*3: the data*/
  lodepng_memcpy(chunk + 8, data, length);

  /*4: CRC (of the chunkname characters and the data)*/
  lodepng_chunk_generate_crc(chunk);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %rcx
movl %esi, %r14d
movq %rdi, %rsi
movq %rsp, %rdi
movl %r14d, %edx
callq 0xb5d9
movl %eax, %ebp
testl %eax, %eax
jne 0x498e
movq (%rsp), %r15
leaq 0x8(%r15), %rdi
movl %r14d, %edx
movq %rbx, %rsi
callq 0x4a33
movq %r15, %rdi
callq 0x46f3
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: lodepng_color_mode_copy
unsigned lodepng_color_mode_copy(LodePNGColorMode* dest, const LodePNGColorMode* source) {
  lodepng_color_mode_cleanup(dest);
  lodepng_memcpy(dest, source, sizeof(LodePNGColorMode));
  if(source->palette) {
    dest->palette = (unsigned char*)lodepng_malloc(1024);
    if(!dest->palette && source->palettesize) return 83; /*alloc fail*/
    lodepng_memcpy(dest->palette, source->palette, source->palettesize * 4);
  }
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0x49b9
pushq $0x28
popq %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x4a33
xorl %ebx, %ebx
cmpq $0x0, 0x8(%r14)
je 0x4a27
movl $0x400, %edi            # imm = 0x400
callq 0x1130
movq %rax, 0x8(%r15)
movq 0x10(%r14), %rdx
testq %rax, %rax
je 0x4a1f
shlq $0x2, %rdx
movq 0x8(%r14), %rsi
movq %rax, %rdi
callq 0x4a33
jmp 0x4a27
testq %rdx, %rdx
je 0x4a2f
pushq $0x53
popq %rbx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
xorl %edx, %edx
jmp 0x4a11
// File: /workspace/github_c_makefile_star2_O2/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: lodepng_palette_add
unsigned lodepng_palette_add(LodePNGColorMode* info,
                             unsigned char r, unsigned char g, unsigned char b, unsigned char a) {
  if(!info->palette) /*allocate palette if empty*/ {
    lodepng_color_mode_alloc_palette(info);
    if(!info->palette) return 83; /*alloc fail*/
  }
  if(info->palettesize >= 256) {
    return 108; /*too many palette values*/
  }
  info->palette[4 * info->palettesize + 0] = r;
  info->palette[4 * info->palettesize + 1] = g;
  info->palette[4 * info->palettesize + 2] = b;
  info->palette[4 * info->palettesize + 3] = a;
  ++info->palettesize;
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %ebx
movl %ecx, %ebp
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %r14
movq 0x8(%rdi), %rax
testq %rax, %rax
jne 0x4a8a
movq %r14, %rdi
callq 0x4ad9
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x4acd
movq 0x10(%r14), %rcx
cmpq $0xff, %rcx
jbe 0x4a9b
pushq $0x6c
jmp 0x4acf
movb %r12b, (%rax,%rcx,4)
movq 0x8(%r14), %rax
movq 0x10(%r14), %rcx
movb %r15b, 0x1(%rax,%rcx,4)
movq 0x8(%r14), %rax
movq 0x10(%r14), %rcx
movb %bpl, 0x2(%rax,%rcx,4)
movq 0x8(%r14), %rax
movq 0x10(%r14), %rcx
movb %bl, 0x3(%rax,%rcx,4)
incq 0x10(%r14)
xorl %eax, %eax
jmp 0x4ad0
pushq $0x53
popq %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: lodepng_color_mode_alloc_palette
static void lodepng_color_mode_alloc_palette(LodePNGColorMode* info) {
  size_t i;
  /*if the palette is already allocated, it will have size 1024 so no reallocation needed in that case*/
  /*the palette must have room for up to 256 colors with 4 bytes each.*/
  if(!info->palette) info->palette = (unsigned char*)lodepng_malloc(1024);
  if(!info->palette) return; /*alloc fail*/
  for(i = 0; i != 256; ++i) {
    /*Initialize all unused colors with black, the value used for invalid palette indices.
    This is an error according to the PNG spec, but common PNG decoders make it black instead.
    That makes color conversion slightly faster due to no error handling needed.*/
    info->palette[i * 4 + 0] = 0;
    info->palette[i * 4 + 1] = 0;
    info->palette[i * 4 + 2] = 0;
    info->palette[i * 4 + 3] = 255;
  }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
jne 0x4af7
movl $0x400, %edi            # imm = 0x400
callq 0x1130
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x4b29
xorl %eax, %eax
xorl %ecx, %ecx
cmpq $0x100, %rcx            # imm = 0x100
je 0x4b29
movq 0x8(%rbx), %rdx
movb %al, (%rdx,%rcx,4)
movq 0x8(%rbx), %rdx
movb %al, 0x1(%rdx,%rcx,4)
movq 0x8(%rbx), %rdx
movb %al, 0x2(%rdx,%rcx,4)
movq 0x8(%rbx), %rdx
movb $-0x1, 0x3(%rdx,%rcx,4)
incq %rcx
jmp 0x4afb
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: lodepng_add_text_sized
static unsigned lodepng_add_text_sized(LodePNGInfo* info, const char* key, const char* str, size_t size) {
  char** new_keys = (char**)(lodepng_realloc(info->text_keys, sizeof(char*) * (info->text_num + 1)));
  char** new_strings = (char**)(lodepng_realloc(info->text_strings, sizeof(char*) * (info->text_num + 1)));

  if(new_keys) info->text_keys = new_keys;
  if(new_strings) info->text_strings = new_strings;

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

  ++info->text_num;
  info->text_keys[info->text_num - 1] = alloc_string(key);
  info->text_strings[info->text_num - 1] = alloc_string_sized(str, size);
  if(!info->text_keys[info->text_num - 1] || !info->text_strings[info->text_num - 1]) return 83; /*alloc fail*/

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq 0x48(%rdi), %rax
movq 0x50(%rdi), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x1160
movq %rax, %r13
movq 0x48(%rbx), %rax
movq 0x58(%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x1160
testq %r13, %r13
je 0x4cd9
movq %r13, 0x50(%rbx)
pushq $0x53
popq %rbp
testq %rax, %rax
je 0x4ce5
movq %rax, 0x58(%rbx)
incq 0x48(%rbx)
movq %r12, %rdi
callq 0xb65f
movq 0x48(%rbx), %rcx
movq 0x50(%rbx), %rdx
movq %rax, -0x8(%rdx,%rcx,8)
movq %r15, %rdi
movq %r14, %rsi
callq 0xb671
movq 0x48(%rbx), %rcx
movq 0x58(%rbx), %rdx
movq %rax, -0x8(%rdx,%rcx,8)
movq 0x50(%rbx), %rax
cmpq $0x0, -0x8(%rax,%rcx,8)
je 0x4ce5
movq 0x58(%rbx), %rax
xorl %edx, %edx
cmpq $0x0, -0x8(%rax,%rcx,8)
pushq $0x53
popq %rbp
cmovnel %edx, %ebp
jmp 0x4ce5
pushq $0x53
popq %rbp
testq %rax, %rax
je 0x4ce5
movq %rax, 0x58(%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, 0x10(%rsp)
movq %r8, 0x8(%rsp)
movq %rcx, (%rsp)
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %rbx
movq 0x60(%rdi), %rax
movq 0x68(%rdi), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x1160
movq %rax, %r14
movq 0x60(%rbx), %rax
movq 0x70(%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x1160
movq %rax, %r15
movq 0x60(%rbx), %rax
movq 0x78(%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x1160
movq %rax, %r12
movq 0x60(%rbx), %rax
movq 0x80(%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x1160
movq %rax, %rcx
testq %r14, %r14
je 0x4e88
movq %r14, 0x68(%rbx)
testq %r15, %r15
je 0x4e91
movq %r15, 0x70(%rbx)
testq %r12, %r12
je 0x4e9a
movq %r12, 0x78(%rbx)
pushq $0x53
popq %rax
testq %rcx, %rcx
je 0x4f1d
movq %rcx, 0x80(%rbx)
testq %r14, %r14
je 0x4f1d
testq %r15, %r15
je 0x4f1d
testq %r12, %r12
je 0x4f1d
incq 0x60(%rbx)
movq %rbp, %rdi
callq 0xb65f
movq 0x60(%rbx), %rcx
movq 0x68(%rbx), %rdx
movq %rax, -0x8(%rdx,%rcx,8)
movq %r13, %rdi
callq 0xb65f
movq 0x60(%rbx), %rcx
movq 0x70(%rbx), %rdx
movq %rax, -0x8(%rdx,%rcx,8)
movq (%rsp), %rdi
callq 0xb65f
movq 0x60(%rbx), %rcx
movq 0x78(%rbx), %rdx
movq %rax, -0x8(%rdx,%rcx,8)
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xb671
movq 0x60(%rbx), %rcx
movq 0x80(%rbx), %rdx
movq %rax, -0x8(%rdx,%rcx,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_O2/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: lodepng_clear_icc
void lodepng_clear_icc(LodePNGInfo* info) {
  string_cleanup(&info->iccp_name);
  lodepng_free(info->iccp_profile);
  info->iccp_profile = NULL;
  info->iccp_profile_size = 0;
  info->iccp_defined = 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0xf0, %rdi
callq 0x501c
movq 0xf8(%rbx), %rdi
callq 0x1030
andq $0x0, 0xf8(%rbx)
andl $0x0, 0x100(%rbx)
andl $0x0, 0xe8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x4ff7
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %ecx, %ebx
movq %rdx, %r15
movq %rdi, %r14
movq %rsi, %rdi
callq 0xb65f
movq %rax, %r13
movq %rax, 0xf0(%r14)
movl %ebx, %r12d
movq %r12, %rdi
callq 0x1130
movq %rax, 0xf8(%r14)
testq %r13, %r13
sete %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
je 0x4ffb
pushq $0x53
popq %rax
jmp 0x5012
pushq $0x64
popq %rax
retq
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x4a33
movl %ebx, 0x100(%r14)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x50c3
movl $0x138, %edx            # imm = 0x138
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4a33
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 0x49cf
testl %eax, %eax
jne 0x5220
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%r14)
andq $0x0, 0x58(%r14)
xorl %r12d, %r12d
cmpq 0x48(%rbx), %r12
je 0x51a5
movq 0x50(%rbx), %rax
movq 0x58(%rbx), %rcx
movq (%rax,%r12,8), %rsi
movq (%rcx,%r12,8), %rdx
movq %r14, %rdi
callq 0x4c06
incq %r12
testl %eax, %eax
je 0x517e
jmp 0x5220
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%r14)
movups %xmm0, 0x60(%r14)
andq $0x0, 0x80(%r14)
xorl %r12d, %r12d
cmpq 0x60(%rbx), %r12
je 0x51f7
movq 0x68(%rbx), %rax
movq 0x70(%rbx), %rcx
movq (%rax,%r12,8), %rsi
movq (%rcx,%r12,8), %rdx
movq 0x78(%rbx), %rax
movq (%rax,%r12,8), %rcx
movq 0x80(%rbx), %rax
movq (%rax,%r12,8), %r8
movq %r14, %rdi
callq 0x4dba
incq %r12
testl %eax, %eax
je 0x51bd
jmp 0x5220
cmpl $0x0, 0xe8(%rbx)
je 0x5235
movq 0xf0(%rbx), %rsi
movq 0xf8(%rbx), %rdx
movl 0x100(%rbx), %ecx
movq %r14, %rdi
callq 0x4fa9
testl %eax, %eax
je 0x5235
movl %eax, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x5096
movq %r14, %rdi
callq 0x50ee
xorl %r15d, %r15d
pushq $0x53
popq %rbp
xorl %r13d, %r13d
cmpq $0x3, %r13
je 0x5223
movq 0x120(%rbx,%r13,8), %r12
movq %r12, 0x120(%r14,%r13,8)
movq %r12, %rdi
callq 0x1130
movq %rax, 0x108(%r14,%r13,8)
testq %rax, %rax
sete %al
testq %r12, %r12
setne %cl
testb %al, %cl
jne 0x52b3
xorl %eax, %eax
cmpq %r12, %rax
jae 0x52ae
movq 0x108(%rbx,%r13,8), %rcx
movb (%rcx,%rax), %cl
movq 0x108(%r14,%r13,8), %rdx
movb %cl, (%rdx,%rax)
incq %rax
movq 0x120(%rbx,%r13,8), %r12
jmp 0x5286
incq %r13
jmp 0x524e
movl %ebp, %r15d
jmp 0x5223
// File: /workspace/github_c_makefile_star2_O2/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 0x5e34
movl 0x4(%rdi), %ecx
cmpl 0x4(%rsi), %ecx
jne 0x5e34
movl 0x18(%rdi), %ecx
cmpl 0x18(%rsi), %ecx
jne 0x5e34
testl %ecx, %ecx
je 0x5e00
movl 0x1c(%rdi), %ecx
cmpl 0x1c(%rsi), %ecx
jne 0x5e34
movl 0x20(%rdi), %ecx
cmpl 0x20(%rsi), %ecx
jne 0x5e34
movl 0x24(%rdi), %ecx
cmpl 0x24(%rsi), %ecx
jne 0x5e34
movq 0x10(%rdi), %rcx
cmpq 0x10(%rsi), %rcx
jne 0x5e34
shlq $0x2, %rcx
xorl %r8d, %r8d
pushq $0x1
popq %rdx
cmpq %r8, %rcx
je 0x5e35
movq 0x8(%rdi), %rax
movb (%rax,%r8), %r9b
movq 0x8(%rsi), %r10
leaq 0x1(%r8), %r11
xorl %eax, %eax
cmpb (%r10,%r8), %r9b
movq %r11, %r8
je 0x5e14
retq
movl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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
subq $0x18, %rsp
movl %r9d, 0xc(%rsp)
movl %r8d, %r15d
movl %ecx, %r12d
movl %edx, %r13d
movl %esi, %r14d
movq %rdi, %r11
xorl %ebx, %ebx
cmpl $0x8, %ebx
je 0x5ee9
movl %r14d, %eax
movl %ebx, %ecx
shrl %cl, %eax
movl %r13d, %edi
shrl %cl, %edi
andl $0x1, %eax
andl $0x1, %edi
movl %r12d, %r10d
shrl %cl, %r10d
andl $0x1, %r10d
xorl %ecx, %ecx
btl %ebx, %r15d
setb %cl
leal (%rcx,%rdi,4), %ecx
leal (%rcx,%rax,8), %eax
leal (%rax,%r10,2), %ebp
movq (%r11,%rbp,8), %rax
testq %rax, %rax
jne 0x5ee2
movl $0x88, %edi
movq %r11, 0x10(%rsp)
callq 0x1130
movq 0x10(%rsp), %rcx
movq %rax, (%rcx,%rbp,8)
testq %rax, %rax
je 0x5ef8
movq %rax, %rdi
callq 0x5e38
movq 0x10(%rsp), %rax
movq (%rax,%rbp,8), %rax
incl %ebx
movq %rax, %r11
jmp 0x5e77
movl 0xc(%rsp), %eax
movl %eax, 0x80(%r11)
xorl %eax, %eax
jmp 0x5efb
pushq $0x53
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq $0x1f
popq %rax
cmpl $0x6, %edi
ja 0x6ff9
movl %edi, %ecx
leaq 0x8251(%rip), %rdx      # 0xf20c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
addl $-0x8, %esi
andl $-0x9, %esi
pushq $0x25
popq %rax
cmovel %esi, %eax
retq
pushq $0x25
popq %rax
cmpl $0x10, %esi
ja 0x6ff9
movl $0x10116, %ecx          # imm = 0x10116
btl %esi, %ecx
jae 0x6ff9
xorl %eax, %eax
retq
decl %esi
cmpl $0x8, %esi
jae 0x6ffa
movl %esi, %eax
leaq 0x9dca(%rip), %rcx      # 0x10dc0
movl (%rcx,%rax,4), %eax
retq
pushq $0x25
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rcx
movq %rsi, %r14
pushq $0x3
popq %rsi
movq %rdx, %rax
xorl %edx, %edx
divq %rsi
movq %rax, 0x10(%rdi)
addq $-0x303, %rcx           # imm = 0xFCFD
cmpq $-0x300, %rcx           # imm = 0xFD00
jae 0x72c9
pushq $0x26
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rdi, %rbx
callq 0x4ad9
cmpq $0x0, 0x8(%rbx)
je 0x733b
xorl %eax, %eax
pushq $0x2
popq %rcx
pushq $0x3
popq %rdx
xorl %esi, %esi
movl %esi, %edi
cmpq %rdi, 0x10(%rbx)
je 0x72c1
leal -0x2(%rcx), %edi
leal -0x1(%rcx), %r8d
movl %edi, %edi
movb (%r14,%rdi), %dil
movq 0x8(%rbx), %r9
leal -0x3(%rdx), %r10d
movb %dil, (%r9,%r10)
movb (%r14,%r8), %dil
movq 0x8(%rbx), %r8
leal -0x2(%rdx), %r9d
movb %dil, (%r8,%r9)
movl %ecx, %edi
movb (%r14,%rdi), %dil
movq 0x8(%rbx), %r8
leal -0x1(%rdx), %r9d
movb %dil, (%r8,%r9)
movq 0x8(%rbx), %rdi
movl %edx, %r8d
movb $-0x1, (%rdi,%r8)
incl %esi
addl $0x3, %ecx
addl $0x4, %edx
jmp 0x72e2
cmpq $0x0, 0x10(%rbx)
je 0x72d8
andq $0x0, 0x10(%rbx)
pushq $0x53
jmp 0x72c0
// File: /workspace/github_c_makefile_star2_O2/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), %eax
testl %eax, %eax
je 0x739f
cmpl $0x2, %eax
je 0x7368
cmpl $0x3, %eax
jne 0x73c5
cmpq %rdx, 0x10(%rdi)
jae 0x73d1
pushq $0x27
jmp 0x73cf
cmpq $0x6, %rdx
jne 0x73c9
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
pushq $0x24
jmp 0x73be
cmpq $0x2, %rdx
jne 0x73cd
movl $0x1, 0x18(%rdi)
movzwl (%rsi), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl %eax, 0x24(%rdi)
movl %eax, 0x20(%rdi)
pushq $0x1c
popq %rcx
movl %eax, (%rdi,%rcx)
xorl %eax, %eax
retq
pushq $0x2a
jmp 0x73cf
pushq $0x29
jmp 0x73cf
pushq $0x1e
popq %rax
retq
xorl %eax, %eax
pushq $0x3
popq %rcx
xorl %r8d, %r8d
movl %r8d, %r8d
cmpq %rdx, %r8
je 0x73c4
movb (%rsi,%r8), %r9b
movq 0x8(%rdi), %r10
movl %ecx, %r11d
movb %r9b, (%r10,%r11)
incl %r8d
addl $0x4, %ecx
jmp 0x73d9
// File: /workspace/github_c_makefile_star2_O2/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 0x746d
leaq 0x7e1e(%rip), %r8       # 0xf228
movslq (%r8,%rcx,4), %rcx
addq %r8, %rcx
jmpq *%rcx
cmpq $0x2, %rdx
jne 0x7472
movl $0x1, 0x38(%rdi)
movzwl (%rsi), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
movl %ecx, 0x44(%rdi)
movl %ecx, 0x40(%rdi)
pushq $0x3c
jmp 0x7469
cmpq $0x6, %rdx
jne 0x746e
movl $0x1, 0x38(%rdi)
movzwl (%rsi), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
movl %ecx, 0x3c(%rdi)
movzwl 0x2(%rsi), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
movl %ecx, 0x40(%rdi)
movzwl 0x4(%rsi), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
pushq $0x44
popq %rdx
movl %ecx, (%rdi,%rdx)
retq
pushq $0x2d
jmp 0x7497
pushq $0x2c
jmp 0x7497
cmpq $0x1, %rdx
jne 0x7491
movzbl (%rsi), %ecx
cmpq %rcx, 0x20(%rdi)
jbe 0x7495
movl $0x1, 0x38(%rdi)
movzbl (%rsi), %ecx
jmp 0x742a
pushq $0x2b
jmp 0x7497
pushq $0x67
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/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
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbp
pushq $-0x50
popq %r13
leal 0x50(%r13), %r14d
cmpq %r12, %r14
jae 0x74c6
cmpb $0x0, (%r15,%r14)
je 0x74c6
incl %r13d
jmp 0x74b1
cmpl $-0x4f, %r13d
jae 0x74da
pushq $0x59
popq %r15
xorl %ebx, %ebx
xorl %r14d, %r14d
jmp 0x755b
addl $0x51, %r13d
movq %r13, %rdi
callq 0x1130
testq %rax, %rax
je 0x7552
movq %rax, %rbx
movq %rbp, (%rsp)
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4a33
movb $0x0, (%rbx,%r14)
xorl %r14d, %r14d
subq %r13, %r12
cmovbq %r14, %r12
leal 0x1(%r12), %edi
callq 0x1130
testq %rax, %rax
je 0x7557
movq %rax, %rbp
addq %r13, %r15
movl %r12d, %r14d
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4a33
movb $0x0, (%rbp,%r14)
movq (%rsp), %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x4c06
movl %eax, %r15d
movq %rbp, %r14
jmp 0x755b
xorl %ebx, %ebx
xorl %r14d, %r14d
pushq $0x53
popq %r15
movq %rbx, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
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_O2/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, %r15
movq %rdx, %r13
andq $0x0, 0x8(%rsp)
andq $0x0, (%rsp)
pushq $0x2
popq %r12
leal -0x2(%r12), %ebp
cmpq %r15, %rbp
jae 0x75b7
cmpb $0x0, (%r13,%rbp)
je 0x75b7
incl %r12d
jmp 0x75a0
movl %r12d, %ebx
cmpq %r15, %rbx
jae 0x75cd
leal -0x52(%r12), %eax
cmpl $-0x4f, %eax
jae 0x75f7
pushq $0x59
jmp 0x75cf
pushq $0x4b
popq %rbp
xorl %r15d, %r15d
xorl %r14d, %r14d
movq %r14, %rdi
callq 0x1030
movq %r15, %rdi
callq 0x1030
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, 0x18(%rsp)
movq %rdi, 0x10(%rsp)
leal -0x1(%r12), %edi
movq %rdi, 0x20(%rsp)
callq 0x1130
testq %rax, %rax
je 0x7640
movq %rax, %r14
movq %rax, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x4a33
movb $0x0, (%r14,%rbp)
movq 0x20(%rsp), %rax
cmpb $0x0, (%r13,%rax)
je 0x7644
pushq $0x48
popq %rbp
xorl %r15d, %r15d
jmp 0x75d6
pushq $0x53
jmp 0x75cf
subl %r12d, %r15d
addq %rbx, %r13
leaq 0x8(%rsp), %rbx
movq %rsp, %rsi
movq %rbx, %rdi
xorl %edx, %edx
movq %r13, %rcx
movq %r15, %r8
movq 0x18(%rsp), %r9
callq 0xb7c0
movq (%rbx), %r15
testl %eax, %eax
je 0x7675
movl %eax, %ebp
jmp 0x75d6
movq (%rsp), %rcx
movq 0x10(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4c2f
movl %eax, %ebp
movq 0x8(%rsp), %r15
jmp 0x75d6
// File: /workspace/github_c_makefile_star2_O2/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: readChunk_tIME
static unsigned readChunk_tIME(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) {
  if(chunkLength != 7) return 73; /*invalid tIME chunk size*/

  info->time_defined = 1;
  info->time.year = 256u * data[0] + data[1];
  info->time.month = data[2];
  info->time.day = data[3];
  info->time.hour = data[4];
  info->time.minute = data[5];
  info->time.second = data[6];

  return 0; /* OK */
}

// Assembly:
cmpq $0x7, %rdx
jne 0x7914
movl $0x1, 0x88(%rdi)
movzwl (%rsi), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl %eax, 0x8c(%rdi)
movzbl 0x2(%rsi), %eax
movl %eax, 0x90(%rdi)
movzbl 0x3(%rsi), %eax
movl %eax, 0x94(%rdi)
movzbl 0x4(%rsi), %eax
movl %eax, 0x98(%rdi)
movzbl 0x5(%rsi), %eax
movl %eax, 0x9c(%rdi)
movzbl 0x6(%rsi), %eax
movl %eax, 0xa0(%rdi)
xorl %eax, %eax
retq
pushq $0x49
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: readChunk_pHYs
static unsigned readChunk_pHYs(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) {
  if(chunkLength != 9) return 74; /*invalid pHYs chunk size*/

  info->phys_defined = 1;
  info->phys_x = 16777216u * data[0] + 65536u * data[1] + 256u * data[2] + data[3];
  info->phys_y = 16777216u * data[4] + 65536u * data[5] + 256u * data[6] + data[7];
  info->phys_unit = data[8];

  return 0; /* OK */
}

// Assembly:
cmpq $0x9, %rdx
jne 0x794a
movl $0x1, 0xa4(%rdi)
movl (%rsi), %eax
bswapl %eax
movl %eax, 0xa8(%rdi)
movl 0x4(%rsi), %eax
bswapl %eax
movl %eax, 0xac(%rdi)
movzbl 0x8(%rsi), %eax
movl %eax, 0xb0(%rdi)
xorl %eax, %eax
retq
pushq $0x4a
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/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:
cmpq $0x20, %rdx
jne 0x79d9
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
pushq $0x61
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/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, 0x8(%rsp)
andq $0x0, 0x10(%rsp)
movq %rdi, %rbx
movl $0x1, 0xe8(%rdi)
cmpq $0x0, 0xf0(%rdi)
je 0x7a1b
movq %rbx, %rdi
callq 0x4f75
pushq $0x2
popq %rbp
leal -0x2(%rbp), %r13d
cmpq %r14, %r13
jae 0x7a32
cmpb $0x0, (%r12,%r13)
je 0x7a32
incl %ebp
jmp 0x7a1e
movl %ebp, %r15d
cmpq %r14, %r15
jae 0x7a46
leal -0x52(%rbp), %eax
cmpl $-0x4f, %eax
jae 0x7a58
pushq $0x59
jmp 0x7a48
pushq $0x4b
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leal -0x1(%rbp), %edi
movq %rdi, (%rsp)
callq 0x1130
movq %rax, 0xf0(%rbx)
testq %rax, %rax
je 0x7aa1
movb $0x0, (%rax,%r13)
movl %r13d, %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x7a92
movb (%r12,%rcx), %dl
movq 0xf0(%rbx), %rsi
movb %dl, (%rsi,%rcx)
incq %rcx
jmp 0x7a7a
movq (%rsp), %rax
cmpb $0x0, (%r12,%rax)
je 0x7aa5
pushq $0x48
jmp 0x7a48
pushq $0x53
jmp 0x7a48
subl %ebp, %r14d
leaq 0xf8(%rbx), %rdi
addq %r15, %r12
xorl %r15d, %r15d
leaq 0x10(%rsp), %r13
movq %r13, %rsi
xorl %edx, %edx
movq %r12, %rcx
movq %r14, %r8
movq 0x8(%rsp), %r9
callq 0xb7c0
movl (%r13), %ecx
movl %ecx, 0x100(%rbx)
testl %eax, %eax
jne 0x7a49
testl %ecx, %ecx
pushq $0x64
popq %rax
cmovel %eax, %r15d
movl %r15d, %eax
jmp 0x7a49
// File: /workspace/github_c_makefile_star2_O2/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)
leaq 0x20(%rsp), %r12
andq $0x0, (%r12)
movq %rdi, %r14
andq $0x0, (%rdi)
movq %rdx, %r15
andl $0x0, (%rdx)
movq %rsi, %r13
andl $0x0, (%rsi)
leaq 0x18(%rsp), %rsi
movq %r12, %rdi
movq %rcx, %rdx
callq 0x24a4
movl %eax, %ebx
movq (%r12), %r12
testl %eax, %eax
jne 0x89da
movq 0x18(%rsp), %r8
movl %ebp, (%rsp)
movq %r14, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r12, %rcx
movl 0x14(%rsp), %r9d
callq 0x8842
movl %eax, %ebx
movq %r12, %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_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8(%rdi), %r12
leaq (%rsi,%rdx), %r13
movq %rsi, %rbp
movq %rbp, %rax
subq %r14, %rax
cmpq %rbx, %rax
jae 0xa48c
movq %r15, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x4890
testl %eax, %eax
jne 0xa48e
movq 0x8(%r15), %rax
movq %rax, 0x10(%r15)
movq %rbp, %rdi
movq %r13, %rsi
callq 0x4720
movq %rax, %rbp
jmp 0xa457
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_O2/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
imull $0x3, 0x10(%rbx), %edx
leaq 0x56ea(%rip), %rcx      # 0xfb9d
leaq 0x8(%rsp), %rdi
callq 0xb5d9
testl %eax, %eax
jne 0xa501
movq 0x8(%rsp), %rdi
leaq 0xa(%rdi), %rax
xorl %ecx, %ecx
cmpq 0x10(%rbx), %rcx
je 0xa4fa
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
jmp 0xa4cc
callq 0x46f3
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: addChunk_tEXt
static unsigned addChunk_tEXt(ucvector* out, const char* keyword, const char* textstring) {
  unsigned char* chunk = 0;
  size_t keysize = lodepng_strlen(keyword), textsize = lodepng_strlen(textstring);
  size_t size = keysize + 1 + textsize;
  if(keysize < 1 || keysize > 79) return 89; /*error: invalid keyword size*/
  CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, size, "tEXt"));
  lodepng_memcpy(chunk + 8, keyword, keysize);
  chunk[8 + keysize] = 0; /*null termination char*/
  lodepng_memcpy(chunk + 9 + keysize, textstring, textsize);
  lodepng_chunk_generate_crc(chunk);
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r13
andq $0x0, 0x8(%rsp)
movq %rsi, %rdi
callq 0x4681
movq %rax, %r15
movq %rbx, %rdi
callq 0x4681
movq %rax, %r12
leaq -0x50(%r15), %rax
cmpq $-0x4f, %rax
jae 0xa548
pushq $0x59
popq %rax
jmp 0xa59d
leal (%r15,%r12), %edx
incl %edx
leaq 0x5657(%rip), %rcx      # 0xfbac
leaq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0xb5d9
testl %eax, %eax
jne 0xa59d
movq 0x8(%rsp), %r13
leaq 0x8(%r13), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4a33
movb $0x0, 0x8(%r13,%r15)
leaq (%r15,%r13), %rdi
addq $0x9, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x4a33
movq %r13, %rdi
callq 0x46f3
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: ucvector_resize
static unsigned ucvector_resize(ucvector* p, size_t size) {
  if(size > p->allocsize) {
    size_t newsize = size + (p->allocsize >> 1u);
    void* data = lodepng_realloc(p->data, newsize);
    if(data) {
      p->allocsize = newsize;
      p->data = (unsigned char*)data;
    }
    else return 0; /*error: not enough memory*/
  }
  p->size = size;
  return 1; /*success*/
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %r15
cmpq %rsi, %r15
jae 0xa723
shrq %r15
addq %rbx, %r15
movq (%r14), %rdi
movq %r15, %rsi
callq 0x1160
testq %rax, %rax
je 0xa730
movq %r15, 0x10(%r14)
movq %rax, (%r14)
movq %rbx, 0x8(%r14)
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %r15
retq
xorl %eax, %eax
jmp 0xa72a
// File: /workspace/github_c_makefile_star2_O2/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: huffmanDecodeSymbol
static unsigned huffmanDecodeSymbol(LodePNGBitReader* reader, const HuffmanTree* codetree) {
  unsigned short code = peekBits(reader, FIRSTBITS);
  unsigned short l = codetree->table_len[code];
  unsigned short value = codetree->table_value[code];
  if(l <= FIRSTBITS) {
    advanceBits(reader, l);
    return value;
  } else {
    unsigned index2;
    advanceBits(reader, FIRSTBITS);
    index2 = value + peekBits(reader, l - FIRSTBITS);
    advanceBits(reader, codetree->table_len[index2] - FIRSTBITS);
    return codetree->table_value[index2];
  }
}

// Assembly:
movl 0x20(%rdi), %eax
movl %eax, %r9d
andl $0x1ff, %r9d            # imm = 0x1FF
movq 0x18(%rsi), %r8
movq 0x20(%rsi), %rdx
movzbl (%r8,%r9), %ecx
movl %r9d, %esi
movzwl (%rdx,%rsi,2), %esi
cmpq $0x9, %rcx
ja 0xa766
shrl %cl, %eax
movl %eax, 0x20(%rdi)
addq %rcx, 0x18(%rdi)
jmp 0xa7b5
movzwl %si, %r9d
shrl $0x9, %eax
movl %eax, 0x20(%rdi)
movq 0x18(%rdi), %rsi
leaq 0x9(%rsi), %r10
addb $-0x9, %cl
pushq $-0x1
popq %r11
shll %cl, %r11d
movq %r10, 0x18(%rdi)
notl %r11d
andl %eax, %r11d
addq %r9, %r11
movzbl (%r8,%r11), %r8d
movl $0xfffffff7, %ecx       # imm = 0xFFFFFFF7
addq %r8, %rcx
movl %ecx, %r8d
shrl %cl, %eax
movl %eax, 0x20(%rdi)
leaq (%r8,%rsi), %rax
addq $0x9, %rax
movq %rax, 0x18(%rdi)
movzwl (%rdx,%r11,2), %esi
movzwl %si, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: writeBits
static void writeBits(LodePNGBitWriter* writer, unsigned value, size_t nbits) {
  if(nbits == 1) { /* compiler should statically compile this case if nbits == 1 */
    WRITEBIT(writer, value);
  } else {
    /* TODO: increase output size only once here rather than in each WRITEBIT */
    size_t i;
    for(i = 0; i != nbits; ++i) {
      WRITEBIT(writer, (unsigned char)((value >> i) & 1));
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
cmpq $0x1, %rdx
jne 0xad36
movb 0x8(%rbx), %cl
andb $0x7, %cl
jne 0xad17
movq (%rbx), %rdi
movq 0x8(%rdi), %rsi
incq %rsi
callq 0xa6f2
testl %eax, %eax
je 0xad2b
movq (%rbx), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
movb $0x0, -0x1(%rcx,%rax)
movb 0x8(%rbx), %cl
andb $0x7, %cl
shll %cl, %ebp
movq (%rbx), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
orb %bpl, -0x1(%rcx,%rax)
incb 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %r14
xorl %r15d, %r15d
cmpq %r15, %r14
je 0xad2b
movb 0x8(%rbx), %cl
andb $0x7, %cl
jne 0xad71
movq (%rbx), %rdi
movq 0x8(%rdi), %rsi
incq %rsi
callq 0xa6f2
testl %eax, %eax
je 0xad2b
movq (%rbx), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
movb $0x0, -0x1(%rcx,%rax)
movb 0x8(%rbx), %cl
andb $0x7, %cl
xorl %eax, %eax
btl %r15d, %ebp
setb %al
shll %cl, %eax
movq (%rbx), %rcx
movq (%rcx), %rdx
movq 0x8(%rcx), %rcx
orb %al, -0x1(%rdx,%rcx)
incb 0x8(%rbx)
incq %r15
jmp 0xad3c
// File: /workspace/github_c_makefile_star2_O2/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: writeLZ77data
static void writeLZ77data(LodePNGBitWriter* writer, const uivector* lz77_encoded,
                          const HuffmanTree* tree_ll, const HuffmanTree* tree_d) {
  size_t i = 0;
  for(i = 0; i != lz77_encoded->size; ++i) {
    unsigned val = lz77_encoded->data[i];
    writeBitsReversed(writer, tree_ll->codes[val], tree_ll->lengths[val]);
    if(val > 256) /*for a length code, 3 more things have to be added*/ {
      unsigned length_index = val - FIRST_LENGTH_CODE_INDEX;
      unsigned n_length_extra_bits = LENGTHEXTRA[length_index];
      unsigned length_extra_bits = lz77_encoded->data[++i];

      unsigned distance_code = lz77_encoded->data[++i];

      unsigned distance_index = distance_code;
      unsigned n_distance_extra_bits = DISTANCEEXTRA[distance_index];
      unsigned distance_extra_bits = lz77_encoded->data[++i];

      writeBits(writer, length_extra_bits, n_length_extra_bits);
      writeBitsReversed(writer, tree_d->codes[distance_code], tree_d->lengths[distance_code]);
      writeBits(writer, distance_extra_bits, n_distance_extra_bits);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x8(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebx, %ebx
cmpq 0x8(%r15), %rbx
je 0xb343
movq (%r15), %rax
movl (%rax,%rbx,4), %r13d
movq (%r14), %rax
movq 0x8(%r14), %rcx
movl (%rax,%r13,4), %esi
movl (%rcx,%r13,4), %edx
movq %r12, %rdi
callq 0xb36b
cmpq $0x101, %r13            # imm = 0x101
jb 0xb33b
addl $0xfffffeff, %r13d      # imm = 0xFFFFFEFF
leaq 0x4496(%rip), %rax      # 0xf770
movl (%rax,%r13,4), %edx
movq (%r15), %rax
movl 0x4(%rax,%rbx,4), %esi
movq %r14, %r13
movl 0x8(%rax,%rbx,4), %r14d
leaq 0x457c(%rip), %rcx      # 0xf870
movl (%rcx,%r14,4), %ecx
movq %rcx, 0x10(%rsp)
movl 0xc(%rax,%rbx,4), %ebp
addq $0x3, %rbx
movq %r12, %rdi
callq 0xacd5
movq 0x8(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
movl (%rax,%r14,4), %esi
movl (%rcx,%r14,4), %edx
movq %r13, %r14
movq %r12, %rdi
callq 0xb36b
movq %r12, %rdi
movl %ebp, %esi
movq 0x10(%rsp), %rdx
callq 0xacd5
incq %rbx
jmp 0xb29b
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: writeBitsReversed
static void writeBitsReversed(LodePNGBitWriter* writer, unsigned value, size_t nbits) {
  size_t i;
  for(i = 0; i != nbits; ++i) {
    /* TODO: increase output size only once here rather than in each WRITEBIT */
    WRITEBIT(writer, (unsigned char)((value >> (nbits - 1u - i)) & 1u));
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
testq %rbx, %rbx
je 0xb3cf
movb 0x8(%r14), %cl
andb $0x7, %cl
jne 0xb3ae
movq (%r14), %rdi
movq 0x8(%rdi), %rsi
incq %rsi
callq 0xa6f2
testl %eax, %eax
je 0xb3cf
movq (%r14), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
movb $0x0, -0x1(%rcx,%rax)
movb 0x8(%r14), %cl
andb $0x7, %cl
decq %rbx
xorl %eax, %eax
btl %ebx, %ebp
setb %al
shll %cl, %eax
movq (%r14), %rcx
movq (%rcx), %rdx
movq 0x8(%rcx), %rcx
orb %al, -0x1(%rdx,%rcx)
incb 0x8(%r14)
jmp 0xb377
popq %rbx
popq %r14
popq %rbp
retq