LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: lodepng_set_icc(LodePNGInfo*, char const*, unsigned char const*, unsigned int)
unsigned lodepng_set_icc(LodePNGInfo* info, const char* name, const unsigned char* profile, unsigned profile_size) {
  if(info->iccp_defined) lodepng_clear_icc(info);

  if(profile_size == 0) return 100; /*invalid ICC profile size*/

  info->iccp_name = alloc_string(name);
  if(!info->iccp_name) return 83; /*alloc fail*/

  info->iccp_profile = (unsigned char*)lodepng_malloc(profile_size);
  if(!info->iccp_profile) {
    lodepng_free(info->iccp_name);
    return 83; /*alloc fail*/
  }

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

  return 0; /*ok*/
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
cmpl $0x0, 0xfc(%rdi)
je 0x5ef1
movq 0x100(%r14), %rdi
callq 0x22a0
xorl %r13d, %r13d
movq %r13, 0x100(%r14)
movq 0x108(%r14), %rdi
callq 0x22a0
movq %r13, 0x108(%r14)
movl %r13d, 0x110(%r14)
movl %r13d, 0xfc(%r14)
testl %ebx, %ebx
je 0x5f4c
movq %r12, %rdi
callq 0x5fb2
movq %rax, 0x100(%r14)
movl $0x53, %ebp
testq %rax, %rax
je 0x5f5b
movq %rax, %r12
movl %ebx, %r13d
movq %r13, %rdi
callq 0x22b0
movq %rax, 0x108(%r14)
testq %rax, %rax
je 0x5f53
movq %rax, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x21e0
movl %ebx, 0x110(%r14)
movl $0x1, 0xfc(%r14)
xorl %ebp, %ebp
jmp 0x5f5b
movl $0x64, %ebp
jmp 0x5f5b
movq %r12, %rdi
callq 0x22a0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: lodepng_set_exif(LodePNGInfo*, unsigned char const*, unsigned int)
unsigned lodepng_set_exif(LodePNGInfo* info, const unsigned char* exif, unsigned exif_size) {
  if(info->exif_defined) lodepng_clear_exif(info);
  info->exif = (unsigned char*)lodepng_malloc(exif_size);

  if(!info->exif) return 83; /*alloc fail*/

  lodepng_memcpy(info->exif, exif, exif_size);
  info->exif_size = exif_size;
  info->exif_defined = 1;

  return 0; /*ok*/
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
cmpl $0x0, 0x88(%rdi)
je 0x6034
movq 0x90(%r14), %rdi
callq 0x22a0
xorl %eax, %eax
movl %eax, 0x98(%r14)
movl %eax, 0x88(%r14)
movl %ebx, %r12d
movq %r12, %rdi
callq 0x22b0
movq %rax, 0x90(%r14)
testq %rax, %rax
je 0x6073
testl %ebx, %ebx
je 0x605d
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x21e0
movl %ebx, 0x98(%r14)
movl $0x1, 0x88(%r14)
xorl %eax, %eax
jmp 0x6078
movl $0x53, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: lodepng_clear_exif(LodePNGInfo*)
void lodepng_clear_exif(LodePNGInfo* info) {
  lodepng_free(info->exif);
  info->exif = NULL;
  info->exif_size = 0;
  info->exif_defined = 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x90(%rdi), %rdi
callq 0x22a0
movq $0x0, 0x90(%rbx)
xorl %eax, %eax
movl %eax, 0x98(%rbx)
movl %eax, 0x88(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: lodepng_info_cleanup(LodePNGInfo*)
void lodepng_info_cleanup(LodePNGInfo* info) {
  lodepng_color_mode_cleanup(&info->color);
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
  LodePNGText_cleanup(info);
  LodePNGIText_cleanup(info);

  lodepng_clear_icc(info);
  lodepng_clear_exif(info);

  LodePNGUnknownChunks_cleanup(info);
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x18(%rdi), %r14
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x6173
callq 0x22a0
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq %rbx, %rdi
callq 0x5c2d
movq %rbx, %rdi
callq 0x5c8f
movq 0x100(%rbx), %rdi
callq 0x22a0
xorl %r14d, %r14d
movq %r14, 0x100(%rbx)
movq 0x108(%rbx), %rdi
callq 0x22a0
movq %r14, 0x108(%rbx)
movl %r14d, 0x110(%rbx)
movl %r14d, 0xfc(%rbx)
movq 0x90(%rbx), %rdi
callq 0x22a0
movq %r14, 0x90(%rbx)
movl %r14d, 0x98(%rbx)
movl %r14d, 0x88(%rbx)
movq 0x178(%rbx,%r14,8), %rdi
callq 0x22a0
incq %r14
cmpq $0x3, %r14
jne 0x61e2
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: color_tree_add(ColorTree*, unsigned char, unsigned char, unsigned char, unsigned char, unsigned int)
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 0x6abb
movl $0x88, %edi
callq 0x22b0
movq %rax, (%rbx,%rbp,8)
testq %rax, %rax
je 0x6ad8
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 0x6a3c
movl (%rsp), %ecx
movl %ecx, 0x80(%rax)
xorl %eax, %eax
jmp 0x6add
movl $0x53, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: readChunk_tEXt(LodePNGInfo*, unsigned char const*, unsigned long)
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 0x8c2b
movq %rdx, %r12
movq %rsi, %r13
xorl %r14d, %r14d
cmpb $0x0, (%r13,%r14)
je 0x8b90
incl %ebp
movq %rbp, %r14
cmpq %r12, %rbp
jb 0x8b7e
leal -0x50(%rbp), %eax
cmpl $-0x4f, %eax
jb 0x8c2b
movq %rdi, (%rsp)
incl %ebp
movq %rbp, %rdi
callq 0x22b0
movl $0x53, %ebx
testq %rax, %rax
je 0x8c2b
movq %rax, %r15
movq %rax, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x21e0
movb $0x0, (%r15,%r14)
xorl %eax, %eax
subq %rbp, %r12
cmovbq %rax, %r12
leal 0x1(%r12), %edi
callq 0x22b0
testq %rax, %rax
je 0x8c2e
movq %rax, %r14
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
andq %rax, %r12
je 0x8c00
addq %rbp, %r13
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x21e0
movb $0x0, (%r14,%r12)
movq $-0x1, %rcx
cmpb $0x0, 0x1(%r14,%rcx)
leaq 0x1(%rcx), %rcx
jne 0x8c0c
movq (%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x5b44
movl %eax, %ebx
jmp 0x8c31
xorl %r15d, %r15d
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x22a0
movq %r14, %rdi
callq 0x22a0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: readChunk_cLLI(LodePNGInfo*, unsigned char const*, unsigned long)
static unsigned readChunk_cLLI(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) {
  if(chunkLength != 8) return 120; /*invalid cLLI chunk size*/

  info->clli_defined = 1;
  info->clli_max_cll = 16777216u * data[0] + 65536u * data[1] + 256u * data[2] + data[3];
  info->clli_max_fall = 16777216u * data[4] + 65536u * data[5] + 256u * data[6] + data[7];

  return 0; /* OK */
}

// Assembly:
movl $0x78, %eax
cmpq $0x8, %rdx
jne 0x940b
movl $0x1, 0x154(%rdi)
movl (%rsi), %eax
bswapl %eax
movl %eax, 0x158(%rdi)
movl 0x4(%rsi), %eax
bswapl %eax
movl %eax, 0x15c(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: lodepng_decode_memory(unsigned char**, unsigned int*, unsigned int*, unsigned char const*, unsigned long, LodePNGColorType, unsigned int)
unsigned lodepng_decode_memory(unsigned char** out, unsigned* w, unsigned* h, const unsigned char* in,
                               size_t insize, LodePNGColorType colortype, unsigned bitdepth) {
  unsigned error;
  LodePNGState state;
  lodepng_state_init(&state);
  state.info_raw.colortype = colortype;
  state.info_raw.bitdepth = bitdepth;
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
  /*disable reading things that this function doesn't output*/
  state.decoder.read_text_chunks = 0;
  state.decoder.remember_unknown_chunks = 0;
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
  error = lodepng_decode(out, w, h, &state, in, insize);
  lodepng_state_cleanup(&state);
  return error;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x280, %rsp            # imm = 0x280
movq %r8, %rax
movq %rcx, %r8
movl 0x2a0(%rsp), %ecx
movl $0x1, %r10d
movq %rsp, %rbx
movl %r10d, 0x34(%rbx)
movl $0x1000000, %r11d       # imm = 0x1000000
movq %r11, 0x40(%rbx)
movq %r11, 0x48(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rbx)
movaps %xmm0, 0x10(%rbx)
movaps %xmm0, 0x20(%rbx)
xorl %r11d, %r11d
movl %r11d, 0x30(%rbx)
movaps 0x67b50(%rip), %xmm1    # 0x720b0
movaps %xmm1, 0x50(%rbx)
movl $0x80, 0x60(%rbx)
movl %r10d, 0x64(%rbx)
movups %xmm0, 0x68(%rbx)
movq %r11, 0x78(%rbx)
movl $0x5, 0x88(%rbx)
movabsq $0x100000001, %r14      # imm = 0x100000001
movq %r14, 0x80(%rbx)
movaps %xmm0, 0x90(%rbx)
movl %r10d, 0xa0(%rbx)
movaps %xmm0, 0xc0(%rbx)
movaps %xmm0, 0xb0(%rbx)
movups %xmm0, 0xf8(%rbx)
movabsq $0x800000006, %r14      # imm = 0x800000006
movq %r14, 0xe0(%rbx)
movups %xmm0, 0xe8(%rbx)
movl %r11d, 0xd8(%rbx)
movq %r11, 0xd0(%rbx)
movl %r11d, 0x188(%rbx)
movl %r11d, 0x198(%rbx)
movl %r11d, 0x1a0(%rbx)
movl %r11d, 0x1c4(%rbx)
movups %xmm0, 0x268(%rbx)
movups %xmm0, 0x258(%rbx)
movups %xmm0, 0x248(%rbx)
movl %r11d, 0x158(%rbx)
movups %xmm0, 0x148(%rbx)
movups %xmm0, 0x138(%rbx)
movups %xmm0, 0x128(%rbx)
movups %xmm0, 0x118(%rbx)
movups %xmm0, 0x108(%rbx)
movaps %xmm0, 0x160(%rbx)
movl %r11d, 0x1dc(%rbx)
movups %xmm0, 0x1cc(%rbx)
movups %xmm0, 0x234(%rbx)
movups %xmm0, 0x224(%rbx)
movups %xmm0, 0x214(%rbx)
movups %xmm0, 0x204(%rbx)
movups %xmm0, 0x1f4(%rbx)
movups %xmm0, 0x1e4(%rbx)
movl %r10d, 0x278(%rbx)
movl %r9d, 0xa8(%rbx)
movl %ecx, 0xac(%rbx)
movq %r11, 0x38(%rbx)
movq %rbx, %rcx
movq %rax, %r9
callq 0x9609
movl %eax, %ebp
movq %rbx, %rdi
callq 0xa802
movl %ebp, %eax
addq $0x280, %rsp            # imm = 0x280
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: addChunk_IHDR(ucvector*, unsigned int, unsigned int, LodePNGColorType, unsigned int, unsigned int)
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, %r15d
movl %r8d, %r14d
movl %ecx, %ebp
movl %edx, %r13d
movl %esi, %ebx
movq %rdi, %rsi
leaq 0x68800(%rip), %rcx     # 0x74877
movq %rsp, %rdi
movl $0xd, %edx
callq 0xebd0
movl %eax, %r12d
testl %eax, %eax
jne 0xc0d7
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 %r15b, 0x14(%rdi)
callq 0x54f4
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: addChunk_cICP(ucvector*, LodePNGInfo const*)
static unsigned addChunk_cICP(ucvector* out, const LodePNGInfo* info) {
  unsigned char* chunk;
  /* Allow up to 255 since they are bytes. The ITU-R-BT.709 spec has a more
  restricted set of valid values for each field, but that's up to the error
  handling of a CICP library, not the PNG encoding/decoding, to manage. */
  if(info->cicp_color_primaries > 255) return 116;
  if(info->cicp_transfer_function > 255) return 116;
  if(info->cicp_matrix_coefficients > 255) return 116;
  if(info->cicp_video_full_range_flag > 255) return 116;
  CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 4, "cICP"));
  chunk[8 + 0] = (unsigned char)info->cicp_color_primaries;
  chunk[8 + 1] = (unsigned char)info->cicp_transfer_function;
  chunk[8 + 2] = (unsigned char)info->cicp_matrix_coefficients;
  chunk[8 + 3] = (unsigned char)info->cicp_video_full_range_flag;
  lodepng_chunk_generate_crc(chunk);
  return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movl $0x74, %eax
cmpl $0xff, 0x118(%rsi)
ja 0xc1dc
cmpl $0xff, 0x11c(%rbx)
ja 0xc1dc
cmpl $0xff, 0x120(%rbx)
ja 0xc1dc
cmpl $0xff, 0x124(%rbx)
ja 0xc1dc
movq %rdi, %rsi
leaq 0x6871f(%rip), %rcx     # 0x748b8
leaq 0x8(%rsp), %rdi
movl $0x4, %edx
callq 0xebd0
testl %eax, %eax
jne 0xc1dc
movb 0x118(%rbx), %al
movq 0x8(%rsp), %rdi
movb %al, 0x8(%rdi)
movb 0x11c(%rbx), %al
movb %al, 0x9(%rdi)
movb 0x120(%rbx), %al
movb %al, 0xa(%rdi)
movb 0x124(%rbx), %al
movb %al, 0xb(%rdi)
callq 0x54f4
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: addChunk_cLLI(ucvector*, LodePNGInfo const*)
static unsigned addChunk_cLLI(ucvector* out, const LodePNGInfo* info) {
  unsigned char* chunk;
  CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 8, "cLLI"));
  lodepng_set32bitInt(chunk + 8 + 0, info->clli_max_cll);
  lodepng_set32bitInt(chunk + 8 + 4, info->clli_max_fall);
  lodepng_chunk_generate_crc(chunk);
  return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %rsi
leaq 0x6856a(%rip), %rcx     # 0x748c2
movq %rsp, %rdi
movl $0x8, %edx
callq 0xebd0
movl %eax, %ebp
testl %eax, %eax
jne 0xc38a
movq (%rsp), %rdi
movl 0x158(%rbx), %eax
bswapl %eax
movl %eax, 0x8(%rdi)
movl 0x15c(%rbx), %eax
bswapl %eax
movl %eax, 0xc(%rdi)
callq 0x54f4
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: addChunk_iCCP(ucvector*, LodePNGInfo const*, LodePNGCompressSettings*)
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 0x100(%rsi), %rax
movq $-0x1, %rbx
cmpb $0x0, 0x1(%rax,%rbx)
leaq 0x1(%rbx), %rbx
jne 0xc3c4
leaq -0x50(%rbx), %rax
movl $0x59, %ebp
cmpq $-0x4f, %rax
jb 0xc42d
movq 0x108(%r14), %rdx
movl 0x110(%r14), %ecx
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0xd394
testl %eax, %eax
jne 0xc421
movq (%rsp), %rax
leaq (%rax,%rbx), %rdx
addq $0x2, %rdx
leaq 0x684a3(%rip), %rcx     # 0x748b3
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0xebd0
testl %eax, %eax
je 0xc43a
movl %eax, %ebp
movq 0x8(%rsp), %rdi
callq 0x22a0
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %r15
leaq 0x8(%r15), %rdi
movq 0x100(%r14), %rsi
movq %rbx, %rdx
callq 0x21e0
movw $0x0, 0x8(%r15,%rbx)
movq (%rsp), %rdx
testq %rdx, %rdx
je 0xc475
movq 0x8(%rsp), %rsi
leaq (%r15,%rbx), %rdi
addq $0xa, %rdi
callq 0x21e0
movq %r15, %rdi
callq 0x54f4
xorl %ebp, %ebp
jmp 0xc423
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: addChunk_gAMA(ucvector*, LodePNGInfo const*)
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 0x68413(%rip), %rcx     # 0x748a4
movq %rsp, %rdi
movl $0x4, %edx
callq 0xebd0
movl %eax, %ebp
testl %eax, %eax
jne 0xc4b8
movq (%rsp), %rdi
movl 0xcc(%rbx), %eax
bswapl %eax
movl %eax, 0x8(%rdi)
callq 0x54f4
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: addChunk_cHRM(ucvector*, LodePNGInfo const*)
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 0x683d8(%rip), %rcx     # 0x748a9
movq %rsp, %rdi
movl $0x20, %edx
callq 0xebd0
movl %eax, %ebp
testl %eax, %eax
jne 0xc545
movq (%rsp), %rdi
movl 0xd4(%rbx), %eax
bswapl %eax
movl %eax, 0x8(%rdi)
movl 0xd8(%rbx), %eax
bswapl %eax
movl %eax, 0xc(%rdi)
movl 0xdc(%rbx), %eax
bswapl %eax
movl %eax, 0x10(%rdi)
movl 0xe0(%rbx), %eax
bswapl %eax
movl %eax, 0x14(%rdi)
movl 0xe4(%rbx), %eax
bswapl %eax
movl %eax, 0x18(%rdi)
movl 0xe8(%rbx), %eax
bswapl %eax
movl %eax, 0x1c(%rdi)
movl 0xec(%rbx), %eax
bswapl %eax
movl %eax, 0x20(%rdi)
movl 0xf0(%rbx), %eax
bswapl %eax
movl %eax, 0x24(%rdi)
callq 0x54f4
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: addChunk_PLTE(ucvector*, LodePNGColorMode const*)
static unsigned addChunk_PLTE(ucvector* out, const LodePNGColorMode* info) {
  unsigned char* chunk;
  size_t i, j = 8;

  if(info->palettesize == 0 || info->palettesize > 256) {
    return 68; /*invalid palette size, it is only allowed to be 1-256*/
  }

  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 0x10(%rsi), %rcx
leaq -0x101(%rcx), %rdx
movl $0x44, %eax
cmpq $-0x100, %rdx
jb 0xc7f0
movq %rdi, %rsi
leaq (%rcx,%rcx,2), %rdx
leaq 0x680df(%rip), %rcx     # 0x7487c
leaq 0x8(%rsp), %rdi
callq 0xebd0
testl %eax, %eax
jne 0xc7f0
cmpq $0x0, 0x10(%rbx)
movq 0x8(%rsp), %rdi
je 0xc7e9
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 0xc7bd
callq 0x54f4
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: addChunk_tRNS(ucvector*, LodePNGColorMode const*)
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 0xc8a6
cmpl $0x2, %eax
je 0xc850
cmpl $0x3, %eax
jne 0xc918
movq 0x10(%r14), %r15
testq %r15, %r15
je 0xc918
movq 0x8(%r14), %rax
cmpb $-0x1, -0x1(%rax,%r15,4)
jne 0xc8dc
decq %r15
jne 0xc83a
jmp 0xc918
cmpl $0x0, 0x18(%r14)
je 0xc918
leaq 0x6801f(%rip), %rcx     # 0x74881
leaq 0x8(%rsp), %rdi
movl $0x6, %edx
callq 0xebd0
testl %eax, %eax
jne 0xc8f4
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 0xc913
cmpl $0x0, 0x18(%r14)
je 0xc918
leaq 0x67fcd(%rip), %rcx     # 0x74881
leaq 0x8(%rsp), %rdi
movl $0x2, %edx
callq 0xebd0
testl %eax, %eax
jne 0xc8f4
movb 0x1d(%r14), %al
movq 0x8(%rsp), %rdi
movb %al, 0x8(%rdi)
movb 0x1c(%r14), %al
movb %al, 0x9(%rdi)
jmp 0xc913
leaq 0x67f9e(%rip), %rcx     # 0x74881
leaq 0x8(%rsp), %rdi
movq %r15, %rdx
callq 0xebd0
testl %eax, %eax
je 0xc8f8
movl %eax, %ebx
jmp 0xc918
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 0xc8ff
callq 0x54f4
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: addChunk_bKGD(ucvector*, LodePNGInfo const*)
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 0xc9f5
movq %rdi, %rsi
leaq 0x65970(%rip), %rcx     # 0x722bc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x67f2a(%rip), %rcx     # 0x74886
movq %rsp, %rdi
movl $0x2, %edx
callq 0xebd0
testl %eax, %eax
jne 0xc9e1
movb 0x3d(%r14), %al
movq (%rsp), %rdi
movb %al, 0x8(%rdi)
movb 0x3c(%r14), %al
movb %al, 0x9(%rdi)
jmp 0xc9f0
leaq 0x67efe(%rip), %rcx     # 0x74886
movq %rsp, %rdi
movl $0x6, %edx
callq 0xebd0
testl %eax, %eax
jne 0xc9e1
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 0xc9f0
leaq 0x67eb6(%rip), %rcx     # 0x74886
movq %rsp, %rdi
movl $0x1, %edx
callq 0xebd0
testl %eax, %eax
je 0xc9e5
movl %eax, %ebx
jmp 0xc9f5
movb 0x3c(%r14), %al
movq (%rsp), %rdi
movb %al, 0x8(%rdi)
callq 0x54f4
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: addChunk_pHYs(ucvector*, LodePNGInfo const*)
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 0x67e90(%rip), %rcx     # 0x7489f
movq %rsp, %rdi
movl $0x9, %edx
callq 0xebd0
movl %eax, %ebp
testl %eax, %eax
jne 0xca4a
movq (%rsp), %rdi
movl 0xbc(%rbx), %eax
bswapl %eax
movl %eax, 0x8(%rdi)
movl 0xc0(%rbx), %eax
bswapl %eax
movl %eax, 0xc(%rdi)
movb 0xc4(%rbx), %al
movb %al, 0x10(%rdi)
callq 0x54f4
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: addChunk_IDAT(ucvector*, unsigned char const*, unsigned long, LodePNGCompressSettings*)
static unsigned addChunk_IDAT(ucvector* out, const unsigned char* data, size_t datasize,
                              LodePNGCompressSettings* zlibsettings) {
  unsigned error = 0;
  unsigned char* zlib = 0;
  size_t pos = 0;
  size_t zlibsize = 0;
  /* max chunk length allowed by the specification is 2147483647 bytes */
  const size_t max_chunk_length = 2147483647u;

  error = zlib_compress(&zlib, &zlibsize, data, datasize, zlibsettings);
  while(!error) {
    if(zlibsize - pos > max_chunk_length) {
      error = lodepng_chunk_createv(out, max_chunk_length, "IDAT", zlib + pos);
      pos += max_chunk_length;
    } else {
      error = lodepng_chunk_createv(out, zlibsize - pos, "IDAT", zlib + pos);
      break;
    }
  }
  lodepng_free(zlib);
  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r8
movq %rdx, %rcx
movq %rsi, %rdx
movq %rdi, %rbx
xorl %eax, %eax
movq %rsp, %rdi
movq %rax, (%rdi)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
callq 0xd394
testl %eax, %eax
jne 0xcadf
xorl %r15d, %r15d
leaq 0x69238(%rip), %r14     # 0x75cc6
xorl %r12d, %r12d
movq 0x8(%rsp), %rsi
addq %r15, %rsi
movq %rsi, %rax
shrq $0x1f, %rax
movq (%rsp), %rcx
addq %r12, %rcx
testq %rax, %rax
je 0xcad0
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq %rbx, %rdi
movq %r14, %rdx
callq 0x5810
addq $0x7fffffff, %r12       # imm = 0x7FFFFFFF
addq $-0x7fffffff, %r15      # imm = 0x80000001
testl %eax, %eax
je 0xca91
jmp 0xcadf
leaq 0x691ef(%rip), %rdx     # 0x75cc6
movq %rbx, %rdi
callq 0x5810
movl %eax, %ebp
movq (%rsp), %rdi
callq 0x22a0
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: addChunk_tIME(ucvector*, LodePNGTime const*)
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 0x67d91(%rip), %rcx     # 0x7489a
movq %rsp, %rdi
movl $0x7, %edx
callq 0xebd0
movl %eax, %ebp
testl %eax, %eax
jne 0xcb4e
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 0x54f4
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: addChunk_zTXt(ucvector*, char const*, char const*, LodePNGCompressSettings*)
static unsigned addChunk_zTXt(ucvector* out, const char* keyword, const char* textstring,
                              LodePNGCompressSettings* zlibsettings) {
  unsigned error = 0;
  unsigned char* chunk = 0;
  unsigned char* compressed = 0;
  size_t compressedsize = 0;
  size_t textsize = lodepng_strlen(textstring);
  size_t keysize = lodepng_strlen(keyword);
  if(keysize < 1 || keysize > 79) return 89; /*error: invalid keyword size*/

  error = zlib_compress(&compressed, &compressedsize,
                        (const unsigned char*)textstring, textsize, zlibsettings);
  if(!error) {
    size_t size = keysize + 2 + compressedsize;
    error = lodepng_chunk_init(&chunk, out, size, "zTXt");
  }
  if(!error) {
    lodepng_memcpy(chunk + 8, keyword, 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 %rcx, %r8
movq %rsi, %rbx
movq %rdi, %r15
xorl %eax, %eax
movq %rax, 0x10(%rsp)
movq %rax, 0x8(%rsp)
movq %rax, (%rsp)
movq $-0x1, %rcx
cmpb $0x0, 0x1(%rdx,%rcx)
leaq 0x1(%rcx), %rcx
jne 0xcb81
movq $-0x1, %r14
cmpb $0x0, 0x1(%rbx,%r14)
leaq 0x1(%r14), %r14
jne 0xcb93
leaq -0x50(%r14), %rax
movl $0x59, %ebp
cmpq $-0x4f, %rax
jb 0xcbef
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0xd394
testl %eax, %eax
jne 0xcbe3
movq (%rsp), %rax
leaq (%rax,%r14), %rdx
addq $0x2, %rdx
leaq 0x67cbe(%rip), %rcx     # 0x74890
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0xebd0
testl %eax, %eax
je 0xcbfc
movl %eax, %ebp
movq 0x8(%rsp), %rdi
callq 0x22a0
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %r15
leaq 0x8(%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x21e0
movw $0x0, 0x8(%r15,%r14)
movq (%rsp), %rdx
testq %rdx, %rdx
je 0xcc33
movq 0x8(%rsp), %rsi
leaq (%r15,%r14), %rdi
addq $0xa, %rdi
callq 0x21e0
movq %r15, %rdi
callq 0x54f4
xorl %ebp, %ebp
jmp 0xcbe5
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: addChunk_tEXt(ucvector*, char const*, char const*)
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, %r15
movq %rdi, %rsi
movq $0x0, 0x8(%rsp)
movq $-0x1, %r14
cmpb $0x0, 0x1(%r15,%r14)
leaq 0x1(%r14), %r14
jne 0xcc65
movq $-0x1, %r12
movq %r14, %rdx
incq %rdx
cmpb $0x0, 0x1(%rbx,%r12)
leaq 0x1(%r12), %r12
jne 0xcc7b
leaq -0x50(%r14), %rcx
movl $0x59, %eax
cmpq $-0x4f, %rcx
jb 0xcceb
leaq 0x67bea(%rip), %rcx     # 0x7488b
leaq 0x8(%rsp), %rdi
callq 0xebd0
testl %eax, %eax
jne 0xcceb
movq 0x8(%rsp), %r13
leaq 0x8(%r13), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x21e0
movb $0x0, 0x8(%r13,%r14)
testq %r12, %r12
je 0xcce1
leaq (%r14,%r13), %rdi
addq $0x9, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x21e0
movq %r13, %rdi
callq 0x54f4
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: lodepng::load_file(std::vector<unsigned char, std::allocator<unsigned char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
unsigned load_file(std::vector<unsigned char>& buffer, const std::string& filename) {
  unsigned error;
  FILE* file = fopen(filename.c_str(), "rb");
  if(!file) return 78;
  error = load_file_(buffer, file);
  fclose(file);
  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq (%rsi), %rdi
leaq 0x6771f(%rip), %rsi     # 0x74871
callq 0x2290
testq %rax, %rax
je 0xd1b0
movq %rax, %rbx
movq %rax, %rdi
callq 0xdb12
testq %rax, %rax
js 0xd1b7
movq %rax, %r15
xorl %ebp, %ebp
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x1078a
testq %r15, %r15
je 0xd1bc
movq (%r14), %rdi
movq 0x8(%r14), %rdx
subq %rdi, %rdx
movl $0x1, %esi
movq %rbx, %rcx
callq 0x22e0
movq 0x8(%r14), %rcx
subq (%r14), %rcx
xorl %edx, %edx
cmpq %rcx, %rax
movl $0x4e, %ebp
cmovel %edx, %ebp
jmp 0xd1bc
movl $0x4e, %ebp
jmp 0xd1c4
movl $0x4e, %ebp
movq %rbx, %rdi
callq 0x2230
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: lodepng::decompress(std::vector<unsigned char, std::allocator<unsigned char>>&, unsigned char const*, unsigned long, LodePNGDecompressSettings const&)
unsigned decompress(std::vector<unsigned char>& out, const unsigned char* in, size_t insize,
                    const LodePNGDecompressSettings& settings) {
  unsigned char* buffer = 0;
  size_t buffersize = 0;
  unsigned error = zlib_decompress(&buffer, &buffersize, 0, in, insize, &settings);
  if(buffer) {
    out.insert(out.end(), buffer, &buffer[buffersize]);
    lodepng_free(buffer);
  }
  return error;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r9
movq %rdx, %r8
movq %rsi, %rcx
movq %rdi, %rbx
xorl %eax, %eax
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movq %rsp, %rsi
movq %rax, (%rsi)
movq %r14, %rdi
xorl %edx, %edx
callq 0xd24c
movl %eax, %ebp
movq (%r14), %rdx
testq %rdx, %rdx
je 0xd241
movq 0x8(%rbx), %rsi
movq (%rsp), %rcx
addq %rdx, %rcx
movq %rbx, %rdi
callq 0x109ac
movq 0x8(%rsp), %rdi
callq 0x22a0
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: zlib_decompress(unsigned char**, unsigned long*, unsigned long, unsigned char const*, unsigned long, LodePNGDecompressSettings const*)
static unsigned zlib_decompress(unsigned char** out, size_t* outsize, size_t expected_size,
                                const unsigned char* in, size_t insize, const LodePNGDecompressSettings* settings) {
  unsigned error;
  if(settings->custom_zlib) {
    error = settings->custom_zlib(out, outsize, in, insize, settings);
    if(error) {
      /*the custom zlib is allowed to have its own error codes, however, we translate it to code 110*/
      error = 110;
      /*if there's a max output size, and the custom zlib returned error, then indicate that error instead*/
      if(settings->max_output_size && *outsize > settings->max_output_size) error = 109;
    }
  } else {
    ucvector v = ucvector_init(*out, *outsize);
    if(expected_size) {
      /*reserve the memory to avoid intermediate reallocations*/
      ucvector_resize(&v, *outsize + expected_size);
      v.size = *outsize;
    }
    error = lodepng_zlib_decompressv(&v, in, insize, settings);
    *out = v.data;
    *outsize = v.size;
  }
  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r14
movq %r8, %r12
movq %rcx, %r13
movq %rsi, %rbx
movq %rdi, %r15
movq 0x10(%r9), %rax
testq %rax, %rax
je 0xd29d
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq %r14, %r8
callq *%rax
testl %eax, %eax
je 0xd306
movq 0x8(%r14), %rax
testq %rax, %rax
je 0xd30a
cmpq (%rbx), %rax
movl $0x6e, %eax
sbbl $0x0, %eax
jmp 0xd30f
movq (%r15), %rdi
movq (%rbx), %rbp
movq %rdi, (%rsp)
movq %rbp, 0x8(%rsp)
movq %rbp, 0x10(%rsp)
testq %rdx, %rdx
je 0xd2e2
addq %rbp, %rdx
cmpq %rdx, %rbp
jae 0xd2da
shrq %rbp
addq %rdx, %rbp
movq %rbp, %rsi
callq 0x2360
testq %rax, %rax
je 0xd2da
movq %rbp, 0x10(%rsp)
movq %rax, (%rsp)
movq (%rbx), %rax
movq %rax, 0x8(%rsp)
movq %rsp, %rbp
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x5005
movq (%rbp), %rcx
movq %rcx, (%r15)
movq 0x8(%rbp), %rcx
movq %rcx, (%rbx)
jmp 0xd30f
xorl %eax, %eax
jmp 0xd30f
movl $0x6e, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: lodepng::compress(std::vector<unsigned char, std::allocator<unsigned char>>&, unsigned char const*, unsigned long, LodePNGCompressSettings const&)
unsigned compress(std::vector<unsigned char>& out, const unsigned char* in, size_t insize,
                  const LodePNGCompressSettings& settings) {
  unsigned char* buffer = 0;
  size_t buffersize = 0;
  unsigned error = zlib_compress(&buffer, &buffersize, in, insize, &settings);
  if(buffer) {
    out.insert(out.end(), buffer, &buffer[buffersize]);
    lodepng_free(buffer);
  }
  return error;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r8
movq %rdx, %rcx
movq %rsi, %rdx
movq %rdi, %rbx
xorl %eax, %eax
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movq %rsp, %rsi
movq %rax, (%rsi)
movq %r14, %rdi
callq 0xd394
movl %eax, %ebp
movq (%r14), %rdx
testq %rdx, %rdx
je 0xd389
movq 0x8(%rbx), %rsi
movq (%rsp), %rcx
addq %rdx, %rcx
movq %rbx, %rdi
callq 0x109ac
movq 0x8(%rsp), %rdi
callq 0x22a0
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: lodepng_filesize(_IO_FILE*)
static long lodepng_filesize(FILE* file) {
  long size;
  if(fseek(file, 0, SEEK_END) != 0) return -1;
  size = ftell(file);
  /* It may give LONG_MAX as directory size, this is invalid for us. */
  if(size == LONG_MAX) return -1;
  if(fseek(file, 0, SEEK_SET) != 0) return -1;
  return size;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
xorl %esi, %esi
movl $0x2, %edx
callq 0x2270
movq $-0x1, %rbx
testl %eax, %eax
jne 0xdb61
movq %r14, %rdi
callq 0x2030
movq %rax, %r15
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rax, %r15
je 0xdb61
xorl %ebx, %ebx
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2270
negl %eax
sbbq %rbx, %rbx
orq %r15, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: ucvector_reserve(ucvector*, unsigned long)
static unsigned ucvector_reserve(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*/
  }
  return 1; /*success*/
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x10(%rdi), %r15
movl $0x1, %ebx
cmpq %rsi, %r15
jae 0xdba1
movq %rdi, %r14
shrq %r15
addq %rsi, %r15
movq (%rdi), %rdi
movq %r15, %rsi
callq 0x2360
testq %rax, %rax
je 0xdb9f
movq %r15, 0x10(%r14)
movq %rax, (%r14)
jmp 0xdba1
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: huffmanDecodeSymbol(LodePNGBitReader*, HuffmanTree const*)
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 {
    advanceBits(reader, FIRSTBITS);
    value += peekBits(reader, l - FIRSTBITS);
    advanceBits(reader, codetree->table_len[value] - FIRSTBITS);
    return codetree->table_value[value];
  }
}

// Assembly:
movl 0x20(%rdi), %eax
movl %eax, %r8d
andl $0x1ff, %r8d            # imm = 0x1FF
movzbl (%rsi,%r8), %ecx
movl %r8d, %r8d
movzwl (%rdx,%r8,2), %r8d
cmpq $0x9, %rcx
ja 0xdbd4
shrl %cl, %eax
movl %eax, 0x20(%rdi)
addq %rcx, 0x18(%rdi)
jmp 0xdc24
shrl $0x9, %eax
movl %eax, 0x20(%rdi)
movq 0x18(%rdi), %r9
leaq 0x9(%r9), %r10
movq %r10, 0x18(%rdi)
addb $-0x9, %cl
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
shll %cl, %r10d
notl %r10d
andl %eax, %r10d
addl %r10d, %r8d
movzwl %r8w, %r8d
movzbl (%rsi,%r8), %esi
movl $0xfffffff7, %ecx       # imm = 0xFFFFFFF7
addq %rsi, %rcx
movl %ecx, %esi
shrl %cl, %eax
movl %eax, 0x20(%rdi)
leaq (%rsi,%r9), %rax
addq $0x9, %rax
movq %rax, 0x18(%rdi)
movzwl (%rdx,%r8,2), %r8d
movzwl %r8w, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: writeLZ77data(LodePNGBitWriter*, uivector const*, HuffmanTree const*, HuffmanTree const*)
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)
cmpq $0x0, 0x8(%rsi)
je 0xea2b
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebx, %ebx
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 0xea3a
cmpq $0x101, %r13            # imm = 0x101
jb 0xea1e
addl $0xfffffeff, %r13d      # imm = 0xFFFFFEFF
leaq 0x65a53(%rip), %rax     # 0x74410
movl (%rax,%r13,4), %edx
movq (%r15), %rax
movl 0x4(%rax,%rbx,4), %esi
movq %r14, %r13
movl 0x8(%rax,%rbx,4), %r14d
leaq 0x65b39(%rip), %rcx     # 0x74510
movl (%rcx,%r14,4), %ecx
movq %rcx, 0x10(%rsp)
movl 0xc(%rax,%rbx,4), %ebp
addq $0x3, %rbx
movq %r12, %rdi
callq 0xe221
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 0xea3a
movq %r12, %rdi
movl %ebp, %esi
movq 0x10(%rsp), %rdx
callq 0xe221
incq %rbx
cmpq 0x8(%r15), %rbx
jne 0xe988
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng.cpp
// Function: uivector_resize(uivector*, unsigned long)
static unsigned uivector_resize(uivector* p, size_t size) {
  size_t allocsize = size * sizeof(unsigned);
  if(allocsize > p->allocsize) {
    size_t newsize = allocsize + (p->allocsize >> 1u);
    void* data = lodepng_realloc(p->data, newsize);
    if(data) {
      p->allocsize = newsize;
      p->data = (unsigned*)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
leaq (,%rsi,4), %rax
movq 0x10(%rdi), %r15
cmpq %r15, %rax
jbe 0xeb30
shrq %r15
addq %rax, %r15
movq (%r14), %rdi
movq %r15, %rsi
callq 0x2360
testq %rax, %rax
je 0xeb3f
movq %r15, 0x10(%r14)
movq %rax, (%r14)
movq %rbx, 0x8(%r14)
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
xorl %eax, %eax
jmp 0xeb39