#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 *, ...);
void display_matrix(int nou, double mat[nou][nou + 1]) {
  for (int c = 0; c < nou; c++) {
    printf(" | ");
    for (int d = 0; d <= nou; d++) {
      printf(" %lf ", mat[c][d]);
    }
    printf(" | \n");
  }
  printf("\n\n");
}


x86 assembly (clang, -O0):
<display_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11b7 <display_matrix+0xa7>
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     119b <display_matrix+0x8b>
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe7e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1153 <display_matrix+0x43>
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1132 <display_matrix+0x22>
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_matrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %edi,%edi
jle    11a0 <display_matrix+0x80>
mov    %rsi,%rbx
lea    0x1(%rdi),%r12d
mov    %edi,%eax
mov    %rax,0x10(%rsp)
lea    0x0(,%r12,8),%rax
mov    %rax,0x8(%rsp)
lea    0xeb4(%rip),%r14
lea    0xea5(%rip),%r15
xor    %r13d,%r13d
xchg   %ax,%ax
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %ebp,%ebp
nopl   0x0(%rax)
movsd  (%rbx,%rbp,8),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r12
jne    1170 <display_matrix+0x50>
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0x1,%r13
add    0x8(%rsp),%rbx
cmp    0x10(%rsp),%r13
jne    1160 <display_matrix+0x40>
lea    0xe5f(%rip),%rdi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [4 x i8] c" | \00"
@.str.1 = [6 x i8] c" %lf \00"
@.str.2 = [5 x i8] c" | \0A\00"
@.str.3 = [3 x i8] c"\0A\0A\00"
define void @display_matrix(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store double* %1, double** %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
%11 = zext i32 %10 to i64
store i32 0, i32* %5
br label %12
12: ; preds = %38, %2
%13 = load i32, i32* %5
%14 = load i32, i32* %3
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %41
16: ; preds = %12
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %6
br label %18
18: ; preds = %33, %16
%19 = load i32, i32* %6
%20 = load i32, i32* %3
%21 = icmp sle i32 %19, %20
br i1 %21, label %22, label %36
22: ; preds = %18
%23 = load double*, double** %4
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = mul nsw i64 %25, %11
%27 = getelementptr inbounds double, double* %23, i64 %26
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %27, i64 %29
%31 = load double, double* %30
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %31)
br label %33
33: ; preds = %22
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 1
store i32 %35, i32* %6
br label %18
36: ; preds = %18
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %38
38: ; preds = %36
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
store i32 %40, i32* %5
br label %12
41: ; preds = %12
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c" %lf \00"
@str = [2 x i8] c"\0A\00"
@str.4 = [4 x i8] c" | \00"
define void @display_matrix(i32 %0, double* nocapture %1) {
%3 = add i32 %0, 1
%4 = zext i32 %3 to i64
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = zext i32 %0 to i64
br label %10
8: ; preds = %15, %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
10: ; preds = %15, %6
%11 = phi i64 [ 0, %6 ], [ %17, %15 ]
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0))
%13 = mul nuw nsw i64 %11, %4
%14 = getelementptr inbounds double, double* %1, i64 %13
br label %19
15: ; preds = %19
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0))
%17 = add nuw nsw i64 %11, 1
%18 = icmp eq i64 %17, %7
br i1 %18, label %8, label %10
19: ; preds = %10, %19
%20 = phi i64 [ 0, %10 ], [ %24, %19 ]
%21 = getelementptr inbounds double, double* %14, i64 %20
%22 = load double, double* %21
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %22)
%24 = add nuw nsw i64 %20, 1
%25 = icmp eq i64 %24, %4
br i1 %25, label %15, label %19
}