#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*/ CopyWordsToNewFile(char *, char *, char *);
int /*<<< orphan*/ GetInputFileName(int, char **);
int /*<<< orphan*/ GetOutputFileName(int, char **);
int /*<<< orphan*/ GetPrefix(int, char **);
scalar_t__ HelpIsNeeded(int, char **);
int /*<<< orphan*/ PrintHelpMessage();
int main(int argc, char *argv[]) {
  typedef struct {
    char *prefix;
    char *inputFileName;
    char *outputFileName;
  } ProgramParameter;
  if (HelpIsNeeded(argc, argv)) {
    PrintHelpMessage();
  } else {
    ProgramParameter programParameter = {GetPrefix(argc, argv),
                                         GetInputFileName(argc, argv),
                                         GetOutputFileName(argc, argv)};
    CopyWordsToNewFile(programParameter.inputFileName,
                       programParameter.outputFileName,
                       programParameter.prefix);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <HelpIsNeeded@plt>
cmp    $0x0,%rax
je     1198 <main+0x38>
mov    $0x0,%al
call   1080 <PrintHelpMessage@plt>
jmp    11df <main+0x7f>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <GetPrefix@plt>
cltq
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <GetInputFileName@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1070 <GetOutputFileName@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1060 <CopyWordsToNewFile@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <HelpIsNeeded@plt>
test   %rax,%rax
je     117f <main+0x1f>
xor    %eax,%eax
call   1080 <PrintHelpMessage@plt>
jmp    11b1 <main+0x51>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <GetPrefix@plt>
movslq %eax,%r14
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <GetInputFileName@plt>
movslq %eax,%r15
mov    %ebp,%edi
mov    %rbx,%rsi
call   1070 <GetOutputFileName@plt>
movslq %eax,%rsi
mov    %r15,%rdi
mov    %r14,%rdx
call   1060 <CopyWordsToNewFile@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.ProgramParameter = type { i8*, i8*, i8* }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.ProgramParameter
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i64 @HelpIsNeeded(i32 %7, i8** %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @PrintHelpMessage()
br label %39
13: ; preds = %2
%14 = getelementptr inbounds %struct.ProgramParameter, %struct.ProgramParameter* %6, i32 0, i32 0
%15 = load i32, i32* %4
%16 = load i8**, i8*** %5
%17 = call i32 @GetPrefix(i32 %15, i8** %16)
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i8*
store i8* %19, i8** %14
%20 = getelementptr inbounds %struct.ProgramParameter, %struct.ProgramParameter* %6, i32 0, i32 1
%21 = load i32, i32* %4
%22 = load i8**, i8*** %5
%23 = call i32 @GetInputFileName(i32 %21, i8** %22)
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to i8*
store i8* %25, i8** %20
%26 = getelementptr inbounds %struct.ProgramParameter, %struct.ProgramParameter* %6, i32 0, i32 2
%27 = load i32, i32* %4
%28 = load i8**, i8*** %5
%29 = call i32 @GetOutputFileName(i32 %27, i8** %28)
%30 = sext i32 %29 to i64
%31 = inttoptr i64 %30 to i8*
store i8* %31, i8** %26
%32 = getelementptr inbounds %struct.ProgramParameter, %struct.ProgramParameter* %6, i32 0, i32 1
%33 = load i8*, i8** %32
%34 = getelementptr inbounds %struct.ProgramParameter, %struct.ProgramParameter* %6, i32 0, i32 2
%35 = load i8*, i8** %34
%36 = getelementptr inbounds %struct.ProgramParameter, %struct.ProgramParameter* %6, i32 0, i32 0
%37 = load i8*, i8** %36
%38 = call i32 @CopyWordsToNewFile(i8* %33, i8* %35, i8* %37)
br label %39
39: ; preds = %13, %11
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i64 @HelpIsNeeded(i32 %0, i8** %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @PrintHelpMessage()
br label %18
7: ; preds = %2
%8 = tail call i32 @GetPrefix(i32 %0, i8** %1)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = tail call i32 @GetInputFileName(i32 %0, i8** %1)
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
%14 = tail call i32 @GetOutputFileName(i32 %0, i8** %1)
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i8*
%17 = tail call i32 @CopyWordsToNewFile(i8* %13, i8* %16, i8* %10)
br label %18
18: ; preds = %7, %5
ret i32 0
}