#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 */
scalar_t__ is_finite(double);
int /*<<< orphan*/ printf(char *, ...);
void print_edist_matrix_full(int first_N_X, int N_X, double **EDM) {
  int i, j;
  printf("  ");
  for (i = 0; i < first_N_X; i++) {
    printf(" %8d", i);
  }
  printf("\n");
  for (i = 0; i < first_N_X; i++) {
    printf("%2d", i);
    for (j = 0; j < i; j++) {
      if (is_finite(EDM[j][i - j - 1])) {
        printf(" %8.4f", EDM[j][i - j - 1]);
      } else {
        printf(" %8.1e", EDM[j][i - j - 1]);
      }
    }
    printf("         ");
    for (j = 0; j < (first_N_X - i - 1); j++) {
      if (is_finite(EDM[i][j])) {
        printf(" %8.4f", EDM[i][j]);
      } else {
        printf(" %8.1e", EDM[i][j]);
      }
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<print_edist_matrix_full>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
lea    0xee7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1172 <print_edist_matrix_full+0x52>
mov    -0x14(%rbp),%esi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <print_edist_matrix_full+0x27>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1318 <print_edist_matrix_full+0x1f8>
mov    -0x14(%rbp),%esi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1251 <print_edist_matrix_full+0x131>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x14(%rbp),%ecx
sub    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1040 <is_finite@plt>
cmp    $0x0,%rax
je     1213 <print_edist_matrix_full+0xf3>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x14(%rbp),%ecx
sub    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe04(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    123e <print_edist_matrix_full+0x11e>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x14(%rbp),%ecx
sub    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xddb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1243 <print_edist_matrix_full+0x123>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11ab <print_edist_matrix_full+0x8b>
lea    0xdc1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12fc <print_edist_matrix_full+0x1dc>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1040 <is_finite@plt>
cmp    $0x0,%rax
je     12c6 <print_edist_matrix_full+0x1a6>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xd51(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    12e9 <print_edist_matrix_full+0x1c9>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xd30(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    12ee <print_edist_matrix_full+0x1ce>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1266 <print_edist_matrix_full+0x146>
lea    0xd02(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1187 <print_edist_matrix_full+0x67>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_edist_matrix_full>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdx,%r12
mov    %edi,%r15d
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r15d,%r15d
jle    12c5 <print_edist_matrix_full+0x195>
lea    0xe9e(%rip),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%r15d
jne    1170 <print_edist_matrix_full+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r15d,%r15d
jle    12b6 <print_edist_matrix_full+0x186>
mov    %r15d,%eax
mov    %rax,0x18(%rsp)
lea    -0x1(%r15),%r14d
lea    0xe66(%rip),%r13
xor    %eax,%eax
mov    %rax,0x8(%rsp)
xor    %ebx,%ebx
mov    %r15,0x10(%rsp)
jmp    11e3 <print_edist_matrix_full+0xb3>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
addq   $0x8,0x8(%rsp)
add    $0xffffffff,%r14d
cmp    0x18(%rsp),%rbx
je     12b6 <print_edist_matrix_full+0x186>
mov    %r14,0x20(%rsp)
lea    0xe16(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %rbx,%rbx
mov    %r13,%rbp
lea    0xe04(%rip),%r15
je     1246 <print_edist_matrix_full+0x116>
mov    0x8(%rsp),%r14
mov    %r12,%r13
nop
mov    0x0(%r13),%rax
movsd  -0x8(%rax,%r14,1),%xmm0
call   1050 <is_finite@plt>
test   %rax,%rax
mov    0x0(%r13),%rax
movsd  -0x8(%rax,%r14,1),%xmm0
mov    %r15,%rdi
cmove  %rbp,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x8,%r13
add    $0xfffffffffffffff8,%r14
jne    1210 <print_edist_matrix_full+0xe0>
mov    0x20(%rsp),%r14
mov    %r14d,%r14d
lea    0xdc2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%eax
not    %eax
add    0x10(%rsp),%eax
test   %eax,%eax
mov    %rbp,%r13
jle    11c0 <print_edist_matrix_full+0x90>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r12,%rbx,8),%rax
movsd  (%rax,%rbp,8),%xmm0
call   1050 <is_finite@plt>
test   %rax,%rax
mov    (%r12,%rbx,8),%rax
movsd  (%rax,%rbp,8),%xmm0
mov    %r15,%rdi
cmove  %r13,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r14
jne    1280 <print_edist_matrix_full+0x150>
jmp    11c0 <print_edist_matrix_full+0x90>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0xa,%edi
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c" \00"
@.str.1 = [5 x i8] c" %8d\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [4 x i8] c"%2d\00"
@.str.4 = [7 x i8] c" %8.4f\00"
@.str.5 = [7 x i8] c" %8.1e\00"
@.str.6 = [10 x i8] c" \00"
define void @print_edist_matrix_full(i32 %0, i32 %1, double** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double**
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store double** %2, double*** %6
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %7
br label %10
10: ; preds = %17, %3
%11 = load i32, i32* %7
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %20
14: ; preds = %10
%15 = load i32, i32* %7
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %14
%18 = load i32, i32* %7
%19 = add nsw i32 %18, 1
store i32 %19, i32* %7
br label %10
20: ; preds = %10
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %7
br label %22
22: ; preds = %129, %20
%23 = load i32, i32* %7
%24 = load i32, i32* %4
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %132
26: ; preds = %22
%27 = load i32, i32* %7
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %27)
store i32 0, i32* %8
br label %29
29: ; preds = %77, %26
%30 = load i32, i32* %8
%31 = load i32, i32* %7
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %80
33: ; preds = %29
%34 = load double**, double*** %6
%35 = load i32, i32* %8
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds double*, double** %34, i64 %36
%38 = load double*, double** %37
%39 = load i32, i32* %7
%40 = load i32, i32* %8
%41 = sub nsw i32 %39, %40
%42 = sub nsw i32 %41, 1
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %38, i64 %43
%45 = load double, double* %44
%46 = call i64 @is_finite(double %45)
%47 = icmp ne i64 %46, 0
br i1 %47, label %48, label %62
48: ; preds = %33
%49 = load double**, double*** %6
%50 = load i32, i32* %8
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double*, double** %49, i64 %51
%53 = load double*, double** %52
%54 = load i32, i32* %7
%55 = load i32, i32* %8
%56 = sub nsw i32 %54, %55
%57 = sub nsw i32 %56, 1
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds double, double* %53, i64 %58
%60 = load double, double* %59
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %60)
br label %76
62: ; preds = %33
%63 = load double**, double*** %6
%64 = load i32, i32* %8
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds double*, double** %63, i64 %65
%67 = load double*, double** %66
%68 = load i32, i32* %7
%69 = load i32, i32* %8
%70 = sub nsw i32 %68, %69
%71 = sub nsw i32 %70, 1
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double, double* %67, i64 %72
%74 = load double, double* %73
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), double %74)
br label %76
76: ; preds = %62, %48
br label %77
77: ; preds = %76
%78 = load i32, i32* %8
%79 = add nsw i32 %78, 1
store i32 %79, i32* %8
br label %29
80: ; preds = %29
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %8
br label %82
82: ; preds = %124, %80
%83 = load i32, i32* %8
%84 = load i32, i32* %4
%85 = load i32, i32* %7
%86 = sub nsw i32 %84, %85
%87 = sub nsw i32 %86, 1
%88 = icmp slt i32 %83, %87
br i1 %88, label %89, label %127
89: ; preds = %82
%90 = load double**, double*** %6
%91 = load i32, i32* %7
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds double*, double** %90, i64 %92
%94 = load double*, double** %93
%95 = load i32, i32* %8
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds double, double* %94, i64 %96
%98 = load double, double* %97
%99 = call i64 @is_finite(double %98)
%100 = icmp ne i64 %99, 0
br i1 %100, label %101, label %112
101: ; preds = %89
%102 = load double**, double*** %6
%103 = load i32, i32* %7
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds double*, double** %102, i64 %104
%106 = load double*, double** %105
%107 = load i32, i32* %8
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds double, double* %106, i64 %108
%110 = load double, double* %109
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %110)
br label %123
112: ; preds = %89
%113 = load double**, double*** %6
%114 = load i32, i32* %7
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds double*, double** %113, i64 %115
%117 = load double*, double** %116
%118 = load i32, i32* %8
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds double, double* %117, i64 %119
%121 = load double, double* %120
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), double %121)
br label %123
123: ; preds = %112, %101
br label %124
124: ; preds = %123
%125 = load i32, i32* %8
%126 = add nsw i32 %125, 1
store i32 %126, i32* %8
br label %82
127: ; preds = %82
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %129
129: ; preds = %127
%130 = load i32, i32* %7
%131 = add nsw i32 %130, 1
store i32 %131, i32* %7
br label %22
132: ; preds = %22
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
@.str.1 = [5 x i8] c" %8d\00"
@.str.3 = [4 x i8] c"%2d\00"
@.str.4 = [7 x i8] c" %8.4f\00"
@.str.5 = [7 x i8] c" %8.1e\00"
@.str.6 = [10 x i8] c" \00"
define void @print_edist_matrix_full(i32 %0, i32 %1, double** nocapture %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp sgt i32 %0, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @putchar(i32 10)
br label %67
8: ; preds = %3, %8
%9 = phi i32 [ %11, %8 ], [ 0, %3 ]
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i32 %9, 1
%12 = icmp eq i32 %11, %0
br i1 %12, label %13, label %8
13: ; preds = %8
%14 = tail call i32 @putchar(i32 10)
br i1 %5, label %15, label %67
15: ; preds = %13
%16 = zext i32 %0 to i64
br label %17
17: ; preds = %15, %63
%18 = phi i64 [ 0, %15 ], [ %65, %63 ]
%19 = phi i32 [ %0, %15 ], [ %20, %63 ]
%20 = add i32 %19, -1
%21 = trunc i64 %18 to i32
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %21)
%23 = icmp eq i64 %18, 0
br i1 %23, label %41, label %24
24: ; preds = %17, %24
%25 = phi i64 [ %39, %24 ], [ 0, %17 ]
%26 = getelementptr inbounds double*, double** %2, i64 %25
%27 = load double*, double** %26
%28 = xor i64 %25, -1
%29 = add nsw i64 %18, %28
%30 = getelementptr inbounds double, double* %27, i64 %29
%31 = load double, double* %30
%32 = tail call i64 @is_finite(double %31)
%33 = icmp eq i64 %32, 0
%34 = load double*, double** %26
%35 = getelementptr inbounds double, double* %34, i64 %29
%36 = load double, double* %35
%37 = select i1 %33, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %37, double %36)
%39 = add nuw nsw i64 %25, 1
%40 = icmp eq i64 %39, %18
br i1 %40, label %41, label %24
41: ; preds = %24, %17
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%43 = xor i32 %21, -1
%44 = add i32 %43, %0
%45 = icmp sgt i32 %44, 0
br i1 %45, label %46, label %63
46: ; preds = %41
%47 = getelementptr inbounds double*, double** %2, i64 %18
%48 = zext i32 %20 to i64
br label %49
49: ; preds = %46, %49
%50 = phi i64 [ 0, %46 ], [ %61, %49 ]
%51 = load double*, double** %47
%52 = getelementptr inbounds double, double* %51, i64 %50
%53 = load double, double* %52
%54 = tail call i64 @is_finite(double %53)
%55 = icmp eq i64 %54, 0
%56 = load double*, double** %47
%57 = getelementptr inbounds double, double* %56, i64 %50
%58 = load double, double* %57
%59 = select i1 %55, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %59, double %58)
%61 = add nuw nsw i64 %50, 1
%62 = icmp eq i64 %61, %48
br i1 %62, label %63, label %49
63: ; preds = %49, %41
%64 = tail call i32 @putchar(i32 10)
%65 = add nuw nsw i64 %18, 1
%66 = icmp eq i64 %65, %16
br i1 %66, label %67, label %17
67: ; preds = %63, %6, %13
ret void
}