#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcat(char *, scalar_t__);
char *strchr(char *, char);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strncat(char *, char *, int);
scalar_t__ strrchr(char *, char);
int RemoveDupes(char *KlineFile, char *parsedFile) {
  FILE *inFile, *outFile;
  char sLine1[512], sLine2[512];
  char domain1[128], domain2[128], userid1[15], userid2[15];
  memset(sLine1, '\0', 512);
  memcpy(sLine2, sLine1, 512);
  memset(domain1, '\0', 128);
  memcpy(domain2, domain1, 128);
  memset(userid1, '\0', 15);
  memcpy(userid2, userid1, 15);
  inFile = fopen(KlineFile, "r+");
  if (inFile == NULL) {
    printf("No %s found\n", KlineFile);
    return EXIT_FAILURE;
  }
  outFile = fopen(parsedFile, "w+");
  if (outFile == NULL) {
    fclose(inFile);
    printf("Could not open %s.parsed for writing.\n", KlineFile);
    return EXIT_FAILURE;
  }
  if (fgets(sLine1, 512, inFile) == NULL) {
    fclose(inFile);
    printf("%s is empty.\n", KlineFile);
    return EXIT_FAILURE;
  }
  while (!feof(inFile)) {
    fgets(sLine2, 512, inFile);
    if (sLine1[0] == 'K' && sLine2[0] == 'K') {
      strncat(domain1, sLine1 + 2, strchr(sLine1 + 2, ':') - sLine1 - 2);
      strcat(userid1, strrchr(sLine1, ':') + 1);
      strncat(domain2, sLine2 + 2, strchr(sLine2 + 2, ':') - sLine2 - 2);
      strcat(userid2, strrchr(sLine2, ':') + 1);
      if (strcmp(domain1, domain2) != 0 || strcmp(userid1, userid2) != 0) {
        fputs(sLine1, outFile);
      }
      domain1[0] = userid1[0] = domain2[0] = userid2[0] = '\0';
    } else {
      fputs(sLine1, outFile);
    }
    strcpy(sLine1, sLine2);
    memset(sLine2, '\0', 512);
  }
  fputs(sLine2, outFile);
  fclose(inFile);
  fclose(outFile);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<RemoveDupes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x580,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x230(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1090 <memset@plt>
lea    -0x430(%rbp),%rdi
lea    -0x230(%rbp),%rsi
mov    $0x200,%edx
call   10e0 <memcpy@plt>
lea    -0x4b0(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1090 <memset@plt>
lea    -0x530(%rbp),%rdi
lea    -0x4b0(%rbp),%rsi
mov    $0x80,%edx
call   10e0 <memcpy@plt>
lea    -0x53f(%rbp),%rdi
xor    %esi,%esi
mov    $0xf,%edx
call   1090 <memset@plt>
lea    -0x54e(%rbp),%rdi
lea    -0x53f(%rbp),%rsi
mov    $0xf,%edx
call   10e0 <memcpy@plt>
mov    -0x10(%rbp),%rdi
lea    0xd81(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    12b4 <RemoveDupes+0xd4>
mov    -0x10(%rbp),%rsi
lea    0xd65(%rip),%rdi
call   1060 <printf@plt>
mov    0x2d36(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1586 <RemoveDupes+0x3a6>
mov    -0x18(%rbp),%rdi
lea    0xd51(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    12fd <RemoveDupes+0x11d>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rsi
lea    0xd2c(%rip),%rdi
call   1060 <printf@plt>
mov    0x2ced(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1586 <RemoveDupes+0x3a6>
lea    -0x230(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x200,%esi
call   10b0 <fgets@plt>
cmp    $0x0,%rax
jne    1346 <RemoveDupes+0x166>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rsi
lea    0xd0a(%rip),%rdi
call   1060 <printf@plt>
mov    0x2ca4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1586 <RemoveDupes+0x3a6>
jmp    134b <RemoveDupes+0x16b>
mov    -0x20(%rbp),%rdi
call   10d0 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1369 <RemoveDupes+0x189>
jmp    1558 <RemoveDupes+0x378>
lea    -0x430(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x200,%esi
call   10b0 <fgets@plt>
movsbl -0x230(%rbp),%eax
cmp    $0x4b,%eax
jne    151d <RemoveDupes+0x33d>
movsbl -0x430(%rbp),%eax
cmp    $0x4b,%eax
jne    151d <RemoveDupes+0x33d>
lea    -0x4b0(%rbp),%rax
mov    %rax,-0x580(%rbp)
lea    -0x230(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x578(%rbp)
lea    -0x230(%rbp),%rdi
add    $0x2,%rdi
mov    $0x3a,%esi
call   1050 <strchr@plt>
mov    -0x580(%rbp),%rdi
mov    -0x578(%rbp),%rsi
lea    -0x230(%rbp),%rcx
sub    %rcx,%rax
sub    $0x2,%rax
mov    %eax,%edx
call   10a0 <strncat@plt>
lea    -0x53f(%rbp),%rax
mov    %rax,-0x570(%rbp)
lea    -0x230(%rbp),%rdi
mov    $0x3a,%esi
call   1070 <strrchr@plt>
mov    -0x570(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
call   1100 <strcat@plt>
lea    -0x530(%rbp),%rax
mov    %rax,-0x568(%rbp)
lea    -0x430(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x560(%rbp)
lea    -0x430(%rbp),%rdi
add    $0x2,%rdi
mov    $0x3a,%esi
call   1050 <strchr@plt>
mov    -0x568(%rbp),%rdi
mov    -0x560(%rbp),%rsi
lea    -0x430(%rbp),%rcx
sub    %rcx,%rax
sub    $0x2,%rax
mov    %eax,%edx
call   10a0 <strncat@plt>
lea    -0x54e(%rbp),%rax
mov    %rax,-0x558(%rbp)
lea    -0x430(%rbp),%rdi
mov    $0x3a,%esi
call   1070 <strrchr@plt>
mov    -0x558(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
call   1100 <strcat@plt>
lea    -0x4b0(%rbp),%rdi
lea    -0x530(%rbp),%rsi
call   10c0 <strcmp@plt>
cmp    $0x0,%rax
jne    14ec <RemoveDupes+0x30c>
lea    -0x53f(%rbp),%rdi
lea    -0x54e(%rbp),%rsi
call   10c0 <strcmp@plt>
cmp    $0x0,%rax
je     14fc <RemoveDupes+0x31c>
lea    -0x230(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1080 <fputs@plt>
movb   $0x0,-0x54e(%rbp)
movb   $0x0,-0x530(%rbp)
movb   $0x0,-0x53f(%rbp)
movb   $0x0,-0x4b0(%rbp)
jmp    152d <RemoveDupes+0x34d>
lea    -0x230(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1080 <fputs@plt>
lea    -0x230(%rbp),%rdi
lea    -0x430(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x430(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1090 <memset@plt>
jmp    134b <RemoveDupes+0x16b>
lea    -0x430(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
mov    0x2a57(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x580,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RemoveDupes>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x538,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x330(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1090 <memset@plt>
lea    0x130(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x200,%edx
call   10e0 <memcpy@plt>
lea    0xb0(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1090 <memset@plt>
lea    0x30(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x80,%edx
call   10e0 <memcpy@plt>
lea    0x19(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xf,%edx
call   1090 <memset@plt>
lea    0xa(%rsp),%rdi
mov    %rbx,%rsi
mov    $0xf,%edx
call   10e0 <memcpy@plt>
lea    0xd87(%rip),%rsi
mov    %r15,%rdi
call   10f0 <fopen@plt>
test   %rax,%rax
je     12ef <RemoveDupes+0x10f>
mov    %rax,%rbp
lea    0xd80(%rip),%rsi
mov    %r14,%rdi
call   10f0 <fopen@plt>
test   %rax,%rax
je     12f8 <RemoveDupes+0x118>
mov    %rax,%r12
lea    0x330(%rsp),%rdi
mov    $0x200,%esi
mov    %rbp,%rdx
call   10b0 <fgets@plt>
test   %rax,%rax
je     1309 <RemoveDupes+0x129>
mov    %rbp,%rdi
call   10d0 <feof@plt>
test   %eax,%eax
je     133b <RemoveDupes+0x15b>
lea    0x130(%rsp),%rdi
mov    %r12,%rsi
call   1080 <fputs@plt>
mov    %rbp,%rdi
call   1040 <fclose@plt>
mov    %r12,%rdi
call   1040 <fclose@plt>
mov    0x2ceb(%rip),%rax
jmp    1327 <RemoveDupes+0x147>
lea    0xd0d(%rip),%rdi
jmp    1318 <RemoveDupes+0x138>
mov    %rbp,%rdi
call   1040 <fclose@plt>
lea    0xd0c(%rip),%rdi
jmp    1318 <RemoveDupes+0x138>
mov    %rbp,%rdi
call   1040 <fclose@plt>
lea    0xd22(%rip),%rdi
mov    %r15,%rsi
call   1060 <printf@plt>
mov    0x2cb9(%rip),%rax
mov    (%rax),%eax
add    $0x538,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x130(%rsp),%rbx
lea    0x330(%rsp),%r13
mov    %rbp,0x28(%rsp)
jmp    1395 <RemoveDupes+0x1b5>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r13,%rdi
mov    %r12,%rsi
call   1080 <fputs@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1090 <memset@plt>
mov    %rbp,%rdi
call   10d0 <feof@plt>
test   %eax,%eax
jne    12c6 <RemoveDupes+0xe6>
mov    %rbx,%rdi
mov    $0x200,%esi
mov    %rbp,%rdx
call   10b0 <fgets@plt>
cmpb   $0x4b,0x330(%rsp)
4b
jne    1360 <RemoveDupes+0x180>
cmpb   $0x4b,0x130(%rsp)
4b
jne    1360 <RemoveDupes+0x180>
lea    0x332(%rsp),%r15
mov    %r15,%rdi
mov    $0x3a,%esi
call   1050 <strchr@plt>
sub    %r13d,%eax
lea    -0x2(%rax),%edx
lea    0xb0(%rsp),%r14
mov    %r14,%rdi
mov    %r15,%rsi
call   10a0 <strncat@plt>
mov    %r13,%rdi
mov    $0x3a,%esi
call   1070 <strrchr@plt>
lea    0x1(%rax),%rsi
lea    0x19(%rsp),%rdi
call   1100 <strcat@plt>
lea    0x132(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x3a,%esi
call   1050 <strchr@plt>
sub    %ebx,%eax
lea    -0x2(%rax),%edx
lea    0x30(%rsp),%r15
mov    %r15,%rdi
mov    %rbp,%rsi
call   10a0 <strncat@plt>
mov    %rbx,%rdi
mov    $0x3a,%esi
call   1070 <strrchr@plt>
lea    0x1(%rax),%rsi
lea    0xa(%rsp),%rdi
call   1100 <strcat@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   10c0 <strcmp@plt>
test   %rax,%rax
jne    146b <RemoveDupes+0x28b>
lea    0x19(%rsp),%rdi
lea    0xa(%rsp),%rsi
call   10c0 <strcmp@plt>
test   %rax,%rax
je     1476 <RemoveDupes+0x296>
mov    %r13,%rdi
mov    %r12,%rsi
call   1080 <fputs@plt>
movb   $0x0,0xa(%rsp)
movb   $0x0,0x30(%rsp)
movb   $0x0,0x19(%rsp)
movb   $0x0,0xb0(%rsp)
mov    0x28(%rsp),%rbp
jmp    136b <RemoveDupes+0x18b>

LLVM IR (-O0):
@.str = [3 x i8] c"r+\00"
@.str.1 = [13 x i8] c"No %s found\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [3 x i8] c"w+\00"
@.str.3 = [39 x i8] c"Could not open %s.parsed for writing.\0A\00"
@.str.4 = [14 x i8] c"%s is empty.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @RemoveDupes(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca [512 x i8]
%9 = alloca [512 x i8]
%10 = alloca [128 x i8]
%11 = alloca [128 x i8]
%12 = alloca [15 x i8]
%13 = alloca [15 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
%14 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%15 = call i32 @memset(i8* %14, i8 signext 0, i32 512)
%16 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%17 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%18 = call i32 @memcpy(i8* %16, i8* %17, i32 512)
%19 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%20 = call i32 @memset(i8* %19, i8 signext 0, i32 128)
%21 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%22 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%23 = call i32 @memcpy(i8* %21, i8* %22, i32 128)
%24 = getelementptr inbounds [15 x i8], [15 x i8]* %12, i64 0, i64 0
%25 = call i32 @memset(i8* %24, i8 signext 0, i32 15)
%26 = getelementptr inbounds [15 x i8], [15 x i8]* %13, i64 0, i64 0
%27 = getelementptr inbounds [15 x i8], [15 x i8]* %12, i64 0, i64 0
%28 = call i32 @memcpy(i8* %26, i8* %27, i32 15)
%29 = load i8*, i8** %4
%30 = call i32* @fopen(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %30, i32** %6
%31 = load i32*, i32** %6
%32 = icmp eq i32* %31, null
br i1 %32, label %33, label %37
33: ; preds = %2
%34 = load i8*, i8** %4
%35 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %34)
%36 = load i32, i32* @EXIT_FAILURE
store i32 %36, i32* %3
br label %152
37: ; preds = %2
%38 = load i8*, i8** %5
%39 = call i32* @fopen(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %39, i32** %7
%40 = load i32*, i32** %7
%41 = icmp eq i32* %40, null
br i1 %41, label %42, label %48
42: ; preds = %37
%43 = load i32*, i32** %6
%44 = call i32 @fclose(i32* %43)
%45 = load i8*, i8** %4
%46 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i8* %45)
%47 = load i32, i32* @EXIT_FAILURE
store i32 %47, i32* %3
br label %152
48: ; preds = %37
%49 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%50 = load i32*, i32** %6
%51 = call i32* @fgets(i8* %49, i32 512, i32* %50)
%52 = icmp eq i32* %51, null
br i1 %52, label %53, label %59
53: ; preds = %48
%54 = load i32*, i32** %6
%55 = call i32 @fclose(i32* %54)
%56 = load i8*, i8** %4
%57 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %56)
%58 = load i32, i32* @EXIT_FAILURE
store i32 %58, i32* %3
br label %152
59: ; preds = %48
br label %60
60: ; preds = %137, %59
%61 = load i32*, i32** %6
%62 = call i32 @feof(i32* %61)
%63 = icmp ne i32 %62, 0
%64 = xor i1 %63, true
br i1 %64, label %65, label %143
65: ; preds = %60
%66 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%67 = load i32*, i32** %6
%68 = call i32* @fgets(i8* %66, i32 512, i32* %67)
%69 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%70 = load i8, i8* %69
%71 = sext i8 %70 to i32
%72 = icmp eq i32 %71, 75
br i1 %72, label %73, label %133
73: ; preds = %65
%74 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = icmp eq i32 %76, 75
br i1 %77, label %78, label %133
78: ; preds = %73
%79 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%80 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%81 = getelementptr inbounds i8, i8* %80, i64 2
%82 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%83 = getelementptr inbounds i8, i8* %82, i64 2
%84 = call i8* @strchr(i8* %83, i8 signext 58)
%85 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%86 = ptrtoint i8* %84 to i64
%87 = ptrtoint i8* %85 to i64
%88 = sub i64 %86, %87
%89 = sub nsw i64 %88, 2
%90 = trunc i64 %89 to i32
%91 = call i32 @strncat(i8* %79, i8* %81, i32 %90)
%92 = getelementptr inbounds [15 x i8], [15 x i8]* %12, i64 0, i64 0
%93 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%94 = call i64 @strrchr(i8* %93, i8 signext 58)
%95 = add nsw i64 %94, 1
%96 = call i32 @strcat(i8* %92, i64 %95)
%97 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%98 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%99 = getelementptr inbounds i8, i8* %98, i64 2
%100 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%101 = getelementptr inbounds i8, i8* %100, i64 2
%102 = call i8* @strchr(i8* %101, i8 signext 58)
%103 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%104 = ptrtoint i8* %102 to i64
%105 = ptrtoint i8* %103 to i64
%106 = sub i64 %104, %105
%107 = sub nsw i64 %106, 2
%108 = trunc i64 %107 to i32
%109 = call i32 @strncat(i8* %97, i8* %99, i32 %108)
%110 = getelementptr inbounds [15 x i8], [15 x i8]* %13, i64 0, i64 0
%111 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%112 = call i64 @strrchr(i8* %111, i8 signext 58)
%113 = add nsw i64 %112, 1
%114 = call i32 @strcat(i8* %110, i64 %113)
%115 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%116 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%117 = call i64 @strcmp(i8* %115, i8* %116)
%118 = icmp ne i64 %117, 0
br i1 %118, label %124, label %119
119: ; preds = %78
%120 = getelementptr inbounds [15 x i8], [15 x i8]* %12, i64 0, i64 0
%121 = getelementptr inbounds [15 x i8], [15 x i8]* %13, i64 0, i64 0
%122 = call i64 @strcmp(i8* %120, i8* %121)
%123 = icmp ne i64 %122, 0
br i1 %123, label %124, label %128
124: ; preds = %119, %78
%125 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%126 = load i32*, i32** %7
%127 = call i32 @fputs(i8* %125, i32* %126)
br label %128
128: ; preds = %124, %119
%129 = getelementptr inbounds [15 x i8], [15 x i8]* %13, i64 0, i64 0
store i8 0, i8* %129
%130 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
store i8 0, i8* %130
%131 = getelementptr inbounds [15 x i8], [15 x i8]* %12, i64 0, i64 0
store i8 0, i8* %131
%132 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
store i8 0, i8* %132
br label %137
133: ; preds = %73, %65
%134 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%135 = load i32*, i32** %7
%136 = call i32 @fputs(i8* %134, i32* %135)
br label %137
137: ; preds = %133, %128
%138 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%139 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%140 = call i32 @strcpy(i8* %138, i8* %139)
%141 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%142 = call i32 @memset(i8* %141, i8 signext 0, i32 512)
br label %60
143: ; preds = %60
%144 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%145 = load i32*, i32** %7
%146 = call i32 @fputs(i8* %144, i32* %145)
%147 = load i32*, i32** %6
%148 = call i32 @fclose(i32* %147)
%149 = load i32*, i32** %7
%150 = call i32 @fclose(i32* %149)
%151 = load i32, i32* @EXIT_SUCCESS
store i32 %151, i32* %3
br label %152
152: ; preds = %143, %53, %42, %33
%153 = load i32, i32* %3
ret i32 %153
}

LLVM IR (-O2):
@.str = [3 x i8] c"r+\00"
@.str.1 = [13 x i8] c"No %s found\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [3 x i8] c"w+\00"
@.str.3 = [39 x i8] c"Could not open %s.parsed for writing.\0A\00"
@.str.4 = [14 x i8] c"%s is empty.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @RemoveDupes(i8* %0, i8* nocapture %1) {
%3 = alloca [512 x i8]
%4 = alloca [512 x i8]
%5 = alloca [128 x i8]
%6 = alloca [128 x i8]
%7 = alloca [15 x i8]
%8 = alloca [15 x i8]
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%13 = getelementptr inbounds [15 x i8], [15 x i8]* %7, i64 0, i64 0
%14 = getelementptr inbounds [15 x i8], [15 x i8]* %8, i64 0, i64 0
%15 = call i32 @memset(i8* %9, i8 signext 0, i32 512)
%16 = call i32 @memcpy(i8* %10, i8* %9, i32 512)
%17 = call i32 @memset(i8* %11, i8 signext 0, i32 128)
%18 = call i32 @memcpy(i8* %12, i8* %11, i32 128)
%19 = call i32 @memset(i8* %13, i8 signext 0, i32 15)
%20 = call i32 @memcpy(i8* %14, i8* %13, i32 15)
%21 = call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%22 = icmp eq i32* %21, null
br i1 %22, label %23, label %25
23: ; preds = %2
%24 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %90
25: ; preds = %2
%26 = call i32* @fopen(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%27 = icmp eq i32* %26, null
br i1 %27, label %28, label %31
28: ; preds = %25
%29 = call i32 @fclose(i32* %21)
%30 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i8* %0)
br label %90
31: ; preds = %25
%32 = call i32* @fgets(i8* %9, i32 512, i32* %21)
%33 = icmp eq i32* %32, null
br i1 %33, label %42, label %34
34: ; preds = %31
%35 = call i32 @feof(i32* %21)
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %86
37: ; preds = %34
%38 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 2
%39 = ptrtoint [512 x i8]* %3 to i64
%40 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 2
%41 = ptrtoint [512 x i8]* %4 to i64
br label %45
42: ; preds = %31
%43 = call i32 @fclose(i32* %21)
%44 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %0)
br label %90
45: ; preds = %37, %81
%46 = call i32* @fgets(i8* %10, i32 512, i32* %21)
%47 = load i8, i8* %9
%48 = icmp eq i8 %47, 75
%49 = load i8, i8* %10
%50 = icmp eq i8 %49, 75
%51 = select i1 %48, i1 %50, i1 false
br i1 %51, label %52, label %79
52: ; preds = %45
%53 = call i8* @strchr(i8* %38, i8 signext 58)
%54 = ptrtoint i8* %53 to i64
%55 = sub i64 %54, %39
%56 = trunc i64 %55 to i32
%57 = add i32 %56, -2
%58 = call i32 @strncat(i8* %11, i8* %38, i32 %57)
%59 = call i64 @strrchr(i8* %9, i8 signext 58)
%60 = add nsw i64 %59, 1
%61 = call i32 @strcat(i8* %13, i64 %60)
%62 = call i8* @strchr(i8* %40, i8 signext 58)
%63 = ptrtoint i8* %62 to i64
%64 = sub i64 %63, %41
%65 = trunc i64 %64 to i32
%66 = add i32 %65, -2
%67 = call i32 @strncat(i8* %12, i8* %40, i32 %66)
%68 = call i64 @strrchr(i8* %10, i8 signext 58)
%69 = add nsw i64 %68, 1
%70 = call i32 @strcat(i8* %14, i64 %69)
%71 = call i64 @strcmp(i8* %11, i8* %12)
%72 = icmp eq i64 %71, 0
br i1 %72, label %73, label %76
73: ; preds = %52
%74 = call i64 @strcmp(i8* %13, i8* %14)
%75 = icmp eq i64 %74, 0
br i1 %75, label %78, label %76
76: ; preds = %73, %52
%77 = call i32 @fputs(i8* %9, i32* %26)
br label %78
78: ; preds = %76, %73
store i8 0, i8* %14
store i8 0, i8* %12
store i8 0, i8* %13
store i8 0, i8* %11
br label %81
79: ; preds = %45
%80 = call i32 @fputs(i8* %9, i32* %26)
br label %81
81: ; preds = %79, %78
%82 = call i32 @strcpy(i8* %9, i8* %10)
%83 = call i32 @memset(i8* %10, i8 signext 0, i32 512)
%84 = call i32 @feof(i32* %21)
%85 = icmp eq i32 %84, 0
br i1 %85, label %45, label %86
86: ; preds = %81, %34
%87 = call i32 @fputs(i8* %10, i32* %26)
%88 = call i32 @fclose(i32* %21)
%89 = call i32 @fclose(i32* %26)
br label %90
90: ; preds = %86, %42, %28, %23
%91 = phi i32* [ @EXIT_FAILURE, %23 ], [ @EXIT_FAILURE, %28 ], [ @EXIT_FAILURE, %42 ], [ @EXIT_SUCCESS, %86 ]
%92 = load i32, i32* %91
ret i32 %92
}