#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 */
struct string_graph {
  int dummy;
};
struct myovlList {
  int dummy;
};

/* Variables and functions */
struct string_graph *catOVLgraph(struct myovlList *, char *);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printOVLgraph(struct myovlList *, int, char *);
int /*<<< orphan*/ printReducedOVLgraph(struct myovlList *, int, char *);
int /*<<< orphan*/ printStringGraph(struct myovlList *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ stringer3(struct myovlList *);
int /*<<< orphan*/ tag_A_Contained(struct myovlList *);
struct string_graph *initStringGraph(struct myovlList *ovlgraph,
                                     char *pathAssembly, char dotdump) {
  printf("CHECKPOINT: Find initial Containments\n");
  tag_A_Contained(ovlgraph);
  printf("CHECKPOINT: Calculate Overlaps\n");
  stringer3(ovlgraph);
  struct string_graph *S = catOVLgraph(ovlgraph, pathAssembly);
  if (dotdump) {
    char *tempPath = (char *)malloc(200);
    printf("WRITE DOT-FILES\n");
    sprintf(tempPath, "%s/catOrgOVL.dot", pathAssembly);
    printOVLgraph(ovlgraph, 1, tempPath);
    sprintf(tempPath, "%s/catRevOVL.dot", pathAssembly);
    printOVLgraph(ovlgraph, 0, tempPath);
    sprintf(tempPath, "%s/catRedRevOVL.dot", pathAssembly);
    printReducedOVLgraph(ovlgraph, 1, tempPath);
    sprintf(tempPath, "%s/string.dot", pathAssembly);
    printStringGraph(ovlgraph, tempPath);
    free(tempPath);
  }
  return S;
}


x86 assembly (clang, -O0):
<initStringGraph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
lea    0xe44(%rip),%rdi
call   1060 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <tag_A_Contained@plt>
lea    0xe56(%rip),%rdi
call   1060 <printf@plt>
mov    -0x8(%rbp),%rdi
call   10b0 <stringer3@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1080 <catOVLgraph@plt>
mov    %rax,-0x20(%rbp)
cmpb   $0x0,-0x11(%rbp)
je     12ad <initStringGraph+0x10d>
mov    $0xc8,%edi
call   1090 <malloc@plt>
mov    %rax,-0x28(%rbp)
lea    0xe38(%rip),%rdi
call   1060 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe35(%rip),%rsi
call   10c0 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    $0x1,%esi
call   1070 <printOVLgraph@plt>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe20(%rip),%rsi
call   10c0 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rdx
xor    %esi,%esi
call   1070 <printOVLgraph@plt>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe0e(%rip),%rsi
call   10c0 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    $0x1,%esi
call   10a0 <printReducedOVLgraph@plt>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xdfc(%rip),%rsi
call   10c0 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1050 <printStringGraph@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initStringGraph>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r12
lea    0xe8d(%rip),%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
call   1050 <tag_A_Contained@plt>
lea    0xe9f(%rip),%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
call   10b0 <stringer3@plt>
mov    %r12,%rdi
mov    %r14,%rsi
call   1080 <catOVLgraph@plt>
mov    %rax,%r15
test   %bl,%bl
je     128f <initStringGraph+0xef>
mov    $0xc8,%edi
call   1090 <malloc@plt>
mov    %rax,%rbx
lea    0xe87(%rip),%rdi
call   1040 <puts@plt>
lea    0xdf2(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   10c0 <sprintf@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
call   1070 <printOVLgraph@plt>
lea    0xde1(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   10c0 <sprintf@plt>
mov    %r12,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1070 <printOVLgraph@plt>
lea    0xdd3(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   10c0 <sprintf@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
call   10a0 <printReducedOVLgraph@plt>
lea    0xdc5(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   10c0 <sprintf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1060 <printStringGraph@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.string_graph = type { i32 }
%struct.myovlList = type { i32 }
@.str = [39 x i8] c"CHECKPOINT: Find initial Containments\0A\00"
@.str.1 = [32 x i8] c"CHECKPOINT: Calculate Overlaps\0A\00"
@.str.2 = [17 x i8] c"WRITE DOT-FILES\0A\00"
@.str.3 = [17 x i8] c"%s/catOrgOVL.dot\00"
@.str.4 = [17 x i8] c"%s/catRevOVL.dot\00"
@.str.5 = [20 x i8] c"%s/catRedRevOVL.dot\00"
@.str.6 = [14 x i8] c"%s/string.dot\00"
define %struct.string_graph* @initStringGraph(%struct.myovlList* %0, i8* %1, i8 signext %2) {
%4 = alloca %struct.myovlList*
%5 = alloca i8*
%6 = alloca i8
%7 = alloca %struct.string_graph*
%8 = alloca i8*
store %struct.myovlList* %0, %struct.myovlList** %4
store i8* %1, i8** %5
store i8 %2, i8* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%10 = load %struct.myovlList*, %struct.myovlList** %4
%11 = call i32 @tag_A_Contained(%struct.myovlList* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%13 = load %struct.myovlList*, %struct.myovlList** %4
%14 = call i32 @stringer3(%struct.myovlList* %13)
%15 = load %struct.myovlList*, %struct.myovlList** %4
%16 = load i8*, i8** %5
%17 = call %struct.string_graph* @catOVLgraph(%struct.myovlList* %15, i8* %16)
store %struct.string_graph* %17, %struct.string_graph** %7
%18 = load i8, i8* %6
%19 = icmp ne i8 %18, 0
br i1 %19, label %20, label %50
20: ; preds = %3
%21 = call i64 @malloc(i32 200)
%22 = inttoptr i64 %21 to i8*
store i8* %22, i8** %8
%23 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%24 = load i8*, i8** %8
%25 = load i8*, i8** %5
%26 = call i32 @sprintf(i8* %24, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %25)
%27 = load %struct.myovlList*, %struct.myovlList** %4
%28 = load i8*, i8** %8
%29 = call i32 @printOVLgraph(%struct.myovlList* %27, i32 1, i8* %28)
%30 = load i8*, i8** %8
%31 = load i8*, i8** %5
%32 = call i32 @sprintf(i8* %30, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %31)
%33 = load %struct.myovlList*, %struct.myovlList** %4
%34 = load i8*, i8** %8
%35 = call i32 @printOVLgraph(%struct.myovlList* %33, i32 0, i8* %34)
%36 = load i8*, i8** %8
%37 = load i8*, i8** %5
%38 = call i32 @sprintf(i8* %36, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8* %37)
%39 = load %struct.myovlList*, %struct.myovlList** %4
%40 = load i8*, i8** %8
%41 = call i32 @printReducedOVLgraph(%struct.myovlList* %39, i32 1, i8* %40)
%42 = load i8*, i8** %8
%43 = load i8*, i8** %5
%44 = call i32 @sprintf(i8* %42, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* %43)
%45 = load %struct.myovlList*, %struct.myovlList** %4
%46 = load i8*, i8** %8
%47 = call i32 @printStringGraph(%struct.myovlList* %45, i8* %46)
%48 = load i8*, i8** %8
%49 = call i32 @free(i8* %48)
br label %50
50: ; preds = %20, %3
%51 = load %struct.string_graph*, %struct.string_graph** %7
ret %struct.string_graph* %51
}

LLVM IR (-O2):
%struct.string_graph = type { i32 }
%struct.myovlList = type { i32 }
@.str.3 = [17 x i8] c"%s/catOrgOVL.dot\00"
@.str.4 = [17 x i8] c"%s/catRevOVL.dot\00"
@.str.5 = [20 x i8] c"%s/catRedRevOVL.dot\00"
@.str.6 = [14 x i8] c"%s/string.dot\00"
@str = [38 x i8] c"CHECKPOINT: Find initial Containments\00"
@str.7 = [31 x i8] c"CHECKPOINT: Calculate Overlaps\00"
@str.8 = [16 x i8] c"WRITE DOT-FILES\00"
define %struct.string_graph* @initStringGraph(%struct.myovlList* %0, i8* %1, i8 signext %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @tag_A_Contained(%struct.myovlList* %0)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.7, i64 0, i64 0))
%7 = tail call i32 @stringer3(%struct.myovlList* %0)
%8 = tail call %struct.string_graph* @catOVLgraph(%struct.myovlList* %0, i8* %1)
%9 = icmp eq i8 %2, 0
br i1 %9, label %23, label %10
10: ; preds = %3
%11 = tail call i64 @malloc(i32 200)
%12 = inttoptr i64 %11 to i8*
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.8, i64 0, i64 0))
%14 = tail call i32 @sprintf(i8* dereferenceable(1) %12, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%15 = tail call i32 @printOVLgraph(%struct.myovlList* %0, i32 1, i8* %12)
%16 = tail call i32 @sprintf(i8* dereferenceable(1) %12, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %1)
%17 = tail call i32 @printOVLgraph(%struct.myovlList* %0, i32 0, i8* %12)
%18 = tail call i32 @sprintf(i8* dereferenceable(1) %12, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8* %1)
%19 = tail call i32 @printReducedOVLgraph(%struct.myovlList* %0, i32 1, i8* %12)
%20 = tail call i32 @sprintf(i8* dereferenceable(1) %12, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* %1)
%21 = tail call i32 @printStringGraph(%struct.myovlList* %0, i8* %12)
%22 = tail call i32 @free(i8* %12)
br label %23
23: ; preds = %10, %3
ret %struct.string_graph* %8
}