// File: /workspace/github_cpp_makefile_star2_O2/IsaacLaw12[P]RayTracer/./src/Sphere.cpp
// Function: Sphere::Sphere(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Sphere::Sphere(std::string driver_line){
    double x, y, z, rad, ka_red, ka_blue, ka_green, kd_red, kd_blue, kd_green,
        ks_red, ks_blue, ks_green, katt_red, katt_blue, katt_green;

    // If driver file does not include refraction constants default to 1, no refraction;
    double ref_red, ref_green, ref_blue;
    ref_red = 1; ref_green = 1; ref_blue = 1;

    std::string driver_type;

    std::stringstream read_sphere(driver_line);
    read_sphere >> driver_type >> x >> y >> z >> rad >> ka_red >> ka_blue >> ka_green >> kd_red >> kd_blue >> kd_green >>
        ks_red >> ks_blue >> ks_green>> katt_red>> katt_blue>> katt_green >> ref_red >> ref_green >> ref_blue >> phong >> eta >> lighting_group >> animation_file;

    sphere_center << x, y, z;
    radius = rad;
    // Just a constant used for spheres


    ambient_color(0, 0) = ka_red;
    ambient_color(1, 1) = ka_blue;
    ambient_color(2, 2) = ka_green;

    diffuse_color(0, 0) = kd_red;
    diffuse_color(1, 1) = kd_blue;
    diffuse_color(2, 2) = kd_green;

    specular_color(0, 0) = ks_red;
    specular_color(1, 1) = ks_blue;
    specular_color(2, 2) = ks_green;

    attenuation_color(0, 0) = katt_red;
    attenuation_color(1, 1) = katt_blue;
    attenuation_color(2, 2) = katt_green;

    refract_color(0, 0) = ref_red;
    refract_color(1, 1) = ref_green;
    refract_color(2, 2) = ref_blue;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movq %rsi, %r12
movq %rdi, %r14
callq 0xa1fe
leaq 0x1a944(%rip), %rax     # 0x29cd8
movq %rax, (%r14)
leaq 0x198(%r14), %rbx
leaq 0x9e29(%rip), %rsi      # 0x191ce
leaq 0xe0(%rsp), %rdx
movq %rbx, %rdi
callq 0x61f6
leaq 0xe0(%rsp), %rdi
callq 0x52c8
leaq 0x1b8(%r14), %r15
leaq 0xe0(%rsp), %rsi
movq %r15, %rdi
callq 0x548c
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x18(%rsp)
movq %rax, 0x10(%rsp)
movq %rax, 0x8(%rsp)
leaq 0xb0(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0xe0(%rsp), %rdi
pushq $0x18
popq %rdx
movq %r12, %rsi
callq 0x33e0
leaq 0xe0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x3320
leaq 0x98(%rsp), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x90(%rsp), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x88(%rsp), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x80(%rsp), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x78(%rsp), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x70(%rsp), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x68(%rsp), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x60(%rsp), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x58(%rsp), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x48(%rsp), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x40(%rsp), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x38(%rsp), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x18(%rsp), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x8(%r14), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x10(%r14), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x18(%r14), %rsi
movq %rax, %rdi
callq 0x3190
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3320
leaq 0xc0(%rsp), %rdi
movq %r15, (%rdi)
andq $0x0, 0x8(%rdi)
pushq $0x1
popq %rax
movq %rax, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movsd 0x98(%rsp), %xmm0
movsd %xmm0, (%r15)
leaq 0x90(%rsp), %rsi
callq 0x6232
leaq 0x88(%rsp), %rsi
movq %rax, %rdi
callq 0x6232
leaq 0xc0(%rsp), %rdi
callq 0x62da
movsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x190(%r14)
movsd 0x78(%rsp), %xmm0
movsd %xmm0, 0x20(%r14)
movsd 0x70(%rsp), %xmm0
movsd %xmm0, 0x40(%r14)
movsd 0x68(%rsp), %xmm0
movsd %xmm0, 0x60(%r14)
movsd 0x60(%rsp), %xmm0
movsd %xmm0, 0x68(%r14)
movsd 0x58(%rsp), %xmm0
movsd %xmm0, 0x88(%r14)
movsd 0x50(%rsp), %xmm0
movsd %xmm0, 0xa8(%r14)
movsd 0x48(%rsp), %xmm0
movsd %xmm0, 0xb0(%r14)
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0xd0(%r14)
movsd 0x38(%rsp), %xmm0
movsd %xmm0, 0xf0(%r14)
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0xf8(%r14)
movsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x118(%r14)
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x138(%r14)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x140(%r14)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x160(%r14)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x180(%r14)
leaq 0xe0(%rsp), %rdi
callq 0x3200
leaq 0xa0(%rsp), %rdi
callq 0x3100
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
jmp 0xf6ef
movq %rax, %r14
leaq 0xc0(%rsp), %rdi
callq 0x62da
jmp 0xf6e2
movq %rax, %r14
jmp 0xf6fc
movq %rax, %r14
leaq 0xe0(%rsp), %rdi
callq 0x3200
leaq 0xa0(%rsp), %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x3100
movq %r14, %rdi
callq 0x3490