#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 /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ strcpy2(char *, char *);
int main() {
  char line[256];
  char linea[256];
  char lineb[256];
  char linec[256];
  FILE *headFPtr = fopen("2LetterWordlist.txt", "r");
  FILE *tailFPtr = fopen("5LetterWordlist.txt", "r");
  FILE *ofPtr = fopen("newWordlist.txt", "w");
  if (ofPtr == NULL)
    printf("Output file could not be opened.\n");
  else if (headFPtr == NULL)
    printf("Head wordlist could not be opened.\n");
  else if (tailFPtr == NULL)
    printf("Tail wordlist could not be opened.\n");
  else {
    while (fgets(linea, sizeof linea, headFPtr) != NULL) {
      strcpy2(lineb, linea);
      rewind(tailFPtr);
      while (fgets(line, sizeof line, tailFPtr) != NULL) {
        strcpy2(linec, line);
        fprintf(ofPtr, "%s%s\n", lineb, linec);
      }
    }
    fclose(ofPtr);
    fclose(headFPtr);
    fclose(tailFPtr);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe77(%rip),%rdi
lea    0xe84(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x418(%rbp)
lea    0xe73(%rip),%rdi
lea    0xe6a(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x420(%rbp)
lea    0xe6d(%rip),%rdi
lea    0xe76(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x428(%rbp)
cmpq   $0x0,-0x428(%rbp)
jne    11ef <main+0x7f>
lea    0xe57(%rip),%rdi
call   1040 <printf@plt>
jmp    1301 <main+0x191>
cmpq   $0x0,-0x418(%rbp)
jne    120e <main+0x9e>
lea    0xe5a(%rip),%rdi
call   1040 <printf@plt>
jmp    12fc <main+0x18c>
cmpq   $0x0,-0x420(%rbp)
jne    122d <main+0xbd>
lea    0xe5f(%rip),%rdi
call   1040 <printf@plt>
jmp    12f7 <main+0x187>
jmp    1232 <main+0xc2>
lea    -0x210(%rbp),%rdi
mov    -0x418(%rbp),%rdx
mov    $0x100,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     12d3 <main+0x163>
lea    -0x310(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1090 <strcpy2@plt>
mov    -0x420(%rbp),%rdi
call   1050 <rewind@plt>
lea    -0x110(%rbp),%rdi
mov    -0x420(%rbp),%rdx
mov    $0x100,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     12ce <main+0x15e>
lea    -0x410(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1090 <strcpy2@plt>
mov    -0x428(%rbp),%rdi
lea    -0x310(%rbp),%rdx
lea    -0x410(%rbp),%rcx
lea    0xde2(%rip),%rsi
call   1070 <fprintf@plt>
jmp    1273 <main+0x103>
jmp    1232 <main+0xc2>
mov    -0x428(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x418(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x420(%rbp),%rdi
call   1030 <fclose@plt>
jmp    12fc <main+0x18c>
jmp    1301 <main+0x191>
xor    %eax,%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
lea    0xe78(%rip),%rdi
lea    0xe85(%rip),%rbx
mov    %rbx,%rsi
call   1080 <fopen@plt>
mov    %rax,%rbp
lea    0xe75(%rip),%rdi
mov    %rbx,%rsi
call   1080 <fopen@plt>
mov    %rax,%r15
lea    0xe77(%rip),%rdi
lea    0xe80(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     1293 <main+0x123>
test   %rbp,%rbp
je     12b8 <main+0x148>
test   %r15,%r15
je     12c1 <main+0x151>
mov    %rax,%rbx
lea    0x10(%rsp),%rdi
mov    $0x100,%esi
mov    %rbp,0x8(%rsp)
mov    %rbp,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     129c <main+0x12c>
lea    0x210(%rsp),%r12
lea    0x10(%rsp),%rsi
lea    0x310(%rsp),%rbp
lea    0x110(%rsp),%r14
lea    0xe1b(%rip),%r13
jmp    124e <main+0xde>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x10(%rsp),%rdi
mov    $0x100,%esi
mov    0x8(%rsp),%rdx
call   1060 <fgets@plt>
lea    0x10(%rsp),%rsi
test   %rax,%rax
je     129c <main+0x12c>
mov    %r12,%rdi
call   1090 <strcpy2@plt>
mov    %r15,%rdi
call   1050 <rewind@plt>
xchg   %ax,%ax
mov    %rbp,%rdi
mov    $0x100,%esi
mov    %r15,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1230 <main+0xc0>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1090 <strcpy2@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
call   1070 <fprintf@plt>
jmp    1260 <main+0xf0>
lea    0xdee(%rip),%rdi
jmp    12c8 <main+0x158>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0x8(%rsp),%rdi
call   1040 <fclose@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
jmp    12cd <main+0x15d>
lea    0xda6(%rip),%rdi
jmp    12c8 <main+0x158>
lea    0xd7a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"2LetterWordlist.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [20 x i8] c"5LetterWordlist.txt\00"
@.str.3 = [16 x i8] c"newWordlist.txt\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [34 x i8] c"Output file could not be opened.\0A\00"
@.str.6 = [36 x i8] c"Head wordlist could not be opened.\0A\00"
@.str.7 = [36 x i8] c"Tail wordlist could not be opened.\0A\00"
@.str.8 = [6 x i8] c"%s%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = alloca [256 x i8]
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32 0, i32* %1
%9 = call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %9, i32** %6
%10 = call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %10, i32** %7
%11 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %11, i32** %8
%12 = load i32*, i32** %8
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
br label %61
16: ; preds = %0
%17 = load i32*, i32** %6
%18 = icmp eq i32* %17, null
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.6, i64 0, i64 0))
br label %60
21: ; preds = %16
%22 = load i32*, i32** %7
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.7, i64 0, i64 0))
br label %59
26: ; preds = %21
br label %27
27: ; preds = %51, %26
%28 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%29 = load i32*, i32** %6
%30 = call i32* @fgets(i8* %28, i32 256, i32* %29)
%31 = icmp ne i32* %30, null
br i1 %31, label %32, label %52
32: ; preds = %27
%33 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%34 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%35 = call i32 @strcpy2(i8* %33, i8* %34)
%36 = load i32*, i32** %7
%37 = call i32 @rewind(i32* %36)
br label %38
38: ; preds = %43, %32
%39 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%40 = load i32*, i32** %7
%41 = call i32* @fgets(i8* %39, i32 256, i32* %40)
%42 = icmp ne i32* %41, null
br i1 %42, label %43, label %51
43: ; preds = %38
%44 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%45 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%46 = call i32 @strcpy2(i8* %44, i8* %45)
%47 = load i32*, i32** %8
%48 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%49 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%50 = call i32 @fprintf(i32* %47, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* %48, i8* %49)
br label %38
51: ; preds = %38
br label %27
52: ; preds = %27
%53 = load i32*, i32** %8
%54 = call i32 @fclose(i32* %53)
%55 = load i32*, i32** %6
%56 = call i32 @fclose(i32* %55)
%57 = load i32*, i32** %7
%58 = call i32 @fclose(i32* %57)
br label %59
59: ; preds = %52, %24
br label %60
60: ; preds = %59, %19
br label %61
61: ; preds = %60, %14
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"2LetterWordlist.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [20 x i8] c"5LetterWordlist.txt\00"
@.str.3 = [16 x i8] c"newWordlist.txt\00"
@.str.4 = [2 x i8] c"w\00"
@.str.8 = [6 x i8] c"%s%s\0A\00"
@str = [35 x i8] c"Tail wordlist could not be opened.\00"
@str.9 = [35 x i8] c"Head wordlist could not be opened.\00"
@str.10 = [33 x i8] c"Output file could not be opened.\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = alloca [256 x i8]
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%9 = tail call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.10, i64 0, i64 0))
br label %43
15: ; preds = %0
%16 = icmp eq i32* %9, null
br i1 %16, label %17, label %19
17: ; preds = %15
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.9, i64 0, i64 0))
br label %43
19: ; preds = %15
%20 = icmp eq i32* %10, null
br i1 %20, label %24, label %21
21: ; preds = %19
%22 = call i32* @fgets(i8* %6, i32 256, i32* %9)
%23 = icmp eq i32* %22, null
br i1 %23, label %39, label %29
24: ; preds = %19
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
br label %43
26: ; preds = %34, %29
%27 = call i32* @fgets(i8* %6, i32 256, i32* %9)
%28 = icmp eq i32* %27, null
br i1 %28, label %39, label %29
29: ; preds = %21, %26
%30 = call i32 @strcpy2(i8* %7, i8* %6)
%31 = call i32 @rewind(i32* %10)
%32 = call i32* @fgets(i8* %5, i32 256, i32* %10)
%33 = icmp eq i32* %32, null
br i1 %33, label %26, label %34
34: ; preds = %29, %34
%35 = call i32 @strcpy2(i8* %8, i8* %5)
%36 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* %7, i8* %8)
%37 = call i32* @fgets(i8* %5, i32 256, i32* %10)
%38 = icmp eq i32* %37, null
br i1 %38, label %26, label %34
39: ; preds = %26, %21
%40 = call i32 @fclose(i32* %11)
%41 = call i32 @fclose(i32* %9)
%42 = call i32 @fclose(i32* %10)
br label %43
43: ; preds = %17, %39, %24, %13
ret i32 0
}