LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: addChunk_zTXt(ucvector*, char const*, char const*, LodeZlib_DeflateSettings*)
static unsigned addChunk_zTXt(ucvector* out, const char* keyword, const char* textstring, LodeZlib_DeflateSettings* zlibsettings)
{
  unsigned error = 0;
  ucvector data, compressed;
  size_t i, textsize = strlen(textstring);
  
  ucvector_init(&data);
  ucvector_init(&compressed);
  for(i = 0; keyword[i] != 0; i++) ucvector_push_back(&data, (unsigned char)keyword[i]);
  ucvector_push_back(&data, 0); /* 0 termination char*/
  ucvector_push_back(&data, 0); /*compression method: 0*/
  
  error = LodePNG_compress(&compressed.data, &compressed.size, (unsigned char*)textstring, textsize, zlibsettings);
  if(!error)
  {
    for(i = 0; i < compressed.size; i++) ucvector_push_back(&data, compressed.data[i]);
    error = addChunk(out, "zTXt", data.data, data.size);
  }
  
  ucvector_cleanup(&compressed);
  ucvector_cleanup(&data);
  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x18(%rbp), %rdi
callq 0x5180
movq %rax, -0x68(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x25960
leaq -0x58(%rbp), %rdi
callq 0x25960
movq $0x0, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq -0x60(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x2b3fa
movq -0x10(%rbp), %rax
movq -0x60(%rbp), %rcx
leaq -0x40(%rbp), %rdi
movzbl (%rax,%rcx), %esi
callq 0x25570
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x2b3c6
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0x25570
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0x25570
leaq -0x58(%rbp), %rdi
leaq -0x58(%rbp), %rsi
addq $0x8, %rsi
movq -0x18(%rbp), %rdx
movq -0x68(%rbp), %rcx
movq -0x20(%rbp), %r8
callq 0x317d0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x2b486
movq $0x0, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x50(%rbp), %rax
jae 0x2b46b
movq -0x58(%rbp), %rax
movq -0x60(%rbp), %rcx
leaq -0x40(%rbp), %rdi
movzbl (%rax,%rcx), %esi
callq 0x25570
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x2b43e
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %rcx
leaq 0x206f3(%rip), %rsi     # 0x4bb71
callq 0x31760
movl %eax, -0x24(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x25990
leaq -0x40(%rbp), %rdi
callq 0x25990
movl -0x24(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: LodePNG_encode32(unsigned char**, unsigned long*, unsigned char const*, unsigned int, unsigned int)
unsigned LodePNG_encode32(unsigned char** out, size_t* outsize, const unsigned char* image, unsigned w, unsigned h)
{
  unsigned error;
  LodePNG_Encoder encoder;
  LodePNG_Encoder_init(&encoder);
  LodePNG_encode(&encoder, out, outsize, image, w, h);
  error = encoder.error;
  LodePNG_Encoder_cleanup(&encoder);
  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x2b8b0
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl -0x1c(%rbp), %r8d
movl -0x20(%rbp), %r9d
leaq -0x158(%rbp), %rdi
callq 0x29d30
movl -0x30(%rbp), %eax
movl %eax, -0x24(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x2b900
movl -0x24(%rbp), %eax
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
nopl (%rax,%rax)
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: LodePNG_Encoder_init(LodePNG_Encoder*)
void LodePNG_Encoder_init(LodePNG_Encoder* encoder)
{
  LodePNG_EncodeSettings_init(&encoder->settings);
  LodePNG_InfoPng_init(&encoder->infoPng);
  LodePNG_InfoRaw_init(&encoder->infoRaw);
  encoder->error = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2ba00
movq -0x8(%rbp), %rdi
addq $0x20, %rdi
callq 0x26d40
movq -0x8(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0x27080
movq -0x8(%rbp), %rax
movl $0x1, 0x128(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: LodePNG_encode32f(char const*, unsigned char const*, unsigned int, unsigned int)
unsigned LodePNG_encode32f(const char* filename, const unsigned char* image, unsigned w, unsigned h)
{
  unsigned char* buffer;
  size_t buffersize;
  unsigned error = LodePNG_encode32(&buffer, &buffersize, image, w, h);
  LodePNG_saveFile(buffer, buffersize, filename);
  free(buffer);
  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq -0x10(%rbp), %rdx
movl -0x14(%rbp), %ecx
movl -0x18(%rbp), %r8d
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x2b840
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x8(%rbp), %rdx
callq 0x2b990
movq -0x20(%rbp), %rdi
callq 0x54b0
movl -0x2c(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: LodePNG_EncodeSettings_init(LodePNG_EncodeSettings*)
void LodePNG_EncodeSettings_init(LodePNG_EncodeSettings* settings)
{
  LodeZlib_DeflateSettings_init(&settings->zlibsettings);
  settings->autoLeaveOutAlphaChannel = 1;
  settings->force_palette = 0;
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
  settings->add_id = 1;
  settings->text_compression = 0;
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x259e0
movq -0x8(%rbp), %rax
movl $0x1, 0xc(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
movl $0x1, 0x14(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x18(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: LodePNG_Encoder_copy(LodePNG_Encoder*, LodePNG_Encoder const*)
void LodePNG_Encoder_copy(LodePNG_Encoder* dest, const LodePNG_Encoder* source)
{
  LodePNG_Encoder_cleanup(dest);
  *dest = *source;
  LodePNG_InfoPng_init(&dest->infoPng);
  LodePNG_InfoRaw_init(&dest->infoRaw);
  dest->error = LodePNG_InfoPng_copy(&dest->infoPng, &source->infoPng); if(dest->error) return;
  dest->error = LodePNG_InfoRaw_copy(&dest->infoRaw, &source->infoRaw); if(dest->error) return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2b900
movq -0x10(%rbp), %rsi
movq -0x8(%rbp), %rdi
movl $0x130, %edx            # imm = 0x130
callq 0x5320
movq -0x8(%rbp), %rdi
addq $0x20, %rdi
callq 0x26d40
movq -0x8(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0x27080
movq -0x8(%rbp), %rdi
addq $0x20, %rdi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
callq 0x26e60
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x128(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x128(%rax)
je 0x2bac8
jmp 0x2bafe
movq -0x8(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
movq -0x10(%rbp), %rsi
addq $0x100, %rsi            # imm = 0x100
callq 0x270c0
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x128(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x128(%rax)
je 0x2bafe
jmp 0x2bafe
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: LodeZlib::decompress(std::vector<unsigned char, std::allocator<unsigned char>>&, std::vector<unsigned char, std::allocator<unsigned char>> const&, LodeZlib_DecompressSettings const&)
unsigned decompress(std::vector<unsigned char>& out, const std::vector<unsigned char>& in, const LodeZlib_DecompressSettings& settings)
  {
    unsigned char* buffer = 0;
    size_t buffersize = 0;
    unsigned error = LodeZlib_decompress(&buffer, &buffersize, in.empty() ? 0 : &in[0], in.size(), &settings);
    if(buffer)
    {
      out.insert(out.end(), &buffer[0], &buffer[buffersize]);
      free(buffer);
    }
    return error;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x22f40
testb $0x1, %al
jne 0x2bb43
jmp 0x2bb4b
xorl %eax, %eax
movq %rax, -0x50(%rbp)
jmp 0x2bb5c
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x31810
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
callq 0x22fa0
movq -0x58(%rbp), %rdx
movq %rax, %rcx
movq -0x18(%rbp), %r8
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x25610
movl %eax, -0x2c(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x2bbd7
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
callq 0x22e50
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x318d0
movq -0x60(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x20(%rbp), %rcx
addq -0x28(%rbp), %rcx
movq -0x38(%rbp), %rsi
callq 0x31830
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rdi
callq 0x54b0
movl -0x2c(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: LodeZlib::compress(std::vector<unsigned char, std::allocator<unsigned char>>&, std::vector<unsigned char, std::allocator<unsigned char>> const&, LodeZlib_DeflateSettings const&)
unsigned compress(std::vector<unsigned char>& out, const std::vector<unsigned char>& in, const LodeZlib_DeflateSettings& settings)
  {
    unsigned char* buffer = 0;
    size_t buffersize = 0;
    unsigned error = LodeZlib_compress(&buffer, &buffersize, in.empty() ? 0 : &in[0], in.size(), &settings);
    if(buffer)
    {
      out.insert(out.end(), &buffer[0], &buffer[buffersize]);
      free(buffer);
    }
    return error;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x22f40
testb $0x1, %al
jne 0x2bc13
jmp 0x2bc1b
xorl %eax, %eax
movq %rax, -0x50(%rbp)
jmp 0x2bc2c
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x31810
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
callq 0x22fa0
movq -0x58(%rbp), %rdx
movq %rax, %rcx
movq -0x18(%rbp), %r8
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x25810
movl %eax, -0x2c(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x2bca7
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
callq 0x22e50
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x318d0
movq -0x60(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x20(%rbp), %rcx
addq -0x28(%rbp), %rcx
movq -0x38(%rbp), %rsi
callq 0x31830
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rdi
callq 0x54b0
movl -0x2c(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: LodePNG::Decoder::decode(std::vector<unsigned char, std::allocator<unsigned char>>&, unsigned char const*, unsigned long)
void Decoder::decode(std::vector<unsigned char>& out, const unsigned char* in, size_t insize)
  {
    unsigned char* buffer;
    size_t buffersize;
    LodePNG_decode(this, &buffer, &buffersize, in, insize);
    if(buffer)
    {
      out.insert(out.end(), &buffer[0], &buffer[buffersize]);
      free(buffer);
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
leaq -0x28(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x28290
cmpq $0x0, -0x28(%rbp)
je 0x2bef0
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
callq 0x22e50
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x318d0
movq -0x50(%rbp), %rdi
movq -0x28(%rbp), %rdx
movq -0x28(%rbp), %rcx
addq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rsi
callq 0x31830
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rdi
callq 0x54b0
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: LodePNG::Encoder::encode(std::vector<unsigned char, std::allocator<unsigned char>>&, unsigned char const*, unsigned int, unsigned int)
void Encoder::encode(std::vector<unsigned char>& out, const unsigned char* image, unsigned w, unsigned h)
  {
    unsigned char* buffer;
    size_t buffersize;
    LodePNG_encode(this, &buffer, &buffersize, image, w, h);
    if(buffer)
    {
      out.insert(out.end(), &buffer[0], &buffer[buffersize]);
      free(buffer);
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rcx
movl -0x1c(%rbp), %r8d
movl -0x20(%rbp), %r9d
leaq -0x28(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x29d30
cmpq $0x0, -0x28(%rbp)
je 0x2c2e7
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
callq 0x22e50
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x318d0
movq -0x50(%rbp), %rdi
movq -0x28(%rbp), %rdx
movq -0x28(%rbp), %rcx
addq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rsi
callq 0x31830
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rdi
callq 0x54b0
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: LodePNG::loadFile(std::vector<unsigned char, std::allocator<unsigned char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void loadFile(std::vector<unsigned char>& buffer, const std::string& filename) //designed for loading files from hard disk in an std::vector
  {
    std::ifstream file(filename.c_str(), std::ios::in|std::ios::binary|std::ios::ate);
  
    /*get filesize*/
    std::streamsize size = 0;
    if(file.seekg(0, std::ios::end).good()) size = file.tellg();
    if(file.seekg(0, std::ios::beg).good()) size -= file.tellg();
  
    /*read contents of the file into the vector*/
    buffer.resize(size_t(size));
    if(size > 0) file.read((char*)(&buffer[0]), size);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2c0, %rsp            # imm = 0x2C0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5160
movq %rax, -0x270(%rbp)
movl $0x8, %edi
movl $0x4, %esi
callq 0x31910
movl %eax, %edi
movl $0x2, %esi
movl %esi, -0x25c(%rbp)
callq 0x31910
movq -0x270(%rbp), %rsi
movl %eax, %edx
leaq -0x218(%rbp), %rdi
movq %rdi, -0x268(%rbp)
callq 0x5700
movq -0x268(%rbp), %rdi
movl -0x25c(%rbp), %edx
movq $0x0, -0x220(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x5590
movq %rax, -0x258(%rbp)
jmp 0x2c76a
movq -0x258(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x5680
movb %al, -0x271(%rbp)
jmp 0x2c788
movb -0x271(%rbp), %al
testb $0x1, %al
jne 0x2c797
jmp 0x2c817
leaq -0x218(%rbp), %rdi
callq 0x56b0
movq %rdx, -0x288(%rbp)
movq %rax, -0x280(%rbp)
jmp 0x2c7b3
movq -0x288(%rbp), %rax
movq -0x280(%rbp), %rcx
movq %rcx, -0x240(%rbp)
movq %rax, -0x238(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x31930
movq %rax, -0x290(%rbp)
jmp 0x2c7e4
movq -0x290(%rbp), %rax
movq %rax, -0x220(%rbp)
jmp 0x2c817
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x5100
jmp 0x2c917
xorl %edx, %edx
movl %edx, %esi
leaq -0x218(%rbp), %rdi
callq 0x5590
movq %rax, -0x298(%rbp)
jmp 0x2c830
movq -0x298(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x5680
movb %al, -0x299(%rbp)
jmp 0x2c84e
movb -0x299(%rbp), %al
testb $0x1, %al
jne 0x2c85a
jmp 0x2c8bf
leaq -0x218(%rbp), %rdi
callq 0x56b0
movq %rdx, -0x2b0(%rbp)
movq %rax, -0x2a8(%rbp)
jmp 0x2c876
movq -0x2b0(%rbp), %rax
movq -0x2a8(%rbp), %rcx
movq %rcx, -0x250(%rbp)
movq %rax, -0x248(%rbp)
leaq -0x250(%rbp), %rdi
callq 0x31930
movq %rax, -0x2b8(%rbp)
jmp 0x2c8a7
movq -0x2b8(%rbp), %rcx
movq -0x220(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x220(%rbp)
movq -0x8(%rbp), %rdi
movq -0x220(%rbp), %rsi
callq 0x22d50
jmp 0x2c8d1
cmpq $0x0, -0x220(%rbp)
jle 0x2c902
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x22f80
movq %rax, %rsi
movq -0x220(%rbp), %rdx
leaq -0x218(%rbp), %rdi
callq 0x5500
jmp 0x2c900
jmp 0x2c902
leaq -0x218(%rbp), %rdi
callq 0x5100
addq $0x2c0, %rsp            # imm = 0x2C0
popq %rbp
retq
movq -0x228(%rbp), %rdi
callq 0x56c0
nopw %cs:(%rax,%rax)
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: LodePNG::decode(std::vector<unsigned char, std::allocator<unsigned char>>&, unsigned int&, unsigned int&, unsigned char const*, unsigned int, unsigned int, unsigned int)
unsigned decode(std::vector<unsigned char>& out, unsigned& w, unsigned& h, const unsigned char* in, unsigned size, unsigned colorType, unsigned bitDepth)
  {
    Decoder decoder;
    decoder.getInfoRaw().color.colorType = colorType;
    decoder.getInfoRaw().color.bitDepth = bitDepth;
    decoder.decode(out, in, size);
    w = decoder.getWidth();
    h = decoder.getHeight();
    return decoder.getError();
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
leaq -0x150(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x2bcb0
movq -0x168(%rbp), %rdi
movl -0x28(%rbp), %eax
movl %eax, -0x170(%rbp)
callq 0x2c140
movl -0x170(%rbp), %ecx
movq -0x168(%rbp), %rdi
movl %ecx, (%rax)
movl 0x10(%rbp), %eax
movl %eax, -0x16c(%rbp)
callq 0x2c140
movl -0x16c(%rbp), %ecx
movq -0x168(%rbp), %rdi
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %eax
movl %eax, %ecx
callq 0x2be70
jmp 0x2caaf
leaq -0x150(%rbp), %rdi
callq 0x2bd70
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
leaq -0x150(%rbp), %rdi
callq 0x2bd90
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
leaq -0x150(%rbp), %rdi
callq 0x2bd50
movl %eax, -0x174(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x2bcd0
movl -0x174(%rbp), %eax
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x158(%rbp)
movl %eax, -0x15c(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x2bcd0
movq -0x158(%rbp), %rdi
callq 0x56c0
nop
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: LodePNG::encode(std::vector<unsigned char, std::allocator<unsigned char>>&, unsigned char const*, unsigned int, unsigned int, unsigned int, unsigned int)
unsigned encode(std::vector<unsigned char>& out, const unsigned char* in, unsigned w, unsigned h, unsigned colorType, unsigned bitDepth)
  {
    Encoder encoder;
    encoder.getInfoRaw().color.colorType = colorType;
    encoder.getInfoRaw().color.bitDepth = bitDepth;
    encoder.encode(out, in, w, h);
    return encoder.getError();
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movl %r9d, -0x20(%rbp)
leaq -0x150(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x2c1a0
movq -0x168(%rbp), %rdi
movl -0x1c(%rbp), %eax
movl %eax, -0x170(%rbp)
callq 0x2c680
movl -0x170(%rbp), %ecx
movq -0x168(%rbp), %rdi
movl %ecx, (%rax)
movl -0x20(%rbp), %eax
movl %eax, -0x16c(%rbp)
callq 0x2c680
movl -0x16c(%rbp), %ecx
movq -0x168(%rbp), %rdi
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
movl -0x14(%rbp), %ecx
movl -0x18(%rbp), %r8d
callq 0x2c260
jmp 0x2ccec
leaq -0x150(%rbp), %rdi
callq 0x2c240
movl %eax, -0x174(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x2c1c0
movl -0x174(%rbp), %eax
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x158(%rbp)
movl %eax, -0x15c(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x2c1c0
movq -0x158(%rbp), %rdi
callq 0x56c0
nopw %cs:(%rax,%rax)
// File: mhe[P]raytracerframework_cpp/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, unsigned int, unsigned int)
unsigned encode(const std::string& filename, const unsigned char* in, unsigned w, unsigned h, unsigned colorType, unsigned bitDepth)
  {
    std::vector<unsigned char> buffer;
    Encoder encoder;
    encoder.getInfoRaw().color.colorType = colorType;
    encoder.getInfoRaw().color.bitDepth = bitDepth;
    encoder.encode(buffer, in, w, h);
    if(!encoder.hasError()) saveFile(buffer, filename);
    return encoder.getError();
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movl %r9d, -0x20(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x22d30
leaq -0x168(%rbp), %rdi
callq 0x2c1a0
jmp 0x2cdf8
movl -0x1c(%rbp), %eax
movl %eax, -0x188(%rbp)
leaq -0x168(%rbp), %rdi
movq %rdi, -0x180(%rbp)
callq 0x2c680
movl -0x188(%rbp), %ecx
movq -0x180(%rbp), %rdi
movl %ecx, (%rax)
movl -0x20(%rbp), %eax
movl %eax, -0x184(%rbp)
callq 0x2c680
movl -0x184(%rbp), %ecx
movq -0x180(%rbp), %rdi
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rdx
movl -0x14(%rbp), %ecx
movl -0x18(%rbp), %r8d
leaq -0x38(%rbp), %rsi
callq 0x2c260
jmp 0x2ce57
leaq -0x168(%rbp), %rdi
callq 0x2c220
testb $0x1, %al
jne 0x2ceac
movq -0x8(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x2c930
jmp 0x2ce76
jmp 0x2ceac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x170(%rbp)
movl %eax, -0x174(%rbp)
jmp 0x2cee2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x170(%rbp)
movl %eax, -0x174(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x2c1c0
jmp 0x2cee2
leaq -0x168(%rbp), %rdi
callq 0x2c240
movl %eax, -0x18c(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x2c1c0
leaq -0x38(%rbp), %rdi
callq 0x22ee0
movl -0x18c(%rbp), %eax
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x22ee0
movq -0x170(%rbp), %rdi
callq 0x56c0
nopw (%rax,%rax)
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: huffmanDecodeSymbol(unsigned int*, unsigned char const*, unsigned long*, HuffmanTree const*, unsigned long)
static unsigned huffmanDecodeSymbol(unsigned int* error, const unsigned char* in, size_t* bp, const HuffmanTree* codetree, size_t inlength)
{
  unsigned treepos = 0, decoded, ct;
  for(;;)
  {
    unsigned char bit;
    if(((*bp) & 0x07) == 0 && ((*bp) >> 3) > inlength) { *error = 10; return 0; } /*error: end of input memory reached without endcode*/
    bit = readBitFromStream(bp, in);
    *error = HuffmanTree_decode(codetree, &decoded, &ct, &treepos, bit);
    if(*error) return 0; /*stop, an error happened*/
    if(decoded) return ct;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
andq $0x7, %rax
cmpq $0x0, %rax
jne 0x2d5d8
movq -0x20(%rbp), %rax
movq (%rax), %rax
shrq $0x3, %rax
cmpq -0x30(%rbp), %rax
jbe 0x2d5d8
movq -0x10(%rbp), %rax
movl $0xa, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x2d62f
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x23e30
movb %al, -0x3d(%rbp)
movq -0x28(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x3c(%rbp), %rdx
leaq -0x34(%rbp), %rcx
movzbl -0x3d(%rbp), %r8d
callq 0x2de50
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2d61c
movl $0x0, -0x4(%rbp)
jmp 0x2d62f
cmpl $0x0, -0x38(%rbp)
je 0x2d62a
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2d62f
jmp 0x2d5a3
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: generateFixedTree(HuffmanTree*)
static unsigned generateFixedTree(HuffmanTree* tree)
{
  unsigned i, error = 0;
  uivector bitlen;
  uivector_init(&bitlen);
  if(!uivector_resize(&bitlen, NUM_DEFLATE_CODE_SYMBOLS)) error = 9909;
  
  if(!error)
  {
    /*288 possible codes: 0-255=literals, 256=endcode, 257-285=lengthcodes, 286-287=unused*/
    for(i =   0; i <= 143; i++) bitlen.data[i] = 8;
    for(i = 144; i <= 255; i++) bitlen.data[i] = 9;
    for(i = 256; i <= 279; i++) bitlen.data[i] = 7;
    for(i = 280; i <= 287; i++) bitlen.data[i] = 8;
    
    error = HuffmanTree_makeFromLengths(tree, bitlen.data, NUM_DEFLATE_CODE_SYMBOLS, 15);
  }
  
  uivector_cleanup(&bitlen);
  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x10(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x2d6a0
leaq -0x28(%rbp), %rdi
movl $0x120, %esi            # imm = 0x120
callq 0x2d870
cmpl $0x0, %eax
jne 0x2d706
movl $0x26b5, -0x10(%rbp)    # imm = 0x26B5
cmpl $0x0, -0x10(%rbp)
jne 0x2d7ce
movl $0x0, -0xc(%rbp)
cmpl $0x8f, -0xc(%rbp)
ja 0x2d739
movq -0x28(%rbp), %rax
movl -0xc(%rbp), %ecx
movl $0x8, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x2d717
movl $0x90, -0xc(%rbp)
cmpl $0xff, -0xc(%rbp)
ja 0x2d762
movq -0x28(%rbp), %rax
movl -0xc(%rbp), %ecx
movl $0x9, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x2d740
movl $0x100, -0xc(%rbp)      # imm = 0x100
cmpl $0x117, -0xc(%rbp)      # imm = 0x117
ja 0x2d78b
movq -0x28(%rbp), %rax
movl -0xc(%rbp), %ecx
movl $0x7, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x2d769
movl $0x118, -0xc(%rbp)      # imm = 0x118
cmpl $0x11f, -0xc(%rbp)      # imm = 0x11F
ja 0x2d7b4
movq -0x28(%rbp), %rax
movl -0xc(%rbp), %ecx
movl $0x8, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x2d792
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl $0x120, %edx            # imm = 0x120
movl $0xf, %ecx
callq 0x2d910
movl %eax, -0x10(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x2d9b0
movl -0x10(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: generateDistanceTree(HuffmanTree*)
static unsigned generateDistanceTree(HuffmanTree* tree)
{
  unsigned i, error = 0;
  uivector bitlen;
  uivector_init(&bitlen);
  if(!uivector_resize(&bitlen, NUM_DISTANCE_SYMBOLS)) error = 9910;
  
  /*there are 32 distance codes, but 30-31 are unused*/
  if(!error)
  {
    for(i = 0; i < NUM_DISTANCE_SYMBOLS; i++) bitlen.data[i] = 5;
    error = HuffmanTree_makeFromLengths(tree, bitlen.data, NUM_DISTANCE_SYMBOLS, 15);
  }
  uivector_cleanup(&bitlen);
  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x10(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x2d6a0
leaq -0x28(%rbp), %rdi
movl $0x20, %esi
callq 0x2d870
cmpl $0x0, %eax
jne 0x2d816
movl $0x26b6, -0x10(%rbp)    # imm = 0x26B6
cmpl $0x0, -0x10(%rbp)
jne 0x2d85c
movl $0x0, -0xc(%rbp)
cmpl $0x20, -0xc(%rbp)
jae 0x2d842
movq -0x28(%rbp), %rax
movl -0xc(%rbp), %ecx
movl $0x5, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x2d823
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl $0x20, %edx
movl $0xf, %ecx
callq 0x2d910
movl %eax, -0x10(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x2d9b0
movl -0x10(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: uivector_resize(uivector*, unsigned long)
static unsigned uivector_resize(uivector* p, size_t size) /*returns 1 if success, 0 if failure ==> nothing done*/
{
  if(size * sizeof(unsigned) > p->allocsize)
  {
    size_t newsize = size * sizeof(unsigned) * 2;
    void* data = realloc(p->data, newsize);
    if(data)
    {
      p->allocsize = newsize;
      p->data = (unsigned*)data;
      p->size = size;
    }
    else return 0;
  }
  else p->size = size;
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
shlq $0x2, %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jbe 0x2d8ec
movq -0x18(%rbp), %rax
shlq $0x2, %rax
shlq %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x5650
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x2d8e1
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x2d8ea
movl $0x0, -0x4(%rbp)
jmp 0x2d8ff
jmp 0x2d8f8
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: mhe[P]raytracerframework_cpp/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;
  if(!uivector_resize(&tree->lengths, numcodes)) return 9903;
  for(i = 0; i < numcodes; i++) tree->lengths.data[i] = bitlen[i];
  tree->numcodes = (unsigned)numcodes; /*number of symbols*/
  tree->maxbitlen = maxbitlen;
  return HuffmanTree_makeFromLengths2(tree);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
movq -0x20(%rbp), %rsi
callq 0x2d870
cmpl $0x0, %eax
jne 0x2d946
movl $0x26af, -0x4(%rbp)     # imm = 0x26AF
jmp 0x2d99c
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpq -0x20(%rbp), %rax
jae 0x2d979
movq -0x18(%rbp), %rax
movl -0x28(%rbp), %ecx
movl (%rax,%rcx,4), %edx
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x28(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x2d94d
movq -0x20(%rbp), %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4c(%rax)
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x48(%rax)
movq -0x10(%rbp), %rdi
callq 0x2da00
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: uivector_resizev(uivector*, unsigned long, unsigned int)
static unsigned uivector_resizev(uivector* p, size_t size, unsigned value) /*resize and give all new elements the value*/
{
  size_t oldsize = p->size, i;
  if(!uivector_resize(p, size)) return 0;
  for(i = oldsize; i < size; i++) p->data[i] = value;
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2d870
cmpl $0x0, %eax
jne 0x2dbea
movl $0x0, -0x4(%rbp)
jmp 0x2dc22
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x2dc1b
movl -0x1c(%rbp), %edx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x2dbf2
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: HuffmanTree_decode(HuffmanTree const*, unsigned int*, unsigned int*, unsigned int*, unsigned char)
static unsigned HuffmanTree_decode(const HuffmanTree* tree, unsigned* decoded, unsigned* result, unsigned* treepos, unsigned char bit)
{
  if((*treepos) >= tree->numcodes) return 11; /*error: it appeared outside the codetree*/
  
  (*result) = tree->tree2d.data[2 * (*treepos) + bit];
  (*decoded) = ((*result) < tree->numcodes);

  if(*decoded) (*treepos) = 0;
  else (*treepos) = (*result) - tree->numcodes;
  
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %r8b, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movb %al, -0x29(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4c(%rcx), %eax
jb 0x2de82
movl $0xb, -0x4(%rbp)
jmp 0x2deec
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
shll %ecx
movzbl -0x29(%rbp), %edx
addl %edx, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4c(%rcx), %eax
setb %al
andb $0x1, %al
movzbl %al, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2ded2
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
jmp 0x2dee5
movq -0x20(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
subl 0x4c(%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: vector_resize(vector*, unsigned long)
static unsigned vector_resize(vector* p, size_t size) /*returns 1 if success, 0 if failure ==> nothing done*/
{
  if(size * p->typesize > p->allocsize)
  {
    size_t newsize = size * p->typesize * 2;
    void* data = realloc(p->data, newsize);
    if(data)
    {
      p->allocsize = newsize;
      p->data = data;
      p->size = size;
    }
    else return 0;
  }
  else p->size = size;
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x18(%rcx), %ecx
imulq %rcx, %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jbe 0x2e77a
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x18(%rcx), %ecx
imulq %rcx, %rax
shlq %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x5650
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x2e76f
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x2e778
movl $0x0, -0x4(%rbp)
jmp 0x2e78d
jmp 0x2e786
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: HuffmanTree_fillInCoins(vector*, unsigned int const*, unsigned int, unsigned long)
static unsigned HuffmanTree_fillInCoins(vector* coins, const unsigned* frequencies, unsigned numcodes, size_t sum)
{
  unsigned i;
  for(i = 0; i < numcodes; i++)
  {
    Coin* coin;
    if(frequencies[i] == 0) continue; /*it's important to exclude symbols that aren't present*/
    if(!vector_resize(coins, coins->size + 1)) { vector_cleanup(coins); return 9904; }
    coin = (Coin*)(vector_get(coins, coins->size - 1));
    Coin_init(coin);
    coin->weight = frequencies[i] / (float)sum;
    uivector_push_back(&coin->symbols, i);
  }
  if(coins->size) Coin_sort((Coin*)coins->data, coins->size);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x2f066
movq -0x18(%rbp), %rax
movl -0x2c(%rbp), %ecx
cmpl $0x0, (%rax,%rcx,4)
jne 0x2ef9c
jmp 0x2f058
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
addq $0x1, %rsi
callq 0x2e6f0
cmpl $0x0, %eax
jne 0x2efcb
movq -0x10(%rbp), %rdi
callq 0x2e990
movl $0x26b0, -0x4(%rbp)     # imm = 0x26B0
jmp 0x2f08c
movq -0x10(%rbp), %rdi
movq 0x8(%rdi), %rsi
decq %rsi
callq 0x2e7a0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0x2f1d0
movq -0x18(%rbp), %rax
movl -0x2c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
cvtsi2ss %rax, %xmm0
movss %xmm0, -0x44(%rbp)
movq -0x28(%rbp), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0x40(%rbp)
testq %rax, %rax
movss %xmm0, -0x3c(%rbp)
js 0x2f035
movss -0x40(%rbp), %xmm0
movss %xmm0, -0x3c(%rbp)
movss -0x44(%rbp), %xmm0
movss -0x3c(%rbp), %xmm1
divss %xmm1, %xmm0
movq -0x38(%rbp), %rax
movss %xmm0, 0x18(%rax)
movq -0x38(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x2e870
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2ef7e
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2f085
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x2f2d0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: Coin_sort(Coin*, unsigned long)
static void Coin_sort(Coin* data, size_t amount) /*combsort*/
{
  size_t gap = amount;
  unsigned char swapped = 0;
  while(gap > 1 || swapped)
  {
    size_t i;
    gap = (gap * 10) / 13; /*shrink factor 1.3*/
    if(gap == 9 || gap == 10) gap = 11; /*combsort11*/
    if(gap < 1) gap = 1;
    swapped = 0;
    for(i = 0; i < amount - gap; i++)
    {
      size_t j = i + gap;
      if(data[j].weight < data[i].weight)
      {
        float temp = data[j].weight; data[j].weight = data[i].weight; data[i].weight = temp;
        uivector_swap(&data[i].symbols, &data[j].symbols);
        swapped = 1;
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
movb $0x1, %al
cmpq $0x1, -0x18(%rbp)
movb %al, -0x35(%rbp)
ja 0x2f302
cmpb $0x0, -0x19(%rbp)
setne %al
movb %al, -0x35(%rbp)
movb -0x35(%rbp), %al
testb $0x1, %al
jne 0x2f30e
jmp 0x2f43d
imulq $0xa, -0x18(%rbp), %rax
movl $0xd, %ecx
xorl %edx, %edx
divq %rcx
movq %rax, -0x18(%rbp)
cmpq $0x9, -0x18(%rbp)
je 0x2f32f
cmpq $0xa, -0x18(%rbp)
jne 0x2f337
movq $0xb, -0x18(%rbp)
cmpq $0x1, -0x18(%rbp)
jae 0x2f346
movq $0x1, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
subq -0x18(%rbp), %rcx
cmpq %rcx, %rax
jae 0x2f438
movq -0x28(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq -0x30(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss 0x18(%rax), %xmm1
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss 0x18(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x2f425
movq -0x8(%rbp), %rax
movq -0x30(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss 0x18(%rax), %xmm0
movss %xmm0, -0x34(%rbp)
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss 0x18(%rax), %xmm0
movq -0x8(%rbp), %rax
movq -0x30(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss %xmm0, 0x18(%rax)
movss -0x34(%rbp), %xmm0
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss %xmm0, 0x18(%rax)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
movq -0x30(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rsi
callq 0x2f450
movb $0x1, -0x19(%rbp)
jmp 0x2f427
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x2f352
jmp 0x2f2ec
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: string_resize(char**, unsigned long)
static unsigned string_resize(char** out, size_t size) /*returns 1 if success, 0 if failure ==> nothing done*/
{
  char* data = (char*)realloc(*out, size + 1);
  if(data)
  {
    data[size] = 0; /*null termination char*/
    *out = data;
  }
  return data != 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x1, %rsi
callq 0x5650
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x2f776
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x18(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: ucvector_resizev(ucvector*, unsigned long, unsigned char)
static unsigned ucvector_resizev(ucvector* p, size_t size, unsigned char value) /*resize and give all new elements the value*/
{
  size_t oldsize = p->size, i;
  if(!ucvector_resize(p, size)) return 0;
  for(i = oldsize; i < size; i++) p->data[i] = value;
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %dl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x24470
cmpl $0x0, %eax
jne 0x2f85c
movl $0x0, -0x4(%rbp)
jmp 0x2f894
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x2f88d
movb -0x19(%rbp), %dl
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x2f864
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: unfilter(unsigned char*, unsigned char const*, unsigned int, unsigned int, unsigned int)
static unsigned unfilter(unsigned char* out, const unsigned char* in, unsigned w, unsigned h, unsigned bpp)
{
  /*
  For PNG filter method 0
  this function unfilters a single image (e.g. without interlacing this is called once, with Adam7 it's called 7 times)
  out must have enough bytes allocated already, in must have the scanlines + 1 filtertype byte per scanline
  w and h are image dimensions or dimensions of reduced image, bpp is bits per pixel
  in and out are allowed to be the same memory address!
  */
  
  unsigned y;
  unsigned char* prevline = 0;
  
  size_t bytewidth = (bpp + 7) / 8; /*bytewidth is used for filtering, is 1 when bpp < 8, number of bytes per pixel otherwise*/
  size_t linebytes = (w * bpp + 7) / 8;
  
  for(y = 0; y < h; y++)
  {
    size_t outindex = linebytes * y;
    size_t inindex = (1 + linebytes) * y; /*the extra filterbyte added to each row*/
    unsigned char filterType = in[inindex];
    
    unsigned error = unfilterScanline(&out[outindex], &in[inindex + 1], prevline, bytewidth, filterType, linebytes);
    if(error) return error;
    
    prevline = &out[outindex];
  }
  
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq $0x0, -0x30(%rbp)
movl -0x24(%rbp), %eax
addl $0x7, %eax
shrl $0x3, %eax
movl %eax, %eax
movq %rax, -0x38(%rbp)
movl -0x1c(%rbp), %eax
imull -0x24(%rbp), %eax
addl $0x7, %eax
shrl $0x3, %eax
movl %eax, %eax
movq %rax, -0x40(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x20(%rbp), %eax
jae 0x2fbd1
movq -0x40(%rbp), %rax
movl -0x28(%rbp), %ecx
imulq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movl -0x28(%rbp), %ecx
imulq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq -0x50(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x51(%rbp)
movq -0x10(%rbp), %rdi
addq -0x48(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x50(%rbp), %rax
addq $0x1, %rax
addq %rax, %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movb -0x51(%rbp), %al
movq -0x40(%rbp), %r9
movzbl %al, %r8d
callq 0x302b0
movl %eax, -0x58(%rbp)
cmpl $0x0, -0x58(%rbp)
je 0x2fbb7
movl -0x58(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2fbd8
movq -0x10(%rbp), %rax
addq -0x48(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x2fb3b
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mhe[P]raytracerframework_cpp/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 obp = 0, ibp = 0; /*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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq -0x20(%rbp), %rax
subq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x2fc8f
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x2fc78
movq -0x10(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x2f790
movb %al, -0x49(%rbp)
movq -0x8(%rbp), %rsi
leaq -0x38(%rbp), %rdi
movzbl -0x49(%rbp), %edx
callq 0x30800
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x2fc3f
movq -0x30(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x2fc2f
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: paethPredictor(int, int, int)
static int paethPredictor(int a, int b, int c)
{
  int p = a + b - c;
  int pa = p > a ? p - a : a - p;
  int pb = p > b ? p - b : b - p;
  int pc = p > c ? p - c : c - p;
  
  if(pa <= pb && pa <= pc) return a;
  else if(pb <= pc) return b;
  else return c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl -0x8(%rbp), %eax
addl -0xc(%rbp), %eax
subl -0x10(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x8(%rbp), %eax
jle 0x3076c
movl -0x14(%rbp), %eax
subl -0x8(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x30775
movl -0x8(%rbp), %eax
subl -0x14(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
cmpl -0xc(%rbp), %eax
jle 0x3078e
movl -0x14(%rbp), %eax
subl -0xc(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x30797
movl -0xc(%rbp), %eax
subl -0x14(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x10(%rbp), %eax
jle 0x307b0
movl -0x14(%rbp), %eax
subl -0x10(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0x307b9
movl -0x10(%rbp), %eax
subl -0x14(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jg 0x307d7
movl -0x18(%rbp), %eax
cmpl -0x20(%rbp), %eax
jg 0x307d7
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x307ed
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jg 0x307e7
movl -0xc(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x307ed
movl -0x10(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)