// File: /workspace/github_cpp_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x80, %rsp
leaq -0x90(%rbp), %rax
movsd (%rsi), %xmm0
movsd %xmm0, (%rax)
movsd 0x8(%rsi), %xmm0
movsd %xmm0, 0x8(%rax)
movsd 0x10(%rsi), %xmm0
movsd %xmm0, 0x10(%rax)
movsd 0x18(%rsi), %xmm0
movsd %xmm0, 0x18(%rax)
leaq -0x70(%rbp), %rcx
movsd 0x20(%rsi), %xmm0
movsd %xmm0, (%rcx)
movsd 0x28(%rsi), %xmm0
movsd %xmm0, 0x8(%rcx)
movsd 0x30(%rsi), %xmm0
movsd %xmm0, 0x10(%rcx)
movsd 0x38(%rsi), %xmm0
movsd %xmm0, 0x18(%rcx)
movsd 0x40(%rsi), %xmm0
movsd %xmm0, 0x20(%rcx)
movsd 0x48(%rsi), %xmm0
movsd %xmm0, 0x28(%rcx)
movsd 0x50(%rsi), %xmm0
movsd %xmm0, 0x30(%rcx)
movsd 0x58(%rsi), %xmm0
movsd %xmm0, 0x38(%rcx)
movsd 0x60(%rsi), %xmm0
movsd %xmm0, 0x40(%rcx)
movsd 0x68(%rsi), %xmm0
movsd %xmm0, 0x48(%rcx)
movsd 0x70(%rsi), %xmm0
movsd %xmm0, 0x50(%rcx)
movsd 0x78(%rsi), %xmm0
movsd %xmm0, 0x58(%rcx)
movabsq $0x3ff0000000000000, %rdx # imm = 0x3FF0000000000000
movq %rdx, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movups %xmm0, 0x18(%rdi)
movq %rdx, 0x28(%rdi)
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x40(%rdi)
movq %rdx, 0x50(%rdi)
movups %xmm0, 0x58(%rdi)
movups %xmm0, 0x68(%rdi)
movq %rdx, 0x78(%rdi)
movq $-0x3, %rdx
xorl %esi, %esi
movapd 0xf171(%rip), %xmm0     # 0x17060
xorpd %xmm1, %xmm1
movsd 0xf115(%rip), %xmm2     # 0x17010
xorl %r8d, %r8d
cmpq $0x2, %r8
ja 0x7f47
leaq -0x90(,%r8,8), %r9
addq %rbp, %r9
movq %rdx, %r10
movq %rcx, %r11
movl %r8d, %ebx
movsd (%r11), %xmm3
andpd %xmm0, %xmm3
movslq %ebx, %r14
shlq $0x5, %r14
movsd (%r9,%r14), %xmm4
andpd %xmm0, %xmm4
ucomisd %xmm4, %xmm3
jbe 0x7f3c
leal 0x4(%r10), %ebx
addq $0x20, %r11
incq %r10
jne 0x7f18
jmp 0x7f4a
movl %r8d, %ebx
movslq %ebx, %r11
shlq $0x5, %r11
movq %r8, %r9
shlq $0x5, %r9
leaq (%r9,%rbp), %r10
addq $-0x90, %r10
movsd -0x90(%rbp,%r11), %xmm6
movsd -0x88(%rbp,%r11), %xmm5
movsd -0x80(%rbp,%r11), %xmm4
movsd -0x78(%rbp,%r11), %xmm3
movsd (%r10), %xmm7
movsd %xmm7, -0x90(%rbp,%r11)
movsd 0x8(%r10), %xmm7
movsd %xmm7, -0x88(%rbp,%r11)
movsd 0x10(%r10), %xmm7
movsd %xmm7, -0x80(%rbp,%r11)
movsd 0x18(%r10), %xmm7
movsd %xmm7, -0x78(%rbp,%r11)
movsd %xmm6, (%r10)
movsd %xmm5, 0x8(%r10)
movsd %xmm4, 0x10(%r10)
movsd %xmm3, 0x18(%r10)
movsd (%rdi,%r11), %xmm10
movsd 0x8(%rdi,%r11), %xmm9
movsd 0x10(%rdi,%r11), %xmm8
movsd 0x18(%rdi,%r11), %xmm7
movsd (%rdi,%r9), %xmm11
movsd %xmm11, (%rdi,%r11)
movsd 0x8(%rdi,%r9), %xmm11
movsd %xmm11, 0x8(%rdi,%r11)
movsd 0x10(%rdi,%r9), %xmm11
movsd %xmm11, 0x10(%rdi,%r11)
movsd 0x18(%rdi,%r9), %xmm11
movsd %xmm11, 0x18(%rdi,%r11)
movsd (%r10,%r8,8), %xmm11
ucomisd %xmm1, %xmm11
jne 0x8039
jnp 0x81cf
incq %r8
addq %rdi, %r9
movapd %xmm2, %xmm12
divsd %xmm11, %xmm12
mulsd %xmm12, %xmm10
movsd %xmm10, (%r9)
mulsd %xmm12, %xmm9
movsd %xmm9, 0x8(%r9)
mulsd %xmm12, %xmm8
movsd %xmm8, 0x10(%r9)
mulsd %xmm12, %xmm7
movsd %xmm7, 0x18(%r9)
mulsd %xmm12, %xmm6
movsd %xmm6, (%r10)
mulsd %xmm12, %xmm5
movsd %xmm5, 0x8(%r10)
mulsd %xmm12, %xmm4
movsd %xmm4, 0x10(%r10)
mulsd %xmm12, %xmm3
movsd %xmm3, 0x18(%r10)
xorl %r11d, %r11d
cmpq %r11, %rsi
je 0x8196
movsd (%rax,%r11), %xmm3
movsd (%r9), %xmm4
mulsd %xmm3, %xmm4
movsd 0x8(%r9), %xmm5
mulsd %xmm3, %xmm5
movsd 0x10(%r9), %xmm6
mulsd %xmm3, %xmm6
movsd 0x18(%r9), %xmm7
mulsd %xmm3, %xmm7
movsd (%rdi,%r11), %xmm8
subsd %xmm4, %xmm8
movsd 0x8(%rdi,%r11), %xmm4
subsd %xmm5, %xmm4
movsd %xmm8, (%rdi,%r11)
movsd %xmm4, 0x8(%rdi,%r11)
movsd 0x10(%rdi,%r11), %xmm4
subsd %xmm6, %xmm4
movsd %xmm4, 0x10(%rdi,%r11)
movsd 0x18(%rdi,%r11), %xmm4
subsd %xmm7, %xmm4
movsd %xmm4, 0x18(%rdi,%r11)
movsd (%r10), %xmm4
mulsd %xmm3, %xmm4
movsd 0x8(%r10), %xmm5
mulsd %xmm3, %xmm5
movsd 0x10(%r10), %xmm6
mulsd %xmm3, %xmm6
mulsd 0x18(%r10), %xmm3
movsd -0x90(%rbp,%r11), %xmm7
subsd %xmm4, %xmm7
movsd -0x88(%rbp,%r11), %xmm4
subsd %xmm5, %xmm4
movsd %xmm7, -0x90(%rbp,%r11)
movsd %xmm4, -0x88(%rbp,%r11)
movsd -0x80(%rbp,%r11), %xmm4
subsd %xmm6, %xmm4
movsd %xmm4, -0x80(%rbp,%r11)
movsd -0x78(%rbp,%r11), %xmm4
subsd %xmm3, %xmm4
movsd %xmm4, -0x78(%rbp,%r11)
addq $0x20, %r11
cmpq $0x80, %r11
jne 0x80a2
addq $0x28, %rcx
incq %rdx
addq $0x20, %rsi
addq $0x8, %rax
cmpq $0x4, %r8
jne 0x7efe
movq %rdi, %rax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xf223(%rip), %rdi      # 0x173f9
leaq 0xf20a(%rip), %rsi      # 0x173e7
leaq 0xf21b(%rip), %rcx      # 0x173ff
movl $0x47d, %edx            # imm = 0x47D
callq 0x3150