#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*/ print_edist_matrix_UT(int, int, double **);
int /*<<< orphan*/ print_edist_matrix_full(int, int, double **);
int /*<<< orphan*/ printf(char *);
void print_edist_matrix(int first_N_X, int N_X, double **EDM, int type) {
  if (first_N_X > N_X) {
    first_N_X = N_X;
  }
  switch (type) {
  case 0:
    print_edist_matrix_UT(first_N_X, N_X, EDM);
    break;
  case 1:
    print_edist_matrix_full(first_N_X, N_X, EDM);
    break;
  default:
    printf("Printing method is not found.\n");
  };
}


x86 assembly (clang, -O0):
<print_edist_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1157 <print_edist_matrix+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
test   %eax,%eax
je     117b <print_edist_matrix+0x4b>
jmp    116a <print_edist_matrix+0x3a>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
je     118f <print_edist_matrix+0x5f>
jmp    11a3 <print_edist_matrix+0x73>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1050 <print_edist_matrix_UT@plt>
jmp    11af <print_edist_matrix+0x7f>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <print_edist_matrix_full@plt>
jmp    11af <print_edist_matrix+0x7f>
lea    0xe56(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_edist_matrix>:
cmp    %esi,%edi
cmovg  %esi,%edi
cmp    $0x1,%ecx
je     1143 <print_edist_matrix+0x13>
test   %ecx,%ecx
jne    1148 <print_edist_matrix+0x18>
jmp    1050 <print_edist_matrix_UT@plt>
jmp    1040 <print_edist_matrix_full@plt>
lea    0xeb1(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Printing method is not found.\0A\00"
define void @print_edist_matrix(i32 %0, i32 %1, double** %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double**
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store double** %2, double*** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = load i32, i32* %6
store i32 %13, i32* %5
br label %14
14: ; preds = %12, %4
%15 = load i32, i32* %8
switch i32 %15, label %26 [
i32 0, label %16
i32 1, label %21
]
16: ; preds = %14
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = load double**, double*** %7
%20 = call i32 @print_edist_matrix_UT(i32 %17, i32 %18, double** %19)
br label %28
21: ; preds = %14
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = load double**, double*** %7
%25 = call i32 @print_edist_matrix_full(i32 %22, i32 %23, double** %24)
br label %28
26: ; preds = %14
%27 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %28
28: ; preds = %26, %21, %16
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"Printing method is not found.\00"
define void @print_edist_matrix(i32 %0, i32 %1, double** %2, i32 %3) {
%5 = icmp sgt i32 %0, %1
%6 = select i1 %5, i32 %1, i32 %0
switch i32 %3, label %11 [
i32 0, label %7
i32 1, label %9
]
7: ; preds = %4
%8 = tail call i32 @print_edist_matrix_UT(i32 %6, i32 %1, double** %2)
br label %13
9: ; preds = %4
%10 = tail call i32 @print_edist_matrix_full(i32 %6, i32 %1, double** %2)
br label %13
11: ; preds = %4
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
br label %13
13: ; preds = %11, %9, %7
ret void
}