LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: addChunk_tRNS(ucvector*, LodePNG_InfoColor const*)
static unsigned addChunk_tRNS(ucvector* out, const LodePNG_InfoColor* info)
{
  unsigned error = 0;
  size_t i;
  ucvector tRNS;
  ucvector_init(&tRNS);
  if(info->colorType == 3)
  {
    for(i = 0; i < info->palettesize; i++) ucvector_push_back(&tRNS, info->palette[4 * i + 3]); /*add only alpha channel*/
  }
  else if(info->colorType == 0)
  {
    if(info->key_defined)
    {
      ucvector_push_back(&tRNS, (unsigned char)(info->key_r / 256));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_r % 256));
    }
  }
  else if(info->colorType == 2)
  {
    if(info->key_defined)
    {
      ucvector_push_back(&tRNS, (unsigned char)(info->key_r / 256));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_r % 256));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_g / 256));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_g % 256));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_b / 256));
      ucvector_push_back(&tRNS, (unsigned char)(info->key_b % 256));
    }
  }
  
  error = addChunk(out, "tRNS", tRNS.data, tRNS.size);
  ucvector_cleanup(&tRNS);
  
  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
andq $0x0, -0x30(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movl (%rsi), %eax
testl %eax, %eax
je 0x156a8
cmpl $0x2, %eax
je 0x15665
cmpl $0x3, %eax
jne 0x156d2
xorl %r12d, %r12d
leaq -0x40(%rbp), %r15
cmpq 0x10(%r14), %r12
jae 0x156d2
movq 0x8(%r14), %rax
movzbl 0x3(%rax,%r12,4), %esi
movq %r15, %rdi
callq 0x11607
incq %r12
jmp 0x15644
cmpl $0x0, 0x18(%r14)
je 0x156d2
movzbl 0x1d(%r14), %esi
leaq -0x40(%rbp), %r15
movq %r15, %rdi
callq 0x11607
movzbl 0x1c(%r14), %esi
movq %r15, %rdi
callq 0x11607
movzbl 0x21(%r14), %esi
movq %r15, %rdi
callq 0x11607
movzbl 0x20(%r14), %esi
movq %r15, %rdi
callq 0x11607
pushq $0x24
jmp 0x156b1
cmpl $0x0, 0x18(%r14)
je 0x156d2
pushq $0x1c
popq %r12
movzbl 0x1(%r14,%r12), %esi
leaq -0x40(%rbp), %r15
movq %r15, %rdi
callq 0x11607
movzbl (%r14,%r12), %esi
movq %r15, %rdi
callq 0x11607
leaq -0x40(%rbp), %r14
movq (%r14), %rdx
movq 0x8(%r14), %rcx
leaq 0xd4f6(%rip), %rsi      # 0x22bda
movq %rbx, %rdi
callq 0x17ed3
movq %r14, %rdi
callq 0x11873
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movl %r8d, -0x2c(%rbp)
movl %ecx, %r14d
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
leaq -0x160(%rbp), %rbx
movq %rbx, %rdi
callq 0x15805
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movl %r14d, %r8d
movl -0x2c(%rbp), %r9d
callq 0x144bf
movl 0x128(%rbx), %r14d
movq %rbx, %rdi
callq 0x15866
movl %r14d, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %rbx
pushq %rax
movq %rdi, %rbx
movaps 0xcfbb(%rip), %xmm0     # 0x227d0
movups %xmm0, (%rdi)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x10(%rdi)
andl $0x0, 0x18(%rdi)
addq $0x20, %rdi
callq 0x122f6
xorps %xmm0, %xmm0
movups %xmm0, 0x118(%rbx)
movabsq $0x800000006, %rax      # imm = 0x800000006
movq %rax, 0x100(%rbx)
movups %xmm0, 0x108(%rbx)
movl $0x1, 0x128(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %ecx, %r8d
movl %edx, %ecx
movq %rsi, %rdx
movq %rdi, %rbx
leaq -0x30(%rbp), %r14
leaq -0x28(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x15796
movl %eax, %r12d
movq (%r14), %r14
movq (%r15), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x158e6
movq %r14, %rdi
callq 0x4350
movl %r12d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x15866
movl $0x130, %edx            # imm = 0x130
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4240
leaq 0x20(%rbx), %r15
movq %r15, %rdi
callq 0x122f6
xorps %xmm0, %xmm0
movups %xmm0, 0x118(%rbx)
movabsq $0x800000006, %rax      # imm = 0x800000006
movq %rax, 0x100(%rbx)
movups %xmm0, 0x108(%rbx)
leaq 0x20(%r14), %rsi
movq %r15, %rdi
callq 0x12388
movl %eax, 0x128(%rbx)
testl %eax, %eax
jne 0x159df
leaq 0x100(%rbx), %rdi
addq $0x100, %r14            # imm = 0x100
movq %r14, %rsi
callq 0x12538
movl %eax, 0x128(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r8
leaq -0x28(%rbp), %r15
andq $0x0, (%r15)
leaq -0x20(%rbp), %rax
andq $0x0, (%rax)
movq %rdi, %rbx
movq (%rsi), %rdi
movq 0x8(%rsi), %rcx
xorl %edx, %edx
subq %rdi, %rcx
cmovneq %rdi, %rdx
movq %r15, %rdi
movq %rax, %rsi
callq 0x1163d
movl %eax, %r14d
movq (%r15), %r15
testq %r15, %r15
je 0x15a51
movq 0x8(%rbx), %rsi
movq -0x20(%rbp), %rcx
addq %r15, %rcx
movq %rbx, %rdi
movq %r15, %rdx
callq 0x17f04
movq %r15, %rdi
callq 0x4350
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %r8d, %r9d
movl %ecx, %r8d
movq %rdx, %rcx
movq %rsi, %rbx
leaq -0x20(%rbp), %r14
leaq -0x18(%rbp), %rdx
movq %r14, %rsi
callq 0x144bf
movq (%r14), %r14
testq %r14, %r14
je 0x15d77
movq 0x8(%rbx), %rsi
movq -0x18(%rbp), %rcx
addq %r14, %rcx
movq %rbx, %rdi
movq %r14, %rdx
callq 0x17f04
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x4350
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r14
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rdi, %rbx
movq (%rsi), %rsi
leaq -0x218(%rbp), %r14
pushq $0xe
popq %rdx
movq %r14, %rdi
callq 0x4560
pushq $0x2
popq %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x4400
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
cmpl $0x0, 0x20(%rax,%rcx)
je 0x15f7c
xorl %r14d, %r14d
jmp 0x15f8b
leaq -0x218(%rbp), %rdi
callq 0x4510
movq %rax, %r14
leaq -0x218(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4400
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
cmpl $0x0, 0x20(%rax,%rcx)
jne 0x15fb8
leaq -0x218(%rbp), %rdi
callq 0x4510
subq %rax, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x100e8
testq %r14, %r14
jle 0x15fda
movq (%rbx), %rsi
leaq -0x218(%rbp), %rdi
movq %r14, %rdx
callq 0x4390
leaq -0x218(%rbp), %rdi
callq 0x40a0
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x15ff6
jmp 0x15ff6
movq %rax, %rbx
leaq -0x218(%rbp), %rdi
callq 0x40a0
movq %rbx, %rdi
callq 0x4530
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movl %r9d, %r15d
movl %r8d, %r12d
movq %rcx, %r13
movq %rdx, -0x38(%rbp)
movq %rsi, -0x30(%rbp)
movq %rdi, %rbx
leaq -0x160(%rbp), %r14
movq %r14, %rdi
callq 0x1428a
movl %r15d, 0x18(%r14)
movl 0x10(%rbp), %eax
movl %eax, 0x1c(%r14)
movl %r12d, %ecx
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x15b60
leaq -0x160(%rbp), %rdi
movl 0x40(%rdi), %eax
movq -0x30(%rbp), %rcx
movl %eax, (%rcx)
movl 0x44(%rdi), %eax
movq -0x38(%rbp), %rcx
movl %eax, (%rcx)
movl 0x120(%rdi), %ebx
callq 0x142dc
movl %ebx, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x160(%rbp), %rdi
callq 0x142dc
movq %rbx, %rdi
callq 0x4530
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movl %r9d, %ebx
movl %r8d, %r14d
movl %ecx, -0x30(%rbp)
movl %edx, -0x2c(%rbp)
movq %rsi, %r13
movq %rdi, %r15
leaq -0x160(%rbp), %r12
movq %r12, %rdi
callq 0x15805
movl %r14d, 0x100(%r12)
movl %ebx, 0x104(%r12)
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movl -0x2c(%rbp), %ecx
movl -0x30(%rbp), %r8d
callq 0x15d22
leaq -0x160(%rbp), %rdi
movl 0x128(%rdi), %ebx
callq 0x15866
movl %ebx, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x160(%rbp), %rdi
callq 0x15866
movq %rbx, %rdi
callq 0x4530
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movl %r9d, %r14d
movl %r8d, %r15d
movl %ecx, -0x30(%rbp)
movl %edx, -0x2c(%rbp)
movq %rsi, %rbx
movq %rdi, -0x38(%rbp)
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %r12
movaps %xmm0, (%r12)
andq $0x0, 0x10(%r12)
leaq -0x180(%rbp), %r13
movq %r13, %rdi
callq 0x15805
movl %r15d, 0x100(%r13)
movl %r14d, 0x104(%r13)
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movl -0x2c(%rbp), %ecx
movl -0x30(%rbp), %r8d
callq 0x15d22
movl -0x58(%rbp), %r14d
testl %r14d, %r14d
jne 0x162fd
leaq -0x50(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x1600d
leaq -0x180(%rbp), %rdi
callq 0x15866
leaq -0x50(%rbp), %rdi
callq 0x1011a
movl %r14d, %eax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x180(%rbp), %rdi
callq 0x15866
leaq -0x50(%rbp), %rdi
callq 0x1011a
movq %rbx, %rdi
callq 0x4530
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq (%rdx), %rax
xorl %r11d, %r11d
movl $0xa, %r9d
movl $0xb, %r10d
testb $0x7, %al
sete %r14b
movq %rax, %rbx
shrq $0x3, %rbx
cmpq %r8, %rbx
seta %r15b
testb %r15b, %r14b
jne 0x16401
movzbl (%rsi,%rbx), %r15d
leaq 0x1(%rax), %rbx
movq %rbx, (%rdx)
movl 0x4c(%rcx), %r14d
cmpl %r14d, %r11d
jae 0x163fe
andl $0x7, %eax
xorl %r12d, %r12d
btl %eax, %r15d
setb %r12b
movq (%rcx), %rax
leal (%r12,%r11,2), %r11d
movl (%rax,%r11,4), %eax
movl %eax, %r11d
subl %r14d, %r11d
jb 0x16405
andl $0x0, (%rdi)
movq %rbx, %rax
jmp 0x163a7
movl %r10d, %r9d
xorl %eax, %eax
jmp 0x16408
xorl %r9d, %r9d
movl %r9d, (%rdi)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq -0x20(%rbp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movl $0x120, %esi            # imm = 0x120
callq 0x16562
testl %eax, %eax
je 0x164f5
movq -0x20(%rbp), %rsi
xorl %eax, %eax
cmpq $0x90, %rax
je 0x1649a
movl $0x8, (%rsi,%rax,4)
incq %rax
jmp 0x16486
movl $0x90, %eax
cmpq $0x100, %rax            # imm = 0x100
je 0x164b3
movl $0x9, (%rsi,%rax,4)
incq %rax
jmp 0x1649f
movl $0x100, %eax            # imm = 0x100
cmpq $0x118, %rax            # imm = 0x118
je 0x164cc
movl $0x7, (%rsi,%rax,4)
incq %rax
jmp 0x164b8
movl $0x118, %eax            # imm = 0x118
cmpq $0x120, %rax            # imm = 0x120
je 0x164e5
movl $0x8, (%rsi,%rax,4)
incq %rax
jmp 0x164d1
pushq $0xf
popq %rcx
movl $0x120, %edx            # imm = 0x120
movq %rbx, %rdi
callq 0x165b5
leaq -0x20(%rbp), %rdi
callq 0x16628
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq -0x20(%rbp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
pushq $0x20
popq %rsi
callq 0x16562
testl %eax, %eax
je 0x16552
movq -0x20(%rbp), %rsi
xorl %eax, %eax
cmpq $0x20, %rax
je 0x16544
movl $0x5, (%rsi,%rax,4)
incq %rax
jmp 0x16532
pushq $0x20
popq %rdx
pushq $0xf
popq %rcx
movq %rbx, %rdi
callq 0x165b5
leaq -0x20(%rbp), %rdi
callq 0x16628
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq (,%rsi,4), %rax
cmpq 0x10(%rdi), %rax
jbe 0x1659f
leaq (,%rbx,8), %r15
movq (%r14), %rdi
movq %r15, %rsi
callq 0x44d0
testq %rax, %rax
je 0x165b1
movq %r15, 0x10(%r14)
movq %rax, (%r14)
movq %rbx, 0x8(%r14)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x165a6
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
leaq 0x30(%rdi), %r13
movq %r13, %rdi
movq %rdx, %rsi
callq 0x16562
testl %eax, %eax
je 0x16614
xorl %eax, %eax
movl %eax, %eax
cmpq %r15, %rax
jae 0x165f9
movl (%r12,%rax,4), %ecx
movq (%r13), %rdx
movl %ecx, (%rdx,%rax,4)
incl %eax
jmp 0x165e3
movl %r15d, 0x4c(%r14)
movl %ebx, 0x48(%r14)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1664b
movl $0x26af, %eax           # imm = 0x26AF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/mhe[P]raytracerframework_cpp/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* codes, const HuffmanTree* codesD)
{
  size_t i = 0;
  for(i = 0; i < lz77_encoded->size; i++)
  {
    unsigned val = lz77_encoded->data[i];
    addHuffmanSymbol(bp, out, HuffmanTree_getCode(codes, val), HuffmanTree_getLength(codes, 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(codesD, distance_code), HuffmanTree_getLength(codesD, distance_code));
      addBitsToStream(bp, out, distance_extra_bits, n_distance_extra_bits);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, -0x38(%rbp)
movq %rcx, -0x48(%rbp)
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
xorl %ebx, %ebx
cmpq 0x8(%r15), %rbx
jae 0x16cfb
movq (%r15), %rax
movl (%rax,%rbx,4), %r14d
movq -0x48(%rbp), %rcx
movq 0x18(%rcx), %rax
movq 0x30(%rcx), %rcx
movl (%rax,%r14,4), %edx
movl (%rcx,%r14,4), %ecx
movq %r13, %rdi
movq %r12, %rsi
callq 0x16d0a
cmpq $0x101, %r14            # imm = 0x101
jb 0x16cf3
addl $0xfffffeff, %r14d      # imm = 0xFFFFFEFF
leaq 0xbca3(%rip), %rax      # 0x22930
movl (%rax,%r14,4), %ecx
movq (%r15), %rax
movl 0x4(%rax,%rbx,4), %edx
movl 0x8(%rax,%rbx,4), %r14d
leaq 0xbd8c(%rip), %rsi      # 0x22a30
movl (%rsi,%r14,4), %esi
movq %rsi, -0x40(%rbp)
movl 0xc(%rax,%rbx,4), %eax
movl %eax, -0x2c(%rbp)
addq $0x3, %rbx
movq %r13, %rdi
movq %r12, %rsi
callq 0x16e6a
movq -0x38(%rbp), %rcx
movq 0x18(%rcx), %rax
movq 0x30(%rcx), %rcx
movl (%rax,%r14,4), %edx
movl (%rcx,%r14,4), %ecx
movq %r13, %rdi
movq %r12, %rsi
callq 0x16d0a
movq %r13, %rdi
movq %r12, %rsi
movl -0x2c(%rbp), %edx
movq -0x40(%rbp), %rcx
callq 0x16e6a
incq %rbx
jmp 0x16c46
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x18(%rdi), %r15d
imulq %rsi, %r15
cmpq 0x10(%rdi), %r15
jbe 0x16d7f
addq %r15, %r15
movq (%r14), %rdi
movq %r15, %rsi
callq 0x44d0
testq %rax, %rax
je 0x16d91
movq %r15, 0x10(%r14)
movq %rax, (%r14)
movq %rbx, 0x8(%r14)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x16d86
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
testq %rcx, %rcx
js 0x17249
cvtsi2ss %rcx, %xmm0
jmp 0x1725e
movq %rcx, %rax
shrq %rax
andl $0x1, %ecx
orq %rax, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
movss %xmm0, -0x24(%rbp)
movl %edx, %r12d
xorl %r15d, %r15d
cmpq %r15, %r12
je 0x172cf
cmpl $0x0, (%r14,%r15,4)
je 0x172ca
movq 0x8(%rbx), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x16d47
testl %eax, %eax
je 0x1739c
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
decq %rcx
movl 0x18(%rbx), %edx
imulq %rcx, %rdx
xorps %xmm0, %xmm0
movups %xmm0, (%rax,%rdx)
andq $0x0, 0x10(%rax,%rdx)
movl (%r14,%r15,4), %ecx
cvtsi2ss %rcx, %xmm0
leaq (%rax,%rdx), %rdi
divss -0x24(%rbp), %xmm0
movss %xmm0, 0x18(%rax,%rdx)
movl %r15d, %esi
callq 0x16dcc
incq %r15
jmp 0x17269
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x173ab
movq (%rbx), %r8
addq $0x18, %r8
xorl %ecx, %ecx
pushq $0xd
popq %r9
pushq $0xb
popq %r10
xorl %r11d, %r11d
movq %rdi, %rax
cmpq $0x2, %rax
setae %dl
testb %r11b, %r11b
setne %sil
orb %dl, %sil
cmpb $0x1, %sil
jne 0x173ad
imulq $0xa, %rax, %rsi
xorl %r11d, %r11d
movq %rsi, %rax
xorl %edx, %edx
divq %r9
addq $-0x75, %rsi
cmpq $0x1, %rax
adcq $0x0, %rax
cmpq $0x1a, %rsi
cmovbq %r10, %rax
movq %rax, %rdx
shlq $0x5, %rdx
movq %rdi, %rsi
movq %r8, %rbx
cmpq %rsi, %rax
je 0x172f3
movss (%rbx,%rdx), %xmm0
movss (%rbx), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x17393
movss %xmm1, (%rbx,%rdx)
movss %xmm0, (%rbx)
movq -0x10(%rbx), %r11
movq -0x10(%rbx,%rdx), %r14
movq %r14, -0x10(%rbx)
movq %r11, -0x10(%rbx,%rdx)
movq -0x8(%rbx), %r11
movq -0x8(%rbx,%rdx), %r14
movq %r14, -0x8(%rbx)
movq %r11, -0x8(%rbx,%rdx)
movq -0x18(%rbx), %r11
movq -0x18(%rbx,%rdx), %r14
movq %r14, -0x18(%rbx)
movq %r11, -0x18(%rbx,%rdx)
movb $0x1, %r11b
addq $0x20, %rbx
decq %rsi
jmp 0x1733e
movq %rbx, %rdi
callq 0x16dff
movl $0x26b0, %ecx           # imm = 0x26B0
jmp 0x173ad
xorl %ecx, %ecx
movl %ecx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rdi
incq %rsi
callq 0x44d0
testq %rax, %rax
je 0x1744e
movb $0x0, (%rax,%r14)
movq %rax, (%rbx)
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
movl %ecx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r8d, -0x2c(%rbp)
movq %rcx, -0x40(%rbp)
movq %rdx, -0x38(%rbp)
leaq -0x50(%rbp), %r12
andq $0x0, (%r12)
movq %rsi, %r13
movq %rdi, %r14
xorl %r15d, %r15d
xorl %eax, %eax
cmpl -0x2c(%rbp), %eax
je 0x17797
movl %eax, -0x30(%rbp)
movq -0x38(%rbp), %rax
movq %r15, -0x48(%rbp)
movq %rax, %rbx
subq $0x1, %rbx
jb 0x17785
movq %r15, %rax
shrq $0x3, %rax
movl %r15d, %ecx
notb %cl
movzbl (%r13,%rax), %eax
movzbl %cl, %ecx
andl $0x7, %ecx
xorl %edx, %edx
btl %ecx, %eax
setb %dl
incq %r15
movq %r12, %rdi
movq %r14, %rsi
callq 0x178f6
movq %rbx, %rax
jmp 0x1774c
movq -0x48(%rbp), %r15
addq -0x40(%rbp), %r15
subq %rax, %r15
movl -0x30(%rbp), %eax
incl %eax
jmp 0x17739
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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, %eax
leal (%rsi,%rax), %ecx
subl %edx, %ecx
movl %ecx, %edi
subl %eax, %edi
movl %edi, %r8d
negl %r8d
cmovsl %edi, %r8d
movl %ecx, %edi
subl %esi, %edi
movl %edi, %r9d
negl %r9d
cmovsl %edi, %r9d
subl %edx, %ecx
movl %ecx, %edi
negl %edi
cmovsl %ecx, %edi
cmpl %edi, %r9d
cmoval %edx, %esi
cmpl %edi, %r8d
cmoval %esi, %eax
cmpl %r9d, %r8d
cmoval %esi, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: setBitOfReversedStream(unsigned long*, unsigned char*, unsigned char)
static void setBitOfReversedStream(size_t* bitpointer, unsigned char* bitstream, unsigned char bit)
{
  /*the current bit in bitstream may be 0 or 1 for this to work*/
  if(bit == 0) bitstream[(*bitpointer) >> 3] &=  (unsigned char)(~(1 << (7 - ((*bitpointer) & 0x7))));
  else bitstream[(*bitpointer) >> 3] |=  (1 << (7 - ((*bitpointer) & 0x7)));
  (*bitpointer)++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rax
movl %eax, %ecx
notb %cl
andb $0x7, %cl
movb $0x1, %r8b
shlb %cl, %r8b
testl %edx, %edx
je 0x17918
shrq $0x3, %rax
orb %r8b, (%rsi,%rax)
jmp 0x17923
notb %r8b
shrq $0x3, %rax
andb %r8b, (%rsi,%rax)
incq (%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: addPaddingBits(unsigned char*, unsigned char const*, unsigned long, unsigned long, unsigned int)
static void addPaddingBits(unsigned char* out, const unsigned char* in, size_t olinebits, size_t ilinebits, unsigned h)
{
  /*The opposite of the removePaddingBits function
  olinebits must be >= ilinebits*/
  unsigned y;
  size_t diff = olinebits - ilinebits;
  size_t obp = 0, ibp = 0; /*bit pointers*/
  for(y = 0; y < h; y++)
  {
    size_t x;
    for(x = 0; x < ilinebits; x++)
    {
      unsigned char bit = readBitFromReversedStream(&ibp, in);
      setBitOfReversedStream(&obp, out, bit);
    }
    /*obp += diff; --> no, fill in some value in the padding bits too, to avoid "Use of uninitialised value of size ###" warning from valgrind*/
    for(x = 0; x < diff; x++) setBitOfReversedStream(&obp, out, 0);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r8d, -0x2c(%rbp)
movq %rsi, %r12
leaq -0x38(%rbp), %r13
andq $0x0, (%r13)
movq %rdi, %rbx
movq %rcx, -0x48(%rbp)
subq %rcx, %rdx
movq %rdx, -0x40(%rbp)
xorl %r14d, %r14d
xorl %eax, %eax
cmpl -0x2c(%rbp), %eax
je 0x179dc
movl %eax, -0x30(%rbp)
movq -0x48(%rbp), %r15
leaq (%r14,%r15), %rax
movq %rax, -0x50(%rbp)
subq $0x1, %r15
jb 0x179a5
movq %r14, %rax
shrq $0x3, %rax
movl %r14d, %ecx
notb %cl
movzbl (%r12,%rax), %eax
movzbl %cl, %ecx
andl $0x7, %ecx
xorl %edx, %edx
btl %ecx, %eax
setb %dl
incq %r14
movq %r13, %rdi
movq %rbx, %rsi
callq 0x178f6
jmp 0x17970
movq -0x38(%rbp), %rax
movq -0x40(%rbp), %rdx
subq $0x1, %rdx
jb 0x179cd
movl %eax, %ecx
notb %cl
movb $-0x2, %sil
rolb %cl, %sil
movq %rax, %rcx
shrq $0x3, %rcx
andb %sil, (%rbx,%rcx)
incq %rax
jmp 0x179ad
movq %rax, -0x38(%rbp)
movl -0x30(%rbp), %eax
incl %eax
movq -0x50(%rbp), %r14
jmp 0x1795c
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/mhe[P]raytracerframework_cpp/scene.cpp
// Function: Scene::trace(Ray const&)
Color Scene::trace(const Ray &ray)
{
	// Find hit object and distance
	double t, min_t = 0.0;
	Object *obj = NULL;
	for (unsigned int i = 0; i < numObjects; ++i) {
		if (objects[i]->intersect(ray, &t) && (!obj || t < min_t)) {
			min_t = t;
			obj = objects[i];
		}
	}
	
	// No hit? Return background color.
	if (!obj) return Color(0.0, 0.0, 0.0);

	Material *material = obj->material;            //the hit objects material
	Point hit = ray.at(min_t);                     //the hit point
	Vector N = obj->normal(hit);                   //the normal at hit point
	Vector V = -ray.D;                             //the view vector


	/****************************************************
	* This is where you should insert the color
	* calculation (Phong model).
	*
	* Given: material, hit, N, V, lights[]
	* Sought: color
	*
	* Hints: (see triple.h)
	*        Triple.dot(Vector) dot product
	*        Vector+Vector      vector sum
	*        Vector-Vector      vector difference
	*        Point-Point        yields vector
	*        Vector.normalize() normalizes vector, returns length
	*        double*Color        scales each color component (r,g,b)
	*        Color*Color        dito
	*        pow(a,b)           a to the power of b
	****************************************************/

	Color color = material->color;                  // place holder

	return color;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, -0x38(%rbp)
xorpd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
xorl %ebx, %ebx
leaq -0x40(%rbp), %r13
xorl %r15d, %r15d
movl (%r12), %eax
cmpq %rax, %rbx
jae 0x1813b
movq 0x8(%r12,%rbx,8), %rdi
movq (%rdi), %rax
movq %r14, %rsi
movq %r13, %rdx
callq *0x10(%rax)
testb %al, %al
je 0x18136
movsd -0x40(%rbp), %xmm0
testq %r15, %r15
je 0x1812c
movsd -0x30(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x18136
movq 0x8(%r12,%rbx,8), %r15
movsd %xmm0, -0x30(%rbp)
incq %rbx
jmp 0x180f9
testq %r15, %r15
je 0x18181
movq 0x8(%r15), %rbx
leaq -0x70(%rbp), %r12
movq %r12, %rdi
movq %r14, %rsi
movsd -0x30(%rbp), %xmm0
callq 0x18396
movq (%r15), %rax
leaq -0x58(%rbp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *0x18(%rax)
movq 0x10(%rbx), %rax
movq -0x38(%rbp), %rcx
movq %rax, 0x10(%rcx)
movq %rcx, %rax
movupd (%rbx), %xmm0
movupd %xmm0, (%rcx)
jmp 0x18192
xorpd %xmm0, %xmm0
movq -0x38(%rbp), %rax
movupd %xmm0, (%rax)
andq $0x0, 0x10(%rax)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/mhe[P]raytracerframework_cpp/scene.cpp
// Function: Scene::render(Image&)
void Scene::render(Image &img)
{
	int w = img.width();
	int h = img.height();
	for (int y = 0; y < h; y++) {
		for (int x = 0; x < w; x++) {
			Point pixel(x, h-1-y, 0);
			Ray ray(eye, (pixel-eye).normalized());
			Color col = trace(ray);
			col.clamp();
			img(x,y) = col;
		}
	}	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl 0x8(%rsi), %eax
movl 0xc(%rsi), %ecx
leaq 0x380(%rdi), %r13
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
movq %rax, -0x68(%rbp)
testl %ecx, %ecx
movl $0x0, %eax
movl %ecx, -0x2c(%rbp)
cmovgl %ecx, %eax
movl %eax, -0x30(%rbp)
cmpl -0x30(%rbp), %edx
je 0x18339
movl %edx, %eax
notl %eax
addl -0x2c(%rbp), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x60(%rbp)
xorpd %xmm0, %xmm0
movq %rdx, -0x50(%rbp)
movslq %edx, %rax
movq %rax, -0x58(%rbp)
xorl %r15d, %r15d
cmpl %r15d, -0x68(%rbp)
je 0x1832e
movsd %xmm0, -0x70(%rbp)
subsd 0x380(%r14), %xmm0
movsd -0x60(%rbp), %xmm1
subsd 0x388(%r14), %xmm1
xorpd %xmm2, %xmm2
subsd 0x390(%r14), %xmm2
movsd %xmm0, -0x88(%rbp)
movsd %xmm1, -0x80(%rbp)
movsd %xmm2, -0x78(%rbp)
leaq -0x48(%rbp), %r12
movq %r12, %rdi
leaq -0x88(%rbp), %rsi
callq 0xfcd4
movq 0x10(%r13), %rax
movq %rax, -0xb0(%rbp)
movups (%r13), %xmm0
movaps %xmm0, -0xc0(%rbp)
movq -0x38(%rbp), %rax
leaq -0xa8(%rbp), %rcx
movq %rax, 0x10(%rcx)
movups -0x48(%rbp), %xmm0
movups %xmm0, (%rcx)
movq %r12, %rdi
movq %r14, %rsi
leaq -0xc0(%rbp), %rdx
callq 0x180cc
movsd -0x48(%rbp), %xmm0
movsd 0xa465(%rip), %xmm1     # 0x22718
ucomisd %xmm1, %xmm0
jbe 0x182c7
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x48(%rbp)
movsd -0x40(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x182e0
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x40(%rbp)
movsd -0x38(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x182f9
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x38(%rbp)
movq (%rbx), %rax
movslq 0x8(%rbx), %rcx
imulq -0x58(%rbp), %rcx
addq %r15, %rcx
imulq $0x18, %rcx, %rcx
movq -0x38(%rbp), %rdx
movq %rdx, 0x10(%rax,%rcx)
movups -0x48(%rbp), %xmm0
movups %xmm0, (%rax,%rcx)
movsd -0x70(%rbp), %xmm0
addsd %xmm1, %xmm0
incq %r15
jmp 0x1820f
movq -0x50(%rbp), %rdx
incl %edx
jmp 0x181e4
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/mhe[P]raytracerframework_cpp/yaml/exp.cpp
// Function: YAML::Exp::ParseHex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, int)
unsigned ParseHex(const std::string& str, int line, int column)
		{
			unsigned value = 0;
			for(unsigned i=0;i<str.size();i++) {
				char ch = str[i];
				int digit = 0;
				if('a' <= ch && ch <= 'f')
					digit = ch - 'a' + 10;
				else if('A' <= ch && ch <= 'F')
					digit = ch - 'A' + 10;
				else if('0' <= ch && ch <= '9')
					digit = ch - '0';
				else
					throw ParserException(line, column, ErrorMsg::INVALID_HEX);

				value = (value << 4) + digit;
			}

			return value;
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r14d
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
xorl %esi, %esi
pushq $-0x57
popq %rdi
pushq $-0x37
popq %r8
pushq $-0x30
popq %r9
xorl %eax, %eax
movl %esi, %esi
cmpq %rsi, %rdx
jbe 0x184fd
movsbl (%rcx,%rsi), %r10d
leal -0x61(%r10), %r15d
movl %edi, %r11d
cmpb $0x6, %r15b
jb 0x184f0
leal -0x41(%r10), %r15d
movl %r8d, %r11d
cmpb $0x6, %r15b
jb 0x184f0
leal -0x30(%r10), %r15d
movl %r9d, %r11d
cmpb $0xa, %r15b
jae 0x18508
shll $0x4, %eax
addl %r11d, %eax
addl %r10d, %eax
incl %esi
jmp 0x184bd
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x30
popq %rdi
callq 0x4130
movq %rax, %r15
leaq 0x174be(%rip), %rcx     # 0x2f9d8
movq %rax, %rdi
movl %r14d, %esi
movl %ebx, %edx
callq 0x18be0
leaq 0x15112(%rip), %rsi     # 0x2d640
leaq -0x8963(%rip), %rdx     # 0xfbd2
movq %r15, %rdi
callq 0x44f0
movq %rax, %rbx
movq %r15, %rdi
callq 0x4210
movq %rbx, %rdi
callq 0x4530
// File: /workspace/github_cpp_makefile_star2_O2/mhe[P]raytracerframework_cpp/yaml/iterator.cpp
// Function: YAML::Iterator::operator++()
Iterator& Iterator::operator ++ ()
	{
		if(m_pData->type == IterPriv::IT_SEQ)
			++m_pData->seqIter;
		else if(m_pData->type == IterPriv::IT_MAP)
			++m_pData->mapIter;

		return *this;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
movl (%rdi), %eax
cmpl $0x2, %eax
je 0x18de3
cmpl $0x1, %eax
jne 0x18dec
addq $0x8, 0x8(%rdi)
jmp 0x18dec
addq $0x10, %rdi
callq 0x18fe0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/mhe[P]raytracerframework_cpp/yaml/iterator.cpp
// Function: YAML::Iterator::operator++(int)
Iterator Iterator::operator ++ (int)
	{
		Iterator temp = *this;

		if(m_pData->type == IterPriv::IT_SEQ)
			++m_pData->seqIter;
		else if(m_pData->type == IterPriv::IT_MAP)
			++m_pData->mapIter;

		return temp;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
callq 0x18d2c
movq (%r14), %rdi
movl (%rdi), %eax
cmpl $0x2, %eax
je 0x18e1e
cmpl $0x1, %eax
jne 0x18e27
addq $0x8, 0x8(%rdi)
jmp 0x18e27
addq $0x10, %rdi
callq 0x18fe0
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/mhe[P]raytracerframework_cpp/yaml/iterator.cpp
// Function: YAML::operator==(YAML::Iterator const&, YAML::Iterator const&)
bool operator == (const Iterator& it, const Iterator& jt)
	{
		if(it.m_pData->type != jt.m_pData->type)
			return false;

		if(it.m_pData->type == IterPriv::IT_SEQ)
			return it.m_pData->seqIter == jt.m_pData->seqIter;
		else if(it.m_pData->type == IterPriv::IT_MAP)
			return it.m_pData->mapIter == jt.m_pData->mapIter;

		return true;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rcx
movl (%rcx), %edi
movq (%rsi), %rdx
cmpl (%rdx), %edi
jne 0x18fb8
cmpl $0x1, %edi
je 0x18fbc
movb $0x1, %al
cmpl $0x2, %edi
jne 0x18fd1
movabsq $0x10, %rax
jmp 0x18fc6
xorl %eax, %eax
jmp 0x18fd1
movabsq $0x8, %rax
movq (%rcx,%rax), %rcx
cmpq (%rdx,%rax), %rcx
sete %al
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/mhe[P]raytracerframework_cpp/yaml/map.cpp
// Function: YAML::Map::Clear()
void Map::Clear()
	{
		for(node_map::const_iterator it=m_data.begin();it!=m_data.end();++it) {
			delete it->first;
			delete it->second;
		}
		m_data.clear();
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %r15
leaq 0x10(%rdi), %r13
pushq $0x58
popq %r14
cmpq %r13, %r15
je 0x190d1
movq 0x20(%r15), %r12
testq %r12, %r12
je 0x1909d
movq %r12, %rdi
callq 0x19ef2
movq %r12, %rdi
movq %r14, %rsi
callq 0x42b0
movq 0x28(%r15), %r12
testq %r12, %r12
je 0x190b9
movq %r12, %rdi
callq 0x19ef2
movq %r12, %rdi
movq %r14, %rsi
callq 0x42b0
movq %r15, %rdi
callq 0x4320
movq %rax, %r15
jmp 0x19087
addq $0x8, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x19af8
nop
// File: /workspace/github_cpp_makefile_star2_O2/mhe[P]raytracerframework_cpp/yaml/map.cpp
// Function: YAML::Map::Parse(YAML::Scanner*, YAML::ParserState const&)
void Map::Parse(Scanner *pScanner, const ParserState& state)
	{
		Clear();

		// split based on start token
		switch(pScanner->peek().type) {
			case TT_BLOCK_MAP_START: ParseBlock(pScanner, state); break;
			case TT_FLOW_MAP_START: ParseFlow(pScanner, state); break;
			default: break;
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0x1906a
movq %r14, %rdi
callq 0x1d548
movl 0x4(%rax), %eax
cmpl $0x8, %eax
je 0x19171
cmpl $0x4, %eax
jne 0x19189
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x19194
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x193b8
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/mhe[P]raytracerframework_cpp/yaml/map.cpp
// Function: YAML::Map::Write(std::ostream&, int, bool, bool)
void Map::Write(std::ostream& out, int indent, bool startedLine, bool onlyOneCharOnLine)
	{
		if(startedLine && !onlyOneCharOnLine)
			out << "\n";

		for(node_map::const_iterator it=m_data.begin();it!=m_data.end();++it) {
			if((startedLine && !onlyOneCharOnLine) || it != m_data.begin()) {
				for(int i=0;i<indent;i++)
					out << "  ";
			}

			out << "? ";
			it->first->Write(out, indent + 1, true, it!= m_data.begin() || !startedLine || onlyOneCharOnLine);

			for(int i=0;i<indent;i++)
				out << "  ";
			out << ": ";
			it->second->Write(out, indent + 1, true, true);
		}

		if(m_data.empty())
			out << "\n";
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, -0x38(%rbp)
xorb $0x1, %cl
orb %r8b, %cl
movl %ecx, -0x30(%rbp)
jne 0x19625
leaq 0x96ce(%rip), %rsi      # 0x22ceb
movq %rbx, %rdi
callq 0x4280
movq -0x38(%rbp), %rax
movq 0x20(%rax), %r13
addq $0x10, %rax
movq %rax, -0x40(%rbp)
leal 0x1(%r15), %r12d
xorl %eax, %eax
testl %r15d, %r15d
cmovgl %r15d, %eax
movl %eax, -0x2c(%rbp)
leaq 0x97a9(%rip), %r15      # 0x22df5
cmpq -0x40(%rbp), %r13
je 0x196fc
movq -0x38(%rbp), %rax
cmpq 0x20(%rax), %r13
sete %al
testb %al, -0x30(%rbp)
je 0x196e1
movq %rbx, %rdi
leaq 0x9788(%rip), %rsi      # 0x22df8
callq 0x4280
movq -0x38(%rbp), %rax
cmpq 0x20(%rax), %r13
movq 0x20(%r13), %rdi
setne %al
orb -0x30(%rbp), %al
movzbl %al, %r8d
movq %rbx, %rsi
movl %r12d, %edx
pushq $0x1
popq %rcx
callq 0x1a324
movl -0x2c(%rbp), %r14d
movq %rbx, %rdi
subl $0x1, %r14d
jb 0x196b0
movq %r15, %rsi
callq 0x4280
jmp 0x1969d
leaq 0x8b3e(%rip), %rsi      # 0x221f5
callq 0x4280
movq 0x28(%r13), %rdi
movq %rbx, %rsi
movl %r12d, %edx
pushq $0x1
popq %rcx
movl %ecx, %r8d
callq 0x1a324
movq %r13, %rdi
callq 0x4320
movq %rax, %r13
jmp 0x1964c
movl -0x2c(%rbp), %r14d
subl $0x1, %r14d
jb 0x19666
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4280
jmp 0x196e5
movq -0x38(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x19716
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x95ce(%rip), %rsi      # 0x22ceb
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4280
nop