#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 /*<<< orphan*/ clear_words();
int /*<<< orphan*/ file_test(char *);
int /*<<< orphan*/ prefix_test(char *, int);
int /*<<< orphan*/ words_from_file(char *);
int main(int argc, char *argv[]) {
  char *filename;
  prefix_test("x", 100);
  prefix_test("x_", 100);
  prefix_test("y", 500);
  prefix_test("z", 1000);
  prefix_test("a", 2000);
  prefix_test("alpha", 600);
  prefix_test("x$4a", 900);
  prefix_test("aaaBBiwbcbue", 600);
  prefix_test("df093hc328vcc3h22gc", 900);
  prefix_test("9190ru09hnf93", 600);
  prefix_test("u_3f=hfho2bxgf", 900);
  if (argc == 2) {
    filename = argv[1];
    words_from_file(filename);
    file_test(filename);
    clear_words();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
mov    $0x64,%esi
call   1040 <prefix_test@plt>
lea    0xe94(%rip),%rdi
mov    $0x64,%esi
call   1040 <prefix_test@plt>
lea    0xe86(%rip),%rdi
mov    $0x1f4,%esi
call   1040 <prefix_test@plt>
lea    0xe77(%rip),%rdi
mov    $0x3e8,%esi
call   1040 <prefix_test@plt>
lea    0xe71(%rip),%rdi
mov    $0x7d0,%esi
call   1040 <prefix_test@plt>
lea    0xe57(%rip),%rdi
mov    $0x258,%esi
call   1040 <prefix_test@plt>
lea    0xe4c(%rip),%rdi
mov    $0x384,%esi
call   1040 <prefix_test@plt>
lea    0xe40(%rip),%rdi
mov    $0x258,%esi
call   1040 <prefix_test@plt>
lea    0xe3c(%rip),%rdi
mov    $0x384,%esi
call   1040 <prefix_test@plt>
lea    0xe3f(%rip),%rdi
mov    $0x258,%esi
call   1040 <prefix_test@plt>
lea    0xe3c(%rip),%rdi
mov    $0x384,%esi
call   1040 <prefix_test@plt>
cmpl   $0x2,-0x8(%rbp)
jne    1240 <main+0x100>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <words_from_file@plt>
mov    -0x18(%rbp),%rdi
call   1030 <file_test@plt>
mov    $0x0,%al
call   1060 <clear_words@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xeb1(%rip),%rdi
mov    $0x64,%esi
call   1040 <prefix_test@plt>
lea    0xea2(%rip),%rdi
mov    $0x64,%esi
call   1040 <prefix_test@plt>
lea    0xe94(%rip),%rdi
mov    $0x1f4,%esi
call   1040 <prefix_test@plt>
lea    0xe85(%rip),%rdi
mov    $0x3e8,%esi
call   1040 <prefix_test@plt>
lea    0xe7f(%rip),%rdi
mov    $0x7d0,%esi
call   1040 <prefix_test@plt>
lea    0xe65(%rip),%rdi
mov    $0x258,%esi
call   1040 <prefix_test@plt>
lea    0xe5a(%rip),%rdi
mov    $0x384,%esi
call   1040 <prefix_test@plt>
lea    0xe4e(%rip),%rdi
mov    $0x258,%esi
call   1040 <prefix_test@plt>
lea    0xe4a(%rip),%rdi
mov    $0x384,%esi
call   1040 <prefix_test@plt>
lea    0xe4d(%rip),%rdi
mov    $0x258,%esi
call   1040 <prefix_test@plt>
lea    0xe4a(%rip),%rdi
mov    $0x384,%esi
call   1040 <prefix_test@plt>
cmp    $0x2,%ebp
jne    1223 <main+0xe3>
mov    0x8(%rbx),%rbx
mov    %rbx,%rdi
call   1050 <words_from_file@plt>
mov    %rbx,%rdi
call   1030 <file_test@plt>
xor    %eax,%eax
call   1060 <clear_words@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"x\00"
@.str.1 = [3 x i8] c"x_\00"
@.str.2 = [2 x i8] c"y\00"
@.str.3 = [2 x i8] c"z\00"
@.str.4 = [2 x i8] c"a\00"
@.str.5 = [6 x i8] c"alpha\00"
@.str.6 = [5 x i8] c"x$4a\00"
@.str.7 = [13 x i8] c"aaaBBiwbcbue\00"
@.str.8 = [20 x i8] c"df093hc328vcc3h22gc\00"
@.str.9 = [14 x i8] c"9190ru09hnf93\00"
@.str.10 = [15 x i8] c"u_3f=hfho2bxgf\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @prefix_test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 100)
%8 = call i32 @prefix_test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 100)
%9 = call i32 @prefix_test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 500)
%10 = call i32 @prefix_test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1000)
%11 = call i32 @prefix_test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i32 2000)
%12 = call i32 @prefix_test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 600)
%13 = call i32 @prefix_test(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 900)
%14 = call i32 @prefix_test(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 600)
%15 = call i32 @prefix_test(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i32 900)
%16 = call i32 @prefix_test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i32 600)
%17 = call i32 @prefix_test(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i32 900)
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 2
br i1 %19, label %20, label %29
20: ; preds = %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
store i8* %23, i8** %6
%24 = load i8*, i8** %6
%25 = call i32 @words_from_file(i8* %24)
%26 = load i8*, i8** %6
%27 = call i32 @file_test(i8* %26)
%28 = call i32 (...) @clear_words()
br label %29
29: ; preds = %20, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"x\00"
@.str.1 = [3 x i8] c"x_\00"
@.str.2 = [2 x i8] c"y\00"
@.str.3 = [2 x i8] c"z\00"
@.str.4 = [2 x i8] c"a\00"
@.str.5 = [6 x i8] c"alpha\00"
@.str.6 = [5 x i8] c"x$4a\00"
@.str.7 = [13 x i8] c"aaaBBiwbcbue\00"
@.str.8 = [20 x i8] c"df093hc328vcc3h22gc\00"
@.str.9 = [14 x i8] c"9190ru09hnf93\00"
@.str.10 = [15 x i8] c"u_3f=hfho2bxgf\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @prefix_test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 100)
%4 = tail call i32 @prefix_test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 100)
%5 = tail call i32 @prefix_test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 500)
%6 = tail call i32 @prefix_test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1000)
%7 = tail call i32 @prefix_test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i32 2000)
%8 = tail call i32 @prefix_test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 600)
%9 = tail call i32 @prefix_test(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 900)
%10 = tail call i32 @prefix_test(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 600)
%11 = tail call i32 @prefix_test(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i32 900)
%12 = tail call i32 @prefix_test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i32 600)
%13 = tail call i32 @prefix_test(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i32 900)
%14 = icmp eq i32 %0, 2
br i1 %14, label %15, label %21
15: ; preds = %2
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = tail call i32 @words_from_file(i8* %17)
%19 = tail call i32 @file_test(i8* %17)
%20 = tail call i32 (...) @clear_words()
br label %21
21: ; preds = %15, %2
ret i32 0
}