#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 *, float);
void printMatrix(float **matrix, int size) {
  int i, j;
  for (i = 0; i < size; i++) {
    for (j = 0; j < size; j++) {
      if (j == size - 1)
        printf("%f\n", matrix[i][j]);
      else
        printf("%f ", matrix[i][j]);
    }
  }
}


x86 assembly (clang, -O0):
<printMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11c3 <printMatrix+0xb3>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11b0 <printMatrix+0xa0>
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    117c <printMatrix+0x6c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
jmp    119d <printMatrix+0x8d>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
jmp    11a2 <printMatrix+0x92>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <printMatrix+0x29>
jmp    11b5 <printMatrix+0xa5>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printMatrix+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMatrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    117f <printMatrix+0x6f>
mov    %rdi,%r15
lea    -0x1(%rsi),%eax
mov    %esi,%ebx
xor    %ebp,%ebp
lea    0xed0(%rip),%r12
lea    0xecd(%rip),%r14
mov    %rax,(%rsp)
nopl   0x0(%rax,%rax,1)
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    %r13,%rax
mov    (%r15,%rbp,8),%rax
mov    %r14,%rdi
cmove  %r12,%rdi
movss  (%rax,%r13,4),%xmm0
call   1030 <printf@plt>
mov    (%rsp),%rax
add    $0x1,%r13
cmp    %r13,%rbx
jne    1150 <printMatrix+0x40>
add    $0x1,%rbp
cmp    %rbx,%rbp
jne    1140 <printMatrix+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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