#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;
  for (i = 0; i < m + 1; i++) {
    for (j = 0; j < n + 1; 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)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    123e <printMatrix+0x12e>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1222 <printMatrix+0x112>
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     11e8 <printMatrix+0xd8>
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  0xe6c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11bc <printMatrix+0xac>
jp     11bc <printMatrix+0xac>
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    0xe2c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    120f <printMatrix+0xff>
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    0xe01(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1214 <printMatrix+0x104>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1141 <printMatrix+0x31>
lea    0xde6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <printMatrix+0x19>
lea    0xdca(%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    %rdx,0x10(%rsp)
mov    %rsi,0x8(%rsp)
test   %esi,%esi
js     11e1 <printMatrix+0xc1>
mov    %rdi,%r12
mov    0x10(%rsp),%rax
lea    0x1(%rax),%r13d
mov    0x8(%rsp),%rax
add    $0x1,%eax
mov    %rax,0x8(%rsp)
xor    %ebx,%ebx
lea    0xea3(%rip),%rbp
lea    0xe9b(%rip),%r14
jmp    1185 <printMatrix+0x65>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    0x8(%rsp),%rbx
je     11e1 <printMatrix+0xc1>
cmpl   $0x0,0x10(%rsp)
js     1170 <printMatrix+0x50>
xor    %r15d,%r15d
jmp    11b7 <printMatrix+0x97>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%r15
cmp    %r15,%r13
je     1170 <printMatrix+0x50>
mov    (%r12,%rbx,8),%rax
movss  (%rax,%r15,4),%xmm0
ucomiss 0xe38(%rip),%xmm0
jb     11a0 <printMatrix+0x80>
mov    %r14,%rdi
jne    11a3 <printMatrix+0x83>
jp     11a3 <printMatrix+0x83>
movl   $0x0,(%rax,%r15,4)
xorps  %xmm0,%xmm0
mov    %r14,%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 = [7 x i8] c" %.2f \00"
@.str.1 = [6 x i8] c"%.2f \00"
@.str.2 = [2 x i8] c"\0A\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
store i32 0, i32* %7
br label %9
9: ; preds = %82, %3
%10 = load i32, i32* %7
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 1
%13 = icmp slt i32 %10, %12
br i1 %13, label %14, label %85
14: ; preds = %9
store i32 0, i32* %8
br label %15
15: ; preds = %77, %14
%16 = load i32, i32* %8
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
%19 = icmp slt i32 %16, %18
br i1 %19, label %20, label %80
20: ; preds = %15
%21 = load float**, float*** %4
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds float*, float** %21, i64 %23
%25 = load float*, float** %24
%26 = load i32, i32* %8
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds float, float* %25, i64 %27
%29 = load float, float* %28
%30 = fcmp oge float %29, 0.000000e+00
br i1 %30, label %31, label %64
31: ; preds = %20
%32 = load float**, float*** %4
%33 = load i32, i32* %7
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds float*, float** %32, i64 %34
%36 = load float*, float** %35
%37 = load i32, i32* %8
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds float, float* %36, i64 %38
%40 = load float, float* %39
%41 = fpext float %40 to double
%42 = fcmp oeq double %41, -0.000000e+00
br i1 %42, label %43, label %52
43: ; preds = %31
%44 = load float**, float*** %4
%45 = load i32, i32* %7
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds float*, float** %44, i64 %46
%48 = load float*, float** %47
%49 = load i32, i32* %8
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds float, float* %48, i64 %50
store float 0.000000e+00, float* %51
br label %52
52: ; preds = %43, %31
%53 = load float**, float*** %4
%54 = load i32, i32* %7
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds float*, float** %53, i64 %55
%57 = load float*, float** %56
%58 = load i32, i32* %8
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds float, float* %57, i64 %59
%61 = load float, float* %60
%62 = fpext float %61 to double
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %62)
br label %76
64: ; preds = %20
%65 = load float**, float*** %4
%66 = load i32, i32* %7
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds float*, float** %65, i64 %67
%69 = load float*, float** %68
%70 = load i32, i32* %8
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds float, float* %69, i64 %71
%73 = load float, float* %72
%74 = fpext float %73 to double
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %74)
br label %76
76: ; preds = %64, %52
br label %77
77: ; preds = %76
%78 = load i32, i32* %8
%79 = add nsw i32 %78, 1
store i32 %79, i32* %8
br label %15
80: ; preds = %15
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %82
82: ; preds = %80
%83 = load i32, i32* %7
%84 = add nsw i32 %83, 1
store i32 %84, i32* %7
br label %9
85: ; preds = %9
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

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