LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: lodepng_decode_memory(unsigned char**, unsigned int*, unsigned int*, unsigned char const*, unsigned long, LodePNGColorType, unsigned int)
unsigned lodepng_decode_memory(unsigned char** out, unsigned* w, unsigned* h, const unsigned char* in,
                               size_t insize, LodePNGColorType colortype, unsigned bitdepth)
{
  unsigned error;
  LodePNGState state;
  lodepng_state_init(&state);
  state.info_raw.colortype = colortype;
  state.info_raw.bitdepth = bitdepth;
  error = lodepng_decode(out, w, h, &state, in, insize);
  lodepng_state_cleanup(&state);
  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
leaq 0xbab9(%rip), %rax      # 0x14d98
leaq 0x10(%rsp), %r14
movq %rdi, %rbp
movl %r9d, %ebx
movq %r8, 0x8(%rsp)
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %r14, %rdi
movq %rax, (%r14)
callq 0x934f
movl 0x1f0(%rsp), %eax
movq 0x8(%rsp), %r9
movl %ebx, 0x90(%r14)
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
movq %r15, %r8
movl %eax, 0x94(%r14)
callq 0x7f74
movq %r14, %rdi
movl %eax, %ebx
callq 0x93b8
movl %ebx, %eax
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: lodepng_state_init(LodePNGState*)
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:
pushq %rbx
movabsq $0x100000001, %rax      # imm = 0x100000001
vxorps %xmm0, %xmm0, %xmm0
movq %rdi, %rbx
movq %rax, 0x2c(%rdi)
andl $0x0, 0x34(%rdi)
andl $0x0, 0x8(%rdi)
vmovups %xmm0, 0x10(%rdi)
vmovups %xmm0, 0x1c(%rdi)
addq $0x38, %rdi
callq 0x94b8
movabsq $0x800000006, %rax      # imm = 0x800000006
leaq 0xb8(%rbx), %rdi
vxorps %xmm0, %xmm0, %xmm0
movq %rax, 0x90(%rbx)
vmovups %ymm0, 0x98(%rbx)
vzeroupper
callq 0x63e0
movl $0x1, 0x1a0(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: lodepng_decode_file(unsigned char**, unsigned int*, unsigned int*, char const*, LodePNGColorType, unsigned int)
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
leaq 0x20(%rsp), %r12
movq %rsi, %r15
leaq 0x18(%rsp), %rsi
movq %rdx, %r14
movq %rdi, %r13
movl %r9d, %ebp
movl %r8d, 0x14(%rsp)
movq %rcx, %rdx
andq $0x0, (%r12)
movq %r12, %rdi
callq 0x3bad
movq (%r12), %r12
movl %eax, %ebx
testl %eax, %eax
jne 0x9461
movq 0x18(%rsp), %r8
movl 0x14(%rsp), %r9d
movl %ebp, (%rsp)
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r12, %rcx
callq 0x92c7
movl %eax, %ebx
movq %r12, %rdi
callq 0x2180
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: lodepng_encoder_settings_init(LodePNGEncoderSettings*)
void lodepng_compress_settings_init(LodePNGCompressSettings* settings)
{
  /*compress with dynamic huffman tree (not in the mathematical sense, just not the predefined one)*/
  settings->btype = 2;
  settings->use_lz77 = 1;
  settings->windowsize = DEFAULT_WINDOWSIZE;
  settings->minmatch = 3;
  settings->nicematch = 128;
  settings->lazymatching = 1;

  settings->custom_zlib = 0;
  settings->custom_deflate = 0;
  settings->custom_context = 0;
}

// Assembly:
vmovaps 0x4e80(%rip), %xmm0     # 0xe340
movabsq $0x100000080, %rax      # imm = 0x100000080
vmovups %xmm0, (%rdi)
movq %rax, 0x10(%rdi)
andq $0x0, 0x28(%rdi)
vxorps %xmm0, %xmm0, %xmm0
vmovups %xmm0, 0x18(%rdi)
pushq $0x1
popq %rax
movabsq $0x100000001, %rcx      # imm = 0x100000001
movl %eax, 0x38(%rdi)
movq %rcx, 0x30(%rdi)
vmovups %xmm0, 0x40(%rdi)
movl %eax, 0x50(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: lodepng_state_copy(LodePNGState*, LodePNGState const*)
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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
callq 0x93b8
leaq 0x8(%rbx), %rdi
leaq 0x8(%r14), %rsi
movl $0x19c, %edx            # imm = 0x19C
callq 0x20d0
movl $0x90, %r12d
movabsq $0x800000006, %rax      # imm = 0x800000006
leaq 0xb8(%rbx), %r15
vxorps %xmm0, %xmm0, %xmm0
movq %rax, 0x90(%rbx)
movq %r15, %rdi
leaq (%rbx,%r12), %r13
vmovups %ymm0, 0x98(%rbx)
vzeroupper
callq 0x63e0
addq %r14, %r12
movq %r13, %rdi
movq %r12, %rsi
callq 0x5e80
movl %eax, 0x1a0(%rbx)
testl %eax, %eax
jne 0x958c
addq $0xb8, %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x649d
movl %eax, 0x1a0(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: addUnknownChunks(ucvector*, unsigned char*, unsigned long)
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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0x8(%rdi), %r12
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %r13
movq %r13, %rax
subq %r14, %rax
cmpq %rbx, %rax
jae 0xa6ad
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x5d19
testl %eax, %eax
jne 0xa6af
movq 0x8(%r15), %rax
movq %r13, %rdi
movq %rax, 0x10(%r15)
callq 0x5cf7
movq %rax, %r13
jmp 0xa67b
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: addChunk_PLTE(ucvector*, LodePNGColorMode const*)
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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsp, %r15
andq $0x0, 0x10(%r15)
vxorps %xmm0, %xmm0, %xmm0
movq %rsi, %r14
movq %rdi, %rbx
xorl %r12d, %r12d
vmovaps %xmm0, (%r15)
movq 0x10(%r14), %rax
shlq $0x2, %rax
cmpq %rax, %r12
je 0xa70a
movl %r12d, %eax
notl %eax
testb $0x3, %al
je 0xa705
movq 0x8(%r14), %rax
movq %r15, %rdi
movzbl (%rax,%r12), %esi
callq 0x5b34
incq %r12
jmp 0xa6de
movq %rsp, %r14
movq (%r14), %rdx
movq 0x8(%r14), %rcx
leaq 0x556e(%rip), %rsi      # 0xfc89
movq %rbx, %rdi
callq 0xcd91
movq %r14, %rdi
callq 0xbf52
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: addChunk_tRNS(ucvector*, LodePNGColorMode const*)
static unsigned addChunk_tRNS(ucvector* out, const LodePNGColorMode* info)
{
  unsigned error = 0;
  size_t i;
  ucvector tRNS;
  ucvector_init(&tRNS);
  if(info->colortype == LCT_PALETTE)
  {
    size_t 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) --amount;
      else break;
    }
    /*add only alpha channel*/
    for(i = 0; i != amount; ++i) ucvector_push_back(&tRNS, info->palette[4 * i + 3]);
  }
  else if(info->colortype == LCT_GREY)
  {
    if(info->key_defined)
    {
      ucvector_push_back(&tRNS, (unsigned char)(info->key_r >> 8));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_r & 255));
    }
  }
  else if(info->colortype == LCT_RGB)
  {
    if(info->key_defined)
    {
      ucvector_push_back(&tRNS, (unsigned char)(info->key_r >> 8));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_r & 255));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_g >> 8));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_g & 255));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_b >> 8));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_b & 255));
    }
  }

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

  return error;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
