LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: LodePNGIText_cleanup
static void LodePNGIText_cleanup(LodePNGInfo* info)
{
  size_t i;
  for(i = 0; i != info->itext_num; ++i)
  {
    string_cleanup(&info->itext_keys[i]);
    string_cleanup(&info->itext_langtags[i]);
    string_cleanup(&info->itext_transkeys[i]);
    string_cleanup(&info->itext_strings[i]);
  }
  lodepng_free(info->itext_keys);
  lodepng_free(info->itext_langtags);
  lodepng_free(info->itext_transkeys);
  lodepng_free(info->itext_strings);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x60(%rdi)
je 0x4f81
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x68(%rbx), %r12
movq (%r12,%r15,8), %rdi
callq 0x1030
movq %r14, (%r12,%r15,8)
movq 0x70(%rbx), %r12
movq (%r12,%r15,8), %rdi
callq 0x1030
movq %r14, (%r12,%r15,8)
movq 0x78(%rbx), %r12
movq (%r12,%r15,8), %rdi
callq 0x1030
movq %r14, (%r12,%r15,8)
movq 0x80(%rbx), %r12
movq (%r12,%r15,8), %rdi
callq 0x1030
movq %r14, (%r12,%r15,8)
incq %r15
cmpq 0x60(%rbx), %r15
jne 0x4f31
movq 0x68(%rbx), %rdi
callq 0x1030
movq 0x70(%rbx), %rdi
callq 0x1030
movq 0x78(%rbx), %rdi
callq 0x1030
movq 0x80(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: lodepng_info_cleanup
void lodepng_info_cleanup(LodePNGInfo* info)
{
  lodepng_color_mode_cleanup(&info->color);
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
  LodePNGText_cleanup(info);
  LodePNGIText_cleanup(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 0x524a
callq 0x1030
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq %rbx, %rdi
callq 0x4d67
movq %rbx, %rdi
callq 0x4f19
xorl %r14d, %r14d
movq 0xb8(%rbx,%r14,8), %rdi
callq 0x1030
incq %r14
cmpq $0x3, %r14
jne 0x5264
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: lodepng_info_copy
unsigned lodepng_info_copy(LodePNGInfo* dest, const LodePNGInfo* source)
{
  lodepng_info_cleanup(dest);
  *dest = *source;
  lodepng_color_mode_init(&dest->color);
  CERROR_TRY_RETURN(lodepng_color_mode_copy(&dest->color, &source->color));

#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
  CERROR_TRY_RETURN(LodePNGText_copy(dest, source));
  CERROR_TRY_RETURN(LodePNGIText_copy(dest, source));

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

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x5231
movl $0xe8, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10f0
leaq 0x10(%r14), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%r14)
movabsq $0x800000006, %rax      # imm = 0x800000006
movq %rax, 0x10(%r14)
movups %xmm0, 0x18(%r14)
leaq 0x10(%rbx), %rsi
callq 0x4b35
testl %eax, %eax
je 0x52dc
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%r14)
movq $0x0, 0x58(%r14)
cmpq $0x0, 0x48(%rbx)
je 0x531b
xorl %r15d, %r15d
movq 0x50(%rbx), %rax
movq 0x58(%rbx), %rcx
movq (%rax,%r15,8), %rsi
movq (%rcx,%r15,8), %rdx
movq %r14, %rdi
callq 0x4dc7
testl %eax, %eax
jne 0x52d2
incq %r15
cmpq 0x48(%rbx), %r15
jne 0x52f6
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%r14)
movups %xmm0, 0x60(%r14)
movq $0x0, 0x80(%r14)
cmpq $0x0, 0x60(%rbx)
je 0x5379
xorl %r15d, %r15d
movq 0x68(%rbx), %rax
movq 0x70(%rbx), %rcx
movq (%rax,%r15,8), %rsi
movq (%rcx,%r15,8), %rdx
movq 0x78(%rbx), %rax
movq (%rax,%r15,8), %rcx
movq 0x80(%rbx), %rax
movq (%rax,%r15,8), %r8
movq %r14, %rdi
callq 0x4fb3
testl %eax, %eax
jne 0x52d2
incq %r15
cmpq 0x60(%rbx), %r15
jne 0x533d
leaq 0xb8(%r14), %r12
xorps %xmm0, %xmm0
movups %xmm0, 0xd8(%r14)
movups %xmm0, 0xc8(%r14)
movups %xmm0, 0xb8(%r14)
xorl %r15d, %r15d
movq (%r12,%r15,8), %rdi
callq 0x1030
incq %r15
cmpq $0x3, %r15
jne 0x539e
xorl %r13d, %r13d
movq 0xd0(%rbx,%r13,8), %r15
movq %r15, 0xd0(%r14,%r13,8)
movq %r15, %rdi
callq 0x1100
movq %rax, 0xb8(%r14,%r13,8)
testq %rax, %rax
sete %al
testq %r15, %r15
setne %cl
testb %al, %cl
jne 0x5419
testq %r15, %r15
je 0x5409
xorl %eax, %eax
movq 0xb8(%rbx,%r13,8), %rcx
movb (%rcx,%rax), %cl
movq (%r12,%r13,8), %rdx
movb %cl, (%rdx,%rax)
incq %rax
cmpq 0xd0(%rbx,%r13,8), %rax
jb 0x53ea
incq %r13
cmpq $0x3, %r13
jne 0x53b3
xorl %eax, %eax
jmp 0x52d2
movl $0x53, %eax
jmp 0x52d2
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: lodepng_color_mode_equal
static int lodepng_color_mode_equal(const LodePNGColorMode* a, const LodePNGColorMode* b)
{
  size_t i;
  if(a->colortype != b->colortype) return 0;
  if(a->bitdepth != b->bitdepth) return 0;
  if(a->key_defined != b->key_defined) return 0;
  if(a->key_defined)
  {
    if(a->key_r != b->key_r) return 0;
    if(a->key_g != b->key_g) return 0;
    if(a->key_b != b->key_b) return 0;
  }
  /*if one of the palette sizes is 0, then we consider it to be the same as the
  other: it means that e.g. the palette was not given by the user and should be
  considered the same as the palette inside the PNG.*/
  if(1/*a->palettesize != 0 && b->palettesize != 0*/) {
    if(a->palettesize != b->palettesize) return 0;
    for(i = 0; i != a->palettesize * 4; ++i)
    {
      if(a->palette[i] != b->palette[i]) return 0;
    }
  }
  return 1;
}

// Assembly:
movl (%rdi), %ecx
xorl %eax, %eax
cmpl (%rsi), %ecx
jne 0x5999
movl 0x4(%rdi), %ecx
cmpl 0x4(%rsi), %ecx
jne 0x5999
movl 0x18(%rdi), %ecx
cmpl 0x18(%rsi), %ecx
jne 0x5999
testl %ecx, %ecx
je 0x5961
movl 0x1c(%rdi), %ecx
cmpl 0x1c(%rsi), %ecx
jne 0x5999
movl 0x20(%rdi), %ecx
cmpl 0x20(%rsi), %ecx
jne 0x5999
movl 0x24(%rdi), %ecx
cmpl 0x24(%rsi), %ecx
jne 0x5999
movq 0x10(%rdi), %rcx
cmpq 0x10(%rsi), %rcx
jne 0x5999
shlq $0x2, %rcx
movl $0x1, %eax
testq %rcx, %rcx
je 0x5999
movq 0x8(%rdi), %rdx
movq 0x8(%rsi), %rsi
xorl %edi, %edi
movb (%rdx,%rdi), %r8b
cmpb (%rsi,%rdi), %r8b
jne 0x5997
incq %rdi
cmpq %rdi, %rcx
jne 0x5983
jmp 0x5999
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: color_tree_add
static void 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));
      color_tree_init(tree->children[i]);
    }
    tree = tree->children[i];
  }
  tree->index = (int)index;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, (%rsp)
