// File: 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:
subq $0x4c8, %rsp            # imm = 0x4C8
movq %rsi, 0x90(%rsp)
movq %rdi, 0x4c0(%rsp)
movq %rsi, 0x4b8(%rsp)
movq 0x4c0(%rsp), %rax
movq %rax, 0x88(%rsp)
movl $0x10, %edi
movl $0x8, %esi
callq 0x11e40
movq 0x90(%rsp), %rsi
movl %eax, %edx
leaq 0x330(%rsp), %rdi
movq %rdi, 0x98(%rsp)
callq 0x4520
leaq 0x310(%rsp), %rdi
movq %rdi, 0xa0(%rsp)
callq 0x4490
leaq 0x2f0(%rsp), %rdi
callq 0x4490
movq 0x98(%rsp), %rdi
movq 0xa0(%rsp), %rsi
callq 0x4450
movq %rax, 0xa8(%rsp)
jmp 0x4f0ee
movq 0xa8(%rsp), %rdi
leaq 0x2e8(%rsp), %rsi
callq 0x42e0
movq %rax, 0x80(%rsp)
jmp 0x4f10d
movq 0x80(%rsp), %rdi
leaq 0x2e0(%rsp), %rsi
callq 0x42e0
movq %rax, 0x78(%rsp)
jmp 0x4f129
movq 0x78(%rsp), %rdi
leaq 0x2d8(%rsp), %rsi
callq 0x42e0
movq %rax, 0x70(%rsp)
jmp 0x4f142
movq 0x70(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
callq 0x42e0
movq %rax, 0x68(%rsp)
jmp 0x4f15b
movq 0x68(%rsp), %rdi
leaq 0x2c8(%rsp), %rsi
callq 0x42e0
movq %rax, 0x60(%rsp)
jmp 0x4f174
movq 0x60(%rsp), %rdi
leaq 0x2c0(%rsp), %rsi
callq 0x42e0
movq %rax, 0x58(%rsp)
jmp 0x4f18d
movq 0x58(%rsp), %rdi
leaq 0x2b8(%rsp), %rsi
callq 0x42e0
movq %rax, 0x50(%rsp)
jmp 0x4f1a6
movq 0x50(%rsp), %rdi
leaq 0x2b0(%rsp), %rsi
callq 0x42e0
movq %rax, 0x48(%rsp)
jmp 0x4f1bf
movq 0x48(%rsp), %rdi
leaq 0x2a8(%rsp), %rsi
callq 0x42e0
movq %rax, 0x40(%rsp)
jmp 0x4f1d8
movq 0x40(%rsp), %rdi
leaq 0x2a0(%rsp), %rsi
callq 0x42e0
movq %rax, 0x38(%rsp)
jmp 0x4f1f1
movq 0x38(%rsp), %rdi
leaq 0x298(%rsp), %rsi
callq 0x42e0
movq %rax, 0x30(%rsp)
jmp 0x4f20a
movq 0x30(%rsp), %rdi
leaq 0x290(%rsp), %rsi
callq 0x42e0
movq %rax, 0x28(%rsp)
jmp 0x4f223
movq 0x28(%rsp), %rdi
leaq 0x288(%rsp), %rsi
callq 0x42e0
movq %rax, 0x20(%rsp)
jmp 0x4f23c
movq 0x20(%rsp), %rdi
leaq 0x284(%rsp), %rsi
callq 0x41f0
movq %rax, 0x18(%rsp)
jmp 0x4f255
movq 0x18(%rsp), %rdi
leaq 0x280(%rsp), %rsi
callq 0x41f0
movq %rax, 0x10(%rsp)
jmp 0x4f26e
movq 0x10(%rsp), %rdi
leaq 0x2f0(%rsp), %rsi
callq 0x4450
jmp 0x4f282
movq 0x88(%rsp), %rax
movsd 0x2d0(%rsp), %xmm0
movsd %xmm0, 0x1d0(%rax)
movsd 0x2c8(%rsp), %xmm0
movsd %xmm0, 0x1d8(%rax)
leaq 0x258(%rsp), %rdi
leaq 0x2e8(%rsp), %rsi
leaq 0x2e0(%rsp), %rdx
leaq 0x2d8(%rsp), %rcx
callq 0x9c70
jmp 0x4f2d3
movq 0x88(%rsp), %rdi
addq $0x1e0, %rdi            # imm = 0x1E0
leaq 0x258(%rsp), %rsi
callq 0x9d10
leaq 0x240(%rsp), %rdi
leaq 0x2c0(%rsp), %rsi
leaq 0x2b8(%rsp), %rdx
leaq 0x2b0(%rsp), %rcx
callq 0x9c70
jmp 0x4f316
movq 0x88(%rsp), %rdi
addq $0x210, %rdi            # imm = 0x210
leaq 0x240(%rsp), %rsi
callq 0x9d10
leaq 0x228(%rsp), %rdi
leaq 0x2a8(%rsp), %rsi
leaq 0x2a0(%rsp), %rdx
leaq 0x298(%rsp), %rcx
callq 0x9c70
jmp 0x4f359
movq 0x88(%rsp), %rdi
addq $0x228, %rdi            # imm = 0x228
leaq 0x228(%rsp), %rsi
callq 0x9d10
movq 0x88(%rsp), %rsi
addq $0x210, %rsi            # imm = 0x210
leaq 0x210(%rsp), %rdi
callq 0x9d50
jmp 0x4f393
movq 0x88(%rsp), %rdi
addq $0x210, %rdi            # imm = 0x210
leaq 0x210(%rsp), %rsi
callq 0x9e50
jmp 0x4f3b1
movq 0x88(%rsp), %rsi
addq $0x228, %rsi            # imm = 0x228
leaq 0x1f8(%rsp), %rdi
callq 0x9d50
jmp 0x4f3cf
movq 0x88(%rsp), %rdi
addq $0x228, %rdi            # imm = 0x228
leaq 0x1f8(%rsp), %rsi
callq 0x9e50
jmp 0x4f3ed
movq 0x88(%rsp), %rdx
movq %rdx, %rax
addq $0x1e0, %rax            # imm = 0x1E0
movq %rax, 0x8(%rsp)
movq %rdx, %rsi
addq $0x1d0, %rsi            # imm = 0x1D0
addq $0x210, %rdx            # imm = 0x210
leaq 0x128(%rsp), %rdi
callq 0xa310
jmp 0x4f423
movq 0x8(%rsp), %rsi
leaq 0x150(%rsp), %rdi
leaq 0x128(%rsp), %rdx
callq 0xa2a0
jmp 0x4f43f
movq 0x88(%rsp), %rdx
movq %rdx, %rsi
addq $0x1d8, %rsi            # imm = 0x1D8
addq $0x228, %rdx            # imm = 0x228
leaq 0x100(%rsp), %rdi
callq 0xa310
jmp 0x4f467
leaq 0x188(%rsp), %rdi
leaq 0x150(%rsp), %rsi
leaq 0x100(%rsp), %rdx
callq 0xa3d0
jmp 0x4f486
movq 0x88(%rsp), %rdi
addq $0x1f8, %rdi            # imm = 0x1F8
leaq 0x188(%rsp), %rsi
callq 0x50a80
jmp 0x4f4a4
movq 0x88(%rsp), %rdx
movq %rdx, %rsi
addq $0x210, %rsi            # imm = 0x210
addq $0x228, %rdx            # imm = 0x228
leaq 0xe8(%rsp), %rdi
callq 0xa000
jmp 0x4f4cc
movq 0x88(%rsp), %rdi
addq $0x240, %rdi            # imm = 0x240
movq %rdi, (%rsp)
leaq 0xe8(%rsp), %rsi
callq 0x9d10
movq (%rsp), %rsi
leaq 0xd0(%rsp), %rdi
callq 0x9d50
jmp 0x4f4ff
movq 0x88(%rsp), %rdi
addq $0x240, %rdi            # imm = 0x240
leaq 0xd0(%rsp), %rsi
callq 0x9e50
jmp 0x4f51d
movq 0x88(%rsp), %rax
movsd 0x288(%rsp), %xmm0
movsd %xmm0, 0x1c0(%rax)
movl 0x284(%rsp), %ecx
movl %ecx, 0x1c8(%rax)
movsd 0x290(%rsp), %xmm1
movsd 0xdab4(%rip), %xmm0     # 0x5d008
divsd %xmm1, %xmm0
movsd %xmm0, 0x1b8(%rax)
leaq 0xb0(%rsp), %rdi
leaq 0x2f0(%rsp), %rsi
callq 0x4130
jmp 0x4f577
movq 0x88(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x43230
jmp 0x4f58e
leaq 0xb0(%rsp), %rdi
callq 0x4200
leaq 0x2f0(%rsp), %rdi
callq 0x4200
leaq 0x310(%rsp), %rdi
callq 0x4200
leaq 0x330(%rsp), %rdi
callq 0x4290
addq $0x4c8, %rsp            # imm = 0x4C8
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x278(%rsp)
movl %eax, 0x274(%rsp)
jmp 0x4f601
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x278(%rsp)
movl %eax, 0x274(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x4200
leaq 0x2f0(%rsp), %rdi
callq 0x4200
leaq 0x310(%rsp), %rdi
callq 0x4200
leaq 0x330(%rsp), %rdi
callq 0x4290
movq 0x278(%rsp), %rdi
callq 0x45e0
nopw %cs:(%rax,%rax)