LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: LodePNG_decode32(unsigned char**, unsigned int*, unsigned int*, unsigned char const*, unsigned long)
unsigned LodePNG_decode32(unsigned char** out, unsigned* w, unsigned* h, const unsigned char* in, size_t insize)
{
  unsigned error;
  size_t dummy_size;
  LodePNG_Decoder decoder;
  LodePNG_Decoder_init(&decoder);
  LodePNG_decode(&decoder, out, &dummy_size, in, insize);
  error = decoder.error;
  *w = decoder.infoPng.width;
  *h = decoder.infoPng.height;
  LodePNG_Decoder_cleanup(&decoder);
  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x130, %rsp            # imm = 0x130
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %rsi
movabsq $0x100000001, %rax      # imm = 0x100000001
leaq -0x150(%rbp), %r14
movq %rax, 0x8(%r14)
xorl %eax, %eax
movl %eax, 0x10(%r14)
movq $0x0, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%r14)
movabsq $0x800000006, %rdx      # imm = 0x800000006
movq %rdx, 0x18(%r14)
movups %xmm0, 0x20(%r14)
movups %xmm0, 0x40(%r14)
movups %xmm0, 0x70(%r14)
movq %rdx, 0x58(%r14)
movups %xmm0, 0x60(%r14)
movl %eax, 0x50(%r14)
movl %eax, 0xe0(%r14)
movups %xmm0, 0x80(%r14)
movups %xmm0, 0x90(%r14)
movups %xmm0, 0xa0(%r14)
movups %xmm0, 0xb0(%r14)
movups %xmm0, 0xc0(%r14)
movb $0x0, 0xd0(%r14)
movups %xmm0, 0x110(%r14)
movups %xmm0, 0x100(%r14)
movups %xmm0, 0xf0(%r14)
movl $0x1, 0x120(%r14)
leaq -0x28(%rbp), %rdx
movq %r14, %rdi
callq 0x1eab5
movl 0x40(%r14), %eax
movl 0x120(%r14), %r12d
movl %eax, (%r15)
movl 0x44(%r14), %eax
movl %eax, (%rbx)
movq %r14, %rdi
callq 0x20098
movl %r12d, %eax
addq $0x130, %rsp            # imm = 0x130
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: LodePNG_Decoder_init(LodePNG_Decoder*)
void LodePNG_Decoder_init(LodePNG_Decoder* decoder)
{
  LodePNG_DecodeSettings_init(&decoder->settings);
  LodePNG_InfoRaw_init(&decoder->infoRaw);
  LodePNG_InfoPng_init(&decoder->infoPng);
  decoder->error = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x8(%rdi)
xorl %eax, %eax
movl %eax, 0x10(%rdi)
movq $0x0, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rdi)
movabsq $0x800000006, %rcx      # imm = 0x800000006
movq %rcx, 0x18(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x40(%rdi)
movups %xmm0, 0x70(%rdi)
movq %rcx, 0x58(%rdi)
movups %xmm0, 0x60(%rdi)
movl %eax, 0x50(%rdi)
movl %eax, 0xe0(%rdi)
movups %xmm0, 0xc0(%rdi)
movups %xmm0, 0xb0(%rdi)
movups %xmm0, 0xa0(%rdi)
movups %xmm0, 0x90(%rdi)
movups %xmm0, 0x80(%rdi)
movb $0x0, 0xd0(%rdi)
movups %xmm0, 0x110(%rdi)
movups %xmm0, 0x100(%rdi)
movups %xmm0, 0xf0(%rdi)
movl $0x1, 0x120(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: LodePNG_decode32f(unsigned char**, unsigned int*, unsigned int*, char const*)
unsigned LodePNG_decode32f(unsigned char** out, unsigned* w, unsigned* h, const char* filename)
{
  unsigned char* buffer;
  size_t buffersize;
  unsigned error;
  error = LodePNG_loadFile(&buffer, &buffersize, filename);
  if(!error) error = LodePNG_decode32(out, w, h, buffer, buffersize);
  free(buffer);
  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movq %rcx, %rdx
callq 0x2012a
movl %eax, %r12d
testl %eax, %eax
jne 0x20111
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1fef9
movl %eax, %r12d
movq -0x28(%rbp), %rdi
callq 0x5390
movl %r12d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: LodePNG_loadFile(unsigned char**, unsigned long*, char const*)
unsigned LodePNG_loadFile(unsigned char** out, size_t* outsize, const char* filename) /*designed for loading files from hard disk in a dynamically allocated buffer*/
{
  FILE* file;
  long size;
  
  /*provide some proper output values if error will happen*/
  *out = 0;
  *outsize = 0;

  file = fopen(filename, "rb");
  if(!file) return 78;

  /*get filesize:*/
  fseek(file , 0 , SEEK_END);
  size = ftell(file);
  rewind(file);
  
  /*read contents of the file into the vector*/
  *outsize = 0;
  *out = (unsigned char*)malloc((size_t)size);
  if(size && (*out)) (*outsize) = fread(*out, 1, (size_t)size, file);

  fclose(file);
  if(!(*out) && size) return 80; /*the above malloc failed*/
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorl %eax, %eax
movq %rax, (%rdi)
movq %rax, (%rsi)
leaq 0x11a5c(%rip), %rsi     # 0x31ba9
movq %rdx, %rdi
callq 0x5380
testq %rax, %rax
je 0x201d8
movq %rax, %r15
xorl %r13d, %r13d
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x5340
movq %r15, %rdi
callq 0x5030
movq %rax, %r12
movq %r15, %rdi
callq 0x5080
movq $0x0, (%r14)
movq %r12, %rdi
callq 0x5420
movq %rax, (%rbx)
testq %r12, %r12
sete %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x201ba
movl $0x1, %esi
movq %rax, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq 0x5470
movq %rax, (%r14)
movq %r15, %rdi
callq 0x52c0
cmpq $0x0, (%rbx)
movl $0x50, %eax
cmovnel %r13d, %eax
testq %r12, %r12
cmovel %r13d, %eax
jmp 0x201dd
movl $0x4e, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: LodePNG_Decoder_copy(LodePNG_Decoder*, LodePNG_Decoder const*)
void LodePNG_Decoder_copy(LodePNG_Decoder* dest, const LodePNG_Decoder* source)
{
  LodePNG_Decoder_cleanup(dest);
  *dest = *source;
  LodePNG_InfoRaw_init(&dest->infoRaw);
  LodePNG_InfoPng_init(&dest->infoPng);
  dest->error = LodePNG_InfoRaw_copy(&dest->infoRaw, &source->infoRaw); if(dest->error) return;
  dest->error = LodePNG_InfoPng_copy(&dest->infoPng, &source->infoPng); if(dest->error) return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
callq 0x20098
movl $0x128, %edx            # imm = 0x128
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5270
leaq 0x18(%rbx), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
movabsq $0x800000006, %rax      # imm = 0x800000006
movq %rax, 0x18(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x40(%rbx)
movups %xmm0, 0x70(%rbx)
movq %rax, 0x58(%rbx)
movups %xmm0, 0x60(%rbx)
xorl %eax, %eax
movl %eax, 0x50(%rbx)
movl %eax, 0xe0(%rbx)
movups %xmm0, 0x80(%rbx)
movups %xmm0, 0x90(%rbx)
movups %xmm0, 0xa0(%rbx)
movups %xmm0, 0xb0(%rbx)
movups %xmm0, 0xc0(%rbx)
movb $0x0, 0xd0(%rbx)
movups %xmm0, 0x110(%rbx)
movups %xmm0, 0x100(%rbx)
movups %xmm0, 0xf0(%rbx)
leaq 0x18(%r14), %rsi
callq 0x1df56
movl %eax, 0x120(%rbx)
testl %eax, %eax
jne 0x202d0
leaq 0x40(%rbx), %rdi
addq $0x40, %r14
movq %r14, %rsi
callq 0x1dd69
movl %eax, 0x120(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: writeSignature(ucvector*)
static void writeSignature(ucvector* out)
{
  /*8 bytes PNG signature*/
  ucvector_push_back(out, 137);
  ucvector_push_back(out, 80);
  ucvector_push_back(out, 78);
  ucvector_push_back(out, 71);
  ucvector_push_back(out, 13);
  ucvector_push_back(out, 10);
  ucvector_push_back(out, 26);
  ucvector_push_back(out, 10);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rsi
incq %rsi
callq 0x1bb2f
testl %eax, %eax
je 0x20f91
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movb $-0x77, -0x1(%rax,%rcx)
movq 0x8(%rbx), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x1bb2f
testl %eax, %eax
je 0x20fb0
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movb $0x50, -0x1(%rax,%rcx)
movq 0x8(%rbx), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x1bb2f
testl %eax, %eax
je 0x20fcf
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movb $0x4e, -0x1(%rax,%rcx)
movq 0x8(%rbx), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x1bb2f
testl %eax, %eax
je 0x20fee
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movb $0x47, -0x1(%rax,%rcx)
movq 0x8(%rbx), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x1bb2f
testl %eax, %eax
je 0x2100d
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movb $0xd, -0x1(%rax,%rcx)
movq 0x8(%rbx), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x1bb2f
testl %eax, %eax
je 0x2102c
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movb $0xa, -0x1(%rax,%rcx)
movq 0x8(%rbx), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x1bb2f
testl %eax, %eax
je 0x2104b
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movb $0x1a, -0x1(%rax,%rcx)
movq 0x8(%rbx), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x1bb2f
testl %eax, %eax
je 0x2106a
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movb $0xa, -0x1(%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: addUnknownChunks(ucvector*, unsigned char*, unsigned long)
static unsigned addUnknownChunks(ucvector* out, unsigned char* data, size_t datasize)
{
  unsigned char* inchunk = data;
  while((size_t)(inchunk - data) < datasize)
  {
    unsigned error = LodePNG_append_chunk(&out->data, &out->size, inchunk);
    if(error) return error; /*error: not enough memory*/
    out->allocsize = out->size; /*fix the allocsize again*/
    inchunk = LodePNG_chunk_next(inchunk);
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r15
leaq 0x8(%rdi), %r13
movq %rsi, %r14
movq %r14, %rax
subq %r12, %rax
cmpq %rbx, %rax
jae 0x212f6
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x1d378
testl %eax, %eax
je 0x212dd
movl %eax, -0x2c(%rbp)
jmp 0x212f0
movq 0x8(%r15), %rcx
movq %rcx, 0x10(%r15)
movl (%r14), %ecx
bswapl %ecx
addl $0xc, %ecx
addq %rcx, %r14
testl %eax, %eax
je 0x212bb
jmp 0x212fd
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: addChunk_pHYs(ucvector*, LodePNG_InfoPng const*)
static unsigned addChunk_pHYs(ucvector* out, const LodePNG_InfoPng* info)
{
  unsigned error = 0;
  ucvector data;
  ucvector_init(&data);
  
  LodePNG_add32bitInt(&data, info->phys_x);
  LodePNG_add32bitInt(&data, info->phys_y);
  ucvector_push_back(&data, info->phys_unit);
  
  error = addChunk(out, "pHYs", data.data, data.size);
  ucvector_cleanup(&data);
  
  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, -0x40(%rbp)
movl 0xa4(%rsi), %ebx
movl $0x20, %edi
callq 0x5420
movq %rax, %r14
xorl %r12d, %r12d
testq %rax, %rax
setne %r12b
leal (,%r12,4), %r13d
shll $0x5, %r12d
bswapl %ebx
movl %ebx, -0x4(%rax,%r13)
movq %r15, -0x38(%rbp)
movl 0xa8(%r15), %ebx
leaq 0x4(%r13), %r15
leal (,%r15,4), %eax
cmpl %r12d, %eax
jbe 0x21b04
leal (,%r15,8), %esi
movq %r14, %rdi
movq %rsi, -0x30(%rbp)
callq 0x5500
testq %rax, %rax
je 0x21b07
movq %rax, %r14
movq %r15, %r13
movq -0x30(%rbp), %r12
jmp 0x21b07
movq %r15, %r13
bswapl %ebx
movl %ebx, -0x4(%r14,%r13)
movq -0x38(%rbp), %rax
movb 0xac(%rax), %bl
leaq 0x1(%r13), %r15
leal (,%r15,4), %eax
cmpl %r12d, %eax
jbe 0x21b45
leal (,%r15,8), %esi
movq %r14, %rdi
callq 0x5500
testq %rax, %rax
je 0x21b49
xorl %ecx, %ecx
movq %rax, %r14
jmp 0x21b4e
xorl %ecx, %ecx
jmp 0x21b4e
movb $0x1, %cl
movq %r13, %r15
testb %cl, %cl
jne 0x21b57
movb %bl, -0x1(%r14,%r15)
movq -0x40(%rbp), %rbx
leaq 0x8(%rbx), %rsi
leaq 0x10076(%rip), %rcx     # 0x31bdc
movq %rbx, %rdi
movl %r15d, %edx
movq %r14, %r8
callq 0x1d440
testl %eax, %eax
jne 0x21b80
movq 0x8(%rbx), %rax
movq %rax, 0x10(%rbx)
movq %r14, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5390
// File: /workspace/github_cpp_makefile_star2_O1/mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: addChunk_IDAT(ucvector*, unsigned char const*, unsigned long, LodeZlib_DeflateSettings*)
static unsigned addChunk_IDAT(ucvector* out, const unsigned char* data, size_t datasize, LodeZlib_DeflateSettings* zlibsettings)
{
  ucvector zlibdata;
  unsigned error = 0;
  
  /*compress with the Zlib compressor*/
  ucvector_init(&zlibdata);
  error = LodePNG_compress(&zlibdata.data, &zlibdata.size, data, datasize, zlibsettings);
  if(!error) error = addChunk(out, "IDAT", zlibdata.data, zlibdata.size);
  ucvector_cleanup(&zlibdata);
  
  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r8
movq %rdx, %rcx
movq %rsi, %rdx
movq %rdi, %r14
xorps %xmm0, %xmm0
leaq -0x28(%rbp), %rbx
movaps %xmm0, -0x8(%rbx)
movq $0x0, 0x8(%rbx)
leaq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x1cf1d
testl %eax, %eax
jne 0x21bf0
movq -0x30(%rbp), %r8
movl -0x28(%rbp), %edx
leaq 0x8(%r14), %rsi
leaq 0xffcb(%rip), %rcx      # 0x31baf
movq %r14, %rdi
callq 0x1d440
testl %eax, %eax
je 0x21c10
movl %eax, %r15d
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq -0x30(%rbp), %rdi
callq 0x5390
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%r14), %rax
movq %rax, 0x10(%r14)
xorl %r15d, %r15d
jmp 0x21bf3
// File: /workspace/github_cpp_makefile_star2_O1/mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: addChunk_tIME(ucvector*, LodePNG_Time const*)
static unsigned addChunk_tIME(ucvector* out, const LodePNG_Time* time)
{
  unsigned error = 0;
  unsigned char* data = (unsigned char*)malloc(7);
  if(!data) return 9948;
  data[0] = (unsigned char)(time->year / 256);
  data[1] = (unsigned char)(time->year % 256);
  data[2] = time->month;
  data[3] = time->day;
  data[4] = time->hour;
  data[5] = time->minute;
  data[6] = time->second;
  error = addChunk(out, "tIME", data, 7);
  free(data);
  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movl $0x7, %edi
callq 0x5420
testq %rax, %rax
je 0x21cac
movq %rax, %r14
movzwl (%r15), %eax
rolw $0x8, %ax
movw %ax, (%r14)
movb 0x4(%r15), %al
movb %al, 0x2(%r14)
movb 0x5(%r15), %al
movb %al, 0x3(%r14)
movb 0x6(%r15), %al
movb %al, 0x4(%r14)
movb 0x7(%r15), %al
movb %al, 0x5(%r14)
movb 0x8(%r15), %al
movb %al, 0x6(%r14)
leaq 0x8(%rbx), %rsi
leaq 0xff59(%rip), %rcx      # 0x31bd7
movq %rbx, %rdi
movl $0x7, %edx
movq %r14, %r8
callq 0x1d440
testl %eax, %eax
jne 0x21c9a
movq 0x8(%rbx), %rax
movq %rax, 0x10(%rbx)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5390
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x130, %rsp            # imm = 0x130
movl %r8d, %r9d
movl %ecx, %r8d
movq %rdx, %rcx
movq %rsi, %rdx
movq %rdi, %rsi
movaps 0xf199(%rip), %xmm0     # 0x317d0
leaq -0x140(%rbp), %rbx
movups %xmm0, (%rbx)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x10(%rbx)
xorl %eax, %eax
movl %eax, 0x18(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x50(%rbx)
movabsq $0x800000006, %rdi      # imm = 0x800000006
movq %rdi, 0x38(%rbx)
movups %xmm0, 0x40(%rbx)
movl %eax, 0x30(%rbx)
movl %eax, 0xc0(%rbx)
movups %xmm0, 0x60(%rbx)
movups %xmm0, 0x70(%rbx)
movups %xmm0, 0x80(%rbx)
movups %xmm0, 0x90(%rbx)
movups %xmm0, 0xa0(%rbx)
movb $0x0, 0xb0(%rbx)
movups %xmm0, 0xf0(%rbx)
movups %xmm0, 0xe0(%rbx)
movups %xmm0, 0xd0(%rbx)
movups %xmm0, 0x118(%rbx)
movq %rdi, 0x100(%rbx)
movups %xmm0, 0x108(%rbx)
movl $0x1, 0x128(%rbx)
movq %rbx, %rdi
callq 0x202d5
movl 0x128(%rbx), %r14d
movq %rbx, %rdi
callq 0x22799
movl %r14d, %eax
addq $0x130, %rsp            # imm = 0x130
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
movaps 0xf0cd(%rip), %xmm0     # 0x317d0
movups %xmm0, (%rdi)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x10(%rdi)
xorl %eax, %eax
movl %eax, 0x18(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x50(%rdi)
movabsq $0x800000006, %rcx      # imm = 0x800000006
movq %rcx, 0x38(%rdi)
movups %xmm0, 0x40(%rdi)
movl %eax, 0x30(%rdi)
movl %eax, 0xc0(%rdi)
movups %xmm0, 0x60(%rdi)
movups %xmm0, 0x70(%rdi)
movups %xmm0, 0x80(%rdi)
movups %xmm0, 0x90(%rdi)
movups %xmm0, 0xa0(%rdi)
movb $0x0, 0xb0(%rdi)
movups %xmm0, 0xf0(%rdi)
movups %xmm0, 0xe0(%rdi)
movups %xmm0, 0xd0(%rdi)
movups %xmm0, 0x118(%rdi)
movq %rcx, 0x100(%rdi)
movups %xmm0, 0x108(%rdi)
movl $0x1, 0x128(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x22613
movl %eax, %r12d
movq (%r14), %r14
movq (%r15), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x22827
movq %r14, %rdi
callq 0x5390
movl %r12d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
callq 0x22799
movl $0x130, %edx            # imm = 0x130
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5270
leaq 0x20(%rbx), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x50(%rbx)
movabsq $0x800000006, %rax      # imm = 0x800000006
movq %rax, 0x38(%rbx)
movups %xmm0, 0x40(%rbx)
xorl %ecx, %ecx
movl %ecx, 0x30(%rbx)
movl %ecx, 0xc0(%rbx)
movups %xmm0, 0x60(%rbx)
movups %xmm0, 0x70(%rbx)
movups %xmm0, 0x80(%rbx)
movups %xmm0, 0x90(%rbx)
movups %xmm0, 0xa0(%rbx)
movb $0x0, 0xb0(%rbx)
movups %xmm0, 0xd0(%rbx)
movups %xmm0, 0xe0(%rbx)
movups %xmm0, 0xf0(%rbx)
movups %xmm0, 0x118(%rbx)
movq %rax, 0x100(%rbx)
movups %xmm0, 0x108(%rbx)
leaq 0x20(%r14), %rsi
callq 0x1dd69
movl %eax, 0x128(%rbx)
testl %eax, %eax
jne 0x2296d
leaq 0x100(%rbx), %rdi
addq $0x100, %r14            # imm = 0x100
movq %r14, %rsi
callq 0x1df56
movl %eax, 0x128(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
movq %rdi, %rbx
xorl %edi, %edi
leaq -0x28(%rbp), %r15
movq %rdi, (%r15)
leaq -0x20(%rbp), %rax
movq %rdi, (%rax)
movq (%rsi), %rdx
movq 0x8(%rsi), %rcx
subq %rdx, %rcx
cmoveq %rdi, %rdx
movq %r15, %rdi
movq %rax, %rsi
callq 0x1cd9e
movl %eax, %r14d
movq (%r15), %r15
testq %r15, %r15
je 0x229d7
movq 0x8(%rbx), %rsi
movq -0x20(%rbp), %rcx
addq %r15, %rcx
movq %rbx, %rdi
movq %r15, %rdx
callq 0x258a6
movq %r15, %rdi
callq 0x5390
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r8
movq %rdi, %rbx
xorl %edi, %edi
leaq -0x28(%rbp), %r15
movq %rdi, (%r15)
leaq -0x20(%rbp), %rax
movq %rdi, (%rax)
movq (%rsi), %rdx
movq 0x8(%rsi), %rcx
subq %rdx, %rcx
cmoveq %rdi, %rdx
movq %r15, %rdi
movq %rax, %rsi
callq 0x1cf1d
movl %eax, %r14d
movq (%r15), %r15
testq %r15, %r15
je 0x22a4a
movq 0x8(%rbx), %rsi
movq -0x20(%rbp), %rcx
addq %r15, %rcx
movq %rbx, %rdi
movq %r15, %rdx
callq 0x258a6
movq %r15, %rdi
callq 0x5390
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r8
movq %rdx, %rcx
movq %rsi, %rbx
leaq -0x20(%rbp), %r14
leaq -0x18(%rbp), %rdx
movq %r14, %rsi
callq 0x1eab5
movq (%r14), %r14
testq %r14, %r14
je 0x22b58
movq 0x8(%rbx), %rsi
movq -0x18(%rbp), %rcx
addq %r14, %rcx
movq %rbx, %rdi
movq %r14, %rdx
callq 0x258a6
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x5390
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x202d5
movq (%r14), %r14
testq %r14, %r14
je 0x22d1d
movq 0x8(%rbx), %rsi
movq -0x18(%rbp), %rcx
addq %r14, %rcx
movq %rbx, %rdi
movq %r14, %rdx
callq 0x258a6
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x5390
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
movq %r14, %rdi
movl $0xe, %edx
callq 0x5590
movq %r14, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x5430
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
cmpl $0x0, 0x20(%rax,%rcx)
je 0x22f3e
xorl %r14d, %r14d
jmp 0x22f4d
leaq -0x218(%rbp), %rdi
callq 0x5540
movq %rax, %r14
leaq -0x218(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5430
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
cmpl $0x0, 0x20(%rax,%rcx)
jne 0x22f7a
leaq -0x218(%rbp), %rdi
callq 0x5540
subq %rax, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1ae26
testq %r14, %r14
jle 0x22f9c
movq (%rbx), %rsi
leaq -0x218(%rbp), %rdi
movq %r14, %rdx
callq 0x53d0
leaq -0x218(%rbp), %rdi
callq 0x50a0
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x22fb8
jmp 0x22fb8
movq %rax, %rbx
leaq -0x218(%rbp), %rdi
callq 0x50a0
movq %rbx, %rdi
callq 0x5560
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x130, %rsp            # imm = 0x130
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %rsi
movl 0x10(%rbp), %eax
movabsq $0x100000001, %rdx      # imm = 0x100000001
leaq -0x138(%rbp), %rdi
movq %rdx, 0x8(%rdi)
xorl %edx, %edx
movl %edx, 0x10(%rdi)
movq $0x0, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rdi)
movabsq $0x800000006, %r10      # imm = 0x800000006
movq %r10, 0x18(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x40(%rdi)
movups %xmm0, 0x70(%rdi)
movq %r10, 0x58(%rdi)
movups %xmm0, 0x60(%rdi)
movl %edx, 0x50(%rdi)
movl %edx, 0xe0(%rdi)
movups %xmm0, 0x80(%rdi)
movups %xmm0, 0x90(%rdi)
movups %xmm0, 0xa0(%rdi)
movups %xmm0, 0xb0(%rdi)
movups %xmm0, 0xc0(%rdi)
movb $0x0, 0xd0(%rdi)
movups %xmm0, 0x110(%rdi)
movups %xmm0, 0x100(%rdi)
movups %xmm0, 0xf0(%rdi)
movl $0x1, 0x120(%rdi)
movl %r9d, 0x18(%rdi)
movl %eax, 0x1c(%rdi)
movl %r8d, %eax
movq %rcx, %rdx
movq %rax, %rcx
callq 0x22b06
leaq -0x138(%rbp), %rdi
movl 0x40(%rdi), %eax
movl %eax, (%r14)
movl 0x44(%rdi), %eax
movl %eax, (%rbx)
movl 0x120(%rdi), %ebx
callq 0x20098
movl %ebx, %eax
addq $0x130, %rsp            # imm = 0x130
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x138(%rbp), %rdi
callq 0x20098
movq %rbx, %rdi
callq 0x5560
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
subq $0x138, %rsp            # imm = 0x138
movl %ecx, %eax
movl %edx, %ecx
movq %rsi, %rdx
movq %rdi, %rsi
movaps 0xe563(%rip), %xmm0     # 0x317d0
leaq -0x138(%rbp), %rdi
movups %xmm0, (%rdi)
movabsq $0x100000000, %r10      # imm = 0x100000000
movq %r10, 0x10(%rdi)
xorl %r10d, %r10d
movl %r10d, 0x18(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x50(%rdi)
movabsq $0x800000006, %r11      # imm = 0x800000006
movq %r11, 0x38(%rdi)
movups %xmm0, 0x40(%rdi)
movl %r10d, 0x30(%rdi)
movl %r10d, 0xc0(%rdi)
movups %xmm0, 0x60(%rdi)
movups %xmm0, 0x70(%rdi)
movups %xmm0, 0x80(%rdi)
movups %xmm0, 0x90(%rdi)
movups %xmm0, 0xa0(%rdi)
movb $0x0, 0xb0(%rdi)
movups %xmm0, 0xf0(%rdi)
movups %xmm0, 0xe0(%rdi)
movups %xmm0, 0xd0(%rdi)
movups %xmm0, 0x118(%rdi)
movups %xmm0, 0x108(%rdi)
movl $0x1, 0x128(%rdi)
movl %r8d, 0x100(%rdi)
movl %r9d, 0x104(%rdi)
movl %eax, %r8d
callq 0x22cc8
leaq -0x138(%rbp), %rdi
movl 0x128(%rdi), %ebx
callq 0x22799
movl %ebx, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq -0x138(%rbp), %rdi
callq 0x22799
movq %rbx, %rdi
callq 0x5560
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x150, %rsp            # imm = 0x150
movl %ecx, %eax
movl %edx, %ecx
movq %rsi, %rdx
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq -0x30(%rbp), %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movaps 0xe435(%rip), %xmm1     # 0x317d0
leaq -0x160(%rbp), %rdi
movups %xmm1, (%rdi)
movabsq $0x100000000, %r10      # imm = 0x100000000
movq %r10, 0x10(%rdi)
xorl %r10d, %r10d
movl %r10d, 0x18(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x50(%rdi)
movabsq $0x800000006, %r11      # imm = 0x800000006
movq %r11, 0x38(%rdi)
movups %xmm0, 0x40(%rdi)
movl %r10d, 0x30(%rdi)
movl %r10d, 0xc0(%rdi)
movups %xmm0, 0x60(%rdi)
movups %xmm0, 0x70(%rdi)
movups %xmm0, 0x80(%rdi)
movups %xmm0, 0x90(%rdi)
movups %xmm0, 0xa0(%rdi)
movb $0x0, 0xb0(%rdi)
movups %xmm0, 0xf0(%rdi)
movups %xmm0, 0xe0(%rdi)
movups %xmm0, 0xd0(%rdi)
movups %xmm0, 0x118(%rdi)
movups %xmm0, 0x108(%rdi)
movl $0x1, 0x128(%rdi)
movl %r8d, 0x100(%rdi)
movl %r9d, 0x104(%rdi)
movl %eax, %r8d
callq 0x22cc8
movl -0x38(%rbp), %r14d
testl %r14d, %r14d
jne 0x2345b
leaq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x22fcf
leaq -0x160(%rbp), %rdi
callq 0x22799
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x2347c
movq -0x20(%rbp), %rsi
subq %rdi, %rsi
callq 0x52e0
movl %r14d, %eax
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x160(%rbp), %rdi
callq 0x22799
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x234af
movq -0x20(%rbp), %rsi
subq %rdi, %rsi
callq 0x52e0
movq %rbx, %rdi
callq 0x5560
// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
movq %rsi, -0x30(%rbp)
movq (%rdx), %rbx
xorl %r9d, %r9d
testb $0x7, %bl
setne %r14b
movq %rbx, %r10
shrq $0x3, %r10
cmpq %r8, %r10
setbe %r15b
orb %r14b, %r15b
jne 0x2355b
movl $0xa, (%rdi)
xorl %eax, %eax
xorl %r13d, %r13d
jmp 0x235ce
movq -0x30(%rbp), %r14
movzbl (%r14,%r10), %r13d
leaq 0x1(%rbx), %r14
movq %r14, (%rdx)
movl 0x4c(%rcx), %r15d
movl $0xb, %r10d
movl %r9d, %r12d
cmpl %r15d, %r9d
jae 0x235a9
andl $0x7, %ebx
xorl %esi, %esi
btl %ebx, %r13d
setb %sil
movq (%rcx), %r10
leal (%rsi,%r9,2), %esi
movl (%r10,%rsi,4), %esi
xorl %r10d, %r10d
xorl %r11d, %r11d
movl %esi, %r12d
subl %r15d, %r12d
setb %r11b
cmovbl %r10d, %r12d
xorl %r13d, %r13d
movl %r10d, (%rdi)
cmpl %r15d, %r9d
jae 0x235c6
testl %r11d, %r11d
sete %r13b
cmovnel %esi, %eax
movq %r14, %rbx
movl %r12d, %r9d
jmp 0x235ce
movq %r14, %rbx
movl %r12d, %r9d
xorl %eax, %eax
testb %r13b, %r13b
jne 0x23534
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
movq %rdi, %r14
movl $0x900, %edi            # imm = 0x900
callq 0x5420
movq %rax, %rbx
testq %rax, %rax
je 0x2366c
xorl %eax, %eax
movl $0x8, (%rbx,%rax,4)
incq %rax
cmpq $0x90, %rax
jne 0x23600
movl $0x90, %eax
movl $0x9, (%rbx,%rax,4)
incq %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0x23617
movl $0x100, %eax            # imm = 0x100
movl $0x7, (%rbx,%rax,4)
incq %rax
cmpq $0x118, %rax            # imm = 0x118
jne 0x2362e
movl $0x118, %eax            # imm = 0x118
movl $0x8, (%rbx,%rax,4)
incq %rax
cmpq $0x120, %rax            # imm = 0x120
jne 0x23645
movl $0x120, %edx            # imm = 0x120
movq %r14, %rdi
movq %rbx, %rsi
movl $0xf, %ecx
callq 0x2371c
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x5390
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
movq %rdi, %r14
movl $0x100, %edi            # imm = 0x100
callq 0x5420
movq %rax, %rbx
testq %rax, %rax
je 0x236bb
xorl %eax, %eax
movl $0x5, (%rbx,%rax,4)
incq %rax
cmpq $0x20, %rax
jne 0x23696
movl $0x20, %edx
movq %r14, %rdi
movq %rbx, %rsi
movl $0xf, %ecx
callq 0x2371c
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x5390
// File: /workspace/github_cpp_makefile_star2_O1/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 0x23704
leaq (,%rbx,8), %r15
movq (%r14), %rdi
movq %r15, %rsi
callq 0x5500
testq %rax, %rax
je 0x23718
movq %r15, 0x10(%r14)
movq %rax, (%r14)
movq %rbx, 0x8(%r14)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x2370d
// File: /workspace/github_cpp_makefile_star2_O1/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 0x236c7
testl %eax, %eax
je 0x2377f
testq %r15, %r15
je 0x23764
movq (%r13), %rax
xorl %ecx, %ecx
movl (%r12,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
incq %rcx
movl %ecx, %edx
cmpq %r15, %rdx
jb 0x23753
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 0x23793
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_O1/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 0x2417b
addq %r15, %r15
movq (%r14), %rdi
movq %r15, %rsi
callq 0x5500
testq %rax, %rax
je 0x2418f
movq %r15, 0x10(%r14)
movq %rax, (%r14)
movq %rbx, 0x8(%r14)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x24184
// File: /workspace/github_cpp_makefile_star2_O1/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:
testl %r8d, %r8d
je 0x25071
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rax
subq %rdx, %rax
xorl %r9d, %r9d
xorl %r10d, %r10d
xorl %r11d, %r11d
testq %rdx, %rdx
je 0x2505c
movq %rdx, %rbx
movq %r10, %r14
movq %r14, %rcx
shrq $0x3, %rcx
movl %r14d, %r15d
notb %r15b
movzbl (%rsi,%rcx), %r12d
movzbl %r15b, %r13d
andl $0x7, %r13d
movl %r11d, %ecx
notb %cl
andb $0x7, %cl
movb $0x1, %r15b
shlb %cl, %r15b
btl %r13d, %r12d
jae 0x25040
movq %r11, %rcx
shrq $0x3, %rcx
orb %r15b, (%rdi,%rcx)
jmp 0x2504e
notb %r15b
movq %r11, %rcx
shrq $0x3, %rcx
andb %r15b, (%rdi,%rcx)
incq %r11
incq %r14
decq %rbx
jne 0x25005
addq %rdx, %r10
addq %rax, %r10
incl %r9d
cmpl %r8d, %r9d
jne 0x24ffa
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
movq %rdx, -0x30(%rbp)
testl %r8d, %r8d
je 0x2523a
movq %rcx, %rax
movq -0x30(%rbp), %rdx
subq %rcx, %rdx
xorl %r10d, %r10d
xorl %r11d, %r11d
xorl %ebx, %ebx
testq %rax, %rax
je 0x25208
movq %rax, %r14
movq %r11, %r15
movq %r15, %rcx
shrq $0x3, %rcx
movl %r15d, %r12d
notb %r12b
movzbl (%rsi,%rcx), %r13d
movzbl %r12b, %r9d
andl $0x7, %r9d
movl %ebx, %ecx
notb %cl
andb $0x7, %cl
movb $0x1, %r12b
shlb %cl, %r12b
btl %r9d, %r13d
jae 0x251ec
movq %rbx, %rcx
shrq $0x3, %rcx
orb %r12b, (%rdi,%rcx)
jmp 0x251fa
notb %r12b
movq %rbx, %rcx
shrq $0x3, %rcx
andb %r12b, (%rdi,%rcx)
incq %rbx
incq %r15
decq %r14
jne 0x251b2
addq %rax, %r11
movq %rdx, %r14
cmpq %rax, -0x30(%rbp)
je 0x2522e
movl %ebx, %ecx
notb %cl
movb $-0x2, %r9b
rolb %cl, %r9b
movq %rbx, %rcx
shrq $0x3, %rcx
andb %r9b, (%rdi,%rcx)
incq %rbx
decq %r14
jne 0x25211
incl %r10d
cmpl %r8d, %r10d
jne 0x251a7
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %rdi, -0x38(%rbp)
cmpl $0x0, (%rsi)
je 0x25b0c
movq %rsi, %r12
xorpd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
xorl %ebx, %ebx
leaq -0x40(%rbp), %r13
xorl %r15d, %r15d
movq 0x8(%r12,%rbx,8), %rdi
movq (%rdi), %rax
movq %r14, %rsi
movq %r13, %rdx
callq *0x10(%rax)
testb %al, %al
je 0x25afe
movsd -0x40(%rbp), %xmm0
testq %r15, %r15
je 0x25af4
movsd -0x30(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x25afe
movq 0x8(%r12,%rbx,8), %r15
movsd %xmm0, -0x30(%rbp)
incq %rbx
movl (%r12), %eax
cmpq %rax, %rbx
jb 0x25aca
jmp 0x25b18
xorpd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
xorl %r15d, %r15d
testq %r15, %r15
je 0x25b89
movsd 0x18(%r14), %xmm0
movsd -0x30(%rbp), %xmm2
mulsd %xmm2, %xmm0
movsd 0x20(%r14), %xmm1
mulsd %xmm2, %xmm1
mulsd 0x28(%r14), %xmm2
addsd (%r14), %xmm0
addsd 0x8(%r14), %xmm1
movq 0x8(%r15), %rbx
addsd 0x10(%r14), %xmm2
leaq -0x70(%rbp), %rdx
movsd %xmm0, (%rdx)
movsd %xmm1, 0x8(%rdx)
movsd %xmm2, 0x10(%rdx)
movq (%r15), %rax
leaq -0x58(%rbp), %rdi
movq %r15, %rsi
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 0x25b9d
xorpd %xmm0, %xmm0
movq -0x38(%rbp), %rax
movupd %xmm0, (%rax)
movq $0x0, 0x10(%rax)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq