#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_chdir();
int /*<<< orphan*/ test_filename();
int /*<<< orphan*/ test_isfile();
int /*<<< orphan*/ test_macros();
int /*<<< orphan*/ test_nonexistent();
int /*<<< orphan*/ test_readdir();
int /*<<< orphan*/ test_retrieval();
int /*<<< orphan*/ test_rewind();
int /*<<< orphan*/ test_wreaddir();
int /*<<< orphan*/ test_zero();
int main(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  test_macros();
  test_retrieval();
  test_nonexistent();
  test_isfile();
  test_zero();
  test_rewind();
  test_chdir();
  test_filename();
  test_readdir();
  test_wreaddir();
  printf("OK\n");
  return EXIT_SUCCESS;
}


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   1070 <test_macros@plt>
mov    $0x0,%al
call   1080 <test_retrieval@plt>
mov    $0x0,%al
call   1050 <test_nonexistent@plt>
mov    $0x0,%al
call   1030 <test_isfile@plt>
mov    $0x0,%al
call   10d0 <test_zero@plt>
mov    $0x0,%al
call   10a0 <test_rewind@plt>
mov    $0x0,%al
call   10b0 <test_chdir@plt>
mov    $0x0,%al
call   10c0 <test_filename@plt>
mov    $0x0,%al
call   1040 <test_readdir@plt>
mov    $0x0,%al
call   1060 <test_wreaddir@plt>
lea    0xded(%rip),%rdi
call   1090 <printf@plt>
mov    0x2dc1(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <test_macros@plt>
xor    %eax,%eax
call   1090 <test_retrieval@plt>
xor    %eax,%eax
call   1050 <test_nonexistent@plt>
xor    %eax,%eax
call   1030 <test_isfile@plt>
xor    %eax,%eax
call   10d0 <test_zero@plt>
xor    %eax,%eax
call   10a0 <test_rewind@plt>
xor    %eax,%eax
call   10b0 <test_chdir@plt>
xor    %eax,%eax
call   10c0 <test_filename@plt>
xor    %eax,%eax
call   1040 <test_readdir@plt>
xor    %eax,%eax
call   1060 <test_wreaddir@plt>
lea    0xe02(%rip),%rdi
call   1080 <puts@plt>
mov    0x2dd6(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"OK\0A\00"
@EXIT_SUCCESS = global i32 0
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 (...) @test_macros()
%9 = call i32 (...) @test_retrieval()
%10 = call i32 (...) @test_nonexistent()
%11 = call i32 (...) @test_isfile()
%12 = call i32 (...) @test_zero()
%13 = call i32 (...) @test_rewind()
%14 = call i32 (...) @test_chdir()
%15 = call i32 (...) @test_filename()
%16 = call i32 (...) @test_readdir()
%17 = call i32 (...) @test_wreaddir()
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%19 = load i32, i32* @EXIT_SUCCESS
ret i32 %19
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [3 x i8] c"OK\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_macros()
%4 = tail call i32 (...) @test_retrieval()
%5 = tail call i32 (...) @test_nonexistent()
%6 = tail call i32 (...) @test_isfile()
%7 = tail call i32 (...) @test_zero()
%8 = tail call i32 (...) @test_rewind()
%9 = tail call i32 (...) @test_chdir()
%10 = tail call i32 (...) @test_filename()
%11 = tail call i32 (...) @test_readdir()
%12 = tail call i32 (...) @test_wreaddir()
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}