// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movq %rsi, %r15
movq %rdi, %rbx
movaps 0x948e(%rip), %xmm0     # 0x16ee0
movups %xmm0, 0x8(%rdi)
movl $0x0, 0x18(%rdi)
addq $0x20, %rdi
xorl %ebp, %ebp
movl $0xd8, %edx
xorl %esi, %esi
callq 0x3170
movabsq $0x3ff0000000000000, %r12 # imm = 0x3FF0000000000000
movq %r12, 0xf8(%rbx)
xorps %xmm1, %xmm1
movups %xmm1, 0x100(%rbx)
movq %rbp, 0x110(%rbx)
movq %r12, 0x118(%rbx)
movups %xmm1, 0x120(%rbx)
movq %rbp, 0x130(%rbx)
movaps 0x9443(%rip), %xmm0     # 0x16ef0
movups %xmm0, 0x138(%rbx)
movups %xmm1, 0x148(%rbx)
movq %rbp, 0x158(%rbx)
movq %r12, 0x160(%rbx)
movups %xmm1, 0x168(%rbx)
movq %rbp, 0x178(%rbx)
movaps 0x9422(%rip), %xmm0     # 0x16f00
movups %xmm0, 0x180(%rbx)
leaq 0x121e4(%rip), %rax     # 0x1fcd0
movq %rax, (%rbx)
leaq 0x198(%rbx), %r14
leaq 0x1a8(%rbx), %r13
movq %r13, 0x198(%rbx)
leaq 0x9169(%rip), %rdx      # 0x16c74
movq %r14, %rdi
movq %rdx, %rsi
callq 0x5bde
movq %rbp, 0x1c8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x1b8(%rbx)
movq %r12, 0x18(%rsp)
movq %r12, 0x10(%rsp)
movq %r12, 0x8(%rsp)
leaq 0xd0(%rsp), %r12
movq %r12, -0x10(%r12)
movq %rbp, -0x8(%r12)
movb $0x0, (%r12)
leaq 0xe0(%rsp), %rdi
movq %r15, %rsi
movl $0x18, %edx
callq 0x3400
leaq 0xe0(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x3340
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(%rbx), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x10(%rbx), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x18(%rbx), %rsi
movq %rax, %rdi
callq 0x3190
movq %rax, %rdi
movq %r14, %rsi
callq 0x3340
leaq 0x1b8(%rbx), %rax
leaq 0xa0(%rsp), %rdi
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movl $0x1, %ecx
movq %rcx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movsd 0x98(%rsp), %xmm0
movsd %xmm0, (%rax)
leaq 0x90(%rsp), %rsi
callq 0x5b22
leaq 0x88(%rsp), %rsi
movq %rax, %rdi
callq 0x5b22
movq 0xb8(%rsp), %rax
addq 0xa8(%rsp), %rax
cmpq $0x3, %rax
jne 0xde4a
cmpq $0x1, 0xb0(%rsp)
jne 0xde4a
movsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x190(%rbx)
movsd 0x78(%rsp), %xmm0
movsd %xmm0, 0x20(%rbx)
movsd 0x70(%rsp), %xmm0
movsd %xmm0, 0x40(%rbx)
movsd 0x68(%rsp), %xmm0
movsd %xmm0, 0x60(%rbx)
movsd 0x60(%rsp), %xmm0
movsd %xmm0, 0x68(%rbx)
movsd 0x58(%rsp), %xmm0
movsd %xmm0, 0x88(%rbx)
movsd 0x50(%rsp), %xmm0
movsd %xmm0, 0xa8(%rbx)
movsd 0x48(%rsp), %xmm0
movsd %xmm0, 0xb0(%rbx)
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0xd0(%rbx)
movsd 0x38(%rsp), %xmm0
movsd %xmm0, 0xf0(%rbx)
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0xf8(%rbx)
movsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x118(%rbx)
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x138(%rbx)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x140(%rbx)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x160(%rbx)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x180(%rbx)
movq 0x12197(%rip), %rsi     # 0x1ff98
leaq 0xe0(%rsp), %rdi
callq 0x3210
leaq 0x160(%rsp), %rdi
callq 0x30e0
movq 0xc0(%rsp), %rdi
cmpq %r12, %rdi
je 0xde38
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x32d0
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8af7(%rip), %rdi      # 0x16948
leaq 0x8b8e(%rip), %rsi      # 0x169e6
leaq 0x8bb1(%rip), %rcx      # 0x16a10
movl $0x78, %edx
callq 0x31a0
movq %rax, %rbx
jmp 0xdebb
movq %rax, %rbx
movq 0xb8(%rsp), %rax
addq 0xa8(%rsp), %rax
cmpq $0x3, %rax
jne 0xde92
cmpq $0x1, 0xb0(%rsp)
je 0xde9a
callq 0x363e
movq %rax, %rbx
movq 0x120f7(%rip), %rsi     # 0x1ff98
leaq 0xe0(%rsp), %rdi
callq 0x3210
leaq 0x160(%rsp), %rdi
callq 0x30e0
movq 0xc0(%rsp), %rdi
cmpq %r12, %rdi
je 0xded8
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x32d0
movq (%r14), %rdi
cmpq %r13, %rdi
je 0xdeec
movq (%r13), %rsi
incq %rsi
callq 0x32d0
movq %rbx, %rdi
callq 0x34b0