#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*/ closeit();
int /*<<< orphan*/ dobadreads();
int /*<<< orphan*/ doreadat0();
int /*<<< orphan*/ doreadateof();
int /*<<< orphan*/ firstread();
int /*<<< orphan*/ openit();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ readallonebyone();
int /*<<< orphan*/ readallrandomly();
int /*<<< orphan*/ readateof();
void dotest(void) {
  printf("Opening directory...\n");
  openit();
  printf("Running tests...\n");
  firstread();
  readateof();
  readallonebyone();
  doreadateof();
  readallrandomly();
  doreadat0();
  dobadreads();
  doreadat0();
  printf("Closing directory...\n");
  closeit();
}


x86 assembly (clang, -O0):
<dotest>:
push   %rbp
mov    %rsp,%rbp
lea    0xe55(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   10a0 <openit@plt>
lea    0xe58(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1070 <firstread@plt>
mov    $0x0,%al
call   1040 <readateof@plt>
mov    $0x0,%al
call   1090 <readallonebyone@plt>
mov    $0x0,%al
call   1080 <doreadateof@plt>
mov    $0x0,%al
call   10c0 <readallrandomly@plt>
mov    $0x0,%al
call   1030 <doreadat0@plt>
mov    $0x0,%al
call   1050 <dobadreads@plt>
mov    $0x0,%al
call   1030 <doreadat0@plt>
lea    0xe26(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   10b0 <closeit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotest>:
push   %rax
lea    0xe58(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   10a0 <openit@plt>
lea    0xe5a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <firstread@plt>
xor    %eax,%eax
call   1050 <readateof@plt>
xor    %eax,%eax
call   1090 <readallonebyone@plt>
xor    %eax,%eax
call   1080 <doreadateof@plt>
xor    %eax,%eax
call   10c0 <readallrandomly@plt>
xor    %eax,%eax
call   1040 <doreadat0@plt>
xor    %eax,%eax
call   1060 <dobadreads@plt>
xor    %eax,%eax
call   1040 <doreadat0@plt>
lea    0xe27(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    10b0 <closeit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Opening directory...\0A\00"
@.str.1 = [18 x i8] c"Running tests...\0A\00"
@.str.2 = [22 x i8] c"Closing directory...\0A\00"
define void @dotest() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @openit()
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @firstread()
%5 = call i32 (...) @readateof()
%6 = call i32 (...) @readallonebyone()
%7 = call i32 (...) @doreadateof()
%8 = call i32 (...) @readallrandomly()
%9 = call i32 (...) @doreadat0()
%10 = call i32 (...) @dobadreads()
%11 = call i32 (...) @doreadat0()
%12 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 (...) @closeit()
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"Opening directory...\00"
@str.3 = [17 x i8] c"Running tests...\00"
@str.4 = [21 x i8] c"Closing directory...\00"
define void @dotest() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @openit()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 (...) @firstread()
%5 = tail call i32 (...) @readateof()
%6 = tail call i32 (...) @readallonebyone()
%7 = tail call i32 (...) @doreadateof()
%8 = tail call i32 (...) @readallrandomly()
%9 = tail call i32 (...) @doreadat0()
%10 = tail call i32 (...) @dobadreads()
%11 = tail call i32 (...) @doreadat0()
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.4, i64 0, i64 0))
%13 = tail call i32 (...) @closeit()
ret void
}