#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*/ cofactor(float **, float **, int, float);
int /*<<< orphan*/ printf(char *);
void inverse(float a[100][100], float d[100][100], int n, float det) {
  if (det == 0)
    printf("\nInverse of Entered Matrix is not possible\n");
  else if (n == 1)
    d[0][0] = 1;
  else
    cofactor(a, d, n, det);
}


x86 assembly (clang, -O0):
<inverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1160 <inverse+0x40>
jp     1160 <inverse+0x40>
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
jmp    1199 <inverse+0x79>
cmpl   $0x1,-0x14(%rbp)
jne    117f <inverse+0x5f>
mov    -0x10(%rbp),%rax
movss  0xe8a(%rip),%xmm0
movss  %xmm0,(%rax)
jmp    1194 <inverse+0x74>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
movss  -0x18(%rbp),%xmm0
call   1030 <cofactor@plt>
jmp    1199 <inverse+0x79>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inverse>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1136 <inverse+0x16>
jp     1136 <inverse+0x16>
lea    0xecf(%rip),%rdi
jmp    1040 <puts@plt>
cmp    $0x1,%edx
jne    1142 <inverse+0x22>
movl   $0x3f800000,(%rsi)
ret
jmp    1030 <cofactor@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"\0AInverse of Entered Matrix is not possible\0A\00"
define void @inverse([100 x float]* %0, [100 x float]* %1, i32 %2, float %3) {
%5 = alloca [100 x float]*
%6 = alloca [100 x float]*
%7 = alloca i32
%8 = alloca float
store [100 x float]* %0, [100 x float]** %5
store [100 x float]* %1, [100 x float]** %6
store i32 %2, i32* %7
store float %3, float* %8
%9 = load float, float* %8
%10 = fcmp oeq float %9, 0.000000e+00
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %29
13: ; preds = %4
%14 = load i32, i32* %7
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load [100 x float]*, [100 x float]** %6
%18 = getelementptr inbounds [100 x float], [100 x float]* %17, i64 0
%19 = getelementptr inbounds [100 x float], [100 x float]* %18, i64 0, i64 0
store float 1.000000e+00, float* %19
br label %28
20: ; preds = %13
%21 = load [100 x float]*, [100 x float]** %5
%22 = bitcast [100 x float]* %21 to float**
%23 = load [100 x float]*, [100 x float]** %6
%24 = bitcast [100 x float]* %23 to float**
%25 = load i32, i32* %7
%26 = load float, float* %8
%27 = call i32 @cofactor(float** %22, float** %24, i32 %25, float %26)
br label %28
28: ; preds = %20, %16
br label %29
29: ; preds = %28, %11
ret void
}

LLVM IR (-O2):
@str = [43 x i8] c"\0AInverse of Entered Matrix is not possible\00"
define void @inverse([100 x float]* %0, [100 x float]* %1, i32 %2, float %3) {
%5 = fcmp oeq float %3, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
br label %16
8: ; preds = %4
%9 = icmp eq i32 %2, 1
br i1 %9, label %10, label %12
10: ; preds = %8
%11 = getelementptr inbounds [100 x float], [100 x float]* %1, i64 0, i64 0
store float 1.000000e+00, float* %11
br label %16
12: ; preds = %8
%13 = bitcast [100 x float]* %0 to float**
%14 = bitcast [100 x float]* %1 to float**
%15 = tail call i32 @cofactor(float** %13, float** %14, i32 %2, float %3)
br label %16
16: ; preds = %10, %12, %6
ret void
}