movl %ecx, %r15d
movl %edx, %r12d
movl %esi, %r14d
movq %rdi, %rbx
xorl %r13d, %r13d
movl %r8d, 0x4(%rsp)
movl %r14d, %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, %r8d
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 0x5a39
movl $0x88, %edi
callq 0x1100
movl 0x4(%rsp), %r8d
movq %rax, (%rbx,%rbp,8)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x60(%rax)
movups %xmm0, 0x70(%rax)
movl $0xffffffff, 0x80(%rax) # imm = 0xFFFFFFFF
movq (%rbx,%rbp,8), %rax
incl %r13d
movq %rax, %rbx
cmpl $0x8, %r13d
jne 0x59bd
movl (%rsp), %ecx
movl %ecx, 0x80(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: color_tree_cleanup
static void color_tree_cleanup(ColorTree* tree)
{
  int i;
  for(i = 0; i != 16; ++i)
  {
    if(tree->children[i])
    {
      color_tree_cleanup(tree->children[i]);
      lodepng_free(tree->children[i]);
    }
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq (%rbx,%r14,8), %rdi
testq %rdi, %rdi
je 0x6357
callq 0x6336
movq (%rbx,%r14,8), %rdi
callq 0x1030
incq %r14
cmpq $0x10, %r14
jne 0x6340
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: checkColorValidity
static unsigned checkColorValidity(LodePNGColorType colortype, unsigned bd) /*bd = bitdepth*/
{
  switch(colortype)
  {
    case 0: if(!(bd == 1 || bd == 2 || bd == 4 || bd == 8 || bd == 16)) return 37; break; /*grey*/
    case 2: if(!(                                 bd == 8 || bd == 16)) return 37; break; /*RGB*/
    case 3: if(!(bd == 1 || bd == 2 || bd == 4 || bd == 8            )) return 37; break; /*palette*/
    case 4: if(!(                                 bd == 8 || bd == 16)) return 37; break; /*grey + alpha*/
    case 6: if(!(                                 bd == 8 || bd == 16)) return 37; break; /*RGBA*/
    default: return 31;
  }
  return 0; /*allowed color type / bits combination*/
}

// Assembly:
movl $0x1f, %eax
cmpl $0x6, %edi
ja 0x707a
movl %edi, %ecx
leaq 0x7189(%rip), %rdx      # 0xe1bc
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
addl $-0x8, %esi
andl $-0x9, %esi
movl $0x25, %eax
cmovel %esi, %eax
retq
movl $0x25, %eax
cmpl $0x10, %esi
ja 0x707a
movl $0x10116, %ecx          # imm = 0x10116
btl %esi, %ecx
jae 0x707a
xorl %eax, %eax
retq
decl %esi
movl $0x25, %eax
cmpl $0x8, %esi
jae 0x707a
movl %esi, %eax
leaq 0x89fd(%rip), %rcx      # 0xfa74
movl (%rcx,%rax,4), %eax
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: lodepng_decode_memory
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;
  error = lodepng_decode(out, w, h, &state, in, insize);
  lodepng_state_cleanup(&state);
  return error;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x1a0, %rsp            # imm = 0x1A0
movq %r8, %rax
movq %rcx, %r8
movl 0x1c0(%rsp), %ecx
xorl %r10d, %r10d
movq %rsp, %rbx
movl %r10d, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movups %xmm0, 0x14(%rbx)
movaps 0x6206(%rip), %xmm1     # 0xe0c0
movups %xmm1, 0x24(%rbx)
movaps 0x620b(%rip), %xmm1     # 0xe0d0
movups %xmm1, 0x34(%rbx)
movl $0x1, %r11d
movl %r11d, 0x44(%rbx)
movups %xmm0, 0x48(%rbx)
movq %r10, 0x58(%rbx)
movl %r11d, 0x68(%rbx)
movabsq $0x100000001, %r14      # imm = 0x100000001
movq %r14, 0x60(%rbx)
movups %xmm0, 0x70(%rbx)
movl %r11d, 0x80(%rbx)
movups %xmm0, 0xa0(%rbx)
movups %xmm0, 0x90(%rbx)
movups %xmm0, 0xd8(%rbx)
movabsq $0x800000006, %r14      # imm = 0x800000006
movq %r14, 0xc0(%rbx)
movups %xmm0, 0xc8(%rbx)
movl %r10d, 0xb8(%rbx)
movq %r10, 0xb0(%rbx)
movl %r10d, 0x154(%rbx)
movups %xmm0, 0x188(%rbx)
movups %xmm0, 0x178(%rbx)
movups %xmm0, 0x168(%rbx)
movl %r10d, 0x138(%rbx)
movups %xmm0, 0x128(%rbx)
movups %xmm0, 0x118(%rbx)
movups %xmm0, 0x108(%rbx)
movups %xmm0, 0xf8(%rbx)
movups %xmm0, 0xe8(%rbx)
movl %r11d, 0x198(%rbx)
movl %r9d, 0x88(%rbx)
movl %ecx, 0x8c(%rbx)
movq %rbx, %rcx
movq %rax, %r9
callq 0x707b
movl %eax, %ebp
movq %rbx, %rdi
callq 0x808c
movl %ebp, %eax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: lodepng_state_init
void lodepng_state_init(LodePNGState* state)
{
#ifdef LODEPNG_COMPILE_DECODER
  lodepng_decoder_settings_init(&state->decoder);
#endif /*LODEPNG_COMPILE_DECODER*/
#ifdef LODEPNG_COMPILE_ENCODER
  lodepng_encoder_settings_init(&state->encoder);
#endif /*LODEPNG_COMPILE_ENCODER*/
  lodepng_color_mode_init(&state->info_raw);
  lodepng_info_init(&state->info_png);
  state->error = 1;
}

// Assembly:
xorl %eax, %eax
movl %eax, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movups %xmm0, 0x14(%rdi)
movaps 0x60fa(%rip), %xmm1     # 0xe0c0
movups %xmm1, 0x24(%rdi)
movaps 0x60ff(%rip), %xmm1     # 0xe0d0
movups %xmm1, 0x34(%rdi)
movl $0x1, %ecx
movl %ecx, 0x44(%rdi)
movups %xmm0, 0x48(%rdi)
movq %rax, 0x58(%rdi)
movl %ecx, 0x68(%rdi)
movabsq $0x100000001, %rdx      # imm = 0x100000001
movq %rdx, 0x60(%rdi)
movups %xmm0, 0x70(%rdi)
movl %ecx, 0x80(%rdi)
movups %xmm0, 0xa0(%rdi)
movabsq $0x800000006, %rdx      # imm = 0x800000006
movq %rdx, 0x88(%rdi)
movups %xmm0, 0x90(%rdi)
movups %xmm0, 0xd8(%rdi)
movq %rdx, 0xc0(%rdi)
movups %xmm0, 0xc8(%rdi)
movl %eax, 0xb8(%rdi)
movq %rax, 0xb0(%rdi)
movl %eax, 0x154(%rdi)
movups %xmm0, 0x188(%rdi)
movups %xmm0, 0x178(%rdi)
movups %xmm0, 0x168(%rdi)
movl %eax, 0x138(%rdi)
movups %xmm0, 0x128(%rdi)
movups %xmm0, 0x118(%rdi)
movups %xmm0, 0x108(%rdi)
movups %xmm0, 0xf8(%rdi)
movups %xmm0, 0xe8(%rdi)
movl %ecx, 0x198(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/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;
  error = lodepng_load_file(&buffer, &buffersize, filename);
  if(!error) error = lodepng_decode_memory(out, w, h, buffer, buffersize, colortype, bitdepth);
  lodepng_free(buffer);
  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, %ebp
movl %r8d, 0x14(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r13
leaq 0x20(%rsp), %r12
movq $0x0, (%r12)
leaq 0x18(%rsp), %rsi
movq %r12, %rdi
movq %rcx, %rdx
callq 0x1281
movl %eax, %ebx
movq (%r12), %r12
testl %eax, %eax
jne 0x8158
movq 0x18(%rsp), %r8
movl %ebp, (%rsp)
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r12, %rcx
movl 0x14(%rsp), %r9d
callq 0x7e87
movl %eax, %ebx
movq %r12, %rdi
callq 0x1030
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: lodepng_encoder_settings_init
void lodepng_encoder_settings_init(LodePNGEncoderSettings* settings)
{
  lodepng_compress_settings_init(&settings->zlibsettings);
  settings->filter_palette_zero = 1;
  settings->filter_strategy = LFS_MINSUM;
  settings->auto_convert = 1;
  settings->force_palette = 0;
  settings->predefined_filters = 0;
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
  settings->add_id = 0;
  settings->text_compression = 1;
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
}

// Assembly:
movaps 0x5ef5(%rip), %xmm0     # 0xe0b0
movups %xmm0, (%rdi)
movabsq $0x100000080, %rax      # imm = 0x100000080
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rdi)
movq $0x0, 0x28(%rdi)
movl $0x1, %eax
movl %eax, 0x38(%rdi)
movabsq $0x100000001, %rcx      # imm = 0x100000001
movq %rcx, 0x30(%rdi)
movups %xmm0, 0x40(%rdi)
movl %eax, 0x50(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: lodepng_state_copy
void lodepng_state_copy(LodePNGState* dest, const LodePNGState* source)
{
  lodepng_state_cleanup(dest);
  *dest = *source;
  lodepng_color_mode_init(&dest->info_raw);
  lodepng_info_init(&dest->info_png);
  dest->error = lodepng_color_mode_copy(&dest->info_raw, &source->info_raw); if(dest->error) return;
  dest->error = lodepng_info_copy(&dest->info_png, &source->info_png); if(dest->error) return;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x808c
movl $0x1a0, %edx            # imm = 0x1A0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x10f0
movl $0x88, %esi
leaq (%rbx,%rsi), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0xa0(%rbx)
movabsq $0x800000006, %rax      # imm = 0x800000006
movq %rax, 0x88(%rbx)
movups %xmm0, 0x90(%rbx)
movups %xmm0, 0xd8(%rbx)
movq %rax, 0xc0(%rbx)
movups %xmm0, 0xc8(%rbx)
xorl %eax, %eax
movl %eax, 0xb8(%rbx)
movq $0x0, 0xb0(%rbx)
movl %eax, 0x154(%rbx)
movups %xmm0, 0x168(%rbx)
movups %xmm0, 0x178(%rbx)
movups %xmm0, 0x188(%rbx)
movups %xmm0, 0xe8(%rbx)
movups %xmm0, 0xf8(%rbx)
movups %xmm0, 0x108(%rbx)
movups %xmm0, 0x118(%rbx)
movups %xmm0, 0x128(%rbx)
movl %eax, 0x138(%rbx)
addq %r14, %rsi
callq 0x4b35
movl %eax, 0x198(%rbx)
testl %eax, %eax
jne 0x82dd
leaq 0xb0(%rbx), %rdi
addq $0xb0, %r14
movq %r14, %rsi
callq 0x5282
movl %eax, 0x198(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: writeSignature
static void writeSignature(ucvector* out)
{
  /*8 bytes PNG signature, aka the magic bytes*/
  ucvector_push_back(out, 137);
  ucvector_push_back(out, 80);
  ucvector_push_back(out, 78);
  ucvector_push_back(out, 71);
  ucvector_push_back(out, 13);
  ucvector_push_back(out, 10);
  ucvector_push_back(out, 26);
  ucvector_push_back(out, 10);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %r14
incq %r14
movq %r14, %rsi
callq 0xa7a0
testl %eax, %eax
je 0x8eb2
movq %r14, 0x8(%rbx)
movq (%rbx), %rax
movb $-0x77, -0x1(%rax,%r14)
movq 0x8(%rbx), %r14
incq %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa7a0
testl %eax, %eax
je 0x8ed5
movq %r14, 0x8(%rbx)
movq (%rbx), %rax
movb $0x50, -0x1(%rax,%r14)
movq 0x8(%rbx), %r14
incq %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa7a0
testl %eax, %eax
je 0x8ef8
movq %r14, 0x8(%rbx)
movq (%rbx), %rax
movb $0x4e, -0x1(%rax,%r14)
movq 0x8(%rbx), %r14
incq %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa7a0
testl %eax, %eax
je 0x8f1b
movq %r14, 0x8(%rbx)
movq (%rbx), %rax
movb $0x47, -0x1(%rax,%r14)
movq 0x8(%rbx), %r14
incq %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa7a0
testl %eax, %eax
je 0x8f3e
movq %r14, 0x8(%rbx)
movq (%rbx), %rax
movb $0xd, -0x1(%rax,%r14)
movq 0x8(%rbx), %r14
incq %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa7a0
testl %eax, %eax
je 0x8f61
movq %r14, 0x8(%rbx)
movq (%rbx), %rax
movb $0xa, -0x1(%rax,%r14)
movq 0x8(%rbx), %r14
incq %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa7a0
testl %eax, %eax
je 0x8f84
movq %r14, 0x8(%rbx)
movq (%rbx), %rax
movb $0x1a, -0x1(%rax,%r14)
movq 0x8(%rbx), %r14
incq %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa7a0
testl %eax, %eax
je 0x8fa7
movq %r14, 0x8(%rbx)
movq (%rbx), %rax
movb $0xa, -0x1(%rax,%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/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);
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %ebx, %ebx
testq %rdx, %rdx
je 0x9243
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x8(%rdi), %r13
movq %rsi, %rbp
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x494f
testl %eax, %eax
jne 0x9241
movq 0x8(%r12), %rax
movq %rax, 0x10(%r12)
movl (%rbp), %eax
bswapl %eax
addl $0xc, %eax
addq %rax, %rbp
movq %rbp, %rax
subq %r15, %rax
cmpq %r14, %rax
jb 0x920d
jmp 0x9243
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: addChunk_PLTE
static unsigned addChunk_PLTE(ucvector* out, const LodePNGColorMode* info)
{
  unsigned error = 0;
  size_t i;
  ucvector PLTE;
  ucvector_init(&PLTE);
  for(i = 0; i != info->palettesize * 4; ++i)
  {
    /*add all channels except alpha channel*/
    if(i % 4 != 3) ucvector_push_back(&PLTE, info->palette[i]);
  }
  error = addChunk(out, "PLTE", PLTE.data, PLTE.size);
  ucvector_cleanup(&PLTE);

  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x10(%rsi), %rax
shlq $0x2, %rax
testq %rax, %rax
je 0x9307
movq %rbx, 0x8(%rsp)
xorl %ebp, %ebp
xorl %r14d, %r14d
xorl %edx, %edx
xorl %r15d, %r15d
movq %rsi, 0x10(%rsp)
movl %ebp, %eax
notl %eax
testb $0x3, %al
je 0x92f0
movq 0x8(%rsi), %rax
movb (%rax,%rbp), %dil
leaq 0x1(%rdx), %r12
cmpq %r12, %r14
jae 0x92dc
leaq (%r14,%r14), %rax
leaq (%r12,%r12,2), %r13
shrq %r13
cmpq %r12, %rax
cmovbq %r12, %r13
movb %dil, 0x7(%rsp)
movq %r15, %rdi
movq %r13, %rsi
movq %rdx, %rbx
callq 0x1130
movb 0x7(%rsp), %dil
movq %rbx, %rdx
movq 0x10(%rsp), %rsi
testq %rax, %rax
jne 0x92e2
jmp 0x92f0
movq %r15, %rax
movq %r14, %r13
movb %dil, -0x1(%rax,%r12)
movq %rax, %r15
movq %r12, %rdx
movq %r13, %r14
incq %rbp
movq 0x10(%rsi), %rax
shlq $0x2, %rax
cmpq %rax, %rbp
jne 0x928a
movq 0x8(%rsp), %rbx
jmp 0x930c
xorl %r15d, %r15d
xorl %edx, %edx
leaq 0x8(%rbx), %rsi
leaq 0x6732(%rip), %rcx      # 0xfa49
movq %rbx, %rdi
movq %r15, %r8
callq 0x4a14
testl %eax, %eax
jne 0x932e
movq 0x8(%rbx), %rax
movq %rax, 0x10(%rbx)
movq %r15, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: getPaletteTranslucency
static unsigned getPaletteTranslucency(const unsigned char* palette, size_t palettesize)
{
  size_t i;
  unsigned key = 0;
  unsigned r = 0, g = 0, b = 0; /*the value of the color with alpha 0, so long as color keying is possible*/
  for(i = 0; i != palettesize; ++i)
  {
    if(!key && palette[4 * i + 3] == 0)
    {
      r = palette[4 * i + 0]; g = palette[4 * i + 1]; b = palette[4 * i + 2];
      key = 1;
      i = (size_t)(-1); /*restart from beginning, to detect earlier opaque colors with key's value*/
    }
    else if(palette[4 * i + 3] != 255) return 2;
    /*when key, no opaque RGB may have key's RGB*/
    else if(key && r == palette[i * 4 + 0] && g == palette[i * 4 + 1] && b == palette[i * 4 + 2]) return 2;
  }
  return key;
}

// Assembly:
testq %rsi, %rsi
je 0x93dc
pushq %rbx
xorl %ecx, %ecx
xorl %edx, %edx
xorl %r8d, %r8d
xorl %r10d, %r10d
xorl %r9d, %r9d
leaq (,%r9,4), %r11
movzbl 0x3(%rdi,%r9,4), %ebx
testl %r10d, %r10d
je 0x93a2
movl $0x2, %eax
cmpl $0xff, %ebx
jne 0x93da
movzbl (%rdi,%r11), %ebx
movl $0x1, %r10d
cmpl %ebx, %r8d
jne 0x93cf
movzbl 0x1(%rdi,%r11), %ebx
cmpl %ebx, %edx
jne 0x93cf
movzbl 0x2(%rdi,%r11), %r11d
cmpl %r11d, %ecx
jne 0x93cf
jmp 0x93da
xorl %r10d, %r10d
cmpl $0xff, %ebx
je 0x93cf
testl %ebx, %ebx
jne 0x93df
movzbl (%rdi,%r11), %r8d
movzbl 0x1(%rdi,%r11), %edx
movzbl 0x2(%rdi,%r11), %ecx
movl $0x1, %r10d
movq $-0x1, %r9
incq %r9
movl %r10d, %eax
cmpq %rsi, %r9
jne 0x935b
popq %rbx
retq
xorl %eax, %eax
retq
movl $0x2, %eax
jmp 0x93da
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: addChunk_pHYs
static unsigned addChunk_pHYs(ucvector* out, const LodePNGInfo* info)
{
  unsigned error = 0;
  ucvector data;
  ucvector_init(&data);

  lodepng_add32bitInt(&data, info->phys_x);
  lodepng_add32bitInt(&data, info->phys_y);
  ucvector_push_back(&data, info->phys_unit);

  error = addChunk(out, "pHYs", data.data, data.size);
  ucvector_cleanup(&data);

  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %r12
movaps %xmm0, (%r12)
movq $0x0, 0x10(%r12)
movl 0xa8(%rsi), %esi
movq %r12, %rdi
callq 0x4746
movl 0xac(%r14), %esi
movq %r12, %rdi
callq 0x4746
movb 0xb0(%r14), %bpl
movq (%r12), %r14
movq 0x8(%r12), %r15
leaq 0x1(%r15), %r13
movq 0x10(%r12), %rax
cmpq %r13, %rax
jae 0x9b1e
addq %rax, %rax
leaq (,%r13,2), %rsi
addq %r13, %rsi
shrq %rsi
cmpq %r13, %rax
cmovbq %r13, %rsi
movq %r14, %rdi
callq 0x1130
testq %rax, %rax
jne 0x9b21
jmp 0x9b2c
movq %r14, %rax
movb %bpl, -0x1(%rax,%r13)
movq %r13, %r15
movq %rax, %r14
leaq 0x8(%rbx), %rsi
leaq 0x5f35(%rip), %rcx      # 0xfa6c
movq %rbx, %rdi
movl %r15d, %edx
movq %r14, %r8
callq 0x4a14
testl %eax, %eax
jne 0x9b51
movq 0x8(%rbx), %rax
movq %rax, 0x10(%rbx)
movq %r14, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: addChunk_IDAT
static unsigned addChunk_IDAT(ucvector* out, const unsigned char* data, size_t datasize,
                              LodePNGCompressSettings* zlibsettings)
{
  ucvector zlibdata;
  unsigned error = 0;

  /*compress with the Zlib compressor*/
  ucvector_init(&zlibdata);
  error = zlib_compress(&zlibdata.data, &zlibdata.size, data, datasize, zlibsettings);
  if(!error) error = addChunk(out, "IDAT", zlibdata.data, zlibdata.size);
  ucvector_cleanup(&zlibdata);

  return error;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rcx, %r8
movq %rdx, %rcx
movq %rsi, %rdx
movq %rdi, %r14
xorps %xmm0, %xmm0
leaq 0x8(%rsp), %rbx
movaps %xmm0, -0x8(%rbx)
movq $0x0, 0x8(%rbx)
movq 0x18(%r8), %rax
movq %rsp, %rdi
movq %rbx, %rsi
testq %rax, %rax
je 0x9ba2
callq *%rax
jmp 0x9ba7
callq 0x44b8
movl %eax, %ebp
testl %eax, %eax
jne 0x9bd8
movq (%rsp), %r8
movl 0x8(%rsp), %edx
leaq 0x8(%r14), %rsi
leaq 0x5e7f(%rip), %rcx      # 0xfa3f
movq %r14, %rdi
callq 0x4a14
movl %eax, %ebp
testl %eax, %eax
jne 0x9bd8
movq 0x8(%r14), %rax
movq %rax, 0x10(%r14)
xorl %ebp, %ebp
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq (%rsp), %rdi
callq 0x1030
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: addChunk_tIME
static unsigned addChunk_tIME(ucvector* out, const LodePNGTime* time)
{
  unsigned error = 0;
  unsigned char* data = (unsigned char*)lodepng_malloc(7);
  if(!data) return 83; /*alloc fail*/
  data[0] = (unsigned char)(time->year >> 8);
  data[1] = (unsigned char)(time->year & 255);
  data[2] = (unsigned char)time->month;
  data[3] = (unsigned char)time->day;
  data[4] = (unsigned char)time->hour;
  data[5] = (unsigned char)time->minute;
  data[6] = (unsigned char)time->second;
  error = addChunk(out, "tIME", data, 7);
  lodepng_free(data);
  return error;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl $0x7, %edi
callq 0x1100
testq %rax, %rax
je 0x9c6f
movq %rax, %rbp
movdqu (%r14), %xmm0
movl (%r14), %eax
movb %ah, (%rbp)
pand 0x44bf(%rip), %xmm0     # 0xe0e0
packuswb %xmm0, %xmm0
packuswb %xmm0, %xmm0
movd %xmm0, 0x1(%rbp)
movb 0x10(%r14), %al
movb %al, 0x5(%rbp)
movb 0x14(%r14), %al
movb %al, 0x6(%rbp)
leaq 0x8(%rbx), %rsi
leaq 0x5e20(%rip), %rcx      # 0xfa67
movq %rbx, %rdi
movl $0x7, %edx
movq %rbp, %r8
callq 0x4a14
testl %eax, %eax
jne 0x9c63
movq 0x8(%rbx), %rax
movq %rax, 0x10(%rbx)
movq %rbp, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x1030
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: addChunk_tEXt
static unsigned addChunk_tEXt(ucvector* out, const char* keyword, const char* textstring)
{
  unsigned error = 0;
  size_t i;
  ucvector text;
  ucvector_init(&text);
  for(i = 0; keyword[i] != 0; ++i) ucvector_push_back(&text, (unsigned char)keyword[i]);
  if(i < 1 || i > 79) return 89; /*error: invalid keyword size*/
  ucvector_push_back(&text, 0); /*0 termination char*/
  for(i = 0; textstring[i] != 0; ++i) ucvector_push_back(&text, (unsigned char)textstring[i]);
  error = addChunk(out, "tEXt", text.data, text.size);
  ucvector_cleanup(&text);

  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, 0x8(%rsp)
movb (%rsi), %r13b
testb %r13b, %r13b
je 0x9f9e
movq %rdi, 0x10(%rsp)
movq $-0x1, %r14
xorl %edx, %edx
xorl %ebx, %ebx
xorl %r15d, %r15d
movq %rsi, 0x18(%rsp)
leaq 0x1(%rbx), %r12
cmpq %r12, %rdx
jae 0x9f77
leaq (%rdx,%rdx), %rax
leaq (%r12,%r12,2), %rbp
shrq %rbp
cmpq %r12, %rax
cmovbq %r12, %rbp
movq %r15, %rdi
movq %rbp, %rsi
movq %rdx, 0x20(%rsp)
callq 0x1130
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
testq %rax, %rax
jne 0x9f7d
jmp 0x9f8b
movq %r15, %rax
movq %rdx, %rbp
movb %r13b, -0x1(%rax,%r12)
movq %rbp, %rdx
movq %rax, %r15
movq %r12, %rbx
movb 0x2(%rsi,%r14), %r13b
incq %r14
testb %r13b, %r13b
jne 0x9f3b
cmpq $0x4e, %r14
jbe 0x9fad
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1(%rbx), %r14
cmpq %r14, %rdx
jae 0x9fe8
leaq (%rdx,%rdx), %rax
leaq (%r14,%r14,2), %r13
shrq %r13
cmpq %r14, %rax
cmovbq %r14, %r13
movq %r15, %rdi
movq %r13, %rsi
movq %rdx, %r12
callq 0x1130
movq %rbx, %rdx
movq %r12, %rbx
testq %rax, %rax
movq 0x8(%rsp), %rcx
jne 0x9ff3
jmp 0xa002
movq %r15, %rax
movq %rdx, %r13
movq 0x8(%rsp), %rcx
movb $0x0, -0x1(%rax,%r14)
movq %r13, %rbx
movq %rax, %r15
movq %r14, %rdx
movb (%rcx), %bpl
testb %bpl, %bpl
je 0xa069
incq %rcx
leaq 0x1(%rdx), %r14
cmpq %r14, %rbx
jae 0xa04a
leaq (%rbx,%rbx), %rax
leaq (%r14,%r14,2), %r13
shrq %r13
cmpq %r14, %rax
cmovbq %r14, %r13
movq %r15, %rdi
movq %rcx, 0x8(%rsp)
movq %r13, %rsi
movq %rdx, %r12
callq 0x1130
movq %r12, %rdx
movq 0x8(%rsp), %rcx
testq %rax, %rax
jne 0xa050
jmp 0xa05e
movq %r15, %rax
movq %rbx, %r13
movb %bpl, -0x1(%rax,%r14)
movq %r13, %rbx
movq %rax, %r15
movq %r14, %rdx
movb (%rcx), %bpl
incq %rcx
testb %bpl, %bpl
jne 0xa00d
movq 0x10(%rsp), %r14
leaq 0x8(%r14), %rsi
leaq 0x59df(%rip), %rcx      # 0xfa58
movq %r14, %rdi
movq %r15, %r8
callq 0x4a14
testl %eax, %eax
jne 0xa090
movq 0x8(%r14), %rax
movq %rax, 0x10(%r14)
movq %r15, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: lodepng_encode_memory
unsigned lodepng_encode_memory(unsigned char** out, size_t* outsize, const unsigned char* image,
                               unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth)
{
  unsigned error;
  LodePNGState state;
  lodepng_state_init(&state);
  state.info_raw.colortype = colortype;
  state.info_raw.bitdepth = bitdepth;
  state.info_png.color.colortype = colortype;
  state.info_png.color.bitdepth = bitdepth;
  lodepng_encode(out, outsize, image, w, h, &state);
  error = state.error;
  lodepng_state_cleanup(&state);
  return error;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x1a0, %rsp            # imm = 0x1A0
movl 0x1c0(%rsp), %eax
xorl %r10d, %r10d
movq %rsp, %rbx
movl %r10d, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movups %xmm0, 0x14(%rbx)
movaps 0x3ada(%rip), %xmm1     # 0xe0c0
movups %xmm1, 0x24(%rbx)
movaps 0x3adf(%rip), %xmm1     # 0xe0d0
movups %xmm1, 0x34(%rbx)
movl $0x1, %r11d
movl %r11d, 0x44(%rbx)
movups %xmm0, 0x48(%rbx)
movq %r10, 0x58(%rbx)
movl %r11d, 0x68(%rbx)
movabsq $0x100000001, %r14      # imm = 0x100000001
movq %r14, 0x60(%rbx)
movups %xmm0, 0x70(%rbx)
movl %r11d, 0x80(%rbx)
movups %xmm0, 0xa0(%rbx)
movups %xmm0, 0x90(%rbx)
movups %xmm0, 0xd8(%rbx)
movups %xmm0, 0xc8(%rbx)
movl %r10d, 0xb8(%rbx)
movq %r10, 0xb0(%rbx)
movl %r10d, 0x154(%rbx)
movups %xmm0, 0x188(%rbx)
movups %xmm0, 0x178(%rbx)
movups %xmm0, 0x168(%rbx)
movl %r10d, 0x138(%rbx)
movups %xmm0, 0x128(%rbx)
movups %xmm0, 0x118(%rbx)
movups %xmm0, 0x108(%rbx)
movups %xmm0, 0xf8(%rbx)
movups %xmm0, 0xe8(%rbx)
movl %r11d, 0x198(%rbx)
movl %r9d, 0x88(%rbx)
movl %eax, 0x8c(%rbx)
movl %r9d, 0xc0(%rbx)
movl %eax, 0xc4(%rbx)
movq %rbx, %r9
callq 0x82e5
movl 0x198(%rbx), %ebp
movq %rbx, %rdi
callq 0x808c
movl %ebp, %eax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: lodepng_encode_file
unsigned lodepng_encode_file(const char* filename, const unsigned char* image, unsigned w, unsigned h,
                             LodePNGColorType colortype, unsigned bitdepth)
{
  unsigned char* buffer;
  size_t buffersize;
  unsigned error = lodepng_encode_memory(&buffer, &buffersize, image, w, h, colortype, bitdepth);
  if(!error) error = lodepng_save_file(buffer, buffersize, filename);
  lodepng_free(buffer);
  return error;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %r8d, %eax
movl %ecx, %r8d
movl %edx, %ecx
movq %rsi, %rdx
movq %rdi, %rbx
movl %r9d, (%rsp)
leaq 0x18(%rsp), %r14
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
movl %eax, %r9d
callq 0xa5b9
movl %eax, %ebp
movq (%r14), %r14
testl %eax, %eax
jne 0xa74d
movq 0x10(%rsp), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x137c
movl %eax, %ebp
movq %r14, %rdi
callq 0x1030
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: ucvector_reserve
static unsigned ucvector_reserve(ucvector* p, size_t allocsize)
{
  if(allocsize > p->allocsize)
  {
    size_t newsize = (allocsize > p->allocsize * 2) ? allocsize : (allocsize * 3 / 2);
    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;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x10(%rdi), %rax
movl $0x1, %ebx
cmpq %rsi, %rax
jae 0xa7e2
movq %rdi, %r14
addq %rax, %rax
leaq (%rsi,%rsi,2), %r15
shrq %r15
cmpq %rsi, %rax
cmovbq %rsi, %r15
movq (%rdi), %rdi
movq %r15, %rsi
callq 0x1130
testq %rax, %rax
je 0xa7e0
movq %r15, 0x10(%r14)
movq %rax, (%r14)
jmp 0xa7e2
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: generateFixedLitLenTree
static unsigned generateFixedLitLenTree(HuffmanTree* tree)
{
  unsigned i, error = 0;
  unsigned* bitlen = (unsigned*)lodepng_malloc(NUM_DEFLATE_CODE_SYMBOLS * sizeof(unsigned));
  if(!bitlen) return 83; /*alloc fail*/

  /*288 possible codes: 0-255=literals, 256=endcode, 257-285=lengthcodes, 286-287=unused*/
  for(i =   0; i <= 143; ++i) bitlen[i] = 8;
  for(i = 144; i <= 255; ++i) bitlen[i] = 9;
  for(i = 256; i <= 279; ++i) bitlen[i] = 7;
  for(i = 280; i <= 287; ++i) bitlen[i] = 8;

  error = HuffmanTree_makeFromLengths(tree, bitlen, NUM_DEFLATE_CODE_SYMBOLS, 15);

  lodepng_free(bitlen);
  return error;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x480, %edi            # imm = 0x480
callq 0x1100
testq %rax, %rax
je 0xa88a
movq %rax, %rbx
xorl %eax, %eax
movaps 0x38e0(%rip), %xmm0     # 0xe0f0
movups %xmm0, (%rbx,%rax,4)
addq $0x4, %rax
cmpq $0x90, %rax
jne 0xa810
movl $0x90, %eax
movaps 0x38d4(%rip), %xmm1     # 0xe100
movups %xmm1, (%rbx,%rax,4)
addq $0x4, %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0xa82c
movl $0x100, %eax            # imm = 0x100
movaps 0x38c8(%rip), %xmm1     # 0xe110
movups %xmm1, (%rbx,%rax,4)
addq $0x4, %rax
cmpq $0x118, %rax            # imm = 0x118
jne 0xa848
movups %xmm0, 0x460(%rbx)
movups %xmm0, 0x470(%rbx)
movl $0x120, %edx            # imm = 0x120
movq %r14, %rdi
movq %rbx, %rsi
movl $0xf, %ecx
callq 0xa8ee
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1030
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: generateFixedDistanceTree
static unsigned generateFixedDistanceTree(HuffmanTree* tree)
{
  unsigned i, error = 0;
  unsigned* bitlen = (unsigned*)lodepng_malloc(NUM_DISTANCE_SYMBOLS * sizeof(unsigned));
  if(!bitlen) return 83; /*alloc fail*/

  /*there are 32 distance codes, but 30-31 are unused*/
  for(i = 0; i != NUM_DISTANCE_SYMBOLS; ++i) bitlen[i] = 5;
  error = HuffmanTree_makeFromLengths(tree, bitlen, NUM_DISTANCE_SYMBOLS, 15);

  lodepng_free(bitlen);
  return error;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x80, %edi
callq 0x1100
testq %rax, %rax
je 0xa8e6
movq %rax, %rbx
xorl %eax, %eax
movaps 0x386c(%rip), %xmm0     # 0xe120
movups %xmm0, (%rbx,%rax,4)
addq $0x4, %rax
cmpq $0x20, %rax
jne 0xa8b4
movl $0x20, %edx
movq %r14, %rdi
movq %rbx, %rsi
movl $0xf, %ecx
callq 0xa8ee
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1030
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: HuffmanTree_makeFromLengths
static unsigned HuffmanTree_makeFromLengths(HuffmanTree* tree, const unsigned* bitlen,
                                            size_t numcodes, unsigned maxbitlen)
{
  unsigned i;
  tree->lengths = (unsigned*)lodepng_malloc(numcodes * sizeof(unsigned));
  if(!tree->lengths) return 83; /*alloc fail*/
  for(i = 0; i != numcodes; ++i) tree->lengths[i] = bitlen[i];
  tree->numcodes = (unsigned)numcodes; /*number of symbols*/
  tree->maxbitlen = maxbitlen;
  return HuffmanTree_makeFromLengths2(tree);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
leaq (,%rdx,4), %rdi
callq 0x1100
movq %rax, 0x10(%r14)
testq %rax, %rax
je 0xa947
testq %r15, %r15
je 0xa92f
xorl %ecx, %ecx
movl (%r12,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
incq %rcx
movl %ecx, %edx
cmpq %r15, %rdx
jne 0xa91e
movl %r15d, 0x1c(%r14)
movl %ebx, 0x18(%r14)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xa958
movl $0x53, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: writeLZ77data
static void writeLZ77data(size_t* bp, ucvector* out, 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];
    addHuffmanSymbol(bp, out, HuffmanTree_getCode(tree_ll, val), HuffmanTree_getLength(tree_ll, 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];

      addBitsToStream(bp, out, length_extra_bits, n_length_extra_bits);
      addHuffmanSymbol(bp, out, HuffmanTree_getCode(tree_d, distance_code),
                       HuffmanTree_getLength(tree_d, distance_code));
      addBitsToStream(bp, out, distance_extra_bits, n_distance_extra_bits);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, 0x8(%rsp)
cmpq $0x0, 0x8(%rdx)
je 0xb494
movq %rcx, %rbp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
xorl %r14d, %r14d
movq (%r15), %rax
movl (%rax,%r14,4), %ebx
movq 0x8(%rbp), %rax
movq 0x10(%rbp), %rcx
movl (%rax,%rbx,4), %edx
movl (%rcx,%rbx,4), %ecx
movq %r13, %rdi
movq %r12, %rsi
callq 0xb4a3
cmpq $0x101, %rbx            # imm = 0x101
jb 0xb487
addl $0xfffffeff, %ebx       # imm = 0xFFFFFEFF
leaq 0x3308(%rip), %rax      # 0xe720
movl (%rax,%rbx,4), %ecx
movq (%r15), %rax
movl 0x4(%rax,%r14,4), %edx
movq %rbp, %rbx
movl 0x8(%rax,%r14,4), %ebp
leaq 0x33ee(%rip), %rsi      # 0xe820
movl (%rsi,%rbp,4), %esi
movq %rsi, 0x10(%rsp)
movl 0xc(%rax,%r14,4), %eax
movl %eax, 0x4(%rsp)
addq $0x3, %r14
movq %r13, %rdi
movq %r12, %rsi
callq 0xb564
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rax
movq 0x10(%rcx), %rcx
movl (%rax,%rbp,4), %edx
movl (%rcx,%rbp,4), %ecx
movq %rbx, %rbp
movq %r13, %rdi
movq %r12, %rsi
callq 0xb4a3
movq %r13, %rdi
movq %r12, %rsi
movl 0x4(%rsp), %edx
movq 0x10(%rsp), %rcx
callq 0xb564
incq %r14
cmpq 0x8(%r15), %r14
jne 0xb3e2
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: getHash
static unsigned getHash(const unsigned char* data, size_t size, size_t pos)
{
  unsigned result = 0;
  if(pos + 2 < size)
  {
    /*A simple shift and xor hash is used. Since the data of PNGs is dominated
    by zeroes due to the filters, a better hash does not have a significant
    effect on speed in traversing the chain, and causes more time spend on
    calculating the hash.*/
    result ^= (unsigned)(data[pos + 0] << 0u);
    result ^= (unsigned)(data[pos + 1] << 4u);
    result ^= (unsigned)(data[pos + 2] << 8u);
  } else {
    size_t amount, i;
    if(pos >= size) return 0;
    amount = size - pos;
    for(i = 0; i != amount; ++i) result ^= (unsigned)(data[pos + i] << (i * 8u));
  }
  return result & HASH_BIT_MASK;
}

// Assembly:
leaq 0x2(%rdx), %rax
cmpq %rsi, %rax
jae 0xb53f
movzbl (%rdi,%rdx), %eax
movzbl 0x1(%rdi,%rdx), %ecx
shll $0x4, %ecx
xorl %eax, %ecx
movzbl 0x2(%rdi,%rdx), %eax
shll $0x8, %eax
xorl %ecx, %eax
jmp 0xb560
xorl %eax, %eax
cmpq %rsi, %rdx
jae 0xb563
xorl %ecx, %ecx
xorl %eax, %eax
movzbl (%rdi,%rdx), %r8d
shll %cl, %r8d
xorl %r8d, %eax
incq %rdx
addl $0x8, %ecx
cmpq %rdx, %rsi
jne 0xb54a
movzwl %ax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/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->maxbitlen = maxbitlen;
  tree->numcodes = (unsigned)numcodes; /*number of symbols*/
  tree->lengths = (unsigned*)lodepng_realloc(tree->lengths, numcodes * sizeof(unsigned));
  if(!tree->lengths) return 83; /*alloc fail*/
  /*initialize all lengths to 0*/
  memset(tree->lengths, 0, numcodes * sizeof(unsigned));

  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 %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movq %rcx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x4(,%rcx,4), %rsi
movl $0x1, %eax
xorl %ecx, %ecx
leaq (%r14,%rcx), %rdi
leaq -0x4(%rsi), %r12
decq %rax
cmpq %rdx, %rdi
jbe 0xb62c
decq %rcx
cmpl $0x0, -0x8(%r15,%rsi)
movq %r12, %rsi
je 0xb60e
movl %ebp, 0x18(%rbx)
addq %rax, %r14
movl %r14d, 0x1c(%rbx)
movq 0x10(%rbx), %rdi
movq %r12, %rsi
callq 0x1130
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0xb685
movq %rax, %r13
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x10b0
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x13c8
testl %eax, %eax
jne 0xb68a
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa958
movl $0x53, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/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;

    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 greyscale image*/
    if(chunkLength != 2) return 44;

    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 greyscale image*/
    if(chunkLength != 6) return 45;

    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 0xb7e9
leaq 0x2a96(%rip), %r8       # 0xe1f4
movslq (%r8,%rcx,4), %rcx
addq %r8, %rcx
jmpq *%rcx
movl $0x2c, %eax
cmpq $0x2, %rdx
jne 0xb7e9
movl $0x1, 0x38(%rdi)
movzwl (%rsi), %eax
rolw $0x8, %ax
movzwl %ax, %eax
jmp 0xb7d9
movl $0x2d, %eax
cmpq $0x6, %rdx
jne 0xb7e9
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
jmp 0xb7e4
movl $0x2b, %eax
cmpq $0x1, %rdx
jne 0xb7e9
movl $0x1, 0x38(%rdi)
movzbl (%rsi), %eax
movl %eax, 0x44(%rdi)
movl %eax, 0x40(%rdi)
movl $0x3c, %ecx
movl %eax, (%rdi,%rcx)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/Joy-Division[P]tools-mgs/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;
  unsigned i;

  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*/

    key[length] = 0;
    for(i = 0; i != length; ++i) key[i] = (char)data[i];

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

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

    str[length] = 0;
    for(i = 0; i != length; ++i) str[i] = (char)data[string2_begin + i];

    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, %r14d
xorl %ebx, %ebx
testq %rdx, %rdx
je 0xb82b
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %rbp
cmpb $0x0, (%r15,%rbx)
je 0xb819
incl %ebx
cmpq %r13, %rbx
jb 0xb80b
leal -0x50(%rbx), %eax
cmpl $-0x4f, %eax
jae 0xb833
xorl %r12d, %r12d
xorl %ebx, %ebx
jmp 0xb8b8
xorl %r12d, %r12d
jmp 0xb8b8
leal 0x1(%rbx), %r14d
movq %r14, %rdi
callq 0x1100
testq %rax, %rax
je 0xb8ad
movq %rax, %r12
movq %rbp, (%rsp)
movb $0x0, (%rax,%rbx)
movl %ebx, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x10f0
xorl %eax, %eax
movq %r13, %rbp
subq %r14, %rbp
cmovbq %rax, %rbp
leal 0x1(%rbp), %edi
callq 0x1100
testq %rax, %rax
je 0xb8b0
movq %rax, %rbx
movl %ebp, %eax
movb $0x0, (%rbx,%rax)
cmpq %r13, %r14
jae 0xb899
movl %ebp, %eax
xorl %ecx, %ecx
leal (%r14,%rcx), %edx
movb (%r15,%rdx), %dl
movb %dl, (%rbx,%rcx)
incq %rcx
cmpl %ecx, %eax
jne 0xb887
movq (%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x4dc7
movl %eax, %r14d
jmp 0xb8b8
xorl %r12d, %r12d
xorl %ebx, %ebx
movl $0x53, %r14d
movq %r12, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq