LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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 0x13667
movsd 0x190(%r14), %xmm0
divsd 0x536f(%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 0x2a09(%rip), %xmm0     # 0x16030
mulsd 0x52c1(%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 0x135be
movq 0x1a0(%r14), %r15
movq 0x1a8(%r14), %rax
jmp 0x1366e
xorpd %xmm3, %xmm3
movq %r15, %rax
subq %r15, %rax
sarq $0x4, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rcx
movq %rcx, %xmm0
punpckldq 0x5240(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x5248(%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_O3/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:
xorpd %xmm1, %xmm1
movb $0x1, %al
movsd 0x2932(%rip), %xmm0     # 0x16030
movb $0x1, %cl
xorpd %xmm2, %xmm2
movsd 0x1d0(%rdi), %xmm4
mulsd 0x1d8(%rdi), %xmm2
mulsd %xmm1, %xmm4
movapd %xmm4, %xmm3
unpcklpd %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0]
movupd 0x1e0(%rdi), %xmm5
movupd 0x210(%rdi), %xmm6
mulpd %xmm3, %xmm6
addpd %xmm5, %xmm6
movupd 0x228(%rdi), %xmm5
movapd %xmm2, %xmm3
unpcklpd %xmm2, %xmm3            # xmm3 = xmm3[0],xmm2[0]
mulpd %xmm5, %xmm3
addpd %xmm6, %xmm3
mulsd 0x220(%rdi), %xmm4
addsd 0x1f0(%rdi), %xmm4
mulsd 0x238(%rdi), %xmm2
addsd %xmm4, %xmm2
movl $0x1, %r8d
movl $0x3, %r10d
subl %r8d, %r10d
subl %r8d, %r10d
xorps %xmm4, %xmm4
cvtsi2sd %r10d, %xmm4
movsd 0x1c0(%rdi), %xmm5
movapd %xmm4, %xmm6
unpcklpd %xmm4, %xmm6            # xmm6 = xmm6[0],xmm4[0]
movupd 0x240(%rdi), %xmm7
mulsd 0x250(%rdi), %xmm4
mulpd %xmm6, %xmm7
mulsd %xmm5, %xmm4
unpcklpd %xmm5, %xmm5            # xmm5 = xmm5[0,0]
mulpd %xmm7, %xmm5
addpd %xmm5, %xmm5
addpd %xmm3, %xmm5
addsd %xmm4, %xmm4
addsd %xmm2, %xmm4
movapd %xmm5, -0x18(%rsp)
movsd %xmm4, -0x8(%rsp)
xorl %r9d, %r9d
movsd -0x18(%rsp,%r9,8), %xmm4
movsd (%rsi,%r9,8), %xmm5
ucomisd %xmm4, %xmm5
jbe 0x137ee
movsd %xmm4, (%rsi,%r9,8)
ucomisd (%rdx,%r9,8), %xmm4
jbe 0x137fc
movsd %xmm4, (%rdx,%r9,8)
incq %r9
cmpq $0x3, %r9
jne 0x137d5
incl %r8d
cmpl $0x3, %r8d
jne 0x13772
movapd %xmm0, %xmm2
testb $0x1, %cl
movl $0x0, %ecx
jne 0x13704
movapd %xmm0, %xmm1
testb $0x1, %al
movl $0x0, %eax
jne 0x136fe
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x13852
movsd %xmm0, (%rdx,%rax,8)
movsd (%rsi,%rax,8), %xmm0
ucomisd (%rcx,%rax,8), %xmm0
jbe 0x1385e
movsd %xmm0, (%rcx,%rax,8)
incq %rax
cmpq $0x3, %rax
jne 0x13838
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x14259
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 0x7a94
leaq 0x10(%rsp), %rdi
movsd 0x8(%rsp), %xmm0
movq %r15, %rdx
callq 0x14294
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x141f7
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
testl %r13d, %r13d
jle 0x14242
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 0x14430
incl %ebp
cmpl %ebp, %ebx
jne 0x1420a
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x14259
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 0x1427a
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1428b
movq (%r12), %rsi
subq %rdi, %rsi
callq 0x32d0
movq %rbx, %rdi
callq 0x34b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x6e3a
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 0x1471e
movupd 0x18(%rbx), %xmm0
movupd (%rbx), %xmm1
subpd %xmm1, %xmm0
mulpd 0x42cd(%rip), %xmm0     # 0x18950
addpd %xmm1, %xmm0
movupd %xmm0, 0x88(%rbx)
movsd 0x28(%rbx), %xmm0
movsd 0x10(%rbx), %xmm1
subsd %xmm1, %xmm0
mulsd 0x424b(%rip), %xmm0     # 0x188f0
addsd %xmm1, %xmm0
movsd %xmm0, 0x98(%rbx)
movl $0x0, 0x4(%rsp)
movq 0x38(%rbx), %rax
cmpq $0x0, 0x10(%rax)
jle 0x146ea
leaq 0x4(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x157e2
movslq 0x4(%rsp), %rax
incq %rax
movl %eax, 0x4(%rsp)
movq 0x38(%rbx), %rcx
cmpq %rax, 0x10(%rcx)
jg 0x146c9
movq %rbx, %rdi
callq 0x14858
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x146ff
movq %rax, %r15
addq $0x40, %rbx
movq %r14, %rdi
callq 0xb148
movq %rbx, %rdi
callq 0xb0cc
movq %r15, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movabsq $-0x10000000000001, %rax # imm = 0xFFEFFFFFFFFFFFFF
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
movabsq $0x7fefffffffffffff, %r14 # imm = 0x7FEFFFFFFFFFFFFF
movq %r14, 0x28(%rsp)
leaq 0x18(%rdi), %rcx
leaq 0x8(%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 0x5b22
leaq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0x5b22
movq 0x20(%rsp), %rax
addq 0x10(%rsp), %rax
cmpq $0x3, %rax
jne 0x147f7
cmpq $0x1, 0x18(%rsp)
jne 0x147f7
leaq 0x8(%rsp), %rdi
movq %rbx, (%rdi)
movq $0x0, 0x8(%rdi)
movl $0x1, %eax
movq %rax, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq %r14, (%rbx)
leaq 0x28(%rsp), %rsi
callq 0x5b22
leaq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0x5b22
movq 0x20(%rsp), %rax
addq 0x10(%rsp), %rax
cmpq $0x3, %rax
jne 0x147f7
cmpq $0x1, 0x18(%rsp)
jne 0x147f7
movq %rbx, %rdi
callq 0x153a0
addq $0x38, %rsp
popq %rbx
popq %r14
retq
leaq 0x214a(%rip), %rdi      # 0x16948
leaq 0x21e1(%rip), %rsi      # 0x169e6
leaq 0x2204(%rip), %rcx      # 0x16a10
movl $0x78, %edx
callq 0x31a0
movq 0x20(%rsp), %rcx
addq 0x10(%rsp), %rcx
cmpq $0x3, %rcx
jne 0x1482e
cmpq $0x1, 0x18(%rsp)
je 0x1484b
callq 0x3719
movq 0x20(%rsp), %rcx
addq 0x10(%rsp), %rcx
cmpq $0x3, %rcx
jne 0x14853
cmpq $0x1, 0x18(%rsp)
jne 0x14853
movq %rax, %rdi
callq 0x34b0
callq 0x36fb
// File: /workspace/github_cpp_makefile_star2_O3/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 0x6e3a
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 0x3d5e(%rip), %xmm0     # 0x18950
addpd %xmm1, %xmm0
movupd %xmm0, 0x88(%rbx)
movsd 0x10(%r12), %xmm0
movsd 0x10(%r15), %xmm1
subsd %xmm1, %xmm0
mulsd 0x3cd9(%rip), %xmm0     # 0x188f0
leaq 0x40(%rbx), %r15
addsd %xmm1, %xmm0
movsd %xmm0, 0x98(%rbx)
addq $0x58, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x14c66
movq %rbx, %rdi
callq 0x14858
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
addq $0x58, %rbx
movq %rbx, %rdi
callq 0xb148
movq %r15, %rdi
callq 0xb0cc
movq %r14, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x14dde
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 0x14df0
movq 0x38(%r14), %rdx
movq 0x8(%rdx), %rcx
testq %rcx, %rcx
jle 0x14df0
cmpq %rax, 0x10(%rdx)
jle 0x14df0
movq (%rdx), %rdx
imulq %rax, %rcx
movl (%rdx,%rcx,4), %edx
decl %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x14e10
movaps 0x10(%rsp), %xmm0
movaps %xmm0, 0x70(%rsp)
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x80(%rsp)
movslq 0xc(%rsp), %rax
testq %rax, %rax
js 0x14df0
movq 0x38(%r14), %rdx
movq 0x8(%rdx), %rcx
cmpq $0x2, %rcx
jl 0x14df0
cmpq %rax, 0x10(%rdx)
jle 0x14df0
movq (%rdx), %rdx
imulq %rax, %rcx
movl 0x4(%rdx,%rcx,4), %edx
decl %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x14e10
movaps 0x10(%rsp), %xmm0
movaps %xmm0, 0x50(%rsp)
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x60(%rsp)
movslq 0xc(%rsp), %rax
testq %rax, %rax
js 0x14df0
movq 0x38(%r14), %rdx
movq 0x8(%rdx), %rcx
cmpq $0x3, %rcx
jl 0x14df0
cmpq %rax, 0x10(%rdx)
jle 0x14df0
movq (%rdx), %rdx
imulq %rax, %rcx
movl 0x8(%rdx,%rcx,4), %edx
decl %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x14e10
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 0x14e74
testb %al, %al
je 0x14dca
movq %r12, %rdi
leaq 0xc(%rsp), %rsi
callq 0x157e2
movq %r15, %rdi
callq 0x3300
movq %rax, %r15
cmpq %rbx, %rax
jne 0x14c9c
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x169c(%rip), %rdi      # 0x16493
leaq 0x16ca(%rip), %rsi      # 0x164c8
leaq 0x21eb(%rip), %rcx      # 0x16ff0
movl $0x16d, %edx            # imm = 0x16D
callq 0x31a0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x15442
movq %rdi, %rbx
xorl %r14d, %r14d
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movl %r14d, %edx
callq 0x14e10
movsd 0x8(%rsp), %xmm0
movsd (%rbx), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x153e5
movsd %xmm0, (%rbx)
movsd 0x10(%rsp), %xmm1
movsd 0x8(%rbx), %xmm2
ucomisd %xmm1, %xmm2
jbe 0x153fb
movsd %xmm1, 0x8(%rbx)
movsd 0x18(%rsp), %xmm2
movsd 0x10(%rbx), %xmm3
ucomisd %xmm2, %xmm3
jbe 0x15411
movsd %xmm2, 0x10(%rbx)
ucomisd 0x18(%rbx), %xmm0
jbe 0x1541d
movsd %xmm0, 0x18(%rbx)
ucomisd 0x20(%rbx), %xmm1
jbe 0x15429
movsd %xmm1, 0x20(%rbx)
ucomisd 0x28(%rbx), %xmm2
jbe 0x15435
movsd %xmm2, 0x28(%rbx)
incq %r14
movq 0x30(%rbx), %rax
cmpq %r14, 0x10(%rax)
jg 0x153c3
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x6e62
testb %al, %al
je 0x154e7
movq 0x40(%r15), %r13
movq 0x48(%r15), %rbp
cmpq %r13, %rbp
je 0x154d8
leaq 0x10(%rsp), %r15
leaq 0x8(%rsp), %r12
movq (%r13), %rsi
movq %r12, %rdi
movq %r14, %rdx
callq 0x1544c
movq 0x20(%rsp), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x15a9e
movq %r12, %rdi
callq 0xb148
addq $0x8, %r13
cmpq %rbp, %r13
jne 0x154a6
jmp 0x154e7
addq $0x58, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1555c
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x154fb
movq %rax, %r14
jmp 0x1550d
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0xb148
movq %rbx, %rdi
callq 0xb148
movq %r14, %rdi
callq 0x34b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xe2b(%rip), %rdi       # 0x3021
leaq -0x20(%rbp), %rbx
movq %rbx, %rsi
callq 0x2088
leaq -0x50(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21ac
movq 0x2dc0(%rip), %rbx      # 0x4fd8
leaq 0xe0f(%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 0xdff(%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_O3/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 0x27d2
cmpb $0x3d, -0x2(%rdi,%rsi)
jne 0x27ca
movsd 0x1878(%rip), %xmm0     # 0x4040
jmp 0x27d2
movsd 0x1876(%rip), %xmm0     # 0x4048
cvtsi2sd %esi, %xmm1
mulsd 0x1872(%rip), %xmm1     # 0x4050
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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, 0x3a13(%rip)      # 0x6208
movq %rax, (%rdi)
movq %rdi, %rsi
callq 0x280a
movq %rbx, %rdi
popq %rbx
jmp 0x2864
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x292b
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 0x292b
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 0x38f2(%rip), %rsi      # 0x6208
callq 0x280a
leaq 0x28(%rbx), %rsi
leaq 0x30(%rbx), %rdx
movq %rbx, %rdi
callq 0x2a0e
movl %r14d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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, 0x38c7(%rip)      # 0x6208
movq %rax, (%rdi)
callq 0x2952
movq %rbx, %rdi
popq %rbx
jmp 0x2864
// File: /workspace/github_cpp_makefile_star2_O3/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 0x29a6
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_O3/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 0x3847(%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 0x2fa0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2b87
cmpq $0x0, (%r13)
je 0x2b87
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 0x2b82
movq 0x8(%r15), %rdi
movq (%r14), %rsi
leaq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
movl %ebx, %r8d
callq 0x2050
testl %eax, %eax
je 0x2b82
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 0x2b87
addl 0x10(%rsp), %r12d
movl %r12d, %ecx
jmp 0x2b87
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %ecx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/shanet[P]Crypto-Example/Crypto.cpp
// Function: Crypto::rsaDecrypt(unsigned char*, unsigned long, unsigned char*, unsigned long, unsigned char*, unsigned long, unsigned char**)
int Crypto::rsaDecrypt(unsigned char *encryptedMessage, size_t encryptedMessageLength, unsigned char *encryptedKey,
  size_t encryptedKeyLength, unsigned char *iv, size_t ivLength, unsigned char **decryptedMessage) {

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

  *decryptedMessage = (unsigned char*)malloc(encryptedMessageLength + ivLength);
  if(*decryptedMessage == NULL) {
    return FAILURE;
  }

  #ifdef PSEUDO_CLIENT
    EVP_PKEY *key = remotePublicKey;
  #else
    EVP_PKEY *key = localKeypair;
  #endif

  // Decrypt it!
  if(!EVP_OpenInit(rsaDecryptContext, EVP_aes_256_cbc(), encryptedKey, encryptedKeyLength, iv, key)) {
    return FAILURE;
  }

  if(!EVP_OpenUpdate(rsaDecryptContext, (unsigned char*)*decryptedMessage + decryptedMessageLength, (int*)&blockLength, encryptedMessage, (int)encryptedMessageLength)) {
    return FAILURE;
  }
  decryptedMessageLength += blockLength;

  if(!EVP_OpenFinal(rsaDecryptContext, (unsigned char*)*decryptedMessage + decryptedMessageLength, (int*)&blockLength)) {
    return FAILURE;
  }
  decryptedMessageLength += blockLength;

  return (int)decryptedMessageLength;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movq %r8, %rbp
movq %rcx, %r12
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %r14
movq 0x58(%rsp), %rbx
movq $0x0, (%rsp)
movq 0x50(%rsp), %rdi
addq %rdx, %rdi
callq 0x22b0
movq %rax, (%rbx)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x2c5a
movq %r13, 0x8(%rsp)
movq (%r14), %rbx
movq 0x18(%r14), %r13
callq 0x2130
movq %r13, %rdi
movq %rax, %rsi
movq %r12, %rdx
movl %ebp, %ecx
movq 0x10(%rsp), %r8
movq %rbx, %r9
callq 0x21b0
testl %eax, %eax
je 0x2c55
movq 0x18(%r14), %rdi
movq 0x58(%rsp), %r12
movq (%r12), %rsi
movq %rsp, %rdx
movq 0x8(%rsp), %rcx
movl %r15d, %r8d
callq 0x2120
testl %eax, %eax
je 0x2c55
movq %rsp, %rdx
movq (%rdx), %rbx
movq 0x18(%r14), %rdi
movq (%r12), %rsi
addq %rbx, %rsi
callq 0x2250
testl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
je 0x2c5a
addl (%rsp), %ebx
movl %ebx, %ecx
jmp 0x2c5a
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %ecx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/shanet[P]Crypto-Example/Crypto.cpp
// Function: Crypto::aesDecrypt(unsigned char*, unsigned long, unsigned char**)
int Crypto::aesDecrypt(unsigned char *encryptedMessage, size_t encryptedMessageLength, unsigned char **decryptedMessage) {
  // Allocate memory for everything
  size_t decryptedMessageLength = 0;
  size_t blockLength = 0;

  *decryptedMessage = (unsigned char*)malloc(encryptedMessageLength);
  if(*decryptedMessage == NULL) {
    return FAILURE;
  }

  // Decrypt it!
  if(!EVP_DecryptInit_ex(aesDecryptContext, EVP_aes_256_cbc(), NULL, aesKey, aesIv)) {
    return FAILURE;
  }

  if(!EVP_DecryptUpdate(aesDecryptContext, (unsigned char*)*decryptedMessage, (int*)&blockLength, encryptedMessage, (int)encryptedMessageLength)) {
    return FAILURE;
  }
  decryptedMessageLength += blockLength;

  if(!EVP_DecryptFinal_ex(aesDecryptContext, (unsigned char*)*decryptedMessage + decryptedMessageLength, (int*)&blockLength)) {
    return FAILURE;
  }
  decryptedMessageLength += blockLength;

  return (int)decryptedMessageLength;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r15
movq $0x0, (%rsp)
movq %rdx, %rdi
callq 0x22b0
movq %rax, (%r14)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x2d97
movq 0x20(%r15), %rbp
callq 0x2130
movq 0x28(%r15), %rcx
movq 0x30(%r15), %r8
movq %rbp, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x2090
testl %eax, %eax
je 0x2d97
movq 0x20(%r15), %rdi
movq (%r14), %rsi
movq %rsp, %rdx
movq %r13, %rcx
movl %r12d, %r8d
callq 0x2120
testl %eax, %eax
je 0x2d97
movq %rsp, %rdx
movq (%rdx), %r12
movq 0x20(%r15), %rdi
movq (%r14), %rsi
addq %r12, %rsi
callq 0x20c0
testl %eax, %eax
je 0x2d97
addl (%rsp), %r12d
movl %r12d, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/shanet[P]Crypto-Example/Crypto.cpp
// Function: Crypto::writeKeyToFile(_IO_FILE*, int)
int Crypto::writeKeyToFile(FILE *file, int key) {
  switch(key) {
    case KEY_SERVER_PRI:
      if(!PEM_write_PrivateKey(file, localKeypair, NULL, NULL, 0, 0, NULL)) {
        return FAILURE;
      }
      break;

    case KEY_SERVER_PUB:
      if(!PEM_write_PUBKEY(file, localKeypair)) {
        return FAILURE;
      }
      break;

    case KEY_CLIENT_PUB:
      if(!PEM_write_PUBKEY(file, remotePublicKey)) {
        return FAILURE;
      }
      break;

    case KEY_AES:
      fwrite(aesKey, 1, aesKeyLength * 8, file);
      break;

    case KEY_AES_IV:
      fwrite(aesIv, 1, aesIvLength * 8, file);
      break;

    default:
      return FAILURE;
  }

  return SUCCESS;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x4, %edx
ja 0x2f98
movq %rsi, %rcx
movl %edx, %eax
leaq 0x1153(%rip), %rdx      # 0x4074
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x32d7(%rip), %rsi      # 0x6208
movq $0x0, (%rsp)
movq %rcx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2100
jmp 0x2f92
movl $0x40, %edx
movl $0x30, %eax
jmp 0x2f68
movq (%rdi), %rsi
jmp 0x2f8a
movl $0x38, %edx
movl $0x28, %eax
movq (%rdi,%rax), %rax
movq (%rdi,%rdx), %rdx
shlq $0x3, %rdx
movl $0x1, %esi
movq %rax, %rdi
callq 0x23a0
jmp 0x2f96
movq 0x327e(%rip), %rsi      # 0x6208
movq %rcx, %rdi
callq 0x2320
testl %eax, %eax
je 0x2f98
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/shanet[P]Crypto-Example/crypto_example.cpp
// Function: main
int main() {
  Crypto crypto;

  #ifdef PRINT_KEYS
    printKeys(&crypto);
  #endif

  while(!std::cin.eof()) {
    encryptRsa(&crypto);
    encryptAes(&crypto);
  }

  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x27e8
movq 0x301b(%rip), %r14      # 0x5fe0
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x20(%r14,%rax)
jne 0x2fe6
movq %rbx, %rdi
callq 0x300b
movq %rbx, %rdi
callq 0x3165
jmp 0x2fc5
movq %rsp, %rdi
callq 0x29b6
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x29b6
movq %rbx, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O3/shanet[P]Crypto-Example/crypto_example.cpp
// Function: encryptRsa(Crypto*)
void encryptRsa(Crypto *crypto) {
  // Get the message to encrypt
  string message = getMessage("Message to RSA encrypt: ");

  // Encrypt the message with RSA
  unsigned char *encryptedMessage = NULL;
  unsigned char *encryptedKey;
  unsigned char *iv;
  size_t encryptedKeyLength;
  size_t ivLength;

  // +1 on the string length argument because we want to encrypt the NUL terminator too
  int encryptedMessageLength = crypto->rsaEncrypt((const unsigned char*)message.c_str(), message.size()+1,
    &encryptedMessage, &encryptedKey, &encryptedKeyLength, &iv, &ivLength);

  if(encryptedMessageLength == -1) {
    fprintf(stderr, "Encryption failed\n");
    return;
  }

  // Print the encrypted message as a base64 string
  char* b64Message = base64Encode(encryptedMessage, encryptedMessageLength);
  printf("Encrypted message: %s\n", b64Message);

  // Decrypt the message
  char *decryptedMessage = NULL;

  int decryptedMessageLength = crypto->rsaDecrypt(encryptedMessage, (size_t)encryptedMessageLength,
    encryptedKey, encryptedKeyLength, iv, ivLength, (unsigned char**)&decryptedMessage);

  if(decryptedMessageLength == -1) {
    fprintf(stderr, "Decryption failed\n");
    return;
  }

  printf("Decrypted message: %s\n", decryptedMessage);

  // Clean up
  free(encryptedMessage);
  free(decryptedMessage);
  free(encryptedKey);
  free(iv);
  free(b64Message);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdi, %r14
leaq 0x106a(%rip), %rsi      # 0x4088
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
callq 0x3278
movq %rsp, %rcx
movq $0x0, (%rcx)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
incq %rdx
leaq 0x20(%rsp), %rax
leaq 0x10(%rsp), %r10
leaq 0x18(%rsp), %r8
leaq 0x28(%rsp), %r9
movq %r14, %rdi
pushq %rax
pushq %r10
callq 0x2a7e
addq $0x10, %rsp
cmpl $-0x1, %eax
je 0x312d
movq (%rsp), %rdi
movslq %eax, %r15
movq %r15, %rsi
callq 0x25dc
movq %rax, %rbx
leaq 0x1030(%rip), %rdi      # 0x40b4
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
leaq 0x8(%rsp), %rax
movq $0x0, (%rax)
movq (%rsp), %rsi
movq 0x18(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0x10(%rsp), %r9
movq %r14, %rdi
movq %r15, %rdx
pushq %rax
pushq 0x28(%rsp)
callq 0x2b98
addq $0x10, %rsp
cmpl $-0x1, %eax
je 0x3134
movq 0x8(%rsp), %rsi
leaq 0x100c(%rip), %rdi      # 0x40de
xorl %eax, %eax
callq 0x2030
movq (%rsp), %rdi
callq 0x2280
movq 0x8(%rsp), %rdi
callq 0x2280
movq 0x18(%rsp), %rdi
callq 0x2280
movq 0x10(%rsp), %rdi
callq 0x2280
movq %rbx, %rdi
callq 0x2280
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3123
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2200
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
callq 0x243c
jmp 0x3108
callq 0x241a
jmp 0x3108
jmp 0x313f
jmp 0x313f
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x315d
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O3/shanet[P]Crypto-Example/crypto_example.cpp
// Function: encryptAes(Crypto*)
void encryptAes(Crypto *crypto) {
  // Get the message to encrypt
  string message = getMessage("Message to AES encrypt: ");

  // Encrypt the message with AES
  unsigned char *encryptedMessage = NULL;
  int encryptedMessageLength = crypto->aesEncrypt((const unsigned char*)message.c_str(), message.size()+1, &encryptedMessage);

  if(encryptedMessageLength == -1) {
    fprintf(stderr, "Encryption failed\n");
    return;
  }

  // Print the encrypted message as a base64 string
  char *b64Message = base64Encode(encryptedMessage, encryptedMessageLength);
  printf("Encrypted message: %s\n", b64Message);

  // Decrypt the message
  char *decryptedMessage = NULL;
  int decryptedMessageLength = crypto->aesDecrypt(encryptedMessage, (size_t)encryptedMessageLength, (unsigned char**)&decryptedMessage);

  if(decryptedMessageLength == -1) {
    fprintf(stderr, "Decryption failed\n");
    return;
  }

  printf("Decrypted message: %s\n", decryptedMessage);

  // Clean up
  free(encryptedMessage);
  free(decryptedMessage);
  free(b64Message);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0xf7d(%rip), %rsi       # 0x40f5
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x3278
movq %rsp, %rcx
movq $0x0, (%rcx)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
incq %rdx
movq %rbx, %rdi
callq 0x2c6c
cmpl $-0x1, %eax
je 0x3240
movq (%rsp), %rdi
movslq %eax, %r15
movq %r15, %rsi
callq 0x25dc
movq %rax, %r14
leaq 0xef1(%rip), %rdi       # 0x40b4
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
leaq 0x8(%rsp), %rcx
movq $0x0, (%rcx)
movq (%rsp), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x2d08
cmpl $-0x1, %eax
je 0x3247
movq 0x8(%rsp), %rsi
leaq 0xee5(%rip), %rdi       # 0x40de
xorl %eax, %eax
callq 0x2030
movq (%rsp), %rdi
callq 0x2280
movq 0x8(%rsp), %rdi
callq 0x2280
movq %r14, %rdi
callq 0x2280
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3236
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2200
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
callq 0x2480
jmp 0x321b
callq 0x245e
jmp 0x321b
jmp 0x3252
jmp 0x3252
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3270
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O3/shanet[P]Crypto-Example/crypto_example.cpp
// Function: getMessage[abi:cxx11](char const*)
string getMessage(const char *prompt) {
  string message;

  printf(prompt);
  fflush(stdout);

  getline(std::cin, message);
  return message;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
movq %rsi, %rdi
xorl %eax, %eax
callq 0x2030
movq 0x2d14(%rip), %rax      # 0x5fb8
movq (%rax), %rdi
callq 0x2270
movq 0x2d2d(%rip), %rdi      # 0x5fe0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %edx
movq 0x2d12(%rip), %rdi      # 0x5fe0
movq %rbx, %rsi
callq 0x2380
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x32f5
movq (%r15), %rsi
incq %rsi
callq 0x2200
movq %r14, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O3/shanet[P]Crypto-Example/crypto_example.cpp
// Function: printKeys(Crypto*)
void printKeys(Crypto *crypto) {
  // Write the RSA keys to stdout
  crypto->writeKeyToFile(stdout, KEY_SERVER_PRI);
  crypto->writeKeyToFile(stdout, KEY_SERVER_PUB);
  crypto->writeKeyToFile(stdout, KEY_CLIENT_PUB);

  // Write the AES key to stdout in hex
  unsigned char *aesKey;
  size_t aesKeyLength = crypto->getAesKey(&aesKey);
  printBytesAsHex(aesKey, aesKeyLength, "AES Key");

  // Write the AES IV to stdout in hex
  unsigned char *aesIv;
  size_t aesIvLength = crypto->getAesIv(&aesIv);
  printBytesAsHex(aesIv, aesIvLength, "AES IV");
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x2caa(%rip), %r14      # 0x5fb8
movq (%r14), %rsi
xorl %edx, %edx
callq 0x2f02
movq (%r14), %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x2f02
movq (%r14), %rsi
movq %rbx, %rdi
movl $0x2, %edx
callq 0x2f02
leaq 0x10(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2eb2
movslq %eax, %rsi
movq (%r14), %rdi
leaq 0xdb9(%rip), %rdx       # 0x410e
callq 0x3384
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2eda
movslq %eax, %rsi
movq (%r14), %rdi
leaq 0xd9f(%rip), %rdx       # 0x4116
callq 0x3384
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/shanet[P]Crypto-Example/crypto_example.cpp
// Function: printBytesAsHex(unsigned char*, unsigned long, char const*)
void printBytesAsHex(unsigned char *bytes, size_t length, const char *message) {
  printf("%s: ", message);

  for(unsigned int i=0; i<length; i++) {
    printf("%02hhx", bytes[i]);
  }

  puts("");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xd85(%rip), %rdi       # 0x411d
movq %rdx, %rsi
xorl %eax, %eax
callq 0x2030
testq %rbx, %rbx
je 0x33cd
movl $0x1, %ebp
leaq 0xd6f(%rip), %r15       # 0x4122
xorl %eax, %eax
movzbl (%r14,%rax), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x2030
movl %ebp, %eax
incl %ebp
cmpq %rbx, %rax
jb 0x33b5
movl $0xa, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x22d0
// File: /workspace/github_cpp_makefile_star2_O3/titusnicolae[P]imgdiff2/imgdiff.cpp
// Function: decodeOneStep(char const*)
void decodeOneStep(const char* filename)
{
  std::vector<unsigned char> image; //the raw pixels
  unsigned width, height;

  //decode
  unsigned error = lodepng::decode(image, width, height, filename);

  //if there's an error, display it
  if(error) std::cout << "decoder error " << error << ": " << lodepng_error_text(error) << std::endl;

  //the pixels are now in the vector "image", 4 bytes per pixel, ordered RGBARGBA..., use it as texture, draw it, ...
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rsi
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x20b0
leaq 0x10(%rsp), %rdi
leaq 0x2c(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x30(%rsp), %rcx
movl $0x6, %r8d
movl $0x8, %r9d
callq 0xd464
movl %eax, %ebp
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2539
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x21c0
testl %ebp, %ebp
je 0x25e5
movq 0x14a90(%rip), %rdi     # 0x16fd8
leaq 0xeab5(%rip), %rsi      # 0x11004
movl $0xe, %edx
callq 0x2200
movl %ebp, %esi
movq 0x14a76(%rip), %rdi     # 0x16fd8
callq 0x2120
movq %rax, %rbx
leaq 0xeaa2(%rip), %rsi      # 0x11013
movl $0x2, %edx
movq %rax, %rdi
callq 0x2200
movl %ebp, %edi
callq 0xce7c
movq %rax, %r14
testq %rax, %rax
je 0x25a5
movq %r14, %rdi
callq 0x20d0
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2200
jmp 0x25be
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq %rbx, %rdi
addq %rax, %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2300
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2130
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x25fc
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x262a
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x21c0
jmp 0x262a
jmp 0x2627
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2641
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
movq %rbx, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O3/titusnicolae[P]imgdiff2/imgdiff.cpp
// Function: encodeOneStep(char const*, std::vector<unsigned char, std::allocator<unsigned char>>&, unsigned int, unsigned int)
void encodeOneStep(const char* filename, std::vector<unsigned char>& image, unsigned width, unsigned height)
{
  //Encode the image
  unsigned error = lodepng::encode(filename, image, width, height);

  //if there's an error, display it
  if(error) std::cout << "encoder error " << error << ": "<< lodepng_error_text(error) << std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %ecx, %ebx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rsi
leaq 0x8(%rsp), %r15
leaq 0x7(%rsp), %rdx
movq %r15, %rdi
callq 0x20b0
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
movl %ebx, %ecx
movl $0x6, %r8d
movl $0x8, %r9d
callq 0xd706
movl %eax, %ebp
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x26a7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21c0
testl %ebp, %ebp
je 0x2752
movq 0x14922(%rip), %rbx     # 0x16fd8
leaq 0xe959(%rip), %rsi      # 0x11016
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2200
movl %ebp, %esi
movq %rbx, %rdi
callq 0x2120
movq %rax, %rbx
leaq 0xe935(%rip), %rsi      # 0x11013
movl $0x2, %edx
movq %rax, %rdi
callq 0x2200
movl %ebp, %edi
callq 0xce7c
testq %rax, %rax
je 0x2712
movq %rax, %r14
movq %rax, %rdi
callq 0x20d0
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2200
jmp 0x272b
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq %rbx, %rdi
addq %rax, %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2300
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2130
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x277b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21c0
movq %rbx, %rdi
callq 0x2320