LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: readChunk_PLTE
static unsigned readChunk_PLTE(LodePNGColorMode* color, const unsigned char* data, size_t chunkLength) {
  unsigned pos = 0, i;
  color->palettesize = chunkLength / 3u;
  if(color->palettesize == 0 || color->palettesize > 256) return 38; /*error: palette too small or big*/
  lodepng_color_mode_alloc_palette(color);
  if(!color->palette && color->palettesize) {
    color->palettesize = 0;
    return 83; /*alloc fail*/
  }

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

  return 0; /* OK */
}

// Assembly:
movq %rdx, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
movq %rcx, %rax
mulq %rdx
shrq %rdx
movq %rdx, 0x10(%rdi)
addq $-0x303, %rcx           # imm = 0xFCFD
movl $0x26, %eax
cmpq $-0x300, %rcx           # imm = 0xFD00
jb 0x8678
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x584b
cmpq $0x0, 0x8(%rbx)
je 0x865d
xorl %eax, %eax
cmpq $0x0, 0x10(%rbx)
je 0x8671
movl $0x3, %ecx
movl $0x1, %edx
movl $0x1, %esi
leal -0x1(%rdx), %edi
movb (%r14,%rdi), %dil
movq 0x8(%rbx), %r8
leal -0x3(%rcx), %r9d
movb %dil, (%r8,%r9)
leal 0x1(%rdx), %edi
movl %edx, %r8d
movb (%r14,%r8), %r8b
movq 0x8(%rbx), %r9
leal -0x2(%rcx), %r10d
movb %r8b, (%r9,%r10)
movb (%r14,%rdi), %dil
movq 0x8(%rbx), %r8
leal -0x1(%rcx), %r9d
movb %dil, (%r8,%r9)
movq 0x8(%rbx), %rdi
movl %ecx, %r8d
movb $-0x1, (%rdi,%r8)
movl %esi, %edi
incl %esi
addl $0x4, %ecx
addl $0x3, %edx
cmpq %rdi, 0x10(%rbx)
jne 0x8606
jmp 0x8671
cmpq $0x0, 0x10(%rbx)
je 0x85ee
movq $0x0, 0x10(%rbx)
movl $0x53, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x87c0
leaq 0x9acc(%rip), %r8       # 0x12218
movslq (%r8,%rcx,4), %rcx
addq %r8, %rcx
jmpq *%rcx
movl $0x2c, %eax
cmpq $0x2, %rdx
jne 0x87c0
movl $0x1, 0x38(%rdi)
movzwl (%rsi), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl %eax, 0x44(%rdi)
movl %eax, 0x40(%rdi)
movl $0x3c, %ecx
jmp 0x87bb
movl $0x2d, %eax
cmpq $0x6, %rdx
jne 0x87c0
movl $0x1, 0x38(%rdi)
movzwl (%rsi), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl %eax, 0x3c(%rdi)
movzwl 0x2(%rsi), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl %eax, 0x40(%rdi)
movzwl 0x4(%rsi), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl $0x44, %ecx
movl %eax, (%rdi,%rcx)
xorl %eax, %eax
retq
movl $0x2b, %eax
cmpq $0x1, %rdx
jne 0x87c0
movzbl (%rsi), %ecx
movl $0x67, %eax
cmpq %rcx, 0x20(%rdi)
jbe 0x87c0
movl $0x1, 0x38(%rdi)
movzbl (%rsi), %eax
jmp 0x8771
// File: /workspace/github_c_makefile_star2_O1/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
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %r15
testq %rdx, %rdx
je 0x8818
xorl %ebx, %ebx
xorl %r13d, %r13d
cmpb $0x0, (%r15,%rbx)
je 0x881d
incl %r13d
movq %r13, %rbx
cmpq %r14, %r13
jb 0x8804
jmp 0x881d
xorl %r13d, %r13d
xorl %ebx, %ebx
leal -0x50(%r13), %eax
cmpl $-0x4f, %eax
jae 0x8830
movl $0x59, %ebp
jmp 0x88d3
movq %rdi, 0x8(%rsp)
leal 0x1(%r13), %edi
movq %rdi, 0x10(%rsp)
callq 0x1140
movl $0x53, %ebp
testq %rax, %rax
je 0x88d3
movq %rax, %r12
testl %r13d, %r13d
je 0x8867
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x1130
movb $0x0, (%r12,%rbx)
xorl %eax, %eax
movq 0x10(%rsp), %rbx
subq %rbx, %r14
cmovbq %rax, %r14
leal 0x1(%r14), %edi
callq 0x1140
testq %rax, %rax
je 0x88d6
movq %rax, %r13
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
andq %rax, %r14
je 0x88a6
addq %rbx, %r15
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1130
movb $0x0, (%r13,%r14)
movq $-0x1, %rcx
cmpb $0x0, 0x1(%r13,%rcx)
leaq 0x1(%rcx), %rcx
jne 0x88b3
movq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x59b7
movl %eax, %ebp
jmp 0x88d9
xorl %r12d, %r12d
xorl %r13d, %r13d
movq %r12, %rdi
callq 0x1030
movq %r13, %rdi
callq 0x1030
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: readChunk_zTXt
static unsigned readChunk_zTXt(LodePNGInfo* info, const LodePNGDecompressSettings* zlibsettings,
                               const unsigned char* data, size_t chunkLength) {
  unsigned error = 0;

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

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

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

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

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

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

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

    break;
  }

  lodepng_free(key);
  lodepng_free(str);

  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r14
movq %rdx, %r12
xorl %ebx, %ebx
movq %rbx, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movl $0x0, %ebp
testq %rcx, %rcx
je 0x8939
xorl %ebp, %ebp
xorl %ebx, %ebx
cmpb $0x0, (%r12,%rbp)
je 0x8939
incl %ebx
movq %rbx, %rbp
cmpq %r14, %rbx
jb 0x8928
leal 0x2(%rbx), %r13d
movl $0x4b, %r15d
cmpq %r14, %r13
jae 0x89a6
leal -0x50(%rbx), %eax
cmpl $-0x4f, %eax
jae 0x8958
movl $0x59, %r15d
jmp 0x89a6
movq %rsi, 0x20(%rsp)
movq %rdi, 0x18(%rsp)
movl %ebx, %r15d
incq %r15
movq %r15, %rdi
callq 0x1140
testq %rax, %rax
je 0x89a0
movq %rax, %rdi
testl %ebx, %ebx
je 0x898d
movq %rdi, %rbx
movq %r12, %rsi
movq %rbp, %rdx
callq 0x1130
movq %rbx, %rdi
movb $0x0, (%rdi,%rbp)
cmpb $0x0, (%r12,%r15)
je 0x89c9
movl $0x48, %r15d
jmp 0x89a8
movl $0x53, %r15d
xorl %edi, %edi
callq 0x1030
movq 0x8(%rsp), %rdi
callq 0x1030
movl %r15d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq %r14, %r13
jbe 0x89d6
movl $0x4b, %r15d
jmp 0x89a8
movq %rdi, %rbx
subl %r13d, %r14d
addq %r13, %r12
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
xorl %edx, %edx
movq %r12, %rcx
movq %r14, %r8
movq 0x20(%rsp), %r9
callq 0xd574
testl %eax, %eax
je 0x8a07
movl %eax, %r15d
movq %rbx, %rdi
jmp 0x89a8
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x59b7
movq %rbx, %rdi
movl %eax, %r15d
jmp 0x89a8
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: readChunk_cHRM
static unsigned readChunk_cHRM(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) {
  if(chunkLength != 32) return 97; /*invalid cHRM chunk size*/

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

  return 0; /* OK */
}

// Assembly:
movl $0x61, %eax
cmpq $0x20, %rdx
jne 0x8da8
movl $0x1, 0xbc(%rdi)
movl (%rsi), %eax
bswapl %eax
movl %eax, 0xc0(%rdi)
movl 0x4(%rsi), %eax
bswapl %eax
movl %eax, 0xc4(%rdi)
movl 0x8(%rsi), %eax
bswapl %eax
movl %eax, 0xc8(%rdi)
movl 0xc(%rsi), %eax
bswapl %eax
movl %eax, 0xcc(%rdi)
movl 0x10(%rsi), %eax
bswapl %eax
movl %eax, 0xd0(%rdi)
movl 0x14(%rsi), %eax
bswapl %eax
movl %eax, 0xd4(%rdi)
movl 0x18(%rsi), %eax
bswapl %eax
movl %eax, 0xd8(%rdi)
movl 0x1c(%rsi), %eax
bswapl %eax
movl %eax, 0xdc(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 $0x28, %rsp
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %rbp
movq %rdi, %rbx
movq $0x0, 0x20(%rsp)
movl $0x1, 0xe8(%rdi)
movq 0xf0(%rdi), %rdi
testq %rdi, %rdi
je 0x8e12
callq 0x1030
xorl %r15d, %r15d
movq %r15, 0xf0(%rbx)
movq 0xf8(%rbx), %rdi
callq 0x1030
movq %r15, 0xf8(%rbx)
movl %r15d, 0x100(%rbx)
movl %r15d, 0xe8(%rbx)
testq %r14, %r14
je 0x8e31
xorl %r13d, %r13d
xorl %r15d, %r15d
cmpb $0x0, (%r12,%r13)
je 0x8e37
incl %r15d
movq %r15, %r13
cmpq %r14, %r15
jb 0x8e1d
jmp 0x8e37
xorl %r15d, %r15d
xorl %r13d, %r13d
leal 0x2(%r15), %edx
movl $0x4b, %eax
cmpq %r14, %rdx
jae 0x8f15
leal -0x50(%r15), %ecx
movl $0x59, %eax
cmpl $-0x4f, %ecx
jb 0x8f15
movq %rdx, 0x10(%rsp)
movq %rbp, 0x18(%rsp)
movl %r15d, %ebp
leaq 0x1(%rbp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x1140
movq %rax, 0xf0(%rbx)
testq %rax, %rax
je 0x8f10
movb $0x0, (%rax,%r13)
testl %r15d, %r15d
je 0x8ea8
xorl %eax, %eax
movb (%r12,%rax), %cl
movq 0xf0(%rbx), %rdx
movb %cl, (%rdx,%rax)
incq %rax
cmpq %rax, %rbp
jne 0x8e92
movl $0x48, %eax
movq 0x8(%rsp), %rcx
cmpb $0x0, (%r12,%rcx)
movq 0x18(%rsp), %r9
movq 0x10(%rsp), %rcx
jne 0x8f15
movl $0x4b, %eax
cmpq %r14, %rcx
ja 0x8f15
subl %ecx, %r14d
leaq 0xf8(%rbx), %rdi
addq %rcx, %r12
xorl %r15d, %r15d
leaq 0x20(%rsp), %r13
movq %r13, %rsi
xorl %edx, %edx
movq %r12, %rcx
movq %r14, %r8
callq 0xd574
movl (%r13), %ecx
movl %ecx, 0x100(%rbx)
testl %eax, %eax
jne 0x8f15
testl %ecx, %ecx
movl $0x64, %eax
cmovel %eax, %r15d
movl %r15d, %eax
jmp 0x8f15
movl $0x53, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 $0x18, %rsp
movl %r9d, %ebp
movl %r8d, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %eax, %eax
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
movq %rax, (%r12)
movl %eax, (%rdx)
movl %eax, (%rsi)
leaq 0x10(%rsp), %rsi
movq %rcx, %rdx
callq 0x2ac0
movl %eax, %r13d
testl %eax, %eax
jne 0xa1c2
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %r8
movl %ebp, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %r9d
callq 0x9ea2
movl %eax, %r13d
movq 0x8(%rsp), %rdi
callq 0x1030
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: lodepng_color_stats_add
static unsigned lodepng_color_stats_add(LodePNGColorStats* stats,
                                        unsigned r, unsigned g, unsigned b, unsigned a) {
  unsigned error = 0;
  unsigned char image[8];
  LodePNGColorMode mode;
  lodepng_color_mode_init(&mode);
  image[0] = r >> 8; image[1] = r; image[2] = g >> 8; image[3] = g;
  image[4] = b >> 8; image[5] = b; image[6] = a >> 8; image[7] = a;
  mode.bitdepth = 16;
  mode.colortype = LCT_RGBA;
  error = lodepng_compute_color_stats(stats, image, 1, 1, &mode);
  lodepng_color_mode_cleanup(&mode);
  return error;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movl %esi, %eax
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r15
movups %xmm0, 0x10(%r15)
movabsq $0x1000000006, %rsi     # imm = 0x1000000006
movq %rsi, -0x8(%r15)
movups %xmm0, (%r15)
movb %ah, (%rsp)
movq %rsp, %rsi
movb %al, 0x1(%rsi)
movb %dh, 0x2(%rsp)
movb %dl, 0x3(%rsi)
movb %ch, 0x4(%rsp)
movb %cl, 0x5(%rsi)
movw $0xffff, 0x6(%rsi)      # imm = 0xFFFF
leaq 0x8(%rsp), %r14
movl $0x1, %edx
movl $0x1, %ecx
movq %r14, %r8
callq 0x7592
movl %eax, %ebx
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0xaef3
callq 0x1030
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: addChunk_IHDR
static unsigned addChunk_IHDR(ucvector* out, unsigned w, unsigned h,
                              LodePNGColorType colortype, unsigned bitdepth, unsigned interlace_method) {
  unsigned char *chunk, *data;
  CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 13, "IHDR"));
  data = chunk + 8;

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

  lodepng_chunk_generate_crc(chunk);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %r9d, %r15d
movl %r8d, %r14d
movl %ecx, %ebp
movl %edx, %r12d
movl %esi, %ebx
movq %rdi, %rsi
leaq 0x74c1(%rip), %rcx      # 0x12b88
leaq 0x8(%rsp), %rdi
movl $0xd, %edx
callq 0xd3f7
testl %eax, %eax
jne 0xb729
movq 0x8(%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 %r12d, %ecx
movl %r12d, %eax
shrl $0x18, %eax
movb %al, 0xc(%rdi)
movl %r12d, %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 0x53c4
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: addUnknownChunks
static unsigned addUnknownChunks(ucvector* out, unsigned char* data, size_t datasize) {
  unsigned char* inchunk = data;
  while((size_t)(inchunk - data) < datasize) {
    CERROR_TRY_RETURN(lodepng_chunk_append(&out->data, &out->size, inchunk));
    out->allocsize = out->size; /*fix the allocsize again*/
    inchunk = lodepng_chunk_next(inchunk, data + datasize);
  }
  return 0;
}

// Assembly:
xorl %eax, %eax
testq %rdx, %rdx
je 0xb7aa
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r12
leaq 0x8(%rdi), %r13
leaq (%rsi,%rdx), %rax
movq %rax, (%rsp)
movq %rsi, %r15
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x55cf
testl %eax, %eax
cmovnel %eax, %ebp
jne 0xb79a
movq 0x8(%r12), %rax
movq %rax, 0x10(%r12)
movq %r15, %rdi
movq (%rsp), %rsi
callq 0x5405
movq %rax, %r15
subq %rbx, %rax
cmpq %r14, %rax
jb 0xb760
xorl %eax, %eax
jmp 0xb79c
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_O1/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: addChunk_iCCP
static unsigned addChunk_iCCP(ucvector* out, const LodePNGInfo* info, LodePNGCompressSettings* zlibsettings) {
  unsigned error = 0;
  unsigned char* chunk = 0;
  unsigned char* compressed = 0;
  size_t compressedsize = 0;
  size_t keysize = lodepng_strlen(info->iccp_name);

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

  lodepng_free(compressed);
  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r8
movq %rsi, %r14
movq %rdi, %r15
xorl %eax, %eax
movq %rax, 0x10(%rsp)
movq %rax, 0x8(%rsp)
movq %rax, (%rsp)
movq 0xf0(%rsi), %rax
movq $-0x1, %rbx
cmpb $0x0, 0x1(%rax,%rbx)
leaq 0x1(%rbx), %rbx
jne 0xb7dc
leaq -0x50(%rbx), %rax
movl $0x59, %ebp
cmpq $-0x4f, %rax
jb 0xb89d
movq 0xf8(%r14), %rdx
movl 0x100(%r14), %ecx
movq 0x18(%r8), %rax
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
testq %rax, %rax
je 0xb81d
callq *%rax
jmp 0xb822
callq 0x5071
movl %eax, %ebp
testl %eax, %eax
jne 0xb847
movl (%rsp), %eax
leal (%rax,%rbx), %edx
addl $0x2, %edx
leaq 0x738c(%rip), %rcx      # 0x12bc4
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0xd3f7
movl %eax, %ebp
testl %ebp, %ebp
jne 0xb893
movq 0x10(%rsp), %r15
testq %rbx, %rbx
je 0xb868
movq 0xf0(%r14), %rsi
leaq 0x8(%r15), %rdi
movq %rbx, %rdx
callq 0x1130
movw $0x0, 0x8(%r15,%rbx)
movq (%rsp), %rdx
testq %rdx, %rdx
je 0xb88b
movq 0x8(%rsp), %rsi
leaq (%r15,%rbx), %rdi
addq $0xa, %rdi
callq 0x1130
movq %r15, %rdi
callq 0x53c4
movq 0x8(%rsp), %rdi
callq 0x1030
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: addChunk_gAMA
static unsigned addChunk_gAMA(ucvector* out, const LodePNGInfo* info) {
  unsigned char* chunk;
  CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 4, "gAMA"));
  lodepng_set32bitInt(chunk + 8, info->gama_gamma);
  lodepng_chunk_generate_crc(chunk);
  return 0;
}

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

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

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

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

  lodepng_chunk_generate_crc(chunk);
  return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %rsi
movl 0x10(%rbx), %eax
leal (%rax,%rax,2), %edx
leaq 0x71fa(%rip), %rcx      # 0x12b8d
leaq 0x8(%rsp), %rdi
callq 0xd3f7
testl %eax, %eax
jne 0xb9eb
cmpq $0x0, 0x10(%rbx)
je 0xb9df
movq 0x8(%rsp), %rax
addq $0xa, %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 0xb9b3
movq 0x8(%rsp), %rdi
callq 0x53c4
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: addChunk_tRNS
static unsigned addChunk_tRNS(ucvector* out, const LodePNGColorMode* info) {
  unsigned char* chunk = 0;

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %rsi
movq $0x0, (%rsp)
movl (%rbx), %eax
testl %eax, %eax
je 0xbab7
cmpl $0x2, %eax
je 0xba6b
cmpl $0x3, %eax
jne 0xbb0c
movq 0x10(%rbx), %r14
testq %r14, %r14
je 0xba3b
movq 0x8(%rbx), %rax
cmpb $-0x1, -0x1(%rax,%r14,4)
jne 0xba3b
decq %r14
jne 0xba2b
xorl %r14d, %r14d
movb $0x1, %r15b
testq %r14, %r14
je 0xbad9
leaq 0x7144(%rip), %rcx      # 0x12b92
movq %rsp, %rdi
movl %r14d, %edx
callq 0xd3f7
movl %eax, %ebp
testl %eax, %eax
je 0xbaed
xorl %r15d, %r15d
jmp 0xbb07
cmpl $0x0, 0x18(%rbx)
je 0xbb0c
leaq 0x7116(%rip), %rcx      # 0x12b92
movq %rsp, %rdi
movl $0x6, %edx
callq 0xd3f7
testl %eax, %eax
jne 0xbad5
movb 0x1d(%rbx), %al
movq (%rsp), %rcx
movb %al, 0x8(%rcx)
movb 0x1c(%rbx), %al
movb %al, 0x9(%rcx)
movb 0x21(%rbx), %al
movb %al, 0xa(%rcx)
movb 0x20(%rbx), %al
movb %al, 0xb(%rcx)
movb 0x25(%rbx), %al
movb %al, 0xc(%rcx)
movb 0x24(%rbx), %al
movb %al, 0xd(%rcx)
jmp 0xbb0c
cmpl $0x0, 0x18(%rbx)
je 0xbb0c
leaq 0x70ce(%rip), %rcx      # 0x12b92
movq %rsp, %rdi
movl $0x2, %edx
callq 0xd3f7
testl %eax, %eax
je 0xbadb
movl %eax, %ebp
jmp 0xbb1c
jmp 0xbb07
movb 0x1d(%rbx), %al
movq (%rsp), %rcx
movb %al, 0x8(%rcx)
movb 0x1c(%rbx), %al
movb %al, 0x9(%rcx)
jmp 0xbb0c
movq (%rsp), %rax
xorl %ecx, %ecx
movq 0x8(%rbx), %rdx
movb 0x3(%rdx,%rcx,4), %dl
movb %dl, 0x8(%rax,%rcx)
incq %rcx
cmpq %rcx, %r14
jne 0xbaf3
testb %r15b, %r15b
je 0xbb1c
movq (%rsp), %rdi
xorl %ebp, %ebp
testq %rdi, %rdi
je 0xbb1c
callq 0x53c4
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: addChunk_bKGD
static unsigned addChunk_bKGD(ucvector* out, const LodePNGInfo* info) {
  unsigned char* chunk = 0;
  if(info->color.colortype == LCT_GREY || info->color.colortype == LCT_GREY_ALPHA) {
    CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 2, "bKGD"));
    chunk[8] = (unsigned char)(info->background_r >> 8);
    chunk[9] = (unsigned char)(info->background_r & 255);
  } else if(info->color.colortype == LCT_RGB || info->color.colortype == LCT_RGBA) {
    CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 6, "bKGD"));
    chunk[8] = (unsigned char)(info->background_r >> 8);
    chunk[9] = (unsigned char)(info->background_r & 255);
    chunk[10] = (unsigned char)(info->background_g >> 8);
    chunk[11] = (unsigned char)(info->background_g & 255);
    chunk[12] = (unsigned char)(info->background_b >> 8);
    chunk[13] = (unsigned char)(info->background_b & 255);
  } else if(info->color.colortype == LCT_PALETTE) {
    CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 1, "bKGD"));
    chunk[8] = (unsigned char)(info->background_r & 255); /*palette index*/
  }
  if(chunk) lodepng_chunk_generate_crc(chunk);
  return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq $0x0, (%rsp)
movl 0x10(%rsi), %eax
cmpq $0x6, %rax
ja 0xbbe9
movq %rdi, %rsi
leaq 0x66e6(%rip), %rcx      # 0x12234
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x7039(%rip), %rcx      # 0x12b97
movq %rsp, %rdi
movl $0x2, %edx
callq 0xd3f7
testl %eax, %eax
jne 0xbbdb
movb 0x3d(%rbx), %al
movq (%rsp), %rcx
movb %al, 0x8(%rcx)
movb 0x3c(%rbx), %al
movb %al, 0x9(%rcx)
jmp 0xbbe9
leaq 0x700f(%rip), %rcx      # 0x12b97
movq %rsp, %rdi
movl $0x6, %edx
callq 0xd3f7
testl %eax, %eax
jne 0xbbdb
movb 0x3d(%rbx), %al
movq (%rsp), %rcx
movb %al, 0x8(%rcx)
movb 0x3c(%rbx), %al
movb %al, 0x9(%rcx)
movb 0x41(%rbx), %al
movb %al, 0xa(%rcx)
movb 0x40(%rbx), %al
movb %al, 0xb(%rcx)
movb 0x45(%rbx), %al
movb %al, 0xc(%rcx)
movb 0x44(%rbx), %al
movb %al, 0xd(%rcx)
jmp 0xbbe9
leaq 0x6fcd(%rip), %rcx      # 0x12b97
movq %rsp, %rdi
movl $0x1, %edx
callq 0xd3f7
testl %eax, %eax
je 0xbbdf
movl %eax, %ebp
jmp 0xbbf9
movb 0x3c(%rbx), %al
movq (%rsp), %rcx
movb %al, 0x8(%rcx)
movq (%rsp), %rdi
xorl %ebp, %ebp
testq %rdi, %rdi
je 0xbbf9
callq 0x53c4
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: addChunk_pHYs
static unsigned addChunk_pHYs(ucvector* out, const LodePNGInfo* info) {
  unsigned char* chunk;
  CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 9, "pHYs"));
  lodepng_set32bitInt(chunk + 8, info->phys_x);
  lodepng_set32bitInt(chunk + 12, info->phys_y);
  chunk[16] = info->phys_unit;
  lodepng_chunk_generate_crc(chunk);
  return 0;
}

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

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

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

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %rsi
leaq 0x6ed4(%rip), %rcx      # 0x12bab
leaq 0x8(%rsp), %rdi
movl $0x7, %edx
callq 0xd3f7
testl %eax, %eax
jne 0xbd1f
movb 0x1(%rbx), %al
movq 0x8(%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 0x53c4
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: addChunk_zTXt
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 0xbd4f
movq $-0x1, %r14
cmpb $0x0, 0x1(%rbx,%r14)
leaq 0x1(%r14), %r14
jne 0xbd61
leaq -0x50(%r14), %rax
movl $0x59, %ebp
cmpq $-0x4f, %rax
jb 0xbe12
movq 0x18(%r8), %rax
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
testq %rax, %rax
je 0xbd95
callq *%rax
jmp 0xbd9a
callq 0x5071
movl %eax, %ebp
testl %eax, %eax
jne 0xbdc0
movl (%rsp), %eax
leal (%rax,%r14), %edx
addl $0x2, %edx
leaq 0x6df0(%rip), %rcx      # 0x12ba1
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0xd3f7
movl %eax, %ebp
testl %ebp, %ebp
jne 0xbe08
movq 0x10(%rsp), %r15
testq %r14, %r14
je 0xbddd
leaq 0x8(%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1130
movw $0x0, 0x8(%r15,%r14)
movq (%rsp), %rdx
testq %rdx, %rdx
je 0xbe00
movq 0x8(%rsp), %rsi
leaq (%r15,%r14), %rdi
addq $0xa, %rdi
callq 0x1130
movq %r15, %rdi
callq 0x53c4
movq 0x8(%rsp), %rdi
callq 0x1030
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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, %r15
movq %rdi, %rsi
movq $0x0, 0x8(%rsp)
movq $-0x1, %r14
cmpb $0x0, 0x1(%r15,%r14)
leaq 0x1(%r14), %r14
jne 0xbe45
movq $-0x1, %r12
movl %r14d, %edx
incl %edx
cmpb $0x0, 0x1(%rbx,%r12)
leaq 0x1(%r12), %r12
jne 0xbe5b
leaq -0x50(%r14), %rcx
movl $0x59, %eax
cmpq $-0x4f, %rcx
jb 0xbecf
leaq 0x6d1c(%rip), %rcx      # 0x12b9c
leaq 0x8(%rsp), %rdi
callq 0xd3f7
testl %eax, %eax
jne 0xbecf
movq 0x8(%rsp), %r13
testq %r14, %r14
je 0xbea7
leaq 0x8(%r13), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1130
movb $0x0, 0x8(%r13,%r14)
testq %r12, %r12
je 0xbec5
leaq (%r14,%r13), %rdi
addq $0x9, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x1130
movq %r13, %rdi
callq 0x53c4
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xc370
shrq %r15
addq %rbx, %r15
movq (%r14), %rdi
movq %r15, %rsi
callq 0x1170
testq %rax, %rax
je 0xc37f
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 0xc379
// File: /workspace/github_c_makefile_star2_O1/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 0xc3b5
shrl %cl, %eax
movl %eax, 0x20(%rdi)
addq %rcx, 0x18(%rdi)
jmp 0xc406
movzwl %si, %r9d
shrl $0x9, %eax
movl %eax, 0x20(%rdi)
movq 0x18(%rdi), %rsi
leaq 0x9(%rsi), %r10
addb $-0x9, %cl
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
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_O1/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: HuffmanTree_cleanup
static void HuffmanTree_cleanup(HuffmanTree* tree) {
  lodepng_free(tree->codes);
  lodepng_free(tree->lengths);
  lodepng_free(tree->table_len);
  lodepng_free(tree->table_value);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x1030
movq 0x8(%rbx), %rdi
callq 0x1030
movq 0x18(%rbx), %rdi
callq 0x1030
movq 0x20(%rbx), %rdi
popq %rbx
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O1/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:
testq %rdx, %rdx
je 0xcab6
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
cmpq $0x1, %rdx
jne 0xca57
testb $0x7, 0x8(%rbx)
jne 0xca3b
movq (%rbx), %rdi
movq 0x8(%rdi), %rsi
incq %rsi
callq 0xc33f
testl %eax, %eax
je 0xcaac
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)
jmp 0xcaac
xorl %r15d, %r15d
testb $0x7, 0x8(%rbx)
jne 0xca82
movq (%rbx), %rdi
movq 0x8(%rdi), %rsi
incq %rsi
callq 0xc33f
testl %eax, %eax
je 0xcaac
movq (%rbx), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
movb $0x0, -0x1(%rcx,%rax)
xorl %eax, %eax
btl %r15d, %ebp
setb %al
movb 0x8(%rbx), %cl
andb $0x7, %cl
shll %cl, %eax
movq (%rbx), %rcx
movq (%rcx), %rdx
movq 0x8(%rcx), %rcx
orb %al, -0x1(%rdx,%rcx)
incb 0x8(%rbx)
incq %r15
cmpq %r15, %r14
jne 0xca5a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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)
cmpq $0x0, 0x8(%rsi)
je 0xd24a
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 0xd259
cmpq $0x101, %r13            # imm = 0x101
jb 0xd23d
addl $0xfffffeff, %r13d      # imm = 0xFFFFFEFF
leaq 0x5584(%rip), %rax      # 0x12760
movl (%rax,%r13,4), %edx
movq (%r15), %rax
movl 0x4(%rax,%rbx,4), %esi
movq %r14, %r13
movl 0x8(%rax,%rbx,4), %r14d
leaq 0x566a(%rip), %rcx      # 0x12860
movl (%rcx,%r14,4), %ecx
movq %rcx, 0x10(%rsp)
movl 0xc(%rax,%rbx,4), %ebp
addq $0x3, %rbx
movq %r12, %rdi
callq 0xc9f1
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 0xd259
movq %r12, %rdi
movl %ebp, %esi
movq 0x10(%rsp), %rdx
callq 0xc9f1
incq %rbx
cmpq 0x8(%r15), %rbx
jne 0xd1a7
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: uivector_resize
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 0xd357
shrq %r15
addq %rax, %r15
movq (%r14), %rdi
movq %r15, %rsi
callq 0x1170
testq %rax, %rax
je 0xd366
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 0xd360
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: HuffmanTree_makeFromFrequencies
static unsigned HuffmanTree_makeFromFrequencies(HuffmanTree* tree, const unsigned* frequencies,
                                                size_t mincodes, size_t numcodes, unsigned maxbitlen) {
  unsigned error = 0;
  while(!frequencies[numcodes - 1] && numcodes > mincodes) --numcodes; /*trim zeroes*/
  tree->lengths = (unsigned*)lodepng_malloc(numcodes * sizeof(unsigned));
  if(!tree->lengths) return 83; /*alloc fail*/
  tree->maxbitlen = maxbitlen;
  tree->numcodes = (unsigned)numcodes; /*number of symbols*/

  error = lodepng_huffman_code_lengths(tree->lengths, frequencies, numcodes, maxbitlen);
  if(!error) error = HuffmanTree_makeFromLengths2(tree);
  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %ebp
movq %rcx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x4(,%rcx,4), %rcx
movl $0x1, %r12d
xorl %eax, %eax
leaq (%r15,%rax), %rsi
leaq -0x4(%rcx), %rdi
decq %r12
cmpq %rdx, %rsi
jbe 0xd3ac
decq %rax
cmpl $0x0, -0x8(%r14,%rcx)
movq %rdi, %rcx
je 0xd38e
callq 0x1140
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0xd3e9
leaq (%r15,%r12), %rdx
movl %ebp, 0x10(%rbx)
addl %r12d, %r15d
movl %r15d, 0x14(%rbx)
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %ecx
callq 0x2ee4
testl %eax, %eax
jne 0xd3ee
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xc593
movl $0x53, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: lodepng_chunk_init
static unsigned lodepng_chunk_init(unsigned char** chunk,
                                   ucvector* out,
                                   unsigned length, const char* type) {
  size_t new_length = out->size;
  if(lodepng_addofl(new_length, length, &new_length)) return 77;
  if(lodepng_addofl(new_length, 12, &new_length)) return 77;
  if(!ucvector_resize(out, new_length)) return 83; /*alloc fail*/
  *chunk = out->data + new_length - length - 12u;

  /*1: length*/
  lodepng_set32bitInt(*chunk, length);

  /*2: chunk name (4 letters)*/
  lodepng_memcpy(*chunk + 4, type, 4);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r13d
movq 0x8(%rsi), %rbp
movl $0x4d, %eax
addq %r13, %rbp
jb 0xd469
subq $-0xc, %rbp
jae 0xd469
movq %rcx, %r14
movl %edx, %ebx
movq %rsi, %r12
movq %rdi, %r15
movq %rsi, %rdi
movq %rbp, %rsi
callq 0xc33f
testl %eax, %eax
je 0xd464
addq (%r12), %rbp
subq %r13, %rbp
leaq -0xc(%rbp), %rax
movq %rax, (%r15)
movl %ebx, %eax
shrl $0x18, %eax
movb %al, -0xc(%rbp)
movl %ebx, %eax
shrl $0x10, %eax
movb %al, -0xb(%rbp)
movb %bh, -0xa(%rbp)
movb %bl, -0x9(%rbp)
movq (%r15), %rax
movl (%r14), %ecx
movl %ecx, 0x4(%rax)
xorl %eax, %eax
jmp 0xd469
movl $0x53, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq