// File: /workspace/github_cpp_makefile_star2_O1/IsaacLaw12[P]RayTracer/./src/WaveObject.cpp
// Function: WaveObject::extract_wave_info(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void WaveObject::extract_wave_info(std::string driver_line){
    // wave  corner1 side_length side_length dir1 dir2 res height  num_waves material
    std::stringstream d_line(driver_line);
    std::string line_type, material_file;
    double c1x, c1y, c1z, len_one, len_two, d1x, d1y, d1z, d2x, d2y, d2z, res, height;
    int n_waves, seed;
    d_line >>line_type>>c1x>>c1y>>c1z>>len_one>>len_two>>d1x>>d1y>>d1z>>d2x>>d2y>>d2z>>res>>height>>n_waves>>seed>>material_file;

    side_len_one = len_one;
    side_len_two = len_two;
    first_corner = Eigen::Vector3d(c1x, c1y, c1z);
    direction_one = Eigen::Vector3d(d1x, d1y, d1z);
    direction_two = Eigen::Vector3d(d2x, d2y, d2z);
    direction_one = direction_one.normalized();
    direction_two = direction_two.normalized();
    second_corner = first_corner + side_len_one * direction_one + side_len_two * direction_two;

    surface_normal = direction_one.cross(direction_two);
    surface_normal = surface_normal.normalized();

    wave_height = height;
    num_waves = n_waves;
    search_step = 1 / res;

    load_material(material_file);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movq %rdi, %rbx
leaq 0xe0(%rsp), %r14
movq %r14, %rdi
movl $0x18, %edx
callq 0x3400
leaq 0xd0(%rsp), %r15
movq %r15, -0x10(%r15)
xorl %eax, %eax
movq %rax, -0x8(%r15)
movb %al, (%r15)
leaq 0x88(%rsp), %r12
movq %r12, -0x10(%r12)
movq %rax, -0x8(%r12)
movb %al, (%r12)
leaq 0xc0(%rsp), %rsi
movq %r14, %rdi
callq 0x3340
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 0xc(%rsp), %rsi
movq %rax, %rdi
callq 0x3190
leaq 0x9c(%rsp), %rsi
movq %rax, %rdi
callq 0x3190
leaq 0x78(%rsp), %rsi
movq %rax, %rdi
callq 0x3340
movsd 0x58(%rsp), %xmm3
movsd %xmm3, 0x1d0(%rbx)
movsd 0x50(%rsp), %xmm2
movsd %xmm2, 0x1d8(%rbx)
movsd 0x70(%rsp), %xmm5
movhpd 0x68(%rsp), %xmm5       # xmm5 = xmm5[0],mem[0]
movsd 0x60(%rsp), %xmm4
movupd %xmm5, 0x1e0(%rbx)
movsd %xmm4, 0x1f0(%rbx)
movsd 0x48(%rsp), %xmm6
movhpd 0x40(%rsp), %xmm6       # xmm6 = xmm6[0],mem[0]
movsd 0x38(%rsp), %xmm1
movupd %xmm6, 0x210(%rbx)
movsd %xmm1, 0x220(%rbx)
movsd 0x30(%rsp), %xmm7
movhpd 0x28(%rsp), %xmm7       # xmm7 = xmm7[0],mem[0]
movsd 0x20(%rsp), %xmm0
movupd %xmm7, 0x228(%rbx)
movsd %xmm0, 0x238(%rbx)
movapd %xmm6, %xmm8
mulpd %xmm6, %xmm8
movapd %xmm8, %xmm10
unpckhpd %xmm8, %xmm10           # xmm10 = xmm10[1],xmm8[1]
addsd %xmm8, %xmm10
movapd %xmm1, %xmm9
mulsd %xmm1, %xmm9
addsd %xmm10, %xmm9
xorpd %xmm8, %xmm8
ucomisd %xmm8, %xmm9
jbe 0x12947
movq %xmm9, %xmm9            # xmm9 = xmm9[0],zero
sqrtpd %xmm9, %xmm9
divsd %xmm9, %xmm1
unpcklpd %xmm9, %xmm9            # xmm9 = xmm9[0,0]
divpd %xmm9, %xmm6
movupd %xmm6, 0x210(%rbx)
movsd %xmm1, 0x220(%rbx)
movapd %xmm7, %xmm9
mulpd %xmm7, %xmm9
movapd %xmm9, %xmm10
unpckhpd %xmm9, %xmm10           # xmm10 = xmm10[1],xmm9[1]
addsd %xmm9, %xmm10
movapd %xmm0, %xmm9
mulsd %xmm0, %xmm9
addsd %xmm10, %xmm9
ucomisd %xmm8, %xmm9
jbe 0x1299f
movq %xmm9, %xmm8            # xmm8 = xmm9[0],zero
sqrtpd %xmm8, %xmm8
divsd %xmm8, %xmm0
unpcklpd %xmm8, %xmm8            # xmm8 = xmm8[0,0]
divpd %xmm8, %xmm7
movupd %xmm7, 0x228(%rbx)
movsd %xmm0, 0x238(%rbx)
movapd %xmm3, %xmm8
unpcklpd %xmm3, %xmm8            # xmm8 = xmm8[0],xmm3[0]
mulpd %xmm6, %xmm8
addpd %xmm8, %xmm5
movapd %xmm2, %xmm6
unpcklpd %xmm2, %xmm6            # xmm6 = xmm6[0],xmm2[0]
mulpd %xmm7, %xmm6
addpd %xmm5, %xmm6
movupd %xmm6, 0x1f8(%rbx)
mulsd %xmm1, %xmm3
addsd %xmm3, %xmm4
mulsd %xmm0, %xmm2
addsd %xmm4, %xmm2
movsd %xmm2, 0x208(%rbx)
movsd 0x210(%rbx), %xmm2
movsd 0x218(%rbx), %xmm3
movsd 0x228(%rbx), %xmm4
movsd 0x230(%rbx), %xmm5
movapd %xmm1, %xmm6
unpcklpd %xmm2, %xmm6            # xmm6 = xmm6[0],xmm2[0]
mulsd %xmm5, %xmm2
unpcklpd %xmm0, %xmm5            # xmm5 = xmm5[0],xmm0[0]
mulpd %xmm6, %xmm5
movapd %xmm3, %xmm6
unpcklpd %xmm4, %xmm6            # xmm6 = xmm6[0],xmm4[0]
unpcklpd %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
mulpd %xmm6, %xmm0
subpd %xmm5, %xmm0
mulsd %xmm3, %xmm4
subsd %xmm4, %xmm2
movupd %xmm0, 0x240(%rbx)
movsd %xmm2, 0x250(%rbx)
movapd %xmm0, %xmm1
mulpd %xmm0, %xmm1
movapd %xmm1, %xmm3
unpckhpd %xmm1, %xmm3            # xmm3 = xmm3[1],xmm1[1]
addsd %xmm1, %xmm3
movapd %xmm2, %xmm1
mulsd %xmm2, %xmm1
addsd %xmm3, %xmm1
xorpd %xmm3, %xmm3
ucomisd %xmm3, %xmm1
jbe 0x12a91
movq %xmm1, %xmm1            # xmm1 = xmm1[0],zero
sqrtpd %xmm1, %xmm1
divsd %xmm1, %xmm2
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
divpd %xmm1, %xmm0
movupd %xmm0, 0x240(%rbx)
movsd %xmm2, 0x250(%rbx)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x1c0(%rbx)
movl 0xc(%rsp), %eax
movl %eax, 0x1c8(%rbx)
movsd 0x356f(%rip), %xmm0     # 0x16030
divsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x1b8(%rbx)
leaq 0xb0(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
addq %rsi, %rdx
leaq 0xa0(%rsp), %rdi
callq 0x5760
leaq 0xa0(%rsp), %rsi
movq %rbx, %rdi
callq 0x10914
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
je 0x12b25
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0x12b3f
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0xc0(%rsp), %rdi
cmpq %r15, %rdi
je 0x12b5c
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0xd435(%rip), %rsi      # 0x1ff98
leaq 0xe0(%rsp), %rdi
callq 0x3210
leaq 0x160(%rsp), %rdi
callq 0x30e0
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
je 0x12bb1
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x32d0
jmp 0x12bb1
movq %rax, %rbx
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0x12bcb
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0xc0(%rsp), %rdi
cmpq %r15, %rdi
je 0x12be8
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0xd3a9(%rip), %rsi      # 0x1ff98
leaq 0xe0(%rsp), %rdi
callq 0x3210
leaq 0x160(%rsp), %rdi
callq 0x30e0
movq %rbx, %rdi
callq 0x34b0
nop