// File: /workspace/github_cpp_makefile_star2_O2/logicx24[P]RayTracer/./algebra3.h
// Function: mat4::inverse() const
inline mat4 mat4::inverse()	const    // Gauss-Jordan elimination with partial pivoting
{
    mat4 a(*this),	    // As a evolves from original mat into identity
	 b(identity3D());   // b evolves from identity into inverse(a)
    int i, j, i1;

    // Loop over cols of a from left to right, eliminating above and below diag
    for (j=0; j<4; j++) {   // Find largest pivot in column j among rows j..3
    i1 = j;		    // Row with largest pivot candidate
    for (i=j+1; i<4; i++)
	if (fabs(a.v[i].n[j]) > fabs(a.v[i1].n[j]))
	i1 = i;

    // Swap rows i1 and j in a and b to put pivot on diagonal
    swap(a.v[i1], a.v[j]);
    swap(b.v[i1], b.v[j]);

    // Scale row j to have a unit diagonal
    if (a.v[j].n[j]==0.)
	ALGEBRA_ERROR("mat4::inverse: singular matrix; can't invert\n");
    b.v[j] /= a.v[j].n[j];
    a.v[j] /= a.v[j].n[j];

    // Eliminate off-diagonal elems in col j of a, doing identical ops to b
    for (i=0; i<4; i++)
	if (i!=j) {
	b.v[i] -= a.v[i].n[j]*b.v[j];
	a.v[i] -= a.v[i].n[j]*a.v[j];
	}
    }
    return b;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %r15
leaq -0x100(%rbp), %rdi
callq 0x5bac
movq %r15, %rdi
callq 0x5576
pushq $-0x3
popq %rdx
leaq -0xe0(%rbp), %rcx
movq $0x0, -0x30(%rbp)
xorl %r13d, %r13d
movq %r15, -0x58(%rbp)
cmpq $0x4, %r13
je 0x7132
leaq -0x100(,%r13,8), %rax
addq %rbp, %rax
movq %rcx, -0x68(%rbp)
movq %rdx, -0x70(%rbp)
movl %r13d, %esi
movslq %esi, %rbx
testq %rdx, %rdx
je 0x6fc7
movsd (%rcx), %xmm0
movapd 0xc0bc(%rip), %xmm2     # 0x13060
andpd %xmm2, %xmm0
shlq $0x5, %rbx
movsd (%rax,%rbx), %xmm1
andpd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x6fbe
leal 0x4(%rdx), %esi
incq %rdx
addq $0x20, %rcx
jmp 0x6f90
shlq $0x5, %rbx
leaq (%rbx,%rbp), %rdi
addq $-0x100, %rdi
movq %r13, %r14
shlq $0x5, %r14
leaq (%r14,%rbp), %r12
addq $-0x100, %r12
movq %r12, %rsi
callq 0x7166
addq %r15, %rbx
addq %r15, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7166
movsd (%r12,%r13,8), %xmm0
ucomisd 0xc019(%rip), %xmm0     # 0x13028
jne 0x7017
jnp 0x7147
leaq 0x1(%r13), %rax
movq %rax, -0x60(%rbp)
movq %r14, -0x80(%rbp)
movq %r14, %rdi
callq 0x71a0
movsd (%r12,%r13,8), %xmm0
movq %r12, %rdi
callq 0x71a0
leaq -0x100(%rbp), %r14
movq %r15, %rbx
xorl %r15d, %r15d
movq %r12, -0x78(%rbp)
cmpq $0x4, %r15
je 0x7111
cmpq %r15, %r13
je 0x7101
movq %r13, %r12
movq -0x30(%rbp), %r13
movsd (%r14,%r13), %xmm0
movq -0x80(%rbp), %rax
movsd (%rax), %xmm1
mulsd %xmm0, %xmm1
movsd 0x8(%rax), %xmm2
mulsd %xmm0, %xmm2
movsd 0x10(%rax), %xmm3
mulsd %xmm0, %xmm3
mulsd 0x18(%rax), %xmm0
movsd %xmm1, -0x50(%rbp)
movsd %xmm2, -0x48(%rbp)
movsd %xmm3, -0x40(%rbp)
movsd %xmm0, -0x38(%rbp)
movq %rbx, %rdi
leaq -0x50(%rbp), %rsi
callq 0x71e8
movsd (%r14,%r13), %xmm0
movq %r12, %r13
movq -0x78(%rbp), %r12
movsd (%r12), %xmm1
mulsd %xmm0, %xmm1
movsd 0x8(%r12), %xmm2
mulsd %xmm0, %xmm2
movsd 0x10(%r12), %xmm3
mulsd %xmm0, %xmm3
mulsd 0x18(%r12), %xmm0
movsd %xmm1, -0x50(%rbp)
movsd %xmm2, -0x48(%rbp)
movsd %xmm3, -0x40(%rbp)
movsd %xmm0, -0x38(%rbp)
movq %r14, %rdi
leaq -0x50(%rbp), %rsi
callq 0x71e8
incq %r15
addq $0x20, %rbx
addq $0x20, %r14
jmp 0x704a
movq -0x70(%rbp), %rdx
incq %rdx
movq -0x68(%rbp), %rcx
addq $0x28, %rcx
addq $0x8, -0x30(%rbp)
movq -0x60(%rbp), %r13
movq -0x58(%rbp), %r15
jmp 0x6f70
movq %r15, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc2b4(%rip), %rdi      # 0x13402
leaq 0xc29b(%rip), %rsi      # 0x133f0
leaq 0xc2ac(%rip), %rcx      # 0x13408
movl $0x47d, %edx            # imm = 0x47D
callq 0x3160