LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/LodePNG.cpp
// Function: addUnknownChunks(ucvector*, unsigned char*, unsigned long)
static unsigned addUnknownChunks(ucvector* out, unsigned char* data, size_t datasize) {
  unsigned char* inchunk = data;
  while((size_t)(inchunk - data) < datasize) {
    CERROR_TRY_RETURN(lodepng_chunk_append(&out->data, &out->size, inchunk));
    out->allocsize = out->size; /*fix the allocsize again*/
    inchunk = lodepng_chunk_next(inchunk, data + datasize);
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8(%rdi), %r12
leaq (%rsi,%rdx), %r13
movq %rsi, %rbp
movq %rbp, %rax
subq %r14, %rax
cmpq %rbx, %rax
jae 0x7b765
movq %r15, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x75dbf
testl %eax, %eax
jne 0x7b767
movq 0x8(%r15), %rax
movq %rax, 0x10(%r15)
movq %rbp, %rdi
movq %r13, %rsi
callq 0x75c4f
movq %rax, %rbp
jmp 0x7b730
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/LodePNG.cpp
// Function: lodepng::decode(std::vector<unsigned char, std::allocator<unsigned char>>&, unsigned int&, unsigned int&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, LodePNGColorType, unsigned int)
unsigned decode(std::vector<unsigned char>& out, unsigned& w, unsigned& h, const std::string& filename,
                LodePNGColorType colortype, unsigned bitdepth) {
  std::vector<unsigned char> buffer;
  /* safe output values in case error happens */
  w = h = 0;
  unsigned error = load_file(buffer, filename);
  if(error) return error;
  return decode(out, w, h, buffer, colortype, bitdepth);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %ebx
movl %r8d, %ebp
movq %rdx, %r14
movq %rsi, %r15
xorps %xmm0, %xmm0
movq %rsp, %rax
andq $0x0, 0x10(%rax)
movaps %xmm0, (%rax)
andl $0x0, (%rdx)
movq %rdi, %r13
andl $0x0, (%rsi)
movq %rax, %rdi
movq %rcx, %rsi
callq 0x7bae6
movl %eax, %r12d
testl %eax, %eax
jne 0x7be68
movq %rsp, %rcx
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebp, %r8d
movl %ebx, %r9d
callq 0x7bd53
movl %eax, %r12d
movq %rsp, %rdi
callq 0x737ec
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x737ec
movq %rbx, %rdi
callq 0x527a0
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/LodePNG.cpp
// Function: huffmanDecodeSymbol(LodePNGBitReader*, HuffmanTree const*)
static unsigned huffmanDecodeSymbol(LodePNGBitReader* reader, const HuffmanTree* codetree) {
  unsigned short code = peekBits(reader, FIRSTBITS);
  unsigned short l = codetree->table_len[code];
  unsigned short value = codetree->table_value[code];
  if(l <= FIRSTBITS) {
    advanceBits(reader, l);
    return value;
  } else {
    unsigned index2;
    advanceBits(reader, FIRSTBITS);
    index2 = value + peekBits(reader, l - FIRSTBITS);
    advanceBits(reader, codetree->table_len[index2] - FIRSTBITS);
    return codetree->table_value[index2];
  }
}

// Assembly:
movl 0x20(%rdi), %eax
movl %eax, %r9d
andl $0x1ff, %r9d            # imm = 0x1FF
movq 0x18(%rsi), %r8
movq 0x20(%rsi), %rdx
movzbl (%r8,%r9), %ecx
movl %r9d, %esi
movzwl (%rdx,%rsi,2), %esi
cmpq $0x9, %rcx
ja 0x7c196
shrl %cl, %eax
movl %eax, 0x20(%rdi)
addq %rcx, 0x18(%rdi)
jmp 0x7c1e5
movzwl %si, %r9d
shrl $0x9, %eax
movl %eax, 0x20(%rdi)
movq 0x18(%rdi), %rsi
leaq 0x9(%rsi), %r10
addb $-0x9, %cl
pushq $-0x1
popq %r11
shll %cl, %r11d
movq %r10, 0x18(%rdi)
notl %r11d
andl %eax, %r11d
addq %r9, %r11
movzbl (%r8,%r11), %r8d
movl $0xfffffff7, %ecx       # imm = 0xFFFFFFF7
addq %r8, %rcx
movl %ecx, %r8d
shrl %cl, %eax
movl %eax, 0x20(%rdi)
leaq (%r8,%rsi), %rax
addq $0x9, %rax
movq %rax, 0x18(%rdi)
movzwl (%rdx,%r11,2), %esi
movzwl %si, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/LodePNG.cpp
// Function: HuffmanTree_cleanup(HuffmanTree*)
static void HuffmanTree_cleanup(HuffmanTree* tree) {
  lodepng_free(tree->codes);
  lodepng_free(tree->lengths);
  lodepng_free(tree->table_len);
  lodepng_free(tree->table_value);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x52530
movq 0x8(%rbx), %rdi
callq 0x52530
movq 0x18(%rbx), %rdi
callq 0x52530
movq 0x20(%rbx), %rdi
popq %rbx
jmp 0x52530
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/LodePNG.cpp
// Function: generateFixedLitLenTree(HuffmanTree*)
static unsigned generateFixedLitLenTree(HuffmanTree* tree) {
  unsigned i, error = 0;
  unsigned* bitlen = (unsigned*)lodepng_malloc(NUM_DEFLATE_CODE_SYMBOLS * sizeof(unsigned));
  if(!bitlen) return 83; /*alloc fail*/

  /*288 possible codes: 0-255=literals, 256=endcode, 257-285=lengthcodes, 286-287=unused*/
  for(i =   0; i <= 143; ++i) bitlen[i] = 8;
  for(i = 144; i <= 255; ++i) bitlen[i] = 9;
  for(i = 256; i <= 279; ++i) bitlen[i] = 7;
  for(i = 280; i <= 287; ++i) bitlen[i] = 8;

  error = HuffmanTree_makeFromLengths(tree, bitlen, NUM_DEFLATE_CODE_SYMBOLS, 15);

  lodepng_free(bitlen);
  return error;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x480, %edi            # imm = 0x480
callq 0x525b0
testq %rax, %rax
je 0x7c2b1
movq %rax, %rbx
xorl %eax, %eax
cmpq $0x90, %rax
je 0x7c244
movl $0x8, (%rbx,%rax,4)
incq %rax
jmp 0x7c230
movl $0x90, %eax
cmpq $0x100, %rax            # imm = 0x100
je 0x7c25d
movl $0x9, (%rbx,%rax,4)
incq %rax
jmp 0x7c249
movl $0x100, %eax            # imm = 0x100
cmpq $0x118, %rax            # imm = 0x118
je 0x7c276
movl $0x7, (%rbx,%rax,4)
incq %rax
jmp 0x7c262
movl $0x118, %eax            # imm = 0x118
cmpq $0x120, %rax            # imm = 0x120
je 0x7c28f
movl $0x8, (%rbx,%rax,4)
incq %rax
jmp 0x7c27b
pushq $0xf
popq %rcx
movl $0x120, %edx            # imm = 0x120
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7c30e
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x52530
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/LodePNG.cpp
// Function: writeBits(LodePNGBitWriter*, unsigned int, unsigned long)
static void writeBits(LodePNGBitWriter* writer, unsigned value, size_t nbits) {
  if(nbits == 1) { /* compiler should statically compile this case if nbits == 1 */
    WRITEBIT(writer, value);
  } else {
    /* TODO: increase output size nly once here rather than in each WRITEBIT */
    size_t i;
    for(i = 0; i != nbits; ++i) {
      WRITEBIT(writer, (unsigned char)((value >> i) & 1));
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
cmpq $0x1, %rdx
jne 0x7c77f
movq 0x8(%rbx), %rcx
testb $0x7, %cl
jne 0x7c75c
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x7c707
movq 0x8(%rbx), %rcx
andb $0x7, %cl
shll %cl, %ebp
movq (%rbx), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
orb %bpl, -0x1(%rcx,%rax)
incq 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %r14
xorl %r15d, %r15d
cmpq %r15, %r14
je 0x7c774
movq 0x8(%rbx), %rcx
testb $0x7, %cl
jne 0x7c7a1
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x7c707
movq 0x8(%rbx), %rcx
xorl %eax, %eax
btl %r15d, %ebp
setb %al
andb $0x7, %cl
shll %cl, %eax
movq (%rbx), %rcx
movq (%rcx), %rdx
movq 0x8(%rcx), %rcx
orb %al, -0x1(%rdx,%rcx)
incq 0x8(%rbx)
incq %r15
jmp 0x7c785
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/LodePNG.cpp
// Function: writeLZ77data(LodePNGBitWriter*, uivector const*, HuffmanTree const*, HuffmanTree const*)
static void writeLZ77data(LodePNGBitWriter* writer, const uivector* lz77_encoded,
                          const HuffmanTree* tree_ll, const HuffmanTree* tree_d) {
  size_t i = 0;
  for(i = 0; i != lz77_encoded->size; ++i) {
    unsigned val = lz77_encoded->data[i];
    writeBitsReversed(writer, HuffmanTree_getCode(tree_ll, val), HuffmanTree_getLength(tree_ll, val));
    if(val > 256) /*for a length code, 3 more things have to be added*/ {
      unsigned length_index = val - FIRST_LENGTH_CODE_INDEX;
      unsigned n_length_extra_bits = LENGTHEXTRA[length_index];
      unsigned length_extra_bits = lz77_encoded->data[++i];

      unsigned distance_code = lz77_encoded->data[++i];

      unsigned distance_index = distance_code;
      unsigned n_distance_extra_bits = DISTANCEEXTRA[distance_index];
      unsigned distance_extra_bits = lz77_encoded->data[++i];

      writeBits(writer, length_extra_bits, n_length_extra_bits);
      writeBitsReversed(writer, HuffmanTree_getCode(tree_d, distance_code),
                       HuffmanTree_getLength(tree_d, distance_code));
      writeBits(writer, distance_extra_bits, n_distance_extra_bits);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x8(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebx, %ebx
cmpq 0x8(%r15), %rbx
je 0x7cd4f
movq (%r15), %rax
movl (%rax,%rbx,4), %r13d
movq (%r14), %rax
movq 0x8(%r14), %rcx
movl (%rax,%r13,4), %esi
movl (%rcx,%r13,4), %edx
movq %r12, %rdi
callq 0x7cd77
cmpq $0x101, %r13            # imm = 0x101
jb 0x7cd47
addl $0xfffffeff, %r13d      # imm = 0xFFFFFEFF
leaq 0x13e3a(%rip), %rax     # 0x90b20
movl (%rax,%r13,4), %edx
movq (%r15), %rax
movl 0x4(%rax,%rbx,4), %esi
movq %r14, %r13
movl 0x8(%rax,%rbx,4), %r14d
leaq 0x13f20(%rip), %rcx     # 0x90c20
movl (%rcx,%r14,4), %ecx
movq %rcx, 0x10(%rsp)
movl 0xc(%rax,%rbx,4), %ebp
addq $0x3, %rbx
movq %r12, %rdi
callq 0x7c733
movq 0x8(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
movl (%rax,%r14,4), %esi
movl (%rcx,%r14,4), %edx
movq %r13, %r14
movq %r12, %rdi
callq 0x7cd77
movq %r12, %rdi
movl %ebp, %esi
movq 0x10(%rsp), %rdx
callq 0x7c733
incq %rbx
jmp 0x7cca7
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/LodePNG.cpp
// Function: writeBitsReversed(LodePNGBitWriter*, unsigned int, unsigned long)
static void writeBitsReversed(LodePNGBitWriter* writer, unsigned value, size_t nbits) {
  size_t i;
  for(i = 0; i != nbits; ++i) {
    /* TODO: increase output size only once here rather than in each WRITEBIT */
    WRITEBIT(writer, (unsigned char)((value >> (nbits - 1u - i)) & 1u));
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
testq %rbx, %rbx
je 0x7cdc3
movq 0x8(%r14), %rcx
testb $0x7, %cl
jne 0x7cd9f
movq (%r14), %rdi
xorl %esi, %esi
callq 0x7c707
movq 0x8(%r14), %rcx
decq %rbx
xorl %eax, %eax
btl %ebx, %ebp
setb %al
andb $0x7, %cl
shll %cl, %eax
movq (%r14), %rcx
movq (%rcx), %rdx
movq 0x8(%rcx), %rcx
orb %al, -0x1(%rdx,%rcx)
incq 0x8(%r14)
jmp 0x7cd83
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/LodePNG.cpp
// Function: uivector_resizev(uivector*, unsigned long, unsigned int)
static unsigned uivector_resizev(uivector* p, size_t size, unsigned value) {
  size_t oldsize = p->size, i;
  if(!uivector_resize(p, size)) return 0;
  for(i = oldsize; i < size; ++i) p->data[i] = value;
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %r15
callq 0x7cebd
testl %eax, %eax
je 0x7cf7c
pushq $0x1
popq %rax
cmpq %rbx, %r15
jae 0x7cf7e
movq (%r14), %rcx
andl $0x0, (%rcx,%r15,4)
incq %r15
jmp 0x7cf6a
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/LodePNG.cpp
// Function: HuffmanTree_makeFromFrequencies(HuffmanTree*, unsigned int const*, unsigned long, unsigned long, unsigned int)
static unsigned HuffmanTree_makeFromFrequencies(HuffmanTree* tree, const unsigned* frequencies,
                                                size_t mincodes, size_t numcodes, unsigned maxbitlen) {
  size_t i;
  unsigned error = 0;
  while(!frequencies[numcodes - 1] && numcodes > mincodes) --numcodes; /*trim zeroes*/
  tree->maxbitlen = maxbitlen;
  tree->numcodes = (unsigned)numcodes; /*number of symbols*/
  tree->lengths = (unsigned*)lodepng_realloc(tree->lengths, numcodes * sizeof(unsigned));
  if(!tree->lengths) return 83; /*alloc fail*/
  /*initialize all lengths to 0*/
  for(i = 0; i < numcodes; i++) tree->lengths[i] = 0;

  error = lodepng_huffman_code_lengths(tree->lengths, frequencies, numcodes, maxbitlen);
  if(!error) error = HuffmanTree_makeFromLengths2(tree);
  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %r8d, %ebp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x1(%rcx), %rax
notq %rcx
shlq $0x2, %rcx
leaq -0x1(%rax), %r15
addq $0x4, %rcx
cmpq %rdx, %r15
jbe 0x7cfb7
cmpl $0x0, -0x8(%r14,%rax,4)
movq %r15, %rax
je 0x7cf9f
movl %ebp, 0x10(%rbx)
movl %r15d, 0x14(%rbx)
movq 0x8(%rbx), %rdi
negq %rcx
movq %rcx, %rsi
callq 0x52730
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x7d00c
xorl %ecx, %ecx
cmpq %rcx, %r15
je 0x7cfe6
andl $0x0, (%rax,%rcx,4)
incq %rcx
jmp 0x7cfd8
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
movl %ebp, %ecx
callq 0x73da7
testl %eax, %eax
jne 0x7d00f
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x7c372
pushq $0x53
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/LodePNG.cpp
// Function: readBitsFromReversedStream(unsigned long*, unsigned char const*, unsigned long)
static unsigned readBitsFromReversedStream(size_t* bitpointer, const unsigned char* bitstream, size_t nbits) {
  unsigned result = 0;
  size_t i;
  for(i = 0 ; i < nbits; ++i) {
    result <<= 1u;
    result |= (unsigned)readBitFromReversedStream(bitpointer, bitstream);
  }
  return result;
}

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

// Assembly:
movl %ecx, %eax
xorl %ecx, %ecx
cmpl $0x2, %edx
sete %cl
cmpl $0x1, %edx
leal 0x1(%rcx,%rcx), %ecx
pushq $0x7
popq %r8
cmovnel %ecx, %r8d
movl %esi, %r10d
andl %r8d, %r10d
pushq $-0x1
popq %r9
movl %edx, %ecx
shll %cl, %r9d
notl %r9d
andl %eax, %r9d
subl %r10d, %r8d
imull %edx, %r8d
movl %r8d, %ecx
shll %cl, %r9d
movl %edx, %eax
imulq %rsi, %rax
shrq $0x3, %rax
testl %r10d, %r10d
je 0x7d0cb
orb %r9b, (%rdi,%rax)
retq
movb %r9b, (%rdi,%rax)
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/LodePNG.cpp
// Function: lodepng_get_raw_size_idat(unsigned int, unsigned int, LodePNGColorMode const*)
static size_t lodepng_get_raw_size_idat(unsigned w, unsigned h, const LodePNGColorMode* color) {
  size_t bpp = lodepng_get_bpp(color);
  /* + 1 for the filter byte, and possibly plus padding bits per line */
  size_t line = ((size_t)(w / 8u) * bpp) + 1u + ((w & 7u) * bpp + 7u) / 8u;
  return (size_t)h * line;
}

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r8d, 0x8(%rsp)
movq %rcx, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
leaq 0x20(%rsp), %r12
andq $0x0, (%r12)
movq %rsi, %r13
movq %rdi, %rbp
xorl %ebx, %ebx
xorl %eax, %eax
cmpl 0x8(%rsp), %eax
je 0x7d7b3
movl %eax, 0xc(%rsp)
movq 0x10(%rsp), %rax
movq %rbx, %r14
movq %rax, %r15
subq $0x1, %r15
jb 0x7d7a3
movq %r14, %rax
shrq $0x3, %rax
movl %r14d, %ecx
notb %cl
movzbl (%r13,%rax), %eax
movzbl %cl, %ecx
andl $0x7, %ecx
xorl %edx, %edx
btl %ecx, %eax
setb %dl
incq %r14
movq %r12, %rdi
movq %rbp, %rsi
callq 0x7d929
movq %r15, %rax
jmp 0x7d76a
addq 0x18(%rsp), %rbx
subq %rax, %rbx
movl 0xc(%rsp), %eax
incl %eax
jmp 0x7d755
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/LodePNG.cpp
// Function: Adam7_getpassvalues(unsigned int*, unsigned int*, unsigned long*, unsigned long*, unsigned long*, unsigned int, unsigned int, unsigned int)
static void Adam7_getpassvalues(unsigned passw[7], unsigned passh[7], size_t filter_passstart[8],
                                size_t padded_passstart[8], size_t passstart[8], unsigned w, unsigned h, unsigned bpp) {
  /*the passstart values have 8 values: the 8th one indicates the byte after the end of the 7th (= last) pass*/
  unsigned i;

  /*calculate width and height in pixels of each pass*/
  for(i = 0; i != 7; ++i) {
    passw[i] = (w + ADAM7_DX[i] - ADAM7_IX[i] - 1) / ADAM7_DX[i];
    passh[i] = (h + ADAM7_DY[i] - ADAM7_IY[i] - 1) / ADAM7_DY[i];
    if(passw[i] == 0) passh[i] = 0;
    if(passh[i] == 0) passw[i] = 0;
  }

  filter_passstart[0] = padded_passstart[0] = passstart[0] = 0;
  for(i = 0; i != 7; ++i) {
    /*if passw[i] is 0, it's 0 bytes, not 1 (no filtertype-byte)*/
    filter_passstart[i + 1] = filter_passstart[i]
                            + ((passw[i] && passh[i]) ? passh[i] * (1u + (passw[i] * bpp + 7u) / 8u) : 0);
    /*bits padded if needed to fill full byte at end of each scanline*/
    padded_passstart[i + 1] = padded_passstart[i] + passh[i] * ((passw[i] * bpp + 7u) / 8u);
    /*only padded at end of reduced image*/
    passstart[i + 1] = passstart[i] + (passh[i] * passw[i] * bpp + 7u) / 8u;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r10
movl 0x38(%rsp), %ebx
xorl %r14d, %r14d
leaq 0x13513(%rip), %r15     # 0x90cf0
leaq 0x1352c(%rip), %r12     # 0x90d10
leaq 0x13545(%rip), %r13     # 0x90d30
leaq 0x1355e(%rip), %rbp     # 0x90d50
cmpq $0x1c, %r14
je 0x7d845
movl (%r14,%r15), %r11d
movl (%r14,%r12), %eax
notl %eax
addl %r11d, %eax
addl %r9d, %eax
xorl %edx, %edx
divl %r11d
movl %eax, (%rdi,%r14)
movl (%r14,%r13), %r11d
movl (%r14,%rbp), %eax
notl %eax
addl %r11d, %eax
addl %ebx, %eax
xorl %edx, %edx
divl %r11d
movl %eax, (%rsi,%r14)
movl (%rdi,%r14), %edx
testl %edx, %edx
cmovel %edx, %eax
movl %eax, (%rsi,%r14)
testl %eax, %eax
jne 0x7d83f
andl $0x0, (%rdi,%r14)
addq $0x4, %r14
jmp 0x7d7f2
andq $0x0, (%r8)
andq $0x0, (%rcx)
andq $0x0, (%r10)
xorl %eax, %eax
movl 0x40(%rsp), %ebp
cmpq $0x1c, %rax
je 0x7d8bf
movl (%rdi,%rax), %edx
movl (%rsi,%rax), %r9d
testl %edx, %edx
je 0x7d883
testl %r9d, %r9d
je 0x7d880
movl %edx, %ebx
imull %ebp, %ebx
addl $0x7, %ebx
shrl $0x3, %ebx
incl %ebx
imull %r9d, %ebx
jmp 0x7d885
xorl %r9d, %r9d
xorl %ebx, %ebx
addq (%r10,%rax,2), %rbx
movq %rbx, 0x8(%r10,%rax,2)
imull %ebp, %edx
leal 0x7(%rdx), %r11d
shrl $0x3, %r11d
imull %r9d, %r11d
addq (%rcx,%rax,2), %r11
movq %r11, 0x8(%rcx,%rax,2)
imull %r9d, %edx
addl $0x7, %edx
shrl $0x3, %edx
addq (%r8,%rax,2), %rdx
movq %rdx, 0x8(%r8,%rax,2)
addq $0x4, %rax
jmp 0x7d857
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/LodePNG.cpp
// Function: paethPredictor(short, short, short)
static unsigned char paethPredictor(short a, short b, short c) {
  short pa = LODEPNG_ABS(b - c);
  short pb = LODEPNG_ABS(a - c);
  short pc = LODEPNG_ABS(a + b - c - c);
  /* return input value associated with smallest of pa, pb, pc (with certain priority if equal) */
  if(pb < pa) { a = b; pa = pb; }
  return (pc < pa) ? c : a;
}

// Assembly:
movl %edi, %eax
movl $0xffff, %ecx           # imm = 0xFFFF
movl %esi, %r8d
andl %ecx, %r8d
movl %edx, %r9d
andl %ecx, %r9d
subl %r9d, %r8d
movl %r8d, %edi
negl %edi
cmovsl %r8d, %edi
andl %ecx, %edi
movl %eax, %r8d
andl %ecx, %r8d
subl %r9d, %r8d
movl %r8d, %r9d
negl %r9d
cmovsl %r8d, %r9d
andl %ecx, %r9d
leal (%rsi,%rax), %r8d
subl %edx, %r8d
subl %edx, %r8d
movl %r8d, %r10d
negl %r10d
cmovsl %r8d, %r10d
andl %ecx, %r10d
cmpl %edi, %r9d
cmovael %edi, %r9d
cmovbl %esi, %eax
cmpl %r9d, %r10d
cmovbl %edx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/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) >> 3u] &=  (unsigned char)(~(1u << (7u - ((*bitpointer) & 7u))));
  else         bitstream[(*bitpointer) >> 3u] |=  (1u << (7u - ((*bitpointer) & 7u)));
  ++(*bitpointer);
}

// Assembly:
movq (%rdi), %rax
movl %eax, %ecx
notb %cl
andb $0x7, %cl
movb $0x1, %r8b
shlb %cl, %r8b
testl %edx, %edx
je 0x7d947
shrq $0x3, %rax
orb %r8b, (%rsi,%rax)
jmp 0x7d952
notb %r8b
shrq $0x3, %rax
andb %r8b, (%rsi,%rax)
incq (%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/Vec3.cpp
// Function: RayTracer::Vec3::operator[](int)
double& Vec3::operator[](int index) {
    if (index == 0) {
        return this->x;
    } else if (index == 1) {
        return this->y;
    } else if (index == 2) {
        return this->z;
    }
    throw out_of_range("Index " + to_string(index) + " is out of range for Vec3");
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x60, %rsp
movl %esi, %ebp
cmpl $0x3, %esi
jae 0x7e630
movl %ebp, %eax
leaq (%rdi,%rax,8), %rax
addq $0x8, %rax
addq $0x60, %rsp
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x52220
movq %rax, %rbx
movq %rsp, %rdi
movl %ebp, %esi
callq 0x6ab27
leaq 0x13bb4(%rip), %rsi     # 0x92200
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
callq 0x6e761
leaq 0x13ba7(%rip), %rdx     # 0x92207
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x5a4df
movb $0x1, %bpl
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x52680
xorl %ebp, %ebp
movq 0x33920(%rip), %rsi     # 0xb1fa8
movq 0x33901(%rip), %rdx     # 0xb1f90
movq %rbx, %rdi
callq 0x52760
movq %rax, %r14
leaq 0x40(%rsp), %rdi
callq 0x52888
jmp 0x7e6ac
movq %rax, %r14
movb $0x1, %bpl
leaq 0x20(%rsp), %rdi
callq 0x52888
jmp 0x7e6be
movq %rax, %r14
movb $0x1, %bpl
movq %rsp, %rdi
callq 0x52888
testb %bpl, %bpl
jne 0x7e6d0
jmp 0x7e6d8
movq %rax, %r14
movq %rbx, %rdi
callq 0x52350
movq %r14, %rdi
callq 0x527a0
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/Vec3.cpp
// Function: RayTracer::Vec3::get(int) const
double Vec3::get(const int index) const {
    if (index == 0) {
        return this->x;
    } else if (index == 1) {
        return this->y;
    } else if (index == 2) {
        return this->z;
    }
    throw out_of_range("Index " + to_string(index) + " is out of range for Vec3");
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x60, %rsp
movl %esi, %ebp
cmpl $0x3, %esi
jae 0x7e700
movl %ebp, %eax
movsd 0x8(%rdi,%rax,8), %xmm0
addq $0x60, %rsp
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x52220
movq %rax, %rbx
movq %rsp, %rdi
movl %ebp, %esi
callq 0x6ab27
leaq 0x13ae4(%rip), %rsi     # 0x92200
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
callq 0x6e761
leaq 0x13ad7(%rip), %rdx     # 0x92207
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x5a4df
movb $0x1, %bpl
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x52680
xorl %ebp, %ebp
movq 0x33850(%rip), %rsi     # 0xb1fa8
movq 0x33831(%rip), %rdx     # 0xb1f90
movq %rbx, %rdi
callq 0x52760
movq %rax, %r14
leaq 0x40(%rsp), %rdi
callq 0x52888
jmp 0x7e77c
movq %rax, %r14
movb $0x1, %bpl
leaq 0x20(%rsp), %rdi
callq 0x52888
jmp 0x7e78e
movq %rax, %r14
movb $0x1, %bpl
movq %rsp, %rdi
callq 0x52888
testb %bpl, %bpl
jne 0x7e7a0
jmp 0x7e7a8
movq %rax, %r14
movq %rbx, %rdi
callq 0x52350
movq %r14, %rdi
callq 0x527a0
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/Vec3.cpp
// Function: RayTracer::Vec3::normalize() const
Vec3 Vec3::normalize() const {
    double l = this->length();
    return Vec3(
        this->x / l,
        this->y / l,
        this->z / l
    );
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x7e7b0
movsd 0x18(%rbx), %xmm1
divsd %xmm0, %xmm1
leaq 0x32c82(%rip), %rax     # 0xb1488
movq %rax, (%r14)
movupd 0x8(%rbx), %xmm2
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
divpd %xmm0, %xmm2
movupd %xmm2, 0x8(%r14)
movsd %xmm1, 0x18(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/Vec3.cpp
// Function: RayTracer::Vec3::to_json[abi:cxx11]() const
json Vec3::to_json() const {
    json j = json::array();
    j[0] = this->x;
    j[1] = this->y;
    j[2] = this->z;
    return j;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorl %esi, %esi
xorl %edx, %edx
callq 0x7eed0
leaq 0x8(%r14), %rsi
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x7eee4
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7eefe
leaq 0x20(%rsp), %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x6d06c
movq %r15, %rdi
callq 0x56fca
leaq 0x10(%r14), %rsi
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x7eee4
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x7eefe
leaq 0x10(%rsp), %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x6d06c
movq %r15, %rdi
callq 0x56fca
addq $0x18, %r14
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x7eee4
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x7eefe
movq %rsp, %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x6d06c
movq %r14, %rdi
callq 0x56fca
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x7e8f1
jmp 0x7e8f1
movq %rax, %r14
movq %r15, %rdi
callq 0x56fca
movq %rbx, %rdi
callq 0x56fca
movq %r14, %rdi
callq 0x527a0
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/Vec3.cpp
// Function: RayTracer::operator+(RayTracer::Vec3 const&, RayTracer::Vec3 const&)
Vec3 RayTracer::operator+(const Vec3& v1, const Vec3& v2) {
    return Vec3(
        v1.x + v2.x,
        v1.y + v2.y,
        v1.z + v2.z
    );
}

// Assembly:
movq %rdi, %rax
movsd 0x18(%rsi), %xmm0
addsd 0x18(%rdx), %xmm0
leaq 0x3284e(%rip), %rcx     # 0xb1488
movq %rcx, (%rdi)
movupd 0x8(%rsi), %xmm1
movupd 0x8(%rdx), %xmm2
addpd %xmm1, %xmm2
movupd %xmm2, 0x8(%rdi)
movsd %xmm0, 0x18(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/Vec3.cpp
// Function: RayTracer::operator+(RayTracer::Vec3 const&, double)
Vec3 RayTracer::operator+(const Vec3& v1, const double n) {
    return Vec3(
        v1.x + n,
        v1.y + n,
        v1.z + n
    );
}

// Assembly:
movq %rdi, %rax
movsd 0x18(%rsi), %xmm1
addsd %xmm0, %xmm1
leaq 0x3281f(%rip), %rcx     # 0xb1488
movq %rcx, (%rdi)
movupd 0x8(%rsi), %xmm2
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
addpd %xmm2, %xmm0
movupd %xmm0, 0x8(%rdi)
movsd %xmm1, 0x18(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/Vec3.cpp
// Function: RayTracer::operator+(double, RayTracer::Vec3 const&)
Vec3 RayTracer::operator+(const double n, const Vec3& v2) {
    return Vec3(
        n + v2.x,
        n + v2.y,
        n + v2.z
    );
}

// Assembly:
movq %rdi, %rax
movsd 0x18(%rsi), %xmm1
addsd %xmm0, %xmm1
leaq 0x327f1(%rip), %rcx     # 0xb1488
movq %rcx, (%rdi)
movupd 0x8(%rsi), %xmm2
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
addpd %xmm2, %xmm0
movupd %xmm0, 0x8(%rdi)
movsd %xmm1, 0x18(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/Vec3.cpp
// Function: RayTracer::cross(RayTracer::Vec3 const&, RayTracer::Vec3 const&)
Vec3 RayTracer::cross(const Vec3& v1, const Vec3& v2) {
    return Vec3(
        v1.y * v2.z - v1.z * v2.y,
        v1.z * v2.x - v1.x * v2.z,
        v1.x * v2.y - v1.y * v2.x
    );
}

// Assembly:
movq %rdi, %rax
movsd 0x8(%rdx), %xmm0
movsd 0x8(%rsi), %xmm1
leaq 0x325f7(%rip), %rcx     # 0xb1488
movq %rcx, (%rdi)
movupd 0x10(%rsi), %xmm2
movupd 0x10(%rdx), %xmm3
movapd %xmm2, %xmm4
shufpd $0x1, %xmm1, %xmm4      # xmm4 = xmm4[1],xmm1[0]
mulpd %xmm3, %xmm4
mulsd %xmm3, %xmm1
shufpd $0x1, %xmm0, %xmm3      # xmm3 = xmm3[1],xmm0[0]
mulpd %xmm2, %xmm3
subpd %xmm4, %xmm3
mulsd %xmm2, %xmm0
subsd %xmm0, %xmm1
movupd %xmm3, 0x8(%rdi)
movsd %xmm1, 0x18(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/include/json.hpp
// Function: nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>::operator[](unsigned long) const
const_reference operator[](size_type idx) const
    {
        // const operator[] only works for arrays
        if (JSON_HEDLEY_LIKELY(is_array()))
        {
            return m_value.array->operator[](idx);
        }

        JSON_THROW(type_error::create(305, "cannot use operator[] with a numeric argument with " + std::string(type_name())));
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdi, %r14
cmpb $0x2, (%rdi)
jne 0x7f8a3
movq 0x8(%r14), %rax
shlq $0x4, %rsi
addq (%rax), %rsi
movq %rsi, %rax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x20
popq %rdi
callq 0x52220
movq %rax, %rbx
movq %r14, %rdi
callq 0x6f406
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
movq %rax, %rsi
callq 0x56548
leaq 0x129f8(%rip), %rsi     # 0x922c7
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x6e761
movb $0x1, %bpl
leaq 0x30(%rsp), %rdx
movq %rbx, %rdi
movl $0x131, %esi            # imm = 0x131
callq 0x6f350
xorl %ebp, %ebp
leaq 0x31ad4(%rip), %rsi     # 0xb13d0
leaq -0x128d1(%rip), %rdx    # 0x6d032
movq %rbx, %rdi
callq 0x52760
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x52888
jmp 0x7f920
movq %rax, %r14
movb $0x1, %bpl
leaq 0x10(%rsp), %rdi
callq 0x52888
testb %bpl, %bpl
jne 0x7f934
jmp 0x7f93c
movq %rax, %r14
movq %rbx, %rdi
callq 0x52350
movq %r14, %rdi
callq 0x527a0
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/objects/Sphere.cpp
// Function: RayTracer::Sphere::Sphere(RayTracer::Vec3 const&, double, RayTracer::Material*)
Sphere::Sphere(const Vec3& center, double radius, Material* material)
    : RenderObject(center, sphere)
{
    this->radius = radius;
    this->material = material;

    // Be sure to compute the hitbox
    this->has_hitbox = this->compute_hit_box();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movsd %xmm0, (%rsp)
movq %rdi, %r14
xorl %edx, %edx
callq 0x80078
leaq 0x30adb(%rip), %rax     # 0xb16d8
movq %rax, (%r14)
movsd (%rsp), %xmm0
movsd %xmm0, 0x80(%r14)
movq %rbx, 0x88(%r14)
movq %r14, %rdi
callq 0x80db6
movb %al, 0x78(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/objects/Sphere.cpp
// Function: RayTracer::Sphere::Sphere(RayTracer::Sphere const&)
Sphere::Sphere(const Sphere& other)
    : RenderObject(other.center, sphere)
{
    this->radius = other.radius;
    this->material = other.material->clone();

    // Also copy the hitbox
    this->has_hitbox = other.has_hitbox;
    if (this->has_hitbox) {
        this->box = BoundingBox(other.box);
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
addq $0x18, %rsi
xorl %edx, %edx
callq 0x80078
leaq 0x30a8f(%rip), %rax     # 0xb16d8
movq %rax, (%rbx)
movsd 0x80(%r14), %xmm0
movsd %xmm0, 0x80(%rbx)
movq 0x88(%r14), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq %rax, 0x88(%rbx)
movb 0x78(%r14), %al
movb %al, 0x78(%rbx)
cmpb $0x1, %al
jne 0x80cc1
leaq 0x307f5(%rip), %rax     # 0xb1478
addq $0x10, %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movups 0x40(%r14), %xmm0
movups %xmm0, 0x8(%rsi)
movq 0x50(%r14), %rcx
movq %rcx, 0x18(%rsi)
movq %rax, 0x20(%rsi)
movups 0x60(%r14), %xmm0
movups %xmm0, 0x28(%rsi)
movq 0x70(%r14), %rax
movq %rax, 0x38(%rsi)
addq $0x38, %rbx
movq %rbx, %rdi
callq 0x8170a
addq $0x48, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/objects/Sphere.cpp
// Function: RayTracer::Sphere::Sphere(RayTracer::Sphere&&)
Sphere::Sphere(Sphere&& other)
    : RenderObject(other.center, sphere)
{
    this->radius = other.radius;
    this->material = other.material;
    other.material = nullptr;

    // Also copy the hitbox
    this->has_hitbox = other.has_hitbox;
    if (this->has_hitbox) {
        this->box = other.box;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x18, %rsi
xorl %edx, %edx
callq 0x80078
leaq 0x309f2(%rip), %rax     # 0xb16d8
movq %rax, (%r14)
movsd 0x80(%rbx), %xmm0
movsd %xmm0, 0x80(%r14)
movq 0x88(%rbx), %rax
movq %rax, 0x88(%r14)
andq $0x0, 0x88(%rbx)
movb 0x78(%rbx), %al
movb %al, 0x78(%r14)
cmpb $0x1, %al
jne 0x80d35
addq $0x38, %rbx
addq $0x38, %r14
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x81734
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/objects/Sphere.cpp
// Function: RayTracer::Sphere::hit(RayTracer::Ray const&, double, double, RayTracer::HitRecord&) const
bool Sphere::hit(const Ray& ray, double t_min, double t_max, HitRecord& record) const {
    Vec3 d_ray_sphere = ray.origin - this->center;
    double a = dot(ray.direction, ray.direction);
    double b = dot(d_ray_sphere, ray.direction);
    double c = dot(d_ray_sphere, d_ray_sphere) - this->radius * this->radius;

    double D = b*b - a*c;

    // Return the distance the ray has travelled until it hits the closest side of the sphere.
    if (D > 0) {
        // Compute tboth variations of the t. If t - sqrt(D) is true, take that one. Otherwise, take the other.
        double t = (-b - sqrtf64(D)) / a;
        if (t <= t_min || t >= t_max) {
            t = (-b + sqrtf64(D)) / a;
            if (t <= t_min || t >= t_max) {
                return false;
            }
        }

        record.t = t;
        record.t_min = t_min;
        record.t_max = t_max;
        record.hitpoint = ray.point(t);
        record.normal = this->normal(record);
        record.obj = (RenderObject*) this;
        record.material = this->material;

        return true;
    }
    return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x90, %rsp
movq %rdx, %rbx
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, 0x18(%rsp)
movq %rsi, %r15
movq %rdi, %r14
leaq 0x18(%rdi), %rdx
leaq 0x70(%rsp), %r12
movq %r12, %rdi
callq 0x7ecb2
leaq 0x20(%r15), %r13
movq %r13, %rdi
movq %r13, %rsi
callq 0x7ee56
movsd %xmm0, 0x10(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x7ee56
movapd %xmm0, 0x20(%rsp)
movq %r12, %rdi
movq %r12, %rsi
callq 0x7ee56
movapd 0x20(%rsp), %xmm2
movsd 0x80(%r14), %xmm1
mulsd %xmm1, %xmm1
subsd %xmm1, %xmm0
movsd 0x10(%rsp), %xmm1
mulsd %xmm1, %xmm0
movapd %xmm2, %xmm3
mulsd %xmm2, %xmm3
subsd %xmm0, %xmm3
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm3
jbe 0x80fd1
movapd 0x112d8(%rip), %xmm0    # 0x921d0
xorpd %xmm2, %xmm0
movapd %xmm0, 0x40(%rsp)
movapd %xmm3, 0x30(%rsp)
movapd %xmm3, %xmm0
callq 0x52160
movapd 0x40(%rsp), %xmm2
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm2
divsd %xmm1, %xmm2
movsd 0x18(%rsp), %xmm0
ucomisd %xmm2, %xmm0
jae 0x80f39
ucomisd 0x8(%rsp), %xmm2
jb 0x80f6a
movapd 0x30(%rsp), %xmm0
callq 0x52160
movapd %xmm0, %xmm2
movsd 0x18(%rsp), %xmm0
subsd 0x20(%rsp), %xmm2
divsd 0x10(%rsp), %xmm2
xorl %eax, %eax
ucomisd %xmm2, %xmm0
jae 0x80fd3
ucomisd 0x8(%rsp), %xmm2
jae 0x80fd3
movsd %xmm2, (%rbx)
movsd %xmm0, 0x8(%rbx)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x10(%rbx)
leaq 0x50(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movapd %xmm2, %xmm0
callq 0x72508
leaq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0x7e47e
movq (%r14), %rax
leaq 0x50(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq *0x40(%rax)
leaq 0x38(%rbx), %rdi
movq %r15, %rsi
callq 0x7e47e
movq %r14, 0x58(%rbx)
movq 0x88(%r14), %rax
movq %rax, 0x60(%rbx)
movb $0x1, %al
jmp 0x80fd3
xorl %eax, %eax
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/objects/Sphere.cpp
// Function: RayTracer::Sphere::to_json[abi:cxx11]() const
json Sphere::to_json() const {
    json j;

    // First, let the parent class parse all it wants
    this->baseclass_to_json(j);
    
    // Add child-specific properties
    j["center"] = this->center.to_json();
    j["radius"] = this->radius;
    j["material"] = this->material->to_json();
    return j;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorl %esi, %esi
callq 0x56d46
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *(%rax)
leaq 0x18(%r14), %rsi
leaq 0x20(%rsp), %rdi
callq 0x7e82e
leaq 0x1160a(%rip), %rsi     # 0x926c4
movq %rbx, %rdi
callq 0x56e34
leaq 0x20(%rsp), %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x6d06c
movq %r15, %rdi
callq 0x56fca
leaq 0x80(%r14), %rsi
leaq 0x10(%rsp), %rdi
callq 0x7eee4
leaq 0x115d9(%rip), %rsi     # 0x926cb
movq %rbx, %rdi
callq 0x56e34
leaq 0x10(%rsp), %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x6d06c
movq %r15, %rdi
callq 0x56fca
movq 0x88(%r14), %rsi
movq (%rsi), %rax
movq %rsp, %rdi
callq *0x28(%rax)
leaq 0x115a9(%rip), %rsi     # 0x926d2
movq %rbx, %rdi
callq 0x56e34
movq %rsp, %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x6d06c
movq %r14, %rdi
callq 0x56fca
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rsp, %rdi
jmp 0x8116e
movq %rax, %r14
leaq 0x10(%rsp), %rdi
jmp 0x8116e
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x56fca
jmp 0x81178
movq %rax, %r14
movq %rbx, %rdi
callq 0x56fca
movq %r14, %rdi
callq 0x527a0
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/objects/RenderObjectCollection.cpp
// Function: RayTracer::RenderObjectCollection::compute_center(std::vector<RayTracer::RenderObject*, std::allocator<RayTracer::RenderObject*>>) const
Vec3 RenderObjectCollection::compute_center(vector<RenderObject*> objects) const {
    Vec3 average;
    for (std::size_t i = 0; i < objects.size(); i++) {
        average += objects[i]->center;
    }
    return average / (double) objects.size();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x7e44c
xorl %r12d, %r12d
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r12
jae 0x817a9
movq (%rax,%r12,8), %rsi
addq $0x18, %rsi
movq %r15, %rdi
callq 0x7e4b2
incq %r12
jmp 0x81781
movq %rcx, %xmm1
punpckldq 0x10a2a(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x10a32(%rip), %xmm1    # 0x921f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x7edfa
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/objects/RenderObjectCollection.cpp
// Function: RayTracer::RenderObjectCollection::RenderObjectCollection(std::vector<RayTracer::RenderObject*, std::allocator<RayTracer::RenderObject*>>)
RenderObjectCollection::RenderObjectCollection(vector<RenderObject*> objects)
    : RenderObject(this->compute_center(objects), render_object_collection)
{
    // Store this vector by copying
    this->objects = vector<RenderObject*>(objects);

    // Be sure to compute the hitbox
    this->has_hitbox = this->compute_hit_box();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x2ff62(%rip), %r12     # 0xb1760
movq %r12, (%rdi)
movq %rsp, %r14
movq %r14, %rdi
callq 0x822e2
leaq 0x18(%rsp), %rdi
movq %r14, %rdx
callq 0x81760
leaq 0x18(%rsp), %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x80078
movq %rsp, %rdi
callq 0x82400
movq %r12, (%rbx)
leaq 0x80(%rbx), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x80(%rbx)
andq $0x0, 0x90(%rbx)
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0x822e2
leaq 0x18(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x82496
movq %r15, %rdi
callq 0x82400
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x28(%rax)
movb %al, 0x78(%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x8188c
movq %rax, %rbx
movq %r14, %rdi
jmp 0x8189a
movq %rax, %rbx
movq %rsp, %rdi
callq 0x82400
movq %rbx, %rdi
callq 0x527a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/objects/RenderObjectCollection.cpp
// Function: RayTracer::RenderObjectCollection::RenderObjectCollection(RayTracer::RenderObjectCollection const&)
RenderObjectCollection::RenderObjectCollection(const RenderObjectCollection& other)
    : RenderObject(other.center, render_object_collection)
{
    // Copy the vector of the other
    this->objects = vector<RenderObject*>(other.objects);

    // Copy the hitbox vectors if needed
    this->has_hitbox = other.has_hitbox;
    if (this->has_hitbox) {
        this->box = BoundingBox(other.box);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r15
movq %rdi, %r14
addq $0x18, %rsi
pushq $0x1
popq %rdx
callq 0x80078
leaq 0x2fe94(%rip), %rax     # 0xb1760
movq %rax, (%r14)
movl $0x80, %esi
leaq (%r14,%rsi), %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x80(%r14)
andq $0x0, 0x90(%r14)
addq %r15, %rsi
leaq 0x8(%rsp), %rdi
callq 0x822e2
leaq 0x8(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x82496
movq %r12, %rdi
callq 0x82400
movb 0x78(%r15), %al
movb %al, 0x78(%r14)
cmpb $0x1, %al
jne 0x81961
leaq 0x2fb55(%rip), %rax     # 0xb1478
addq $0x10, %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movups 0x40(%r15), %xmm0
movups %xmm0, 0x8(%rsi)
movq 0x50(%r15), %rcx
movq %rcx, 0x18(%rsi)
movq %rax, 0x20(%rsi)
movups 0x60(%r15), %xmm0
movups %xmm0, 0x28(%rsi)
movq 0x70(%r15), %rax
movq %rax, 0x38(%rsi)
addq $0x38, %r14
movq %r14, %rdi
callq 0x8170a
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x8196f
movq %rax, %r14
movq %rbx, %rdi
callq 0x82400
movq %r14, %rdi
callq 0x527a0
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/objects/RenderObjectCollection.cpp
// Function: RayTracer::RenderObjectCollection::RenderObjectCollection(RayTracer::RenderObjectCollection&&)
RenderObjectCollection::RenderObjectCollection(RenderObjectCollection&& other)
    : RenderObject(other.center, render_object_collection)
{
    // Steal the vector
    this->objects = std::move(other.objects);
    other.objects = vector<RenderObject*>();

    // Also steal the vectors (if needed)
    this->has_hitbox = other.has_hitbox;
    if (this->has_hitbox) {
        this->box = other.box;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
addq $0x18, %rsi
pushq $0x1
popq %rdx
callq 0x80078
leaq 0x2fdb8(%rip), %rax     # 0xb1760
movq %rax, (%r14)
movl $0x80, %r12d
leaq (%r14,%r12), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x80(%r14)
andq $0x0, 0x90(%r14)
addq %rbx, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x82496
movq %rsp, %r13
xorps %xmm0, %xmm0
movaps %xmm0, (%r13)
andq $0x0, 0x10(%r13)
movq %r12, %rdi
movq %r13, %rsi
callq 0x82496
movq %r13, %rdi
callq 0x82400
movb 0x78(%rbx), %al
movb %al, 0x78(%r14)
cmpb $0x1, %al
jne 0x81a17
addq $0x38, %rbx
addq $0x38, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x81734
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %r15, %rdi
callq 0x82400
movq %rbx, %rdi
callq 0x527a0
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/objects/RenderObjectCollection.cpp
// Function: RayTracer::RenderObjectCollection::hit(RayTracer::Ray const&, double, double, RayTracer::HitRecord&) const
bool RenderObjectCollection::hit(const Ray& ray, double t_min, double t_max, HitRecord& record) const {
    HitRecord temp_record;
    double t_best = t_max;
    bool hit = false;
    // Loop until we found the hit with the smallest t. By overriding t_max, we can easily and elegantly do this.
    for (std::size_t i = 0; i < this->objects.size(); i++) {
        if (this->objects[i]->quick_hit(ray, t_min, t_best) && this->objects[i]->hit(ray, t_min, t_best, temp_record)) {
            hit = true;
            t_best = temp_record.t;
            record = temp_record;
        }
    }
    return hit;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %rbx
movsd %xmm1, (%rsp)
movsd %xmm0, 0x8(%rsp)
movq %rsi, %r14
movq %rdi, %r15
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x82352
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x80(%r15), %rax
movq 0x88(%r15), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %rbp
jae 0x81c0e
movq (%rax,%rbp,8), %rdi
movq (%rdi), %rax
movq %r14, %rsi
movsd 0x8(%rsp), %xmm0
movsd (%rsp), %xmm1
callq *0x20(%rax)
testb %al, %al
je 0x81c09
movq 0x80(%r15), %rax
movq (%rax,%rbp,8), %rdi
movq (%rdi), %rax
movq %r14, %rsi
movsd 0x8(%rsp), %xmm0
movsd (%rsp), %xmm1
movq %r12, %rdx
callq *0x30(%rax)
testb %al, %al
je 0x81c09
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x8236c
movb $0x1, %r13b
incq %rbp
jmp 0x81b94
andb $0x1, %r13b
movl %r13d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq