#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 */
char EOF;
scalar_t__ Exists(char *);
int /*<<< orphan*/ PassWordsWithPrefixes(char **, char *, char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
char fscanf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ printf(char *, char *);
void CopyWordsToNewFile(char *inputFileName, char *outputFileName,
                        char *prefix) {
  {
    FILE *inputFile;
    char singleWord[100];
    char c;
    if (Exists(inputFileName)) {
      inputFile = fopen(inputFileName, "r");
      do {
        c = fscanf(inputFile, "%s", singleWord);
        PassWordsWithPrefixes(&singleWord, outputFileName, prefix);
      } while (c != EOF);
      fclose(inputFile);
    } else
      printf("Plik o nazwie '%s' nie istnieje. \nSprawdz czy podales podales "
             "poprawna nazwe pliku.  \nW celu uzyskania pomocy uzyj komendy "
             "'PrefixFilter -h'.\n\n",
             inputFileName);
  }
}


x86 assembly (clang, -O0):
<CopyWordsToNewFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <Exists@plt>
cmp    $0x0,%rax
je     11f6 <CopyWordsToNewFile+0x96>
mov    -0x8(%rbp),%rdi
lea    0xe6b(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x90(%rbp),%rdx
lea    0xe52(%rip),%rsi
call   1060 <fscanf@plt>
mov    %al,-0x91(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <PassWordsWithPrefixes@plt>
movsbl -0x91(%rbp),%eax
mov    0x2e0b(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    119e <CopyWordsToNewFile+0x3e>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
jmp    1206 <CopyWordsToNewFile+0xa6>
mov    -0x8(%rbp),%rsi
lea    0xe04(%rip),%rdi
call   1050 <printf@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyWordsToNewFile>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1070 <Exists@plt>
test   %rax,%rax
je     11df <CopyWordsToNewFile+0x7f>
lea    0xe78(%rip),%rsi
mov    %rbx,%rdi
call   1080 <fopen@plt>
mov    %rax,%r13
mov    %rsp,%rbp
mov    0x2e4b(%rip),%r12
nopl   (%rax)
mov    %r13,%rdi
lea    0xe58(%rip),%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <PassWordsWithPrefixes@plt>
cmp    (%r12),%bl
jne    11a0 <CopyWordsToNewFile+0x40>
mov    %r13,%rdi
call   1040 <fclose@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe1f(%rip),%rdi
mov    %rbx,%rsi
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [3 x i8] c"%s\00"
@EOF = global i8 0
@.str.2 = [144 x i8] c"Plik o nazwie '%s' nie istnieje. \0ASprawdz czy podales podales poprawna nazwe pliku. \0AW celu uzyskania pomocy uzyj komendy 'PrefixFilter -h'.\0A\0A\00"
define void @CopyWordsToNewFile(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca [100 x i8]
%9 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%10 = load i8*, i8** %4
%11 = call i64 @Exists(i8* %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %33
13: ; preds = %3
%14 = load i8*, i8** %4
%15 = call i32* @fopen(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %15, i32** %7
br label %16
16: ; preds = %24, %13
%17 = load i32*, i32** %7
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%19 = call signext i8 @fscanf(i32* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %18)
store i8 %19, i8* %9
%20 = bitcast [100 x i8]* %8 to i8**
%21 = load i8*, i8** %5
%22 = load i8*, i8** %6
%23 = call i32 @PassWordsWithPrefixes(i8** %20, i8* %21, i8* %22)
br label %24
24: ; preds = %16
%25 = load i8, i8* %9
%26 = sext i8 %25 to i32
%27 = load i8, i8* @EOF
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %26, %28
br i1 %29, label %16, label %30
30: ; preds = %24
%31 = load i32*, i32** %7
%32 = call i32 @fclose(i32* %31)
br label %36
33: ; preds = %3
%34 = load i8*, i8** %4
%35 = call i32 @printf(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.2, i64 0, i64 0), i8* %34)
br label %36
36: ; preds = %33, %30
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [3 x i8] c"%s\00"
@EOF = global i8 0
@.str.2 = [144 x i8] c"Plik o nazwie '%s' nie istnieje. \0ASprawdz czy podales podales poprawna nazwe pliku. \0AW celu uzyskania pomocy uzyj komendy 'PrefixFilter -h'.\0A\0A\00"
define void @CopyWordsToNewFile(i8* %0, i8* %1, i8* %2) {
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%6 = tail call i64 @Exists(i8* %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %18, label %8
8: ; preds = %3
%9 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = bitcast [100 x i8]* %4 to i8**
br label %11
11: ; preds = %11, %8
%12 = call signext i8 @fscanf(i32* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%13 = call i32 @PassWordsWithPrefixes(i8** %10, i8* %1, i8* %2)
%14 = load i8, i8* @EOF
%15 = icmp eq i8 %12, %14
br i1 %15, label %16, label %11
16: ; preds = %11
%17 = call i32 @fclose(i32* %9)
br label %20
18: ; preds = %3
%19 = tail call i32 @printf(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.2, i64 0, i64 0), i8* %0)
br label %20
20: ; preds = %18, %16
ret void
}