LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 $0x28, %rsp
movl %r9d, %ebp
movl %r8d, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
xorl %eax, %eax
movl %eax, (%rdx)
movl %eax, (%rsi)
movq %rcx, %rsi
callq 0x6f88a
movl %eax, %r13d
testl %eax, %eax
jne 0x6fd61
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %r8
xorl %ecx, %ecx
cmpq %r8, %rax
cmovneq %rax, %rcx
subl %eax, %r8d
movl %ebp, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %r9d
callq 0x6fa48
movl %eax, %r13d
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x6fd78
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x3a470
movl %r13d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x6fda4
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x3a470
movq %rbx, %rdi
callq 0x3a780
// File: /workspace/github_cpp_makefile_star2_O1/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 0x700d7
shrl %cl, %eax
movl %eax, 0x20(%rdi)
addq %rcx, 0x18(%rdi)
jmp 0x70128
movzwl %si, %r9d
shrl $0x9, %eax
movl %eax, 0x20(%rdi)
movq 0x18(%rdi), %rsi
leaq 0x9(%rsi), %r10
addb $-0x9, %cl
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
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_O1/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 0x3a530
movq 0x8(%rbx), %rdi
callq 0x3a530
movq 0x18(%rbx), %rdi
callq 0x3a530
movq 0x20(%rbx), %rdi
popq %rbx
jmp 0x3a530
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3a5a0
testq %rax, %rax
je 0x701fb
movq %rax, %rbx
xorl %eax, %eax
movaps 0x19266(%rip), %xmm0    # 0x893e0
movups %xmm0, (%rbx,%rax,4)
addq $0x4, %rax
cmpq $0x90, %rax
jne 0x7017a
movl $0x90, %eax
movaps 0x1925a(%rip), %xmm1    # 0x893f0
movups %xmm1, (%rbx,%rax,4)
addq $0x4, %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0x70196
movl $0x100, %eax            # imm = 0x100
movaps 0x1924e(%rip), %xmm1    # 0x89400
movups %xmm1, (%rbx,%rax,4)
addq $0x4, %rax
cmpq $0x118, %rax            # imm = 0x118
jne 0x701b2
movl $0x118, %eax            # imm = 0x118
movups %xmm0, (%rbx,%rax,4)
addq $0x4, %rax
cmpq $0x120, %rax            # imm = 0x120
jne 0x701c7
movl $0x120, %edx            # imm = 0x120
movq %r14, %rdi
movq %rbx, %rsi
movl $0xf, %ecx
callq 0x7025f
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3a530
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
testq %rdx, %rdx
je 0x707ec
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
cmpq $0x1, %rdx
jne 0x7078e
testb $0x7, 0x8(%rbx)
jne 0x70771
movq (%rbx), %r14
movq 0x8(%r14), %rsi
incq %rsi
movq %r14, %rdi
callq 0x70056
testl %eax, %eax
je 0x70771
movq (%r14), %rax
movq 0x8(%r14), %rcx
movb $0x0, -0x1(%rax,%rcx)
movb 0x8(%rbx), %cl
andb $0x7, %cl
shll %cl, %ebp
movq (%rbx), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
orb %bpl, -0x1(%rcx,%rax)
incq 0x8(%rbx)
jmp 0x707e4
xorl %r12d, %r12d
testb $0x7, 0x8(%rbx)
jne 0x707b9
movq (%rbx), %r15
movq 0x8(%r15), %rsi
incq %rsi
movq %r15, %rdi
callq 0x70056
testl %eax, %eax
je 0x707b9
movq (%r15), %rax
movq 0x8(%r15), %rcx
movb $0x0, -0x1(%rax,%rcx)
xorl %eax, %eax
btl %r12d, %ebp
setb %al
movb 0x8(%rbx), %cl
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 %r12
cmpq %r12, %r14
jne 0x70791
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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)
cmpq $0x0, 0x8(%rsi)
je 0x70ffe
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebx, %ebx
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 0x7100d
cmpq $0x101, %r13            # imm = 0x101
jb 0x70ff1
addl $0xfffffeff, %r13d      # imm = 0xFFFFFEFF
leaq 0x18ad0(%rip), %rax     # 0x89a60
movl (%rax,%r13,4), %edx
movq (%r15), %rax
movl 0x4(%rax,%rbx,4), %esi
movq %r14, %r13
movl 0x8(%rax,%rbx,4), %r14d
leaq 0x18bb6(%rip), %rcx     # 0x89b60
movl (%rcx,%r14,4), %ecx
movq %rcx, 0x10(%rsp)
movl 0xc(%rax,%rbx,4), %ebp
addq $0x3, %rbx
movq %r12, %rdi
callq 0x7072a
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 0x7100d
movq %r12, %rdi
movl %ebp, %esi
movq 0x10(%rsp), %rdx
callq 0x7072a
incq %rbx
cmpq 0x8(%r15), %rbx
jne 0x70f5b
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
testq %rdx, %rdx
je 0x7107f
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
testb $0x7, 0x8(%r14)
jne 0x7104a
movq (%r14), %r15
movq 0x8(%r15), %rsi
incq %rsi
movq %r15, %rdi
callq 0x70056
testl %eax, %eax
je 0x7104a
movq (%r15), %rax
movq 0x8(%r15), %rcx
movb $0x0, -0x1(%rax,%rcx)
decq %rbx
xorl %eax, %eax
btl %ebx, %ebp
setb %al
movb 0x8(%r14), %cl
andb $0x7, %cl
shll %cl, %eax
movq (%r14), %rcx
movq (%rcx), %rdx
movq 0x8(%rcx), %rcx
orb %al, -0x1(%rdx,%rcx)
incq 0x8(%r14)
testq %rbx, %rbx
jne 0x71021
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x4(,%rcx,4), %r15
incq %rcx
leaq -0x1(%rcx), %r12
addq $-0x4, %r15
cmpq %rdx, %r12
jbe 0x71169
cmpl $0x0, -0x8(%r14,%rcx,4)
movq %r12, %rcx
je 0x71151
movl %ebp, 0x10(%rbx)
movl %r12d, 0x14(%rbx)
movq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x3a720
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x711c4
movq %rax, %r13
testq %r12, %r12
je 0x7119a
movq %r13, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x3a260
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
movl %ebp, %ecx
callq 0x64ef5
testl %eax, %eax
jne 0x711c9
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x702c9
movl $0x53, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
movl $0x7, %r8d
cmovnel %ecx, %r8d
movl %esi, %r10d
andl %r8d, %r10d
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
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 0x7122b
orb %r9b, (%rdi,%rax)
retq
movb %r9b, (%rdi,%rax)
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
testl %r8d, %r8d
je 0x71c65
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rax
subq %rdx, %rax
xorl %r9d, %r9d
xorl %r10d, %r10d
xorl %r11d, %r11d
testq %rdx, %rdx
je 0x71c52
movq %rdx, %rbx
movq %r11, %r14
movq %r14, %rcx
shrq $0x3, %rcx
movl %r14d, %ebp
notb %bpl
movzbl (%rsi,%rcx), %r15d
movzbl %bpl, %r12d
andl $0x7, %r12d
movl %r10d, %ecx
notb %cl
andb $0x7, %cl
movb $0x1, %bpl
shlb %cl, %bpl
btl %r12d, %r15d
jae 0x71c36
movq %r10, %rcx
shrq $0x3, %rcx
orb %bpl, (%rdi,%rcx)
jmp 0x71c44
notb %bpl
movq %r10, %rcx
shrq $0x3, %rcx
andb %bpl, (%rdi,%rcx)
incq %r10
incq %r14
decq %rbx
jne 0x71bfb
addq %rdx, %r11
addq %rax, %r11
incl %r9d
cmpl %r8d, %r9d
jne 0x71bf0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x17faf(%rip), %r15     # 0x89c30
leaq 0x17fc8(%rip), %r12     # 0x89c50
leaq 0x17fe1(%rip), %r13     # 0x89c70
leaq 0x17ffa(%rip), %rbp     # 0x89c90
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 0x71ce0
movl $0x0, (%rdi,%r14)
addq $0x4, %r14
cmpq $0x1c, %r14
jne 0x71c96
xorl %eax, %eax
movq %rax, (%r8)
movq %rax, (%rcx)
movq %rax, (%r10)
movl 0x40(%rsp), %ebx
movl (%rdi,%rax), %edx
testl %edx, %edx
je 0x71d21
movl (%rsi,%rax), %r9d
testl %r9d, %r9d
je 0x71d21
movl %edx, %r11d
imull %ebx, %r11d
addl $0x7, %r11d
shrl $0x3, %r11d
incl %r11d
imull %r11d, %r9d
jmp 0x71d24
xorl %r9d, %r9d
addq (%r10,%rax,2), %r9
movq %r9, 0x8(%r10,%rax,2)
movl (%rsi,%rax), %r9d
imull %ebx, %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
cmpq $0x1c, %rax
jne 0x71cf9
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Lut99[P]RayTracer/src/lib/Vec3.cpp
// Function: RayTracer::Vec3::operator=(RayTracer::Vec3 const&)
Vec3& Vec3::operator=(const Vec3& other) {
    this->x = other.x;
    this->y = other.y;
    this->z = other.z;
    return *this;
}

