#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*/ TEST_BEGIN();
int /*<<< orphan*/ TEST_END();
int doErrorTest();
int doFunctionalTest();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fillPatternBuffer();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ unlink(char *);
int main(int argc, char **argv) {
  TEST_BEGIN();
  if (fillPatternBuffer() != 1) {
    puts("Error filling pattern buffer");
    exit(0);
  }
  if (doErrorTest() != 1) {
    puts("Error during error test!!!!");
    exit(0);
  }
  if (doFunctionalTest() != 1) {
    puts("Error during functional test!!!!");
    exit(0);
  }
  unlink("testfile1.tst");
  TEST_END();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <TEST_BEGIN@plt>
mov    $0x0,%al
call   10a0 <fillPatternBuffer@plt>
cmp    $0x1,%eax
je     11c0 <main+0x40>
lea    0xe4c(%rip),%rdi
call   1050 <puts@plt>
xor    %edi,%edi
call   1080 <exit@plt>
mov    $0x0,%al
call   1060 <doErrorTest@plt>
cmp    $0x1,%eax
je     11e3 <main+0x63>
lea    0xe46(%rip),%rdi
call   1050 <puts@plt>
xor    %edi,%edi
call   1080 <exit@plt>
mov    $0x0,%al
call   1070 <doFunctionalTest@plt>
cmp    $0x1,%eax
je     1206 <main+0x86>
lea    0xe3f(%rip),%rdi
call   1050 <puts@plt>
xor    %edi,%edi
call   1080 <exit@plt>
lea    0xe4d(%rip),%rdi
call   1040 <unlink@plt>
mov    $0x0,%al
call   1090 <TEST_END@plt>
xor    %edi,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <TEST_BEGIN@plt>
xor    %eax,%eax
call   10a0 <fillPatternBuffer@plt>
cmp    $0x1,%eax
jne    11c6 <main+0x46>
xor    %eax,%eax
call   1060 <doErrorTest@plt>
cmp    $0x1,%eax
jne    11cf <main+0x4f>
xor    %eax,%eax
call   1070 <doFunctionalTest@plt>
cmp    $0x1,%eax
jne    11d8 <main+0x58>
lea    0xea7(%rip),%rdi
call   1040 <unlink@plt>
xor    %eax,%eax
call   1090 <TEST_END@plt>
xor    %edi,%edi
call   1080 <exit@plt>
lea    0xe33(%rip),%rdi
jmp    11df <main+0x5f>
lea    0xe47(%rip),%rdi
jmp    11df <main+0x5f>
lea    0xe5a(%rip),%rdi
call   1050 <puts@plt>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Error filling pattern buffer\00"
@.str.1 = [28 x i8] c"Error during error test!!!!\00"
@.str.2 = [33 x i8] c"Error during functional test!!!!\00"
@.str.3 = [14 x i8] c"testfile1.tst\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @TEST_BEGIN()
%7 = call i32 (...) @fillPatternBuffer()
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %2
%13 = call i32 (...) @doErrorTest()
%14 = icmp ne i32 %13, 1
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @exit(i32 0)
unreachable
18: ; preds = %12
%19 = call i32 (...) @doFunctionalTest()
%20 = icmp ne i32 %19, 1
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = call i32 @puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%23 = call i32 @exit(i32 0)
unreachable
24: ; preds = %18
%25 = call i32 @unlink(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%26 = call i32 (...) @TEST_END()
%27 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [29 x i8] c"Error filling pattern buffer\00"
@.str.1 = [28 x i8] c"Error during error test!!!!\00"
@.str.2 = [33 x i8] c"Error during functional test!!!!\00"
@.str.3 = [14 x i8] c"testfile1.tst\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @TEST_BEGIN()
%4 = tail call i32 (...) @fillPatternBuffer()
%5 = icmp eq i32 %4, 1
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %2
%10 = tail call i32 (...) @doErrorTest()
%11 = icmp eq i32 %10, 1
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%14 = tail call i32 @exit(i32 0)
unreachable
15: ; preds = %9
%16 = tail call i32 (...) @doFunctionalTest()
%17 = icmp eq i32 %16, 1
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%20 = tail call i32 @exit(i32 0)
unreachable
21: ; preds = %15
%22 = tail call i32 @unlink(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%23 = tail call i32 (...) @TEST_END()
%24 = tail call i32 @exit(i32 0)
unreachable
}