#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ build_dominator_tree(int **, int *, int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ print_dot_input(int **, int, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ print_dot_output(int *, int, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int mainDominator(int no_of_vertices, int cfg[][100], int idominator[100]) {
  int i, j;
  FILE *input, *output;
  if (no_of_vertices > 100) {
    fprintf(stderr, "Too many nodes..\n");
    abort();
  }
  build_dominator_tree(cfg, idominator, no_of_vertices);
  input = fopen("cfg.dot", "w");
  print_dot_input(cfg, no_of_vertices, "CFG", input);
  output = fopen("dominator.lengauerTarjan.dot", "w");
  print_dot_output(idominator, no_of_vertices,
                   "DOMINATOR_TREE_FROM_LENGAUER_TARJAN", output);
  return 0;
}


x86 assembly (clang, -O0):
<mainDominator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x64,-0x4(%rbp)
jle    1199 <mainDominator+0x39>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
lea    0xe73(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1060 <build_dominator_tree@plt>
lea    0xe62(%rip),%rdi
lea    0xe63(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x28(%rbp),%rcx
lea    0xe4a(%rip),%rdx
call   1050 <print_dot_input@plt>
lea    0xe42(%rip),%rdi
lea    0xe35(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x30(%rbp),%rcx
lea    0xe3d(%rip),%rdx
call   1080 <print_dot_output@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mainDominator>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x65,%edi
jge    11db <mainDominator+0x7b>
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %ebp,%edx
call   1060 <build_dominator_tree@plt>
lea    0xe8a(%rip),%rdi
lea    0xe8b(%rip),%r15
mov    %r15,%rsi
call   1070 <fopen@plt>
lea    0xe7e(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %rax,%rcx
call   1050 <print_dot_input@plt>
lea    0xe6e(%rip),%rdi
mov    %r15,%rsi
call   1070 <fopen@plt>
lea    0xe7c(%rip),%rdx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %rax,%rcx
call   1080 <print_dot_output@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2dfe(%rip),%rax
mov    (%rax),%edi
lea    0xe15(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"Too many nodes..\0A\00"
@.str.1 = [8 x i8] c"cfg.dot\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [4 x i8] c"CFG\00"
@.str.4 = [29 x i8] c"dominator.lengauerTarjan.dot\00"
@.str.5 = [36 x i8] c"DOMINATOR_TREE_FROM_LENGAUER_TARJAN\00"
define i32 @mainDominator(i32 %0, [100 x i32]* %1, i32* %2) {
%4 = alloca i32
%5 = alloca [100 x i32]*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %4
store [100 x i32]* %1, [100 x i32]** %5
store i32* %2, i32** %6
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 100
br i1 %12, label %13, label %17
13: ; preds = %3
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %3
%18 = load [100 x i32]*, [100 x i32]** %5
%19 = bitcast [100 x i32]* %18 to i32**
%20 = load i32*, i32** %6
%21 = load i32, i32* %4
%22 = call i32 @build_dominator_tree(i32** %19, i32* %20, i32 %21)
%23 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %23, i32** %9
%24 = load [100 x i32]*, [100 x i32]** %5
%25 = bitcast [100 x i32]* %24 to i32**
%26 = load i32, i32* %4
%27 = load i32*, i32** %9
%28 = call i32 @print_dot_input(i32** %25, i32 %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32* %27)
%29 = call i32* @fopen(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %29, i32** %10
%30 = load i32*, i32** %6
%31 = load i32, i32* %4
%32 = load i32*, i32** %10
%33 = call i32 @print_dot_output(i32* %30, i32 %31, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i32* %32)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Too many nodes..\0A\00"
@.str.1 = [8 x i8] c"cfg.dot\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [4 x i8] c"CFG\00"
@.str.4 = [29 x i8] c"dominator.lengauerTarjan.dot\00"
@.str.5 = [36 x i8] c"DOMINATOR_TREE_FROM_LENGAUER_TARJAN\00"
define i32 @mainDominator(i32 %0, [100 x i32]* %1, i32* %2) {
%4 = icmp sgt i32 %0, 100
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %3
%10 = bitcast [100 x i32]* %1 to i32**
%11 = tail call i32 @build_dominator_tree(i32** %10, i32* %2, i32 %0)
%12 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%13 = tail call i32 @print_dot_input(i32** %10, i32 %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32* %12)
%14 = tail call i32* @fopen(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%15 = tail call i32 @print_dot_output(i32* %2, i32 %0, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i32* %14)
ret i32 0
}