LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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 0x70756
cmpl $0x0, -0x8(%r14,%rcx,4)
movq %r12, %rcx
je 0x7073e
movl %ebp, 0x10(%rbx)
movl %r12d, 0x14(%rbx)
movq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x3a730
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x707b1
movq %rax, %r13
testq %r12, %r12
je 0x70787
movq %r13, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x3a260
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
movl %ebp, %ecx
callq 0x649fe
testl %eax, %eax
jne 0x707b6
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6f987
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_O3/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:
xorl %eax, %eax
cmpl $0x6, %edx
ja 0x70887
movl %edx, %eax
leaq 0x18618(%rip), %rdx     # 0x88e9c
movl (%rdx,%rax,4), %eax
imull %ecx, %eax
movl %edi, %ecx
shrl $0x3, %ecx
imulq %rax, %rcx
andl $0x7, %edi
imulq %rax, %rdi
addq $0x7, %rdi
shrq $0x3, %rdi
addq %rdi, %rcx
incq %rcx
movl %esi, %eax
imulq %rcx, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x711ae
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rax
subq %rdx, %rax
xorl %r9d, %r9d
xorl %r11d, %r11d
xorl %r10d, %r10d
testq %rdx, %rdx
je 0x71199
leaq (%r11,%rdx), %rbx
movq %rdx, %r14
movq %r10, %r15
movq %r15, %rcx
shrq $0x3, %rcx
movl %r15d, %ebp
notb %bpl
movzbl (%rsi,%rcx), %r12d
movzbl %bpl, %r13d
andl $0x7, %r13d
movl %r11d, %ecx
notb %cl
andb $0x7, %cl
movb $0x1, %bpl
shlb %cl, %bpl
btl %r13d, %r12d
jae 0x7117a
movq %r11, %rcx
shrq $0x3, %rcx
orb %bpl, (%rdi,%rcx)
jmp 0x71188
notb %bpl
movq %r11, %rcx
shrq $0x3, %rcx
andb %bpl, (%rdi,%rcx)
incq %r11
incq %r15
decq %r14
jne 0x7113f
addq %rdx, %r10
movq %rbx, %r11
addq %rax, %r10
incl %r9d
cmpl %r8d, %r9d
jne 0x71130
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x17a86(%rip), %r15     # 0x88c50
leaq 0x17a9f(%rip), %r12     # 0x88c70
leaq 0x17ab8(%rip), %r13     # 0x88c90
leaq 0x17ad1(%rip), %rbp     # 0x88cb0
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 0x71229
movl $0x0, (%rdi,%r14)
addq $0x4, %r14
cmpq $0x1c, %r14
jne 0x711df
xorl %eax, %eax
movq %rax, (%r8)
movq %rax, (%rcx)
movq %rax, (%r10)
movl 0x40(%rsp), %ebp
movl (%rdi,%rax), %edx
movl (%rsi,%rax), %r9d
testl %edx, %edx
je 0x71268
testl %r9d, %r9d
je 0x71265
movl %edx, %ebx
imull %ebp, %ebx
addl $0x7, %ebx
shrl $0x3, %ebx
incl %ebx
imull %r9d, %ebx
jmp 0x7126a
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
cmpq $0x1c, %rax
jne 0x71242
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x7207e
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 0x8(%rsp), %rdi
movl %ebp, %esi
callq 0x72d22
leaq 0x180c2(%rip), %rsi     # 0x8a160
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x5cd14
leaq 0x180b3(%rip), %rsi     # 0x8a167
leaq 0x48(%rsp), %rdi
callq 0x3a810
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x720df
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x720ec
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %rbx, %rdi
callq 0x3a680
xorl %ebp, %ebp
movq 0x31e84(%rip), %rsi     # 0xa3fa0
movq 0x31e65(%rip), %rdx     # 0xa3f88
movq %rbx, %rdi
callq 0x3a760
movq %rax, %r14
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x7214d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x7214d
movq %rax, %r14
movb $0x1, %bpl
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x72168
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3a480
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x72183
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3a480
testb %bpl, %bpl
jne 0x721ad
jmp 0x721b5
movq %rax, %r14
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x721ad
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x721ad
movq %rax, %r14
movq %rbx, %rdi
callq 0x3a340
movq %r14, %rdi
callq 0x3a790
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x721e2
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 0x8(%rsp), %rdi
movl %ebp, %esi
callq 0x72d22
leaq 0x17f5e(%rip), %rsi     # 0x8a160
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x5cd14
leaq 0x17f4f(%rip), %rsi     # 0x8a167
leaq 0x48(%rsp), %rdi
callq 0x3a810
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x72243
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x72250
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %rbx, %rdi
callq 0x3a680
xorl %ebp, %ebp
movq 0x31d20(%rip), %rsi     # 0xa3fa0
movq 0x31d01(%rip), %rdx     # 0xa3f88
movq %rbx, %rdi
callq 0x3a760
movq %rax, %r14
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x722b1
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x722b1
movq %rax, %r14
movb $0x1, %bpl
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x722cc
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3a480
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x722e7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3a480
testb %bpl, %bpl
jne 0x72311
jmp 0x72319
movq %rax, %r14
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x72311
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x72311
movq %rax, %r14
movq %rbx, %rdi
callq 0x3a340
movq %r14, %rdi
callq 0x3a790
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x30d03(%rip), %rax     # 0xa30c0
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_O3/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 $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x2, %r8d
callq 0x73c9e
movsd 0x8(%r14), %xmm0
leaq 0x20(%rsp), %r15
movb $0x7, (%r15)
movsd %xmm0, 0x8(%r15)
movq %r15, %rdi
callq 0x4861e
movq %r15, %rdi
callq 0x4861e
movq %rbx, %rdi
xorl %esi, %esi
callq 0x72dc4
movq %rax, %r12
leaq 0x28(%rsp), %r15
leaq 0x20(%rsp), %r13
movq %r13, %rdi
callq 0x4861e
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 0x4861e
movq %r13, %rdi
callq 0x4861e
movzbl (%r13), %esi
movq %r15, %rdi
callq 0x486c0
movsd 0x10(%r14), %xmm0
leaq 0x10(%rsp), %r15
movb $0x7, (%r15)
movsd %xmm0, 0x8(%r15)
movq %r15, %rdi
callq 0x4861e
movq %r15, %rdi
callq 0x4861e
movl $0x1, %esi
movq %rbx, %rdi
callq 0x72dc4
movq %rax, %r12
leaq 0x18(%rsp), %r15
leaq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0x4861e
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 0x4861e
movq %r13, %rdi
callq 0x4861e
movzbl (%r13), %esi
movq %r15, %rdi
callq 0x486c0
movsd 0x18(%r14), %xmm0
movq %rsp, %r15
movb $0x7, (%r15)
movsd %xmm0, 0x8(%r15)
movq %r15, %rdi
callq 0x4861e
movq %r15, %rdi
callq 0x4861e
movl $0x2, %esi
movq %rbx, %rdi
callq 0x72dc4
movq %rax, %r14
leaq 0x8(%rsp), %r15
movq %rsp, %r12
movq %r12, %rdi
callq 0x4861e
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 0x4861e
movq %r12, %rdi
callq 0x4861e
movzbl (%r12), %esi
movq %r15, %rdi
callq 0x486c0
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x725a6
jmp 0x725a6
movq %rax, %r14
movq %r15, %rdi
callq 0x415d4
movq %rbx, %rdi
callq 0x415d4
movq %r14, %rdi
callq 0x3a790
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x30633(%rip), %rcx     # 0xa30c0
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_O3/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 0x30604(%rip), %rcx     # 0xa30c0
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_O3/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 0x303dc(%rip), %rcx     # 0xa30c0
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_O3/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 0x74031
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 0x74055
leaq 0x2f089(%rip), %rcx     # 0xa30d8
movq (%rcx,%rax,8), %r14
jmp 0x7405c
leaq 0x1219f(%rip), %r14     # 0x861fb
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 0x44390
leaq 0x161a2(%rip), %rsi     # 0x8a227
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x5cd14
movb $0x1, %bpl
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
movl $0x131, %esi            # imm = 0x131
callq 0x5db3e
xorl %ebp, %ebp
leaq 0x2ef0e(%rip), %rsi     # 0xa2fc0
leaq -0x19029(%rip), %rdx    # 0x5b090
movq %rbx, %rdi
callq 0x3a760
movq %rax, %r14
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x740df
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x740f6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3a480
testb %bpl, %bpl
jne 0x7411c
jmp 0x74124
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x7411c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x7411c
movq %rax, %r14
movq %rbx, %rdi
callq 0x3a340
movq %r14, %rdi
callq 0x3a790
// File: /workspace/github_cpp_makefile_star2_O3/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 0x74a4c
leaq 0x2d4e3(%rip), %rax     # 0xa33a0
movq %rax, (%r14)
movsd (%rsp), %xmm0
movsd %xmm0, 0x80(%r14)
movq %rbx, 0x88(%r14)
movq %r14, %rdi
callq 0x760b0
movb %al, 0x78(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x74a4c
leaq 0x2d495(%rip), %rax     # 0xa33a0
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 0x75f94
leaq 0x2d16b(%rip), %rax     # 0xa30b0
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 0x71ec8
addq $0x58, %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x71ec8
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x74a4c
leaq 0x2d3e6(%rip), %rax     # 0xa33a0
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 0x76019
leaq 0x38(%rbx), %rsi
leaq 0x38(%r14), %rdi
callq 0x71ec8
addq $0x58, %r14
addq $0x58, %rbx
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x71ec8
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x72b05
leaq 0x20(%r15), %r13
movq %r13, %rdi
movq %r13, %rsi
callq 0x72ca9
movsd %xmm0, 0x10(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x72ca9
movapd %xmm0, 0x20(%rsp)
movq %r12, %rdi
movq %r12, %rsi
callq 0x72ca9
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 0x762cb
movapd 0x13f3e(%rip), %xmm0    # 0x8a130
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 0x76233
ucomisd 0x8(%rsp), %xmm2
jb 0x76264
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 0x762cd
ucomisd 0x8(%rsp), %xmm2
jae 0x762cd
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 0x62138
leaq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0x71ec8
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 0x71ec8
movq %r14, 0x58(%rbx)
movq 0x88(%r14), %rax
movq %rax, 0x60(%rbx)
movb $0x1, %al
jmp 0x762cd
xorl %eax, %eax
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movb $0x0, (%rdi)
movq $0x0, 0x8(%rdi)
callq 0x4861e
movq %rbx, %rdi
callq 0x4861e
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *(%rax)
leaq 0x18(%r14), %rsi
leaq 0x20(%rsp), %rdi
callq 0x723e4
leaq 0x14024(%rip), %rsi     # 0x8a3ed
movq %rbx, %rdi
callq 0x41392
movq %rax, %r15
leaq 0x20(%rsp), %r12
movq %r12, %rdi
callq 0x4861e
movb (%r15), %al
movb (%r12), %cl
movb %cl, (%r15)
movb %al, (%r12)
leaq 0x28(%rsp), %r13
movq 0x8(%r15), %rax
movq (%r13), %rcx
movq %rcx, 0x8(%r15)
movq %rax, (%r13)
movq %r15, %rdi
callq 0x4861e
movq %r12, %rdi
callq 0x4861e
movzbl -0x8(%r13), %esi
movq %r13, %rdi
callq 0x486c0
movsd 0x80(%r14), %xmm0
leaq 0x10(%rsp), %r15
movb $0x7, (%r15)
movsd %xmm0, 0x8(%r15)
movq %r15, %rdi
callq 0x4861e
movq %r15, %rdi
callq 0x4861e
leaq 0x13fa4(%rip), %rsi     # 0x8a3f4
movq %rbx, %rdi
callq 0x41392
movq %rax, %r15
leaq 0x18(%rsp), %r12
leaq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0x4861e
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 0x4861e
movq %r13, %rdi
callq 0x4861e
movzbl (%r13), %esi
movq %r12, %rdi
callq 0x486c0
movq 0x88(%r14), %rsi
movq (%rsi), %rax
movq %rsp, %rdi
callq *0x28(%rax)
leaq 0x13f3c(%rip), %rsi     # 0x8a3fb
movq %rbx, %rdi
callq 0x41392
movq %rax, %r14
movq %rsp, %r15
movq %r15, %rdi
callq 0x4861e
movb (%r14), %al
movb (%r15), %cl
movb %cl, (%r14)
movb %al, (%r15)
leaq 0x8(%rsp), %r12
movq 0x8(%r14), %rax
movq (%r12), %rcx
movq %rcx, 0x8(%r14)
movq %rax, (%r12)
movq %r14, %rdi
callq 0x4861e
movq %r15, %rdi
callq 0x4861e
movzbl -0x8(%r12), %esi
movq %r12, %rdi
callq 0x486c0
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rsp, %rdi
jmp 0x7653f
movq %rax, %r14
leaq 0x10(%rsp), %rdi
jmp 0x7653f
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x415d4
jmp 0x76549
movq %rax, %r14
movq %rbx, %rdi
callq 0x415d4
movq %r14, %rdi
callq 0x3a790
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x71e94
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
je 0x76dd3
xorl %r12d, %r12d
leaq 0x8(%rsp), %r15
movq (%rax,%r12,8), %rsi
addq $0x18, %rsi
movq %r15, %rdi
callq 0x71efc
incq %r12
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r12
jb 0x76dab
jmp 0x76dd7
sarq $0x3, %rcx
movq %rcx, %xmm1
punpckldq 0x1335c(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x13364(%rip), %xmm1    # 0x8a150
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x72c4d
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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, %r14
movq %rdi, %rbx
leaq 0x2c644(%rip), %r12     # 0xa3470
movq %r12, (%rdi)
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x77df4
movq %rsp, %rdi
movq %r15, %rdx
callq 0x76d7c
movq %rsp, %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x74a4c
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x76e6e
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x3a480
movq %r12, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x80(%rbx)
movq $0x0, 0x90(%rbx)
movq %rsp, %rdi
movq %r14, %rsi
callq 0x77df4
movq 0x80(%rbx), %rdi
movq 0x90(%rbx), %rsi
movaps (%rsp), %xmm0
movups %xmm0, 0x80(%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x90(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
testq %rdi, %rdi
je 0x76ee9
subq %rdi, %rsi
callq 0x3a480
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x76ee9
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x3a480
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 0x76f03
movq %rax, %r14
leaq 0x80(%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x76f38
movq 0x90(%rbx), %rsi
jmp 0x76f30
movq %rax, %r14
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x76f38
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x3a480
movq %r14, %rdi
callq 0x3a790
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq %rdi, %rbx
addq $0x18, %rsi
movl $0x1, %edx
callq 0x74a4c
leaq 0x2c50c(%rip), %rax     # 0xa3470
movq %rax, (%rbx)
movl $0x80, %r15d
xorps %xmm0, %xmm0
movups %xmm0, 0x80(%rbx)
movq $0x0, 0x90(%rbx)
leaq (%r14,%r15), %rsi
movq %rsp, %rdi
callq 0x77df4
movq 0x80(%rbx), %rdi
movq 0x90(%rbx), %rsi
movaps (%rsp), %xmm0
movups %xmm0, 0x80(%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x90(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
testq %rdi, %rdi
je 0x76fe6
subq %rdi, %rsi
callq 0x3a480
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x76fe6
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x3a480
movb 0x78(%r14), %al
movb %al, 0x78(%rbx)
cmpb $0x1, %al
jne 0x7703f
leaq 0x2c0b8(%rip), %rax     # 0xa30b0
addq $0x10, %rax
movq %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)
leaq 0x38(%rbx), %rdi
callq 0x71ec8
leaq 0x20(%rsp), %rsi
leaq 0x58(%rbx), %rdi
callq 0x71ec8
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x7704b
movq %rax, %r14
addq %rbx, %r15
movq (%r15), %rdi
testq %rdi, %rdi
je 0x77068
movq 0x90(%rbx), %rsi
subq %rdi, %rsi
callq 0x3a480
movq %r14, %rdi
callq 0x3a790
// File: /workspace/github_cpp_makefile_star2_O3/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 %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
addq $0x18, %rsi
movl $0x1, %edx
callq 0x74a4c
leaq 0x2c3dd(%rip), %rax     # 0xa3470
movq %rax, (%rbx)
movl $0x80, %esi
leaq (%rbx,%rsi), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x80(%rbx)
xorl %r12d, %r12d
movq %r12, 0x90(%rbx)
addq %r14, %rsi
movq %r15, %rdi
callq 0x77ef2
movq 0x80(%r14), %rdi
movq 0x90(%r14), %rsi
xorps %xmm0, %xmm0
movups %xmm0, 0x80(%r14)
movq %r12, 0x90(%r14)
testq %rdi, %rdi
je 0x770eb
subq %rdi, %rsi
callq 0x3a480
movb 0x78(%r14), %al
movb %al, 0x78(%rbx)
cmpb $0x1, %al
jne 0x77113
leaq 0x38(%r14), %rsi
leaq 0x38(%rbx), %rdi
callq 0x71ec8
leaq 0x58(%rbx), %rdi
addq $0x58, %r14
movq %r14, %rsi
callq 0x71ec8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%r15), %rdi
testq %rdi, %rdi
je 0x77139
movq 0x90(%rbx), %rsi
subq %rdi, %rsi
callq 0x3a480
movq %r14, %rdi
callq 0x3a790
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 $0x88, %rsp
movq %rdx, %rbx
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, (%rsp)
movq %rsi, %r14
movq %rdi, %r15
leaq 0x38(%rsp), %rdi
callq 0x71e94
leaq 0x58(%rsp), %rdi
callq 0x71e94
movq 0x80(%r15), %rax
cmpq %rax, 0x88(%r15)
je 0x77394
leaq 0x18(%rbx), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x38(%rbx), %r12
leaq 0x58(%rbx), %rcx
movq %rcx, 0x10(%rsp)
xorl %r13d, %r13d
xorl %ebp, %ebp
movsd (%rsp), %xmm0
movq (%rax,%r13,8), %rdi
movq (%rdi), %rax
movq %r14, %rsi
movsd 0x8(%rsp), %xmm1
callq *0x20(%rax)
testb %al, %al
je 0x7736c
movq 0x80(%r15), %rax
movq (%rax,%r13,8), %rdi
movq (%rdi), %rax
movq %r14, %rsi
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
leaq 0x20(%rsp), %rdx
callq *0x30(%rax)
testb %al, %al
je 0x7736c
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rbx)
movups 0x20(%rsp), %xmm0
movups %xmm0, (%rbx)
movq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x71ec8
movq %r12, %rdi
leaq 0x58(%rsp), %rsi
callq 0x71ec8
leaq 0x78(%rsp), %rax
movups (%rax), %xmm0
movq 0x10(%rsp), %rax
movups %xmm0, (%rax)
movb $0x1, %bpl
incq %r13
movq 0x80(%r15), %rax
movq 0x88(%r15), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r13
movsd (%rsp), %xmm0
jb 0x772e1
jmp 0x77396
xorl %ebp, %ebp
andb $0x1, %bpl
movl %ebp, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/objects/RenderObjectCollection.cpp
// Function: RayTracer::RenderObjectCollection::to_json[abi:cxx11]() const
json RenderObjectCollection::to_json() const {
    json j;

    // First, let the parent class parse all it wants
    this->baseclass_to_json(j);
    
    // Add child-specific properties
    j["objects"] = json::array();
    // Append all the internal objects
    for (std::size_t i = 0; i < this->objects.size(); i++) {
        j["objects"][i] = this->objects[i]->to_json();
    }
    return j;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movb $0x0, (%rdi)
movq $0x0, 0x8(%rdi)
callq 0x4861e
movq %rbx, %rdi
callq 0x4861e
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *(%rax)
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x2, %r8d
callq 0x73c9e
leaq 0xc84a(%rip), %rsi      # 0x83e76
movq %rbx, %rdi
callq 0x41392
movq %rax, %r15
leaq 0x18(%rsp), %r12
movq %r12, %rdi
callq 0x4861e
movb (%r15), %al
movb (%r12), %cl
movb %cl, (%r15)
movb %al, (%r12)
leaq 0x20(%rsp), %r13
movq 0x8(%r15), %rax
movq (%r13), %rcx
movq %rcx, 0x8(%r15)
movq %rax, (%r13)
movq %r15, %rdi
callq 0x4861e
movq %r12, %rdi
callq 0x4861e
movzbl -0x8(%r13), %esi
movq %r13, %rdi
callq 0x486c0
movq 0x80(%r14), %rax
cmpq %rax, 0x88(%r14)
je 0x77735
xorl %r12d, %r12d
leaq 0x8(%rsp), %r13
leaq 0xc7cf(%rip), %rbp      # 0x83e76
movq (%rax,%r12,8), %rsi
movq (%rsi), %rax
movq %r13, %rdi
callq *0x58(%rax)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x41392
movq %rax, %rdi
movq %r12, %rsi
callq 0x72dc4
movq %rax, %r15
movq %r13, %rdi
callq 0x4861e
movb (%r15), %al
movb 0x8(%rsp), %cl
movb %cl, (%r15)
movb %al, 0x8(%rsp)
movq 0x8(%r15), %rax
movq 0x10(%rsp), %rcx
movq %rcx, 0x8(%r15)
movq %rax, 0x10(%rsp)
movq %r15, %rdi
callq 0x4861e
movq %r13, %rdi
callq 0x4861e
movzbl 0x8(%rsp), %esi
leaq 0x10(%rsp), %rdi
callq 0x486c0
incq %r12
movq 0x80(%r14), %rax
movq 0x88(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r12
jb 0x776a7
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x18(%rsp), %rdi
jmp 0x77760
jmp 0x77753
movq %rax, %r14
jmp 0x77765
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x415d4
movq %rbx, %rdi
callq 0x415d4
movq %r14, %rdi
callq 0x3a790
nop
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/Random.cpp
// Function: RayTracer::random_double()
double RayTracer::random_double() {
    static std::uniform_real_distribution<double> distribution(0.0, 1.0);
    static std::mt19937 generator;
    static std::function<double()> rand_generator = std::bind(distribution, generator);
    return rand_generator();
}

// Assembly:
pushq %rbx
movb 0x2ccc5(%rip), %al      # 0xa4d50
testb %al, %al
je 0x780bf
movb 0x2e04b(%rip), %al      # 0xa60e0
testb %al, %al
je 0x780c6
movb 0x2e069(%rip), %al      # 0xa6108
testb %al, %al
je 0x780cd
cmpq $0x0, 0x2e04d(%rip)     # 0xa60f8
je 0x7816b
leaq 0x2e030(%rip), %rdi     # 0xa60e8
popq %rbx
jmpq *0x2e041(%rip)          # 0xa6100
callq 0x3acf6
jmp 0x7808f
callq 0x3ad27
jmp 0x78099
leaq 0x2e034(%rip), %rdi     # 0xa6108
callq 0x3a7b0
testl %eax, %eax
je 0x780a3
xorps %xmm0, %xmm0
movups %xmm0, 0x2e011(%rip)    # 0xa60f8
movups %xmm0, 0x2dffa(%rip)    # 0xa60e8
movl $0x1398, %edi           # imm = 0x1398
callq 0x3a470
movq %rax, %rbx
movaps 0x2cc3e(%rip), %xmm0    # 0xa4d40
movups %xmm0, (%rax)
movq %rax, %rdi
addq $0x10, %rdi
leaq 0x2cc45(%rip), %rsi     # 0xa4d58
movl $0x1388, %edx           # imm = 0x1388
callq 0x3a3b0
movq %rbx, 0x2dfc4(%rip)     # 0xa60e8
leaq 0x2dfbd(%rip), %rsi     # 0xa60e8
leaq 0x1d6(%rip), %rax       # 0x78308
movq %rax, 0x2dfc7(%rip)     # 0xa6100
leaq 0x1ec(%rip), %rax       # 0x7832c
movq %rax, 0x2dfb1(%rip)     # 0xa60f8
leaq 0x19c(%rip), %rdi       # 0x782ea
leaq 0x2c2e3(%rip), %rdx     # 0xa4438
callq 0x3a3f0
leaq 0x2dfa7(%rip), %rdi     # 0xa6108
callq 0x3a2c0
jmp 0x780a3
callq 0x3a1a0
movq %rax, %rbx
leaq 0x2df8e(%rip), %rdi     # 0xa6108
callq 0x3a2b0
movq %rbx, %rdi
callq 0x3a790
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/Random.cpp
// Function: RayTracer::random_in_unit_sphere()
RayTracer::Vec3 RayTracer::random_in_unit_sphere() {
    Vec3 p;
    do {
        p = 2.0 * Vec3(random_double(), random_double(), random_double()) - 1.0;
    } while (p.squared_length() >= 1.0);
    return p;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
callq 0x71e94
leaq 0x18(%rsp), %r14
leaq 0x38(%rsp), %r15
leaq 0x58(%rsp), %r12
callq 0x78084
movsd %xmm0, 0x10(%rsp)
callq 0x78084
movsd %xmm0, 0x8(%rsp)
callq 0x78084
movaps %xmm0, %xmm2
movq %r14, %rdi
movsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
callq 0x71eae
movq %r15, %rdi
movsd 0xae7a(%rip), %xmm0     # 0x83060
movq %r14, %rsi
callq 0x72bef
movq %r12, %rdi
movq %r15, %rsi
movsd 0xae44(%rip), %xmm0     # 0x83040
callq 0x72b35
movq %rbx, %rdi
movq %r12, %rsi
callq 0x71ec8
movq %rbx, %rdi
callq 0x7234a
ucomisd 0xae24(%rip), %xmm0     # 0x83040
jae 0x781a9
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/Random.cpp
// Function: RayTracer::random_in_unit_disc()
RayTracer::Vec3 RayTracer::random_in_unit_disc() {
    Vec3 p;
    do {
        p = 2.0 * Vec3(random_double(), random_double(), 0) - Vec3(1, 1, 0);
    } while (dot(p, p) >= 1.0);
    return p;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x90, %rsp
movq %rdi, %rbx
callq 0x71e94
leaq 0x30(%rsp), %r14
leaq 0x50(%rsp), %r15
leaq 0x10(%rsp), %r12
leaq 0x70(%rsp), %r13
callq 0x78084
movsd %xmm0, 0x8(%rsp)
callq 0x78084
movaps %xmm0, %xmm1
xorps %xmm2, %xmm2
movq %r14, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x71eae
movq %r15, %rdi
movsd 0xadd8(%rip), %xmm0     # 0x83060
movq %r14, %rsi
callq 0x72bef
xorps %xmm2, %xmm2
movq %r12, %rdi
movsd 0xada2(%rip), %xmm0     # 0x83040
movapd %xmm0, %xmm1
callq 0x71eae
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x72b05
movq %rbx, %rdi
movq %r13, %rsi
callq 0x71ec8
movq %rbx, %rdi
movq %rbx, %rsi
callq 0x72ca9
ucomisd 0xad6d(%rip), %xmm0     # 0x83040
jae 0x78259
movq %rbx, %rax
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/ProgressBar.cpp
// Function: std::ProgressBar::ProgressBar()
ProgressBar::ProgressBar() {
    this->min = DEFAULT_MIN;
    this->max = DEFAULT_MAX;
    
    this->left = DEFAULT_LEFT;
    this->right = DEFAULT_RIGHT;

    this->width = DEFAULT_WIDTH;
    this->interval = DEFAULT_INTERVAL;

    this->init();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x20(%rdi), %r14
leaq 0x30(%rdi), %rax
movq %rax, (%rsp)
movq %rax, 0x20(%rdi)
xorl %eax, %eax
movq %rax, 0x28(%rdi)
movb %al, 0x30(%rdi)
leaq 0x40(%rdi), %r15
leaq 0x50(%rdi), %rbp
movq %rbp, 0x40(%rdi)
movq %rax, 0x48(%rdi)
movb %al, 0x50(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0xbcf4(%rip), %rdx      # 0x84398
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x44390
leaq 0x8(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x3a570
movq (%r12), %rdi
cmpq %r13, %rdi
je 0x786d7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3a480
leaq 0x8(%rsp), %rdi
movq %r13, (%rdi)
leaq 0xbcb2(%rip), %rdx      # 0x84398
movq %rdx, %rsi
callq 0x44390
leaq 0x8(%rsp), %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x3a570
movq (%r14), %rdi
cmpq %r13, %rdi
je 0x78713
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3a480
movl $0xffffffff, 0x60(%rbx) # imm = 0xFFFFFFFF
movq $0x1f4, 0x78(%rbx)      # imm = 0x1F4
movb $0x1, 0x6c(%rbx)
movq 0x10(%rbx), %rax
movq %rax, 0x8(%rbx)
movb $0x0, (%rbx)
callq 0x3a080
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
imulq %rcx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x12, %rdx
addq %rax, %rdx
subq 0x78(%rbx), %rdx
movq %rdx, 0x70(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7876a
movq %rax, %rbx
movq (%r15), %rdi
cmpq %rbp, %rdi
je 0x78781
movq (%rbp), %rsi
incq %rsi
callq 0x3a480
movq (%r14), %rdi
cmpq (%rsp), %rdi
je 0x78799
movq (%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x3a480
movq %rbx, %rdi
callq 0x3a790
nop
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/ProgressBar.cpp
// Function: std::ProgressBar::ProgressBar(long, long)
ProgressBar::ProgressBar(long min_value, long max_value) {
    this->min = min_value;
    this->max = max_value;
    
    this->left = DEFAULT_LEFT;
    this->right = DEFAULT_RIGHT;

    this->width = DEFAULT_WIDTH;
    this->interval = DEFAULT_INTERVAL;

    this->init();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x20(%rdi), %r14
leaq 0x30(%rdi), %rax
movq %rax, (%rsp)
movq %rax, 0x20(%rdi)
xorl %eax, %eax
movq %rax, 0x28(%rdi)
movb %al, 0x30(%rdi)
leaq 0x40(%rdi), %r15
leaq 0x50(%rdi), %rbp
movq %rbp, 0x40(%rdi)
movq %rax, 0x48(%rdi)
movb %al, 0x50(%rdi)
movq %rsi, 0x10(%rdi)
movq %rdx, 0x18(%rdi)
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0xbb5f(%rip), %rdx      # 0x84398
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x44390
leaq 0x8(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x3a570
movq (%r12), %rdi
cmpq %r13, %rdi
je 0x7886c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3a480
leaq 0x8(%rsp), %rdi
movq %r13, (%rdi)
leaq 0xbb1d(%rip), %rdx      # 0x84398
movq %rdx, %rsi
callq 0x44390
leaq 0x8(%rsp), %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x3a570
movq (%r14), %rdi
cmpq %r13, %rdi
je 0x788a8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3a480
movl $0xffffffff, 0x60(%rbx) # imm = 0xFFFFFFFF
movq $0x1f4, 0x78(%rbx)      # imm = 0x1F4
movb $0x1, 0x6c(%rbx)
movq 0x10(%rbx), %rax
movq %rax, 0x8(%rbx)
movb $0x0, (%rbx)
callq 0x3a080
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
imulq %rcx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x12, %rdx
addq %rax, %rdx
subq 0x78(%rbx), %rdx
movq %rdx, 0x70(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x788ff
movq %rax, %rbx
movq (%r15), %rdi
cmpq %rbp, %rdi
je 0x78916
movq (%rbp), %rsi
incq %rsi
callq 0x3a480
movq (%r14), %rdi
cmpq (%rsp), %rdi
je 0x7892e
movq (%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x3a480
movq %rbx, %rdi
callq 0x3a790