LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/ProgressBar.cpp
// Function: std::ProgressBar::ProgressBar(long, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
ProgressBar::ProgressBar(long min_value, long max_value, std::string left_text, std::string right_text) {
    this->min = min_value;
    this->max = max_value;
    
    this->left = left_text;
    this->right = right_text;

    this->width = DEFAULT_WIDTH;
    this->interval = DEFAULT_INTERVAL;

    this->init();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r12
movq %rdi, %rbx
leaq 0x20(%rdi), %r14
leaq 0x30(%rdi), %r15
movq %r15, 0x20(%rdi)
xorl %eax, %eax
movq %rax, 0x28(%rdi)
movb %al, 0x30(%rdi)
leaq 0x40(%rdi), %r13
leaq 0x50(%rdi), %rbp
movq %rbp, 0x40(%rdi)
movq %rax, 0x48(%rdi)
movb %al, 0x50(%rdi)
movq %rsi, 0x10(%rdi)
movq %rdx, 0x18(%rdi)
movq %r14, %rdi
movq %rcx, %rsi
callq 0x3a250
movq %r13, %rdi
movq %r12, %rsi
callq 0x3a250
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 $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%r13), %rdi
cmpq %rbp, %rdi
je 0x789fa
movq (%rbp), %rsi
incq %rsi
callq 0x3a480
movq %r14, %rdi
movq %r15, %rsi
callq 0x3ad8c
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, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, std::chrono::duration<long, std::ratio<1l, 1000l>>)
ProgressBar::ProgressBar(long min_value, long max_value, std::string left_text, std::string right_text, int width, chrono::milliseconds update_interval) {
    this->min = min_value;
    this->max = max_value;
    
    this->left = left_text;
    this->right = right_text;

    this->width = width;
    this->interval = update_interval;

    this->init();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebp
movq %r8, %r12
movq %rdi, %rbx
addq $0x20, %rdi
leaq 0x30(%rbx), %r15
movq %r15, 0x20(%rbx)
xorl %eax, %eax
movq %rax, 0x28(%rbx)
movb %al, 0x30(%rbx)
leaq 0x40(%rbx), %r13
leaq 0x50(%rbx), %r14
movq %r14, 0x40(%rbx)
movq %rax, 0x48(%rbx)
movb %al, 0x50(%rbx)
movq %rsi, 0x10(%rbx)
movq %rdx, 0x18(%rbx)
movq %rdi, (%rsp)
movq %rcx, %rsi
callq 0x3a250
movq %r13, %rdi
movq %r12, %rsi
callq 0x3a250
movq 0x40(%rsp), %rax
movl %ebp, 0x60(%rbx)
movq %rax, 0x78(%rbx)
shrl $0x1f, %ebp
movb %bpl, 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 $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%r13), %rdi
cmpq %r14, %rdi
je 0x78baf
movq (%r14), %rsi
incq %rsi
callq 0x3a480
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x3adb4
movq %rbx, %rdi
callq 0x3a790
nop
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/ProgressBar.cpp
// Function: std::ProgressBar::win()
void ProgressBar::win() {
    // Make sure progress isn't too large
    if (this->progress > this->max) {
        this->progress = this->max;
    }
    // Do a draw
    this->draw();
    // Print endline to finish it up
    cout << endl;
    this->done = true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rax
cmpq %rax, 0x8(%rdi)
jle 0x78eed
movq %rax, 0x8(%rbx)
movq %rbx, %rdi
callq 0x78bc4
movq 0x2b084(%rip), %r14     # 0xa3f80
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3a440
movsbl %al, %esi
movq %r14, %rdi
callq 0x3a050
movq %rax, %rdi
callq 0x3a310
movb $0x1, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/ProgressBar.cpp
// Function: std::ProgressBar::set(long)
void ProgressBar::set(long value) {
    if (this->done) {
        return;
    }

    // Update the progress
    this->progress = value;
    
    // Check if we are done
    if (this->progress >= this->max) {
        return this->win();
    }

    // Otherwise, check for draw call
    chrono::milliseconds now = chrono::duration_cast<chrono::milliseconds>(chrono::system_clock::now().time_since_epoch());
    if (now - this->last_draw >= this->interval) {
        // Do the draw call
        this->draw();

        // Update the clock
        this->last_draw += this->interval;

        // Reset to now if we're an entire interval or more behind
        if (now - this->last_draw >= this->interval) {
            this->last_draw = now;
        }
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpb $0x0, (%rdi)
je 0x78f49
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rdi, %rbx
movq %rsi, 0x8(%rdi)
cmpq %rsi, 0x18(%rdi)
jle 0x78fac
callq 0x3a080
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
imulq %rcx
movq %rdx, %r14
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x12, %r14
addq %rax, %r14
movq %r14, %rax
subq 0x70(%rbx), %rax
cmpq 0x78(%rbx), %rax
jl 0x78f41
movq %rbx, %rdi
callq 0x78bc4
movq 0x78(%rbx), %rax
movq 0x70(%rbx), %rcx
addq %rax, %rcx
movq %r14, %rdx
subq %rcx, %rdx
cmpq %rax, %rdx
cmovgeq %r14, %rcx
movq %rcx, 0x70(%rbx)
jmp 0x78f41
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x78ed8
nop
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/Camera.cpp
// Function: RayTracer::Camera::get_ray(int, int) const
Ray Camera::get_ray(int x, int y) const {
    // Compute u and v
    double s, t;
    if (this->rays > 1) {
        s = double(x + random_double()) / double(this->width);
        t = double(this->height - 1 - y + random_double()) / double(this->height);
    } else {
        s = double(x) / double(this->width);
        t = double(this->height - 1 - y) / double(this->height);
    }

    // Return a ray shot through this pixel
    Vec3 rd = this->lens_radius * random_in_unit_disc();
    Vec3 offset = this->u * rd.x + this->v * rd.y;
    return Ray(this->origin + offset, this->lower_left_corner + s * this->horizontal + t * this->vertical - this->origin - offset);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movl %ecx, %ebp
movq %rsi, %r14
movq %rdi, 0x20(%rsp)
cmpl $0x2, 0x10(%rsi)
cvtsi2sd %edx, %xmm1
jl 0x7942b
movsd %xmm1, 0x8(%rsp)
callq 0x78084
addsd 0x8(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x8(%r14), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
notl %ebp
addl 0xc(%r14), %ebp
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movsd %xmm0, 0x10(%rsp)
callq 0x78084
addsd 0x10(%rsp), %xmm0
movl 0xc(%r14), %eax
jmp 0x7944a
cvtsi2sdl 0x8(%r14), %xmm0
divsd %xmm0, %xmm1
movl 0xc(%r14), %eax
notl %ebp
addl %eax, %ebp
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movsd %xmm1, 0x8(%rsp)
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x170(%r14), %xmm0
movsd %xmm0, 0x18(%rsp)
leaq 0x68(%rsp), %r15
movq %r15, %rdi
callq 0x7822d
leaq 0x128(%rsp), %r12
movq %r12, %rdi
movsd 0x18(%rsp), %xmm0
movq %r15, %rsi
callq 0x72bef
leaq 0x110(%r14), %rsi
movsd 0x8(%r12), %xmm0
leaq 0x28(%rsp), %r13
movq %r13, %rdi
callq 0x72bc1
leaq 0x150(%r14), %rsi
movsd 0x10(%r12), %xmm0
leaq 0x48(%rsp), %r12
movq %r12, %rdi
callq 0x72bc1
leaq 0x68(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x72a79
leaq 0xf0(%r14), %r13
leaq 0x28(%rsp), %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x72a79
leaq 0x90(%r14), %rbp
leaq 0xb0(%r14), %rsi
leaq 0xa8(%rsp), %rbx
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x72bef
leaq 0xc8(%rsp), %r12
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x72a79
addq $0xd0, %r14
leaq 0x88(%rsp), %rbx
movq %rbx, %rdi
movsd 0x10(%rsp), %xmm0
movq %r14, %rsi
callq 0x72bef
leaq 0xe8(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x72a79
leaq 0x108(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x72b05
leaq 0x48(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x72b05
movq 0x20(%rsp), %rbx
movq %rbx, %rdi
leaq 0x28(%rsp), %rsi
movq %r14, %rdx
callq 0x620f4
movq %rbx, %rax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/RenderWorld.cpp
// Function: RayTracer::RenderWorld::bounce_ray(RayTracer::Ray const&, int) const
Vec3 RenderWorld::bounce_ray(const Ray& ray, int depth) const {
    // Find the hit with the smallest hit
    HitRecord record;
    bool hit = this->objects->hit(ray, 0.0, numeric_limits<double>::max(), record);

    // Check if a hit occured
    if (hit) {
        Ray scattered;
        Vec3 attenuation;
        if (depth < 50 && record.material->scatter(ray, record, attenuation, scattered)) {
            return attenuation * this->bounce_ray(scattered, depth + 1);
        } else {
            return Vec3(0, 0, 0);
        }
    } else {
        Vec3 unit = ray.direction.normalize();
        double t = 0.5 * (unit.y + 1.0);
        return (1.0 - t) * Vec3(1, 1, 1) + t * Vec3(0.5, 0.7, 1.0);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x140, %rsp            # imm = 0x140
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x71e94
leaq 0xd0(%rsp), %rdi
callq 0x71e94
movq 0x8(%r14), %rdi
movsd 0x10148(%rip), %xmm1    # 0x8a768
leaq 0x98(%rsp), %rdx
xorps %xmm0, %xmm0
movq %r15, %rsi
callq 0x82158
testb %al, %al
je 0x7a6a9
leaq 0x58(%rsp), %rdi
callq 0x620a0
leaq 0x18(%rsp), %rdi
callq 0x71e94
cmpl $0x31, %ebp
jg 0x7a767
leaq 0x98(%rsp), %rdx
movq 0x60(%rdx), %rdi
movq (%rdi), %rax
leaq 0x18(%rsp), %rcx
leaq 0x58(%rsp), %r8
movq %r15, %rsi
callq *0x20(%rax)
testb %al, %al
je 0x7a767
incl %ebp
leaq 0x38(%rsp), %r15
leaq 0x58(%rsp), %rdx
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %ecx
callq 0x7a5e0
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x72b91
jmp 0x7a778
addq $0x20, %r15
leaq 0x58(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x7237a
movsd 0x897b(%rip), %xmm1     # 0x83040
movsd 0x10(%r14), %xmm0
addsd %xmm1, %xmm0
mulsd 0x8949(%rip), %xmm0     # 0x83020
movsd %xmm0, 0x10(%rsp)
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
movsd %xmm2, 0x8(%rsp)
leaq 0x38(%rsp), %r14
movq %r14, %rdi
movapd %xmm1, %xmm0
movapd %xmm1, %xmm2
callq 0x71eae
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movsd 0x8(%rsp), %xmm0
movq %r14, %rsi
callq 0x72bef
leaq 0x100(%rsp), %r14
movsd 0x1004a(%rip), %xmm1    # 0x8a770
movq %r14, %rdi
movsd 0x88ef(%rip), %xmm0     # 0x83020
movsd 0x8907(%rip), %xmm2     # 0x83040
callq 0x71eae
leaq 0x120(%rsp), %r12
movq %r12, %rdi
movsd 0x10(%rsp), %xmm0
movq %r14, %rsi
callq 0x72bef
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x72a79
jmp 0x7a778
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
movq %rbx, %rdi
callq 0x71eae
movq %rbx, %rax
addq $0x140, %rsp            # imm = 0x140
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/RenderWorld.cpp
// Function: RayTracer::RenderWorld::render_pixel(int, int, RayTracer::Camera const&) const
Vec3 RenderWorld::render_pixel(int x, int y, const Camera& cam) const {
    Vec3 col;
    for (int r = 0; r < cam.rays; r++) {
        Ray ray = cam.get_ray(x, y);

        // Get the colour
        col += this->bounce_ray(ray);
    }

    // Compute the colour average
    Vec3 avg_col = col / cam.rays;
    if (cam.gamma) {
        // Gamma-correct the avg_colour
        return Vec3(sqrtf64(avg_col.x), sqrtf64(avg_col.y), sqrtf64(avg_col.z));
    } else {
        return avg_col;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r8, %r14
movl %ecx, (%rsp)
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, 0x8(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x71e94
movl 0x10(%r14), %eax
testl %eax, %eax
jle 0x7a804
xorl %ebp, %ebp
leaq 0x18(%rsp), %r13
leaq 0x78(%rsp), %rbx
movq %r13, %rdi
movq %r14, %rsi
movl %r15d, %edx
movl (%rsp), %ecx
callq 0x793be
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x7a5e0
leaq 0x58(%rsp), %rdi
movq %rbx, %rsi
callq 0x71efc
incl %ebp
movl 0x10(%r14), %eax
cmpl %eax, %ebp
jl 0x7a7cc
cvtsi2sd %eax, %xmm0
leaq 0x18(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x72c4d
cmpb $0x0, 0x14(%r14)
je 0x7a867
movsd 0x20(%rsp), %xmm0
callq 0x3a170
movsd %xmm0, (%rsp)
movsd 0x28(%rsp), %xmm0
callq 0x3a170
movsd %xmm0, 0x10(%rsp)
movsd 0x30(%rsp), %xmm0
callq 0x3a170
movaps %xmm0, %xmm2
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
movsd (%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
callq 0x71eae
jmp 0x7a88c
leaq 0x28842(%rip), %rax     # 0xa30b0
addq $0x10, %rax
movq 0x8(%rsp), %rbx
movq %rax, (%rbx)
movups 0x20(%rsp), %xmm0
movups %xmm0, 0x8(%rbx)
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rbx)
movq %rbx, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/RenderWorld.cpp
// Function: RayTracer::RenderWorld::update(std::chrono::duration<long, std::ratio<1l, 1000l>>)
void RenderWorld::update(chrono::milliseconds time_passed) {
    // Loop through all objects and update them
    for (size_t i = 0; i < this->objects->size(); i++) {
        this->objects->operator[](i)->update(time_passed);
    }
    // Re-optimise the tree
    this->objects->optimize();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x8214c
testq %rax, %rax
je 0x7a8e7
xorl %r15d, %r15d
movq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x82352
movq (%rax), %rcx
movq %rax, %rdi
movq %r14, %rsi
callq *0x50(%rcx)
incq %r15
movq 0x8(%rbx), %rdi
callq 0x8214c
cmpq %rax, %r15
jb 0x7a8be
movq 0x8(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x82012
nop
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/RenderWorld.cpp
// Function: RayTracer::RenderWorld::operator=(RayTracer::RenderWorld)
RenderWorld& RenderWorld::operator=(RenderWorld other) {
    // Only do some stuff if this != other
    if (this != &other) {
        // Swap this data with the other data
        swap(*this, other);
    }
    return *this;
}

// Assembly:
movq %rdi, %rax
cmpq %rsi, %rdi
je 0x7a918
movq 0x8(%rax), %rcx
movq 0x8(%rsi), %rdx
movq %rdx, 0x8(%rax)
movq %rcx, 0x8(%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/RenderWorld.cpp
// Function: RayTracer::RenderWorld::to_json[abi:cxx11]() const
json RenderWorld::to_json() const {
    json j;
    j["objects"] = json::array();

    for (size_t i = 0; i < this->objects->size(); i++) {
        j["objects"][i] = this->objects->operator[](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
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x2, %r8d
callq 0x73c9e
leaq 0x94ef(%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
xorl %r12d, %r12d
leaq 0x8(%rsp), %r13
leaq 0x9488(%rip), %rbp      # 0x83e76
movq 0x8(%r14), %rdi
callq 0x8214c
cmpq %rax, %r12
jae 0x7aa80
movq 0x8(%r14), %rdi
movq %r12, %rsi
callq 0x82352
movq (%rax), %rcx
movq %r13, %rdi
movq %rax, %rsi
callq *0x58(%rcx)
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
jmp 0x7a9ee
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 0x7aaa6
jmp 0x7aaad
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x415d4
jmp 0x7aab0
movq %rax, %r14
movq %rbx, %rdi
callq 0x415d4
movq %r14, %rdi
callq 0x3a790
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/materials/Lambertian.cpp
// Function: RayTracer::Lambertian::scatter(RayTracer::Ray const&, RayTracer::HitRecord const&, RayTracer::Vec3&, RayTracer::Ray&) const
bool Lambertian::scatter(const Ray&, const HitRecord& record, Vec3& attenuation, Ray& ray_out) const {
    Vec3 target = record.hitpoint + record.normal + random_in_unit_sphere();
    ray_out = Ray(record.hitpoint, target - record.hitpoint);
    attenuation = this->albedo;
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %r8, %r15
movq %rcx, (%rsp)
movq %rdi, %r14
leaq 0x18(%rdx), %r12
addq $0x38, %rdx
leaq 0x28(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x72a79
leaq 0x8(%rsp), %rbp
movq %rbp, %rdi
callq 0x78187
leaq 0x68(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x72a79
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x72b05
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x620f4
movq %r15, %rdi
movq %rbx, %rsi
callq 0x71ec8
addq $0x20, %r15
leaq 0x48(%rsp), %rsi
movq %r15, %rdi
callq 0x71ec8
addq $0x10, %r14
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x71ec8
movb $0x1, %al
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/materials/Lambertian.cpp
// Function: RayTracer::Lambertian::to_json[abi:cxx11]() const
nlohmann::json Lambertian::to_json() const {
    json j;
    
    // First, let the Material class compile
    this->baseclass_to_json(j);

    // Add our own properties
    j["albedo"] = this->albedo.to_json();
    return j;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %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)
addq $0x10, %r14
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x723e4
leaq 0xd184(%rip), %rsi      # 0x8a96e
movq %rbx, %rdi
callq 0x41392
movq %rax, %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x4861e
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 0x4861e
movq %r15, %rdi
callq 0x4861e
movzbl -0x8(%r12), %esi
movq %r12, %rdi
callq 0x486c0
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x415d4
jmp 0x7d862
movq %rax, %r14
movq %rbx, %rdi
callq 0x415d4
movq %r14, %rdi
callq 0x3a790
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/materials/Metal.cpp
// Function: RayTracer::Metal::scatter(RayTracer::Ray const&, RayTracer::HitRecord const&, RayTracer::Vec3&, RayTracer::Ray&) const
bool Metal::scatter(const Ray& ray_in, const HitRecord& record, Vec3& attenuation, Ray& ray_out) const {
    Vec3 reflected = this->reflect(ray_in.direction.normalize(), record.normal);
    ray_out = Ray(record.hitpoint, reflected + this->fuzz*random_in_unit_sphere());
    attenuation = this->albedo;
    return (dot(ray_out.direction, record.normal) > 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %r8, %rbx
movq %rcx, 0x10(%rsp)
movq %rdx, %r13
movq %rdi, %r15
addq $0x20, %rsi
leaq 0x38(%rsp), %rbp
movq %rbp, %rdi
callq 0x7237a
leaq 0x38(%r13), %r12
movq (%r15), %rax
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq %r12, %rcx
callq *0x30(%rax)
addq $0x18, %r13
movsd 0x30(%r15), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x78(%rsp), %rbp
movq %rbp, %rdi
callq 0x78187
leaq 0x98(%rsp), %r14
movq %r14, %rdi
movsd 0x8(%rsp), %xmm0
movq %rbp, %rsi
callq 0x72bef
leaq 0xb8(%rsp), %rbp
movq %rbp, %rdi
leaq 0x18(%rsp), %rsi
movq %r14, %rdx
callq 0x72a79
leaq 0x38(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x620f4
movq %rbx, %rdi
movq %r14, %rsi
callq 0x71ec8
addq $0x20, %rbx
leaq 0x58(%rsp), %rsi
movq %rbx, %rdi
callq 0x71ec8
addq $0x10, %r15
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x71ec8
movq %rbx, %rdi
movq %r12, %rsi
callq 0x72ca9
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
seta %al
addq $0xd8, %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/materials/Metal.cpp
// Function: RayTracer::Metal::to_json[abi:cxx11]() const
json Metal::to_json() const {
    json j;

    // First, let the Material class compile
    this->baseclass_to_json(j);

    // Add our own properties
    j["albedo"] = this->albedo.to_json();
    j["fuzz"] = this->fuzz;
    return j;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %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 0x10(%r14), %rsi
leaq 0x10(%rsp), %rdi
callq 0x723e4
leaq 0xcb49(%rip), %rsi      # 0x8a96e
movq %rbx, %rdi
callq 0x41392
movq %rax, %r15
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x4861e
movb (%r15), %al
movb (%r12), %cl
movb %cl, (%r15)
movb %al, (%r12)
leaq 0x18(%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 0x30(%r14), %xmm0
movq %rsp, %r14
movb $0x7, (%r14)
movsd %xmm0, 0x8(%r14)
movq %r14, %rdi
callq 0x4861e
movq %r14, %rdi
callq 0x4861e
leaq 0xcaf2(%rip), %rsi      # 0x8a999
movq %rbx, %rdi
callq 0x41392
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 $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rsp, %rdi
jmp 0x7df20
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x415d4
jmp 0x7df2a
movq %rax, %r14
movq %rbx, %rdi
callq 0x415d4
movq %r14, %rdi
callq 0x3a790
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/materials/Dielectric.cpp
// Function: RayTracer::Dielectric::refract(RayTracer::Vec3 const&, RayTracer::Vec3 const&, double, RayTracer::Vec3&) const
bool Dielectric::refract(const Vec3& v, const Vec3& n, double ni_over_nt, Vec3& refracted) const {
    Vec3 v_normalized = v.normalize();
    double dt = dot(v_normalized, n);
    double D = 1.0 - ni_over_nt * ni_over_nt * (1 - dt * dt);
    // Only refract if there is a real solution to Snell's law
    if (D > 0) {
        refracted = ni_over_nt * (v_normalized - n * dt) - n * sqrtf64(D);
        return true;
    }
    return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rcx, %rbx
movsd %xmm0, 0x10(%rsp)
movq %rdx, %r14
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x7237a
movq %r15, %rdi
movq %r14, %rsi
callq 0x72ca9
movapd %xmm0, %xmm1
mulsd %xmm0, %xmm1
movsd 0x46d0(%rip), %xmm3     # 0x83040
movapd %xmm3, %xmm2
subsd %xmm1, %xmm2
movsd 0x10(%rsp), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm2, %xmm1
subsd %xmm1, %xmm3
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm3
jbe 0x7ea22
leaq 0x58(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movsd %xmm3, 0x8(%rsp)
callq 0x72bc1
leaq 0x78(%rsp), %r12
leaq 0x18(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0x72b05
leaq 0x98(%rsp), %r15
movq %r15, %rdi
movsd 0x10(%rsp), %xmm0
movq %r12, %rsi
callq 0x72bef
movsd 0x8(%rsp), %xmm0
callq 0x3a170
leaq 0x38(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x72bc1
leaq 0xb8(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x72b05
movq %rbx, %rdi
movq %r14, %rsi
callq 0x71ec8
xorpd %xmm1, %xmm1
movsd 0x8(%rsp), %xmm3
ucomisd %xmm1, %xmm3
seta %al
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/materials/Dielectric.cpp
// Function: RayTracer::Dielectric::to_json[abi:cxx11]() const
json Dielectric::to_json() const {
    json j;
    
    // First, let the Material class compile
    this->baseclass_to_json(j);

    // Add our own properties
    j["albedo"] = this->albedo.to_json();
    j["ref_idx"] = this->ref_idx;
    return j;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %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 0x10(%r14), %rsi
leaq 0x10(%rsp), %rdi
callq 0x723e4
leaq 0xbe8b(%rip), %rsi      # 0x8a96e
movq %rbx, %rdi
callq 0x41392
movq %rax, %r15
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x4861e
movb (%r15), %al
movb (%r12), %cl
movb %cl, (%r15)
movb %al, (%r12)
leaq 0x18(%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 0x30(%r14), %xmm0
movq %rsp, %r14
movb $0x7, (%r14)
movsd %xmm0, 0x8(%r14)
movq %r14, %rdi
callq 0x4861e
movq %r14, %rdi
callq 0x4861e
leaq 0xbe5b(%rip), %rsi      # 0x8a9c0
movq %rbx, %rdi
callq 0x41392
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 $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rsp, %rdi
jmp 0x7ebde
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x415d4
jmp 0x7ebe8
movq %rax, %r14
movq %rbx, %rdi
callq 0x415d4
movq %r14, %rdi
callq 0x3a790
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/animations/camera/CameraRotation.cpp
// Function: RayTracer::CameraRotation::recompute(RayTracer::Camera*)
void CameraRotation::recompute(Camera* target) {
    Vec3 lookat = target->lookat;
    Vec3 lookfrom = target->lookfrom;
    Vec3 lookfrom_circle(lookfrom.x, 0, lookfrom.z);

    this->center = Vec3(lookat.x, 0, lookat.z);
    this->angle = acosf64(dot(Vec3(0, 0, 1), (lookfrom_circle - center).normalize()));
    this->radius = (lookfrom_circle - this->center).length();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
movsd 0x48(%rsi), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x58(%rsi), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x28(%rsi), %xmm0
movsd 0x38(%rsi), %xmm2
leaq 0x78(%rsp), %r14
xorps %xmm1, %xmm1
movq %r14, %rdi
callq 0x71eae
leaq 0x18(%rsp), %r12
xorps %xmm1, %xmm1
movq %r12, %rdi
movsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm2
callq 0x71eae
leaq 0x10(%rbx), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x71ec8
leaq 0x18(%rsp), %r12
movsd 0x2f5e(%rip), %xmm2     # 0x83040
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
movq %r12, %rdi
callq 0x71eae
leaq 0x38(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x72b05
leaq 0x58(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
callq 0x7237a
movq %r12, %rdi
movq %rbp, %rsi
callq 0x72ca9
callq 0x3a410
movsd %xmm0, 0x38(%rbx)
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x72b05
movq %r12, %rdi
callq 0x72322
movsd %xmm0, 0x30(%rbx)
addq $0x98, %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/animations/camera/CameraRotation.cpp
// Function: RayTracer::CameraRotation::update(std::chrono::duration<long, std::ratio<1l, 1000l>>, RayTracer::Camera*)
void CameraRotation::update(chrono::milliseconds time_passed, Camera* target) {
    // Set the camera lookfrom to this new position
    target->lookfrom = Vec3(
        this->center.x + cosf64(this->angle) * this->radius,
        target->lookfrom.y,
        this->center.z + sinf64(this->angle) * this->radius
    );

    this->angle += this->speed * time_passed.count();
    while (this->angle >= 2 * M_PI) {
        this->angle -= 2 * M_PI;
    }

    // Recompute the camera variables
    target->recompute();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movsd 0x18(%rdi), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x38(%rdi), %xmm0
callq 0x3a120
mulsd 0x30(%r14), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x20(%rbx), %r12
movsd 0x30(%rbx), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x28(%r14), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x38(%r14), %xmm0
callq 0x3a2a0
mulsd 0x30(%r14), %xmm0
movsd 0x10(%rsp), %xmm2
addsd %xmm0, %xmm2
leaq 0x20(%rsp), %r13
movq %r13, %rdi
movsd 0x8(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
callq 0x71eae
movq %r12, %rdi
movq %r13, %rsi
callq 0x71ec8
xorps %xmm0, %xmm0
cvtsi2sd %r15, %xmm0
mulsd 0x40(%r14), %xmm0
addsd 0x38(%r14), %xmm0
ucomisd 0xa8ab(%rip), %xmm0     # 0x8aab8
jb 0x80229
movsd 0xa8a9(%rip), %xmm1     # 0x8aac0
movsd 0xa899(%rip), %xmm2     # 0x8aab8
addsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jae 0x8021f
movsd %xmm0, 0x38(%r14)
movq %rbx, %rdi
callq 0x7909e
addq $0x40, %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/animations/camera/CameraRotation.cpp
// Function: RayTracer::CameraRotation::to_json[abi:cxx11]() const
json CameraRotation::to_json() const {
    json j;
    
    // First, let the parent add their general properties
    this->baseclass_to_json(j);

    // Now, add our own
    j["loop_time"] = this->loop_time.count();

    return j;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %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)
movq 0x48(%r14), %rax
leaq 0x8(%rsp), %r14
movb $0x5, (%r14)
movq %rax, 0x8(%r14)
movq %r14, %rdi
callq 0x4861e
movq %r14, %rdi
callq 0x4861e
leaq 0xa826(%rip), %rsi      # 0x8aac8
movq %rbx, %rdi
callq 0x41392
movq %rax, %r14
leaq 0x10(%rsp), %r15
leaq 0x8(%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 $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x415d4
jmp 0x8031d
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/BoundingBox.cpp
// Function: RayTracer::BoundingBox::hit(RayTracer::Ray const&, double, double) const
bool BoundingBox::hit(const Ray& ray, double t_min, double t_max) const {
    // Fetch the correct order of the hits
    for (int i = 0; i < 3; i++) {
        // Compute the t's
        double invD = 1.0 / ray.direction.get(i);
        double t0 = (this->p1.get(i) - ray.origin.get(i)) * invD;
        double t1 = (this->p2.get(i) - ray.origin.get(i)) * invD;
        if (invD < 0.0) {
            std::swap(t0, t1);
        }

        // Mix in the given min and max t values
        t_min = t0 > t_min ? t0 : t_min;
        t_max = t1 < t_max ? t1 : t_max;

        if (t_max <= t_min) {
            return false;
        }
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rsi), %r15
leaq 0x20(%rdi), %r12
xorl %ebp, %ebp
xorl %r13d, %r13d
movsd %xmm0, 0x10(%rsp)
movsd %xmm1, 0x18(%rsp)
movq %r15, %rdi
movl %r13d, %esi
callq 0x721be
movsd 0x2624(%rip), %xmm1     # 0x83040
divsd %xmm0, %xmm1
movapd %xmm1, 0x20(%rsp)
movq %r14, %rdi
movl %r13d, %esi
callq 0x721be
movapd %xmm0, (%rsp)
movq %rbx, %rdi
movl %r13d, %esi
callq 0x721be
movapd (%rsp), %xmm1
subsd %xmm0, %xmm1
mulsd 0x20(%rsp), %xmm1
movapd %xmm1, (%rsp)
movq %r12, %rdi
movl %r13d, %esi
callq 0x721be
movapd %xmm0, 0x30(%rsp)
movq %rbx, %rdi
movl %r13d, %esi
callq 0x721be
movapd 0x30(%rsp), %xmm4
movapd (%rsp), %xmm3
movapd 0x20(%rsp), %xmm2
xorpd %xmm1, %xmm1
subsd %xmm0, %xmm4
mulsd %xmm2, %xmm4
ucomisd %xmm2, %xmm1
movapd %xmm4, %xmm0
ja 0x80a9c
movapd %xmm3, %xmm0
maxsd 0x10(%rsp), %xmm0
cmpltsd %xmm1, %xmm2
andpd %xmm2, %xmm3
andnpd %xmm4, %xmm2
orpd %xmm3, %xmm2
minsd 0x18(%rsp), %xmm2
ucomisd %xmm2, %xmm0
jae 0x80adb
cmpl $0x2, %r13d
leal 0x1(%r13), %eax
setae %bpl
movl %eax, %r13d
movapd %xmm2, %xmm1
cmpl $0x3, %eax
jne 0x809fd
andb $0x1, %bpl
movl %ebp, %eax
addq $0x48, %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/BoundingBox.cpp
// Function: RayTracer::BoundingBox::merge(RayTracer::BoundingBox const&)
void BoundingBox::merge(const BoundingBox& other) {
    // For each of the three dimensions, find the smallest and put that in
    //   this->p1. The larger is put in this->p2.
    for (int i = 0; i < 3; i++) {
        double a1 = this->p1.get(i);
        double a2 = this->p2.get(i);
        double b1 = other.p1.get(i);
        double b2 = other.p2.get(i);

        // Order the A-box values
        double min = a1;
        double max = a2;
        if (min > max) {
            min = max;
            max = a1;
        }

        // Add the B-box values
        if (b1 < min) {
            min = b1;
        } else if (b1 > max) {
            max = b1;
        }
        if (b2 < min) {
            min = b2;
        } else if (b2 > max) {
            max = b2;
        }

        // Set the values and return
        this->p1[i] = min;
        this->p2[i] = max;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rdi), %r15
leaq 0x20(%rsi), %r12
xorl %ebp, %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x721be
movsd %xmm0, 0x8(%rsp)
movq %r15, %rdi
movl %ebp, %esi
callq 0x721be
movsd %xmm0, 0x10(%rsp)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x721be
movsd %xmm0, 0x18(%rsp)
movq %r12, %rdi
movl %ebp, %esi
callq 0x721be
movsd 0x8(%rsp), %xmm3
movsd 0x18(%rsp), %xmm2
movsd 0x10(%rsp), %xmm4
movapd %xmm4, %xmm1
minsd %xmm3, %xmm1
maxsd %xmm4, %xmm3
ucomisd %xmm2, %xmm1
jbe 0x80b70
movapd %xmm2, %xmm1
jmp 0x80b76
ucomisd %xmm3, %xmm2
ja 0x80b7a
movapd %xmm3, %xmm2
ucomisd %xmm0, %xmm1
jbe 0x80b88
movsd %xmm0, 0x10(%rsp)
jmp 0x80b9c
ucomisd %xmm2, %xmm0
movsd %xmm1, 0x10(%rsp)
jbe 0x80b9c
movsd %xmm0, 0x8(%rsp)
jmp 0x80ba2
movsd %xmm2, 0x8(%rsp)
movq %r14, %rdi
movl %ebp, %esi
callq 0x72058
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %r15, %rdi
movl %ebp, %esi
callq 0x72058
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
incl %ebp
cmpl $0x3, %ebp
jne 0x80b0c
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/BoundingBox.cpp
// Function: RayTracer::BoundingBox::size() const
double BoundingBox::size() const {
    double dx = fabsf64(this->p1.x - this->p2.x);
    double dy = fabsf64(this->p1.y - this->p2.y);
    double dz = fabsf64(this->p1.z - this->p2.z);
    return dx * dy * dz;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movsd 0x8(%rdi), %xmm0
subsd 0x28(%rdi), %xmm0
callq 0x3a7d0
movsd %xmm0, 0x8(%rsp)
movsd 0x10(%rbx), %xmm0
subsd 0x30(%rbx), %xmm0
callq 0x3a7d0
movsd %xmm0, (%rsp)
movsd 0x18(%rbx), %xmm0
subsd 0x38(%rbx), %xmm0
callq 0x3a7d0
movsd (%rsp), %xmm1
mulsd 0x8(%rsp), %xmm1
mulsd %xmm1, %xmm0
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/ObjectTree.cpp
// Function: print_vec(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<RayTracer::RenderObject*, std::allocator<RayTracer::RenderObject*>> const&)
void print_vec(string name, const vector<RenderObject*>& vec) {
    cout << name << " {";
    for (size_t i = 0; i < vec.size(); i++) {
        if (i > 0) { cout << ", "; }
        cout << vec.at(i);
    }
    cout << "}" << endl;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq (%rdi), %rsi
movq 0x8(%rdi), %rdx
movq 0x2332e(%rip), %rbx     # 0xa3f80
movq %rbx, %rdi
callq 0x3a500
leaq 0x9e9d(%rip), %rsi      # 0x8aafe
movl $0x2, %edx
movq %rax, %rdi
callq 0x3a500
movq (%r14), %rax
movq 0x8(%r14), %rdx
cmpq %rax, %rdx
je 0x80cd8
xorl %r15d, %r15d
movq 0x232fc(%rip), %r12     # 0xa3f80
leaq 0x7615(%rip), %r13      # 0x882a0
testq %r15, %r15
je 0x80ca7
movl $0x2, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x3a500
movq (%r14), %rax
movq 0x8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r15, %rdx
jbe 0x80d1c
movq (%rax,%r15,8), %rsi
movq %r12, %rdi
callq 0x3a370
incq %r15
movq (%r14), %rax
movq 0x8(%r14), %rdx
movq %rdx, %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r15
jb 0x80c8b
leaq 0x9e22(%rip), %rsi      # 0x8ab01
movl $0x1, %edx
movq %rbx, %rdi
callq 0x3a500
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3a440
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3a050
movq %rax, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x3a310
leaq 0x974a(%rip), %rdi      # 0x8a46d
movq %r15, %rsi
xorl %eax, %eax
callq 0x3a670
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/ObjectTree.cpp
// Function: RayTracer::ObjectTreeBranch::hit(RayTracer::Ray const&, double, double, RayTracer::HitRecord&) const
bool ObjectTreeBranch::hit(const Ray& ray, double t_min, double t_max, HitRecord& record) const {
    HitRecord record_r;
    bool hit_left = this->left->quick_hit(ray, t_min, t_max) && this->left->hit(ray, t_min, t_max, record);
    bool hit_right = this->right->quick_hit(ray, t_min, t_max) && this->right->hit(ray, t_min, t_max, record_r);
    // Note the record if it was a hit
    if (hit_left && hit_right) {
        // Set record to the smallest one
        if (record_r.t < record.t) {
            record = record_r;
        }
    } else if (hit_right) {
        // Don't forget to update record
        record = record_r;
    }
    
    // Return if we actually hit
    return hit_left || hit_right;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %rbx
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, (%rsp)
movq %rsi, %r12
movq %rdi, %r13
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0x71e94
leaq 0x48(%rsp), %r14
movq %r14, %rdi
callq 0x71e94
movq 0x50(%r13), %rdi
movq (%rdi), %rax
movq %r12, %rsi
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
callq *0x10(%rax)
testb %al, %al
je 0x81aab
movq 0x50(%r13), %rdi
movq (%rdi), %rax
movq %r12, %rsi
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movq %rbx, %rdx
callq *0x18(%rax)
movl %eax, %ebp
jmp 0x81aad
xorl %ebp, %ebp
movq 0x58(%r13), %rdi
movq (%rdi), %rax
movq %r12, %rsi
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
callq *0x10(%rax)
testb %al, %al
je 0x81b3b
movq 0x58(%r13), %rdi
movq (%rdi), %rax
leaq 0x10(%rsp), %rdx
movq %r12, %rsi
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
callq *0x18(%rax)
movl %ebp, %ecx
andb %al, %cl
cmpb $0x1, %cl
jne 0x81aff
movsd (%rbx), %xmm0
movb $0x1, %al
ucomisd 0x10(%rsp), %xmm0
ja 0x81b03
jmp 0x81b3d
testb %al, %al
je 0x81b3b
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rbx)
movups 0x10(%rsp), %xmm0
movups %xmm0, (%rbx)
leaq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0x71ec8
leaq 0x38(%rbx), %rdi
movq %r14, %rsi
callq 0x71ec8
movupd 0x68(%rsp), %xmm0
movupd %xmm0, 0x58(%rbx)
movb $0x1, %al
jmp 0x81b3d
xorl %eax, %eax
orb %al, %bpl
movl %ebp, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/ObjectTree.cpp
// Function: RayTracer::ObjectTreeBranch::operator=(RayTracer::ObjectTreeBranch)
ObjectTreeBranch& ObjectTreeBranch::operator=(ObjectTreeBranch other) {
    // Copy the stuff by swapping
    if (this != &other) {
        // Copy by swapping
        swap(*this, other);
    }
    return *this;
}

// Assembly:
movq %rdi, %rax
cmpq %rsi, %rdi
je 0x81b7a
movq 0x50(%rax), %rcx
movq 0x50(%rsi), %rdx
movq %rdx, 0x50(%rax)
movq %rcx, 0x50(%rsi)
movq 0x58(%rax), %rcx
movq 0x58(%rsi), %rdx
movq %rdx, 0x58(%rax)
movq %rcx, 0x58(%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/ObjectTree.cpp
// Function: RayTracer::ObjectTreeLeaf::operator=(RayTracer::ObjectTreeLeaf)
ObjectTreeLeaf& ObjectTreeLeaf::operator=(ObjectTreeLeaf other) {
    // Copy the stuff by swapping
    if (this != &other) {
        // Copy by swapping
        swap(*this, other);
    }
    return *this;
}

// Assembly:
movq %rdi, %rax
cmpq %rsi, %rdi
je 0x81dec
movq 0x50(%rax), %rcx
movq 0x50(%rsi), %rdx
movq %rdx, 0x50(%rax)
movq %rcx, 0x50(%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/ObjectTree.cpp
// Function: RayTracer::ObjectTree::~ObjectTree()
ObjectTree::~ObjectTree() {
    if (this->root != nullptr) { delete this->root; }

    // ALso delete all objects
    for (size_t i = 0; i < this->objects.size(); i++) {
        delete this->objects.at(i);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x81ee2
movq (%rdi), %rax
callq *0x8(%rax)
movq (%rbx), %rdi
movq 0x8(%rbx), %rcx
cmpq %rdi, %rcx
je 0x81f1c
xorl %r14d, %r14d
movq (%rdi,%r14,8), %rax
testq %rax, %rax
je 0x81f0a
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
movq (%rbx), %rdi
movq 0x8(%rbx), %rcx
incq %r14
movq %rcx, %rax
subq %rdi, %rax
sarq $0x3, %rax
cmpq %rax, %r14
jb 0x81ef1
testq %rdi, %rdi
je 0x81f34
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3a480
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/ObjectTree.cpp
// Function: RayTracer::ObjectTree::add(RayTracer::RenderObject*)
bool ObjectTree::add(RenderObject* obj) {
    // Crash if the object has no hitbox
    if (!obj->has_hitbox) {
        return false;
    }

    this->objects.push_back(obj);   

    // Be sure to mark the tree as non-optimised anymore
    this->is_optimised = false;

    return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
movb 0x78(%rsi), %bl
cmpb $0x1, %bl
jne 0x81f76
movq %rdi, %r14
movq 0x8(%rdi), %rax
cmpq 0x10(%rdi), %rax
je 0x81f63
movq %rsi, (%rax)
addq $0x8, 0x8(%r14)
jmp 0x81f71
movq %rsp, %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x82afe
movb $0x0, 0x20(%r14)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/ObjectTree.cpp
// Function: RayTracer::ObjectTree::remove(RayTracer::RenderObject*)
bool ObjectTree::remove(RenderObject* obj) {
    // Check if a node with this pointer is present
    for (size_t i = 0; i < this->objects.size(); i++) {
        if (this->objects.at(i) == obj) {
            // Remove it and then quit
            this->objects.erase(this->objects.begin() + i);

            this->is_optimised = false;
            
            return true;
        }
    }
    return false;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
movq %rdx, %rcx
subq %rax, %rcx
je 0x81fcd
movq %rdi, %rbx
sarq $0x3, %rcx
cmpq $0x1, %rcx
movq %rcx, %r8
adcq $0x0, %r8
cmpq %rsi, (%rax)
je 0x81fd1
movl $0x1, %r9d
cmpq %r9, %r8
je 0x82001
leaq 0x1(%r9), %rdi
cmpq %rsi, (%rax,%r9,8)
movq %rdi, %r9
jne 0x81faf
decq %rdi
cmpq %rcx, %rdi
setb %bpl
jmp 0x81fd6
xorl %ebp, %ebp
jmp 0x82008
movb $0x1, %bpl
xorl %edi, %edi
leaq (%rax,%rdi,8), %rsi
addq $0x8, %rsi
cmpq %rdx, %rsi
je 0x81ff3
leaq (%rax,%rdi,8), %rdi
subq %rsi, %rdx
callq 0x3a710
movq 0x8(%rbx), %rdx
addq $-0x8, %rdx
movq %rdx, 0x8(%rbx)
movb $0x0, 0x20(%rbx)
jmp 0x82008
cmpq %rcx, %r9
setb %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/ObjectTree.cpp
// Function: RayTracer::ObjectTree::optimize()
void ObjectTree::optimize() {
    this->is_optimised = true;

    // Start by removing any existing trees
    if (this->root != nullptr) {
        delete this->root;
    }
    
    // Make sure there are things to optimize
    if (this->size() == 0) { return; }

    // Create the root node
    if (this->size() == 1) {
        // If there is only one element, make a leaf
        this->root = (ObjectTreeNode*) new ObjectTreeLeaf(this->objects.at(0));
    } else {
        // Else, make a branch which splits itself
        this->root = (ObjectTreeNode*) new ObjectTreeBranch(this->objects);
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movb $0x1, 0x20(%rdi)
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x8202f
movq (%rdi), %rax
callq *0x8(%rax)
movq (%rbx), %r14
movq 0x8(%rbx), %rax
subq %r14, %rax
sarq $0x3, %rax
je 0x8210f
cmpq $0x1, %rax
jne 0x820cd
movl $0x58, %edi
callq 0x3a470
movq (%r14), %rcx
movups 0x40(%rcx), %xmm0
movaps %xmm0, 0x40(%rsp)
movq 0x50(%rcx), %rdx
movq %rdx, 0x50(%rsp)
movups 0x60(%rcx), %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0x70(%rcx), %rdx
movq %rdx, 0x30(%rsp)
movb $0x1, 0x8(%rax)
leaq 0x21027(%rip), %rdx     # 0xa30b0
addq $0x10, %rdx
movq %rdx, 0x10(%rax)
movaps 0x40(%rsp), %xmm0
movups %xmm0, 0x18(%rax)
movq 0x50(%rsp), %rsi
movq %rsi, 0x28(%rax)
movq %rdx, 0x30(%rax)
movaps 0x20(%rsp), %xmm0
movups %xmm0, 0x38(%rax)
movq 0x30(%rsp), %rdx
movq %rdx, 0x48(%rax)
leaq 0x21be0(%rip), %rdx     # 0xa3ca0
movq %rdx, (%rax)
movq %rcx, 0x50(%rax)
movq %rax, 0x18(%rbx)
jmp 0x8210f
movl $0x60, %edi
callq 0x3a470
movq %rax, %r14
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x77df4
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x8157c
movq %r14, 0x18(%rbx)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x8210f
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x3a480
addq $0x58, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x82136
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x3a480
jmp 0x82136
movq %rax, %rbx
movl $0x60, %esi
movq %r14, %rdi
callq 0x3a480
movq %rbx, %rdi
callq 0x3a790
nop