// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R3Matrix.cpp
// Function: gaps::R3Matrix::Invert()
void R3Matrix::
Invert(void)
{
    // Compute determinant
    RNScalar det = Determinant();
    if (RNIsZero(det, 1E-8)) {
        RNWarning("Unable to invert matrix with zero determinant");
        return;
    }

    // Copy values
    RNScalar m00 = m[0][0]; RNScalar m01 = m[0][1]; RNScalar m02 = m[0][2];
    RNScalar m10 = m[1][0]; RNScalar m11 = m[1][1]; RNScalar m12 = m[1][2];
    RNScalar m20 = m[2][0]; RNScalar m21 = m[2][1]; RNScalar m22 = m[2][2];

    // Compute inverse matrix
    m[0][0] = R3MatrixDet2(m11, m12, m21, m22)/det;
    m[0][1] = R3MatrixDet2(m02, m01, m22, m21)/det;
    m[0][2] = R3MatrixDet2(m01, m02, m11, m12)/det;
    m[1][0] = R3MatrixDet2(m12, m10, m22, m20)/det;
    m[1][1] = R3MatrixDet2(m00, m02, m20, m22)/det;
    m[1][2] = R3MatrixDet2(m02, m00, m12, m10)/det;
    m[2][0] = R3MatrixDet2(m10, m11, m20, m21)/det;
    m[2][1] = R3MatrixDet2(m01, m00, m21, m20)/det;
    m[2][2] = R3MatrixDet2(m00, m01, m10, m11)/det;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x5dad8
movapd 0x35665(%rip), %xmm1    # 0x93270
andpd %xmm0, %xmm1
movsd 0x36151(%rip), %xmm2    # 0x93d68
ucomisd %xmm1, %xmm2
jae 0x5dd4b
movsd (%rbx), %xmm1
movsd 0x20(%rbx), %xmm9
movupd 0x38(%rbx), %xmm5
movupd 0x10(%rbx), %xmm7
movupd 0x28(%rbx), %xmm3
movsd 0x8(%rbx), %xmm10
movapd %xmm3, %xmm2
unpcklpd %xmm10, %xmm2           # xmm2 = xmm2[0],xmm10[0]
movapd 0x353df(%rip), %xmm4    # 0x93030
movapd %xmm5, %xmm6
mulpd %xmm2, %xmm6
xorpd %xmm4, %xmm2
movapd %xmm5, %xmm8
movsd %xmm9, %xmm8            # xmm8 = xmm9[0],xmm8[1]
movapd %xmm7, %xmm11
unpcklpd %xmm1, %xmm11           # xmm11 = xmm11[0],xmm1[0]
movapd %xmm9, %xmm12
unpcklpd %xmm1, %xmm12           # xmm12 = xmm12[0],xmm1[0]
mulsd %xmm9, %xmm1
movapd %xmm9, %xmm13
unpcklpd %xmm7, %xmm13           # xmm13 = xmm13[0],xmm7[0]
mulpd %xmm7, %xmm8
movapd %xmm7, %xmm9
shufpd $0x1, %xmm10, %xmm9     # xmm9 = xmm9[1],xmm10[0]
unpcklpd %xmm3, %xmm10           # xmm10 = xmm10[0],xmm3[0]
mulpd %xmm3, %xmm10
movapd %xmm7, %xmm14
mulpd %xmm7, %xmm2
unpcklpd %xmm7, %xmm7            # xmm7 = xmm7[0,0]
xorpd 0x35377(%rip), %xmm7    # 0x93030
unpckhpd %xmm5, %xmm14           # xmm14 = xmm14[1],xmm5[1]
xorpd %xmm12, %xmm4
unpckhpd %xmm7, %xmm4            # xmm4 = xmm4[1],xmm7[1]
mulpd %xmm3, %xmm4
movapd %xmm3, %xmm7
shufpd $0x1, %xmm5, %xmm7      # xmm7 = xmm7[1],xmm5[0]
movsd %xmm5, %xmm3            # xmm3 = xmm5[0],xmm3[1]
shufpd $0x1, %xmm5, %xmm5      # xmm5 = xmm5[1,0]
mulpd %xmm5, %xmm13
subpd %xmm6, %xmm13
movapd %xmm0, %xmm5
unpcklpd %xmm0, %xmm5            # xmm5 = xmm5[0],xmm0[0]
divpd %xmm5, %xmm13
movupd %xmm13, (%rbx)
subpd %xmm8, %xmm10
divpd %xmm5, %xmm10
movupd %xmm10, 0x10(%rbx)
mulpd %xmm11, %xmm14
addpd %xmm14, %xmm4
divpd %xmm5, %xmm4
shufpd $0x1, %xmm4, %xmm4      # xmm4 = xmm4[1,0]
movupd %xmm4, 0x20(%rbx)
mulpd %xmm12, %xmm7
mulpd %xmm9, %xmm3
subpd %xmm7, %xmm3
divpd %xmm5, %xmm3
movupd %xmm3, 0x30(%rbx)
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm2, %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x40(%rbx)
popq %rbx
retq
leaq 0x3611e(%rip), %rdi     # 0x93e70
xorl %eax, %eax
popq %rbx
jmp 0x68283