#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*/ F_OK;
int access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void assert_test_existence(void) {
  if (access("hello", F_OK) == -1) {
    fprintf(stderr, "Hello world binary does not exist.\n");
    exit(1);
  } else if (access("rot13", F_OK) == -1) {
    fprintf(stderr, "rot13 binary does not exist.\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<assert_test_existence>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
lea    0xebc(%rip),%rdi
call   1040 <access@plt>
cmp    $0xffffffff,%eax
jne    1171 <assert_test_existence+0x41>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%esi
lea    0xea9(%rip),%rdi
call   1040 <access@plt>
cmp    $0xffffffff,%eax
jne    11ae <assert_test_existence+0x7e>
mov    0x2e4a(%rip),%rax
mov    (%rax),%edi
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    11b3 <assert_test_existence+0x83>
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_test_existence>:
push   %rbx
mov    0x2e98(%rip),%rbx
mov    (%rbx),%esi
lea    0xebf(%rip),%rdi
call   1040 <access@plt>
cmp    $0xffffffff,%eax
je     1160 <assert_test_existence+0x30>
mov    (%rbx),%esi
lea    0xed6(%rip),%rdi
call   1040 <access@plt>
cmp    $0xffffffff,%eax
je     1172 <assert_test_existence+0x42>
pop    %rbx
ret
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe96(%rip),%rsi
jmp    1182 <assert_test_existence+0x52>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@F_OK = global i32 0
@stderr = global i32 0
@.str.1 = [36 x i8] c"Hello world binary does not exist.\0A\00"
@.str.2 = [6 x i8] c"rot13\00"
@.str.3 = [30 x i8] c"rot13 binary does not exist.\0A\00"
define void @assert_test_existence() {
%1 = load i32, i32* @F_OK
%2 = call i32 @access(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = load i32, i32* @F_OK
%10 = call i32 @access(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %8
br label %17
17: ; preds = %16
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@F_OK = global i32 0
@stderr = global i32 0
@.str.1 = [36 x i8] c"Hello world binary does not exist.\0A\00"
@.str.2 = [6 x i8] c"rot13\00"
@.str.3 = [30 x i8] c"rot13 binary does not exist.\0A\00"
define void @assert_test_existence() {
%1 = load i32, i32* @F_OK
%2 = tail call i32 @access(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = load i32, i32* @F_OK
%10 = tail call i32 @access(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i32, i32* @stderr
%14 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%15 = tail call i32 @exit(i32 1)
unreachable
16: ; preds = %8
ret void
}