#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
void show_matrix(float **A, int m, int n) {
  int i, j;
  for (i = 1; i <= m; i++) {
    for (j = 1; j <= n; j++) {
      if (A[i][j] != 0)
        fprintf(stdout, "%14.6e", A[i][j]);
      else
        fprintf(stdout, "   0       ");
    }
    if (i == m)
      fprintf(stdout, " ];\n\n");
    else
      fprintf(stdout, " \n");
  }
  return;
}


x86 assembly (clang, -O0):
<show_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1225 <show_matrix+0x115>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11d3 <show_matrix+0xc3>
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
jne    1174 <show_matrix+0x64>
jp     1174 <show_matrix+0x64>
jmp    11a9 <show_matrix+0x99>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
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    0xe63(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
jmp    11c0 <show_matrix+0xb0>
mov    0x2e30(%rip),%rax
mov    (%rax),%edi
lea    0xe4e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11c5 <show_matrix+0xb5>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113c <show_matrix+0x2c>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    11fb <show_matrix+0xeb>
mov    0x2dfa(%rip),%rax
mov    (%rax),%edi
lea    0xe24(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1212 <show_matrix+0x102>
mov    0x2dde(%rip),%rax
mov    (%rax),%edi
lea    0xe0e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1217 <show_matrix+0x107>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <show_matrix+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_matrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,(%rsp)
test   %esi,%esi
jle    11df <show_matrix+0xcf>
mov    %rdi,%rbx
mov    %rsi,%rcx
mov    (%rsp),%rax
lea    0x1(%rax),%ebp
mov    %ecx,%eax
mov    %rax,0x8(%rsp)
add    $0x1,%ecx
mov    %rcx,0x10(%rsp)
mov    $0x1,%r14d
mov    0x2e8d(%rip),%r15
lea    0xeaa(%rip),%r12
jmp    118c <show_matrix+0x7c>
nopl   0x0(%rax)
cmp    0x8(%rsp),%r14
mov    (%r15),%edi
lea    0xeae(%rip),%rsi
lea    0xea1(%rip),%rax
cmove  %rax,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0x1,%r14
cmp    0x10(%rsp),%r14
je     11df <show_matrix+0xcf>
cmpl   $0x0,(%rsp)
jle    1160 <show_matrix+0x50>
mov    $0x1,%r13d
jmp    11b7 <show_matrix+0xa7>
nopw   0x0(%rax,%rax,1)
lea    0xe64(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0x1,%r13
cmp    %r13,%rbp
je     1160 <show_matrix+0x50>
mov    (%rbx,%r14,8),%rax
movss  (%rax,%r13,4),%xmm0
ucomiss 0xe38(%rip),%xmm0
mov    (%r15),%edi
jne    11cf <show_matrix+0xbf>
jnp    11a0 <show_matrix+0x90>
cvtss2sd %xmm0,%xmm0
mov    %r12,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
jmp    11ae <show_matrix+0x9e>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [7 x i8] c"%14.6e\00"
@.str.1 = [12 x i8] c" 0 \00"
@.str.2 = [6 x i8] c" ];\0A\0A\00"
@.str.3 = [3 x i8] c" \0A\00"
define void @show_matrix(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 1, i32* %7
br label %9
9: ; preds = %60, %3
%10 = load i32, i32* %7
%11 = load i32, i32* %5
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %63
13: ; preds = %9
store i32 1, i32* %8
br label %14
14: ; preds = %46, %13
%15 = load i32, i32* %8
%16 = load i32, i32* %6
%17 = icmp sle i32 %15, %16
br i1 %17, label %18, label %49
18: ; preds = %14
%19 = load float**, float*** %4
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds float*, float** %19, i64 %21
%23 = load float*, float** %22
%24 = load i32, i32* %8
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds float, float* %23, i64 %25
%27 = load float, float* %26
%28 = fcmp une float %27, 0.000000e+00
br i1 %28, label %29, label %42
29: ; preds = %18
%30 = load i32, i32* @stdout
%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 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %40)
br label %45
42: ; preds = %18
%43 = load i32, i32* @stdout
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %45
45: ; preds = %42, %29
br label %46
46: ; preds = %45
%47 = load i32, i32* %8
%48 = add nsw i32 %47, 1
store i32 %48, i32* %8
br label %14
49: ; preds = %14
%50 = load i32, i32* %7
%51 = load i32, i32* %5
%52 = icmp eq i32 %50, %51
br i1 %52, label %53, label %56
53: ; preds = %49
%54 = load i32, i32* @stdout
%55 = call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %59
56: ; preds = %49
%57 = load i32, i32* @stdout
%58 = call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %59
59: ; preds = %56, %53
br label %60
60: ; preds = %59
%61 = load i32, i32* %7
%62 = add nsw i32 %61, 1
store i32 %62, i32* %7
br label %9
63: ; preds = %9
ret void
}

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