// File: IsaacLaw12[P]RayTracer/./src/Transformation.cpp
// Function: Transformation::Transformation(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Transformation::Transformation(std::string driver_string){
    // driver_string "model wx wy wz angle scale tx ty tz cube.obj"
    std::stringstream driver(driver_string);
    double transform_floats[8] = {};
    std::string driver_type = "";
    driver >> driver_type;

    double temp = 0;
    int counter = 0;
    while (driver >> temp){
        transform_floats[counter++] = temp;
    }
    if (counter != 8){
        // The correct transform numbers were not found
        std::cout << "WRONG NUMBERS OF MODEL ATTRIBUTES FOUND" << "\n";
        load_successful = false;
        return;
    }
    create_transform_matrix(transform_floats);
    generate_transform_matrix();

    driver.clear();
    driver >> smoothing;
    driver >> asset_name;
    driver >> lighting_group;
    driver >> animation_file;
    if (asset_name.length() == 0)
        std::cout << "Invalid driver_string: " << driver_string << std::endl;
}

// Assembly:
subq $0x2f8, %rsp            # imm = 0x2F8
movq %rsi, 0x88(%rsp)
movq %rdi, 0x2f0(%rsp)
movq %rsi, 0x2e8(%rsp)
movq 0x2f0(%rsp), %rax
movq %rax, 0x98(%rsp)
movq %rax, 0x90(%rsp)
leaq 0x2e7(%rsp), %rdi
movq %rdi, 0xa0(%rsp)
callq 0x45f0
movq 0x98(%rsp), %rdi
movq 0xa0(%rsp), %rdx
leaq 0x1da4b(%rip), %rsi     # 0x61dfe
callq 0x11e60
jmp 0x443ba
leaq 0x2e7(%rsp), %rdi
callq 0x43c0
movq 0x90(%rsp), %rax
addq $0x20, %rax
movq %rax, 0x78(%rsp)
leaq 0x2d3(%rsp), %rdi
movq %rdi, 0x80(%rsp)
callq 0x45f0
movq 0x78(%rsp), %rdi
movq 0x80(%rsp), %rdx
leaq 0x1d9fd(%rip), %rsi     # 0x61dfe
callq 0x11e60
jmp 0x44408
leaq 0x2d3(%rsp), %rdi
callq 0x43c0
movq 0x90(%rsp), %rax
addq $0x50, %rax
movq %rax, 0x70(%rsp)
leaq 0x2d0(%rsp), %rdi
callq 0x45840
jmp 0x44435
movq 0x70(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
callq 0x45890
jmp 0x44449
movq 0x90(%rsp), %rax
addq $0xd0, %rax
movq %rax, 0x68(%rsp)
leaq 0x2cd(%rsp), %rdi
callq 0x45840
jmp 0x4446b
movq 0x68(%rsp), %rdi
leaq 0x2cd(%rsp), %rsi
callq 0x45890
jmp 0x4447f
movq 0x90(%rsp), %rax
addq $0x150, %rax            # imm = 0x150
movq %rax, 0x60(%rsp)
leaq 0x2ca(%rsp), %rdi
callq 0x45840
jmp 0x444a1
movq 0x60(%rsp), %rdi
leaq 0x2ca(%rsp), %rsi
callq 0x45890
jmp 0x444b5
movq 0x90(%rsp), %rax
addq $0x1d0, %rax            # imm = 0x1D0
movq %rax, 0x58(%rsp)
leaq 0x2c7(%rsp), %rdi
callq 0x45840
jmp 0x444d7
movq 0x58(%rsp), %rdi
leaq 0x2c7(%rsp), %rsi
callq 0x45890
jmp 0x444eb
movq 0x90(%rsp), %rax
addq $0x250, %rax            # imm = 0x250
movq %rax, 0x50(%rsp)
leaq 0x2b0(%rsp), %rdi
callq 0x458d0
jmp 0x4450d
movq 0x50(%rsp), %rdi
leaq 0x2b0(%rsp), %rsi
callq 0x45900
jmp 0x44521
movq 0x90(%rsp), %rax
movb $0x1, 0x2d0(%rax)
addq $0x2d8, %rax            # imm = 0x2D8
movq %rax, 0x40(%rsp)
leaq 0x2af(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x45f0
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rdx
leaq 0x1d8a0(%rip), %rsi     # 0x61dfe
callq 0x11e60
jmp 0x44565
leaq 0x2af(%rsp), %rdi
callq 0x43c0
movq 0x90(%rsp), %rax
movl $0x0, 0x2f8(%rax)
movl $0x10, %edi
movl $0x8, %esi
callq 0x11e40
movl %eax, 0x3c(%rsp)
jmp 0x44599
movl 0x3c(%rsp), %edx
movq 0x88(%rsp), %rsi
leaq 0x120(%rsp), %rdi
callq 0x4520
jmp 0x445b4
xorps %xmm0, %xmm0
movaps %xmm0, 0x110(%rsp)
movaps %xmm0, 0x100(%rsp)
movaps %xmm0, 0xf0(%rsp)
movaps %xmm0, 0xe0(%rsp)
leaq 0xbf(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x45f0
movq 0x30(%rsp), %rdx
leaq 0x1d809(%rip), %rsi     # 0x61dfe
leaq 0xc0(%rsp), %rdi
callq 0x11e60
jmp 0x44604
leaq 0xbf(%rsp), %rdi
callq 0x43c0
leaq 0x120(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x4450
jmp 0x44628
xorps %xmm0, %xmm0
movsd %xmm0, 0xb0(%rsp)
movl $0x0, 0xac(%rsp)
leaq 0x120(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x42e0
movq %rax, 0x28(%rsp)
jmp 0x4465b
movq 0x28(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x4440
movb %al, 0x27(%rsp)
jmp 0x44675
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0x44682
jmp 0x4479b
movsd 0xb0(%rsp), %xmm0
movl 0xac(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0xac(%rsp)
cltq
movsd %xmm0, 0xe0(%rsp,%rax,8)
jmp 0x4463f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2d8(%rsp)
movl %eax, 0x2d4(%rsp)
leaq 0x2e7(%rsp), %rdi
callq 0x43c0
jmp 0x44958
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2d8(%rsp)
movl %eax, 0x2d4(%rsp)
leaq 0x2d3(%rsp), %rdi
callq 0x43c0
jmp 0x4494b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2d8(%rsp)
movl %eax, 0x2d4(%rsp)
jmp 0x44941
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2d8(%rsp)
movl %eax, 0x2d4(%rsp)
leaq 0x2af(%rsp), %rdi
callq 0x43c0
jmp 0x44941
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2d8(%rsp)
movl %eax, 0x2d4(%rsp)
jmp 0x44937
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2d8(%rsp)
movl %eax, 0x2d4(%rsp)
leaq 0xbf(%rsp), %rdi
callq 0x43c0
jmp 0x4492a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2d8(%rsp)
movl %eax, 0x2d4(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x4200
jmp 0x4492a
cmpl $0x8, 0xac(%rsp)
je 0x447f1
movq 0x56814(%rip), %rdi     # 0x9afc0
leaq 0x27dad(%rip), %rsi     # 0x6c560
callq 0x4360
movq %rax, 0x18(%rsp)
jmp 0x447bf
movq 0x18(%rsp), %rdi
leaq 0x1d632(%rip), %rsi     # 0x61dfd
callq 0x4360
jmp 0x447d2
movq 0x90(%rsp), %rax
movb $0x0, 0x2d0(%rax)
movl $0x1, 0xa8(%rsp)
jmp 0x44908
movq 0x90(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x44970
jmp 0x44808
movq 0x90(%rsp), %rdi
callq 0x451c0
jmp 0x44817
movq 0x120(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x120(%rsp,%rax), %rdi
xorl %esi, %esi
callq 0x4580
jmp 0x44834
movq 0x90(%rsp), %rsi
addq $0x2d8, %rsi            # imm = 0x2D8
leaq 0x120(%rsp), %rdi
callq 0x4450
jmp 0x44852
movq 0x90(%rsp), %rsi
leaq 0x120(%rsp), %rdi
callq 0x4450
jmp 0x44869
movq 0x90(%rsp), %rsi
addq $0x2f8, %rsi            # imm = 0x2F8
leaq 0x120(%rsp), %rdi
callq 0x41f0
jmp 0x44887
movq 0x90(%rsp), %rsi
addq $0x20, %rsi
leaq 0x120(%rsp), %rdi
callq 0x4450
jmp 0x448a2
movq 0x90(%rsp), %rdi
callq 0x44f0
cmpq $0x0, %rax
jne 0x448fd
movq 0x56704(%rip), %rdi     # 0x9afc0
leaq 0x27cc5(%rip), %rsi     # 0x6c588
callq 0x4360
movq %rax, 0x10(%rsp)
jmp 0x448cf
movq 0x88(%rsp), %rsi
movq 0x10(%rsp), %rdi
callq 0x4340
movq %rax, 0x8(%rsp)
jmp 0x448e8
movq 0x8(%rsp), %rdi
movq 0x5669c(%rip), %rsi     # 0x9af90
callq 0x43a0
jmp 0x448fb
jmp 0x448fd
movl $0x0, 0xa8(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x4200
leaq 0x120(%rsp), %rdi
callq 0x4290
addq $0x2f8, %rsp            # imm = 0x2F8
retq
leaq 0x120(%rsp), %rdi
callq 0x4290
movq 0x40(%rsp), %rdi
callq 0x4200
movq 0x78(%rsp), %rdi
callq 0x4200
movq 0x98(%rsp), %rdi
callq 0x4200
movq 0x2d8(%rsp), %rdi
callq 0x45e0
nopw %cs:(%rax,%rax)