#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*/ access_filesystem();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ unaddr_finit_module();
int /*<<< orphan*/ unaddr_open();
int /*<<< orphan*/ unaddr_process_vm_readv_writev(int);
int /*<<< orphan*/ unaddr_uninit_execve();
int /*<<< orphan*/ uninit_finit_module(int);
int /*<<< orphan*/ uninit_open(int);
int /*<<< orphan*/ wild_open();
int main(void) {
  access_filesystem();
  unaddr_open();
  wild_open();
  uninit_open(1);
  uninit_open(0);
  unaddr_finit_module();
  uninit_finit_module(0);
  uninit_finit_module(1);
  unaddr_uninit_execve();
  unaddr_process_vm_readv_writev(1);
  unaddr_process_vm_readv_writev(0);
  printf("done\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1080 <access_filesystem@plt>
mov    $0x0,%al
call   10a0 <unaddr_open@plt>
mov    $0x0,%al
call   1050 <wild_open@plt>
mov    $0x1,%edi
call   1060 <uninit_open@plt>
xor    %edi,%edi
call   1060 <uninit_open@plt>
mov    $0x0,%al
call   1030 <unaddr_finit_module@plt>
xor    %edi,%edi
call   1090 <uninit_finit_module@plt>
mov    $0x1,%edi
call   1090 <uninit_finit_module@plt>
mov    $0x0,%al
call   1070 <unaddr_uninit_execve@plt>
mov    $0x1,%edi
call   10b0 <unaddr_process_vm_readv_writev@plt>
xor    %edi,%edi
call   10b0 <unaddr_process_vm_readv_writev@plt>
lea    0xe04(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <access_filesystem@plt>
xor    %eax,%eax
call   10a0 <unaddr_open@plt>
xor    %eax,%eax
call   1050 <wild_open@plt>
mov    $0x1,%edi
call   1060 <uninit_open@plt>
xor    %edi,%edi
call   1060 <uninit_open@plt>
xor    %eax,%eax
call   1040 <unaddr_finit_module@plt>
xor    %edi,%edi
call   1090 <uninit_finit_module@plt>
mov    $0x1,%edi
call   1090 <uninit_finit_module@plt>
xor    %eax,%eax
call   1070 <unaddr_uninit_execve@plt>
mov    $0x1,%edi
call   10b0 <unaddr_process_vm_readv_writev@plt>
xor    %edi,%edi
call   10b0 <unaddr_process_vm_readv_writev@plt>
lea    0xe12(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"done\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @access_filesystem()
%3 = call i32 (...) @unaddr_open()
%4 = call i32 (...) @wild_open()
%5 = call i32 @uninit_open(i32 1)
%6 = call i32 @uninit_open(i32 0)
%7 = call i32 (...) @unaddr_finit_module()
%8 = call i32 @uninit_finit_module(i32 0)
%9 = call i32 @uninit_finit_module(i32 1)
%10 = call i32 (...) @unaddr_uninit_execve()
%11 = call i32 @unaddr_process_vm_readv_writev(i32 1)
%12 = call i32 @unaddr_process_vm_readv_writev(i32 0)
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [5 x i8] c"done\00"
define i32 @main() {
%1 = tail call i32 (...) @access_filesystem()
%2 = tail call i32 (...) @unaddr_open()
%3 = tail call i32 (...) @wild_open()
%4 = tail call i32 @uninit_open(i32 1)
%5 = tail call i32 @uninit_open(i32 0)
%6 = tail call i32 (...) @unaddr_finit_module()
%7 = tail call i32 @uninit_finit_module(i32 0)
%8 = tail call i32 @uninit_finit_module(i32 1)
%9 = tail call i32 (...) @unaddr_uninit_execve()
%10 = tail call i32 @unaddr_process_vm_readv_writev(i32 1)
%11 = tail call i32 @unaddr_process_vm_readv_writev(i32 0)
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}