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


x86 assembly (clang, -O0):
<show_dmatrix>:
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     1227 <show_dmatrix+0x117>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11d5 <show_dmatrix+0xc5>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xeac(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xe90(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11ab <show_dmatrix+0x9b>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe81(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
jmp    11c2 <show_dmatrix+0xb2>
mov    0x2e2e(%rip),%rax
mov    (%rax),%edi
lea    0xe6c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11c7 <show_dmatrix+0xb7>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113c <show_dmatrix+0x2c>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    11fd <show_dmatrix+0xed>
mov    0x2df8(%rip),%rax
mov    (%rax),%edi
lea    0xe42(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1214 <show_dmatrix+0x104>
mov    0x2ddc(%rip),%rax
mov    (%rax),%edi
lea    0xe2c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1219 <show_dmatrix+0x109>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <show_dmatrix+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_dmatrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,(%rsp)
test   %esi,%esi
jle    11e6 <show_dmatrix+0xd6>
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    0xec5(%rip),%r13
jmp    118c <show_dmatrix+0x7c>
nopl   0x0(%rax)
cmp    0x8(%rsp),%r14
mov    (%r15),%edi
lea    0xec2(%rip),%rsi
lea    0xeb5(%rip),%rax
cmove  %rax,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0x1,%r14
cmp    0x10(%rsp),%r14
je     11e6 <show_dmatrix+0xd6>
cmpl   $0x0,(%rsp)
jle    1160 <show_dmatrix+0x50>
mov    $0x1,%r12d
jmp    11b3 <show_dmatrix+0xa3>
nopw   0x0(%rax,%rax,1)
mov    %r13,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0x1,%r12
cmp    %r12,%rbp
je     1160 <show_dmatrix+0x50>
mov    (%rbx,%r14,8),%rax
movsd  (%rax,%r12,8),%xmm0
movapd %xmm0,%xmm1
andpd  0xe37(%rip),%xmm1
ucomisd 0xe3f(%rip),%xmm1
mov    (%r15),%edi
jbe    11a0 <show_dmatrix+0x90>
lea    0xe3b(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
jmp    11aa <show_dmatrix+0x9a>
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"%11.3e\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_dmatrix(double** %0, i32 %1, i32 %2) {
%4 = alloca double**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store double** %0, double*** %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 double**, double*** %4
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double*, double** %19, i64 %21
%23 = load double*, double** %22
%24 = load i32, i32* %8
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %23, i64 %25
%27 = load double, double* %26
%28 = call double @llvm.fabs.f64(double %27)
%29 = fcmp ogt double %28, 1.000000e-99
br i1 %29, label %30, label %42
30: ; preds = %18
%31 = load i32, i32* @stdout
%32 = load double**, double*** %4
%33 = load i32, i32* %7
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds double*, double** %32, i64 %34
%36 = load double*, double** %35
%37 = load i32, i32* %8
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds double, double* %36, i64 %38
%40 = load double, double* %39
%41 = call i32 (i32, i8*, ...) @fprintf(i32 %31, 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, %30
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"%11.3e\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_dmatrix(double** 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 double*, double** %0, i64 %13
br label %16
16: ; preds = %14, %28
%17 = phi i64 [ 1, %14 ], [ %29, %28 ]
%18 = load double*, double** %15
%19 = getelementptr inbounds double, double* %18, i64 %17
%20 = load double, double* %19
%21 = tail call double @llvm.fabs.f64(double %20)
%22 = fcmp ogt double %21, 1.000000e-99
%23 = load i32, i32* @stdout
br i1 %22, label %24, label %26
24: ; preds = %16
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %20)
br label %28
26: ; preds = %16
%27 = tail call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %28
28: ; preds = %24, %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
}