#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 printMatrix(float **m, float w, float h) {
  int i, j;
  printf("\n");
  for (j = 0; j < h; j++) {
    for (i = 0; i < w; i++) {
      printf("%.2f ", m[j][i]);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<printMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
cvtsi2ssl -0x18(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    11b9 <printMatrix+0xa9>
movl   $0x0,-0x14(%rbp)
cvtsi2ssl -0x14(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    119d <printMatrix+0x8d>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe7a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1155 <printMatrix+0x45>
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113b <printMatrix+0x2b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMatrix>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
mov    %rdi,%r15
mov    $0xa,%edi
call   1030 <putchar@plt>
xorps  %xmm0,%xmm0
movss  (%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    11cf <printMatrix+0xaf>
xor    %r12d,%r12d
lea    0xea9(%rip),%r14
jmp    1180 <printMatrix+0x60>
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12
xorps  %xmm0,%xmm0
cvtsi2ss %r12d,%xmm0
movss  (%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    11cf <printMatrix+0xaf>
movss  0x4(%rsp),%xmm0
ucomiss 0xe73(%rip),%xmm0
jbe    1160 <printMatrix+0x40>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15,%r12,8),%rax
movss  (%rax,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
movss  0x4(%rsp),%xmm1
ucomiss %xmm0,%xmm1
ja     11a0 <printMatrix+0x80>
jmp    1160 <printMatrix+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%.2f \00"
define void @printMatrix(float** nocapture %0, float %1, float %2) {
%4 = tail call i32 @putchar(i32 10)
%5 = fcmp ogt float %2, 0.000000e+00
br i1 %5, label %6, label %29
6: ; preds = %3
%7 = fcmp ogt float %1, 0.000000e+00
br label %8
8: ; preds = %6, %23
%9 = phi i64 [ 0, %6 ], [ %25, %23 ]
br i1 %7, label %10, label %23
10: ; preds = %8
%11 = getelementptr inbounds float*, float** %0, i64 %9
br label %12
12: ; preds = %10, %12
%13 = phi i64 [ 0, %10 ], [ %19, %12 ]
%14 = load float*, float** %11
%15 = getelementptr inbounds float, float* %14, i64 %13
%16 = load float, float* %15
%17 = fpext float %16 to double
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %17)
%19 = add nuw i64 %13, 1
%20 = trunc i64 %19 to i32
%21 = sitofp i32 %20 to float
%22 = fcmp olt float %21, %1
br i1 %22, label %12, label %23
23: ; preds = %12, %8
%24 = tail call i32 @putchar(i32 10)
%25 = add nuw i64 %9, 1
%26 = trunc i64 %25 to i32
%27 = sitofp i32 %26 to float
%28 = fcmp olt float %27, %2
br i1 %28, label %8, label %29
29: ; preds = %23, %3
ret void
}