#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*/ assign_and_solve(float **, int);
scalar_t__ checkif_sol_exist(float **);
int /*<<< orphan*/ print_matrix(float **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ row_echelon(float **);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  int i, j;
  float A[6][10 + 1];
  for (i = 0; i < 6; i++)
    for (j = 0; j < 10; j++)
      scanf("%f", &A[i][j]);
  for (i = 0; i < 6; i++)
    scanf("%f", &A[i][10]);
  row_echelon(A);
  printf("Row echelon Form :\n");
  print_matrix(A);
  if (checkif_sol_exist(A) == 0) {
    printf("\nEquation is in consistent\n");
    return 0;
  }
  printf("\nOne solution is :\n");
  assign_and_solve(A, 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    11de <main+0x7e>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    11cb <main+0x6b>
movslq -0x8(%rbp),%rax
lea    -0x120(%rbp),%rsi
imul   $0x2c,%rax,%rax
add    %rax,%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe48(%rip),%rdi
call   1060 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    118a <main+0x2a>
jmp    11d0 <main+0x70>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1179 <main+0x19>
movl   $0x0,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    121f <main+0xbf>
movslq -0x8(%rbp),%rax
lea    -0x120(%rbp),%rsi
imul   $0x2c,%rax,%rax
add    %rax,%rsi
add    $0x28,%rsi
lea    0xdf4(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11e5 <main+0x85>
lea    -0x120(%rbp),%rdi
call   1080 <row_echelon@plt>
lea    0xdd1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x120(%rbp),%rdi
call   1070 <print_matrix@plt>
lea    -0x120(%rbp),%rdi
call   1040 <checkif_sol_exist@plt>
cmp    $0x0,%rax
jne    1271 <main+0x111>
lea    0xdb7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1295 <main+0x135>
lea    0xdbb(%rip),%rdi
call   1030 <printf@plt>
lea    -0x120(%rbp),%rdi
mov    $0x1,%esi
call   1050 <assign_and_solve@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x108,%rsp
xor    %ebx,%ebx
lea    0xe8d(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    (%rsp,%rbx,1),%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x4,%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x8,%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0xc,%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x10,%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x14,%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x18,%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x1c,%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x20,%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x24,%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
add    $0x2c,%rbx
cmp    $0x108,%rbx
jne    1180 <main+0x20>
lea    0x28(%rsp),%rsi
lea    0xdc7(%rip),%rbx
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0x54(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0x80(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xac(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xd8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0x104(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1080 <row_echelon@plt>
lea    0xd63(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1070 <print_matrix@plt>
mov    %rbx,%rdi
call   1040 <checkif_sol_exist@plt>
test   %rax,%rax
je     12d5 <main+0x175>
lea    0xd55(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
mov    $0x1,%esi
call   1050 <assign_and_solve@plt>
jmp    12e1 <main+0x181>
lea    0xd4d(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [20 x i8] c"Row echelon Form :\0A\00"
@.str.2 = [28 x i8] c"\0AEquation is in consistent\0A\00"
@.str.3 = [20 x i8] c"\0AOne solution is :\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [6 x [11 x float]]
store i32 0, i32* %1
store i32 0, i32* %2
br label %5
5: ; preds = %24, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 6
br i1 %7, label %8, label %27
8: ; preds = %5
store i32 0, i32* %3
br label %9
9: ; preds = %20, %8
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %23
12: ; preds = %9
%13 = load i32, i32* %2
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [6 x [11 x float]], [6 x [11 x float]]* %4, i64 0, i64 %14
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [11 x float], [11 x float]* %15, i64 0, i64 %17
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %18)
br label %20
20: ; preds = %12
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %9
23: ; preds = %9
br label %24
24: ; preds = %23
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
br label %5
27: ; preds = %5
store i32 0, i32* %2
br label %28
28: ; preds = %37, %27
%29 = load i32, i32* %2
%30 = icmp slt i32 %29, 6
br i1 %30, label %31, label %40
31: ; preds = %28
%32 = load i32, i32* %2
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [6 x [11 x float]], [6 x [11 x float]]* %4, i64 0, i64 %33
%35 = getelementptr inbounds [11 x float], [11 x float]* %34, i64 0, i64 10
%36 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %35)
br label %37
37: ; preds = %31
%38 = load i32, i32* %2
%39 = add nsw i32 %38, 1
store i32 %39, i32* %2
br label %28
40: ; preds = %28
%41 = getelementptr inbounds [6 x [11 x float]], [6 x [11 x float]]* %4, i64 0, i64 0
%42 = bitcast [11 x float]* %41 to float**
%43 = call i32 @row_echelon(float** %42)
%44 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%45 = getelementptr inbounds [6 x [11 x float]], [6 x [11 x float]]* %4, i64 0, i64 0
%46 = bitcast [11 x float]* %45 to float**
%47 = call i32 @print_matrix(float** %46)
%48 = getelementptr inbounds [6 x [11 x float]], [6 x [11 x float]]* %4, i64 0, i64 0
%49 = bitcast [11 x float]* %48 to float**
%50 = call i64 @checkif_sol_exist(float** %49)
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %54
52: ; preds = %40
%53 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
br label %59
54: ; preds = %40
%55 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%56 = getelementptr inbounds [6 x [11 x float]], [6 x [11 x float]]* %4, i64 0, i64 0
%57 = bitcast [11 x float]* %56 to float**
%58 = call i32 @assign_and_solve(float** %57, i32 1)
store i32 0, i32* %1
br label %59
59: ; preds = %54, %52
%60 = load i32, i32* %1
ret i32 %60
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@str = [19 x i8] c"Row echelon Form :\00"
@str.4 = [19 x i8] c"\0AOne solution is :\00"
@str.5 = [27 x i8] c"\0AEquation is in consistent\00"
define i32 @main() {
%1 = alloca [6 x [11 x float]]
%2 = bitcast [6 x [11 x float]]* %1 to i8*
br label %3
3: ; preds = %0, %3
%4 = phi i64 [ 0, %0 ], [ %25, %3 ]
%5 = getelementptr inbounds [6 x [11 x float]], [6 x [11 x float]]* %1, i64 0, i64 %4, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %5)
%7 = getelementptr inbounds [6 x [11 x float]], [6 x [11 x float]]* %1, i64 0, i64 %4, i64 1
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %7)
%9 = getelementptr inbounds [6 x [11 x float]], [6 x [11 x float]]* %1, i64 0, i64 %4, i64 2
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %9)
%11 = getelementptr inbounds [6 x [11 x float]], [6 x [11 x float]]* %1, i64 0, i64 %4, i64 3
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %11)
%13 = getelementptr inbounds [6 x [11 x float]], [6 x [11 x float]]* %1, i64 0, i64 %4, i64 4
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %13)
%15 = getelementptr inbounds [6 x [11 x float]], [6 x [11 x float]]* %1, i64 0, i64 %4, i64 5
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %15)
%17 = getelementptr inbounds [6 x [11 x float]], [6 x [11 x float]]* %1, i64 0, i64 %4, i64 6
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %17)
%19 = getelementptr inbounds [6 x [11 x float]], [6 x [11 x float]]* %1, i64 0, i64 %4, i64 7
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %19)
%21 = getelementptr inbounds [6 x [11 x float]], [6 x [11 x float]]* %1, i64 0, i64 %4, i64 8
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %21)
%23 = getelementptr inbounds [6 x [11 x float]], [6 x [11 x float]]* %1, i64 0, i64 %4, i64 9
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %23)
%25 = add nuw nsw i64 %4, 1
%26 = icmp eq i64 %25, 6
br i1 %26, label %27, label %3
27: ; preds = %3
%28 = getelementptr inbounds [6 x [11 x float]], [6 x [11 x float]]* %1, i64 0, i64 0, i64 10
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %28)
%30 = getelementptr inbounds [6 x [11 x float]], [6 x [11 x float]]* %1, i64 0, i64 1, i64 10
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %30)
%32 = getelementptr inbounds [6 x [11 x float]], [6 x [11 x float]]* %1, i64 0, i64 2, i64 10
%33 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %32)
%34 = getelementptr inbounds [6 x [11 x float]], [6 x [11 x float]]* %1, i64 0, i64 3, i64 10
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %34)
%36 = getelementptr inbounds [6 x [11 x float]], [6 x [11 x float]]* %1, i64 0, i64 4, i64 10
%37 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %36)
%38 = getelementptr inbounds [6 x [11 x float]], [6 x [11 x float]]* %1, i64 0, i64 5, i64 10
%39 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %38)
%40 = bitcast [6 x [11 x float]]* %1 to float**
%41 = call i32 @row_echelon(float** %40)
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%43 = call i32 @print_matrix(float** %40)
%44 = call i64 @checkif_sol_exist(float** %40)
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %27
%47 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0))
br label %51
48: ; preds = %27
%49 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.4, i64 0, i64 0))
%50 = call i32 @assign_and_solve(float** %40, i32 1)
br label %51
51: ; preds = %48, %46
ret i32 0
}