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

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ free(char *);
int getline(char **, size_t *, int /*<<< orphan*/ *);
int /*<<< orphan*/ helptext(char *);
int /*<<< orphan*/ puts(char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strip(char *);
int main(int argc, char **argv) {
  int dos2unix = 0;
  int unix2dos = 0;
  char *infile;
  char *outfile;
  FILE *ifptr;
  FILE *ofptr;
  char *line = NULL;
  size_t len = 0;
  ssize_t read;
  char *pos;
  unsigned char cr = 0x0d;
  unsigned char lf = 0x0a;
  if (argc < 5) {
    helptext(argv[0]);
    exit(EXIT_FAILURE);
  }
  int i = 1;
  while (i < argc) {
    if (strcmp(argv[i], "--dos2unix") == 0) {
      dos2unix = 1;
    }
    if (strcmp(argv[i], "--unix2dos") == 0) {
      unix2dos = 1;
    }
    if (strcmp(argv[i], "-i") == 0) {
      i++;
      infile = argv[i];
    }
    if (strcmp(argv[i], "-o") == 0) {
      i++;
      outfile = argv[i];
    }
    i++;
  }
  if ((dos2unix + unix2dos) != 1) {
    puts("Select either dos2unix or unix2dos");
    helptext(argv[0]);
    exit(EXIT_FAILURE);
  }
  if (strcmp(infile, outfile) == 0) {
    puts("Input and output file may not be the same");
    helptext(argv[0]);
    exit(EXIT_FAILURE);
  }
  while ((ifptr = fopen(infile, "r")) == NULL) {
    puts("Input file can not be opened");
    helptext(argv[0]);
    exit(EXIT_FAILURE);
  }
  while ((ofptr = fopen(outfile, "w")) == NULL) {
    puts("Output file can not be opened");
    helptext(argv[0]);
    exit(EXIT_FAILURE);
  }
  while ((read = getline(&line, &len, ifptr)) != -1) {
    strip(line);
    fprintf(ofptr, "%s", line);
    if (dos2unix == 1) {
      fprintf(ofptr, "%c", lf);
    } else {
      fprintf(ofptr, "%c%c", cr, lf);
    }
  }
  fclose(ifptr);
  fclose(ofptr);
  if (line)
    free(line);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
movb   $0xd,-0x59(%rbp)
movb   $0xa,-0x5a(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1200 <main+0x60>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1090 <helptext@plt>
mov    0x2de7(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
movl   $0x1,-0x60(%rbp)
mov    -0x60(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12e9 <main+0x149>
mov    -0x10(%rbp),%rax
movslq -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdda(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    123c <main+0x9c>
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdbc(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1265 <main+0xc5>
movl   $0x1,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd9e(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    12a0 <main+0x100>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd66(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    12db <main+0x13b>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    1207 <main+0x67>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
cmp    $0x1,%eax
je     131e <main+0x17e>
lea    0xd1d(%rip),%rdi
call   1040 <puts@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1090 <helptext@plt>
mov    0x2cc9(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    135b <main+0x1bb>
lea    0xd03(%rip),%rdi
call   1040 <puts@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1090 <helptext@plt>
mov    0x2c8c(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
jmp    1360 <main+0x1c0>
mov    -0x20(%rbp),%rdi
lea    0xcfe(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    13a4 <main+0x204>
lea    0xce6(%rip),%rdi
call   1040 <puts@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1090 <helptext@plt>
mov    0x2c43(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
jmp    13a9 <main+0x209>
mov    -0x28(%rbp),%rdi
lea    0xcd4(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    13ed <main+0x24d>
lea    0xcbc(%rip),%rdi
call   1040 <puts@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1090 <helptext@plt>
mov    0x2bfa(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
jmp    13f2 <main+0x252>
mov    -0x30(%rbp),%rdx
lea    -0x40(%rbp),%rdi
lea    -0x48(%rbp),%rsi
call   10b0 <getline@plt>
mov    %eax,-0x4c(%rbp)
cmp    $0xffffffff,%eax
je     1472 <main+0x2d2>
mov    -0x40(%rbp),%rdi
call   1060 <strip@plt>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rdx
lea    0xc81(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
cmpl   $0x1,-0x14(%rbp)
jne    1453 <main+0x2b3>
mov    -0x38(%rbp),%rdi
movzbl -0x5a(%rbp),%edx
lea    0xc66(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    146d <main+0x2cd>
mov    -0x38(%rbp),%rdi
movzbl -0x59(%rbp),%edx
movzbl -0x5a(%rbp),%ecx
lea    0xc45(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    13f2 <main+0x252>
mov    -0x30(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x38(%rbp),%rdi
call   1050 <fclose@plt>
cmpq   $0x0,-0x40(%rbp)
je     1498 <main+0x2f8>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    0x2b39(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
cmp    $0x5,%edi
jl     12f6 <main+0x136>
mov    %edi,%r13d
movl   $0x0,0x4(%rsp)
mov    $0x1,%r15d
xor    %r14d,%r14d
mov    $0x1,%r12d
jmp    121d <main+0x5d>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15d
cmp    %r13d,%r15d
jge    12b9 <main+0xf9>
movslq %r15d,%rbp
mov    (%rbx,%rbp,8),%rdi
lea    0xdd5(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
mov    0x4(%rsp),%eax
cmove  %r12d,%eax
mov    %eax,0x4(%rsp)
mov    (%rbx,%rbp,8),%rdi
lea    0xdc1(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
cmove  %r12d,%r14d
mov    (%rbx,%rbp,8),%rdi
lea    0xdb5(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1280 <main+0xc0>
mov    (%rbx,%rbp,8),%rdi
jmp    128e <main+0xce>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x1(%rbp),%r15d
mov    0x8(%rbx,%rbp,8),%rdi
mov    %rdi,0x18(%rsp)
lea    0xd84(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    1210 <main+0x50>
movslq %r15d,%rax
add    $0x1,%r15d
mov    0x8(%rbx,%rax,8),%rax
mov    %rax,0x20(%rsp)
jmp    1210 <main+0x50>
mov    0x4(%rsp),%r12d
add    %r12d,%r14d
cmp    $0x1,%r14d
jne    12ea <main+0x12a>
mov    0x18(%rsp),%rbp
mov    %rbp,%rdi
mov    0x20(%rsp),%r15
mov    %r15,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    130c <main+0x14c>
lea    0xd57(%rip),%rdi
jmp    12f1 <main+0x131>
lea    0xd2b(%rip),%rdi
call   1040 <puts@plt>
mov    (%rbx),%rdi
call   10b0 <helptext@plt>
mov    0x2cdb(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
lea    0xd56(%rip),%rsi
mov    %rbp,%rdi
call   10c0 <fopen@plt>
test   %rax,%rax
jne    1329 <main+0x169>
lea    0xd44(%rip),%rdi
jmp    12f1 <main+0x131>
mov    %rax,%r14
lea    0xd55(%rip),%rsi
mov    %r15,%rdi
call   10c0 <fopen@plt>
test   %rax,%rax
jne    1349 <main+0x189>
lea    0xd43(%rip),%rdi
jmp    12f1 <main+0x131>
mov    %rax,%rbp
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    %r14,%rdx
call   10d0 <getline@plt>
cmp    $0xffffffff,%eax
jne    1390 <main+0x1d0>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %rbp,%rdi
call   1050 <fclose@plt>
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     1382 <main+0x1c2>
call   1030 <free@plt>
mov    0x2c4f(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
lea    0x8(%rsp),%r15
lea    0x10(%rsp),%rbx
lea    0xd07(%rip),%r13
jmp    13da <main+0x21a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0xd,%edx
mov    $0xa,%ecx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   10d0 <getline@plt>
cmp    $0xffffffff,%eax
je     1363 <main+0x1a3>
mov    0x8(%rsp),%rdi
call   1070 <strip@plt>
mov    0x8(%rsp),%rdi
mov    %rbp,%rsi
call   1060 <fputs@plt>
cmp    $0x1,%r12d
jne    13b0 <main+0x1f0>
mov    $0xa,%edi
mov    %rbp,%rsi
call   1080 <fputc@plt>
jmp    13c7 <main+0x207>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [11 x i8] c"--dos2unix\00"
@.str.1 = [11 x i8] c"--unix2dos\00"
@.str.2 = [3 x i8] c"-i\00"
@.str.3 = [3 x i8] c"-o\00"
@.str.4 = [35 x i8] c"Select either dos2unix or unix2dos\00"
@.str.5 = [42 x i8] c"Input and output file may not be the same\00"
@.str.6 = [2 x i8] c"r\00"
@.str.7 = [29 x i8] c"Input file can not be opened\00"
@.str.8 = [2 x i8] c"w\00"
@.str.9 = [30 x i8] c"Output file can not be opened\00"
@.str.10 = [3 x i8] c"%s\00"
@.str.11 = [3 x i8] c"%c\00"
@.str.12 = [5 x i8] c"%c%c\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i8
%17 = alloca i8
%18 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i8* null, i8** %12
store i64 0, i64* %13
store i8 13, i8* %16
store i8 10, i8* %17
%19 = load i32, i32* %4
%20 = icmp slt i32 %19, 5
br i1 %20, label %21, label %28
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 @helptext(i8* %24)
%26 = load i32, i32* @EXIT_FAILURE
%27 = call i32 @exit(i32 %26)
unreachable
28: ; preds = %2
store i32 1, i32* %18
br label %29
29: ; preds = %83, %28
%30 = load i32, i32* %18
%31 = load i32, i32* %4
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %86
33: ; preds = %29
%34 = load i8**, i8*** %5
%35 = load i32, i32* %18
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8*, i8** %34, i64 %36
%38 = load i8*, i8** %37
%39 = call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %42
41: ; preds = %33
store i32 1, i32* %6
br label %42
42: ; preds = %41, %33
%43 = load i8**, i8*** %5
%44 = load i32, i32* %18
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8*, i8** %43, i64 %45
%47 = load i8*, i8** %46
%48 = call i64 @strcmp(i8* %47, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %51
50: ; preds = %42
store i32 1, i32* %7
br label %51
51: ; preds = %50, %42
%52 = load i8**, i8*** %5
%53 = load i32, i32* %18
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8*, i8** %52, i64 %54
%56 = load i8*, i8** %55
%57 = call i64 @strcmp(i8* %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %67
59: ; preds = %51
%60 = load i32, i32* %18
%61 = add nsw i32 %60, 1
store i32 %61, i32* %18
%62 = load i8**, i8*** %5
%63 = load i32, i32* %18
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8*, i8** %62, i64 %64
%66 = load i8*, i8** %65
store i8* %66, i8** %8
br label %67
67: ; preds = %59, %51
%68 = load i8**, i8*** %5
%69 = load i32, i32* %18
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8*, i8** %68, i64 %70
%72 = load i8*, i8** %71
%73 = call i64 @strcmp(i8* %72, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%74 = icmp eq i64 %73, 0
br i1 %74, label %75, label %83
75: ; preds = %67
%76 = load i32, i32* %18
%77 = add nsw i32 %76, 1
store i32 %77, i32* %18
%78 = load i8**, i8*** %5
%79 = load i32, i32* %18
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds i8*, i8** %78, i64 %80
%82 = load i8*, i8** %81
store i8* %82, i8** %9
br label %83
83: ; preds = %75, %67
%84 = load i32, i32* %18
%85 = add nsw i32 %84, 1
store i32 %85, i32* %18
br label %29
86: ; preds = %29
%87 = load i32, i32* %6
%88 = load i32, i32* %7
%89 = add nsw i32 %87, %88
%90 = icmp ne i32 %89, 1
br i1 %90, label %91, label %99
91: ; preds = %86
%92 = call i32 @puts(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%93 = load i8**, i8*** %5
%94 = getelementptr inbounds i8*, i8** %93, i64 0
%95 = load i8*, i8** %94
%96 = call i32 @helptext(i8* %95)
%97 = load i32, i32* @EXIT_FAILURE
%98 = call i32 @exit(i32 %97)
unreachable
99: ; preds = %86
%100 = load i8*, i8** %8
%101 = load i8*, i8** %9
%102 = call i64 @strcmp(i8* %100, i8* %101)
%103 = icmp eq i64 %102, 0
br i1 %103, label %104, label %112
104: ; preds = %99
%105 = call i32 @puts(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0))
%106 = load i8**, i8*** %5
%107 = getelementptr inbounds i8*, i8** %106, i64 0
%108 = load i8*, i8** %107
%109 = call i32 @helptext(i8* %108)
%110 = load i32, i32* @EXIT_FAILURE
%111 = call i32 @exit(i32 %110)
unreachable
112: ; preds = %99
br label %113
113: ; preds = %112
%114 = load i8*, i8** %8
%115 = call i32* @fopen(i8* %114, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32* %115, i32** %10
%116 = icmp eq i32* %115, null
br i1 %116, label %117, label %125
117: ; preds = %113
%118 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0))
%119 = load i8**, i8*** %5
%120 = getelementptr inbounds i8*, i8** %119, i64 0
%121 = load i8*, i8** %120
%122 = call i32 @helptext(i8* %121)
%123 = load i32, i32* @EXIT_FAILURE
%124 = call i32 @exit(i32 %123)
unreachable
125: ; preds = %113
br label %126
126: ; preds = %125
%127 = load i8*, i8** %9
%128 = call i32* @fopen(i8* %127, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
store i32* %128, i32** %11
%129 = icmp eq i32* %128, null
br i1 %129, label %130, label %138
130: ; preds = %126
%131 = call i32 @puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0))
%132 = load i8**, i8*** %5
%133 = getelementptr inbounds i8*, i8** %132, i64 0
%134 = load i8*, i8** %133
%135 = call i32 @helptext(i8* %134)
%136 = load i32, i32* @EXIT_FAILURE
%137 = call i32 @exit(i32 %136)
unreachable
138: ; preds = %126
br label %139
139: ; preds = %163, %138
%140 = load i32*, i32** %10
%141 = call i32 @getline(i8** %12, i64* %13, i32* %140)
store i32 %141, i32* %14
%142 = icmp ne i32 %141, -1
br i1 %142, label %143, label %164
143: ; preds = %139
%144 = load i8*, i8** %12
%145 = call i32 @strip(i8* %144)
%146 = load i32*, i32** %11
%147 = load i8*, i8** %12
%148 = call i32 (i32*, i8*, ...) @fprintf(i32* %146, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %147)
%149 = load i32, i32* %6
%150 = icmp eq i32 %149, 1
br i1 %150, label %151, label %156
151: ; preds = %143
%152 = load i32*, i32** %11
%153 = load i8, i8* %17
%154 = zext i8 %153 to i32
%155 = call i32 (i32*, i8*, ...) @fprintf(i32* %152, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %154)
br label %163
156: ; preds = %143
%157 = load i32*, i32** %11
%158 = load i8, i8* %16
%159 = zext i8 %158 to i32
%160 = load i8, i8* %17
%161 = zext i8 %160 to i32
%162 = call i32 (i32*, i8*, ...) @fprintf(i32* %157, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i32 %159, i32 %161)
br label %163
163: ; preds = %156, %151
br label %139
164: ; preds = %139
%165 = load i32*, i32** %10
%166 = call i32 @fclose(i32* %165)
%167 = load i32*, i32** %11
%168 = call i32 @fclose(i32* %167)
%169 = load i8*, i8** %12
%170 = icmp ne i8* %169, null
br i1 %170, label %171, label %174
171: ; preds = %164
%172 = load i8*, i8** %12
%173 = call i32 @free(i8* %172)
br label %174
174: ; preds = %171, %164
%175 = load i32, i32* @EXIT_SUCCESS
%176 = call i32 @exit(i32 %175)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [11 x i8] c"--dos2unix\00"
@.str.1 = [11 x i8] c"--unix2dos\00"
@.str.2 = [3 x i8] c"-i\00"
@.str.3 = [3 x i8] c"-o\00"
@.str.4 = [35 x i8] c"Select either dos2unix or unix2dos\00"
@.str.5 = [42 x i8] c"Input and output file may not be the same\00"
@.str.6 = [2 x i8] c"r\00"
@.str.7 = [29 x i8] c"Input file can not be opened\00"
@.str.8 = [2 x i8] c"w\00"
@.str.9 = [30 x i8] c"Output file can not be opened\00"
@.str.12 = [5 x i8] c"%c%c\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%6 = bitcast i64* %4 to i8*
store i64 0, i64* %4
%7 = icmp slt i32 %0, 5
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8*, i8** %1
%10 = tail call i32 @helptext(i8* %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = tail call i32 @exit(i32 %11)
unreachable
13: ; preds = %2, %50
%14 = phi i32 [ %53, %50 ], [ 1, %2 ]
%15 = phi i32 [ %24, %50 ], [ 0, %2 ]
%16 = phi i32 [ %28, %50 ], [ 0, %2 ]
%17 = phi i8* [ %41, %50 ], [ undef, %2 ]
%18 = phi i8* [ %51, %50 ], [ undef, %2 ]
%19 = sext i32 %14 to i64
%20 = getelementptr inbounds i8*, i8** %1, i64 %19
%21 = load i8*, i8** %20
%22 = tail call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
%24 = select i1 %23, i32 1, i32 %15
%25 = load i8*, i8** %20
%26 = tail call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
%28 = select i1 %27, i32 1, i32 %16
%29 = load i8*, i8** %20
%30 = tail call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %34, label %32
32: ; preds = %13
%33 = load i8*, i8** %20
br label %39
34: ; preds = %13
%35 = add nsw i32 %14, 1
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8*, i8** %1, i64 %36
%38 = load i8*, i8** %37
br label %39
39: ; preds = %32, %34
%40 = phi i8* [ %38, %34 ], [ %33, %32 ]
%41 = phi i8* [ %38, %34 ], [ %17, %32 ]
%42 = phi i32 [ %35, %34 ], [ %14, %32 ]
%43 = tail call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %50
45: ; preds = %39
%46 = add nsw i32 %42, 1
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8*, i8** %1, i64 %47
%49 = load i8*, i8** %48
br label %50
50: ; preds = %45, %39
%51 = phi i8* [ %49, %45 ], [ %18, %39 ]
%52 = phi i32 [ %46, %45 ], [ %42, %39 ]
%53 = add nsw i32 %52, 1
%54 = icmp slt i32 %53, %0
br i1 %54, label %13, label %55
55: ; preds = %50
%56 = add nsw i32 %24, %28
%57 = icmp eq i32 %56, 1
br i1 %57, label %64, label %58
58: ; preds = %55
%59 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%60 = load i8*, i8** %1
%61 = tail call i32 @helptext(i8* %60)
%62 = load i32, i32* @EXIT_FAILURE
%63 = tail call i32 @exit(i32 %62)
unreachable
64: ; preds = %55
%65 = tail call i64 @strcmp(i8* %41, i8* %51)
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %73
67: ; preds = %64
%68 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0))
%69 = load i8*, i8** %1
%70 = tail call i32 @helptext(i8* %69)
%71 = load i32, i32* @EXIT_FAILURE
%72 = tail call i32 @exit(i32 %71)
unreachable
73: ; preds = %64
%74 = tail call i32* @fopen(i8* %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%75 = icmp eq i32* %74, null
br i1 %75, label %76, label %82
76: ; preds = %73
%77 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0))
%78 = load i8*, i8** %1
%79 = tail call i32 @helptext(i8* %78)
%80 = load i32, i32* @EXIT_FAILURE
%81 = tail call i32 @exit(i32 %80)
unreachable
82: ; preds = %73
%83 = tail call i32* @fopen(i8* %51, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%84 = icmp eq i32* %83, null
br i1 %84, label %90, label %85
85: ; preds = %82
%86 = call i32 @getline(i8** %3, i64* %4, i32* %74)
%87 = icmp eq i32 %86, -1
br i1 %87, label %108, label %88
88: ; preds = %85
%89 = icmp eq i32 %24, 1
br label %96
90: ; preds = %82
%91 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0))
%92 = load i8*, i8** %1
%93 = tail call i32 @helptext(i8* %92)
%94 = load i32, i32* @EXIT_FAILURE
%95 = tail call i32 @exit(i32 %94)
unreachable
96: ; preds = %88, %105
%97 = load i8*, i8** %3
%98 = call i32 @strip(i8* %97)
%99 = load i8*, i8** %3
%100 = call i32 @fputs(i8* %99, i32* %83)
br i1 %89, label %101, label %103
101: ; preds = %96
%102 = call i32 @fputc(i32 10, i32* %83)
br label %105
103: ; preds = %96
%104 = call i32 (i32*, i8*, ...) @fprintf(i32* %83, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i32 13, i32 10)
br label %105
105: ; preds = %103, %101
%106 = call i32 @getline(i8** %3, i64* %4, i32* %74)
%107 = icmp eq i32 %106, -1
br i1 %107, label %108, label %96
108: ; preds = %105, %85
%109 = call i32 @fclose(i32* %74)
%110 = call i32 @fclose(i32* %83)
%111 = load i8*, i8** %3
%112 = icmp eq i8* %111, null
br i1 %112, label %115, label %113
113: ; preds = %108
%114 = call i32 @free(i8* %111)
br label %115
115: ; preds = %113, %108
%116 = load i32, i32* @EXIT_SUCCESS
%117 = call i32 @exit(i32 %116)
unreachable
}