vxorps %xmm0, %xmm0, %xmm0
andq $0x0, 0x10(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
vmovaps %xmm0, (%rsp)
movl (%rsi), %eax
testl %eax, %eax
je 0xa7f1
cmpl $0x2, %eax
je 0xa7af
cmpl $0x3, %eax
jne 0xa81a
movq 0x10(%r14), %rax
movq %rax, %r12
subq $0x1, %rax
jb 0xa789
movq 0x8(%r14), %rcx
cmpb $-0x1, 0x3(%rcx,%rax,4)
je 0xa775
xorl %r13d, %r13d
movq %rsp, %r15
cmpq %r13, %r12
je 0xa81a
movq 0x8(%r14), %rax
movq %r15, %rdi
movzbl 0x3(%rax,%r13,4), %esi
callq 0x5b34
incq %r13
jmp 0xa78f
cmpl $0x0, 0x18(%r14)
je 0xa81a
movzbl 0x1d(%r14), %esi
movq %rsp, %r15
movq %r15, %rdi
callq 0x5b34
movzbl 0x1c(%r14), %esi
movq %r15, %rdi
callq 0x5b34
movzbl 0x21(%r14), %esi
movq %r15, %rdi
callq 0x5b34
movzbl 0x20(%r14), %esi
movq %r15, %rdi
callq 0x5b34
pushq $0x24
jmp 0xa7fa
cmpl $0x0, 0x18(%r14)
je 0xa81a
pushq $0x1c
popq %r12
movzbl 0x1(%r14,%r12), %esi
movq %rsp, %r15
movq %r15, %rdi
callq 0x5b34
movzbl (%r14,%r12), %esi
movq %r15, %rdi
callq 0x5b34
movq %rsp, %r14
movq (%r14), %rdx
movq 0x8(%r14), %rcx
leaq 0x5463(%rip), %rsi      # 0xfc8e
movq %rbx, %rdi
callq 0xcd91
movq %r14, %rdi
callq 0xbf52
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: addChunk_tEXt(ucvector*, char const*, char const*)
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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsp, %r12
andq $0x0, 0x10(%r12)
vxorps %xmm0, %xmm0, %xmm0
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
vmovaps %xmm0, (%r12)
pushq $-0x50
popq %r13
movb 0x50(%r15,%r13), %al
testb %al, %al
je 0xa88f
movzbl %al, %esi
movq %r12, %rdi
callq 0x5b34
incq %r13
jmp 0xa876
cmpq $-0x4f, %r13
jb 0xa8da
movq %rsp, %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x5b34
movb (%r14), %al
testb %al, %al
je 0xa8b9
movzbl %al, %esi
movq %r15, %rdi
callq 0x5b34
incq %r14
jmp 0xa8a2
movq %rsp, %r14
movq (%r14), %rdx
movq 0x8(%r14), %rcx
leaq 0x53ce(%rip), %rsi      # 0xfc98
movq %rbx, %rdi
callq 0xcd91
movq %r14, %rdi
callq 0xbf52
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: lodepng_encode_memory(unsigned char**, unsigned long*, unsigned char const*, unsigned int, unsigned int, LodePNGColorType, unsigned int)
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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
leaq 0xa498(%rip), %rax      # 0x14d98
leaq 0x10(%rsp), %rbp
movq %rdi, %r13
movl %r9d, %ebx
movl %r8d, 0xc(%rsp)
movl %ecx, %r14d
movq %rdx, %r15
movq %rsi, %r12
movq %rbp, %rdi
movq %rax, (%rbp)
callq 0x934f
movl 0x1f0(%rsp), %eax
movl 0xc(%rsp), %r8d
movl %ebx, 0x90(%rbp)
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movl %r14d, %ecx
movq %rbp, %r9
movl %eax, 0x94(%rbp)
movl %ebx, 0xc8(%rbp)
movl %eax, 0xcc(%rbp)
callq 0x9596
movl 0x1a0(%rbp), %ebx
movq %rbp, %rdi
callq 0x93b8
movl %ebx, %eax
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: lodepng_encode_file(char const*, unsigned char const*, unsigned int, unsigned int, LodePNGColorType, unsigned int)
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
leaq 0x18(%rsp), %r14
leaq 0x10(%rsp), %rsi
movq %rdi, %rbx
movl %r9d, (%rsp)
movl %eax, %r9d
movq %r14, %rdi
callq 0xa8e8
movq (%r14), %r14
movl %eax, %ebp
testl %eax, %eax
jne 0xa9ef
movq 0x10(%rsp), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x3ccf
movl %eax, %ebp
movq %r14, %rdi
callq 0x2180
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: lodepng::load_file(std::vector<unsigned char, std::allocator<unsigned char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
unsigned load_file(std::vector<unsigned char>& buffer, const std::string& filename)
{
  long size = lodepng_filesize(filename.c_str());
  if(size < 0) return 78;
  buffer.resize((size_t)size);
  return size == 0 ? 0 : lodepng_buffer_file(&buffer[0], (size_t)size, filename.c_str());
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movq (%rsi), %rdi
movq %rsi, %rbx
callq 0x3c16
testq %rax, %rax
js 0xaa78
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0xcdba
testq %r15, %r15
je 0xaa7d
movq (%r14), %rdi
movq (%rbx), %rdx
movq %r15, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x3c7b
pushq $0x4e
popq %rax
jmp 0xaa7f
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: lodepng::decompress(std::vector<unsigned char, std::allocator<unsigned char>>&, unsigned char const*, unsigned long, LodePNGDecompressSettings const&)
unsigned decompress(std::vector<unsigned char>& out, const unsigned char* in, size_t insize,
                    const LodePNGDecompressSettings& settings)
{
  unsigned char* buffer = 0;
  size_t buffersize = 0;
  unsigned error = zlib_decompress(&buffer, &buffersize, in, insize, &settings);
  if(buffer)
  {
    out.insert(out.end(), &buffer[0], &buffer[buffersize]);
    lodepng_free(buffer);
  }
  return error;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x8(%rsp), %r14
movq %rcx, %r8
movq %rdx, %rcx
movq %rsi, %rdx
movq %rsp, %rsi
andq $0x0, (%rsi)
movq %rdi, %rbx
andq $0x0, (%r14)
movq %r14, %rdi
callq 0xaafe
movq (%r14), %rdx
movl %eax, %ebp
testq %rdx, %rdx
je 0xaaf3
movq (%rsp), %rcx
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
addq %rdx, %rcx
callq 0xcde6
movq 0x8(%rsp), %rdi
callq 0x2180
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: lodepng::compress(std::vector<unsigned char, std::allocator<unsigned char>>&, unsigned char const*, unsigned long, LodePNGCompressSettings const&)
unsigned compress(std::vector<unsigned char>& out, const unsigned char* in, size_t insize,
                  const LodePNGCompressSettings& settings)
{
  unsigned char* buffer = 0;
  size_t buffersize = 0;
  unsigned error = zlib_compress(&buffer, &buffersize, in, insize, &settings);
  if(buffer)
  {
    out.insert(out.end(), &buffer[0], &buffer[buffersize]);
    lodepng_free(buffer);
  }
  return error;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x8(%rsp), %r14
movq %rcx, %r8
movq %rdx, %rcx
movq %rsi, %rdx
movq %rsp, %rsi
andq $0x0, (%rsi)
movq %rdi, %rbx
andq $0x0, (%r14)
movq %r14, %rdi
callq 0xab83
movq (%r14), %rdx
movl %eax, %ebp
testq %rdx, %rdx
je 0xab78
movq (%rsp), %rcx
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
addq %rdx, %rcx
callq 0xcde6
movq 0x8(%rsp), %rdi
callq 0x2180
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: lodepng::decode(std::vector<unsigned char, std::allocator<unsigned char>>&, unsigned int&, unsigned int&, unsigned char const*, unsigned long, LodePNGColorType, unsigned int)
unsigned decode(std::vector<unsigned char>& out, unsigned& w, unsigned& h, const unsigned char* in,
                size_t insize, LodePNGColorType colortype, unsigned bitdepth)
{
  unsigned char* buffer;
  unsigned error = lodepng_decode_memory(&buffer, &w, &h, in, insize, colortype, bitdepth);
  if(buffer && !error)
  {
    State state;
    state.info_raw.colortype = colortype;
    state.info_raw.bitdepth = bitdepth;
    size_t buffersize = lodepng_get_raw_size(w, h, &state.info_raw);
    out.insert(out.end(), &buffer[0], &buffer[buffersize]);
    lodepng_free(buffer);
  }
  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
movl 0x1f0(%rsp), %eax
leaq 0x8(%rsp), %r15
movq %rdi, %r14
movl %r9d, %ebp
movq %rdx, %r12
movq %rsi, %r13
movq %r15, %rdi
movl %eax, (%rsp)
callq 0x92c7
movq (%r15), %r15
movl %eax, %ebx
testq %r15, %r15
sete %al
testl %ebx, %ebx
setne %cl
orb %al, %cl
jne 0xacae
leaq 0x10(%rsp), %rdi
callq 0xabaa
movl 0x1f0(%rsp), %eax
leaq 0xa0(%rsp), %rdx
movl %ebp, (%rdx)
movl %eax, 0x4(%rdx)
movl (%r13), %edi
movl (%r12), %esi
callq 0x5fee
movq 0x8(%r14), %rsi
leaq (%rax,%r15), %rcx
movq %r14, %rdi
movq %r15, %rdx
callq 0xcde6
movq %r15, %rdi
callq 0x2180
leaq 0x10(%rsp), %rdi
callq 0xabe6
movl %ebx, %eax
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10(%rsp), %rdi
movq %rax, %rbx
callq 0xabe6
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: lodepng::decode(std::vector<unsigned char, std::allocator<unsigned char>>&, unsigned int&, unsigned int&, lodepng::State&, unsigned char const*, unsigned long)
unsigned decode(std::vector<unsigned char>& out, unsigned& w, unsigned& h,
                State& state,
                const unsigned char* in, size_t insize)
{
  unsigned char* buffer = NULL;
  unsigned error = lodepng_decode(&buffer, &w, &h, &state, in, insize);
  if(buffer && !error)
  {
    size_t buffersize = lodepng_get_raw_size(w, h, &state.info_raw);
    out.insert(out.end(), &buffer[0], &buffer[buffersize]);
  }
  lodepng_free(buffer);
  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsp, %r15
andq $0x0, (%r15)
movq %rdi, %rbx
movq %r15, %rdi
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r13
callq 0x7f74
movq (%r15), %r15
movl %eax, %ebp
testq %r15, %r15
sete %al
testl %ebp, %ebp
setne %cl
orb %al, %cl
jne 0xad60
movl (%r13), %edi
movl (%r12), %esi
addq $0x90, %r14
movq %r14, %rdx
callq 0x5fee
movq 0x8(%rbx), %rsi
leaq (%rax,%r15), %rcx
movq %rbx, %rdi
movq %r15, %rdx
callq 0xcde6
movq %r15, %rdi
callq 0x2180
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: lodepng::decode(std::vector<unsigned char, std::allocator<unsigned char>>&, unsigned int&, unsigned int&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, LodePNGColorType, unsigned int)
unsigned decode(std::vector<unsigned char>& out, unsigned& w, unsigned& h, const std::string& filename,
                LodePNGColorType colortype, unsigned bitdepth)
{
  std::vector<unsigned char> buffer;
  unsigned error = load_file(buffer, filename);
  if(error) return error;
  return decode(out, w, h, buffer, colortype, bitdepth);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r13
movq %rsp, %rdi
andq $0x0, 0x10(%rdi)
vxorps %xmm0, %xmm0, %xmm0
movl %r9d, %ebx
movl %r8d, %ebp
movq %rdx, %r14
movq %rsi, %r15
vmovaps %xmm0, (%rdi)
movq %rcx, %rsi
callq 0xaa3a
movl %eax, %r12d
testl %eax, %eax
jne 0xade5
movq %rsp, %rcx
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebp, %r8d
movl %ebx, %r9d
callq 0xacd7
movl %eax, %r12d
movq %rsp, %rdi
callq 0x3b4c
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsp, %rdi
movq %rax, %rbx
callq 0x3b4c
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: lodepng::encode(std::vector<unsigned char, std::allocator<unsigned char>>&, unsigned char const*, unsigned int, unsigned int, LodePNGColorType, unsigned int)
unsigned encode(std::vector<unsigned char>& out, const unsigned char* in, unsigned w, unsigned h,
                LodePNGColorType colortype, unsigned bitdepth)
{
  unsigned char* buffer;
  size_t buffersize;
  unsigned error = lodepng_encode_memory(&buffer, &buffersize, in, w, h, colortype, bitdepth);
  if(buffer)
  {
    out.insert(out.end(), &buffer[0], &buffer[buffersize]);
    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
leaq 0x18(%rsp), %r14
leaq 0x10(%rsp), %rsi
movq %rdi, %rbx
movl %r9d, (%rsp)
movl %eax, %r9d
movq %r14, %rdi
callq 0xa8e8
movq (%r14), %r14
movl %eax, %ebp
testq %r14, %r14
je 0xae6a
movq 0x10(%rsp), %rcx
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
movq %r14, %rdx
addq %r14, %rcx
callq 0xcde6
movq %r14, %rdi
callq 0x2180
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: lodepng::encode(std::vector<unsigned char, std::allocator<unsigned char>>&, unsigned char const*, unsigned int, unsigned int, lodepng::State&)
unsigned encode(std::vector<unsigned char>& out,
                const unsigned char* in, unsigned w, unsigned h,
                State& state)
{
  unsigned char* buffer;
  size_t buffersize;
  unsigned error = lodepng_encode(&buffer, &buffersize, in, w, h, &state);
  if(buffer)
  {
    out.insert(out.end(), &buffer[0], &buffer[buffersize]);
    lodepng_free(buffer);
  }
  return error;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x8(%rsp), %r14
movq %r8, %r9
movl %ecx, %r8d
movl %edx, %ecx
movq %rsi, %rdx
movq %rdi, %rbx
movq %rsp, %rsi
movq %r14, %rdi
callq 0x9596
movq (%r14), %r14
movl %eax, %ebp
testq %r14, %r14
je 0xaf3f
movq (%rsp), %rcx
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
movq %r14, %rdx
addq %r14, %rcx
callq 0xcde6
movq %r14, %rdi
callq 0x2180
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: lodepng::encode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned char const*, unsigned int, unsigned int, LodePNGColorType, unsigned int)
unsigned encode(const std::string& filename,
                const unsigned char* in, unsigned w, unsigned h,
                LodePNGColorType colortype, unsigned bitdepth)
{
  std::vector<unsigned char> buffer;
  unsigned error = encode(buffer, in, w, h, colortype, bitdepth);
  if(!error) error = save_file(buffer, filename);
  return error;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq %rsp, %rdi
andq $0x0, 0x10(%rdi)
vxorps %xmm0, %xmm0, %xmm0
vmovaps %xmm0, (%rdi)
callq 0xae12
movl %eax, %ebp
testl %eax, %eax
jne 0xafe3
movq %rsp, %rdi
movq %rbx, %rsi
callq 0xaa85
movl %eax, %ebp
movq %rsp, %rdi
callq 0x3b4c
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
movq %rsp, %rdi
movq %rax, %rbx
callq 0x3b4c
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: ucvector_reserve(ucvector*, unsigned long)
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
pushq $0x1
popq %rbx
cmpq %rsi, %rax
jae 0xb0e9
movq %rdi, %r14
movq (%rdi), %rdi
leaq (%rsi,%rsi,2), %r15
addq %rax, %rax
shrq %r15
cmpq %rsi, %rax
cmovbq %rsi, %r15
movq %r15, %rsi
callq 0x2260
testq %rax, %rax
je 0xb0e7
movq %r15, 0x10(%r14)
movq %rax, (%r14)
jmp 0xb0e9
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: huffmanDecodeSymbol(unsigned char const*, unsigned long*, HuffmanTree const*, unsigned long)
static unsigned huffmanDecodeSymbol(const unsigned char* in, size_t* bp,
                                    const HuffmanTree* codetree, size_t inbitlength)
{
  unsigned treepos = 0, ct;
  for(;;)
  {
    if(*bp >= inbitlength) return (unsigned)(-1); /*error: end of input memory reached without endcode*/
    /*
    decode the symbol from the tree. The "readBitFromStream" code is inlined in
    the expression below because this is the biggest bottleneck while decoding
    */
    ct = codetree->tree2d[(treepos << 1) + READBIT(*bp, in)];
    ++(*bp);
    if(ct < codetree->numcodes) return ct; /*the symbol is decoded, return it*/
    else treepos = ct - codetree->numcodes; /*symbol not yet decoded, instead move tree position*/

    if(treepos >= codetree->numcodes) return (unsigned)(-1); /*error: it appeared outside the codetree*/
  }
}

// Assembly:
pushq %rbx
movq (%rsi), %r9
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r10d, %r10d
cmpq %rcx, %r9
jae 0xb140
movq %r9, %r11
shrq $0x3, %r11
movl %r9d, %ebx
movq (%rdx), %rax
incq %r9
movzbl (%rdi,%r11), %r11d
andb $0x7, %bl
shrxl %ebx, %r11d, %r11d
andl $0x1, %r11d
leal (%r11,%r10,2), %r10d
movl (%rax,%r10,4), %eax
movq %r9, (%rsi)
movl 0x1c(%rdx), %r11d
movl %eax, %r10d
subl %r11d, %r10d
jb 0xb143
cmpl %r11d, %r10d
jb 0xb0fe
movl %r8d, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: readBitsFromStream(unsigned long*, unsigned char const*, unsigned long)
static unsigned readBitsFromStream(size_t* bitpointer, const unsigned char* bitstream, size_t nbits)
{
  unsigned result = 0, i;
  for(i = 0; i != nbits; ++i)
  {
    result += ((unsigned)READBIT(*bitpointer, bitstream)) << i;
    ++(*bitpointer);
  }
  return result;
}

// Assembly:
xorl %eax, %eax
xorl %ecx, %ecx
movl %ecx, %r8d
cmpq %rdx, %r8
je 0xb182
movq (%rdi), %r8
movq %r8, %r9
shrq $0x3, %r9
movl %r8d, %r10d
incq %r8
movzbl (%rsi,%r9), %r9d
andb $0x7, %r10b
movq %r8, (%rdi)
shrxl %r10d, %r9d, %r9d
andl $0x1, %r9d
shlxl %ecx, %r9d, %r9d
incl %ecx
addl %r9d, %eax
jmp 0xb149
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: generateFixedLitLenTree(HuffmanTree*)
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 0x21c0
testq %rax, %rax
je 0xb242
movq %rax, %rbx
xorl %eax, %eax
cmpq $0x90, %rax
je 0xb1d5
movl $0x8, (%rbx,%rax,4)
incq %rax
jmp 0xb1c1
movl $0x90, %eax
cmpq $0x100, %rax            # imm = 0x100
je 0xb1ee
movl $0x9, (%rbx,%rax,4)
incq %rax
jmp 0xb1da
movl $0x100, %eax            # imm = 0x100
cmpq $0x118, %rax            # imm = 0x118
je 0xb207
movl $0x7, (%rbx,%rax,4)
incq %rax
jmp 0xb1f3
movl $0x118, %eax            # imm = 0x118
cmpq $0x120, %rax            # imm = 0x120
je 0xb220
movl $0x8, (%rbx,%rax,4)
incq %rax
jmp 0xb20c
pushq $0xf
popq %rcx
movl $0x120, %edx            # imm = 0x120
movq %r14, %rdi
movq %rbx, %rsi
callq 0xb29f
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2180
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: generateFixedDistanceTree(HuffmanTree*)
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 0x21c0
testq %rax, %rax
je 0xb297
movq %rax, %rbx
xorl %eax, %eax
cmpq $0x20, %rax
je 0xb277
movl $0x5, (%rbx,%rax,4)
incq %rax
jmp 0xb265
pushq $0x20
popq %rdx
pushq $0xf
popq %rcx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xb29f
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2180
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: HuffmanTree_makeFromLengths(HuffmanTree*, unsigned int const*, unsigned long, unsigned int)
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
movq %rdi, %r14
leaq (,%rdx,4), %rdi
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r12
callq 0x21c0
movq %rax, 0x10(%r14)
testq %rax, %rax
je 0xb2f4
xorl %ecx, %ecx
movl %ecx, %ecx
cmpq %r15, %rcx
je 0xb2dc
movl (%r12,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
incl %ecx
jmp 0xb2ca
movl %r15d, 0x1c(%r14)
movl %ebx, 0x18(%r14)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xb303
pushq $0x53
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: writeLZ77data(unsigned long*, ucvector*, uivector const*, HuffmanTree const*, HuffmanTree const*)
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)
movq %rcx, %rbp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
xorl %r14d, %r14d
cmpq 0x8(%r15), %r14
je 0xbb28
movq (%r15), %rax
movq 0x8(%rbp), %rsi
movq 0x10(%rbp), %rcx
movq %r13, %rdi
movl (%rax,%r14,4), %ebx
movl (%rsi,%rbx,4), %edx
movl (%rcx,%rbx,4), %ecx
movq %r12, %rsi
callq 0xbb37
cmpq $0x101, %rbx            # imm = 0x101
jb 0xbb20
addl $0xfffffeff, %ebx       # imm = 0xFFFFFEFF
leaq 0x2eaf(%rip), %rax      # 0xe960
leaq 0x2fa8(%rip), %rsi      # 0xea60
movq %r13, %rdi
movl (%rax,%rbx,4), %ecx
movq (%r15), %rax
movq %rbp, %rbx
movl 0x8(%rax,%r14,4), %ebp
movl 0x4(%rax,%r14,4), %edx
movl 0xc(%rax,%r14,4), %eax
addq $0x3, %r14
movl (%rsi,%rbp,4), %esi
movl %eax, 0x4(%rsp)
movq %rsi, 0x10(%rsp)
movq %r12, %rsi
callq 0xbcc3
movq 0x8(%rsp), %rcx
movq %r13, %rdi
movq %r12, %rsi
movq 0x8(%rcx), %rax
movq 0x10(%rcx), %rcx
movl (%rax,%rbp,4), %edx
movl (%rcx,%rbp,4), %ecx
movq %rbx, %rbp
callq 0xbb37
movl 0x4(%rsp), %edx
movq 0x10(%rsp), %rcx
movq %r13, %rdi
movq %r12, %rsi
callq 0xbcc3
incq %r14
jmp 0xba71
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: getHash(unsigned char const*, unsigned long, unsigned long)
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 0xbbb7
movzbl 0x1(%rdi,%rdx), %ecx
movzbl (%rdi,%rdx), %eax
shll $0x4, %ecx
xorl %eax, %ecx
movzbl 0x2(%rdi,%rdx), %eax
shll $0x8, %eax
xorl %ecx, %eax
movzwl %ax, %eax
jmp 0xbbdc
xorl %eax, %eax
cmpq %rsi, %rdx
jae 0xbbdc
xorl %ecx, %ecx
xorl %eax, %eax
cmpq %rdx, %rsi
je 0xbbb2
movzbl (%rdi,%rdx), %r8d
incq %rdx
shlxl %ecx, %r8d, %r8d
addl $0x8, %ecx
xorl %r8d, %eax
jmp 0xbbc2
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: countZeros(unsigned char const*, unsigned long, unsigned long)
static unsigned countZeros(const unsigned char* data, size_t size, size_t pos)
{
  const unsigned char* start = data + pos;
  const unsigned char* end = start + MAX_SUPPORTED_DEFLATE_LENGTH;
  if(end > data + size) end = data + size;
  data = start;
  while(data != end && *data == 0) ++data;
  /*subtracting two addresses returned as 32-bit number (max value is MAX_SUPPORTED_DEFLATE_LENGTH)*/
  return (unsigned)(data - start);
}

// Assembly:
leaq (%rdi,%rdx), %rcx
leaq 0x102(%rdi,%rdx), %rdx
movq %rsi, %rax
addq %rdi, %rax
cmpq %rax, %rdx
cmovbeq %rdx, %rax
movq %rcx, %rdx
cmpq %rax, %rdx
je 0xbc0b
cmpb $0x0, (%rdx)
jne 0xbc08
incq %rdx
jmp 0xbbf9
movq %rdx, %rax
subl %ecx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: updateHashChain(Hash*, unsigned long, unsigned int, unsigned short)
static void updateHashChain(Hash* hash, size_t wpos, unsigned hashval, unsigned short numzeros)
{
  hash->val[wpos] = (int)hashval;
  if(hash->head[hashval] != -1) hash->chain[wpos] = hash->head[hashval];
  hash->head[hashval] = wpos;

  hash->zeros[wpos] = numzeros;
  if(hash->headz[numzeros] != -1) hash->chainz[wpos] = hash->headz[numzeros];
  hash->headz[numzeros] = wpos;
}

// Assembly:
movq 0x10(%rdi), %rax
movl %edx, (%rax,%rsi,4)
movl %edx, %edx
movq (%rdi), %rax
movl (%rax,%rdx,4), %r8d
cmpl $-0x1, %r8d
je 0xbc2d
movq 0x8(%rdi), %r9
movw %r8w, (%r9,%rsi,2)
movl %esi, (%rax,%rdx,4)
movq 0x28(%rdi), %rax
movw %cx, (%rax,%rsi,2)
movzwl %cx, %ecx
movq 0x18(%rdi), %rax
movl (%rax,%rcx,4), %edx
cmpl $-0x1, %edx
je 0xbc4f
movq 0x20(%rdi), %rdi
movw %dx, (%rdi,%rsi,2)
movl %esi, (%rax,%rcx,4)
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: searchCodeIndex(unsigned int const*, unsigned long, unsigned long)
static size_t searchCodeIndex(const unsigned* array, size_t array_size, size_t value)
{
  /*binary search (only small gain over linear). TODO: use CPU log2 instruction for getting symbols instead*/
  size_t left = 1;
  size_t right = array_size - 1;

  while(left <= right) {
    size_t mid = (left + right) >> 1;
    if (array[mid] >= value) right = mid - 1;
    else left = mid + 1;
  }
  if(left >= array_size || array[left] > value) left--;
  return left;
}

// Assembly:
leaq -0x1(%rsi), %rcx
pushq $0x1
popq %rax
cmpq %rcx, %rax
ja 0xbcb2
leaq (%rax,%rcx), %r8
shrq %r8
movl (%rdi,%r8,4), %r9d
cmpq %rdx, %r9
jb 0xbcaa
decq %r8
movq %r8, %rcx
jmp 0xbc8d
incq %r8
movq %r8, %rax
jmp 0xbc8d
cmpq %rsi, %rax
jae 0xbcbf
movl (%rdi,%rax,4), %ecx
cmpq %rdx, %rcx
jbe 0xbcc2
decq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: HuffmanTree_makeFromFrequencies(HuffmanTree*, unsigned int const*, unsigned long, unsigned long, unsigned int)
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
movq %rsi, %r15
leaq 0x4(,%rcx,4), %rsi
movl %r8d, %ebp
movq %rcx, %r14
movq %rdi, %rbx
pushq $0x1
popq %rax
xorl %ecx, %ecx
leaq (%r14,%rcx), %rdi
leaq -0x4(%rsi), %r12
decq %rax
cmpq %rdx, %rdi
jbe 0xbd5f
decq %rcx
cmpl $0x0, -0x8(%r15,%rsi)
movq %r12, %rsi
je 0xbd41
addq %rax, %r14
movl %ebp, 0x18(%rbx)
movq %r12, %rsi
movl %r14d, 0x1c(%rbx)
movq 0x10(%rbx), %rdi
callq 0x2260
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0xbdb8
movq %rax, %r13
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x20a0
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x3d17
testl %eax, %eax
jne 0xbdbb
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb303
pushq $0x53
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: string_resize(char**, unsigned long)
static unsigned string_resize(char** out, size_t size)
{
  char* data = (char*)lodepng_realloc(*out, size + 1);
  if(data)
  {
    data[size] = 0; /*null termination char*/
    *out = data;
  }
  return data != 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
movq %rsi, %r14
incq %rsi
callq 0x2260
testq %rax, %rax
je 0xbdfe
movb $0x0, (%rax,%r14)
movq %rax, (%rbx)
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: readBitsFromReversedStream(unsigned long*, unsigned char const*, unsigned long)
static unsigned readBitsFromReversedStream(size_t* bitpointer, const unsigned char* bitstream, size_t nbits)
{
  unsigned result = 0;
  size_t i;
  for(i = 0 ; i < nbits; ++i)
  {
    result <<= 1;
    result |= (unsigned)readBitFromReversedStream(bitpointer, bitstream);
  }
  return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
xorl %r15d, %r15d
subq $0x1, %rbx
jb 0xbe3e
movq %r12, %rdi
movq %r14, %rsi
callq 0xbe4d
movzbl %al, %eax
leal (%rax,%r15,2), %r15d
jmp 0xbe24
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: addColorBits(unsigned char*, unsigned long, unsigned int, unsigned int)
static void addColorBits(unsigned char* out, size_t index, unsigned bits, unsigned in)
{
  unsigned m = bits == 1 ? 7 : bits == 2 ? 3 : 1; /*8 / bits - 1*/
  /*p = the partial index in the byte, e.g. with 4 palettebits it is 0 for first half or 1 for second half*/
  unsigned p = index & m;
  in &= (1u << bits) - 1u; /*filter out any other bits of the input value*/
  in = in << (bits * (m - p));
  if(p == 0) out[index * bits / 8] = in;
  else out[index * bits / 8] |= in;
}

// Assembly:
xorl %eax, %eax
cmpl $0x2, %edx
sete %al
cmpl $0x1, %edx
leal 0x1(%rax,%rax), %eax
pushq $0x7
popq %r8
cmovnel %eax, %r8d
movl %esi, %r9d
bzhil %edx, %ecx, %eax
movl %edx, %ecx
imulq %rsi, %rcx
andl %r8d, %r9d
subl %r9d, %r8d
imull %edx, %r8d
shrq $0x3, %rcx
shlxl %r8d, %eax, %eax
testl %r9d, %r9d
je 0xbeb3
orb %al, (%rdi,%rcx)
retq
movb %al, (%rdi,%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: color_tree_get(ColorTree*, unsigned char, unsigned char, unsigned char, unsigned char)
static int color_tree_get(ColorTree* tree, unsigned char r, unsigned char g, unsigned char b, unsigned char a)
{
  int bit = 0;
  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]) return -1;
    else tree = tree->children[i];
  }
  return tree ? tree->index : -1;
}

// Assembly:
pushq %r14
pushq %rbx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
cmpl $0x8, %r9d
je 0xbf05
shrxl %r9d, %edx, %r11d
shrxl %r9d, %r8d, %r14d
shrxl %r9d, %esi, %r10d
shrxl %r9d, %ecx, %ebx
incl %r9d
andl $0x1, %r11d
andl $0x1, %r14d
andl $0x1, %r10d
andl $0x1, %ebx
leal (%r14,%r11,4), %r11d
leal (%r11,%r10,8), %r10d
leal (%r10,%rbx,2), %r10d
movq (%rdi,%r10,8), %rdi
testq %rdi, %rdi
jne 0xbec2
jmp 0xbf10
testq %rdi, %rdi
je 0xbf10
movl 0x80(%rdi), %eax
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: lodepng_get_raw_size_idat(unsigned int, unsigned int, LodePNGColorMode const*)
static size_t lodepng_get_raw_size_idat(unsigned w, unsigned h, const LodePNGColorMode* color)
{
  /*will not overflow for any color type if roughly w * h < 268435455*/
  size_t bpp = lodepng_get_bpp(color);
  size_t line = ((w / 8) * bpp) + ((w & 7) * bpp + 7) / 8;
  return h * line;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %r14d
movq %rdx, %rdi
movl %esi, %ebx
callq 0x5f6e
movl %r14d, %ecx
andl $0x7, %r14d
movl %eax, %eax
shrl $0x3, %ecx
imulq %rax, %r14
imulq %rax, %rcx
movl %ebx, %eax
addq $0x7, %r14
shrq $0x3, %r14
addq %rcx, %r14
imulq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: removePaddingBits(unsigned char*, unsigned char const*, unsigned long, unsigned long, unsigned int)
static void removePaddingBits(unsigned char* out, const unsigned char* in,
                              size_t olinebits, size_t ilinebits, unsigned h)
{
  /*
  After filtering there are still padding bits if scanlines have non multiple of 8 bit amounts. They need
  to be removed (except at last scanline of (Adam7-reduced) image) before working with pure image buffers
  for the Adam7 code, the color convert code and the output to the user.
  in and out are allowed to be the same buffer, in may also be higher but still overlapping; in must
  have >= ilinebits*h bits, out must have >= olinebits*h bits, olinebits must be <= ilinebits
  also used to move bits after earlier such operations happened, e.g. in a sequence of reduced images from Adam7
  only useful if (ilinebits - olinebits) is a value in the range 1..7
  */
  unsigned y;
  size_t diff = ilinebits - olinebits;
  size_t ibp = 0, obp = 0; /*input and output bit pointers*/
  for(y = 0; y < h; ++y)
  {
    size_t x;
    for(x = 0; x < olinebits; ++x)
    {
      unsigned char bit = readBitFromReversedStream(&ibp, in);
      setBitOfReversedStream(&obp, out, bit);
    }
    ibp += diff;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x20(%rsp), %rbp
movl %r8d, 0x8(%rsp)
movq %rcx, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rsi, %r12
movq %rdi, %r13
xorl %ebx, %ebx
xorl %eax, %eax
andq $0x0, (%rbp)
cmpl 0x8(%rsp), %eax
je 0xc263
movl %eax, 0xc(%rsp)
movq 0x10(%rsp), %rax
movq %rbx, %r14
movq %rax, %r15
subq $0x1, %r15
jb 0xc253
movq %r14, %rax
shrq $0x3, %rax
movl %r14d, %ecx
xorl %edx, %edx
movq %rbp, %rdi
movq %r13, %rsi
movzbl (%r12,%rax), %eax
notb %cl
movzbl %cl, %ecx
andl $0x7, %ecx
btl %ecx, %eax
setb %dl
incq %r14
callq 0xc3dc
movq %r15, %rax
jmp 0xc21b
addq 0x18(%rsp), %rbx
subq %rax, %rbx
movl 0xc(%rsp), %eax
incl %eax
jmp 0xc206
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq