#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*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int freeReference(void *);
int initReference(void **);
int loadReferenceMFASTA(char *, void *);
char *processError(int);
int saveRef(char *, void *);
int /*<<< orphan*/ stderr;
int32_t main(int argc, char *argv[]) {
  void *reference;
  char *refFile = argv[1];
  int error;
  error = initReference(&reference);
  {{if (error){fprintf(stderr, "%s\n", processError(error));
  exit(EXIT_FAILURE);
}
}
}
;
error = loadReferenceMFASTA(refFile, reference);
{{if (error){fprintf(stderr, "%s\n", processError(error));
exit(EXIT_FAILURE);
}
}
}
;
error = saveRef(refFile, reference);
{{if (error){fprintf(stderr, "%s\n", processError(error));
exit(EXIT_FAILURE);
}
}
}
;
error = freeReference(reference);
{{if (error){fprintf(stderr, "%s\n", processError(error));
exit(EXIT_FAILURE);
}
}
}
;
return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
lea    -0x18(%rbp),%rdi
call   1050 <initReference@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     11dc <main+0x6c>
mov    0x2e31(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
call   1080 <processError@plt>
mov    -0x28(%rbp),%edi
mov    %rax,%rdx
lea    0xe37(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2e03(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1070 <loadReferenceMFASTA@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     122a <main+0xba>
mov    0x2de3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x24(%rbp),%edi
call   1080 <processError@plt>
mov    -0x2c(%rbp),%edi
mov    %rax,%rdx
lea    0xde9(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2db5(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <saveRef@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1278 <main+0x108>
mov    0x2d95(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x24(%rbp),%edi
call   1080 <processError@plt>
mov    -0x30(%rbp),%edi
mov    %rax,%rdx
lea    0xd9b(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2d67(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
mov    -0x18(%rbp),%rdi
call   1040 <freeReference@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     12c2 <main+0x152>
mov    0x2d4b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x24(%rbp),%edi
call   1080 <processError@plt>
mov    -0x34(%rbp),%edi
mov    %rax,%rdx
lea    0xd51(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2d1d(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x8(%rsi),%rbx
lea    0x8(%rsp),%rdi
call   1050 <initReference@plt>
test   %eax,%eax
jne    11bf <main+0x4f>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <loadReferenceMFASTA@plt>
test   %eax,%eax
jne    11bf <main+0x4f>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <saveRef@plt>
test   %eax,%eax
jne    11bf <main+0x4f>
mov    0x8(%rsp),%rdi
call   1040 <freeReference@plt>
test   %eax,%eax
jne    11bf <main+0x4f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    0x2e1a(%rip),%rcx
mov    (%rcx),%ebx
mov    %eax,%edi
call   1080 <processError@plt>
lea    0xe2a(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1060 <fprintf@plt>
mov    0x2df1(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
store i8* %11, i8** %7
%12 = call i32 @initReference(i8** %6)
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = load i32, i32* %8
%18 = call i8* @processError(i32 %17)
%19 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = load i32, i32* @EXIT_FAILURE
%21 = call i32 @exit(i32 %20)
unreachable
22: ; preds = %2
%23 = load i8*, i8** %7
%24 = load i8*, i8** %6
%25 = call i32 @loadReferenceMFASTA(i8* %23, i8* %24)
store i32 %25, i32* %8
%26 = load i32, i32* %8
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %35
28: ; preds = %22
%29 = load i32, i32* @stderr
%30 = load i32, i32* %8
%31 = call i8* @processError(i32 %30)
%32 = call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %31)
%33 = load i32, i32* @EXIT_FAILURE
%34 = call i32 @exit(i32 %33)
unreachable
35: ; preds = %22
%36 = load i8*, i8** %7
%37 = load i8*, i8** %6
%38 = call i32 @saveRef(i8* %36, i8* %37)
store i32 %38, i32* %8
%39 = load i32, i32* %8
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %48
41: ; preds = %35
%42 = load i32, i32* @stderr
%43 = load i32, i32* %8
%44 = call i8* @processError(i32 %43)
%45 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %44)
%46 = load i32, i32* @EXIT_FAILURE
%47 = call i32 @exit(i32 %46)
unreachable
48: ; preds = %35
%49 = load i8*, i8** %6
%50 = call i32 @freeReference(i8* %49)
store i32 %50, i32* %8
%51 = load i32, i32* %8
%52 = icmp ne i32 %51, 0
br i1 %52, label %53, label %60
53: ; preds = %48
%54 = load i32, i32* @stderr
%55 = load i32, i32* %8
%56 = call i8* @processError(i32 %55)
%57 = call i32 @fprintf(i32 %54, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %56)
%58 = load i32, i32* @EXIT_FAILURE
%59 = call i32 @exit(i32 %58)
unreachable
60: ; preds = %48
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = call i32 @initReference(i8** %3)
%8 = icmp eq i32 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i8* @processError(i32 %7)
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %3
%17 = call i32 @loadReferenceMFASTA(i8* %6, i8* %16)
%18 = icmp eq i32 %17, 0
br i1 %18, label %25, label %19
19: ; preds = %15
%20 = load i32, i32* @stderr
%21 = call i8* @processError(i32 %17)
%22 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %21)
%23 = load i32, i32* @EXIT_FAILURE
%24 = call i32 @exit(i32 %23)
unreachable
25: ; preds = %15
%26 = load i8*, i8** %3
%27 = call i32 @saveRef(i8* %6, i8* %26)
%28 = icmp eq i32 %27, 0
br i1 %28, label %35, label %29
29: ; preds = %25
%30 = load i32, i32* @stderr
%31 = call i8* @processError(i32 %27)
%32 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %31)
%33 = load i32, i32* @EXIT_FAILURE
%34 = call i32 @exit(i32 %33)
unreachable
35: ; preds = %25
%36 = load i8*, i8** %3
%37 = call i32 @freeReference(i8* %36)
%38 = icmp eq i32 %37, 0
br i1 %38, label %45, label %39
39: ; preds = %35
%40 = load i32, i32* @stderr
%41 = call i8* @processError(i32 %37)
%42 = call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %41)
%43 = load i32, i32* @EXIT_FAILURE
%44 = call i32 @exit(i32 %43)
unreachable
45: ; preds = %35
ret i32 0
}