// File: /workspace/github_cpp_makefile_star2_O1/IsaacLaw12[P]RayTracer/./src/RenderImage.cpp
// Function: RenderImage::calculate_color(Ray&, double, SceneObject*, Eigen::Matrix<double, 3, 1, 0, 3, 1>&, Eigen::Matrix<double, 3, 1, 0, 3, 1>&, Eigen::Matrix<double, 3, 1, 0, 3, 1>&, int)
void RenderImage::calculate_color(Ray& ray, double t_value, SceneObject* hit_obj, Eigen::Vector3d &hit_normal, Eigen::Vector3d &accum, Eigen::Vector3d &ampl, int level){
    Eigen::Vector3d vector_to_light, intersect_pos, dif_refl, color;
    Eigen::Vector3d obj_intsct_vector, light_reflect_point;
    if (t_value == MISSED_T_VALUE){
        accum << 0,0,0;
        return;
    }
    color = hit_obj->get_ambient_color() * scene->get_ambient();
    double light_concentration, proximity_reflection;
    intersect_pos = ray.get_ray_loc(t_value);

    for(Light light:scene->get_lights()){
        if (light.get_lighting_group() != hit_obj->get_lighting_group()){
            continue;
        }
        if (!lightReachesObject(light, intersect_pos)){
            continue;
        }
        // Diffuse reflection
        vector_to_light = (light.get_pos() - intersect_pos).normalized();
        light_concentration = hit_normal.dot(vector_to_light);
        if (light_concentration < 0){
                continue;
        }

        dif_refl =  hit_obj->get_diffuse_color() * light.get_color() * light_concentration;
        color += dif_refl;
        // Specular reflection

        // The vector from the intersect point to the camera
        obj_intsct_vector = (ray.get_point() - intersect_pos).normalized();
        // The point opposite the light flipped on the normal
        light_reflect_point = (2 * hit_normal.dot(vector_to_light) *  hit_normal) - vector_to_light;
        proximity_reflection = obj_intsct_vector.dot(light_reflect_point);
        if (proximity_reflection > 0.0){
            color += hit_obj->get_specular_color() * light.get_color() * std::pow(proximity_reflection, hit_obj->get_phong());
        }

    }
    accum = accum + ampl.cwiseProduct(color);

    Eigen::Vector3d kr_ampl = hit_obj->get_kr() * ampl;
    Eigen::Matrix3d ko = hit_obj->get_ko();
    double opacity = (ko * Eigen::Vector3d(1,1,1)).dot(Eigen::Vector3d(1,1,1));
    double dummy_t = 0;
    // Reflections
    if (level > 0){
        Eigen::Vector3d reflect_accum = Eigen::Vector3d::Zero();
        Eigen::Vector3d w = -1 * ray.get_dir();
        Eigen::Vector3d ray_dir = (2 * hit_normal.dot(w) * hit_normal - w).normalized();
        Ray reflect_ray = Ray(intersect_pos, ray_dir);
        ray_trace(reflect_ray, reflect_accum, kr_ampl, --level, dummy_t);
        Eigen::Vector3d reflect_ampl = ko * ampl;
        accum = accum + reflect_ampl.cwiseProduct(reflect_accum);
    }
    // Calculate refraction
    if (level > 0 && opacity < 3.0){
        Eigen::Vector3d refract_accum = Eigen::Vector3d::Zero();
        Ray refract_ray = hit_obj->get_refracted_ray(ray, intersect_pos, hit_normal);
        ray_trace(refract_ray, refract_accum, kr_ampl, --level, dummy_t);
        Eigen::Vector3d refract_ampl = (Eigen::Matrix3d::Identity() - ko) * ampl;
        accum = accum + refract_ampl.cwiseProduct(refract_accum);
    }
    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
movsd 0x8(%rdi), %xmm1
ucomisd %xmm0, %xmm1
jne 0xc82e
jp 0xc82e
leaq 0x100(%rsp), %rdi
movq %r8, (%rdi)
xorl %eax, %eax
movq %rax, 0x8(%rdi)
movl $0x1, %ecx
movq %rcx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %rax, (%r8)
leaq 0x90(%rsp), %rsi
movq %rax, (%rsi)
callq 0x5b26
leaq 0x1e0(%rsp), %rsi
movq $0x0, (%rsi)
movq %rax, %rdi
callq 0x5b26
movq 0x118(%rsp), %rax
addq 0x108(%rsp), %rax
cmpq $0x3, %rax
jne 0xd380
cmpq $0x1, 0x110(%rsp)
je 0xd343
jmp 0xd380
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %r14
movq %rcx, 0x40(%rsp)
movq %r9, 0x188(%rsp)
movq %r8, 0x30(%rsp)
leaq 0x90(%rsp), %r12
movq %r12, %rdi
movq %rdx, %rsi
movsd %xmm0, 0x70(%rsp)
callq 0x108ac
movq (%r14), %rdi
callq 0xee24
movupd (%rax), %xmm0
movupd 0x8(%rax), %xmm1
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd (%r12), %xmm0
movupd 0x18(%r12), %xmm2
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
mulpd %xmm2, %xmm1
addpd %xmm0, %xmm1
movsd 0x10(%rax), %xmm0
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd 0x30(%r12), %xmm0
addpd %xmm1, %xmm0
movapd %xmm0, 0x20(%rsp)
leaq 0xa0(%rsp), %rcx
leaq 0x100(%rsp), %rbx
movq %rcx, (%rbx)
movq %r12, 0x10(%rbx)
movq $0x2, 0x18(%rbx)
xorl %ecx, %ecx
movq %rcx, 0x20(%rbx)
movq $0x1, 0x28(%rbx)
movq %rax, 0x30(%rbx)
movq %rax, 0x40(%rbx)
movq %rcx, 0x48(%rbx)
movq $0x3, 0x58(%rbx)
leaq 0x1e0(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
callq 0xd9a6
movq %rbx, 0x30(%rbp)
movq 0x10(%rbp), %rax
movq 0x20(%rbp), %rcx
movupd (%rcx), %xmm0
movsd (%rax), %xmm1
movhpd 0x18(%rax), %xmm1       # xmm1 = xmm1[0],mem[0]
mulpd %xmm0, %xmm1
movsd 0x30(%rax), %xmm0
mulsd 0x10(%rcx), %xmm0
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm0, %xmm2
addsd %xmm1, %xmm2
movapd %xmm2, 0x10(%rsp)
leaq 0x100(%rsp), %rbx
movq %rbx, %rdi
movq %r15, 0x38(%rsp)
movq %r15, %rsi
movsd 0x70(%rsp), %xmm0
callq 0x15cc0
movaps (%rbx), %xmm0
movaps %xmm0, 0x50(%rsp)
movsd 0x10(%rbx), %xmm0
movsd %xmm0, 0x60(%rsp)
movq %r14, 0x48(%rsp)
movq (%r14), %rdi
callq 0xee42
movq (%rax), %r14
movq 0x8(%rax), %r15
cmpq %r15, %r14
movq %r13, 0x8(%rsp)
je 0xcd8d
leaq 0x110(%rsp), %r12
leaq 0x100(%rsp), %rbx
movups (%r14), %xmm0
movaps %xmm0, 0x100(%rsp)
movq 0x20(%r14), %rax
movq %rax, 0x10(%r12)
movups 0x10(%r14), %xmm0
movups %xmm0, (%r12)
movq 0x38(%r14), %rax
movq %rax, 0x28(%r12)
movupd 0x28(%r14), %xmm0
movupd %xmm0, 0x18(%r12)
movb 0x40(%r14), %al
movb %al, 0x140(%rsp)
movq %rbx, %rdi
callq 0x5b22
movl %eax, %ebp
movq %r13, %rdi
callq 0x1090c
cmpl %eax, %ebp
jne 0xcd80
movq 0x60(%rsp), %rax
movq %rax, 0x260(%rsp)
movapd 0x50(%rsp), %xmm0
movapd %xmm0, 0x250(%rsp)
movq 0x48(%rsp), %rdi
movq %rbx, %rsi
leaq 0x250(%rsp), %rdx
callq 0xd3a0
testb %al, %al
je 0xcd80
leaq 0x90(%rsp), %rdi
movq %rbx, %rsi
callq 0x5afa
movapd 0x90(%rsp), %xmm3
subpd 0x50(%rsp), %xmm3
movapd %xmm3, %xmm0
mulpd %xmm3, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movsd 0xa0(%rsp), %xmm4
subsd 0x60(%rsp), %xmm4
movapd %xmm4, %xmm0
mulsd %xmm4, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
movq 0x40(%rsp), %rbp
jbe 0xcaa2
movq %xmm0, %xmm0            # xmm0 = xmm0[0],zero
sqrtpd %xmm0, %xmm0
divsd %xmm0, %xmm4
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
divpd %xmm0, %xmm3
movupd (%rbp), %xmm0
mulpd %xmm3, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movsd 0x10(%rbp), %xmm0
mulsd %xmm4, %xmm0
addsd %xmm1, %xmm0
ucomisd %xmm0, %xmm2
ja 0xcd80
movsd %xmm4, 0x198(%rsp)
movapd %xmm3, 0x70(%rsp)
movq %r13, %rsi
leaq 0x90(%rsp), %r13
movq %r13, %rdi
movsd %xmm0, 0x170(%rsp)
callq 0x1089c
movq %rbx, %rsi
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
callq 0x5b0e
movq %r13, 0x1a0(%rsp)
movq %rbx, 0x1a8(%rsp)
movsd 0x170(%rsp), %xmm0
movsd %xmm0, 0x1b8(%rsp)
leaq 0x1e8(%rsp), %rdi
leaq 0x1a0(%rsp), %rsi
callq 0xd9fc
movsd 0x1b8(%rsp), %xmm0
movsd %xmm0, 0x210(%rsp)
movq 0x1e8(%rsp), %rax
movups (%rax), %xmm1
movaps %xmm1, 0x240(%rsp)
movsd 0x10(%rax), %xmm1
movapd %xmm0, 0x170(%rsp)
mulsd %xmm0, %xmm1
movsd %xmm1, 0x190(%rsp)
movq 0x38(%rsp), %rdi
callq 0x15cb4
xorpd %xmm6, %xmm6
movupd (%rax), %xmm0
subpd 0x50(%rsp), %xmm0
movapd %xmm0, %xmm1
mulpd %xmm0, %xmm1
movapd %xmm1, %xmm3
unpckhpd %xmm1, %xmm3            # xmm3 = xmm3[1],xmm1[1]
addsd %xmm1, %xmm3
movsd 0x10(%rax), %xmm1
subsd 0x60(%rsp), %xmm1
movapd %xmm1, %xmm2
mulsd %xmm1, %xmm2
addsd %xmm3, %xmm2
ucomisd %xmm6, %xmm2
jbe 0xcbe0
movq %xmm2, %xmm2            # xmm2 = xmm2[0],zero
sqrtpd %xmm2, %xmm2
divsd %xmm2, %xmm1
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
divpd %xmm2, %xmm0
movapd 0x20(%rsp), %xmm3
movapd 0x10(%rsp), %xmm4
movapd 0x170(%rsp), %xmm2
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
mulpd 0x240(%rsp), %xmm2
addpd %xmm2, %xmm3
addsd 0x190(%rsp), %xmm4
movupd (%rbp), %xmm2
movapd %xmm3, %xmm10
movapd 0x70(%rsp), %xmm7
movapd %xmm7, %xmm3
mulpd %xmm2, %xmm3
movapd %xmm4, %xmm9
movapd %xmm3, %xmm4
unpckhpd %xmm3, %xmm4            # xmm4 = xmm4[1],xmm3[1]
addsd %xmm3, %xmm4
movsd 0x10(%rbp), %xmm3
movsd 0x198(%rsp), %xmm8
movapd %xmm8, %xmm5
mulsd %xmm3, %xmm5
addsd %xmm4, %xmm5
addsd %xmm5, %xmm5
mulsd %xmm5, %xmm3
unpcklpd %xmm5, %xmm5            # xmm5 = xmm5[0,0]
mulpd %xmm2, %xmm5
subpd %xmm7, %xmm5
mulpd %xmm0, %xmm5
subsd %xmm8, %xmm3
mulsd %xmm1, %xmm3
movapd %xmm5, %xmm0
unpckhpd %xmm5, %xmm0            # xmm0 = xmm0[1],xmm5[1]
addsd %xmm5, %xmm0
addsd %xmm3, %xmm0
ucomisd %xmm6, %xmm0
movapd %xmm10, 0x20(%rsp)
movapd %xmm9, 0x10(%rsp)
jbe 0xcd73
leaq 0x90(%rsp), %r13
movq %r13, %rdi
movq 0x8(%rsp), %rbp
movq %rbp, %rsi
movapd %xmm0, 0x70(%rsp)
callq 0x108bc
leaq 0xe0(%rsp), %rdi
leaq 0x100(%rsp), %rbx
movq %rbx, %rsi
callq 0x5b0e
movq %rbp, %rdi
callq 0x1088c
movapd %xmm0, %xmm1
movaps 0x70(%rsp), %xmm0
callq 0x34a0
movq %r13, 0x1a0(%rsp)
movq %rbp, %r13
leaq 0xe0(%rsp), %rax
movq %rax, 0x1a8(%rsp)
movsd %xmm0, 0x1b8(%rsp)
leaq 0x1e8(%rsp), %rdi
leaq 0x1a0(%rsp), %rsi
callq 0xd9fc
movsd 0x1b8(%rsp), %xmm0
movsd %xmm0, 0x210(%rsp)
movq 0x1e8(%rsp), %rax
movupd (%rax), %xmm1
movapd %xmm0, %xmm2
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
mulpd %xmm1, %xmm2
movapd 0x20(%rsp), %xmm1
addpd %xmm2, %xmm1
movapd %xmm1, 0x20(%rsp)
mulsd 0x10(%rax), %xmm0
movapd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, 0x10(%rsp)
jmp 0xcd80
movq 0x8(%rsp), %r13
leaq 0x100(%rsp), %rbx
addq $0x48, %r14
cmpq %r15, %r14
jne 0xc99e
movq 0x30(%rsp), %rax
movupd (%rax), %xmm0
movq 0x188(%rsp), %r12
movupd (%r12), %xmm1
mulpd 0x20(%rsp), %xmm1
addpd %xmm0, %xmm1
movupd %xmm1, (%rax)
movapd 0x10(%rsp), %xmm0
mulsd 0x10(%r12), %xmm0
addsd 0x10(%rax), %xmm0
movsd %xmm0, 0x10(%rax)
leaq 0x90(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x108e4
movupd (%r12), %xmm0
movupd 0x8(%r12), %xmm1
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd 0x90(%rsp), %xmm0
movupd 0xa8(%rsp), %xmm2
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
mulpd %xmm2, %xmm1
addpd %xmm0, %xmm1
movsd 0x10(%r12), %xmm0
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd 0xc0(%rsp), %xmm0
addpd %xmm1, %xmm0
movapd %xmm0, 0xe0(%rsp)
leaq 0x108(%rsp), %rbx
leaq 0xa0(%rsp), %rax
movq %rax, -0x8(%rbx)
movq %r14, 0x8(%rbx)
movq $0x2, 0x10(%rbx)
xorl %eax, %eax
movq %rax, 0x18(%rbx)
movq $0x1, 0x20(%rbx)
movq %r12, 0x28(%rbx)
movq %r12, 0x38(%rbx)
movq %rax, 0x40(%rbx)
movq $0x3, 0x50(%rbx)
leaq 0x1e0(%rsp), %rbp
movq %rbp, %rdi
leaq 0x100(%rsp), %r15
movq %r15, %rsi
callq 0xd9a6
movq %r15, 0x30(%rbp)
movq 0x10(%rbp), %rax
movq 0x20(%rbp), %rcx
movupd (%rcx), %xmm0
movsd (%rax), %xmm1
movhpd 0x18(%rax), %xmm1       # xmm1 = xmm1[0],mem[0]
mulpd %xmm0, %xmm1
movsd 0x30(%rax), %xmm0
mulsd 0x10(%rcx), %xmm0
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm0, %xmm2
addsd %xmm1, %xmm2
movsd %xmm2, 0xf0(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x108f8
movaps 0xa015(%rip), %xmm0     # 0x16ef0
leaq 0x1a0(%rsp), %rax
movaps %xmm0, (%rax)
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, 0x10(%rax)
leaq 0x220(%rsp), %rdx
movaps %xmm0, (%rdx)
movq %rcx, 0x10(%rdx)
movq %r14, (%rbp)
movq %rax, 0x8(%rbp)
movq %rdx, 0x10(%rbp)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xd9fc
movq 0x10(%rbp), %rax
movq %rax, 0x28(%rbx)
movq %rbp, 0x38(%rbx)
movq (%rbx), %rcx
movupd (%rcx), %xmm0
movupd (%rax), %xmm1
mulpd %xmm0, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
movsd 0x10(%rcx), %xmm2
mulsd 0x10(%rax), %xmm2
addsd %xmm1, %xmm0
addsd %xmm0, %xmm2
xorl %eax, %eax
movq %rax, 0x88(%rsp)
movl 0x2e0(%rsp), %r14d
testl %r14d, %r14d
jle 0xd1d3
movsd %xmm2, 0x20(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x220(%rsp)
movq $0x0, 0x230(%rsp)
movq 0x38(%rsp), %rdi
callq 0x15cba
movupd (%rax), %xmm2
movapd 0x9f71(%rip), %xmm1     # 0x16f10
xorpd %xmm2, %xmm1
movsd 0x10(%rax), %xmm3
movq 0x40(%rsp), %rax
movupd (%rax), %xmm4
mulpd %xmm4, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movsd 0x10(%rax), %xmm1
movapd %xmm3, %xmm5
mulsd %xmm1, %xmm5
subsd %xmm5, %xmm0
addsd %xmm0, %xmm0
mulsd %xmm0, %xmm1
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd %xmm4, %xmm0
addpd %xmm2, %xmm0
addsd %xmm3, %xmm1
movapd %xmm0, %xmm2
mulpd %xmm0, %xmm2
movapd %xmm2, %xmm3
unpckhpd %xmm2, %xmm3            # xmm3 = xmm3[1],xmm2[1]
addsd %xmm2, %xmm3
movapd %xmm1, %xmm2
mulsd %xmm1, %xmm2
addsd %xmm3, %xmm2
xorpd %xmm3, %xmm3
ucomisd %xmm3, %xmm2
movq 0x48(%rsp), %r15
jbe 0xd02d
movq %xmm2, %xmm2            # xmm2 = xmm2[0],zero
sqrtpd %xmm2, %xmm2
divsd %xmm2, %xmm1
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
divpd %xmm2, %xmm0
movq 0x8(%rsp), %r13
movaps 0x50(%rsp), %xmm2
leaq 0x290(%rsp), %rsi
movaps %xmm2, (%rsi)
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsi)
leaq 0x270(%rsp), %rdx
movapd %xmm0, (%rdx)
movsd %xmm1, 0x10(%rdx)
leaq 0x1a0(%rsp), %rbp
movq %rbp, %rdi
callq 0x15c24
decl %r14d
leaq 0x220(%rsp), %rbx
leaq 0xe0(%rsp), %rcx
leaq 0x88(%rsp), %r9
movq %r15, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movl %r14d, %r8d
callq 0xc660
movupd (%r12), %xmm0
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd 0x90(%rsp), %xmm0
movupd 0x8(%r12), %xmm1
movupd 0xa8(%rsp), %xmm2
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
mulpd %xmm2, %xmm1
movsd 0x10(%r12), %xmm2
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
mulpd 0xc0(%rsp), %xmm2
addpd %xmm0, %xmm1
addpd %xmm1, %xmm2
movapd %xmm2, 0x10(%rsp)
leaq 0xa0(%rsp), %rax
movq %rax, 0x100(%rsp)
leaq 0x90(%rsp), %rax
movq %rax, 0x110(%rsp)
movq $0x2, 0x118(%rsp)
xorl %eax, %eax
movq %rax, 0x120(%rsp)
movq $0x1, 0x128(%rsp)
movq %r12, 0x130(%rsp)
movq %r12, 0x140(%rsp)
movq %rax, 0x148(%rsp)
movq $0x3, 0x158(%rsp)
leaq 0x1e0(%rsp), %rbp
movq %rbp, %rdi
leaq 0x100(%rsp), %r15
movq %r15, %rsi
callq 0xd9a6
movq %r15, 0x30(%rbp)
movq 0x10(%rbp), %rax
movq 0x20(%rbp), %rcx
movsd (%rax), %xmm0
movhpd 0x18(%rax), %xmm0       # xmm0 = xmm0[0],mem[0]
movupd (%rcx), %xmm1
movsd 0x30(%rax), %xmm2
mulsd 0x10(%rcx), %xmm2
mulpd %xmm1, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movq 0x30(%rsp), %r15
movupd (%r15), %xmm0
movapd 0x10(%rsp), %xmm2
mulpd (%rbx), %xmm2
addpd %xmm0, %xmm2
movupd %xmm2, (%r15)
mulsd 0x10(%rbx), %xmm1
addsd 0x10(%r15), %xmm1
movsd %xmm1, 0x10(%r15)
movsd 0x20(%rsp), %xmm2
jmp 0xd1dd
movq 0x8(%rsp), %r13
movq 0x30(%rsp), %r15
testl %r14d, %r14d
setle %al
movsd 0xab25(%rip), %xmm0     # 0x17d10
ucomisd %xmm2, %xmm0
setbe %cl
orb %al, %cl
jne 0xd343
xorpd %xmm0, %xmm0
leaq 0x1e0(%rsp), %rbx
movapd %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq (%r13), %rax
leaq 0x100(%rsp), %rbp
leaq 0x50(%rsp), %rcx
movq %rbp, %rdi
movq %r13, %rsi
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %r8
callq *0x18(%rax)
decl %r14d
leaq 0xe0(%rsp), %rcx
leaq 0x88(%rsp), %r9
movq 0x48(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movl %r14d, %r8d
callq 0xc660
movupd 0xa8(%rsp), %xmm3
movapd 0xc0(%rsp), %xmm4
movupd (%r12), %xmm2
movupd 0x8(%r12), %xmm0
movapd %xmm0, %xmm5
shufpd $0x1, %xmm0, %xmm5      # xmm5 = xmm5[1],xmm0[0]
movsd 0x8da4(%rip), %xmm1     # 0x16030
movsd 0x8d9c(%rip), %xmm6     # 0x16030
subpd 0x90(%rsp), %xmm6
movsd (%r12), %xmm7
unpcklpd %xmm7, %xmm7            # xmm7 = xmm7[0,0]
movhpd 0xb0(%rsp), %xmm4       # xmm4 = xmm4[0],mem[0]
mulpd %xmm6, %xmm7
xorpd %xmm6, %xmm6
unpcklpd %xmm1, %xmm6            # xmm6 = xmm6[0],xmm1[0]
subpd %xmm4, %xmm6
mulpd %xmm5, %xmm6
movhpd 0xc8(%rsp), %xmm3       # xmm3 = xmm3[0],mem[0]
xorpd %xmm4, %xmm4
subpd %xmm3, %xmm4
mulpd %xmm0, %xmm4
addpd %xmm6, %xmm4
addpd %xmm7, %xmm4
movapd 0xa0(%rsp), %xmm3
movhpd 0xb8(%rsp), %xmm3       # xmm3 = xmm3[0],mem[0]
xorpd %xmm5, %xmm5
subpd %xmm3, %xmm5
mulpd %xmm2, %xmm5
subsd 0xd0(%rsp), %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
mulsd %xmm1, %xmm0
movapd %xmm5, %xmm1
unpckhpd %xmm5, %xmm1            # xmm1 = xmm1[1],xmm5[1]
addsd %xmm0, %xmm1
addsd %xmm5, %xmm1
movupd (%r15), %xmm0
mulpd (%rbx), %xmm4
addpd %xmm0, %xmm4
movupd %xmm4, (%r15)
mulsd 0x10(%rbx), %xmm1
addsd 0x10(%r15), %xmm1
movsd %xmm1, 0x10(%r15)
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd357
movq 0x118(%rsp), %rcx
addq 0x108(%rsp), %rcx
cmpq $0x3, %rcx
jne 0xd380
cmpq $0x1, 0x110(%rsp)
jne 0xd380
movq %rax, %rdi
callq 0x34b0
leaq 0x95c1(%rip), %rdi      # 0x16948
leaq 0x9658(%rip), %rsi      # 0x169e6
leaq 0x967b(%rip), %rcx      # 0x16a10
movl $0x78, %edx
callq 0x31a0
nop