#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double vector_dot_3d(double *, double *);
int matrix_rigid_body_transform_inverse_4x4d(const double m[16],
                                             double inv[16]) {
  double rot_inv_1[3] = {m[0], m[4], m[8]};
  double rot_inv_2[3] = {m[1], m[5], m[9]};
  double rot_inv_3[3] = {m[2], m[6], m[10]};
  double t_inv[3] = {-m[3], -m[7], -m[11]};
  inv[0] = m[0];
  inv[1] = m[4];
  inv[2] = m[8];
  inv[3] = vector_dot_3d(rot_inv_1, t_inv);
  inv[4] = m[1];
  inv[5] = m[5];
  inv[6] = m[9];
  inv[7] = vector_dot_3d(rot_inv_2, t_inv);
  inv[8] = m[2];
  inv[9] = m[6];
  inv[10] = m[10];
  inv[11] = vector_dot_3d(rot_inv_3, t_inv);
  inv[12] = inv[13] = inv[14] = 0;
  inv[15] = m[15];
  return 0;
}


x86 assembly (clang, -O0):
<matrix_rigid_body_transform_inverse_4x4d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x48(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x50(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x8(%rbp),%rax
movsd  0x58(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
lea    -0x30(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <vector_dot_3d@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x28(%rax)
mov    -0x8(%rbp),%rax
movsd  0x48(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x30(%rax)
lea    -0x50(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <vector_dot_3d@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x38(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x40(%rax)
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x48(%rax)
mov    -0x8(%rbp),%rax
movsd  0x50(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x50(%rax)
lea    -0x70(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <vector_dot_3d@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x58(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x70(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x68(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x60(%rax)
mov    -0x8(%rbp),%rax
movsd  0x78(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x78(%rax)
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_rigid_body_transform_inverse_4x4d>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0x20(%rdi),%xmm1
movsd  %xmm1,0x48(%rsp)
movsd  0x40(%rdi),%xmm1
movsd  %xmm1,0x50(%rsp)
movsd  0x8(%rdi),%xmm1
movsd  %xmm1,0x20(%rsp)
movsd  0x28(%rdi),%xmm1
movsd  %xmm1,0x28(%rsp)
movsd  0x48(%rdi),%xmm1
movsd  %xmm1,0x30(%rsp)
movsd  0x10(%rdi),%xmm1
movsd  %xmm1,(%rsp)
movsd  0x30(%rdi),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x50(%rdi),%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0x18(%rdi),%xmm1
movhps 0x38(%rdi),%xmm1
mov    %rsi,%r14
movaps 0xe6d(%rip),%xmm2
xorps  %xmm2,%xmm1
movaps %xmm1,0x60(%rsp)
movsd  0x58(%rdi),%xmm1
xorps  %xmm2,%xmm1
movlps %xmm1,0x70(%rsp)
movsd  %xmm0,(%rsi)
movsd  0x20(%rdi),%xmm0
movsd  %xmm0,0x8(%rsi)
movsd  0x40(%rdi),%xmm0
movsd  %xmm0,0x10(%rsi)
lea    0x40(%rsp),%rdi
lea    0x60(%rsp),%r15
mov    %r15,%rsi
call   1030 <vector_dot_3d@plt>
movsd  %xmm0,0x18(%r14)
movsd  0x8(%rbx),%xmm0
movsd  %xmm0,0x20(%r14)
movsd  0x28(%rbx),%xmm0
movsd  %xmm0,0x28(%r14)
movsd  0x48(%rbx),%xmm0
movsd  %xmm0,0x30(%r14)
lea    0x20(%rsp),%rdi
mov    %r15,%rsi
call   1030 <vector_dot_3d@plt>
movsd  %xmm0,0x38(%r14)
movsd  0x10(%rbx),%xmm0
movsd  %xmm0,0x40(%r14)
movsd  0x30(%rbx),%xmm0
movsd  %xmm0,0x48(%r14)
movsd  0x50(%rbx),%xmm0
movsd  %xmm0,0x50(%r14)
mov    %rsp,%rdi
mov    %r15,%rsi
call   1030 <vector_dot_3d@plt>
movsd  %xmm0,0x58(%r14)
xorps  %xmm0,%xmm0
movups %xmm0,0x60(%r14)
movq   $0x0,0x70(%r14)
movsd  0x78(%rbx),%xmm0
movsd  %xmm0,0x78(%r14)
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @matrix_rigid_body_transform_inverse_4x4d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca [3 x double]
%6 = alloca [3 x double]
%7 = alloca [3 x double]
%8 = alloca [3 x double]
store double* %0, double** %3
store double* %1, double** %4
%9 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
store double %12, double* %9
%13 = getelementptr inbounds double, double* %9, i64 1
%14 = load double*, double** %3
%15 = getelementptr inbounds double, double* %14, i64 4
%16 = load double, double* %15
store double %16, double* %13
%17 = getelementptr inbounds double, double* %13, i64 1
%18 = load double*, double** %3
%19 = getelementptr inbounds double, double* %18, i64 8
%20 = load double, double* %19
store double %20, double* %17
%21 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%22 = load double*, double** %3
%23 = getelementptr inbounds double, double* %22, i64 1
%24 = load double, double* %23
store double %24, double* %21
%25 = getelementptr inbounds double, double* %21, i64 1
%26 = load double*, double** %3
%27 = getelementptr inbounds double, double* %26, i64 5
%28 = load double, double* %27
store double %28, double* %25
%29 = getelementptr inbounds double, double* %25, i64 1
%30 = load double*, double** %3
%31 = getelementptr inbounds double, double* %30, i64 9
%32 = load double, double* %31
store double %32, double* %29
%33 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%34 = load double*, double** %3
%35 = getelementptr inbounds double, double* %34, i64 2
%36 = load double, double* %35
store double %36, double* %33
%37 = getelementptr inbounds double, double* %33, i64 1
%38 = load double*, double** %3
%39 = getelementptr inbounds double, double* %38, i64 6
%40 = load double, double* %39
store double %40, double* %37
%41 = getelementptr inbounds double, double* %37, i64 1
%42 = load double*, double** %3
%43 = getelementptr inbounds double, double* %42, i64 10
%44 = load double, double* %43
store double %44, double* %41
%45 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
%46 = load double*, double** %3
%47 = getelementptr inbounds double, double* %46, i64 3
%48 = load double, double* %47
%49 = fneg double %48
store double %49, double* %45
%50 = getelementptr inbounds double, double* %45, i64 1
%51 = load double*, double** %3
%52 = getelementptr inbounds double, double* %51, i64 7
%53 = load double, double* %52
%54 = fneg double %53
store double %54, double* %50
%55 = getelementptr inbounds double, double* %50, i64 1
%56 = load double*, double** %3
%57 = getelementptr inbounds double, double* %56, i64 11
%58 = load double, double* %57
%59 = fneg double %58
store double %59, double* %55
%60 = load double*, double** %3
%61 = getelementptr inbounds double, double* %60, i64 0
%62 = load double, double* %61
%63 = load double*, double** %4
%64 = getelementptr inbounds double, double* %63, i64 0
store double %62, double* %64
%65 = load double*, double** %3
%66 = getelementptr inbounds double, double* %65, i64 4
%67 = load double, double* %66
%68 = load double*, double** %4
%69 = getelementptr inbounds double, double* %68, i64 1
store double %67, double* %69
%70 = load double*, double** %3
%71 = getelementptr inbounds double, double* %70, i64 8
%72 = load double, double* %71
%73 = load double*, double** %4
%74 = getelementptr inbounds double, double* %73, i64 2
store double %72, double* %74
%75 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%76 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
%77 = call double @vector_dot_3d(double* %75, double* %76)
%78 = load double*, double** %4
%79 = getelementptr inbounds double, double* %78, i64 3
store double %77, double* %79
%80 = load double*, double** %3
%81 = getelementptr inbounds double, double* %80, i64 1
%82 = load double, double* %81
%83 = load double*, double** %4
%84 = getelementptr inbounds double, double* %83, i64 4
store double %82, double* %84
%85 = load double*, double** %3
%86 = getelementptr inbounds double, double* %85, i64 5
%87 = load double, double* %86
%88 = load double*, double** %4
%89 = getelementptr inbounds double, double* %88, i64 5
store double %87, double* %89
%90 = load double*, double** %3
%91 = getelementptr inbounds double, double* %90, i64 9
%92 = load double, double* %91
%93 = load double*, double** %4
%94 = getelementptr inbounds double, double* %93, i64 6
store double %92, double* %94
%95 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%96 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
%97 = call double @vector_dot_3d(double* %95, double* %96)
%98 = load double*, double** %4
%99 = getelementptr inbounds double, double* %98, i64 7
store double %97, double* %99
%100 = load double*, double** %3
%101 = getelementptr inbounds double, double* %100, i64 2
%102 = load double, double* %101
%103 = load double*, double** %4
%104 = getelementptr inbounds double, double* %103, i64 8
store double %102, double* %104
%105 = load double*, double** %3
%106 = getelementptr inbounds double, double* %105, i64 6
%107 = load double, double* %106
%108 = load double*, double** %4
%109 = getelementptr inbounds double, double* %108, i64 9
store double %107, double* %109
%110 = load double*, double** %3
%111 = getelementptr inbounds double, double* %110, i64 10
%112 = load double, double* %111
%113 = load double*, double** %4
%114 = getelementptr inbounds double, double* %113, i64 10
store double %112, double* %114
%115 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%116 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
%117 = call double @vector_dot_3d(double* %115, double* %116)
%118 = load double*, double** %4
%119 = getelementptr inbounds double, double* %118, i64 11
store double %117, double* %119
%120 = load double*, double** %4
%121 = getelementptr inbounds double, double* %120, i64 14
store double 0.000000e+00, double* %121
%122 = load double*, double** %4
%123 = getelementptr inbounds double, double* %122, i64 13
store double 0.000000e+00, double* %123
%124 = load double*, double** %4
%125 = getelementptr inbounds double, double* %124, i64 12
store double 0.000000e+00, double* %125
%126 = load double*, double** %3
%127 = getelementptr inbounds double, double* %126, i64 15
%128 = load double, double* %127
%129 = load double*, double** %4
%130 = getelementptr inbounds double, double* %129, i64 15
store double %128, double* %130
ret i32 0
}

LLVM IR (-O2):
define i32 @matrix_rigid_body_transform_inverse_4x4d(double* nocapture %0, double* nocapture writeonly %1) {
%3 = alloca [3 x double]
%4 = alloca [3 x double]
%5 = alloca [3 x double]
%6 = alloca [3 x double]
%7 = bitcast [3 x double]* %3 to i8*
%8 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%9 = load double, double* %0
store double %9, double* %8
%10 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 1
%11 = getelementptr inbounds double, double* %0, i64 4
%12 = load double, double* %11
store double %12, double* %10
%13 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 2
%14 = getelementptr inbounds double, double* %0, i64 8
%15 = load double, double* %14
store double %15, double* %13
%16 = bitcast [3 x double]* %4 to i8*
%17 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%18 = getelementptr inbounds double, double* %0, i64 1
%19 = load double, double* %18
store double %19, double* %17
%20 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 1
%21 = getelementptr inbounds double, double* %0, i64 5
%22 = load double, double* %21
store double %22, double* %20
%23 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 2
%24 = getelementptr inbounds double, double* %0, i64 9
%25 = load double, double* %24
store double %25, double* %23
%26 = bitcast [3 x double]* %5 to i8*
%27 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%28 = getelementptr inbounds double, double* %0, i64 2
%29 = load double, double* %28
store double %29, double* %27
%30 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 1
%31 = getelementptr inbounds double, double* %0, i64 6
%32 = load double, double* %31
store double %32, double* %30
%33 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 2
%34 = getelementptr inbounds double, double* %0, i64 10
%35 = load double, double* %34
store double %35, double* %33
%36 = bitcast [3 x double]* %6 to i8*
%37 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%38 = getelementptr inbounds double, double* %0, i64 3
%39 = load double, double* %38
%40 = getelementptr inbounds double, double* %0, i64 7
%41 = load double, double* %40
%42 = insertelement <2 x double> poison, double %39, i64 0
%43 = insertelement <2 x double> %42, double %41, i64 1
%44 = fneg <2 x double> %43
%45 = bitcast [3 x double]* %6 to <2 x double>*
store <2 x double> %44, <2 x double>* %45
%46 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 2
%47 = getelementptr inbounds double, double* %0, i64 11
%48 = load double, double* %47
%49 = fneg double %48
store double %49, double* %46
store double %9, double* %1
%50 = load double, double* %11
%51 = getelementptr inbounds double, double* %1, i64 1
store double %50, double* %51
%52 = load double, double* %14
%53 = getelementptr inbounds double, double* %1, i64 2
store double %52, double* %53
%54 = call double @vector_dot_3d(double* %8, double* %37)
%55 = getelementptr inbounds double, double* %1, i64 3
store double %54, double* %55
%56 = load double, double* %18
%57 = getelementptr inbounds double, double* %1, i64 4
store double %56, double* %57
%58 = load double, double* %21
%59 = getelementptr inbounds double, double* %1, i64 5
store double %58, double* %59
%60 = load double, double* %24
%61 = getelementptr inbounds double, double* %1, i64 6
store double %60, double* %61
%62 = call double @vector_dot_3d(double* %17, double* %37)
%63 = getelementptr inbounds double, double* %1, i64 7
store double %62, double* %63
%64 = load double, double* %28
%65 = getelementptr inbounds double, double* %1, i64 8
store double %64, double* %65
%66 = load double, double* %31
%67 = getelementptr inbounds double, double* %1, i64 9
store double %66, double* %67
%68 = load double, double* %34
%69 = getelementptr inbounds double, double* %1, i64 10
store double %68, double* %69
%70 = call double @vector_dot_3d(double* %27, double* %37)
%71 = getelementptr inbounds double, double* %1, i64 11
store double %70, double* %71
%72 = getelementptr inbounds double, double* %1, i64 12
%73 = getelementptr inbounds double, double* %0, i64 15
%74 = bitcast double* %72 to i8*
%75 = load double, double* %73
%76 = getelementptr inbounds double, double* %1, i64 15
store double %75, double* %76
ret i32 0
}