#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ RemoveDupes(char *, char *);
scalar_t__ RemoveRedundant(char *, char *, short);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ remove(char *);
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strchr(char *, char);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *strrchr(char *, char);
scalar_t__ strspn(char *, char *);
int main(int argc, char *argv[]) {
  char *parsedFile, *klineFile, appName[128];
  short dupeCheck, altInput, altOutput, showMatches;
  dupeCheck = altInput = altOutput = showMatches = 0;
  memset(appName, '\0', 128);
  if (argc > 1) {
    if (argv[1][0] == '-') {
      if (strspn(argv[1], "-dvf\0") != strlen(argv[1])) {
        goto paramReturn;
      }
      if (strchr(argv[1], 'f')) {
        if (argc > 3) {
          parsedFile = (char *)malloc(strlen(argv[3]) + 1);
          strcpy(parsedFile, argv[3]);
          altOutput = 1;
        }
        if (argc > 2) {
          klineFile = (char *)malloc(strlen(argv[2]) + 1);
          strcpy(klineFile, argv[2]);
          altInput = 1;
        }
      }
      if (strchr(argv[1], 'v')) {
        showMatches = 1;
      }
      if (strchr(argv[1], 'd')) {
        dupeCheck = 1;
      }
    } else {
      goto paramReturn;
    }
  }
  if (!altOutput) {
    parsedFile = (char *)malloc(strlen("kline.conf") + 8);
    strcpy(parsedFile, "kline.conf");
    strcat(parsedFile, ".parsed");
  }
  if (!altInput) {
    klineFile = (char *)malloc(strlen("kline.conf"));
    strcpy(klineFile, "kline.conf");
  }
  if (dupeCheck) {
    if (!RemoveDupes(klineFile, "kline.conf.parsed.tmp")) {
      RemoveRedundant("kline.conf.parsed.tmp", parsedFile, showMatches);
      remove("kline.conf.parsed.tmp");
    } else {
      printf("\n");
      goto paramReturn;
    }
  } else {
    if (RemoveRedundant(klineFile, parsedFile, showMatches)) {
      printf("\n");
      goto paramReturn;
    }
  }
  printf("\nklineParse %s has finished mangling %s.\n", "2.12", klineFile);
  printf("The new version has been saved as %s.\n", parsedFile);
  printf("It is a good idea to diff the two files to ensure no insane "
         "changes were made.\n\n");
  free(parsedFile);
  free(klineFile);
  return (EXIT_SUCCESS);
paramReturn:
  if (strchr(argv[0], '/')) {
    strcat(appName, strrchr(argv[0], '/') + 1);
  } else {
    strcpy(appName, argv[0]);
  }
  printf("usage: %s [-dfv] [<input file>] [<output file>]\n", appName);
  printf(" -d remove duplicate consecutive klines\n");
  printf(" -v verbose display during redundant search\n");
  printf(" -f use alterate file names, instead of kline.conf and ");
  printf("kline.conf.parsed\n ");
  if (altOutput) {
    free(parsedFile);
  }
  if (altInput) {
    free(klineFile);
  }
  return (EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movw   $0x0,-0xa8(%rbp)
movw   $0x0,-0xa6(%rbp)
movw   $0x0,-0xa4(%rbp)
movw   $0x0,-0xa2(%rbp)
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   10a0 <memset@plt>
cmpl   $0x1,-0x8(%rbp)
jle    137a <main+0x1aa>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1370 <main+0x1a0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdb3(%rip),%rsi
call   10c0 <strspn@plt>
mov    %rax,-0xb0(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <strlen@plt>
mov    %rax,%rcx
mov    -0xb0(%rbp),%rax
cmp    %rcx,%rax
je     127e <main+0xae>
jmp    14f3 <main+0x323>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x66,%esi
call   1070 <strchr@plt>
cmp    $0x0,%rax
je     1321 <main+0x151>
cmpl   $0x3,-0x8(%rbp)
jle    12db <main+0x10b>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1060 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   10d0 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
call   1050 <strcpy@plt>
movw   $0x1,-0xa6(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    131c <main+0x14c>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   10d0 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1050 <strcpy@plt>
movw   $0x1,-0xa4(%rbp)
jmp    1321 <main+0x151>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x76,%esi
call   1070 <strchr@plt>
cmp    $0x0,%rax
je     1346 <main+0x176>
movw   $0x1,-0xa8(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x64,%esi
call   1070 <strchr@plt>
cmp    $0x0,%rax
je     136b <main+0x19b>
movw   $0x1,-0xa2(%rbp)
jmp    1375 <main+0x1a5>
jmp    14f3 <main+0x323>
jmp    137a <main+0x1aa>
cmpw   $0x0,-0xa6(%rbp)
jne    13c4 <main+0x1f4>
lea    0xc77(%rip),%rdi
call   1060 <strlen@plt>
mov    %rax,%rdi
add    $0x8,%rdi
call   10d0 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xc57(%rip),%rsi
call   1050 <strcpy@plt>
mov    -0x18(%rbp),%rdi
lea    0xc52(%rip),%rsi
call   10f0 <strcat@plt>
cmpw   $0x0,-0xa4(%rbp)
jne    13fa <main+0x22a>
lea    0xc2d(%rip),%rdi
call   1060 <strlen@plt>
mov    %rax,%rdi
call   10d0 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xc11(%rip),%rsi
call   1050 <strcpy@plt>
cmpw   $0x0,-0xa2(%rbp)
je     1461 <main+0x291>
mov    -0x20(%rbp),%rdi
lea    0xc06(%rip),%rsi
call   10b0 <RemoveDupes@plt>
cmp    $0x0,%eax
jne    1449 <main+0x279>
mov    -0x18(%rbp),%rsi
lea    0xbed(%rip),%rdi
movswl -0xa8(%rbp),%edx
call   10e0 <RemoveRedundant@plt>
lea    0xbda(%rip),%rdi
call   1040 <remove@plt>
jmp    145c <main+0x28c>
lea    0xc84(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    14f3 <main+0x323>
jmp    1497 <main+0x2c7>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movswl -0xa8(%rbp),%edx
call   10e0 <RemoveRedundant@plt>
cmp    $0x0,%rax
je     1492 <main+0x2c2>
lea    0xc4e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    14f3 <main+0x323>
jmp    1497 <main+0x2c7>
mov    -0x20(%rbp),%rdx
lea    0xb8d(%rip),%rdi
lea    0xbb0(%rip),%rsi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xba3(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xbbc(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    0x2aef(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    15df <main+0x40f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x2f,%esi
call   1070 <strchr@plt>
cmp    $0x0,%rax
je     1545 <main+0x375>
lea    -0xa0(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x2f,%esi
call   1090 <strrchr@plt>
mov    -0xb8(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
call   10f0 <strcat@plt>
jmp    1558 <main+0x388>
lea    -0xa0(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1050 <strcpy@plt>
lea    -0xa0(%rbp),%rsi
lea    0xb70(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xb93(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xbae(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xbcd(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xbf7(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
cmpw   $0x0,-0xa6(%rbp)
je     15bc <main+0x3ec>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
cmpw   $0x0,-0xa4(%rbp)
je     15d3 <main+0x403>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    0x2a06(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %rsi,%r12
mov    %edi,%ebp
lea    0x10(%rsp),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0x80,%edx
call   10c0 <memset@plt>
cmp    $0x2,%ebp
jl     129a <main+0xaa>
mov    0x8(%r12),%rbx
cmpb   $0x2d,(%rbx)
jne    12f3 <main+0x103>
lea    0xdcd(%rip),%rsi
mov    %rbx,%rdi
call   10e0 <strspn@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1080 <strlen@plt>
cmp    %rax,%r14
jne    12f3 <main+0x103>
mov    %rbx,%rdi
mov    $0x66,%esi
call   1090 <strchr@plt>
test   %rax,%rax
je     145f <main+0x26f>
cmp    $0x4,%ebp
jb     1465 <main+0x275>
mov    0x18(%r12),%rdi
call   1080 <strlen@plt>
lea    0x1(%rax),%rdi
call   10f0 <malloc@plt>
mov    %rax,%r15
mov    0x18(%r12),%rsi
mov    %rax,%rdi
call   1060 <strcpy@plt>
mov    $0x1,%bp
jmp    1474 <main+0x284>
mov    $0x1,%r14b
xor    %ebp,%ebp
mov    $0x12,%edi
call   10f0 <malloc@plt>
mov    %rax,%r15
lea    0xd53(%rip),%rsi
mov    %rax,%rdi
call   1060 <strcpy@plt>
lea    0xd4f(%rip),%rsi
mov    %r15,%rdi
call   1110 <strcat@plt>
xor    %r13d,%r13d
test   %bp,%bp
je     12fa <main+0x10a>
test   %r14b,%r14b
je     131c <main+0x12c>
movzwl %bx,%edx
mov    (%rsp),%r14
mov    %r14,%rdi
mov    %r15,%rsi
call   1100 <RemoveRedundant@plt>
test   %rax,%rax
jne    1337 <main+0x147>
jmp    13ff <main+0x20f>
xor    %ebp,%ebp
xor    %r13d,%r13d
jmp    1341 <main+0x151>
mov    $0xa,%edi
call   10f0 <malloc@plt>
lea    0xcfb(%rip),%rsi
mov    %rax,(%rsp)
mov    %rax,%rdi
call   1060 <strcpy@plt>
test   %r14b,%r14b
jne    12d7 <main+0xe7>
lea    0xcf6(%rip),%rsi
mov    (%rsp),%r14
mov    %r14,%rdi
call   10d0 <RemoveDupes@plt>
test   %eax,%eax
je     13e2 <main+0x1f2>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    (%r12),%rdi
mov    $0x2f,%esi
call   1090 <strchr@plt>
mov    (%r12),%rsi
test   %rax,%rax
je     1375 <main+0x185>
mov    %rsi,%rdi
mov    $0x2f,%esi
call   10b0 <strrchr@plt>
lea    0x1(%rax),%rsi
lea    0x10(%rsp),%rdi
call   1110 <strcat@plt>
jmp    137f <main+0x18f>
lea    0x10(%rsp),%rdi
call   1060 <strcpy@plt>
lea    0xcff(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xdb9(%rip),%rdi
call   1070 <puts@plt>
lea    0xdd5(%rip),%rdi
call   1070 <puts@plt>
lea    0xd05(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xd2f(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
test   %r13w,%r13w
je     13d4 <main+0x1e4>
mov    %r15,%rdi
call   1030 <free@plt>
mov    0x2c05(%rip),%rbx
test   %bp,%bp
jne    1443 <main+0x253>
jmp    144b <main+0x25b>
movzwl %bx,%edx
lea    0xc2d(%rip),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1100 <RemoveRedundant@plt>
mov    %rbx,%rdi
call   1050 <remove@plt>
lea    0xc29(%rip),%rdi
lea    0xc4c(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xc40(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xcd3(%rip),%rdi
call   1070 <puts@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    0x2b95(%rip),%rbx
mov    %r14,%rdi
call   1030 <free@plt>
mov    (%rbx),%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ebp,%ebp
xor    %ebx,%ebx
jmp    149e <main+0x2ae>
mov    $0x0,%ebx
cmp    $0x3,%ebp
mov    $0x0,%ebp
jne    149e <main+0x2ae>
mov    %ebp,%ebx
mov    0x10(%r12),%rdi
call   1080 <strlen@plt>
lea    0x1(%rax),%rdi
call   10f0 <malloc@plt>
mov    0x10(%r12),%rsi
mov    %rax,(%rsp)
mov    %rax,%rdi
call   1060 <strcpy@plt>
mov    $0x1,%bp
mov    %ebx,0xc(%rsp)
mov    0x8(%r12),%rdi
mov    $0x76,%esi
call   1090 <strchr@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    0x8(%r12),%rdi
mov    $0x64,%esi
call   1090 <strchr@plt>
test   %rax,%rax
sete   %r14b
mov    $0x1,%r13w
cmpw   $0x0,0xc(%rsp)
jne    12cd <main+0xdd>
jmp    129f <main+0xaf>

LLVM IR (-O0):
@.str = [6 x i8] c"-dvf\00\00"
@.str.1 = [11 x i8] c"kline.conf\00"
@.str.2 = [8 x i8] c".parsed\00"
@.str.3 = [22 x i8] c"kline.conf.parsed.tmp\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [42 x i8] c"\0AklineParse %s has finished mangling %s.\0A\00"
@.str.6 = [5 x i8] c"2.12\00"
@.str.7 = [39 x i8] c"The new version has been saved as %s.\0A\00"
@.str.8 = [81 x i8] c"It is a good idea to diff the two files to ensure no insane changes were made.\0A\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.9 = [49 x i8] c"usage: %s [-dfv] [<input file>] [<output file>]\0A\00"
@.str.10 = [41 x i8] c" -d remove duplicate consecutive klines\0A\00"
@.str.11 = [45 x i8] c" -v verbose display during redundant search\0A\00"
@.str.12 = [56 x i8] c" -f use alterate file names, instead of kline.conf and \00"
@.str.13 = [20 x i8] c"kline.conf.parsed\0A \00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [128 x i8]
%9 = alloca i16
%10 = alloca i16
%11 = alloca i16
%12 = alloca i16
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i16 0, i16* %12
store i16 0, i16* %11
store i16 0, i16* %10
store i16 0, i16* %9
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%14 = call i32 @memset(i8* %13, i8 signext 0, i32 128)
%15 = load i32, i32* %4
%16 = icmp sgt i32 %15, 1
br i1 %16, label %17, label %92
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 45
br i1 %24, label %25, label %90
25: ; preds = %17
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i64 @strspn(i8* %28, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i64 @strlen(i8* %32)
%34 = icmp ne i64 %29, %33
br i1 %34, label %35, label %36
35: ; preds = %25
br label %148
36: ; preds = %25
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = call i64 @strchr(i8* %39, i8 signext 102)
%41 = icmp ne i64 %40, 0
br i1 %41, label %42, label %75
42: ; preds = %36
%43 = load i32, i32* %4
%44 = icmp sgt i32 %43, 3
br i1 %44, label %45, label %58
45: ; preds = %42
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 3
%48 = load i8*, i8** %47
%49 = call i64 @strlen(i8* %48)
%50 = add nsw i64 %49, 1
%51 = call i64 @malloc(i64 %50)
%52 = inttoptr i64 %51 to i8*
store i8* %52, i8** %6
%53 = load i8*, i8** %6
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 3
%56 = load i8*, i8** %55
%57 = call i32 @strcpy(i8* %53, i8* %56)
store i16 1, i16* %11
br label %58
58: ; preds = %45, %42
%59 = load i32, i32* %4
%60 = icmp sgt i32 %59, 2
br i1 %60, label %61, label %74
61: ; preds = %58
%62 = load i8**, i8*** %5
%63 = getelementptr inbounds i8*, i8** %62, i64 2
%64 = load i8*, i8** %63
%65 = call i64 @strlen(i8* %64)
%66 = add nsw i64 %65, 1
%67 = call i64 @malloc(i64 %66)
%68 = inttoptr i64 %67 to i8*
store i8* %68, i8** %7
%69 = load i8*, i8** %7
%70 = load i8**, i8*** %5
%71 = getelementptr inbounds i8*, i8** %70, i64 2
%72 = load i8*, i8** %71
%73 = call i32 @strcpy(i8* %69, i8* %72)
store i16 1, i16* %10
br label %74
74: ; preds = %61, %58
br label %75
75: ; preds = %74, %36
%76 = load i8**, i8*** %5
%77 = getelementptr inbounds i8*, i8** %76, i64 1
%78 = load i8*, i8** %77
%79 = call i64 @strchr(i8* %78, i8 signext 118)
%80 = icmp ne i64 %79, 0
br i1 %80, label %81, label %82
81: ; preds = %75
store i16 1, i16* %12
br label %82
82: ; preds = %81, %75
%83 = load i8**, i8*** %5
%84 = getelementptr inbounds i8*, i8** %83, i64 1
%85 = load i8*, i8** %84
%86 = call i64 @strchr(i8* %85, i8 signext 100)
%87 = icmp ne i64 %86, 0
br i1 %87, label %88, label %89
88: ; preds = %82
store i16 1, i16* %9
br label %89
89: ; preds = %88, %82
br label %91
90: ; preds = %17
br label %148
91: ; preds = %89
br label %92
92: ; preds = %91, %2
%93 = load i16, i16* %11
%94 = icmp ne i16 %93, 0
br i1 %94, label %104, label %95
95: ; preds = %92
%96 = call i64 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%97 = add nsw i64 %96, 8
%98 = call i64 @malloc(i64 %97)
%99 = inttoptr i64 %98 to i8*
store i8* %99, i8** %6
%100 = load i8*, i8** %6
%101 = call i32 @strcpy(i8* %100, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%102 = load i8*, i8** %6
%103 = call i32 @strcat(i8* %102, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %104
104: ; preds = %95, %92
%105 = load i16, i16* %10
%106 = icmp ne i16 %105, 0
br i1 %106, label %113, label %107
107: ; preds = %104
%108 = call i64 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%109 = call i64 @malloc(i64 %108)
%110 = inttoptr i64 %109 to i8*
store i8* %110, i8** %7
%111 = load i8*, i8** %7
%112 = call i32 @strcpy(i8* %111, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %113
113: ; preds = %107, %104
%114 = load i16, i16* %9
%115 = icmp ne i16 %114, 0
br i1 %115, label %116, label %128
116: ; preds = %113
%117 = load i8*, i8** %7
%118 = call i32 @RemoveDupes(i8* %117, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%119 = icmp ne i32 %118, 0
br i1 %119, label %125, label %120
120: ; preds = %116
%121 = load i8*, i8** %6
%122 = load i16, i16* %12
%123 = call i64 @RemoveRedundant(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i8* %121, i16 signext %122)
%124 = call i32 @remove(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
br label %127
125: ; preds = %116
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %148
127: ; preds = %120
br label %137
128: ; preds = %113
%129 = load i8*, i8** %7
%130 = load i8*, i8** %6
%131 = load i16, i16* %12
%132 = call i64 @RemoveRedundant(i8* %129, i8* %130, i16 signext %131)
%133 = icmp ne i64 %132, 0
br i1 %133, label %134, label %136
134: ; preds = %128
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %148
136: ; preds = %128
br label %137
137: ; preds = %136, %127
%138 = load i8*, i8** %7
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* %138)
%140 = load i8*, i8** %6
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0), i8* %140)
%142 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.8, i64 0, i64 0))
%143 = load i8*, i8** %6
%144 = call i32 @free(i8* %143)
%145 = load i8*, i8** %7
%146 = call i32 @free(i8* %145)
%147 = load i32, i32* @EXIT_SUCCESS
store i32 %147, i32* %3
br label %188
148: ; preds = %134, %125, %90, %35
%149 = load i8**, i8*** %5
%150 = getelementptr inbounds i8*, i8** %149, i64 0
%151 = load i8*, i8** %150
%152 = call i64 @strchr(i8* %151, i8 signext 47)
%153 = icmp ne i64 %152, 0
br i1 %153, label %154, label %162
154: ; preds = %148
%155 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%156 = load i8**, i8*** %5
%157 = getelementptr inbounds i8*, i8** %156, i64 0
%158 = load i8*, i8** %157
%159 = call i8* @strrchr(i8* %158, i8 signext 47)
%160 = getelementptr inbounds i8, i8* %159, i64 1
%161 = call i32 @strcat(i8* %155, i8* %160)
br label %168
162: ; preds = %148
%163 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%164 = load i8**, i8*** %5
%165 = getelementptr inbounds i8*, i8** %164, i64 0
%166 = load i8*, i8** %165
%167 = call i32 @strcpy(i8* %163, i8* %166)
br label %168
168: ; preds = %162, %154
%169 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%170 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0), i8* %169)
%171 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.10, i64 0, i64 0))
%172 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.11, i64 0, i64 0))
%173 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.12, i64 0, i64 0))
%174 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.13, i64 0, i64 0))
%175 = load i16, i16* %11
%176 = icmp ne i16 %175, 0
br i1 %176, label %177, label %180
177: ; preds = %168
%178 = load i8*, i8** %6
%179 = call i32 @free(i8* %178)
br label %180
180: ; preds = %177, %168
%181 = load i16, i16* %10
%182 = icmp ne i16 %181, 0
br i1 %182, label %183, label %186
183: ; preds = %180
%184 = load i8*, i8** %7
%185 = call i32 @free(i8* %184)
br label %186
186: ; preds = %183, %180
%187 = load i32, i32* @EXIT_FAILURE
store i32 %187, i32* %3
br label %188
188: ; preds = %186, %137
%189 = load i32, i32* %3
ret i32 %189
}

LLVM IR (-O2):
@.str = [6 x i8] c"-dvf\00\00"
@.str.1 = [11 x i8] c"kline.conf\00"
@.str.2 = [8 x i8] c".parsed\00"
@.str.3 = [22 x i8] c"kline.conf.parsed.tmp\00"
@.str.5 = [42 x i8] c"\0AklineParse %s has finished mangling %s.\0A\00"
@.str.6 = [5 x i8] c"2.12\00"
@.str.7 = [39 x i8] c"The new version has been saved as %s.\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.9 = [49 x i8] c"usage: %s [-dfv] [<input file>] [<output file>]\0A\00"
@.str.12 = [56 x i8] c" -f use alterate file names, instead of kline.conf and \00"
@.str.13 = [20 x i8] c"kline.conf.parsed\0A \00"
@EXIT_FAILURE = global i32 0
@str = [80 x i8] c"It is a good idea to diff the two files to ensure no insane changes were made.\0A\00"
@str.14 = [40 x i8] c" -d remove duplicate consecutive klines\00"
@str.15 = [44 x i8] c" -v verbose display during redundant search\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i8 signext 0, i32 128)
%6 = icmp sgt i32 %0, 1
br i1 %6, label %7, label %56
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 45
br i1 %11, label %12, label %95
12: ; preds = %7
%13 = call i64 @strspn(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%14 = call i64 @strlen(i8* %9)
%15 = icmp eq i64 %13, %14
br i1 %15, label %16, label %95
16: ; preds = %12
%17 = call i64 @strchr(i8* %9, i8 signext 102)
%18 = icmp eq i64 %17, 0
br i1 %18, label %43, label %19
19: ; preds = %16
%20 = icmp ugt i32 %0, 3
br i1 %20, label %21, label %30
21: ; preds = %19
%22 = getelementptr inbounds i8*, i8** %1, i64 3
%23 = load i8*, i8** %22
%24 = call i64 @strlen(i8* dereferenceable(1) %23)
%25 = add nsw i64 %24, 1
%26 = call i64 @malloc(i64 %25)
%27 = inttoptr i64 %26 to i8*
%28 = load i8*, i8** %22
%29 = call i32 @strcpy(i8* %27, i8* %28)
br label %32
30: ; preds = %19
%31 = icmp eq i32 %0, 3
br i1 %31, label %32, label %43
32: ; preds = %21, %30
%33 = phi i16 [ 1, %21 ], [ 0, %30 ]
%34 = phi i8* [ %27, %21 ], [ undef, %30 ]
%35 = getelementptr inbounds i8*, i8** %1, i64 2
%36 = load i8*, i8** %35
%37 = call i64 @strlen(i8* dereferenceable(1) %36)
%38 = add nsw i64 %37, 1
%39 = call i64 @malloc(i64 %38)
%40 = inttoptr i64 %39 to i8*
%41 = load i8*, i8** %35
%42 = call i32 @strcpy(i8* %40, i8* %41)
br label %43
43: ; preds = %16, %32, %30
%44 = phi i8* [ %34, %32 ], [ undef, %30 ], [ undef, %16 ]
%45 = phi i8* [ %40, %32 ], [ undef, %30 ], [ undef, %16 ]
%46 = phi i16 [ 1, %32 ], [ 0, %30 ], [ 0, %16 ]
%47 = phi i16 [ %33, %32 ], [ 0, %30 ], [ 0, %16 ]
%48 = load i8*, i8** %8
%49 = call i64 @strchr(i8* %48, i8 signext 118)
%50 = icmp ne i64 %49, 0
%51 = zext i1 %50 to i16
%52 = load i8*, i8** %8
%53 = call i64 @strchr(i8* %52, i8 signext 100)
%54 = icmp eq i64 %53, 0
%55 = icmp eq i16 %47, 0
br i1 %55, label %56, label %65
56: ; preds = %2, %43
%57 = phi i16 [ %51, %43 ], [ 0, %2 ]
%58 = phi i16 [ %46, %43 ], [ 0, %2 ]
%59 = phi i1 [ %54, %43 ], [ true, %2 ]
%60 = phi i8* [ %45, %43 ], [ undef, %2 ]
%61 = call i64 @malloc(i64 18)
%62 = inttoptr i64 %61 to i8*
%63 = call i32 @strcpy(i8* %62, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%64 = call i32 @strcat(i8* %62, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %65
65: ; preds = %56, %43
%66 = phi i16 [ %51, %43 ], [ %57, %56 ]
%67 = phi i16 [ 1, %43 ], [ 0, %56 ]
%68 = phi i16 [ %46, %43 ], [ %58, %56 ]
%69 = phi i1 [ %54, %43 ], [ %59, %56 ]
%70 = phi i8* [ %45, %43 ], [ %60, %56 ]
%71 = phi i8* [ %44, %43 ], [ %62, %56 ]
%72 = icmp eq i16 %68, 0
br i1 %72, label %73, label %77
73: ; preds = %65
%74 = call i64 @malloc(i64 10)
%75 = inttoptr i64 %74 to i8*
%76 = call i32 @strcpy(i8* %75, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %77
77: ; preds = %73, %65
%78 = phi i8* [ %70, %65 ], [ %75, %73 ]
br i1 %69, label %85, label %79
79: ; preds = %77
%80 = call i32 @RemoveDupes(i8* %78, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%81 = icmp eq i32 %80, 0
br i1 %81, label %82, label %93
82: ; preds = %79
%83 = call i64 @RemoveRedundant(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i8* %71, i16 signext %66)
%84 = call i32 @remove(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
br label %88
85: ; preds = %77
%86 = call i64 @RemoveRedundant(i8* %78, i8* %71, i16 signext %66)
%87 = icmp eq i64 %86, 0
br i1 %87, label %88, label %93
88: ; preds = %85, %82
%89 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* %78)
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0), i8* %71)
%91 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str, i64 0, i64 0))
%92 = call i32 @free(i8* %71)
br label %121
93: ; preds = %85, %79
%94 = call i32 @putchar(i32 10)
br label %95
95: ; preds = %93, %7, %12
%96 = phi i8* [ undef, %12 ], [ undef, %7 ], [ %71, %93 ]
%97 = phi i8* [ undef, %12 ], [ undef, %7 ], [ %78, %93 ]
%98 = phi i16 [ 0, %12 ], [ 0, %7 ], [ %68, %93 ]
%99 = phi i16 [ 0, %12 ], [ 0, %7 ], [ %67, %93 ]
%100 = load i8*, i8** %1
%101 = call i64 @strchr(i8* %100, i8 signext 47)
%102 = icmp eq i64 %101, 0
%103 = load i8*, i8** %1
br i1 %102, label %108, label %104
104: ; preds = %95
%105 = call i8* @strrchr(i8* dereferenceable(1) %103, i8 signext 47)
%106 = getelementptr inbounds i8, i8* %105, i64 1
%107 = call i32 @strcat(i8* %4, i8* %106)
br label %110
108: ; preds = %95
%109 = call i32 @strcpy(i8* %4, i8* %103)
br label %110
110: ; preds = %108, %104
%111 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0), i8* %4)
%112 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.14, i64 0, i64 0))
%113 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.15, i64 0, i64 0))
%114 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.12, i64 0, i64 0))
%115 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.13, i64 0, i64 0))
%116 = icmp eq i16 %99, 0
br i1 %116, label %119, label %117
117: ; preds = %110
%118 = call i32 @free(i8* %96)
br label %119
119: ; preds = %117, %110
%120 = icmp eq i16 %98, 0
br i1 %120, label %125, label %121
121: ; preds = %119, %88
%122 = phi i8* [ %78, %88 ], [ %97, %119 ]
%123 = phi i32* [ @EXIT_SUCCESS, %88 ], [ @EXIT_FAILURE, %119 ]
%124 = call i32 @free(i8* %122)
br label %125
125: ; preds = %121, %119
%126 = phi i32* [ @EXIT_FAILURE, %119 ], [ %123, %121 ]
%127 = load i32, i32* %126
ret i32 %127
}