#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 wordinfo_node {
  int dummy;
};
typedef int /*<<< orphan*/ buffer;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ print_help(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ process_token(char *, struct wordinfo_node *);
int /*<<< orphan*/ strcmp(char *, char *);
int strlen(char *);
char *strtok(char *, char *);
struct wordinfo_node *wordinfo_node_alloc();
int /*<<< orphan*/ wordlist_dump(struct wordinfo_node *, int /*<<< orphan*/ *);
int /*<<< orphan*/ wordlist_free(struct wordinfo_node *);
int main(int argc, char *argv[]) {
  FILE *ifp = NULL, *ofp = NULL;
  char *buf = NULL, *tok = NULL;
  char buffer[4096];
  char delim[] = " (){}[]\t\n,./\\;:\"\'~!@#$%^&*-_`+=<>?0123456789";
  struct wordinfo_node *info_head = NULL;
  int optind = 1;
  int outfile = 0, arg = 1;
  char *ofile = NULL;
  if (argc < 2) {
    print_help(argv[0]);
    return -1;
  }
  while (optind < argc) {
    if (argv[optind][0] == '-') {
      if (!strcmp(argv[optind], "-o")) {
        outfile = optind + 1;
        break;
      } else if (!strcmp(argv[optind], "--output")) {
        outfile = optind + 1;
        break;
      } else {
        printf("Error: Invalid option %s\n", argv[optind]);
        return -1;
      }
    }
    optind++;
  }
  if (outfile)
    ofile = argv[outfile];
  else
    ofile = "./words.list";
  ofp = fopen(ofile, "w+");
  if (ofp == NULL) {
    perror(ofile);
    return -1;
  }
  info_head = wordinfo_node_alloc();
  if (info_head == NULL)
    goto cleanup;
  while (arg < argc) {
    if ((arg == outfile) || (arg == (outfile - 1))) {
      arg++;
      continue;
    }
    ifp = fopen(argv[arg], "r");
    if (ifp == NULL) {
      perror(argv[arg]);
      continue;
    }
    printf("Processing input file: %s\n", argv[arg]);
    while (fgets(buffer, sizeof(buffer), ifp) != 0) {
      if (buffer[0] == '\n')
        continue;
      buffer[strlen(buffer) - 1] = '\0';
      buf = buffer;
      tok = strtok(buf, delim);
      if (tok == NULL)
        continue;
      process_token(tok, info_head);
      do {
        tok = strtok(NULL, delim);
        if (tok)
          process_token(tok, info_head);
      } while (tok);
    }
    fclose(ifp);
    arg++;
  }
  wordlist_dump(info_head, ofp);
  fflush(ofp);
  printf("Output word list generated in %s\n", ofile);
cleanup:
  wordlist_free(info_head);
  fclose(ofp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1080,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
lea    -0x1060(%rbp),%rdi
lea    0xdc9(%rip),%rsi
mov    $0x2d,%edx
call   10a0 <memcpy@plt>
movq   $0x0,-0x1068(%rbp)
movl   $0x1,-0x106c(%rbp)
movl   $0x0,-0x1070(%rbp)
movl   $0x1,-0x1074(%rbp)
movq   $0x0,-0x1080(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1297 <main+0xa7>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1100 <print_help@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    15e6 <main+0x3f6>
jmp    129c <main+0xac>
mov    -0x106c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1371 <main+0x181>
mov    -0x10(%rbp),%rax
movslq -0x106c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    135d <main+0x16d>
mov    -0x10(%rbp),%rax
movslq -0x106c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd51(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%eax
jne    12fe <main+0x10e>
mov    -0x106c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1070(%rbp)
jmp    1371 <main+0x181>
mov    -0x10(%rbp),%rax
movslq -0x106c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd1c(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%eax
jne    1336 <main+0x146>
mov    -0x106c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1070(%rbp)
jmp    1371 <main+0x181>
mov    -0x10(%rbp),%rax
movslq -0x106c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xced(%rip),%rdi
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    15e6 <main+0x3f6>
mov    -0x106c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x106c(%rbp)
jmp    129c <main+0xac>
cmpl   $0x0,-0x1070(%rbp)
je     1399 <main+0x1a9>
mov    -0x10(%rbp),%rax
movslq -0x1070(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x1080(%rbp)
jmp    13a7 <main+0x1b7>
lea    0xcb3(%rip),%rax
mov    %rax,-0x1080(%rbp)
mov    -0x1080(%rbp),%rdi
lea    0xcab(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    13e1 <main+0x1f1>
mov    -0x1080(%rbp),%rdi
call   10e0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    15e6 <main+0x3f6>
mov    $0x0,%al
call   1110 <wordinfo_node_alloc@plt>
mov    %rax,-0x1068(%rbp)
cmpq   $0x0,-0x1068(%rbp)
jne    1402 <main+0x212>
jmp    15ca <main+0x3da>
jmp    1407 <main+0x217>
mov    -0x1074(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    159e <main+0x3ae>
mov    -0x1074(%rbp),%eax
cmp    -0x1070(%rbp),%eax
je     143f <main+0x24f>
mov    -0x1074(%rbp),%eax
mov    -0x1070(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    1453 <main+0x263>
mov    -0x1074(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1074(%rbp)
jmp    1407 <main+0x217>
mov    -0x10(%rbp),%rax
movslq -0x1074(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xbfa(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1496 <main+0x2a6>
mov    -0x10(%rbp),%rax
movslq -0x1074(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   10e0 <perror@plt>
jmp    1407 <main+0x217>
mov    -0x10(%rbp),%rax
movslq -0x1074(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xbb9(%rip),%rdi
call   1060 <printf@plt>
lea    -0x1030(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x1000,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     1581 <main+0x391>
movsbl -0x1030(%rbp),%eax
cmp    $0xa,%eax
jne    14e5 <main+0x2f5>
jmp    14b1 <main+0x2c1>
lea    -0x1030(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0x1030(%rbp,%rax,1)
lea    -0x1030(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    -0x1060(%rbp),%rsi
call   10f0 <strtok@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    152d <main+0x33d>
jmp    14b1 <main+0x2c1>
mov    -0x30(%rbp),%rdi
mov    -0x1068(%rbp),%rsi
call   1030 <process_token@plt>
lea    -0x1060(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <strtok@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     156c <main+0x37c>
mov    -0x30(%rbp),%rdi
mov    -0x1068(%rbp),%rsi
call   1030 <process_token@plt>
jmp    1571 <main+0x381>
cmpq   $0x0,-0x30(%rbp)
jne    153d <main+0x34d>
jmp    14b1 <main+0x2c1>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x1074(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1074(%rbp)
jmp    1407 <main+0x217>
mov    -0x1068(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1070 <wordlist_dump@plt>
mov    -0x20(%rbp),%rdi
call   10b0 <fflush@plt>
mov    -0x1080(%rbp),%rsi
lea    0xabb(%rip),%rdi
call   1060 <printf@plt>
mov    -0x1068(%rbp),%rdi
call   10c0 <wordlist_free@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1080,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1078,%rsp
mov    %rsi,%rbx
movups 0xe22(%rip),%xmm0
movups %xmm0,0x5d(%rsp)
movaps 0xe09(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xded(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
cmp    $0x2,%edi
jge    122f <main+0x4f>
mov    (%rbx),%rdi
call   10f0 <print_help@plt>
mov    $0xffffffff,%eax
jmp    1449 <main+0x269>
mov    %edi,%r14d
mov    %edi,%ecx
mov    $0x1,%eax
mov    %rcx,0x30(%rsp)
sub    %rcx,%rax
mov    $0x2,%r12d
lea    0xe05(%rip),%r15
xchg   %ax,%ax
mov    -0x8(%rbx,%r12,8),%rbp
cmpb   $0x2d,0x0(%rbp)
je     1272 <main+0x92>
lea    (%rax,%r12,1),%rcx
add    $0x1,%rcx
add    $0x1,%r12
cmp    $0x2,%rcx
jne    1250 <main+0x70>
xor    %r12d,%r12d
jmp    12b5 <main+0xd5>
lea    0xdb4(%rip),%rsi
mov    %rbp,%rdi
call   1090 <strcmp@plt>
test   %eax,%eax
je     12b1 <main+0xd1>
lea    0xda4(%rip),%rsi
mov    %rbp,%rdi
call   1090 <strcmp@plt>
test   %eax,%eax
je     12b1 <main+0xd1>
lea    0xd9a(%rip),%rdi
mov    %rbp,%rsi
call   1060 <printf@plt>
mov    $0xffffffff,%eax
jmp    1449 <main+0x269>
mov    (%rbx,%r12,8),%r15
lea    0xda4(%rip),%rsi
mov    %r15,%rdi
call   10c0 <fopen@plt>
mov    %rax,0x10(%rsp)
test   %rax,%rax
je     145b <main+0x27b>
xor    %eax,%eax
call   1100 <wordinfo_node_alloc@plt>
mov    %rax,%rbp
test   %rax,%rax
je     1435 <main+0x255>
mov    %r15,0x20(%rsp)
mov    %rbx,0x38(%rsp)
cmp    $0x2,%r14d
jl     140c <main+0x22c>
mov    %r12d,%eax
mov    %rax,0x28(%rsp)
add    $0xffffffff,%r12d
movb   $0x1,0xf(%rsp)
mov    $0x1,%r14d
lea    0x40(%rsp),%r15
jmp    1341 <main+0x161>
nopw   0x0(%rax,%rax,1)
mov    %r13,%rdi
call   1040 <fclose@plt>
mov    0x18(%rsp),%r14
add    $0x1,%r14
cmp    0x30(%rsp),%r14
setb   0xf(%rsp)
je     140c <main+0x22c>
cmp    0x28(%rsp),%r14
je     132d <main+0x14d>
cmp    %r12,%r14
je     132d <main+0x14d>
mov    %r14,0x18(%rsp)
mov    0x38(%rsp),%rbx
mov    (%rbx,%r14,8),%rdi
lea    0xd01(%rip),%rsi
call   10c0 <fopen@plt>
mov    (%rbx,%r14,8),%rsi
test   %rax,%rax
jne    1390 <main+0x1b0>
mov    %rsi,%rdi
call   10d0 <perror@plt>
testb  $0x1,0xf(%rsp)
mov    0x18(%rsp),%r14
jne    1352 <main+0x172>
jmp    140c <main+0x22c>
nopl   0x0(%rax)
mov    %rax,%r13
lea    0xccb(%rip),%rdi
call   1060 <printf@plt>
lea    0x70(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    $0x1000,%esi
mov    %r13,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     1320 <main+0x140>
cmpb   $0xa,0x70(%rsp)
je     13b0 <main+0x1d0>
mov    %rbx,%rdi
call   1050 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rsi
call   10e0 <strtok@plt>
test   %rax,%rax
je     13b0 <main+0x1d0>
mov    %rax,%rdi
mov    %rbp,%rsi
call   1030 <process_token@plt>
xor    %edi,%edi
jmp    13f0 <main+0x210>
mov    %rbp,%rdi
mov    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1070 <wordlist_dump@plt>
mov    %rbx,%rdi
call   10a0 <fflush@plt>
lea    0xc55(%rip),%rdi
mov    0x20(%rsp),%rsi
call   1060 <printf@plt>
mov    %rbp,%rdi
call   10b0 <wordlist_free@plt>
mov    0x10(%rsp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x1078,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r15,%rdi
call   10d0 <perror@plt>
mov    $0xffffffff,%eax
jmp    1449 <main+0x269>

LLVM IR (-O0):
%struct.wordinfo_node = type { i32 }
@__const.main.delim = [45 x i8] c" (){}[]\09\0A,./\\;:\22'~!@#$%^&*-_`+=<>?0123456789\00"
@.str = [3 x i8] c"-o\00"
@.str.1 = [9 x i8] c"--output\00"
@.str.2 = [26 x i8] c"Error: Invalid option %s\0A\00"
@.str.3 = [13 x i8] c"./words.list\00"
@.str.4 = [3 x i8] c"w+\00"
@.str.5 = [2 x i8] c"r\00"
@.str.6 = [27 x i8] c"Processing input file: %s\0A\00"
@.str.7 = [34 x i8] c"Output word list generated in %s\0A\00"
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 [4096 x i8]
%11 = alloca [45 x i8]
%12 = alloca %struct.wordinfo_node*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
store i32* null, i32** %7
store i8* null, i8** %8
store i8* null, i8** %9
%17 = bitcast [45 x i8]* %11 to i8*
store %struct.wordinfo_node* null, %struct.wordinfo_node** %12
store i32 1, i32* %13
store i32 0, i32* %14
store i32 1, i32* %15
store i8* null, i8** %16
%18 = load i32, i32* %4
%19 = icmp slt i32 %18, 2
br i1 %19, label %20, label %25
20: ; preds = %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 0
%23 = load i8*, i8** %22
%24 = call i32 @print_help(i8* %23)
store i32 -1, i32* %3
br label %195
25: ; preds = %2
br label %26
26: ; preds = %69, %25
%27 = load i32, i32* %13
%28 = load i32, i32* %4
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %72
30: ; preds = %26
%31 = load i8**, i8*** %5
%32 = load i32, i32* %13
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8*, i8** %31, i64 %33
%35 = load i8*, i8** %34
%36 = getelementptr inbounds i8, i8* %35, i64 0
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %38, 45
br i1 %39, label %40, label %69
40: ; preds = %30
%41 = load i8**, i8*** %5
%42 = load i32, i32* %13
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8*, i8** %41, i64 %43
%45 = load i8*, i8** %44
%46 = call i32 @strcmp(i8* %45, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%47 = icmp ne i32 %46, 0
br i1 %47, label %51, label %48
48: ; preds = %40
%49 = load i32, i32* %13
%50 = add nsw i32 %49, 1
store i32 %50, i32* %14
br label %72
51: ; preds = %40
%52 = load i8**, i8*** %5
%53 = load i32, i32* %13
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8*, i8** %52, i64 %54
%56 = load i8*, i8** %55
%57 = call i32 @strcmp(i8* %56, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%58 = icmp ne i32 %57, 0
br i1 %58, label %62, label %59
59: ; preds = %51
%60 = load i32, i32* %13
%61 = add nsw i32 %60, 1
store i32 %61, i32* %14
br label %72
62: ; preds = %51
%63 = load i8**, i8*** %5
%64 = load i32, i32* %13
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i8*, i8** %63, i64 %65
%67 = load i8*, i8** %66
%68 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %67)
store i32 -1, i32* %3
br label %195
69: ; preds = %30
%70 = load i32, i32* %13
%71 = add nsw i32 %70, 1
store i32 %71, i32* %13
br label %26
72: ; preds = %59, %48, %26
%73 = load i32, i32* %14
%74 = icmp ne i32 %73, 0
br i1 %74, label %75, label %81
75: ; preds = %72
%76 = load i8**, i8*** %5
%77 = load i32, i32* %14
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i8*, i8** %76, i64 %78
%80 = load i8*, i8** %79
store i8* %80, i8** %16
br label %82
81: ; preds = %72
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8** %16
br label %82
82: ; preds = %81, %75
%83 = load i8*, i8** %16
%84 = call i32* @fopen(i8* %83, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32* %84, i32** %7
%85 = load i32*, i32** %7
%86 = icmp eq i32* %85, null
br i1 %86, label %87, label %90
87: ; preds = %82
%88 = load i8*, i8** %16
%89 = call i32 @perror(i8* %88)
store i32 -1, i32* %3
br label %195
90: ; preds = %82
%91 = call %struct.wordinfo_node* (...) @wordinfo_node_alloc()
store %struct.wordinfo_node* %91, %struct.wordinfo_node** %12
%92 = load %struct.wordinfo_node*, %struct.wordinfo_node** %12
%93 = icmp eq %struct.wordinfo_node* %92, null
br i1 %93, label %94, label %95
94: ; preds = %90
br label %190
95: ; preds = %90
br label %96
96: ; preds = %177, %121, %109, %95
%97 = load i32, i32* %15
%98 = load i32, i32* %4
%99 = icmp slt i32 %97, %98
br i1 %99, label %100, label %182
100: ; preds = %96
%101 = load i32, i32* %15
%102 = load i32, i32* %14
%103 = icmp eq i32 %101, %102
br i1 %103, label %109, label %104
104: ; preds = %100
%105 = load i32, i32* %15
%106 = load i32, i32* %14
%107 = sub nsw i32 %106, 1
%108 = icmp eq i32 %105, %107
br i1 %108, label %109, label %112
109: ; preds = %104, %100
%110 = load i32, i32* %15
%111 = add nsw i32 %110, 1
store i32 %111, i32* %15
br label %96
112: ; preds = %104
%113 = load i8**, i8*** %5
%114 = load i32, i32* %15
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds i8*, i8** %113, i64 %115
%117 = load i8*, i8** %116
%118 = call i32* @fopen(i8* %117, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %118, i32** %6
%119 = load i32*, i32** %6
%120 = icmp eq i32* %119, null
br i1 %120, label %121, label %128
121: ; preds = %112
%122 = load i8**, i8*** %5
%123 = load i32, i32* %15
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds i8*, i8** %122, i64 %124
%126 = load i8*, i8** %125
%127 = call i32 @perror(i8* %126)
br label %96
128: ; preds = %112
%129 = load i8**, i8*** %5
%130 = load i32, i32* %15
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds i8*, i8** %129, i64 %131
%133 = load i8*, i8** %132
%134 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i8* %133)
br label %135
135: ; preds = %176, %158, %145, %128
%136 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%137 = load i32*, i32** %6
%138 = call i64 @fgets(i8* %136, i32 4096, i32* %137)
%139 = icmp ne i64 %138, 0
br i1 %139, label %140, label %177
140: ; preds = %135
%141 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%142 = load i8, i8* %141
%143 = sext i8 %142 to i32
%144 = icmp eq i32 %143, 10
br i1 %144, label %145, label %146
145: ; preds = %140
br label %135
146: ; preds = %140
%147 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%148 = call i32 @strlen(i8* %147)
%149 = sub nsw i32 %148, 1
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 %150
store i8 0, i8* %151
%152 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
store i8* %152, i8** %8
%153 = load i8*, i8** %8
%154 = getelementptr inbounds [45 x i8], [45 x i8]* %11, i64 0, i64 0
%155 = call i8* @strtok(i8* %153, i8* %154)
store i8* %155, i8** %9
%156 = load i8*, i8** %9
%157 = icmp eq i8* %156, null
br i1 %157, label %158, label %159
158: ; preds = %146
br label %135
159: ; preds = %146
%160 = load i8*, i8** %9
%161 = load %struct.wordinfo_node*, %struct.wordinfo_node** %12
%162 = call i32 @process_token(i8* %160, %struct.wordinfo_node* %161)
br label %163
163: ; preds = %173, %159
%164 = getelementptr inbounds [45 x i8], [45 x i8]* %11, i64 0, i64 0
%165 = call i8* @strtok(i8* null, i8* %164)
store i8* %165, i8** %9
%166 = load i8*, i8** %9
%167 = icmp ne i8* %166, null
br i1 %167, label %168, label %172
168: ; preds = %163
%169 = load i8*, i8** %9
%170 = load %struct.wordinfo_node*, %struct.wordinfo_node** %12
%171 = call i32 @process_token(i8* %169, %struct.wordinfo_node* %170)
br label %172
172: ; preds = %168, %163
br label %173
173: ; preds = %172
%174 = load i8*, i8** %9
%175 = icmp ne i8* %174, null
br i1 %175, label %163, label %176
176: ; preds = %173
br label %135
177: ; preds = %135
%178 = load i32*, i32** %6
%179 = call i32 @fclose(i32* %178)
%180 = load i32, i32* %15
%181 = add nsw i32 %180, 1
store i32 %181, i32* %15
br label %96
182: ; preds = %96
%183 = load %struct.wordinfo_node*, %struct.wordinfo_node** %12
%184 = load i32*, i32** %7
%185 = call i32 @wordlist_dump(%struct.wordinfo_node* %183, i32* %184)
%186 = load i32*, i32** %7
%187 = call i32 @fflush(i32* %186)
%188 = load i8*, i8** %16
%189 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i8* %188)
br label %190
190: ; preds = %182, %94
%191 = load %struct.wordinfo_node*, %struct.wordinfo_node** %12
%192 = call i32 @wordlist_free(%struct.wordinfo_node* %191)
%193 = load i32*, i32** %7
%194 = call i32 @fclose(i32* %193)
store i32 0, i32* %3
br label %195
195: ; preds = %190, %87, %62, %20
%196 = load i32, i32* %3
ret i32 %196
}

LLVM IR (-O2):
%struct.wordinfo_node = type { i32 }
@__const.main.delim = [45 x i8] c" (){}[]\09\0A,./\\;:\22'~!@#$%^&*-_`+=<>?0123456789\00"
@.str = [3 x i8] c"-o\00"
@.str.1 = [9 x i8] c"--output\00"
@.str.2 = [26 x i8] c"Error: Invalid option %s\0A\00"
@.str.3 = [13 x i8] c"./words.list\00"
@.str.4 = [3 x i8] c"w+\00"
@.str.5 = [2 x i8] c"r\00"
@.str.6 = [27 x i8] c"Processing input file: %s\0A\00"
@.str.7 = [34 x i8] c"Output word list generated in %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [4096 x i8]
%4 = alloca [45 x i8]
%5 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [45 x i8], [45 x i8]* %4, i64 0, i64 0
%7 = icmp slt i32 %0, 2
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = zext i32 %0 to i64
br label %13
10: ; preds = %2
%11 = load i8*, i8** %1
%12 = tail call i32 @print_help(i8* %11)
br label %107
13: ; preds = %8, %28
%14 = phi i64 [ 1, %8 ], [ %29, %28 ]
%15 = getelementptr inbounds i8*, i8** %1, i64 %14
%16 = load i8*, i8** %15
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 45
br i1 %18, label %19, label %28
19: ; preds = %13
%20 = trunc i64 %14 to i32
%21 = tail call i32 @strcmp(i8* %16, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%22 = icmp eq i32 %21, 0
br i1 %22, label %31, label %23
23: ; preds = %19
%24 = tail call i32 @strcmp(i8* %16, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp eq i32 %24, 0
br i1 %25, label %31, label %26
26: ; preds = %23
%27 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %16)
br label %107
28: ; preds = %13
%29 = add nuw nsw i64 %14, 1
%30 = icmp eq i64 %29, %9
br i1 %30, label %36, label %13
31: ; preds = %23, %19
%32 = add nuw nsw i32 %20, 1
%33 = zext i32 %32 to i64
%34 = getelementptr inbounds i8*, i8** %1, i64 %33
%35 = load i8*, i8** %34
br label %36
36: ; preds = %28, %31
%37 = phi i32 [ %32, %31 ], [ 0, %28 ]
%38 = phi i8* [ %35, %31 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), %28 ]
%39 = tail call i32* @fopen(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%40 = icmp eq i32* %39, null
br i1 %40, label %41, label %43
41: ; preds = %36
%42 = tail call i32 @perror(i8* %38)
br label %107
43: ; preds = %36
%44 = tail call %struct.wordinfo_node* (...) @wordinfo_node_alloc()
%45 = icmp eq %struct.wordinfo_node* %44, null
br i1 %45, label %104, label %46
46: ; preds = %43
%47 = icmp sgt i32 %0, 1
br i1 %47, label %48, label %100
48: ; preds = %46
%49 = add nsw i32 %37, -1
%50 = zext i32 %37 to i64
%51 = zext i32 %49 to i64
%52 = zext i32 %0 to i64
%53 = zext i32 %0 to i64
br label %54
54: ; preds = %48, %66
%55 = phi i64 [ 1, %48 ], [ %67, %66 ]
%56 = phi i1 [ true, %48 ], [ %68, %66 ]
%57 = icmp eq i64 %55, %50
%58 = icmp eq i64 %55, %51
%59 = select i1 %57, i1 true, i1 %58
%60 = getelementptr inbounds i8*, i8** %1, i64 %55
br i1 %59, label %66, label %61
61: ; preds = %54, %70
%62 = load i8*, i8** %60
%63 = call i32* @fopen(i8* %62, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%64 = icmp eq i32* %63, null
%65 = load i8*, i8** %60
br i1 %64, label %70, label %72
66: ; preds = %54, %98
%67 = add nuw nsw i64 %55, 1
%68 = icmp ult i64 %67, %52
%69 = icmp eq i64 %67, %53
br i1 %69, label %100, label %54
70: ; preds = %61
%71 = call i32 @perror(i8* %65)
br i1 %56, label %61, label %100
72: ; preds = %61
%73 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i8* %65)
%74 = call i64 @fgets(i8* %5, i32 4096, i32* %63)
%75 = icmp eq i64 %74, 0
br i1 %75, label %98, label %76
76: ; preds = %72, %79
%77 = load i8, i8* %5
%78 = icmp eq i8 %77, 10
br i1 %78, label %79, label %82
79: ; preds = %93, %89, %76, %82
%80 = call i64 @fgets(i8* %5, i32 4096, i32* %63)
%81 = icmp eq i64 %80, 0
br i1 %81, label %98, label %76
82: ; preds = %76
%83 = call i32 @strlen(i8* %5)
%84 = add nsw i32 %83, -1
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %85
store i8 0, i8* %86
%87 = call i8* @strtok(i8* %5, i8* %6)
%88 = icmp eq i8* %87, null
br i1 %88, label %79, label %89
89: ; preds = %82
%90 = call i32 @process_token(i8* %87, %struct.wordinfo_node* %44)
%91 = call i8* @strtok(i8* null, i8* %6)
%92 = icmp eq i8* %91, null
br i1 %92, label %79, label %93
93: ; preds = %89, %93
%94 = phi i8* [ %96, %93 ], [ %91, %89 ]
%95 = call i32 @process_token(i8* %94, %struct.wordinfo_node* %44)
%96 = call i8* @strtok(i8* null, i8* %6)
%97 = icmp eq i8* %96, null
br i1 %97, label %79, label %93
98: ; preds = %79, %72
%99 = call i32 @fclose(i32* %63)
br label %66
100: ; preds = %66, %70, %46
%101 = call i32 @wordlist_dump(%struct.wordinfo_node* %44, i32* %39)
%102 = call i32 @fflush(i32* %39)
%103 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i8* %38)
br label %104
104: ; preds = %43, %100
%105 = call i32 @wordlist_free(%struct.wordinfo_node* %44)
%106 = call i32 @fclose(i32* %39)
br label %107
107: ; preds = %104, %41, %26, %10
%108 = phi i32 [ -1, %10 ], [ -1, %26 ], [ -1, %41 ], [ 0, %104 ]
ret i32 %108
}