#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 */
int /*<<< orphan*/ inverse(float **, float **);
int /*<<< orphan*/ printMatrix(float **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, float *);
int main(int argc, char *argv[]) {
  float a[4][4], a_inv[4][4];
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      scanf("%f", &a[i][j]);
      a_inv[i][j] = 0;
    }
  }
  inverse(a, a_inv);
  printf("Inverse is:\n");
  printMatrix(a_inv);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x94(%rbp)
cmpl   $0x4,-0x94(%rbp)
jge    1204 <main+0xc4>
movl   $0x0,-0x98(%rbp)
cmpl   $0x4,-0x98(%rbp)
jge    11eb <main+0xab>
movslq -0x94(%rbp),%rax
lea    -0x50(%rbp),%rsi
shl    $0x4,%rax
add    %rax,%rsi
movslq -0x98(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe52(%rip),%rdi
call   1060 <scanf@plt>
movslq -0x94(%rbp),%rcx
lea    -0x90(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x98(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    117a <main+0x3a>
jmp    11f0 <main+0xb0>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1163 <main+0x23>
lea    -0x50(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1050 <inverse@plt>
lea    0xde8(%rip),%rdi
call   1030 <printf@plt>
lea    -0x90(%rbp),%rdi
call   1040 <printMatrix@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x88,%rsp
lea    0xeaf(%rip),%rbx
lea    0x40(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
movl   $0x0,(%rsp)
lea    0x44(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movl   $0x0,0x4(%rsp)
lea    0x48(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movl   $0x0,0x8(%rsp)
lea    0x4c(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movl   $0x0,0xc(%rsp)
lea    0x50(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movl   $0x0,0x10(%rsp)
lea    0x54(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movl   $0x0,0x14(%rsp)
lea    0x58(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movl   $0x0,0x18(%rsp)
lea    0x5c(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movl   $0x0,0x1c(%rsp)
lea    0x60(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movl   $0x0,0x20(%rsp)
lea    0x64(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movl   $0x0,0x24(%rsp)
lea    0x68(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movl   $0x0,0x28(%rsp)
lea    0x6c(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movl   $0x0,0x2c(%rsp)
lea    0x70(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movl   $0x0,0x30(%rsp)
lea    0x74(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movl   $0x0,0x34(%rsp)
lea    0x78(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movl   $0x0,0x38(%rsp)
lea    0x7c(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movl   $0x0,0x3c(%rsp)
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <inverse@plt>
lea    0xd4b(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <printMatrix@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [13 x i8] c"Inverse is:\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x [4 x float]]
%7 = alloca [4 x [4 x float]]
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
br label %10
10: ; preds = %35, %2
%11 = load i32, i32* %8
%12 = icmp slt i32 %11, 4
br i1 %12, label %13, label %38
13: ; preds = %10
store i32 0, i32* %9
br label %14
14: ; preds = %31, %13
%15 = load i32, i32* %9
%16 = icmp slt i32 %15, 4
br i1 %16, label %17, label %34
17: ; preds = %14
%18 = load i32, i32* %8
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %6, i64 0, i64 %19
%21 = load i32, i32* %9
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [4 x float], [4 x float]* %20, i64 0, i64 %22
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %23)
%25 = load i32, i32* %8
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %7, i64 0, i64 %26
%28 = load i32, i32* %9
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [4 x float], [4 x float]* %27, i64 0, i64 %29
store float 0.000000e+00, float* %30
br label %31
31: ; preds = %17
%32 = load i32, i32* %9
%33 = add nsw i32 %32, 1
store i32 %33, i32* %9
br label %14
34: ; preds = %14
br label %35
35: ; preds = %34
%36 = load i32, i32* %8
%37 = add nsw i32 %36, 1
store i32 %37, i32* %8
br label %10
38: ; preds = %10
%39 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %6, i64 0, i64 0
%40 = bitcast [4 x float]* %39 to float**
%41 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %7, i64 0, i64 0
%42 = bitcast [4 x float]* %41 to float**
%43 = call i32 @inverse(float** %40, float** %42)
%44 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%45 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %7, i64 0, i64 0
%46 = bitcast [4 x float]* %45 to float**
%47 = call i32 @printMatrix(float** %46)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@str = [12 x i8] c"Inverse is:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4 x [4 x float]]
%4 = alloca [4 x [4 x float]]
%5 = bitcast [4 x [4 x float]]* %3 to i8*
%6 = bitcast [4 x [4 x float]]* %4 to i8*
%7 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %7)
%9 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 0, i64 0
store float 0.000000e+00, float* %9
%10 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 0, i64 1
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %10)
%12 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 0, i64 1
store float 0.000000e+00, float* %12
%13 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 0, i64 2
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %13)
%15 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 0, i64 2
store float 0.000000e+00, float* %15
%16 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 0, i64 3
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %16)
%18 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 0, i64 3
store float 0.000000e+00, float* %18
%19 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 1, i64 0
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %19)
%21 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 1, i64 0
store float 0.000000e+00, float* %21
%22 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 1, i64 1
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %22)
%24 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 1, i64 1
store float 0.000000e+00, float* %24
%25 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 1, i64 2
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %25)
%27 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 1, i64 2
store float 0.000000e+00, float* %27
%28 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 1, i64 3
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %28)
%30 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 1, i64 3
store float 0.000000e+00, float* %30
%31 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 2, i64 0
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %31)
%33 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 2, i64 0
store float 0.000000e+00, float* %33
%34 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 2, i64 1
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %34)
%36 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 2, i64 1
store float 0.000000e+00, float* %36
%37 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 2, i64 2
%38 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %37)
%39 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 2, i64 2
store float 0.000000e+00, float* %39
%40 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 2, i64 3
%41 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %40)
%42 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 2, i64 3
store float 0.000000e+00, float* %42
%43 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 3, i64 0
%44 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %43)
%45 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 3, i64 0
store float 0.000000e+00, float* %45
%46 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 3, i64 1
%47 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %46)
%48 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 3, i64 1
store float 0.000000e+00, float* %48
%49 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 3, i64 2
%50 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %49)
%51 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 3, i64 2
store float 0.000000e+00, float* %51
%52 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 3, i64 3
%53 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %52)
%54 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %4, i64 0, i64 3, i64 3
store float 0.000000e+00, float* %54
%55 = bitcast [4 x [4 x float]]* %3 to float**
%56 = bitcast [4 x [4 x float]]* %4 to float**
%57 = call i32 @inverse(float** %55, float** %56)
%58 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%59 = call i32 @printMatrix(float** %56)
ret i32 0
}