#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*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void print_dot_output(int idominator[], int no_of_vertices, const char *name,
                      FILE *fp) {
  int i;
  fprintf(fp, "digraph %s {\n", name);
  for (i = 0; i < no_of_vertices; i++)
    if (idominator[i] != -1)
      fprintf(fp, "%d -> %d\n", idominator[i], i);
  fprintf(fp, "}\n");
}


x86 assembly (clang, -O0):
<print_dot_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xeca(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1195 <print_dot_output+0x85>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
je     1182 <print_dot_output+0x72>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x24(%rbp),%ecx
lea    0xe93(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1187 <print_dot_output+0x77>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1144 <print_dot_output+0x34>
mov    -0x20(%rbp),%rdi
lea    0xe78(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_dot_output>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rcx,%r14
mov    %esi,%ebx
mov    %rdi,%r12
lea    0xec8(%rip),%rsi
mov    %rcx,%rdi
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %ebx,%ebx
jle    1183 <print_dot_output+0x63>
mov    %ebx,%r13d
lea    0xebe(%rip),%r15
xor    %ebx,%ebx
jmp    1169 <print_dot_output+0x49>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbx
cmp    %rbx,%r13
je     1183 <print_dot_output+0x63>
mov    (%r12,%rbx,4),%edx
cmp    $0xffffffff,%edx
je     1160 <print_dot_output+0x40>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
jmp    1160 <print_dot_output+0x40>
lea    0xe8e(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r14,%rcx
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"digraph %s {\0A\00"
@.str.1 = [10 x i8] c"%d -> %d\0A\00"
@.str.2 = [3 x i8] c"}\0A\00"
define void @print_dot_output(i32* %0, i32 %1, i8* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32* %3, i32** %8
%10 = load i32*, i32** %8
%11 = load i8*, i8** %7
%12 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %11)
store i32 0, i32* %9
br label %13
13: ; preds = %34, %4
%14 = load i32, i32* %9
%15 = load i32, i32* %6
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %37
17: ; preds = %13
%18 = load i32*, i32** %5
%19 = load i32, i32* %9
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
%23 = icmp ne i32 %22, -1
br i1 %23, label %24, label %33
24: ; preds = %17
%25 = load i32*, i32** %8
%26 = load i32*, i32** %5
%27 = load i32, i32* %9
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %26, i64 %28
%30 = load i32, i32* %29
%31 = load i32, i32* %9
%32 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %30, i32 %31)
br label %33
33: ; preds = %24, %17
br label %34
34: ; preds = %33
%35 = load i32, i32* %9
%36 = add nsw i32 %35, 1
store i32 %36, i32* %9
br label %13
37: ; preds = %13
%38 = load i32*, i32** %8
%39 = call i32 (i32*, i8*, ...) @fprintf(i32* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"digraph %s {\0A\00"
@.str.1 = [10 x i8] c"%d -> %d\0A\00"
@.str.2 = [3 x i8] c"}\0A\00"
define void @print_dot_output(i32* nocapture %0, i32 %1, i8* %2, i32* nocapture %3) {
%5 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %20
7: ; preds = %4
%8 = zext i32 %1 to i64
br label %9
9: ; preds = %7, %17
%10 = phi i64 [ 0, %7 ], [ %18, %17 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, -1
br i1 %13, label %17, label %14
14: ; preds = %9
%15 = trunc i64 %10 to i32
%16 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %15)
br label %17
17: ; preds = %9, %14
%18 = add nuw nsw i64 %10, 1
%19 = icmp eq i64 %18, %8
br i1 %19, label %20, label %9
20: ; preds = %17, %4
%21 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i64 2, i64 1, i32* %3)
ret void
}