#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*/ print(char *, ...);
int /*<<< orphan*/ printf(char *);
void ShowMatrix(double **A, int n, double eps) {
  int k1, k2;
  print("----------------------------------------------------------------\n");
  for (k1 = 0; k1 < n; k1++) {
    for (k2 = 0; k2 < n; k2++) {
      print("%12.3e   ", fabs(A[k1][k2]) > eps ? A[k1][k2] : 0.0);
    }
    printf("\n");
  }
  print("----------------------------------------------------------------\n");
}


x86 assembly (clang, -O0):
<ShowMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1040 <print@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11fa <ShowMatrix+0xda>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11e0 <ShowMatrix+0xc0>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xe7c(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    11b2 <ShowMatrix+0x92>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    11bf <ShowMatrix+0x9f>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    11bf <ShowMatrix+0x9f>
movsd  -0x28(%rbp),%xmm0
lea    0xe87(%rip),%rdi
mov    $0x1,%al
call   1040 <print@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    115c <ShowMatrix+0x3c>
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1149 <ShowMatrix+0x29>
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1040 <print@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShowMatrix>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %esi,%ebp
mov    %rdi,%r15
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1040 <print@plt>
test   %ebp,%ebp
jle    11ba <ShowMatrix+0x9a>
mov    %ebp,%r12d
xor    %ebx,%ebx
lea    0xefd(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15,%rbx,8),%rax
movsd  (%rax,%rbp,8),%xmm1
movapd %xmm1,%xmm2
andpd  0xe7b(%rip),%xmm2
movsd  0x8(%rsp),%xmm0
cmpltsd %xmm2,%xmm0
andpd  %xmm1,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <print@plt>
add    $0x1,%rbp
cmp    %rbp,%r12
jne    1170 <ShowMatrix+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %r12,%rbx
jne    1160 <ShowMatrix+0x40>
lea    0xe4f(%rip),%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <print@plt>

LLVM IR (-O0):
@.str = [66 x i8] c"----------------------------------------------------------------\0A\00"
@.str.1 = [10 x i8] c"%12.3e \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @ShowMatrix(double** %0, i32 %1, double %2) {
%4 = alloca double**
%5 = alloca i32
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
store double** %0, double*** %4
store i32 %1, i32* %5
store double %2, double* %6
%9 = call i32 (i8*, ...) @print(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %7
br label %10
10: ; preds = %51, %3
%11 = load i32, i32* %7
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %54
14: ; preds = %10
store i32 0, i32* %8
br label %15
15: ; preds = %46, %14
%16 = load i32, i32* %8
%17 = load i32, i32* %5
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %49
19: ; preds = %15
%20 = load double**, double*** %4
%21 = load i32, i32* %7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds double*, double** %20, i64 %22
%24 = load double*, double** %23
%25 = load i32, i32* %8
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double, double* %24, i64 %26
%28 = load double, double* %27
%29 = call double @llvm.fabs.f64(double %28)
%30 = load double, double* %6
%31 = fcmp ogt double %29, %30
br i1 %31, label %32, label %42
32: ; preds = %19
%33 = load double**, double*** %4
%34 = load i32, i32* %7
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double*, double** %33, i64 %35
%37 = load double*, double** %36
%38 = load i32, i32* %8
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %37, i64 %39
%41 = load double, double* %40
br label %43
42: ; preds = %19
br label %43
43: ; preds = %42, %32
%44 = phi double [ %41, %32 ], [ 0.000000e+00, %42 ]
%45 = call i32 (i8*, ...) @print(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %44)
br label %46
46: ; preds = %43
%47 = load i32, i32* %8
%48 = add nsw i32 %47, 1
store i32 %48, i32* %8
br label %15
49: ; preds = %15
%50 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %51
51: ; preds = %49
%52 = load i32, i32* %7
%53 = add nsw i32 %52, 1
store i32 %53, i32* %7
br label %10
54: ; preds = %10
%55 = call i32 (i8*, ...) @print(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [66 x i8] c"----------------------------------------------------------------\0A\00"
@.str.1 = [10 x i8] c"%12.3e \00"
define void @ShowMatrix(double** nocapture %0, i32 %1, double %2) {
%4 = tail call i32 (i8*, ...) @print(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %26
6: ; preds = %3
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %22, %6
%9 = phi i64 [ 0, %6 ], [ %24, %22 ]
%10 = getelementptr inbounds double*, double** %0, i64 %9
br label %11
11: ; preds = %8, %11
%12 = phi i64 [ 0, %8 ], [ %20, %11 ]
%13 = load double*, double** %10
%14 = getelementptr inbounds double, double* %13, i64 %12
%15 = load double, double* %14
%16 = tail call double @llvm.fabs.f64(double %15)
%17 = fcmp ogt double %16, %2
%18 = select i1 %17, double %15, double 0.000000e+00
%19 = tail call i32 (i8*, ...) @print(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %18)
%20 = add nuw nsw i64 %12, 1
%21 = icmp eq i64 %20, %7
br i1 %21, label %22, label %11
22: ; preds = %11
%23 = tail call i32 @putchar(i32 10)
%24 = add nuw nsw i64 %9, 1
%25 = icmp eq i64 %24, %7
br i1 %25, label %26, label %8
26: ; preds = %22, %3
%27 = tail call i32 (i8*, ...) @print(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
ret void
}