// Assembly:
movq %rdi, %rax
movups 0x8(%rsi), %xmm0
movups %xmm0, 0x8(%rdi)
movsd 0x18(%rsi), %xmm0
movsd %xmm0, 0x18(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/Lut99[P]RayTracer/src/lib/Vec3.cpp
// Function: RayTracer::Vec3::operator+=(RayTracer::Vec3 const&)
Vec3& Vec3::operator+=(const Vec3& other) {
    this->x += other.x;
    this->y += other.y;
    this->z += other.z;

    return *this;
}

// Assembly:
movq %rdi, %rax
movupd 0x8(%rsi), %xmm0
movupd 0x8(%rdi), %xmm1
addpd %xmm0, %xmm1
movupd %xmm1, 0x8(%rdi)
movsd 0x18(%rsi), %xmm0
addsd 0x18(%rdi), %xmm0
movsd %xmm0, 0x18(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/Lut99[P]RayTracer/src/lib/Vec3.cpp
// Function: RayTracer::Vec3::operator+=(double)
Vec3& Vec3::operator+=(const double other) {
    this->x += other;
    this->y += other;
    this->z += other;

    return *this;
}

// Assembly:
movq %rdi, %rax
movupd 0x8(%rdi), %xmm1
movapd %xmm0, %xmm2
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
addpd %xmm1, %xmm2
movupd %xmm2, 0x8(%rdi)
addsd 0x18(%rdi), %xmm0
movsd %xmm0, 0x18(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movl %esi, %ebp
cmpl $0x3, %esi
jae 0x72bbe
movl %ebp, %eax
leaq (%rdi,%rax,8), %rax
addq $0x8, %rax
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x3a210
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
movl %ebp, %esi
callq 0x73857
leaq 0x18562(%rip), %rsi     # 0x8b140
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x5d118
leaq 0x18553(%rip), %rsi     # 0x8b147
leaq 0x48(%rsp), %rdi
callq 0x3a800
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x72c1f
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x72c2c
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %rbx, %rdi
callq 0x3a670
xorl %ebp, %ebp
movq 0x3234c(%rip), %rsi     # 0xa4fa8
movq 0x3232d(%rip), %rdx     # 0xa4f90
movq %rbx, %rdi
callq 0x3a750
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x72c8d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x72c8d
movq %rax, %r14
movb $0x1, %bpl
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x72cb0
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x72cb0
movq %rax, %r14
movb $0x1, %bpl
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x72cd3
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x72cd3
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x72ce0
movq %rbx, %rdi
callq 0x3a330
movq %r14, %rdi
callq 0x3a780
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movl %esi, %ebp
cmpl $0x3, %esi
jae 0x72d0c
movl %ebp, %eax
movsd 0x8(%rdi,%rax,8), %xmm0
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x3a210
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
movl %ebp, %esi
callq 0x73857
leaq 0x18414(%rip), %rsi     # 0x8b140
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x5d118
leaq 0x18405(%rip), %rsi     # 0x8b147
leaq 0x48(%rsp), %rdi
callq 0x3a800
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x72d6d
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x72d7a
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %rbx, %rdi
callq 0x3a670
xorl %ebp, %ebp
movq 0x321fe(%rip), %rsi     # 0xa4fa8
movq 0x321df(%rip), %rdx     # 0xa4f90
movq %rbx, %rdi
callq 0x3a750
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x72ddb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x72ddb
movq %rax, %r14
movb $0x1, %bpl
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x72dfe
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x72dfe
movq %rax, %r14
movb $0x1, %bpl
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x72e21
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x72e21
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x72e2e
movq %rbx, %rdi
callq 0x3a330
movq %r14, %rdi
callq 0x3a780
// File: /workspace/github_cpp_makefile_star2_O1/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, %r14
movq %rdi, %rbx
movsd 0x8(%rsi), %xmm1
movsd 0x10(%rsi), %xmm0
mulsd %xmm0, %xmm0
mulsd %xmm1, %xmm1
addsd %xmm0, %xmm1
movsd 0x18(%rsi), %xmm0
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
callq 0x3a170
movsd 0x18(%r14), %xmm1
divsd %xmm0, %xmm1
leaq 0x311bf(%rip), %rax     # 0xa4090
movq %rax, (%rbx)
movupd 0x8(%r14), %xmm2
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
divpd %xmm0, %xmm2
movupd %xmm2, 0x8(%rbx)
movsd %xmm1, 0x18(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x2, %r8d
callq 0x747bc
leaq 0x30(%rsp), %r15
movb $0x0, (%r15)
movq $0x0, 0x8(%r15)
movsd 0x8(%r14), %xmm0
movb $0x7, (%r15)
movsd %xmm0, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x8(%r15)
movq %r15, %rdi
callq 0x48a06
movq %r15, %rdi
callq 0x48a06
movq %rbx, %rdi
xorl %esi, %esi
callq 0x738fa
movq %rax, %r12
leaq 0x38(%rsp), %r15
leaq 0x30(%rsp), %r13
movq %r13, %rdi
callq 0x48a06
movb (%r12), %al
movb (%r13), %cl
movb %cl, (%r12)
movb %al, (%r13)
movq 0x8(%r12), %rax
movq 0x8(%r13), %rcx
movq %rcx, 0x8(%r12)
movq %rax, 0x8(%r13)
movq %r12, %rdi
callq 0x48a06
movq %r13, %rdi
callq 0x48a06
movzbl (%r13), %esi
movq %r15, %rdi
callq 0x48aa8
leaq 0x20(%rsp), %r15
movb $0x0, (%r15)
movq $0x0, 0x8(%r15)
movsd 0x10(%r14), %xmm0
movb $0x7, (%r15)
movsd %xmm0, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x8(%r15)
movq %r15, %rdi
callq 0x48a06
movq %r15, %rdi
callq 0x48a06
movl $0x1, %esi
movq %rbx, %rdi
callq 0x738fa
movq %rax, %r12
leaq 0x28(%rsp), %r15
leaq 0x20(%rsp), %r13
movq %r13, %rdi
callq 0x48a06
movb (%r12), %al
movb (%r13), %cl
movb %cl, (%r12)
movb %al, (%r13)
movq 0x8(%r12), %rax
movq 0x8(%r13), %rcx
movq %rcx, 0x8(%r12)
movq %rax, 0x8(%r13)
movq %r12, %rdi
callq 0x48a06
movq %r13, %rdi
callq 0x48a06
movzbl (%r13), %esi
movq %r15, %rdi
callq 0x48aa8
leaq 0x10(%rsp), %r15
movb $0x0, (%r15)
movq $0x0, 0x8(%r15)
movsd 0x18(%r14), %xmm0
movb $0x7, (%r15)
movsd %xmm0, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x8(%r15)
movq %r15, %rdi
callq 0x48a06
movq %r15, %rdi
callq 0x48a06
movl $0x2, %esi
movq %rbx, %rdi
callq 0x738fa
movq %rax, %r14
leaq 0x18(%rsp), %r15
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x48a06
movb (%r14), %al
movb (%r12), %cl
movb %cl, (%r14)
movb %al, (%r12)
movq 0x8(%r14), %rax
movq 0x8(%r12), %rcx
movq %rcx, 0x8(%r14)
movq %rax, 0x8(%r12)
movq %r14, %rdi
callq 0x48a06
movq %r12, %rdi
callq 0x48a06
movzbl (%r12), %esi
movq %r15, %rdi
callq 0x48aa8
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x730fd
jmp 0x730fd
movq %rax, %r14
movq %r15, %rdi
callq 0x4191c
movq %rbx, %rdi
callq 0x4191c
movq %r14, %rdi
callq 0x3a780
// File: /workspace/github_cpp_makefile_star2_O1/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 0x30ace(%rip), %rcx     # 0xa4090
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_O1/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 0x30a9f(%rip), %rcx     # 0xa4090
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_O1/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 0x30a71(%rip), %rcx     # 0xa4090
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_O1/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 0x30877(%rip), %rcx     # 0xa4090
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
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %r14
cmpb $0x2, (%rdi)
jne 0x74b59
movq 0x8(%r14), %rax
shlq $0x4, %rsi
addq (%rax), %rsi
movq %rsi, %rax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0x3a210
movq %rax, %rbx
movzbl (%r14), %eax
cmpq $0x8, %rax
ja 0x74b7d
leaq 0x2f531(%rip), %rcx     # 0xa40a8
movq (%rcx,%rax,8), %r14
jmp 0x74b84
leaq 0x1267a(%rip), %r14     # 0x871fe
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq %r14, %rdi
callq 0x3a1f0
leaq (%rax,%r14), %rdx
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x44728
leaq 0x1665a(%rip), %rsi     # 0x8b207
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x5d118
movb $0x1, %bpl
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
movl $0x131, %esi            # imm = 0x131
callq 0x5dfaa
xorl %ebp, %ebp
leaq 0x2f3b6(%rip), %rsi     # 0xa3f90
leaq -0x197c1(%rip), %rdx    # 0x5b420
movq %rbx, %rdi
callq 0x3a750
movq %rax, %r14
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x74c0f
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x74c0f
movq %rax, %r14
movb $0x1, %bpl
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x74c2e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x74c2e
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x74c3b
movq %rbx, %rdi
callq 0x3a330
movq %r14, %rdi
callq 0x3a780
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x75544
leaq 0x2da03(%rip), %rax     # 0xa4370
movq %rax, (%r14)
movsd (%rsp), %xmm0
movsd %xmm0, 0x80(%r14)
movq %rbx, 0x88(%r14)
movq %r14, %rdi
callq 0x76b60
movb %al, 0x78(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq %rdi, %rbx
addq $0x18, %rsi
xorl %edx, %edx
callq 0x75544
leaq 0x2d9b5(%rip), %rax     # 0xa4370
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 0x76a44
leaq 0x2d68b(%rip), %rax     # 0xa4080
addq $0x10, %rax
leaq 0x20(%rsp), %r15
movq %rax, -0x20(%r15)
movups 0x40(%r14), %xmm0
movups %xmm0, -0x18(%r15)
movq 0x50(%r14), %rcx
movq %rcx, -0x8(%r15)
movq %rax, (%r15)
movups 0x60(%r14), %xmm0
movups %xmm0, 0x8(%r15)
movq 0x70(%r14), %rax
movq %rax, 0x18(%r15)
leaq 0x38(%rbx), %rdi
movq %rsp, %rsi
callq 0x72a08
addq $0x58, %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x72a08
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x75544
leaq 0x2d906(%rip), %rax     # 0xa4370
movq %rax, (%r14)
movsd 0x80(%rbx), %xmm0
movsd %xmm0, 0x80(%r14)
movq 0x88(%rbx), %rax
movq %rax, 0x88(%r14)
movq $0x0, 0x88(%rbx)
movb 0x78(%rbx), %al
movb %al, 0x78(%r14)
cmpb $0x1, %al
jne 0x76ac9
leaq 0x38(%rbx), %rsi
leaq 0x38(%r14), %rdi
callq 0x72a08
addq $0x58, %r14
addq $0x58, %rbx
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x72a08
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x7363a
leaq 0x20(%r15), %r13
movq %r13, %rdi
movq %r13, %rsi
callq 0x737de
movsd %xmm0, 0x10(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x737de
movapd %xmm0, 0x20(%rsp)
movq %r12, %rdi
movq %r12, %rsi
callq 0x737de
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 0x76d7b
movapd 0x1446e(%rip), %xmm0    # 0x8b110
xorpd %xmm2, %xmm0
movapd %xmm0, 0x40(%rsp)
movapd %xmm3, 0x30(%rsp)
movapd %xmm3, %xmm0
callq 0x3a170
movapd 0x40(%rsp), %xmm2
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm2
divsd %xmm1, %xmm2
movsd 0x18(%rsp), %xmm0
ucomisd %xmm2, %xmm0
jae 0x76ce3
ucomisd 0x8(%rsp), %xmm2
jb 0x76d14
movapd 0x30(%rsp), %xmm0
callq 0x3a170
movapd %xmm0, %xmm2
movsd 0x18(%rsp), %xmm0
subsd 0x20(%rsp), %xmm2
divsd 0x10(%rsp), %xmm2
xorl %eax, %eax
ucomisd %xmm2, %xmm0
jae 0x76d7d
ucomisd 0x8(%rsp), %xmm2
jae 0x76d7d
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 0x62684
leaq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0x72a08
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 0x72a08
movq %r14, 0x58(%rbx)
movq 0x88(%r14), %rax
movq %rax, 0x60(%rbx)
movb $0x1, %al
jmp 0x76d7d
xorl %eax, %eax
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movb $0x0, (%rdi)
movq $0x0, 0x8(%rdi)
callq 0x48a06
movq %rbx, %rdi
callq 0x48a06
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *(%rax)
leaq 0x18(%r14), %rsi
leaq 0x28(%rsp), %rdi
callq 0x72ef8
leaq 0x14554(%rip), %rsi     # 0x8b3cd
movq %rbx, %rdi
callq 0x416d6
movq %rax, %r15
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x48a06
movb (%r15), %al
movb (%r12), %cl
movb %cl, (%r15)
movb %al, (%r12)
leaq 0x30(%rsp), %r13
movq 0x8(%r15), %rax
movq (%r13), %rcx
movq %rcx, 0x8(%r15)
movq %rax, (%r13)
movq %r15, %rdi
callq 0x48a06
movq %r12, %rdi
callq 0x48a06
movzbl -0x8(%r13), %esi
movq %r13, %rdi
callq 0x48aa8
leaq 0x18(%rsp), %r15
movb $0x0, (%r15)
movq $0x0, 0x8(%r15)
movsd 0x80(%r14), %xmm0
movb $0x7, (%r15)
movsd %xmm0, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x8(%r15)
movq %r15, %rdi
callq 0x48a06
movq %r15, %rdi
callq 0x48a06
leaq 0x144bf(%rip), %rsi     # 0x8b3d4
movq %rbx, %rdi
callq 0x416d6
movq %rax, %r15
leaq 0x20(%rsp), %r12
leaq 0x18(%rsp), %r13
movq %r13, %rdi
callq 0x48a06
movb (%r15), %al
movb (%r13), %cl
movb %cl, (%r15)
movb %al, (%r13)
movq 0x8(%r15), %rax
movq 0x8(%r13), %rcx
movq %rcx, 0x8(%r15)
movq %rax, 0x8(%r13)
movq %r15, %rdi
callq 0x48a06
movq %r13, %rdi
callq 0x48a06
movzbl (%r13), %esi
movq %r12, %rdi
callq 0x48aa8
movq 0x88(%r14), %rsi
movq (%rsi), %rax
leaq 0x8(%rsp), %rdi
callq *0x28(%rax)
leaq 0x14455(%rip), %rsi     # 0x8b3db
movq %rbx, %rdi
callq 0x416d6
movq %rax, %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x48a06
movb (%r14), %al
movb (%r15), %cl
movb %cl, (%r14)
movb %al, (%r15)
leaq 0x10(%rsp), %r12
movq 0x8(%r14), %rax
movq (%r12), %rcx
movq %rcx, 0x8(%r14)
movq %rax, (%r12)
movq %r14, %rdi
callq 0x48a06
movq %r15, %rdi
callq 0x48a06
movzbl -0x8(%r12), %esi
movq %r12, %rdi
callq 0x48aa8
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
leaq 0x8(%rsp), %rdi
jmp 0x7700a
movq %rax, %r14
leaq 0x18(%rsp), %rdi
jmp 0x7700a
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x4191c
jmp 0x77014
movq %rax, %r14
movq %rbx, %rdi
callq 0x4191c
movq %r14, %rdi
callq 0x3a780
// File: /workspace/github_cpp_makefile_star2_O1/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), %rdi
callq 0x729d4
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
je 0x77837
xorl %r12d, %r12d
leaq 0x8(%rsp), %r15
movq (%rax,%r12,8), %rsi
addq $0x18, %rsi
movq %r15, %rdi
callq 0x72a3c
incq %r12
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r12
jb 0x7780f
jmp 0x7783b
sarq $0x3, %rcx
movq %rcx, %xmm1
punpckldq 0x138d8(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x138e0(%rip), %xmm1    # 0x8b130
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x73782
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2cbb0(%rip), %r12     # 0xa4440
movq %r12, (%rdi)
movq %rsp, %r14
movq %r14, %rdi
callq 0x787dc
leaq 0x18(%rsp), %rdi
movq %r14, %rdx
callq 0x777e0
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x75544
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x778d3
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x3a470
movq %r12, (%rbx)
leaq 0x80(%rbx), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x80(%rbx)
movq $0x0, 0x90(%rbx)
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0x787dc
leaq 0x18(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x788da
movq (%r15), %rdi
testq %rdi, %rdi
je 0x77924
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x3a470
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 0x7793e
movq %rax, %r15
movq (%r14), %rdi
testq %rdi, %rdi
je 0x7796b
movq 0x90(%rbx), %rsi
jmp 0x77963
movq %rax, %r15
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x7796b
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x3a470
movq %r15, %rdi
callq 0x3a780
nop
// File: /workspace/github_cpp_makefile_star2_O1/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, %rbx
addq $0x18, %rsi
movl $0x1, %edx
callq 0x75544
leaq 0x2caa6(%rip), %rax     # 0xa4440
movq %rax, (%rbx)
movl $0x80, %esi
leaq (%rbx,%rsi), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x80(%rbx)
movq $0x0, 0x90(%rbx)
addq %r15, %rsi
leaq 0x8(%rsp), %rdi
callq 0x787dc
leaq 0x8(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x788da
movq (%r12), %rdi
testq %rdi, %rdi
je 0x779ee
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x3a470
movb 0x78(%r15), %al
movb %al, 0x78(%rbx)
cmpb $0x1, %al
jne 0x77a49
leaq 0x2c680(%rip), %rax     # 0xa4080
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)
leaq 0x38(%rbx), %rdi
callq 0x72a08
leaq 0x28(%rsp), %rsi
leaq 0x58(%rbx), %rdi
callq 0x72a08
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x77a57
movq %rax, %r15
movq (%r14), %rdi
testq %rdi, %rdi
je 0x77a71
movq 0x90(%rbx), %rsi
subq %rdi, %rsi
callq 0x3a470
movq %r15, %rdi
callq 0x3a780
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
addq $0x18, %rsi
movl $0x1, %edx
callq 0x75544
leaq 0x2c99d(%rip), %rax     # 0xa4440
movq %rax, (%rbx)
movl $0x80, %r12d
leaq (%rbx,%r12), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x80(%rbx)
xorl %ebp, %ebp
movq %rbp, 0x90(%rbx)
addq %r14, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x788da
movq %rsp, %r13
movq %rbp, 0x10(%r13)
xorps %xmm0, %xmm0
movaps %xmm0, (%r13)
movq %r12, %rdi
movq %r13, %rsi
callq 0x788da
movq (%r13), %rdi
testq %rdi, %rdi
je 0x77b01
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x3a470
movb 0x78(%r14), %al
movb %al, 0x78(%rbx)
cmpb $0x1, %al
jne 0x77b29
leaq 0x38(%r14), %rsi
leaq 0x38(%rbx), %rdi
callq 0x72a08
leaq 0x58(%rbx), %rdi
addq $0x58, %r14
movq %r14, %rsi
callq 0x72a08
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq (%r15), %rdi
testq %rdi, %rdi
je 0x77b52
movq 0x90(%rbx), %rsi
subq %rdi, %rsi
callq 0x3a470
movq %r14, %rdi
callq 0x3a780