// File: Olverine[P]TerminalGraphics/./Maths.h
// Function: getView(glm::tvec3<float, (glm::precision)0>, glm::tvec3<float, (glm::precision)0>, glm::tvec3<float, (glm::precision)0>)
mat4 getView(vec3 eye, vec3 target, vec3 up) {
    vec3 zaxis = normalize(eye - target); // The "forward" vector.
    vec3 xaxis = normalize(cross(up, zaxis)); // The "right" vector.
    vec3 yaxis = cross(zaxis, xaxis); // The "up" vector.

    // Create a 4x4 view matrix from the right, up, forward and eye position vectors
    float viewMatrix[16] = {
        xaxis.x, yaxis.x, zaxis.x, 0,
        xaxis.y, yaxis.y, zaxis.y, 0,
        xaxis.z, yaxis.z, zaxis.z, 0,
        -dot(xaxis, eye), -dot(yaxis, eye), -dot(zaxis, eye),  1
    };

    return arrayToMatrix(viewMatrix);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x150(%rbp)
movq %rdi, -0x148(%rbp)
movlpd %xmm0, -0x20(%rbp)
movss %xmm1, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x8(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
movlpd %xmm2, -0x40(%rbp)
movss %xmm3, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
movlpd %xmm4, -0x60(%rbp)
movss %xmm5, -0x58(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0x48(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x4220
movss %xmm1, -0x88(%rbp)
movlpd %xmm0, -0x90(%rbp)
movl -0x88(%rbp), %eax
movl %eax, -0x78(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x41d0
movss %xmm1, -0x98(%rbp)
movlpd %xmm0, -0xa0(%rbp)
movl -0x98(%rbp), %eax
movl %eax, -0x68(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movq %rsi, -0x158(%rbp)
callq 0x4290
movss %xmm1, -0xc8(%rbp)
movlpd %xmm0, -0xd0(%rbp)
movl -0xc8(%rbp), %eax
movl %eax, -0xb8(%rbp)
movq -0xd0(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x41d0
movq -0x158(%rbp), %rdi
movss %xmm1, -0xd8(%rbp)
movlpd %xmm0, -0xe0(%rbp)
movl -0xd8(%rbp), %eax
movl %eax, -0xa8(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0xb0(%rbp), %rsi
callq 0x4290
movss %xmm1, -0xf8(%rbp)
movlpd %xmm0, -0x100(%rbp)
movq -0x100(%rbp), %rax
movq %rax, -0xec(%rbp)
movl -0xf8(%rbp), %eax
movl %eax, -0xe4(%rbp)
movss -0xb0(%rbp), %xmm0
movss %xmm0, -0x140(%rbp)
movss -0xec(%rbp), %xmm0
movss %xmm0, -0x13c(%rbp)
movss -0x70(%rbp), %xmm0
movss %xmm0, -0x138(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x134(%rbp)
movss -0xac(%rbp), %xmm0
movss %xmm0, -0x130(%rbp)
movss -0xe8(%rbp), %xmm0
movss %xmm0, -0x12c(%rbp)
movss -0x6c(%rbp), %xmm0
movss %xmm0, -0x128(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x124(%rbp)
movss -0xa8(%rbp), %xmm0
movss %xmm0, -0x120(%rbp)
movss -0xe4(%rbp), %xmm0
movss %xmm0, -0x11c(%rbp)
movss -0x68(%rbp), %xmm0
movss %xmm0, -0x118(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x114(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x42f0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0x110(%rbp)
leaq -0xec(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x42f0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0x10c(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x42f0
movq -0x150(%rbp), %rdi
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0x108(%rbp)
movss 0x3331(%rip), %xmm0     # 0x6004
movss %xmm0, -0x104(%rbp)
leaq -0x140(%rbp), %rsi
callq 0x27d0
movq -0x148(%rbp), %rax
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
nopw (%rax,%rax)