#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, double eps) {
  int k1, k2;
  print("----------------------------------------------------------------\n");
  for (k1 = 0; k1 < (2 + (5 == 1 ? 2 : 1)); k1++) {
    for (k2 = 0; k2 < (2 + (5 == 1 ? 2 : 1)); 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    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1040 <print@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    11f3 <ShowMatrix+0xd3>
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    11d9 <ShowMatrix+0xb9>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xe83(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11ab <ShowMatrix+0x8b>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11b8 <ShowMatrix+0x98>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11b8 <ShowMatrix+0x98>
movsd  -0x20(%rbp),%xmm0
lea    0xe8e(%rip),%rdi
mov    $0x1,%al
call   1040 <print@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1157 <ShowMatrix+0x37>
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1146 <ShowMatrix+0x26>
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1040 <print@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShowMatrix>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movaps %xmm0,(%rsp)
mov    %rdi,%rbx
lea    0xed9(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <print@plt>
mov    (%rbx),%rax
movsd  (%rax),%xmm1
movapd %xmm1,%xmm2
andpd  0xeac(%rip),%xmm2
movapd (%rsp),%xmm0
cmpltsd %xmm2,%xmm0
andpd  %xmm1,%xmm0
lea    0xee9(%rip),%r15
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <print@plt>
mov    (%rbx),%rax
movsd  0x8(%rax),%xmm1
movapd %xmm1,%xmm2
andpd  0xe79(%rip),%xmm2
movapd (%rsp),%xmm0
cmpltsd %xmm2,%xmm0
andpd  %xmm1,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <print@plt>
mov    (%rbx),%rax
movsd  0x10(%rax),%xmm1
movapd %xmm1,%xmm2
andpd  0xe4d(%rip),%xmm2
movapd (%rsp),%xmm0
cmpltsd %xmm2,%xmm0
andpd  %xmm1,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <print@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rbx),%rax
movsd  (%rax),%xmm1
movapd %xmm1,%xmm2
andpd  0xe17(%rip),%xmm2
movapd (%rsp),%xmm0
cmpltsd %xmm2,%xmm0
andpd  %xmm1,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <print@plt>
mov    0x8(%rbx),%rax
movsd  0x8(%rax),%xmm1
movapd %xmm1,%xmm2
andpd  0xdea(%rip),%xmm2
movapd (%rsp),%xmm0
cmpltsd %xmm2,%xmm0
andpd  %xmm1,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <print@plt>
mov    0x8(%rbx),%rax
movsd  0x10(%rax),%xmm1
movapd %xmm1,%xmm2
andpd  0xdbd(%rip),%xmm2
movapd (%rsp),%xmm0
cmpltsd %xmm2,%xmm0
andpd  %xmm1,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <print@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x10(%rbx),%rax
movsd  (%rax),%xmm1
movapd %xmm1,%xmm2
andpd  0xd87(%rip),%xmm2
movapd (%rsp),%xmm0
cmpltsd %xmm2,%xmm0
andpd  %xmm1,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <print@plt>
mov    0x10(%rbx),%rax
movsd  0x8(%rax),%xmm1
movapd %xmm1,%xmm2
andpd  0xd5a(%rip),%xmm2
movapd (%rsp),%xmm0
cmpltsd %xmm2,%xmm0
andpd  %xmm1,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <print@plt>
mov    0x10(%rbx),%rax
movsd  0x10(%rax),%xmm0
movapd 0xd31(%rip),%xmm2
andpd  %xmm0,%xmm2
movapd (%rsp),%xmm1
cmpltsd %xmm2,%xmm1
andpd  %xmm0,%xmm1
movapd %xmm1,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <print@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
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, double %1) {
%3 = alloca double**
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
store double** %0, double*** %3
store double %1, double* %4
%7 = call i32 (i8*, ...) @print(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %8
8: ; preds = %47, %2
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 3
br i1 %10, label %11, label %50
11: ; preds = %8
store i32 0, i32* %6
br label %12
12: ; preds = %42, %11
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 3
br i1 %14, label %15, label %45
15: ; preds = %12
%16 = load double**, double*** %3
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double*, double** %16, i64 %18
%20 = load double*, double** %19
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds double, double* %20, i64 %22
%24 = load double, double* %23
%25 = call double @llvm.fabs.f64(double %24)
%26 = load double, double* %4
%27 = fcmp ogt double %25, %26
br i1 %27, label %28, label %38
28: ; preds = %15
%29 = load double**, double*** %3
%30 = load i32, i32* %5
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds double*, double** %29, i64 %31
%33 = load double*, double** %32
%34 = load i32, i32* %6
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double, double* %33, i64 %35
%37 = load double, double* %36
br label %39
38: ; preds = %15
br label %39
39: ; preds = %38, %28
%40 = phi double [ %37, %28 ], [ 0.000000e+00, %38 ]
%41 = call i32 (i8*, ...) @print(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %40)
br label %42
42: ; preds = %39
%43 = load i32, i32* %6
%44 = add nsw i32 %43, 1
store i32 %44, i32* %6
br label %12
45: ; preds = %12
%46 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %47
47: ; preds = %45
%48 = load i32, i32* %5
%49 = add nsw i32 %48, 1
store i32 %49, i32* %5
br label %8
50: ; preds = %8
%51 = 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, double %1) {
%3 = tail call i32 (i8*, ...) @print(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%4 = load double*, double** %0
%5 = load double, double* %4
%6 = tail call double @llvm.fabs.f64(double %5)
%7 = fcmp ogt double %6, %1
%8 = select i1 %7, double %5, double 0.000000e+00
%9 = tail call i32 (i8*, ...) @print(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %8)
%10 = load double*, double** %0
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
%13 = tail call double @llvm.fabs.f64(double %12)
%14 = fcmp ogt double %13, %1
%15 = select i1 %14, double %12, double 0.000000e+00
%16 = tail call i32 (i8*, ...) @print(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %15)
%17 = load double*, double** %0
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = tail call double @llvm.fabs.f64(double %19)
%21 = fcmp ogt double %20, %1
%22 = select i1 %21, double %19, double 0.000000e+00
%23 = tail call i32 (i8*, ...) @print(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %22)
%24 = tail call i32 @putchar(i32 10)
%25 = getelementptr inbounds double*, double** %0, i64 1
%26 = load double*, double** %25
%27 = load double, double* %26
%28 = tail call double @llvm.fabs.f64(double %27)
%29 = fcmp ogt double %28, %1
%30 = select i1 %29, double %27, double 0.000000e+00
%31 = tail call i32 (i8*, ...) @print(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %30)
%32 = load double*, double** %25
%33 = getelementptr inbounds double, double* %32, i64 1
%34 = load double, double* %33
%35 = tail call double @llvm.fabs.f64(double %34)
%36 = fcmp ogt double %35, %1
%37 = select i1 %36, double %34, double 0.000000e+00
%38 = tail call i32 (i8*, ...) @print(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %37)
%39 = load double*, double** %25
%40 = getelementptr inbounds double, double* %39, i64 2
%41 = load double, double* %40
%42 = tail call double @llvm.fabs.f64(double %41)
%43 = fcmp ogt double %42, %1
%44 = select i1 %43, double %41, double 0.000000e+00
%45 = tail call i32 (i8*, ...) @print(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %44)
%46 = tail call i32 @putchar(i32 10)
%47 = getelementptr inbounds double*, double** %0, i64 2
%48 = load double*, double** %47
%49 = load double, double* %48
%50 = tail call double @llvm.fabs.f64(double %49)
%51 = fcmp ogt double %50, %1
%52 = select i1 %51, double %49, double 0.000000e+00
%53 = tail call i32 (i8*, ...) @print(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %52)
%54 = load double*, double** %47
%55 = getelementptr inbounds double, double* %54, i64 1
%56 = load double, double* %55
%57 = tail call double @llvm.fabs.f64(double %56)
%58 = fcmp ogt double %57, %1
%59 = select i1 %58, double %56, double 0.000000e+00
%60 = tail call i32 (i8*, ...) @print(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %59)
%61 = load double*, double** %47
%62 = getelementptr inbounds double, double* %61, i64 2
%63 = load double, double* %62
%64 = tail call double @llvm.fabs.f64(double %63)
%65 = fcmp ogt double %64, %1
%66 = select i1 %65, double %63, double 0.000000e+00
%67 = tail call i32 (i8*, ...) @print(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %66)
%68 = tail call i32 @putchar(i32 10)
%69 = tail call i32 (i8*, ...) @print(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
ret void
}