LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/BoundingBox.cpp
// Function: BoundingBox::ray_intersects(Ray&, double&, double&)
bool BoundingBox::ray_intersects(Ray& ray, double &tmin, double &tmax){
    const Eigen::Vector3d& ray_pt = ray.get_point();
    const Eigen::Vector3d& ray_dir = ray.get_dir();
    tmin = (min_corner(0) - ray_pt(0)) / ray_dir(0);
    tmax = (max_corner(0) - ray_pt(0)) / ray_dir(0);

    if (tmin > tmax) std::swap(tmin, tmax);

    double tymin = (min_corner(1) - ray_pt(1)) / ray_dir(1);
    double tymax = (max_corner(1) - ray_pt(1)) / ray_dir(1);

    if (tymin > tymax) std::swap(tymin, tymax);

    if ((tmin > tymax) || (tymin > tmax))
        return false;

    if (tymin > tmin)
        tmin = tymin;

    if (tymax < tmax)
        tmax = tymax;

    double tzmin = (min_corner(2) - ray_pt(2)) / ray_dir(2);
    double tzmax = (max_corner(2) - ray_pt(2)) / ray_dir(2);

    if (tzmin > tzmax) std::swap(tzmin, tzmax);

    if ((tmin > tzmax) || (tzmin > tmax))
        return false;

    if (tzmin > tmin)
        tmin = tzmin;

    if (tzmax < tmax)
        tmax = tzmax;

    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r15
movq %rsi, %rdi
callq 0x15c80
movq %rax, %r12
movq %r13, %rdi
callq 0x15c86
movsd (%r15), %xmm0
subsd (%r12), %xmm0
divsd (%rax), %xmm0
movsd %xmm0, (%r14)
movsd 0x18(%r15), %xmm0
subsd (%r12), %xmm0
divsd (%rax), %xmm0
movsd %xmm0, (%rbx)
movsd (%r14), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x6ee7
movsd %xmm0, (%r14)
movsd %xmm1, (%rbx)
movapd %xmm1, %xmm0
movsd (%r14), %xmm1
movupd 0x8(%r15), %xmm3
movupd 0x8(%r12), %xmm2
movhpd 0x20(%r15), %xmm3       # xmm3 = xmm3[0],mem[0]
movupd 0x8(%rax), %xmm4
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
subpd %xmm2, %xmm3
unpcklpd %xmm4, %xmm4            # xmm4 = xmm4[0,0]
divpd %xmm4, %xmm3
movapd %xmm3, %xmm4
unpckhpd %xmm3, %xmm4            # xmm4 = xmm4[1],xmm3[1]
movapd %xmm3, %xmm2
maxsd %xmm4, %xmm2
xorl %ecx, %ecx
ucomisd %xmm2, %xmm1
ja 0x6fc4
minsd %xmm3, %xmm4
ucomisd %xmm0, %xmm4
ja 0x6fc4
ucomisd %xmm1, %xmm4
jbe 0x6f4c
movsd %xmm4, (%r14)
movsd (%rbx), %xmm0
movapd %xmm4, %xmm1
ucomisd %xmm2, %xmm0
jbe 0x6f5f
movsd %xmm2, (%rbx)
movsd (%r14), %xmm1
movapd %xmm2, %xmm0
movupd 0x10(%r15), %xmm3
movhpd 0x28(%r15), %xmm3       # xmm3 = xmm3[0],mem[0]
movsd 0x10(%r12), %xmm2
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
subpd %xmm2, %xmm3
movsd 0x10(%rax), %xmm2
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
divpd %xmm2, %xmm3
movapd %xmm3, %xmm4
unpckhpd %xmm3, %xmm4            # xmm4 = xmm4[1],xmm3[1]
movapd %xmm3, %xmm2
maxsd %xmm4, %xmm2
xorl %ecx, %ecx
ucomisd %xmm2, %xmm1
ja 0x6fc4
minsd %xmm3, %xmm4
ucomisd %xmm0, %xmm4
ja 0x6fc4
ucomisd %xmm1, %xmm4
jbe 0x6fb8
movsd %xmm4, (%r14)
movsd (%rbx), %xmm0
movb $0x1, %cl
ucomisd %xmm2, %xmm0
jbe 0x6fc4
movsd %xmm2, (%rbx)
movl %ecx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/AnimatedObject.cpp
// Function: AnimatedObject::AnimatedObject(Model*)
AnimatedObject::AnimatedObject(Model* animated_asset){
     original_obj = animated_asset;
     current_obj = new Model(*original_obj);
     animation_file = animated_asset->get_animation_file();
     load_animation();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x18c5e(%rip), %rax     # 0x1fc48
movq %rax, (%rdi)
movl $0x0, 0x8(%rdi)
leaq 0x10(%rdi), %r14
leaq 0x20(%rdi), %r13
movq %r13, 0x10(%rdi)
leaq 0xfc6d(%rip), %rdx      # 0x16c74
movq %r14, %rdi
movq %rdx, %rsi
callq 0x5bde
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
movq $0x0, 0x40(%rbx)
movq %r15, 0x48(%rbx)
movl $0x258, %edi            # imm = 0x258
callq 0x32c0
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0x8aee
movq %r12, 0x50(%rbx)
movq %rsp, %rdi
movq %r15, %rsi
callq 0x9b82
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x3330
movq (%r15), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x7074
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32d0
movq %rbx, %rdi
callq 0x70ca
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x709e
movq %rax, %r15
movl $0x258, %esi            # imm = 0x258
movq %r12, %rdi
callq 0x32d0
jmp 0x70a1
movq %rax, %r15
addq $0x30, %rbx
movq %rbx, %rdi
callq 0x5702
movq (%r14), %rdi
cmpq %r13, %rdi
je 0x70c1
movq (%r13), %rsi
incq %rsi
callq 0x32d0
movq %r15, %rdi
callq 0x34b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/AnimatedObject.cpp
// Function: AnimatedObject::extract_file_lines(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::vector<std::string> AnimatedObject::extract_file_lines(std::string file_name){
    std::ifstream in(file_name);
    std::string driver_line;
    std::vector<std::string> result;

    while (std::getline(in, driver_line)){
        // An arbitrary check to make sure the line has contents
        if (driver_line.size() > 10){
            result.push_back(driver_line);
        }
    }
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq %rdx, %rsi
movl $0x8, %edx
callq 0x3420
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
xorl %eax, %eax
movq %rax, -0x8(%r12)
movb $0x0, (%r12)
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq %rsp, %r15
movq 0x20(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32b0
movsbl %al, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x34e0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x7472
cmpq $0xb, 0x8(%rsp)
jb 0x742b
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7bbe
jmp 0x742b
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x7488
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32d0
leaq 0x20(%rsp), %rdi
callq 0x30a0
movq %rbx, %rax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x7b14
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x74c5
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32d0
leaq 0x20(%rsp), %rdi
callq 0x30a0
movq %r14, %rdi
callq 0x34b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/AnimatedObject.cpp
// Function: AnimatedObject::add_animation_section(int, int, std::vector<double, std::allocator<double>>)
void AnimatedObject::add_animation_section(int section_start, int section_end,  std::vector<double> transform_floats){
    int number_frames = section_end - section_start;
    if (number_frames == 0){
        return;
    }
    std::vector<double> single_frame_transform = fraction_of_transform(number_frames, transform_floats);
    for (int i=1; i<number_frames+1; i++){
        frame_setting current;
        current.frame_number = section_start + i - 1;
        current.transform_floats = multiple_of_transform(i, single_frame_transform);
        current.set_as_new_base_model = (i == number_frames);
        frame_steps.push_back(current);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %edx, %ebp
subl %esi, %ebp
je 0x7673
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
leaq 0x90(%rsp), %r13
cvtsi2sd %ebp, %xmm0
movsd %xmm0, (%rsp)
leaq 0x80(%rsp), %r12
movq %r12, %rdi
movq %rcx, %rsi
callq 0x7a94
leaq 0x50(%rsp), %rdi
movsd (%rsp), %xmm0
movq %r12, %rdx
callq 0x76f0
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x754e
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
testl %ebp, %ebp
jle 0x765c
leaq 0x60(%rsp), %rax
movq %rax, (%rsp)
leaq 0x10(%rsp), %rbp
addq $0x30, %r15
negl %ebx
movl $0x1, %r13d
leaq 0x68(%rsp), %r12
xorpd %xmm0, %xmm0
movupd %xmm0, (%rbp)
movq $0x0, 0x10(%rbp)
movl %r14d, 0x8(%rsp)
movq %r12, %rdi
leaq 0x50(%rsp), %rsi
callq 0x7a94
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
leaq 0x30(%rsp), %rdi
movq %r12, %rdx
callq 0x77d2
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
movapd 0x30(%rsp), %xmm0
movupd %xmm0, 0x10(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x20(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
testq %rdi, %rdi
je 0x7604
subq %rdi, %rsi
callq 0x32d0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x7604
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x761b
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
leal (%rbx,%r14), %eax
cmpl $-0x1, %eax
sete 0x28(%rsp)
movq %r15, %rdi
leaq 0x8(%rsp), %rsi
callq 0x7b72
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x764b
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
incl %r13d
incl %r14d
movl %ebx, %eax
addl %r14d, %eax
jne 0x7575
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x7673
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, (%rsp)
movq %rax, %rbx
movq 0x80(%rsp), %rdi
jmp 0x76d3
jmp 0x76b4
movq %rax, %rbx
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x76b7
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
jmp 0x76b7
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x76ce
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x76e7
movq (%rsp), %rax
movq (%rax), %rsi
subq %rdi, %rsi
callq 0x32d0
movq %rbx, %rdi
callq 0x34b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/AnimatedObject.cpp
// Function: AnimatedObject::fraction_of_transform(double, std::vector<double, std::allocator<double>>)
std::vector<double> AnimatedObject::fraction_of_transform(double divide_by, std::vector<double> transform_floats){
    // transform_floats should be 8 long
    std::vector<double> result;
    for (int i=0; i<8; i++){
        double temp = transform_floats[i];
        // Scale value defaults to 1
        if (i==4){
            temp = 1 + (temp-1) / divide_by;
        }
        // Transform values default to 0
        if (i>4 || i==3){
            temp = temp / divide_by;
        }
        result.push_back(temp);
    }
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movsd %xmm0, 0x8(%rsp)
movq %rdi, %rbx
xorpd %xmm0, %xmm0
movupd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
xorl %r12d, %r12d
leaq 0x10(%rsp), %r15
movq (%r14), %rax
movsd (%rax,%r12,8), %xmm0
movapd %xmm0, %xmm1
addsd 0xf784(%rip), %xmm1     # 0x16eb8
divsd 0x8(%rsp), %xmm1
addsd 0xe8ee(%rip), %xmm1     # 0x16030
cmpq $0x4, %r12
je 0x774c
movapd %xmm0, %xmm1
movapd %xmm1, %xmm0
divsd 0x8(%rsp), %xmm0
movapd %xmm0, %xmm2
cmpq $0x3, %r12
je 0x7764
movapd %xmm1, %xmm2
cmpq $0x5, %r12
jae 0x776e
movapd %xmm2, %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x778c
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x7797
movq %rbx, %rdi
movq %r15, %rdx
callq 0x7c5c
incq %r12
cmpq $0x8, %r12
jne 0x771f
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x77ca
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x32d0
movq %r14, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/Model.cpp
// Function: Model::on_model_load()
void Model::on_model_load(){
    map_vertices_faces();
    calculate_face_normals();
    int recursion_depth = 8;
    bounding_box = std::make_unique<OctTree>(Vertices, Faces, recursion_depth);
    calculate_vertex_normals();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x9278
movq %rbx, %rdi
callq 0x93ac
leaq 0x198(%rbx), %r15
leaq 0x1b0(%rbx), %r12
movl $0xa8, %edi
callq 0x32c0
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
movl $0x8, %ecx
callq 0x14610
leaq 0x190(%rbx), %rdi
movq %r14, %rsi
callq 0xb074
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x95cc
movq %rax, %rbx
movl $0xa8, %esi
movq %r14, %rdi
callq 0x32d0
movq %rbx, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/Model.cpp
// Function: Model::map_vertices_faces()
void Model::map_vertices_faces(){
    int num_verts = Vertices.cols();
    std::vector<std::vector<int>> temp(num_verts);
    vertex_to_faces = temp;

    for (int face_num=0; face_num<Faces.cols(); face_num++){
        for (int j=0; j<3; j++){
            int vert = Faces(j, face_num);
            vertex_to_faces[vert-1].push_back(face_num);
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movslq 0x1a8(%rdi), %rsi
leaq 0x8(%rsp), %r14
leaq 0x4(%rsp), %rdx
movq %r14, %rdi
callq 0xabf0
leaq 0x1e0(%rbx), %rdi
movq %r14, %rsi
callq 0xa8e2
movl $0x0, 0x4(%rsp)
cmpq $0x0, 0x1c0(%rbx)
jle 0x9361
xorl %r15d, %r15d
leaq 0x4(%rsp), %r14
movslq 0x4(%rsp), %rax
testq %rax, %rax
js 0x9375
movq 0x1b8(%rbx), %rcx
cmpq %r15, %rcx
jle 0x9375
cmpq %rax, 0x1c0(%rbx)
jle 0x9375
imulq %rax, %rcx
shlq $0x2, %rcx
addq 0x1b0(%rbx), %rcx
movslq (%rcx,%r15,4), %rcx
movq 0x1e0(%rbx), %rdx
leaq (%rcx,%rcx,2), %rcx
leaq (%rdx,%rcx,8), %rdi
movq -0x10(%rdi), %rsi
cmpq -0x8(%rdi), %rsi
je 0x932d
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x10(%rdi)
jmp 0x9339
addq $-0x18, %rdi
movq %r14, %rdx
callq 0xb5dc
incq %r15
cmpq $0x3, %r15
jne 0x92ca
movslq 0x4(%rsp), %rax
incq %rax
movl %eax, 0x4(%rsp)
movl $0x0, %r15d
cmpq %rax, 0x1c0(%rbx)
jg 0x92ca
leaq 0x8(%rsp), %rdi
callq 0xa88e
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0xd117(%rip), %rdi      # 0x16493
leaq 0xd145(%rip), %rsi      # 0x164c8
leaq 0xdc66(%rip), %rcx      # 0x16ff0
movl $0x16d, %edx            # imm = 0x16D
callq 0x31a0
jmp 0x9396
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xa88e
movq %rbx, %rdi
callq 0x34b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/Model.cpp
// Function: Model::calculate_vertex_normals()
void Model::calculate_vertex_normals(){
    /* Assumes that calculate_face_normals was called first
      For every face calculate and store the vertex normal for its three vertices
    */
    int num_vert_norms = Faces.cols()*3;
    std::vector<Eigen::Vector3d> temp(num_vert_norms);
    vertex_normals = temp;
    Eigen::Vector3d original, average;
    for (int face_num=0; face_num<Faces.cols(); face_num++){
        original = get_face_normal(face_num);
        for (int f_vert=0; f_vert<3; f_vert++){
            int vertex_num = Faces(f_vert, face_num);
            average = get_face_normal(face_num);
            calc_vertex_normal(vertex_num, original, average);
            vertex_normals[3*face_num + f_vert] = average;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movq 0x1c0(%rdi), %rax
shlq $0x20, %rax
leaq (%rax,%rax,2), %rsi
sarq $0x20, %rsi
leaq 0x38(%rsp), %r14
leaq 0x50(%rsp), %rdx
movq %r14, %rdi
callq 0xae66
leaq 0x1f8(%rbx), %rdi
movq %r14, %rsi
callq 0xaa80
cmpq $0x0, 0x1c0(%rbx)
jle 0x9705
movl $0x10, %r12d
xorl %r15d, %r15d
xorl %r13d, %r13d
movq %rsp, %rdi
movq %rbx, %rsi
movl %r13d, %edx
callq 0x9922
movaps (%rsp), %xmm0
movaps %xmm0, 0x50(%rsp)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x60(%rsp)
movq %r12, 0x18(%rsp)
xorl %r14d, %r14d
movq 0x1b8(%rbx), %rax
cmpq %r14, %rax
jle 0x972b
cmpq %r13, 0x1c0(%rbx)
jle 0x972b
imulq %r15, %rax
addq 0x1b0(%rbx), %rax
movl (%rax,%r14,4), %ebp
movq %rsp, %rdi
movq %rbx, %rsi
movl %r13d, %edx
callq 0x9922
movaps (%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
movq %rbx, %rdi
movl %ebp, %esi
leaq 0x50(%rsp), %rdx
leaq 0x20(%rsp), %rcx
callq 0x998c
movq 0x1f8(%rbx), %rax
movaps 0x20(%rsp), %xmm0
movups %xmm0, -0x10(%rax,%r12)
movsd 0x30(%rsp), %xmm0
movsd %xmm0, (%rax,%r12)
incq %r14
addq $0x18, %r12
cmpq $0x3, %r14
jne 0x9656
incq %r13
movq 0x18(%rsp), %r12
addq $0x48, %r12
addq $0x4, %r15
cmpq %r13, 0x1c0(%rbx)
jg 0x962b
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x971c
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xcd61(%rip), %rdi      # 0x16493
leaq 0xcd8f(%rip), %rsi      # 0x164c8
leaq 0xd8b0(%rip), %rcx      # 0x16ff0
movl $0x16d, %edx            # imm = 0x16D
callq 0x31a0
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x9764
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
movq %rbx, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/Model.cpp
// Function: Model::calc_vertex_normal(int, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1>&)
void Model::calc_vertex_normal(int vertex_num, const Eigen::Vector3d& original_face, Eigen::Vector3d& average){
    int num_to_average = 1;
    Eigen::Vector3d conn_face_normal;
    for (auto connected_face:vertex_to_faces[vertex_num-1]){
        conn_face_normal = get_face_normal(connected_face);
        double angle = conn_face_normal.dot(original_face);
        // If angle between face normals is less than 22.5 degrees then smooth between them
        if (angle <= 1 && angle >=.9239){
            average = average + conn_face_normal;
            num_to_average++;
        }
    }
    average = average.normalized();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq 0x1e0(%rdi), %rax
movslq %esi, %rcx
leaq (%rcx,%rcx,2), %rcx
movq -0x18(%rax,%rcx,8), %r13
movq -0x10(%rax,%rcx,8), %rbp
cmpq %rbp, %r13
je 0x9a37
movq %rdx, %r14
movq %rdi, %r15
movq %rsp, %r12
movl (%r13), %edx
movq %r12, %rdi
movq %r15, %rsi
callq 0x9922
movapd (%rsp), %xmm1
movsd 0x10(%rsp), %xmm0
movupd (%r14), %xmm2
mulpd %xmm1, %xmm2
movapd %xmm2, %xmm3
unpckhpd %xmm2, %xmm3            # xmm3 = xmm3[1],xmm2[1]
addsd %xmm2, %xmm3
movsd 0x10(%r14), %xmm2
mulsd %xmm0, %xmm2
addsd %xmm3, %xmm2
movsd 0xc628(%rip), %xmm3     # 0x16030
ucomisd %xmm2, %xmm3
jb 0x9a2e
ucomisd 0xd512(%rip), %xmm2     # 0x16f28
jb 0x9a2e
movupd (%rbx), %xmm2
addpd %xmm2, %xmm1
movupd %xmm1, (%rbx)
addsd 0x10(%rbx), %xmm0
movsd %xmm0, 0x10(%rbx)
addq $0x4, %r13
cmpq %rbp, %r13
jne 0x99c3
movupd (%rbx), %xmm0
movapd %xmm0, %xmm1
mulpd %xmm0, %xmm1
movapd %xmm1, %xmm3
unpckhpd %xmm1, %xmm3            # xmm3 = xmm3[1],xmm1[1]
addsd %xmm1, %xmm3
movsd 0x10(%rbx), %xmm1
movapd %xmm1, %xmm2
mulsd %xmm1, %xmm2
addsd %xmm3, %xmm2
xorpd %xmm3, %xmm3
ucomisd %xmm3, %xmm2
jbe 0x9a7e
movq %xmm2, %xmm2            # xmm2 = xmm2[0],zero
sqrtpd %xmm2, %xmm2
divsd %xmm2, %xmm1
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
divpd %xmm2, %xmm0
movupd %xmm0, (%rbx)
movsd %xmm1, 0x10(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/Model.cpp
// Function: Model::get_refracted_ray(Ray&, Eigen::Matrix<double, 3, 1, 0, 3, 1>&, Eigen::Matrix<double, 3, 1, 0, 3, 1>&)
Ray Model::get_refracted_ray(Ray &orig_ray, Eigen::Vector3d &intersect_pos, Eigen::Vector3d &normal){
    Eigen::Vector3d T1, T2;
    double this_eta = get_eta();
    Eigen::Vector3d W = -1 * orig_ray.get_dir();
    T1 = refract_ray(W, normal, 1.0, this_eta);
    Eigen::Vector3d exit, Nin;
    get_refract_exit(intersect_pos, T1, exit, Nin);
    T1 = -1 * T1;
    T2 = refract_ray(T1, Nin, this_eta, 1.0);
    Ray exit_ray = Ray(exit, T2);
    return exit_ray;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %r8, %r12
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x1079a
movsd %xmm0, 0x8(%rsp)
movq %r13, %rdi
callq 0x15c86
movups (%rax), %xmm0
movaps 0xcbce(%rip), %xmm1     # 0x16f10
xorps %xmm1, %xmm0
leaq 0xd0(%rsp), %rdx
movaps %xmm0, (%rdx)
movsd 0x10(%rax), %xmm0
xorps %xmm1, %xmm0
movlps %xmm0, 0x10(%rdx)
leaq 0x50(%rsp), %r13
movsd 0xbcc7(%rip), %xmm0     # 0x16030
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rcx
movsd 0x8(%rsp), %xmm1
callq 0x1069c
movaps (%r13), %xmm0
movaps %xmm0, 0x30(%rsp)
leaq 0xf0(%rsp), %r12
movaps %xmm0, (%r12)
movsd 0x10(%r13), %xmm0
movaps %xmm0, 0x40(%rsp)
movsd %xmm0, 0x10(%r12)
movups (%r15), %xmm0
leaq 0x130(%rsp), %rsi
movaps %xmm0, (%rsi)
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsi)
movapd (%r12), %xmm0
leaq 0x110(%rsp), %rdx
movapd %xmm0, (%rdx)
movq 0x10(%r12), %rax
movq %rax, 0x10(%rdx)
leaq 0x50(%rsp), %r13
movq %r13, %rdi
callq 0x15bf0
movq (%r14), %rax
leaq 0x150(%rsp), %rbp
movq %r14, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq *0x10(%rax)
movupd (%r15), %xmm2
movapd %xmm0, %xmm3
unpcklpd %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0]
movapd 0x30(%rsp), %xmm1
mulpd %xmm1, %xmm3
addpd %xmm2, %xmm3
movapd %xmm3, 0x20(%rsp)
movapd 0x40(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd 0x10(%r15), %xmm0
movapd %xmm0, 0x10(%rsp)
movapd 0xcad5(%rip), %xmm0     # 0x16f10
xorpd %xmm0, %xmm1
movapd %xmm1, (%r12)
xorpd %xmm0, %xmm2
movlpd %xmm2, 0x10(%r12)
leaq 0x50(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbp, %rcx
movsd 0x8(%rsp), %xmm0
movsd 0xbbc1(%rip), %xmm1     # 0x16030
callq 0x1069c
movaps (%r15), %xmm0
movsd 0x10(%r15), %xmm1
leaq 0xb0(%rsp), %rsi
movaps 0x20(%rsp), %xmm2
movaps %xmm2, (%rsi)
movaps 0x10(%rsp), %xmm2
movsd %xmm2, 0x10(%rsi)
leaq 0x90(%rsp), %rdx
movaps %xmm0, (%rdx)
movsd %xmm1, 0x10(%rdx)
movq %rbx, %rdi
callq 0x15bf0
movq %rbx, %rax
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/RenderImage.cpp
// Function: RenderImage::tile_images(int)
std::queue<image_tile> RenderImage::tile_images(int tile_size){
  std::queue<image_tile> results;
  int width = scene->get_camera().pixel_width;
  int height = scene->get_camera().pixel_height;
  for (int i=0; i<width; i+=tile_size){
      for (int j=0; j<height; j+=tile_size){
          int x_len = std::min(width-i, tile_size);
          int y_len = std::min(height-j, tile_size);
          image_tile ir = build_image_tile(i, j, x_len, y_len);
          results.push(ir);
      }
  }
  return results;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rdi)
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
xorl %esi, %esi
callq 0xd524
movq (%r14), %rdi
callq 0xed76
movl (%rax), %r15d
movq (%r14), %rdi
callq 0xed76
testl %r15d, %r15d
jle 0xc10d
movl 0x4(%rax), %eax
movl %eax, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl %r15d, 0x14(%rsp)
cmpl $0x0, 0x10(%rsp)
jle 0xc0f5
movl 0x14(%rsp), %eax
movl %eax, %r15d
movl 0xc(%rsp), %eax
subl %eax, %r15d
cmpl %ebp, %r15d
cmovgel %ebp, %r15d
movl %eax, %r14d
xorl %r13d, %r13d
movl 0x10(%rsp), %r12d
movl %r12d, %eax
subl %ebp, %r12d
cmovgel %ebp, %eax
movq %r13, %rcx
shlq $0x20, %rcx
orq %r14, %rcx
shlq $0x20, %rax
orq %r15, %rax
movq %rcx, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movq 0x30(%rbx), %rax
movq 0x40(%rbx), %rcx
addq $-0x10, %rcx
cmpq %rcx, %rax
je 0xc0de
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rax)
addq $0x10, 0x30(%rbx)
jmp 0xc0eb
movq %rbx, %rdi
leaq 0x18(%rsp), %rsi
callq 0xd69c
addl %ebp, %r13d
cmpl 0x10(%rsp), %r13d
jl 0xc09a
movl 0xc(%rsp), %eax
addl %ebp, %eax
movl 0x14(%rsp), %r15d
movl %eax, 0xc(%rsp)
cmpl %r15d, %eax
jl 0xc073
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc123
jmp 0xc123
movq %rax, %r14
movq %rbx, %rdi
callq 0x6bee
movq %r14, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/RenderImage.cpp
// Function: RenderImage::render_tiles()
void RenderImage::render_tiles(){
    // Might be called by multiple threads, so image_tiles needs to be populated
    //   before this function is used
    bool queue_empty = false;
    while (!queue_empty){
        image_tiles_mutex.lock();
        image_tile current_tile = build_image_tile(0,0,0,0);
        if (!image_tiles.empty()){
            current_tile = image_tiles.front();
            image_tiles.pop();
        } else{
            queue_empty = true;
        }
        image_tiles_mutex.unlock();
        // If the queue was empty, current_tile covers no area and will not cause any rendering
        render_tile(current_tile);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x60(%rdi), %r14
movq %r14, %rdi
callq 0x33b0
testl %eax, %eax
jne 0xc227
leaq 0x10(%rbx), %r15
movq 0x20(%rbx), %rax
cmpq %rax, 0x40(%rbx)
je 0xc22e
movq (%rax), %r12
movq 0x8(%rax), %r13
movq %r15, %rdi
callq 0xd8b2
movq %r14, %rdi
callq 0x3220
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0xc24c
movq %r14, %rdi
callq 0x33b0
testl %eax, %eax
je 0xc1ec
movl %eax, %edi
callq 0x31c0
movq %r14, %rdi
callq 0x3220
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xc24c
nop
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/RenderImage.cpp
// Function: RenderImage::ray_trace(Ray&, Eigen::Matrix<double, 3, 1, 0, 3, 1>&, Eigen::Matrix<double, 3, 1, 0, 3, 1>&, int, double&)
void RenderImage::ray_trace(Ray& ray, Eigen::Vector3d& accum, Eigen::Vector3d& ampl, int level, double &t_value){
    if (scene->get_rendered_objects().size() == 0){
        return;
    }
    SceneObject* hit_obj = scene->get_rendered_objects()[0];
    Eigen::Vector3d hit_normal;
    t_value = find_intersection(ray, hit_obj, hit_normal);

    calculate_color(ray, t_value, hit_obj, hit_normal, accum, ampl, level);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %r13
movl %r8d, %ebp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq (%rdi), %rdi
callq 0xed6e
movq 0x8(%rax), %rcx
cmpq (%rax), %rcx
je 0xc646
movq (%r12), %rdi
callq 0xed6e
movq (%rax), %rax
movq (%rax), %rax
movq %rbx, 0x10(%rsp)
leaq 0x18(%rsp), %rbx
movq %rax, (%rbx)
leaq 0x20(%rsp), %rcx
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xc656
movsd %xmm0, (%r13)
movq (%rbx), %rdx
movl %ebp, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
leaq 0x20(%rsp), %rcx
movq %r14, %r8
movq 0x10(%rsp), %r9
callq 0xc6fc
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/RenderImage.cpp
// Function: RenderImage::find_intersection(Ray&, SceneObject*&, Eigen::Matrix<double, 3, 1, 0, 3, 1>&)
double RenderImage::find_intersection(Ray& ray, SceneObject*& md, Eigen::Vector3d &hit_normal){
    double epsilon = .0000000001;
    double intersect_t = MISSED_T_VALUE;
    Eigen::Vector3d hit_s_normal;
    for (auto so : scene->get_rendered_objects()){
        double t_value = so->intersect_ray(ray, hit_s_normal);
        if (t_value <= epsilon){
            continue;
        }
        if ((t_value < intersect_t) ){
            intersect_t = t_value;
            md = so;
            hit_normal = hit_s_normal;
        }
    }
    return intersect_t;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rbx
movq %rdx, 0x8(%rsp)
movq %rsi, %r15
movsd 0x8(%rdi), %xmm0
movsd %xmm0, (%rsp)
movq (%rdi), %rdi
callq 0xed6e
movq (%rax), %rbp
movq 0x8(%rax), %r14
cmpq %r14, %rbp
je 0xc6e8
leaq 0x10(%rsp), %r12
movq (%rbp), %r13
movq (%r13), %rax
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *0x10(%rax)
movsd 0xb65a(%rip), %xmm1     # 0x17d08
ucomisd %xmm0, %xmm1
jae 0xc6df
movsd (%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0xc6df
movq 0x8(%rsp), %rax
movq %r13, (%rax)
movaps 0x10(%rsp), %xmm1
movups %xmm1, (%rbx)
movsd 0x20(%rsp), %xmm1
movsd %xmm1, 0x10(%rbx)
movsd %xmm0, (%rsp)
addq $0x8, %rbp
cmpq %r14, %rbp
jne 0xc692
movsd (%rsp), %xmm0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/Scene.cpp
// Function: Scene::add_model(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Scene::add_model(std::string driver_line){
    Model* mo = new Model(driver_line);
    if (mo->is_animated()){
        AnimatedObject* ao = new AnimatedObject(mo);
        ao->set_start_frame(current_frame);
        animated_objects.push_back(ao);
    } else{
        SceneObject* so = (SceneObject*) mo;
        scene_objects.push_back(so);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movl $0x258, %edi            # imm = 0x258
callq 0x32c0
movq %rax, %r14
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x5756
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x81c8
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xf170
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32d0
movq %r14, %rdi
callq 0x9bac
testb %al, %al
je 0xf1c3
movl $0x58, %edi
callq 0x32c0
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x6fd0
movq %r15, (%rsp)
movl 0x234(%rbx), %esi
movq %r15, %rdi
callq 0x785a
movq 0x1f0(%rbx), %rsi
cmpq 0x1f8(%rbx), %rsi
je 0xf1f8
movq %r15, (%rsi)
addq $0x8, 0x1f0(%rbx)
jmp 0xf20a
movq %r14, (%rsp)
movq 0x1c0(%rbx), %rsi
cmpq 0x1c8(%rbx), %rsi
je 0xf1e4
movq %r14, (%rsi)
addq $0x8, 0x1c0(%rbx)
jmp 0xf20a
addq $0x1b8, %rbx            # imm = 0x1B8
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x10176
jmp 0xf20a
addq $0x1e8, %rbx            # imm = 0x1E8
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x10252
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movl $0x58, %esi
movq %r15, %rdi
jmp 0xf24a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xf242
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32d0
jmp 0xf242
movq %rax, %rbx
movl $0x258, %esi            # imm = 0x258
movq %r14, %rdi
callq 0x32d0
movq %rbx, %rdi
callq 0x34b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/Scene.cpp
// Function: Scene::add_sphere(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Scene::add_sphere(std::string driver_line){
    Sphere* sp = new Sphere(driver_line);
    if (sp->is_animated()){
        AnimatedSphere* as = new AnimatedSphere(sp);
        as->set_start_frame(current_frame);
        animated_objects.push_back(as);
    } else{
        SceneObject* so = (SceneObject*) sp;
        scene_objects.push_back(so);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r15
movq %rdi, %r14
movl $0x1d0, %edi            # imm = 0x1D0
callq 0x32c0
movq %rax, %rbx
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x5756
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xda34
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xf2b8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32d0
movq %rbx, %rdi
callq 0xe424
testb %al, %al
je 0xf302
movl $0x78, %edi
callq 0x32c0
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x13e0c
movl 0x234(%r14), %esi
movq %r15, %rdi
callq 0x785a
addq $0x1e8, %r14            # imm = 0x1E8
movq %rsp, %rsi
movq %r15, (%rsi)
movq %r14, %rdi
callq 0x1038e
jmp 0xf335
movq %rbx, (%rsp)
movq 0x1c0(%r14), %rsi
cmpq 0x1c8(%r14), %rsi
je 0xf323
movq %rbx, (%rsi)
addq $0x8, 0x1c0(%r14)
jmp 0xf335
addq $0x1b8, %r14            # imm = 0x1B8
movq %rsp, %rdx
movq %r14, %rdi
callq 0x10176
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movl $0x78, %esi
movq %r15, %rdi
jmp 0xf375
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xf36d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32d0
jmp 0xf36d
movq %rax, %r14
movl $0x1d0, %esi            # imm = 0x1D0
movq %rbx, %rdi
callq 0x32d0
movq %r14, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/Scene.cpp
// Function: Scene::edit_ambient(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Scene::edit_ambient(std::string driver_line){
    std::stringstream ambient_read(driver_line);
    std::string line_type;
    double red, green, blue;
    ambient_read >> line_type >> red >> green >> blue;
    ambient << red, green, blue;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1e0, %rsp            # imm = 0x1E0
movq %rdi, %rbx
leaq 0x58(%rsp), %r14
movq %r14, %rdi
movl $0x18, %edx
callq 0x3400
leaq 0x48(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
leaq 0x38(%rsp), %rsi
movq %r14, %rdi
callq 0x3340
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x31b0
movq %rsp, %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x218(%rbx), %rax
leaq 0x18(%rsp), %rdi
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movl $0x1, %eax
movq %rax, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x218(%rbx)
leaq 0x8(%rsp), %rsi
callq 0x5b22
movq %rsp, %rsi
movq %rax, %rdi
callq 0x5b22
movq 0x30(%rsp), %rax
addq 0x20(%rsp), %rax
cmpq $0x3, %rax
jne 0xf48b
cmpq $0x1, 0x28(%rsp)
jne 0xf48b
movq 0x38(%rsp), %rdi
cmpq %r15, %rdi
je 0xf460
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0x10b31(%rip), %rsi     # 0x1ff98
leaq 0x58(%rsp), %rdi
callq 0x3210
leaq 0xd8(%rsp), %rdi
callq 0x30e0
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbx
popq %r14
popq %r15
retq
leaq 0x74b6(%rip), %rdi      # 0x16948
leaq 0x754d(%rip), %rsi      # 0x169e6
leaq 0x7570(%rip), %rcx      # 0x16a10
movl $0x78, %edx
callq 0x31a0
movq %rax, %rbx
movq 0x30(%rsp), %rax
addq 0x20(%rsp), %rax
cmpq $0x3, %rax
jne 0xf4c5
cmpq $0x1, 0x28(%rsp)
je 0xf4cd
callq 0x365c
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %r15, %rdi
je 0xf4e4
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0x10aad(%rip), %rsi     # 0x1ff98
leaq 0x58(%rsp), %rdi
callq 0x3210
leaq 0xd8(%rsp), %rdi
callq 0x30e0
movq %rbx, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/Scene.cpp
// Function: Scene::valid_driver_line(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool Scene::valid_driver_line(std::string driver_line){
    bool is_valid = true;
    if(driver_line.size() == 0){
        is_valid = false;
    } else if(isspace(driver_line[0])){
        is_valid = false;
    } else if(driver_line[0] == '#'){
        is_valid = false;
    }
    return is_valid;
}

// Assembly:
cmpq $0x0, 0x8(%rsi)
je 0xf606
pushq %rbx
movq (%rsi), %rax
movsbl (%rax), %edi
cmpl $0x23, %edi
setne %bl
callq 0x3050
testl %eax, %eax
sete %al
andb %bl, %al
popq %rbx
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/SceneObject.cpp
// Function: SceneObject::refract_ray(Eigen::Matrix<double, 3, 1, 0, 3, 1>&, Eigen::Matrix<double, 3, 1, 0, 3, 1>&, double, double)
Eigen::Vector3d SceneObject::refract_ray(Eigen::Vector3d &w, Eigen::Vector3d &normal, double first_eta, double second_eta){
    double etar = first_eta / second_eta;
    double a = - etar;
    double wn = w.dot(normal);
    double radsq = etar*etar * (wn*wn -1) + 1;
    double b = (etar * wn) - std::sqrt(radsq);
    Eigen::Vector3d T = a * w + b * normal;
    return T;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movapd %xmm0, %xmm3
movq %rcx, %r15
movq %rdx, %r14
movq %rdi, %rbx
divsd %xmm1, %xmm3
movapd 0x6852(%rip), %xmm2     # 0x16f10
movupd (%rdx), %xmm0
movupd (%rcx), %xmm1
mulpd %xmm0, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movsd 0x10(%rdx), %xmm4
mulsd 0x10(%rcx), %xmm4
addsd %xmm0, %xmm4
movapd %xmm3, %xmm1
movapd %xmm4, %xmm0
mulsd %xmm4, %xmm0
addsd 0x67c0(%rip), %xmm0     # 0x16eb8
mulsd %xmm3, %xmm1
mulsd %xmm1, %xmm0
addsd 0x5928(%rip), %xmm0     # 0x16030
xorpd %xmm3, %xmm2
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1071c
sqrtsd %xmm0, %xmm0
jmp 0x10743
movapd %xmm3, 0x20(%rsp)
movapd %xmm4, 0x10(%rsp)
movapd %xmm2, (%rsp)
callq 0x3240
movapd (%rsp), %xmm2
movapd 0x10(%rsp), %xmm4
movapd 0x20(%rsp), %xmm3
mulsd %xmm3, %xmm4
subsd %xmm0, %xmm4
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
movupd (%r14), %xmm0
mulpd %xmm2, %xmm0
movapd %xmm4, %xmm1
unpcklpd %xmm4, %xmm1            # xmm1 = xmm1[0],xmm4[0]
movupd (%r15), %xmm2
mulpd %xmm1, %xmm2
addpd %xmm0, %xmm2
movupd %xmm2, (%rbx)
mulsd 0x10(%r15), %xmm4
mulsd 0x10(%r14), %xmm3
subsd %xmm3, %xmm4
movsd %xmm4, 0x10(%rbx)
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./Eigen/Eigen/src/Core/ProductEvaluators.h
// Function: Eigen::internal::Assignment<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Product<Eigen::Matrix<double, 4, 4, 0, 4, 4>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0>, Eigen::internal::assign_op<double, double>, Eigen::internal::Dense2Dense, void>::run(Eigen::Matrix<double, -1, -1, 0, -1, -1>&, Eigen::Product<Eigen::Matrix<double, 4, 4, 0, 4, 4>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0> const&, Eigen::internal::assign_op<double, double> const&)
static EIGEN_STRONG_INLINE
  void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op<Scalar,Scalar> &)
  {
    Index dstRows = src.rows();
    Index dstCols = src.cols();
    if((dst.rows()!=dstRows) || (dst.cols()!=dstCols))
      dst.resize(dstRows, dstCols);
    // FIXME shall we handle nested_eval here?
    generic_product_impl<Lhs, Rhs>::evalTo(dst, src.lhs(), src.rhs());
  }

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rax
movq 0x10(%rax), %rcx
cmpq $0x4, 0x8(%rdi)
jne 0x12064
cmpq %rcx, 0x10(%rbx)
je 0x1208f
testq %rcx, %rcx
js 0x120d9
movq %rcx, %rax
shrq $0x3d, %rax
jne 0x120f8
leaq (,%rcx,4), %rsi
movl $0x4, %edx
movq %rbx, %rdi
callq 0x5204
movq 0x8(%r14), %rax
cmpq $0x4, 0x8(%rax)
jne 0x120ba
movq (%r14), %rcx
leaq 0x8(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, 0x8(%rsi)
leaq 0x7(%rsp), %rdx
movq %rbx, %rdi
callq 0x12126
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x608e(%rip), %rdi      # 0x1814f
leaq 0x6113(%rip), %rsi      # 0x181db
leaq 0x672a(%rip), %rcx      # 0x187f9
movl $0x61, %edx
callq 0x31a0
leaq 0x45cd(%rip), %rdi      # 0x166ad
leaq 0x4755(%rip), %rsi      # 0x1683c
leaq 0x4777(%rip), %rcx      # 0x16865
movl $0x11d, %edx            # imm = 0x11D
callq 0x31a0
movl $0x8, %edi
callq 0x3130
movq 0xdeb7(%rip), %rcx      # 0x1ffc0
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0xdeb9(%rip), %rsi      # 0x1ffd0
movq 0xde8a(%rip), %rdx      # 0x1ffa8
movq %rax, %rdi
callq 0x3480
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/WaveObject.cpp
// Function: WaveObject::WaveObject(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
WaveObject::WaveObject(std::string driver_line, int current_time){
    set_time(current_time);
    extract_wave_info(driver_line);
    set_bounding_box();
    generate_waves(num_waves, random_seed);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movaps 0x491b(%rip), %xmm0     # 0x16ee0
movups %xmm0, 0x8(%rdi)
movl $0x0, 0x18(%rdi)
addq $0x20, %rdi
xorl %r15d, %r15d
movl $0xd8, %edx
xorl %esi, %esi
callq 0x3170
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0xf8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x100(%rbx)
movq %r15, 0x110(%rbx)
movq %rax, 0x118(%rbx)
movups %xmm0, 0x120(%rbx)
movq %r15, 0x130(%rbx)
movaps 0x48cf(%rip), %xmm1     # 0x16ef0
movups %xmm1, 0x138(%rbx)
movups %xmm0, 0x148(%rbx)
movq %r15, 0x158(%rbx)
movq %rax, 0x160(%rbx)
movups %xmm0, 0x168(%rbx)
movq %r15, 0x178(%rbx)
movaps 0x48ae(%rip), %xmm1     # 0x16f00
movups %xmm1, 0x180(%rbx)
leaq 0xd6b8(%rip), %rax      # 0x1fd18
movq %rax, (%rbx)
movups %xmm0, 0x198(%rbx)
movups %xmm0, 0x1a8(%rbx)
movaps 0x6248(%rip), %xmm1     # 0x188c0
movups %xmm1, 0x1b8(%rbx)
movabsq $0x100000001, %rax      # imm = 0x100000001
xorps %xmm1, %xmm1
cvtsi2sd %ebp, %xmm1
movq %rax, 0x1c8(%rbx)
movups %xmm0, 0x1d0(%rbx)
movsd %xmm1, 0x190(%rbx)
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x5756
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x12780
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x126e7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32d0
movq %rbx, %rdi
callq 0x12c46
movl 0x1c8(%rbx), %esi
movl 0x1cc(%rbx), %edx
movq %rbx, %rdi
callq 0x12d16
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1272d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32d0
jmp 0x1272d
movq %rax, %r14
movq 0x1a0(%rbx), %rdi
testq %rdi, %rdi
je 0x12748
movq 0x1b0(%rbx), %rsi
subq %rdi, %rsi
callq 0x32d0
movq 0x198(%rbx), %rdi
testq %rdi, %rdi
je 0x1275e
movl $0x30, %esi
callq 0x32d0
movq $0x0, 0x198(%rbx)
movq %r14, %rdi
callq 0x34b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/WaveObject.cpp
// Function: WaveObject::intersect_ray(Ray&, Eigen::Matrix<double, 3, 1, 0, 3, 1>&)
double WaveObject::intersect_ray(Ray& ray, Eigen::Vector3d &hit_normal){
    // Find max and min of search
    double near_edge = 0;
    double far_edge = 1;
    if (!bounding_box->ray_intersects(ray, near_edge, far_edge))
        return MISSED_T_VALUE;

    // Step along ray between max and min
    double t_value = step_search(ray, near_edge, far_edge);
    // //std::cout << "near&far: " << near_edge << ", " << far_edge << "\n" << "ray: \n" << ray.get_dir() << "\n\n\n";
    if (t_value >= near_edge && t_value <= far_edge){
        //std::cout << "Here\n";
        t_value = refine_search(ray, t_value);
        hit_normal = find_surf_norm(ray, t_value);
    } else{
        t_value = MISSED_T_VALUE;
    }
    //std::cout << t_value << "\n";
    return t_value;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x10(%rsp), %rdx
movq $0x0, (%rdx)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
leaq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movq 0x198(%rdi), %rdi
callq 0x6e7a
testb %al, %al
je 0x13005
movsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movq %r14, %rdi
movq %r15, %rsi
callq 0x1301a
ucomisd 0x10(%rsp), %xmm0
jb 0x13005
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jb 0x13005
movq %r14, %rdi
movq %r15, %rsi
callq 0x130ea
movsd %xmm0, 0x18(%rsp)
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x131a4
movaps (%r12), %xmm0
movups %xmm0, (%rbx)
movsd 0x10(%r12), %xmm0
movsd %xmm0, 0x10(%rbx)
movsd 0x18(%rsp), %xmm0
jmp 0x1300e
movsd 0x188(%r14), %xmm0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/WaveObject.cpp
// Function: WaveObject::step_search(Ray&, double, double)
double WaveObject::step_search(Ray& ray, double start, double end){
    double current_pos = start;
    Eigen::Vector3d ray_pos = ray.get_ray_loc(start);
    bool start_side = is_above_wave(ray_pos);
    do {
        current_pos += search_step;
        ray_pos = ray.get_ray_loc(current_pos);
    } while (current_pos < end && is_above_wave(ray_pos) == start_side);

    return current_pos;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x90, %rsp
movsd %xmm1, 0x8(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movsd %xmm0, (%rsp)
callq 0x15c8c
movq 0x10(%r15), %rax
leaq 0x70(%rsp), %rsi
movq %rax, 0x10(%rsi)
movaps (%r15), %xmm0
movaps %xmm0, (%rsi)
movq %r14, %rdi
callq 0x1337e
movl %eax, %ebp
leaq 0x50(%rsp), %r15
leaq 0x30(%rsp), %r12
movsd (%rsp), %xmm0
addsd 0x1b8(%r14), %xmm0
movsd %xmm0, (%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x15c8c
movaps 0x50(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
movsd 0x60(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x8(%rsp), %xmm0
ucomisd (%rsp), %xmm0
jbe 0x130d4
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
movaps 0x10(%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x1337e
cmpb %al, %bpl
je 0x1306f
movsd (%rsp), %xmm0
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/IsaacLaw12[P]RayTracer/./src/WaveObject.cpp
// Function: WaveObject::refine_search(Ray&, double)
double WaveObject::refine_search(Ray &ray, double search_end){
    // Use Binary search to find a precise t_value that is close to where the intersection occurs
    double search_start = search_end - search_step;
    bool start_side = is_above_wave(ray.get_ray_loc(search_start));
    double step_middle;

    for (int i=0; i<48; i++){
        step_middle = (search_end - search_start) / 2 + search_start;
        bool middle_side = is_above_wave(ray.get_ray_loc(step_middle));
        if (middle_side == start_side){
            search_start = step_middle;
        } else{
            search_end = step_middle;
        }
    }
    return step_middle;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
subsd 0x1b8(%rdi), %xmm0
leaq 0x38(%rsp), %r15
movq %r15, %rdi
movsd %xmm0, 0x10(%rsp)
callq 0x15c8c
movq %r14, %rdi
movq %r15, %rsi
callq 0x1337e
movsd 0x8(%rsp), %xmm0
movl %eax, %ebp
movl $0x30, %r12d
leaq 0x20(%rsp), %r15
movsd %xmm0, 0x8(%rsp)
movsd 0x10(%rsp), %xmm1
subsd %xmm1, %xmm0
mulsd 0x579d(%rip), %xmm0     # 0x188f0
addsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x15c8c
movq %r14, %rdi
movq %r15, %rsi
callq 0x1337e
movsd 0x18(%rsp), %xmm1
xorb %bpl, %al
movapd %xmm1, %xmm0
jne 0x1318e
movsd %xmm1, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
decl %r12d
jne 0x1313b
movapd %xmm1, %xmm0
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq