#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 cin(float **);
int /*<<< orphan*/ cout(float **, int, int);
scalar_t__ det(float **, int);
int /*<<< orphan*/ getch();
int /*<<< orphan*/ inverse(float **, float **, int, float);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int i, j, n;
  float a[100][100], d[100][100], deter;
  printf("\n C Program To Find Inverse Of Matrix\n\n");
  n = cin(a);
  int print_matrix = 1;
  cout(a, n, print_matrix);
  deter = (float)det(a, n);
  printf("----------------------------------------------------\n");
  printf("\n\n Determinant of the Matrix : %.4f ", deter);
  printf("\n\n-----------------------\n");
  inverse(a, d, n, deter);
  int print_inverse = 2;
  cout(d, n, print_inverse);
  printf("\n\n==============================* THE END "
         "*==============================\n");
  printf("\n		**** Thanks For Using The Program!!! ****\n");
  getch();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x138a0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x9c50(%rbp),%rdi
call   1080 <cin@plt>
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x13898(%rbp)
lea    -0x9c50(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x13898(%rbp),%edx
call   1030 <cout@plt>
lea    -0x9c50(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1070 <det@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x13894(%rbp)
ff
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movss  -0x13894(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xe73(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x9c50(%rbp),%rdi
lea    -0x13890(%rbp),%rsi
mov    -0x10(%rbp),%edx
movss  -0x13894(%rbp),%xmm0
ff
call   1050 <inverse@plt>
movl   $0x2,-0x1389c(%rbp)
lea    -0x13890(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x1389c(%rbp),%edx
call   1030 <cout@plt>
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <getch@plt>
xor    %eax,%eax
add    $0x138a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x13890,%rsp
lea    0xea2(%rip),%rdi
call   1040 <puts@plt>
lea    0x9c50(%rsp),%r14
mov    %r14,%rdi
call   1090 <cin@plt>
mov    %eax,%ebx
mov    %r14,%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <cout@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1080 <det@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,0xc(%rsp)
lea    0xe87(%rip),%rdi
call   1040 <puts@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe25(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xe98(%rip),%rdi
call   1040 <puts@plt>
lea    0x10(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
movss  0xc(%rsp),%xmm0
call   1060 <inverse@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x2,%edx
call   1030 <cout@plt>
lea    0xe7f(%rip),%rdi
call   1040 <puts@plt>
lea    0xebd(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1070 <getch@plt>
xor    %eax,%eax
add    $0x13890,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [40 x i8] c"\0A C Program To Find Inverse Of Matrix\0A\0A\00"
@.str.1 = [54 x i8] c"----------------------------------------------------\0A\00"
@.str.2 = [37 x i8] c"\0A\0A Determinant of the Matrix : %.4f \00"
@.str.3 = [27 x i8] c"\0A\0A-----------------------\0A\00"
@.str.4 = [75 x i8] c"\0A\0A==============================* THE END *==============================\0A\00"
@.str.5 = [46 x i8] c"\0A\09\09**** Thanks For Using The Program!!! ****\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [100 x [100 x float]]
%6 = alloca [100 x [100 x float]]
%7 = alloca float
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%11 = getelementptr inbounds [100 x [100 x float]], [100 x [100 x float]]* %5, i64 0, i64 0
%12 = bitcast [100 x float]* %11 to float**
%13 = call i32 @cin(float** %12)
store i32 %13, i32* %4
store i32 1, i32* %8
%14 = getelementptr inbounds [100 x [100 x float]], [100 x [100 x float]]* %5, i64 0, i64 0
%15 = bitcast [100 x float]* %14 to float**
%16 = load i32, i32* %4
%17 = load i32, i32* %8
%18 = call i32 @cout(float** %15, i32 %16, i32 %17)
%19 = getelementptr inbounds [100 x [100 x float]], [100 x [100 x float]]* %5, i64 0, i64 0
%20 = bitcast [100 x float]* %19 to float**
%21 = load i32, i32* %4
%22 = call i64 @det(float** %20, i32 %21)
%23 = sitofp i64 %22 to float
store float %23, float* %7
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
%25 = load float, float* %7
%26 = fpext float %25 to double
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), double %26)
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%29 = getelementptr inbounds [100 x [100 x float]], [100 x [100 x float]]* %5, i64 0, i64 0
%30 = bitcast [100 x float]* %29 to float**
%31 = getelementptr inbounds [100 x [100 x float]], [100 x [100 x float]]* %6, i64 0, i64 0
%32 = bitcast [100 x float]* %31 to float**
%33 = load i32, i32* %4
%34 = load float, float* %7
%35 = call i32 @inverse(float** %30, float** %32, i32 %33, float %34)
store i32 2, i32* %9
%36 = getelementptr inbounds [100 x [100 x float]], [100 x [100 x float]]* %6, i64 0, i64 0
%37 = bitcast [100 x float]* %36 to float**
%38 = load i32, i32* %4
%39 = load i32, i32* %9
%40 = call i32 @cout(float** %37, i32 %38, i32 %39)
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.4, i64 0, i64 0))
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0))
%43 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [37 x i8] c"\0A\0A Determinant of the Matrix : %.4f \00"
@str = [39 x i8] c"\0A C Program To Find Inverse Of Matrix\0A\00"
@str.6 = [53 x i8] c"----------------------------------------------------\00"
@str.7 = [26 x i8] c"\0A\0A-----------------------\00"
@str.8 = [74 x i8] c"\0A\0A==============================* THE END *==============================\00"
@str.9 = [45 x i8] c"\0A\09\09**** Thanks For Using The Program!!! ****\00"
define i32 @main() {
%1 = alloca [100 x [100 x float]]
%2 = alloca [100 x [100 x float]]
%3 = bitcast [100 x [100 x float]]* %1 to i8*
%4 = bitcast [100 x [100 x float]]* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%6 = bitcast [100 x [100 x float]]* %1 to float**
%7 = call i32 @cin(float** %6)
%8 = call i32 @cout(float** %6, i32 %7, i32 1)
%9 = call i64 @det(float** %6, i32 %7)
%10 = sitofp i64 %9 to float
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.6, i64 0, i64 0))
%12 = fpext float %10 to double
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), double %12)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.7, i64 0, i64 0))
%15 = bitcast [100 x [100 x float]]* %2 to float**
%16 = call i32 @inverse(float** %6, float** %15, i32 %7, float %10)
%17 = call i32 @cout(float** %15, i32 %7, i32 2)
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str.8, i64 0, i64 0))
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.9, i64 0, i64 0))
%20 = call i32 (...) @getch()
ret i32 0
}