LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6e82
testb %al, %al
je 0x12fe5
movsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movq %r14, %rdi
movq %r15, %rsi
callq 0x12ffa
ucomisd 0x10(%rsp), %xmm0
jb 0x12fe5
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jb 0x12fe5
movq %r14, %rdi
movq %r15, %rsi
callq 0x130ca
movsd %xmm0, 0x18(%rsp)
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x13184
movups (%rbx), %xmm0
movaps (%r12), %xmm1
movups %xmm1, (%rbx)
movaps %xmm0, (%r12)
movsd 0x10(%r12), %xmm0
movsd 0x10(%rbx), %xmm1
movsd %xmm1, 0x10(%r12)
movsd %xmm0, 0x10(%rbx)
movsd 0x18(%rsp), %xmm0
jmp 0x12fee
movsd 0x188(%r14), %xmm0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x15cc0
movq 0x10(%r15), %rax
leaq 0x70(%rsp), %rsi
movq %rax, 0x10(%rsi)
movaps (%r15), %xmm0
movaps %xmm0, (%rsi)
movq %r14, %rdi
callq 0x1335e
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 0x15cc0
movaps 0x50(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
movsd 0x60(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x8(%rsp), %xmm0
ucomisd (%rsp), %xmm0
jbe 0x130b4
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
movaps 0x10(%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x1335e
cmpb %al, %bpl
je 0x1304f
movsd (%rsp), %xmm0
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x15cc0
movq %r14, %rdi
movq %r15, %rsi
callq 0x1335e
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 0x57bd(%rip), %xmm0     # 0x188f0
addsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x15cc0
movq %r14, %rdi
movq %r15, %rsi
callq 0x1335e
movsd 0x18(%rsp), %xmm1
xorb %bpl, %al
movapd %xmm1, %xmm0
jne 0x1316e
movsd %xmm1, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
decl %r12d
jne 0x1311b
movapd %xmm1, %xmm0
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/IsaacLaw12[P]RayTracer/./src/WaveObject.cpp
// Function: WaveObject::is_above_wave(Eigen::Matrix<double, 3, 1, 0, 3, 1>)
bool WaveObject::is_above_wave(Eigen::Vector3d loc){
    // Return true if loc is in the positive direction along the surface normal from the corresponding place on the wave
    double offset_one = 0;
    double offset_two = 0;
    find_offsets(loc, offset_one, offset_two);

    Eigen::Vector3d wave_location = wave_function(offset_one, offset_two);
    Eigen::Vector3d wave_p_norm = wave_location + surface_normal;
    Eigen::Vector3d wave_n_norm = wave_location - surface_normal;
    // norm() returns the magnitude of the vector
    double p_diff = (loc - wave_p_norm).norm();
    double n_diff = (loc - wave_n_norm).norm();
    return p_diff < n_diff;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movupd (%rsi), %xmm2
movsd 0x10(%rsi), %xmm1
movupd 0x1e0(%rdi), %xmm0
subpd %xmm0, %xmm2
movupd 0x210(%rdi), %xmm0
movupd 0x228(%rdi), %xmm3
subsd 0x1f0(%rdi), %xmm1
mulpd %xmm2, %xmm0
movapd %xmm0, %xmm4
unpckhpd %xmm0, %xmm4            # xmm4 = xmm4[1],xmm0[1]
addsd %xmm0, %xmm4
movsd 0x220(%rdi), %xmm0
mulsd %xmm1, %xmm0
addsd %xmm4, %xmm0
mulpd %xmm2, %xmm3
movapd %xmm3, %xmm2
unpckhpd %xmm3, %xmm2            # xmm2 = xmm2[1],xmm3[1]
addsd %xmm3, %xmm2
mulsd 0x238(%rdi), %xmm1
addsd %xmm2, %xmm1
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x134fc
movapd (%r15), %xmm1
movupd 0x240(%r14), %xmm2
movapd %xmm1, %xmm3
addpd %xmm2, %xmm3
movsd 0x10(%r15), %xmm0
movsd 0x250(%r14), %xmm4
movapd %xmm0, %xmm5
addsd %xmm4, %xmm5
subpd %xmm2, %xmm1
subsd %xmm4, %xmm0
movupd (%rbx), %xmm2
movapd %xmm2, %xmm4
subpd %xmm3, %xmm4
mulpd %xmm4, %xmm4
movapd %xmm4, %xmm3
unpckhpd %xmm4, %xmm3            # xmm3 = xmm3[1],xmm4[1]
addsd %xmm4, %xmm3
movsd 0x10(%rbx), %xmm4
movapd %xmm4, %xmm6
subsd %xmm5, %xmm6
mulsd %xmm6, %xmm6
addsd %xmm3, %xmm6
xorps %xmm3, %xmm3
sqrtsd %xmm6, %xmm3
subpd %xmm1, %xmm2
mulpd %xmm2, %xmm2
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
subsd %xmm0, %xmm4
mulsd %xmm4, %xmm4
addsd %xmm1, %xmm4
xorps %xmm0, %xmm0
sqrtsd %xmm4, %xmm0
ucomisd %xmm3, %xmm0
seta %al
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/IsaacLaw12[P]RayTracer/./src/WaveObject.cpp
// Function: WaveObject::wave_function(double, double)
Eigen::Vector3d WaveObject::wave_function(double offset_one, double offset_two){
    double current_time = time / 60;
    double total = 0;
    Eigen::Vector3d point = first_corner + offset_one * direction_one + offset_two * direction_two;
    // direction one waves
    for (auto wave:component_waves){
        //double sine = sin(offset_one * offset_two + time);
        double sine = (sin(wave.direction.dot(point)*wave.frequency + current_time*wave.phase_constant)+1)/2;
        total += wave_height * wave.amplitude * pow(sine, 2);
    }
    total = total / component_waves.size();
    Eigen::Vector3d result = point + total * surface_normal;
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movupd 0x1e0(%rsi), %xmm4
movapd %xmm0, %xmm2
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
movupd 0x210(%rsi), %xmm3
mulpd %xmm2, %xmm3
addpd %xmm4, %xmm3
movapd %xmm1, %xmm2
unpcklpd %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0]
movupd 0x228(%rsi), %xmm4
mulpd %xmm2, %xmm4
addpd %xmm3, %xmm4
mulsd 0x220(%rsi), %xmm0
addsd 0x1f0(%rsi), %xmm0
mulsd 0x238(%rsi), %xmm1
addsd %xmm0, %xmm1
movq 0x1a0(%rsi), %r15
movq 0x1a8(%rsi), %r12
cmpq %r12, %r15
je 0x13639
movsd 0x190(%r14), %xmm0
divsd 0x538f(%rip), %xmm0     # 0x18918
movsd %xmm0, (%rsp)
xorpd %xmm3, %xmm3
movapd %xmm1, 0x20(%rsp)
movapd %xmm4, 0x10(%rsp)
movapd %xmm3, 0x30(%rsp)
movupd (%r15), %xmm0
movsd 0x18(%r15), %xmm2
movsd %xmm2, 0x8(%rsp)
mulpd %xmm4, %xmm0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
movsd 0x10(%r15), %xmm0
mulsd %xmm1, %xmm0
addsd %xmm2, %xmm0
movsd 0x28(%r15), %xmm1
mulsd (%rsp), %xmm1
mulsd 0x20(%r15), %xmm0
addsd %xmm1, %xmm0
callq 0x3090
movapd 0x30(%rsp), %xmm3
movapd 0x10(%rsp), %xmm4
movapd 0x20(%rsp), %xmm1
addsd 0x2a29(%rip), %xmm0     # 0x16030
mulsd 0x52e1(%rip), %xmm0     # 0x188f0
movsd 0x8(%rsp), %xmm2
mulsd 0x1c0(%r14), %xmm2
mulsd %xmm0, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm0, %xmm3
addq $0x30, %r15
cmpq %r12, %r15
jne 0x1359e
jmp 0x1363d
xorpd %xmm3, %xmm3
movq 0x1a8(%r14), %rax
subq 0x1a0(%r14), %rax
sarq $0x4, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rcx
movq %rcx, %xmm0
punpckldq 0x5266(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x526e(%rip), %xmm0     # 0x188e0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
divsd %xmm2, %xmm3
movapd %xmm3, %xmm0
unpcklpd %xmm3, %xmm0            # xmm0 = xmm0[0],xmm3[0]
movupd 0x240(%r14), %xmm2
mulpd %xmm0, %xmm2
addpd %xmm2, %xmm4
movupd %xmm4, (%rbx)
mulsd 0x250(%r14), %xmm3
addsd %xmm3, %xmm1
movsd %xmm1, 0x10(%rbx)
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/IsaacLaw12[P]RayTracer/./src/WaveObject.cpp
// Function: WaveObject::find_min_max(Eigen::Matrix<double, 3, 1, 0, 3, 1>&, Eigen::Matrix<double, 3, 1, 0, 3, 1>&)
void WaveObject::find_min_max(Eigen::Vector3d &min, Eigen::Vector3d &max){
    // On the bounded 2d wave space find the min and max x,y,z values
    double safety_margin = 2;
    for (int dir_one=0; dir_one<=1; dir_one++){
        for (int dir_two=0; dir_two<=1; dir_two++){
            Eigen::Vector3d current = first_corner + dir_one*side_len_one*direction_one
                                                   + dir_two*side_len_two*direction_two;
            for (int i=1; i<=2; i++){
                int sign = 3 - i * 2;  // Extract 1 or -1
                Eigen::Vector3d with_wave = current + sign * surface_normal * wave_height * safety_margin;
                extract_vector_extremes(with_wave, min, max);
            }

        }
    }
}

// Assembly:
xorl %eax, %eax
xorpd %xmm0, %xmm0
movsd 0x2958(%rip), %xmm1     # 0x16030
xorpd %xmm2, %xmm2
xorl %ecx, %ecx
movsd 0x1d0(%rdi), %xmm5
mulsd %xmm0, %xmm5
movsd 0x1d8(%rdi), %xmm3
mulsd %xmm2, %xmm3
movapd %xmm5, %xmm4
unpcklpd %xmm5, %xmm4            # xmm4 = xmm4[0],xmm5[0]
movupd 0x1e0(%rdi), %xmm6
movupd 0x210(%rdi), %xmm7
mulpd %xmm4, %xmm7
addpd %xmm6, %xmm7
movupd 0x228(%rdi), %xmm6
movapd %xmm3, %xmm4
unpcklpd %xmm3, %xmm4            # xmm4 = xmm4[0],xmm3[0]
mulpd %xmm6, %xmm4
addpd %xmm7, %xmm4
mulsd 0x220(%rdi), %xmm5
addsd 0x1f0(%rdi), %xmm5
mulsd 0x238(%rdi), %xmm3
addsd %xmm5, %xmm3
movl $0x1, %r8d
movl $0x3, %r10d
subl %r8d, %r10d
subl %r8d, %r10d
xorps %xmm5, %xmm5
cvtsi2sd %r10d, %xmm5
movsd 0x1c0(%rdi), %xmm6
movapd %xmm5, %xmm7
unpcklpd %xmm5, %xmm7            # xmm7 = xmm7[0],xmm5[0]
movupd 0x240(%rdi), %xmm8
mulsd 0x250(%rdi), %xmm5
mulpd %xmm7, %xmm8
mulsd %xmm6, %xmm5
unpcklpd %xmm6, %xmm6            # xmm6 = xmm6[0,0]
mulpd %xmm8, %xmm6
addpd %xmm6, %xmm6
addpd %xmm4, %xmm6
addsd %xmm5, %xmm5
addsd %xmm3, %xmm5
movapd %xmm6, -0x18(%rsp)
movsd %xmm5, -0x8(%rsp)
xorl %r9d, %r9d
movsd -0x18(%rsp,%r9,8), %xmm5
movsd (%rsi,%r9,8), %xmm6
ucomisd %xmm5, %xmm6
jbe 0x137cf
movsd %xmm5, (%rsi,%r9,8)
ucomisd (%rdx,%r9,8), %xmm5
jbe 0x137dd
movsd %xmm5, (%rdx,%r9,8)
incq %r9
cmpq $0x3, %r9
jne 0x137b6
incl %r8d
cmpl $0x3, %r8d
jne 0x13750
addsd %xmm1, %xmm2
leal 0x1(%rcx), %r8d
testl %ecx, %ecx
movl %r8d, %ecx
je 0x136de
addsd %xmm1, %xmm0
leal 0x1(%rax), %ecx
testl %eax, %eax
movl %ecx, %eax
je 0x136d8
retq
// File: /workspace/github_cpp_makefile_star2_O1/IsaacLaw12[P]RayTracer/./src/WaveObject.cpp
// Function: WaveObject::extract_vector_extremes(Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1>&, Eigen::Matrix<double, 3, 1, 0, 3, 1>&)
void WaveObject::extract_vector_extremes(Eigen::Vector3d original, Eigen::Vector3d &min, Eigen::Vector3d &max){
    // Iterate original and elementwise update min and max if a smaller or larger value is found
    for (int i=0; i<=2; i++){
        if (original(i) < min(i))
            min(i) = original(i);
        if (original(i) > max(i))
            max(i) = original(i);
    }
}

// Assembly:
xorl %eax, %eax
movsd (%rsi,%rax,8), %xmm0
movsd (%rdx,%rax,8), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x1382f
movsd %xmm0, (%rdx,%rax,8)
movsd (%rsi,%rax,8), %xmm0
ucomisd (%rcx,%rax,8), %xmm0
jbe 0x13840
movsd %xmm0, (%rcx,%rax,8)
incq %rax
cmpq $0x3, %rax
jne 0x1381a
retq
// File: /workspace/github_cpp_makefile_star2_O1/IsaacLaw12[P]RayTracer/./src/AnimatedSphere.cpp
// Function: AnimatedSphere::add_animation_section(int, int, std::vector<double, std::allocator<double>>)
void AnimatedSphere::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++){
        sp_frame_setting current;
        current.frame_number = section_start + i - 1;
        current.center_change = Eigen::Vector3d(single_frame_transform[0], single_frame_transform[1], single_frame_transform[2]);
        current.radius_change = single_frame_transform[3];
        frame_steps.push_back(current);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edx, %r13d
subl %esi, %r13d
je 0x14269
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
leaq 0x38(%rsp), %r12
cvtsi2sd %r13d, %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x28(%rsp), %r15
movq %r15, %rdi
movq %rcx, %rsi
callq 0x7a96
leaq 0x10(%rsp), %rdi
movsd 0x8(%rsp), %xmm0
movq %r15, %rdx
callq 0x142a4
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x14207
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
testl %r13d, %r13d
jle 0x14252
leaq 0x20(%rsp), %r12
addq $0x58, %r14
leaq 0x40(%rsp), %r15
movl %ebp, 0x40(%rsp)
movq 0x10(%rsp), %rax
movups (%rax), %xmm0
movsd 0x10(%rax), %xmm1
movups %xmm0, 0x48(%rsp)
movsd %xmm1, 0x58(%rsp)
movsd 0x18(%rax), %xmm0
movsd %xmm0, 0x60(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x14442
incl %ebp
cmpl %ebp, %ebx
jne 0x1421a
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x14269
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x28(%rsp), %rdi
jmp 0x1428a
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1429b
movq (%r12), %rsi
subq %rdi, %rsi
callq 0x32d0
movq %rbx, %rdi
callq 0x34b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/IsaacLaw12[P]RayTracer/./src/AnimatedSphere.cpp
// Function: AnimatedSphere::fraction_of_transform(double, std::vector<double, std::allocator<double>>)
std::vector<double> AnimatedSphere::fraction_of_transform(double divide_by, std::vector<double> transform_floats){
    // transform_floats should be 8 long
    std::vector<double> result;
    for (auto i:transform_floats)
        std::cout << i << std::endl;
    for (int i=0; i<4; i++){
        double temp = transform_floats[i];
        temp = temp / divide_by;
        result.push_back(temp);
    }
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
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)
movq (%rdx), %r13
movq 0x8(%rdx), %rbp
cmpq %rbp, %r13
je 0x14322
movq 0xbce7(%rip), %r15      # 0x1ffc8
movsd (%r13), %xmm0
movq %r15, %rdi
callq 0x3410
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x32b0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
addq $0x8, %r13
cmpq %rbp, %r13
jne 0x142e1
xorl %r12d, %r12d
leaq 0x10(%rsp), %r15
movq (%r14), %rax
movsd (%rax,%r12,8), %xmm0
divsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x14357
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x14362
movq %rbx, %rdi
movq %r15, %rdx
callq 0x7c5c
incq %r12
cmpq $0x4, %r12
jne 0x1432a
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1437f
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x14396
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x32d0
movq %r14, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O1/IsaacLaw12[P]RayTracer/./src/OctTree.cpp
// Function: OctTree::OctTree(Eigen::Matrix<double, -1, -1, 0, -1, -1>&, Eigen::Matrix<int, -1, -1, 0, -1, -1>&, int)
OctTree::OctTree(Eigen::MatrixXd& verts, Eigen::MatrixXi& faces, int recursionLimit)
    : Vertices(verts), Faces(faces)
{
    // Constructor called directly by the Model object
    recursion_limit = recursionLimit;
    find_corners();
    center = (max_corner-min_corner) / 2 + min_corner;
    // The first box should surround the entire model, so all faces are passed.
    for(int i=0;i<Faces.cols();i++){
        contained_faces.insert(i);
    }
    subdivide_box();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
callq 0x6e42
movq %r15, 0x30(%rbx)
movq %r14, 0x38(%rbx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x40(%rbx)
xorl %eax, %eax
movq %rax, 0x50(%rbx)
leaq 0x58(%rbx), %r14
leaq 0x60(%rbx), %rcx
movl $0x0, 0x60(%rbx)
movq %rax, 0x68(%rbx)
movq %rcx, 0x70(%rbx)
movq %rcx, 0x78(%rbx)
movq %rax, 0x80(%rbx)
movl %ebp, 0xa0(%rbx)
movq %rbx, %rdi
callq 0x14756
movupd 0x18(%rbx), %xmm0
movupd (%rbx), %xmm1
subpd %xmm1, %xmm0
mulpd 0x4295(%rip), %xmm0     # 0x18950
addpd %xmm1, %xmm0
movupd %xmm0, 0x88(%rbx)
movsd 0x28(%rbx), %xmm0
movsd 0x10(%rbx), %xmm1
subsd %xmm1, %xmm0
mulsd 0x4213(%rip), %xmm0     # 0x188f0
addsd %xmm1, %xmm0
movsd %xmm0, 0x98(%rbx)
movl $0x0, 0x4(%rsp)
movq 0x38(%rbx), %rax
cmpq $0x0, 0x10(%rax)
jle 0x14722
leaq 0x4(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x15818
movslq 0x4(%rsp), %rax
incq %rax
movl %eax, 0x4(%rsp)
movq 0x38(%rbx), %rcx
cmpq %rax, 0x10(%rcx)
jg 0x14701
movq %rbx, %rdi
callq 0x1488e
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x14737
movq %rax, %r15
addq $0x40, %rbx
movq %r14, %rdi
callq 0xb1e8
movq %rbx, %rdi
callq 0xb172
movq %r15, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O1/IsaacLaw12[P]RayTracer/./src/OctTree.cpp
// Function: OctTree::find_corners()
void  OctTree::find_corners(){
    double min_val = std::numeric_limits<double>::lowest();
    double max_val = std::numeric_limits<double>::max();
    max_corner << min_val, min_val, min_val;
    min_corner << max_val, max_val, max_val;
    calculate_bounding();
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movabsq $-0x10000000000001, %rax # imm = 0xFFEFFFFFFFFFFFFF
leaq 0x28(%rsp), %rsi
movq %rax, (%rsi)
movabsq $0x7fefffffffffffff, %rcx # imm = 0x7FEFFFFFFFFFFFFF
movq %rcx, 0x20(%rsp)
leaq 0x18(%rdi), %rcx
movq %rsp, %rdi
movq %rcx, (%rdi)
movq $0x0, 0x8(%rdi)
movl $0x1, %ecx
movq %rcx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %rax, 0x18(%rbx)
callq 0x5b26
leaq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0x5b26
movq 0x18(%rsp), %rax
addq 0x8(%rsp), %rax
cmpq $0x3, %rax
jne 0x1482c
cmpq $0x1, 0x10(%rsp)
jne 0x1482c
movq %rsp, %rdi
movq %rbx, (%rdi)
movq $0x0, 0x8(%rdi)
movl $0x1, %eax
movq %rax, 0x10(%rdi)
movq %rax, 0x18(%rdi)
leaq 0x20(%rsp), %rsi
movsd (%rsi), %xmm0
movsd %xmm0, (%rbx)
callq 0x5b26
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x5b26
movq 0x18(%rsp), %rax
addq 0x8(%rsp), %rax
cmpq $0x3, %rax
jne 0x1482c
cmpq $0x1, 0x10(%rsp)
jne 0x1482c
movq %rbx, %rdi
callq 0x153d4
addq $0x30, %rsp
popq %rbx
retq
leaq 0x2115(%rip), %rdi      # 0x16948
leaq 0x21ac(%rip), %rsi      # 0x169e6
leaq 0x21cf(%rip), %rcx      # 0x16a10
movl $0x78, %edx
callq 0x31a0
movq 0x18(%rsp), %rcx
addq 0x8(%rsp), %rcx
cmpq $0x3, %rcx
jne 0x14863
cmpq $0x1, 0x10(%rsp)
je 0x14880
callq 0x371b
movq 0x18(%rsp), %rcx
addq 0x8(%rsp), %rcx
cmpq $0x3, %rcx
jne 0x14888
cmpq $0x1, 0x10(%rsp)
jne 0x14888
movq %rax, %rdi
callq 0x34b0
callq 0x36fd
nop
// File: /workspace/github_cpp_makefile_star2_O1/IsaacLaw12[P]RayTracer/./src/OctTree.cpp
// Function: OctTree::OctTree(OctTree*, int, Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1>)
OctTree::OctTree(OctTree* parent_bb, int recursionLimit, Eigen::Vector3d min, Eigen::Vector3d max)
    : Vertices(parent_bb->Vertices), Faces(parent_bb->Faces)
{
    // Constructor of sub boxes in the recursive tree
    recursion_limit = recursionLimit - 1;
    min_corner = min;
    max_corner = max;
    center = (max-min) / 2 + min;
    find_contained_faces(parent_bb->contained_faces);
    subdivide_box();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r8, %r12
movq %rcx, %r15
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x6e42
movq 0x30(%r14), %rax
movq %rax, 0x30(%rbx)
movq 0x38(%r14), %rax
movq %rax, 0x38(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rbx)
xorl %eax, %eax
movq %rax, 0x50(%rbx)
leaq 0x60(%rbx), %rcx
movl $0x0, 0x60(%rbx)
movq %rax, 0x68(%rbx)
movq %rcx, 0x70(%rbx)
movq %rcx, 0x78(%rbx)
movq %rax, 0x80(%rbx)
decl %ebp
movl %ebp, 0xa0(%rbx)
movups (%r15), %xmm0
movups %xmm0, (%rbx)
movsd 0x10(%r15), %xmm0
movsd %xmm0, 0x10(%rbx)
movups (%r12), %xmm0
movups %xmm0, 0x18(%rbx)
movsd 0x10(%r12), %xmm0
movsd %xmm0, 0x28(%rbx)
movupd (%r12), %xmm0
movupd (%r15), %xmm1
subpd %xmm1, %xmm0
mulpd 0x3d2a(%rip), %xmm0     # 0x18950
addpd %xmm1, %xmm0
movupd %xmm0, 0x88(%rbx)
movsd 0x10(%r12), %xmm0
movsd 0x10(%r15), %xmm1
subsd %xmm1, %xmm0
mulsd 0x3ca5(%rip), %xmm0     # 0x188f0
leaq 0x40(%rbx), %r15
addsd %xmm1, %xmm0
movsd %xmm0, 0x98(%rbx)
addq $0x58, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x14c9a
movq %rbx, %rdi
callq 0x1488e
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
addq $0x58, %rbx
movq %rbx, %rdi
callq 0xb1e8
movq %r15, %rdi
callq 0xb172
movq %r14, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O1/IsaacLaw12[P]RayTracer/./src/OctTree.cpp
// Function: OctTree::find_contained_faces(std::set<int, std::less<int>, std::allocator<int>>&)
void OctTree::find_contained_faces(std::set<int> &parent_faces){
    Eigen::Vector3d point_a, point_b, point_c;
    for(auto face_num: parent_faces){
        point_a = get_vertex( Faces(0, face_num) - 1 );
        point_b = get_vertex( Faces(1, face_num) - 1 );
        point_c = get_vertex( Faces(2, face_num) - 1 );
        if (triangle_intersects(point_a, point_b, point_c)){
            contained_faces.insert(face_num);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %rbx
movq 0x18(%rsi), %r15
addq $0x8, %rbx
cmpq %rbx, %r15
je 0x14e12
movq %rdi, %r14
leaq 0x58(%rdi), %r12
leaq 0x10(%rsp), %r13
leaq 0x30(%rsp), %rbp
movslq 0x20(%r15), %rax
movl %eax, 0xc(%rsp)
testq %rax, %rax
js 0x14e24
movq 0x38(%r14), %rdx
movq 0x8(%rdx), %rcx
testq %rcx, %rcx
jle 0x14e24
cmpq %rax, 0x10(%rdx)
jle 0x14e24
movq (%rdx), %rdx
imulq %rax, %rcx
movl (%rdx,%rcx,4), %edx
decl %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x14e44
movaps 0x10(%rsp), %xmm0
movaps %xmm0, 0x70(%rsp)
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x80(%rsp)
movslq 0xc(%rsp), %rax
testq %rax, %rax
js 0x14e24
movq 0x38(%r14), %rdx
movq 0x8(%rdx), %rcx
cmpq $0x2, %rcx
jl 0x14e24
cmpq %rax, 0x10(%rdx)
jle 0x14e24
movq (%rdx), %rdx
imulq %rax, %rcx
movl 0x4(%rdx,%rcx,4), %edx
decl %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x14e44
movaps 0x10(%rsp), %xmm0
movaps %xmm0, 0x50(%rsp)
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x60(%rsp)
movslq 0xc(%rsp), %rax
testq %rax, %rax
js 0x14e24
movq 0x38(%r14), %rdx
movq 0x8(%rdx), %rcx
cmpq $0x3, %rcx
jl 0x14e24
cmpq %rax, 0x10(%rdx)
jle 0x14e24
movq (%rdx), %rdx
imulq %rax, %rcx
movl 0x8(%rdx,%rcx,4), %edx
decl %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x14e44
movaps 0x10(%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x40(%rsp)
movq %r14, %rdi
leaq 0x70(%rsp), %rsi
leaq 0x50(%rsp), %rdx
movq %rbp, %rcx
callq 0x14ea8
testb %al, %al
je 0x14dfe
movq %r12, %rdi
leaq 0xc(%rsp), %rsi
callq 0x15818
movq %r15, %rdi
callq 0x3300
movq %rax, %r15
cmpq %rbx, %rax
jne 0x14cd0
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1668(%rip), %rdi      # 0x16493
leaq 0x1696(%rip), %rsi      # 0x164c8
leaq 0x21b7(%rip), %rcx      # 0x16ff0
movl $0x16d, %edx            # imm = 0x16D
callq 0x31a0
nop
// File: /workspace/github_cpp_makefile_star2_O1/IsaacLaw12[P]RayTracer/./src/OctTree.cpp
// Function: OctTree::axis_test(Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&)
bool OctTree::axis_test(const Eigen::Vector3d& axis, const Eigen::Vector3d& e, const Eigen::Vector3d& v0, const Eigen::Vector3d& v1, const Eigen::Vector3d& v2, const Eigen::Vector3d& u0, const Eigen::Vector3d& u1, const Eigen::Vector3d& u2) {
    double p0 = v0.dot(axis);
    double p1 = v1.dot(axis);
    double p2 = v2.dot(axis);
    double r = e[0] * std::abs(u0.dot(axis)) +
               e[1] * std::abs(u1.dot(axis)) +
               e[2] * std::abs(u2.dot(axis));
    if (std::max(-max(p0, p1, p2), min(p0, p1, p2)) > r) return false;
    return true;
}

// Assembly:
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %r10
movupd (%rcx), %xmm0
movupd (%rsi), %xmm3
mulpd %xmm3, %xmm0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
movsd 0x10(%rsi), %xmm0
movsd 0x10(%rcx), %xmm1
mulsd %xmm0, %xmm1
addsd %xmm2, %xmm1
movupd (%r8), %xmm2
mulpd %xmm3, %xmm2
movupd (%r9), %xmm4
mulpd %xmm3, %xmm4
movapd %xmm4, %xmm5
unpcklpd %xmm2, %xmm5            # xmm5 = xmm5[0],xmm2[0]
unpckhpd %xmm2, %xmm4            # xmm4 = xmm4[1],xmm2[1]
addpd %xmm5, %xmm4
movapd %xmm0, %xmm5
unpcklpd %xmm0, %xmm5            # xmm5 = xmm5[0],xmm0[0]
movsd 0x10(%r9), %xmm2
movhpd 0x10(%r8), %xmm2        # xmm2 = xmm2[0],mem[0]
mulpd %xmm5, %xmm2
addpd %xmm4, %xmm2
movupd (%r10), %xmm4
mulpd %xmm3, %xmm4
movapd %xmm4, %xmm5
unpckhpd %xmm4, %xmm5            # xmm5 = xmm5[1],xmm4[1]
addsd %xmm4, %xmm5
movsd 0x10(%r10), %xmm4
mulsd %xmm0, %xmm4
addsd %xmm5, %xmm4
movapd 0xcdc(%rip), %xmm5      # 0x16020
movupd (%rdi), %xmm6
mulpd %xmm3, %xmm6
movapd %xmm6, %xmm7
unpckhpd %xmm6, %xmm7            # xmm7 = xmm7[1],xmm6[1]
addsd %xmm6, %xmm7
movsd 0x10(%rdi), %xmm6
mulsd %xmm0, %xmm6
addsd %xmm7, %xmm6
andpd %xmm5, %xmm6
mulsd 0x8(%rdx), %xmm6
andpd %xmm5, %xmm4
mulsd (%rdx), %xmm4
addsd %xmm6, %xmm4
movupd (%rax), %xmm6
mulpd %xmm3, %xmm6
movapd %xmm6, %xmm3
unpckhpd %xmm6, %xmm3            # xmm3 = xmm3[1],xmm6[1]
addsd %xmm6, %xmm3
mulsd 0x10(%rax), %xmm0
addsd %xmm3, %xmm0
andpd %xmm5, %xmm0
mulsd 0x10(%rdx), %xmm0
addsd %xmm4, %xmm0
movapd %xmm2, %xmm3
unpckhpd %xmm2, %xmm3            # xmm3 = xmm3[1],xmm2[1]
movapd %xmm2, %xmm4
maxsd %xmm3, %xmm4
maxsd %xmm1, %xmm4
xorpd 0x1b50(%rip), %xmm4     # 0x16f10
minsd %xmm3, %xmm2
minsd %xmm1, %xmm2
maxsd %xmm4, %xmm2
ucomisd %xmm0, %xmm2
setbe %al
retq
// File: /workspace/github_cpp_makefile_star2_O1/IsaacLaw12[P]RayTracer/./src/OctTree.cpp
// Function: OctTree::calculate_bounding()
void OctTree::calculate_bounding(){
    for(int i=0; i<Vertices.cols(); i++){
        Eigen::Vector3d vertex = get_vertex(i);
        if (vertex(0) < min_corner(0)){
            min_corner(0) = vertex(0);
        }
        if (vertex(1) < min_corner(1)){
            min_corner(1) = vertex(1);
        }
        if (vertex(2) < min_corner(2)){
            min_corner(2) = vertex(2);
        }
        if (vertex(0) > max_corner(0)){
            max_corner(0) = vertex(0);
        }
        if (vertex(1) > max_corner(1)){
            max_corner(1) = vertex(1);
        }
        if (vertex(2) > max_corner(2)){
            max_corner(2) = vertex(2);
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq 0x30(%rdi), %rax
cmpq $0x0, 0x10(%rax)
jle 0x15476
movq %rdi, %rbx
xorl %r14d, %r14d
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movl %r14d, %edx
callq 0x14e44
movsd 0x8(%rsp), %xmm0
movsd (%rbx), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x15419
movsd %xmm0, (%rbx)
movsd 0x10(%rsp), %xmm1
movsd 0x8(%rbx), %xmm2
ucomisd %xmm1, %xmm2
jbe 0x1542f
movsd %xmm1, 0x8(%rbx)
movsd 0x18(%rsp), %xmm2
movsd 0x10(%rbx), %xmm3
ucomisd %xmm2, %xmm3
jbe 0x15445
movsd %xmm2, 0x10(%rbx)
ucomisd 0x18(%rbx), %xmm0
jbe 0x15451
movsd %xmm0, 0x18(%rbx)
ucomisd 0x20(%rbx), %xmm1
jbe 0x1545d
movsd %xmm1, 0x20(%rbx)
ucomisd 0x28(%rbx), %xmm2
jbe 0x15469
movsd %xmm2, 0x28(%rbx)
incq %r14
movq 0x30(%rbx), %rax
cmpq %r14, 0x10(%rax)
jg 0x153f7
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/IsaacLaw12[P]RayTracer/./src/OctTree.cpp
// Function: OctTree::intersected_faces(Ray&)
std::set<int> OctTree::intersected_faces(Ray& ray){
    std::set<int> intersected_faces;
    if (!ray_intersects(ray)){
        return intersected_faces;
    }
    if (contained_boxes.size() > 0){
        for (std::unique_ptr<OctTree>& sub_bb: contained_boxes){
            std::set<int> hit_faces = sub_bb->intersected_faces(ray);
            intersected_faces.insert(hit_faces.begin(), hit_faces.end());
        }
    } else{
        intersected_faces = contained_faces;
    }
    return intersected_faces;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x8(%rdi), %rax
movl $0x0, 0x8(%rdi)
xorl %ecx, %ecx
movq %rcx, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
movq %rcx, 0x28(%rdi)
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x6e6a
testb %al, %al
je 0x1551b
movq 0x40(%r15), %r13
movq 0x48(%r15), %rbp
cmpq %r13, %rbp
je 0x1550c
leaq 0x10(%rsp), %r15
leaq 0x8(%rsp), %r12
movq (%r13), %rsi
movq %r12, %rdi
movq %r14, %rdx
callq 0x15480
movq 0x20(%rsp), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x15ad0
movq %r12, %rdi
callq 0xb1e8
addq $0x8, %r13
cmpq %rbp, %r13
jne 0x154da
jmp 0x1551b
addq $0x58, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x15590
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1552f
movq %rax, %r14
jmp 0x15541
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0xb1e8
movq %rbx, %rdi
callq 0xb1e8
movq %r14, %rdi
callq 0x34b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/calebstewart[P]md5/./examples/basic-string.cpp
// Function: main
int main(int argc, char** argv)
{
  char digest[33];
  unsigned char hash[16];

  // Write the calculated hash to `hash`
  MD5::hash("hello world\n", hash);
  // Retrieve the hex-encoded digest
  MD5::digest(hash, digest);

  std::cout << "md5(\"hello world\\n\") => \"" << digest << "\"\n";

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
leaq 0xe23(%rip), %rdi       # 0x3021
leaq -0x20(%rbp), %rbx
movq %rbx, %rsi
callq 0x208e
leaq -0x50(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21b2
movq 0x2db8(%rip), %rbx      # 0x4fd8
leaq 0xe07(%rip), %rsi       # 0x302e
movl $0x19, %edx
movq %rbx, %rdi
callq 0x1070
movq %r14, %rdi
callq 0x1030
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1070
leaq 0xdf7(%rip), %rsi       # 0x3048
movl $0x2, %edx
movq %rbx, %rdi
callq 0x1070
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/shanet[P]Crypto-Example/base64.cpp
// Function: base64Encode(unsigned char const*, unsigned long)
char* base64Encode(const unsigned char *message, const size_t length) {
  int encodedSize = 4 * ceil((double)length / 3);
  char *encodedMessage = (char*)malloc(encodedSize + 1);

  if(encodedMessage == NULL) {
    fprintf(stderr, "Failed to allocate memory\n");
    exit(1);
  }

  BIO *b64 = BIO_new(BIO_f_base64());
  BIO *bio = BIO_new(BIO_s_mem());
  bio = BIO_push(b64, bio);
  BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL);

  BIO_write(bio, message, length);
  BIO_flush(bio);

  BUF_MEM *bufferPtr;
  BIO_get_mem_ptr(bio, &bufferPtr);
  BIO_set_close(bio, BIO_CLOSE);

  // Add a NUL terminator
  memcpy(encodedMessage, (*bufferPtr).data, (*bufferPtr).length + 1);
  encodedMessage[(*bufferPtr).length] = '\0';

  BIO_free_all(bio);
  return encodedMessage;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rsi, %xmm1
punpckldq 0x1a1c(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
movq %rdi, %r15
subpd 0x1a21(%rip), %xmm1     # 0x4020
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x1a1d(%rip), %xmm0     # 0x4030
callq 0x2070
mulsd 0x1a18(%rip), %xmm0     # 0x4038
cvttsd2si %xmm0, %eax
incl %eax
movslq %eax, %rdi
callq 0x22b0
testq %rax, %rax
je 0x26ec
movq %rax, %rbx
callq 0x21e0
movq %rax, %rdi
callq 0x2340
movq %rax, %r12
callq 0x2180
movq %rax, %rdi
callq 0x2340
movq %r12, %rdi
movq %rax, %rsi
callq 0x2210
movq %rax, %r12
movq %rax, %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x2060
movq %r12, %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0x2230
movq %r12, %rdi
movl $0xb, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x20a0
movq %rsp, %r14
movq %r12, %rdi
movl $0x73, %esi
xorl %edx, %edx
movq %r14, %rcx
callq 0x20a0
movl $0x1, %edx
movq %r12, %rdi
movl $0x9, %esi
xorl %ecx, %ecx
callq 0x20a0
movq (%r14), %rax
movq (%rax), %r14
movq 0x8(%rax), %rsi
leaq 0x1(%r14), %rdx
movq %rbx, %rdi
callq 0x2160
movb $0x0, (%rbx,%r14)
movq %r12, %rdi
callq 0x20d0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x23d0
// File: /workspace/github_cpp_makefile_star2_O1/shanet[P]Crypto-Example/base64.cpp
// Function: base64Decode(char const*, unsigned long, unsigned char**)
int base64Decode(const char *encodedMessage, const size_t encodedMessageLength, unsigned char **decodedMessage) {
  int decodedLength = calculateDecodedLength(encodedMessage, encodedMessageLength);
  *decodedMessage = (unsigned char*)malloc(decodedLength + 1);

  if(*decodedMessage == NULL) {
    fprintf(stderr, "Failed to allocate memory\n");
    exit(1);
  }

  BIO *bio = BIO_new_mem_buf(encodedMessage, encodedMessageLength);
  BIO *b64 = BIO_new(BIO_f_base64());
  bio = BIO_push(b64, bio);
  BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL);

  // Add a NUL terminator
  decodedLength = BIO_read(bio, *decodedMessage, encodedMessageLength);
  (*decodedMessage)[decodedLength] = '\0';

  BIO_free_all(bio);

  return decodedLength;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorpd %xmm0, %xmm0
cmpb $0x3d, -0x1(%rdi,%rsi)
jne 0x2724
cmpb $0x3d, -0x2(%r15,%r14)
jne 0x271a
movsd 0x1926(%rip), %xmm0     # 0x4040
je 0x2724
movsd 0x1924(%rip), %xmm0     # 0x4048
cvtsi2sd %r14d, %xmm1
mulsd 0x191f(%rip), %xmm1     # 0x4050
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
incl %eax
movslq %eax, %rdi
callq 0x22b0
movq %rax, (%rbx)
testq %rax, %rax
je 0x27a9
movq %r15, %rdi
movl %r14d, %esi
callq 0x2080
movq %rax, %r15
callq 0x21e0
movq %rax, %rdi
callq 0x2340
movq %rax, %rdi
movq %r15, %rsi
callq 0x2210
movq %rax, %r15
movq %rax, %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x2060
movq (%rbx), %rsi
movq %r15, %rdi
movl %r14d, %edx
callq 0x2260
movq (%rbx), %rcx
movslq %eax, %rbx
movb $0x0, (%rcx,%rbx)
movq %r15, %rdi
callq 0x20d0
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
callq 0x23f5
// File: /workspace/github_cpp_makefile_star2_O1/shanet[P]Crypto-Example/base64.cpp
// Function: calculateDecodedLength(char const*, unsigned long)
int calculateDecodedLength(const char *encodedMessage, const size_t encodedMessageLength) {
  unsigned int padding = 0;

  // Check for trailing '=''s as padding
  if(encodedMessage[encodedMessageLength - 1] == '=' && encodedMessage[encodedMessageLength - 2] == '=') {
    padding = 2;
  } else if (encodedMessage[encodedMessageLength - 1] == '=') {
    padding = 1;
  }

  return (int)encodedMessageLength * 0.75 - padding;
}

// Assembly:
xorpd %xmm0, %xmm0
cmpb $0x3d, -0x1(%rdi,%rsi)
jne 0x27da
setne %al
cmpb $0x3d, -0x2(%rdi,%rsi)
sete %cl
jne 0x27ce
movsd 0x1872(%rip), %xmm0     # 0x4040
orb %cl, %al
jne 0x27da
movsd 0x186e(%rip), %xmm0     # 0x4048
cvtsi2sd %esi, %xmm1
mulsd 0x186a(%rip), %xmm1     # 0x4050
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/shanet[P]Crypto-Example/Crypto.cpp
// Function: Crypto::Crypto()
Crypto::Crypto() {
  localKeypair = NULL;
  remotePublicKey = NULL;

  #ifdef PSEUDO_CLIENT
    generateRsaKeypair(&remotePublicKey);
  #endif

  init();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorl %eax, %eax
movq %rax, 0x3a0b(%rip)      # 0x6208
movq %rax, (%rdi)
movq %rdi, %rsi
callq 0x2812
movq %rbx, %rdi
popq %rbx
jmp 0x286c
nop
// File: /workspace/github_cpp_makefile_star2_O1/shanet[P]Crypto-Example/Crypto.cpp
// Function: Crypto::generateRsaKeypair(evp_pkey_st**)
int Crypto::generateRsaKeypair(EVP_PKEY **keypair) {
  EVP_PKEY_CTX *context = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, NULL);

  if(EVP_PKEY_keygen_init(context) <= 0) {
    return FAILURE;
  }

  if(EVP_PKEY_CTX_set_rsa_keygen_bits(context, RSA_KEYLEN) <= 0) {
    return FAILURE;
  }

  if(EVP_PKEY_keygen(context, keypair) <= 0) {
    return FAILURE;
  }

  EVP_PKEY_CTX_free(context);

  return SUCCESS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movl $0x6, %edi
xorl %esi, %esi
callq 0x23b0
movq %rax, %r14
movq %rax, %rdi
callq 0x22c0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jle 0x2864
movq %r14, %rdi
movl $0x800, %esi            # imm = 0x800
callq 0x2170
testl %eax, %eax
jle 0x2864
movq %r14, %rdi
movq %r15, %rsi
callq 0x22a0
testl %eax, %eax
jle 0x2864
movq %r14, %rdi
callq 0x2330
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/shanet[P]Crypto-Example/Crypto.cpp
// Function: Crypto::init()
int Crypto::init() {
  // Initalize contexts
  rsaEncryptContext = EVP_CIPHER_CTX_new();
  aesEncryptContext = EVP_CIPHER_CTX_new();

  rsaDecryptContext = EVP_CIPHER_CTX_new();
  aesDecryptContext = EVP_CIPHER_CTX_new();

  // Check if any of the contexts initializations failed
  if(rsaEncryptContext == NULL || aesEncryptContext == NULL || rsaDecryptContext == NULL || aesDecryptContext == NULL) {
    return FAILURE;
  }

  /* Don't set key or IV right away; we want to set lengths */
  EVP_CIPHER_CTX_init(aesEncryptContext);
  EVP_CIPHER_CTX_init(aesDecryptContext);

  EVP_CipherInit_ex(aesEncryptContext, EVP_aes_256_cbc(), NULL, NULL, NULL, 1);

  /* Now we can set key and IV lengths */
  aesKeyLength = EVP_CIPHER_CTX_key_length(aesEncryptContext);
  aesIvLength = EVP_CIPHER_CTX_iv_length(aesEncryptContext);

  // Generate RSA and AES keys
  generateRsaKeypair(&localKeypair);
  generateAesKey(&aesKey, &aesIv);

  return SUCCESS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x2150
movq %rax, 0x8(%rbx)
callq 0x2150
movq %rax, 0x10(%rbx)
callq 0x2150
movq %rax, 0x18(%rbx)
callq 0x2150
movq %rax, 0x20(%rbx)
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
cmpq $0x0, 0x8(%rbx)
je 0x2933
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
sete %cl
cmpq $0x0, 0x18(%rbx)
sete %dl
orb %cl, %dl
testq %rax, %rax
sete %al
orb %dl, %al
jne 0x2933
callq 0x2310
movq 0x20(%rbx), %rdi
callq 0x2310
movq 0x10(%rbx), %r15
callq 0x2130
xorl %r14d, %r14d
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0x21f0
movq 0x10(%rbx), %rdi
callq 0x21a0
cltq
movq %rax, 0x38(%rbx)
movq 0x10(%rbx), %rdi
callq 0x20f0
cltq
movq %rax, 0x40(%rbx)
leaq 0x38ea(%rip), %rsi      # 0x6208
callq 0x2812
leaq 0x28(%rbx), %rsi
leaq 0x30(%rbx), %rdx
movq %rbx, %rdi
callq 0x2a16
movl %r14d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/shanet[P]Crypto-Example/Crypto.cpp
// Function: Crypto::Crypto(unsigned char*, unsigned long)
Crypto::Crypto(unsigned char *remotePublicKey, size_t remotePublicKeyLength) {
  localKeypair = NULL;
  this->remotePublicKey = NULL;

  setRemotePublicKey(remotePublicKey, remotePublicKeyLength);
  init();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorl %eax, %eax
movq %rax, 0x38bf(%rip)      # 0x6208
movq %rax, (%rdi)
callq 0x295a
movq %rbx, %rdi
popq %rbx
jmp 0x286c
// File: /workspace/github_cpp_makefile_star2_O1/shanet[P]Crypto-Example/Crypto.cpp
// Function: Crypto::setRemotePublicKey(unsigned char*, unsigned long)
int Crypto::setRemotePublicKey(unsigned char *publicKey, size_t publicKeyLength) {
  BIO *bio = BIO_new(BIO_s_mem());

  if(BIO_write(bio, publicKey, publicKeyLength) != (int)publicKeyLength) {
    return FAILURE;
  }

  PEM_read_bio_PUBKEY(bio, &remotePublicKey, NULL, NULL);
  BIO_free_all(bio);

  return SUCCESS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
callq 0x2180
movq %rax, %rdi
callq 0x2340
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movl %r12d, %edx
callq 0x2230
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
cmpl %r12d, %eax
jne 0x29ae
xorl %r15d, %r15d
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2040
movq %r14, %rdi
callq 0x20d0
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/shanet[P]Crypto-Example/Crypto.cpp
// Function: Crypto::~Crypto()
Crypto::~Crypto() {
  EVP_PKEY_free(localKeypair);
  EVP_PKEY_free(remotePublicKey);

  EVP_CIPHER_CTX_free(rsaEncryptContext);
  EVP_CIPHER_CTX_free(aesEncryptContext);

  EVP_CIPHER_CTX_free(rsaDecryptContext);
  EVP_CIPHER_CTX_free(aesDecryptContext);

  free(aesKey);
  free(aesIv);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x383f(%rip), %rdi      # 0x6208
callq 0x2140
movq (%rbx), %rdi
callq 0x2140
movq 0x8(%rbx), %rdi
callq 0x2220
movq 0x10(%rbx), %rdi
callq 0x2220
movq 0x18(%rbx), %rdi
callq 0x2220
movq 0x20(%rbx), %rdi
callq 0x2220
movq 0x28(%rbx), %rdi
callq 0x2280
movq 0x30(%rbx), %rdi
popq %rbx
jmp 0x2280
movq %rax, %rdi
callq 0x2fb4
nop
// File: /workspace/github_cpp_makefile_star2_O1/shanet[P]Crypto-Example/Crypto.cpp
// Function: Crypto::rsaEncrypt(unsigned char const*, unsigned long, unsigned char**, unsigned char**, unsigned long*, unsigned char**, unsigned long*)
int Crypto::rsaEncrypt(const unsigned char *message, size_t messageLength, unsigned char **encryptedMessage, unsigned char **encryptedKey,
  size_t *encryptedKeyLength, unsigned char **iv, size_t *ivLength) {

  // Allocate memory for everything
  size_t encryptedMessageLength = 0;
  size_t blockLength = 0;

  *encryptedKey = (unsigned char*)malloc(EVP_PKEY_size(remotePublicKey));
  *iv = (unsigned char*)malloc(EVP_MAX_IV_LENGTH);
  *ivLength = EVP_MAX_IV_LENGTH;

  if(*encryptedKey == NULL || *iv == NULL) {
    return FAILURE;
  }

  *encryptedMessage = (unsigned char*)malloc(messageLength + EVP_MAX_IV_LENGTH);
  if(encryptedMessage == NULL) {
    return FAILURE;
  }

  // Encrypt it!
  if(!EVP_SealInit(rsaEncryptContext, EVP_aes_256_cbc(), encryptedKey, (int*)encryptedKeyLength, *iv, &remotePublicKey, 1)) {
    return FAILURE;
  }

  if(!EVP_SealUpdate(rsaEncryptContext, *encryptedMessage + encryptedMessageLength, (int*)&blockLength, (const unsigned char*)message, (int)messageLength)) {
    return FAILURE;
  }
  encryptedMessageLength += blockLength;

  if(!EVP_SealFinal(rsaEncryptContext, *encryptedMessage + encryptedMessageLength, (int*)&blockLength)) {
    return FAILURE;
  }
  encryptedMessageLength += blockLength;

  return (int)encryptedMessageLength;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, 0x20(%rsp)
movq %r8, %r13
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %rbp
movq %rdi, %r15
movq 0x60(%rsp), %r14
movq $0x0, 0x10(%rsp)
movq (%rdi), %rdi
callq 0x2350
movslq %eax, %rdi
callq 0x22b0
movq %rax, (%r13)
movl $0x10, %edi
callq 0x22b0
movq %rax, (%r14)
movq 0x68(%rsp), %rcx
movq $0x10, (%rcx)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x2b8f
cmpq $0x0, (%r13)
je 0x2b8f
movq %rbp, 0x18(%rsp)
leaq 0x10(%rbx), %rdi
callq 0x22b0
movq %r12, %r14
movq %rax, (%r12)
movq 0x8(%r15), %rbp
callq 0x2130
movq 0x60(%rsp), %rcx
movq (%rcx), %r8
movl $0x1, (%rsp)
movq %rbp, %rdi
movq %rax, %rsi
movq %r13, %rdx
movq 0x20(%rsp), %rcx
movq %r15, %r9
callq 0x2390
testl %eax, %eax
je 0x2b8a
movq 0x8(%r15), %rdi
movq (%r14), %rsi
leaq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
movl %ebx, %r8d
callq 0x2050
testl %eax, %eax
je 0x2b8a
leaq 0x10(%rsp), %rdx
movq (%rdx), %r12
movq 0x8(%r15), %rdi
movq (%r14), %rsi
addq %r12, %rsi
callq 0x2240
testl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
je 0x2b8f
addl 0x10(%rsp), %r12d
movl %r12d, %ecx
jmp 0x2b8f
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %ecx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq