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


x86 assembly (clang, -O0):
<printMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1242 <printMatrix+0x132>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1226 <printMatrix+0x116>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     11ec <printMatrix+0xdc>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe68(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11c0 <printMatrix+0xb0>
jp     11c0 <printMatrix+0xb0>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe2a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1213 <printMatrix+0x103>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdff(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1218 <printMatrix+0x108>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114a <printMatrix+0x3a>
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <printMatrix+0x27>
lea    0xdbf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMatrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edx,0xc(%rsp)
mov    %esi,%r14d
mov    %rdi,%r12
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r14d,%r14d
jle    11e1 <printMatrix+0xc1>
mov    %r14d,%eax
mov    %rax,0x10(%rsp)
mov    0xc(%rsp),%ebp
xor    %ebx,%ebx
lea    0xea5(%rip),%r13
lea    0xe9d(%rip),%r15
jmp    1185 <printMatrix+0x65>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    0x10(%rsp),%rbx
je     11e1 <printMatrix+0xc1>
cmpl   $0x0,0xc(%rsp)
jle    1170 <printMatrix+0x50>
xor    %r14d,%r14d
jmp    11b7 <printMatrix+0x97>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%r14
cmp    %r14,%rbp
je     1170 <printMatrix+0x50>
mov    (%r12,%rbx,8),%rax
movss  (%rax,%r14,4),%xmm0
ucomiss 0xe38(%rip),%xmm0
jb     11a0 <printMatrix+0x80>
mov    %r15,%rdi
jne    11a3 <printMatrix+0x83>
jp     11a3 <printMatrix+0x83>
movl   $0x0,(%rax,%r14,4)
xorps  %xmm0,%xmm0
mov    %r15,%rdi
jmp    11a3 <printMatrix+0x83>
mov    $0xa,%edi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [7 x i8] c" %.2f \00"
@.str.2 = [6 x i8] c"%.2f \00"
define void @printMatrix(float** %0, i32 %1, i32 %2) {
%4 = alloca float**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store float** %0, float*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %7
br label %10
10: ; preds = %81, %3
%11 = load i32, i32* %7
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %84
14: ; preds = %10
store i32 0, i32* %8
br label %15
15: ; preds = %76, %14
%16 = load i32, i32* %8
%17 = load i32, i32* %6
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %79
19: ; preds = %15
%20 = load float**, float*** %4
%21 = load i32, i32* %7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds float*, float** %20, i64 %22
%24 = load float*, float** %23
%25 = load i32, i32* %8
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds float, float* %24, i64 %26
%28 = load float, float* %27
%29 = fcmp oge float %28, 0.000000e+00
br i1 %29, label %30, label %63
30: ; preds = %19
%31 = load float**, float*** %4
%32 = load i32, i32* %7
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds float*, float** %31, i64 %33
%35 = load float*, float** %34
%36 = load i32, i32* %8
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds float, float* %35, i64 %37
%39 = load float, float* %38
%40 = fpext float %39 to double
%41 = fcmp oeq double %40, -0.000000e+00
br i1 %41, label %42, label %51
42: ; preds = %30
%43 = load float**, float*** %4
%44 = load i32, i32* %7
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds float*, float** %43, i64 %45
%47 = load float*, float** %46
%48 = load i32, i32* %8
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds float, float* %47, i64 %49
store float 0.000000e+00, float* %50
br label %51
51: ; preds = %42, %30
%52 = load float**, float*** %4
%53 = load i32, i32* %7
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds float*, float** %52, i64 %54
%56 = load float*, float** %55
%57 = load i32, i32* %8
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds float, float* %56, i64 %58
%60 = load float, float* %59
%61 = fpext float %60 to double
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %61)
br label %75
63: ; preds = %19
%64 = load float**, float*** %4
%65 = load i32, i32* %7
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds float*, float** %64, i64 %66
%68 = load float*, float** %67
%69 = load i32, i32* %8
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds float, float* %68, i64 %70
%72 = load float, float* %71
%73 = fpext float %72 to double
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %73)
br label %75
75: ; preds = %63, %51
br label %76
76: ; preds = %75
%77 = load i32, i32* %8
%78 = add nsw i32 %77, 1
store i32 %78, i32* %8
br label %15
79: ; preds = %15
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %81
81: ; preds = %79
%82 = load i32, i32* %7
%83 = add nsw i32 %82, 1
store i32 %83, i32* %7
br label %10
84: ; preds = %10
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

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