#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*/ printf(char *, ...);
int /*<<< orphan*/ reduction(float **, int, int, int);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float matrix[3][6];
  int i, j;
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 6; j++) {
      if (j == i + 3) {
        matrix[i][j] = (float)1;
      } else {
        matrix[i][j] = (float)0;
      }
    }
  }
  printf("\nEnter a 3 X 3 Matrix :");
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      scanf("%f", &matrix[i][j]);
    }
  }
  for (i = 0; i < 3; i++) {
    reduction(matrix, 3, i, i);
  }
  printf("\nInverse Matrix");
  for (i = 0; i < 3; i++) {
    printf("\n");
    for (j = 0; j < 3; j++) {
      printf("%8.3f", matrix[i][j + 3]);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x54(%rbp)
cmpl   $0x3,-0x54(%rbp)
jge    11d8 <main+0xa8>
movl   $0x0,-0x58(%rbp)
cmpl   $0x6,-0x58(%rbp)
jge    11c5 <main+0x95>
mov    -0x58(%rbp),%eax
mov    -0x54(%rbp),%ecx
add    $0x3,%ecx
cmp    %ecx,%eax
jne    1197 <main+0x67>
movslq -0x54(%rbp),%rcx
lea    -0x50(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x58(%rbp),%rcx
movss  0xe73(%rip),%xmm0
movss  %xmm0,(%rax,%rcx,4)
jmp    11b2 <main+0x82>
movslq -0x54(%rbp),%rcx
lea    -0x50(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x58(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
jmp    11b7 <main+0x87>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    1157 <main+0x27>
jmp    11ca <main+0x9a>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1146 <main+0x16>
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x54(%rbp)
cmpl   $0x3,-0x54(%rbp)
jge    124f <main+0x11f>
movl   $0x0,-0x58(%rbp)
cmpl   $0x3,-0x58(%rbp)
jge    123c <main+0x10c>
movslq -0x54(%rbp),%rax
lea    -0x50(%rbp),%rsi
imul   $0x18,%rax,%rax
add    %rax,%rsi
movslq -0x58(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xdf3(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    11fe <main+0xce>
jmp    1241 <main+0x111>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    11ed <main+0xbd>
movl   $0x0,-0x54(%rbp)
cmpl   $0x3,-0x54(%rbp)
jge    1282 <main+0x152>
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%edx
mov    -0x54(%rbp),%ecx
mov    $0x3,%esi
call   1030 <reduction@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1256 <main+0x126>
lea    0xd96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x54(%rbp)
cmpl   $0x3,-0x54(%rbp)
jge    1310 <main+0x1e0>
lea    0xd87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x58(%rbp)
cmpl   $0x3,-0x58(%rbp)
jge    12fd <main+0x1cd>
movslq -0x54(%rbp),%rcx
lea    -0x50(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mov    -0x58(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd49(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    12b6 <main+0x186>
jmp    1302 <main+0x1d2>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1297 <main+0x167>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
lea    0x4(%rsp),%r13
lea    0x8(%rsp),%r12
movaps 0xea1(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x18(%rsp),%r15
lea    0x1c(%rsp),%rbp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x20(%rsp)
movl   $0x3f800000,0x28(%rsp)
3f
movups %xmm0,0x2c(%rsp)
movq   $0x0,0x3c(%rsp)
movl   $0x3f800000,0x44(%rsp)
3f
lea    0xe6d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe77(%rip),%r14
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %r14,%rdi
mov    %r13,%rsi
call   1060 <scanf@plt>
mov    %r14,%rdi
mov    %r12,%rsi
call   1060 <scanf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1060 <scanf@plt>
mov    %r14,%rdi
lea    0x20(%rsp),%rsi
call   1060 <scanf@plt>
mov    %r14,%rdi
lea    0x30(%rsp),%rsi
call   1060 <scanf@plt>
mov    %r14,%rdi
lea    0x34(%rsp),%rsi
call   1060 <scanf@plt>
mov    %r14,%rdi
lea    0x38(%rsp),%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <reduction@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
call   1040 <reduction@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x2,%edx
mov    $0x2,%ecx
call   1040 <reduction@plt>
lea    0xdc6(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdb4(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movss  0x24(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x28(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x2c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movss  0x3c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x40(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x44(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"\0AEnter a 3 X 3 Matrix :\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [16 x i8] c"\0AInverse Matrix\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [6 x i8] c"%8.3f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x [6 x float]]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %5
5: ; preds = %36, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %39
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %32, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 6
br i1 %11, label %12, label %35
12: ; preds = %9
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 3
%16 = icmp eq i32 %13, %15
br i1 %16, label %17, label %24
17: ; preds = %12
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [3 x [6 x float]], [3 x [6 x float]]* %2, i64 0, i64 %19
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [6 x float], [6 x float]* %20, i64 0, i64 %22
store float 1.000000e+00, float* %23
br label %31
24: ; preds = %12
%25 = load i32, i32* %3
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [3 x [6 x float]], [3 x [6 x float]]* %2, i64 0, i64 %26
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [6 x float], [6 x float]* %27, i64 0, i64 %29
store float 0.000000e+00, float* %30
br label %31
31: ; preds = %24, %17
br label %32
32: ; preds = %31
%33 = load i32, i32* %4
%34 = add nsw i32 %33, 1
store i32 %34, i32* %4
br label %9
35: ; preds = %9
br label %36
36: ; preds = %35
%37 = load i32, i32* %3
%38 = add nsw i32 %37, 1
store i32 %38, i32* %3
br label %5
39: ; preds = %5
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %41
41: ; preds = %60, %39
%42 = load i32, i32* %3
%43 = icmp slt i32 %42, 3
br i1 %43, label %44, label %63
44: ; preds = %41
store i32 0, i32* %4
br label %45
45: ; preds = %56, %44
%46 = load i32, i32* %4
%47 = icmp slt i32 %46, 3
br i1 %47, label %48, label %59
48: ; preds = %45
%49 = load i32, i32* %3
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [3 x [6 x float]], [3 x [6 x float]]* %2, i64 0, i64 %50
%52 = load i32, i32* %4
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [6 x float], [6 x float]* %51, i64 0, i64 %53
%55 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %54)
br label %56
56: ; preds = %48
%57 = load i32, i32* %4
%58 = add nsw i32 %57, 1
store i32 %58, i32* %4
br label %45
59: ; preds = %45
br label %60
60: ; preds = %59
%61 = load i32, i32* %3
%62 = add nsw i32 %61, 1
store i32 %62, i32* %3
br label %41
63: ; preds = %41
store i32 0, i32* %3
br label %64
64: ; preds = %73, %63
%65 = load i32, i32* %3
%66 = icmp slt i32 %65, 3
br i1 %66, label %67, label %76
67: ; preds = %64
%68 = getelementptr inbounds [3 x [6 x float]], [3 x [6 x float]]* %2, i64 0, i64 0
%69 = bitcast [6 x float]* %68 to float**
%70 = load i32, i32* %3
%71 = load i32, i32* %3
%72 = call i32 @reduction(float** %69, i32 3, i32 %70, i32 %71)
br label %73
73: ; preds = %67
%74 = load i32, i32* %3
%75 = add nsw i32 %74, 1
store i32 %75, i32* %3
br label %64
76: ; preds = %64
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %78
78: ; preds = %101, %76
%79 = load i32, i32* %3
%80 = icmp slt i32 %79, 3
br i1 %80, label %81, label %104
81: ; preds = %78
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %4
br label %83
83: ; preds = %97, %81
%84 = load i32, i32* %4
%85 = icmp slt i32 %84, 3
br i1 %85, label %86, label %100
86: ; preds = %83
%87 = load i32, i32* %3
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [3 x [6 x float]], [3 x [6 x float]]* %2, i64 0, i64 %88
%90 = load i32, i32* %4
%91 = add nsw i32 %90, 3
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [6 x float], [6 x float]* %89, i64 0, i64 %92
%94 = load float, float* %93
%95 = fpext float %94 to double
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %95)
br label %97
97: ; preds = %86
%98 = load i32, i32* %4
%99 = add nsw i32 %98, 1
store i32 %99, i32* %4
br label %83
100: ; preds = %83
br label %101
101: ; preds = %100
%102 = load i32, i32* %3
%103 = add nsw i32 %102, 1
store i32 %103, i32* %3
br label %78
104: ; preds = %78
%105 = load i32, i32* %1
ret i32 %105
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0AEnter a 3 X 3 Matrix :\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [16 x i8] c"\0AInverse Matrix\00"
@.str.4 = [6 x i8] c"%8.3f\00"
define i32 @main() {
%1 = alloca [3 x [6 x float]]
%2 = bitcast [3 x [6 x float]]* %1 to i8*
%3 = getelementptr inbounds [3 x [6 x float]], [3 x [6 x float]]* %1, i64 0, i64 0, i64 0
%4 = getelementptr inbounds [3 x [6 x float]], [3 x [6 x float]]* %1, i64 0, i64 0, i64 1
%5 = getelementptr inbounds [3 x [6 x float]], [3 x [6 x float]]* %1, i64 0, i64 0, i64 2
%6 = getelementptr inbounds [3 x [6 x float]], [3 x [6 x float]]* %1, i64 0, i64 0, i64 3
%7 = bitcast [3 x [6 x float]]* %1 to <4 x float>*
store <4 x float> <float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00>, <4 x float>* %7
%8 = getelementptr inbounds [3 x [6 x float]], [3 x [6 x float]]* %1, i64 0, i64 0, i64 4
%9 = getelementptr inbounds [3 x [6 x float]], [3 x [6 x float]]* %1, i64 0, i64 0, i64 5
%10 = getelementptr inbounds [3 x [6 x float]], [3 x [6 x float]]* %1, i64 0, i64 1, i64 0
%11 = getelementptr inbounds [3 x [6 x float]], [3 x [6 x float]]* %1, i64 0, i64 1, i64 1
%12 = getelementptr inbounds [3 x [6 x float]], [3 x [6 x float]]* %1, i64 0, i64 1, i64 2
%13 = getelementptr inbounds [3 x [6 x float]], [3 x [6 x float]]* %1, i64 0, i64 1, i64 3
%14 = getelementptr inbounds [3 x [6 x float]], [3 x [6 x float]]* %1, i64 0, i64 1, i64 4
%15 = bitcast float* %8 to i8*
store float 1.000000e+00, float* %14
%16 = getelementptr inbounds [3 x [6 x float]], [3 x [6 x float]]* %1, i64 0, i64 1, i64 5
%17 = getelementptr inbounds [3 x [6 x float]], [3 x [6 x float]]* %1, i64 0, i64 2, i64 0
%18 = getelementptr inbounds [3 x [6 x float]], [3 x [6 x float]]* %1, i64 0, i64 2, i64 1
%19 = getelementptr inbounds [3 x [6 x float]], [3 x [6 x float]]* %1, i64 0, i64 2, i64 2
%20 = getelementptr inbounds [3 x [6 x float]], [3 x [6 x float]]* %1, i64 0, i64 2, i64 3
%21 = getelementptr inbounds [3 x [6 x float]], [3 x [6 x float]]* %1, i64 0, i64 2, i64 4
%22 = getelementptr inbounds [3 x [6 x float]], [3 x [6 x float]]* %1, i64 0, i64 2, i64 5
%23 = bitcast float* %16 to i8*
store float 1.000000e+00, float* %22
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %5)
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %10)
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %11)
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %12)
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %17)
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %18)
%33 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %19)
%34 = bitcast [3 x [6 x float]]* %1 to float**
%35 = call i32 @reduction(float** %34, i32 3, i32 0, i32 0)
%36 = call i32 @reduction(float** %34, i32 3, i32 1, i32 1)
%37 = call i32 @reduction(float** %34, i32 3, i32 2, i32 2)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%39 = call i32 @putchar(i32 10)
%40 = load float, float* %6
%41 = fpext float %40 to double
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %41)
%43 = load float, float* %8
%44 = fpext float %43 to double
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %44)
%46 = load float, float* %9
%47 = fpext float %46 to double
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %47)
%49 = call i32 @putchar(i32 10)
%50 = load float, float* %13
%51 = fpext float %50 to double
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %51)
%53 = load float, float* %14
%54 = fpext float %53 to double
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %54)
%56 = load float, float* %16
%57 = fpext float %56 to double
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %57)
%59 = call i32 @putchar(i32 10)
%60 = load float, float* %20
%61 = fpext float %60 to double
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %61)
%63 = load float, float* %21
%64 = fpext float %63 to double
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %64)
%66 = load float, float* %22
%67 = fpext float %66 to double
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %67)
ret i32 0
}