#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*/ printf(char *);
int /*<<< orphan*/ runtest(char *, char *);
int main(int argc, char *argv[]) {
  printf("1..45\n");
  runtest("/dev/null", "r");
  runtest("/dev/null", "r+");
  runtest("/dev/null", "w");
  runtest("/dev/null", "w+");
  runtest("/dev/null", "a");
  runtest("/dev/null", "a+");
  runtest("/dev/null", "re");
  runtest("/dev/null", "r+e");
  runtest("/dev/null", "we");
  runtest("/dev/null", "w+e");
  runtest("/dev/null", "ae");
  runtest("/dev/null", "a+e");
  runtest("/dev/null", "re+");
  runtest("/dev/null", "we+");
  runtest("/dev/null", "ae+");
  return 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)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    0xec1(%rip),%rsi
call   1040 <runtest@plt>
lea    0xeab(%rip),%rdi
lea    0xeb0(%rip),%rsi
call   1040 <runtest@plt>
lea    0xe98(%rip),%rdi
lea    0xea0(%rip),%rsi
call   1040 <runtest@plt>
lea    0xe85(%rip),%rdi
lea    0xe8f(%rip),%rsi
call   1040 <runtest@plt>
lea    0xe72(%rip),%rdi
lea    0xe7f(%rip),%rsi
call   1040 <runtest@plt>
lea    0xe5f(%rip),%rdi
lea    0xe6e(%rip),%rsi
call   1040 <runtest@plt>
lea    0xe4c(%rip),%rdi
lea    0xe5e(%rip),%rsi
call   1040 <runtest@plt>
lea    0xe39(%rip),%rdi
lea    0xe4e(%rip),%rsi
call   1040 <runtest@plt>
lea    0xe26(%rip),%rdi
lea    0xe3f(%rip),%rsi
call   1040 <runtest@plt>
lea    0xe13(%rip),%rdi
lea    0xe2f(%rip),%rsi
call   1040 <runtest@plt>
lea    0xe00(%rip),%rdi
lea    0xe20(%rip),%rsi
call   1040 <runtest@plt>
lea    0xded(%rip),%rdi
lea    0xe10(%rip),%rsi
call   1040 <runtest@plt>
lea    0xdda(%rip),%rdi
lea    0xe01(%rip),%rsi
call   1040 <runtest@plt>
lea    0xdc7(%rip),%rdi
lea    0xdf2(%rip),%rsi
call   1040 <runtest@plt>
lea    0xdb4(%rip),%rdi
lea    0xde3(%rip),%rsi
call   1040 <runtest@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf12(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rbx
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
call   1040 <runtest@plt>
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
call   1040 <runtest@plt>
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdi
call   1040 <runtest@plt>
lea    0xea9(%rip),%rsi
mov    %rbx,%rdi
call   1040 <runtest@plt>
lea    0xe9d(%rip),%rsi
mov    %rbx,%rdi
call   1040 <runtest@plt>
lea    0xe90(%rip),%rsi
mov    %rbx,%rdi
call   1040 <runtest@plt>
lea    0xe84(%rip),%rsi
mov    %rbx,%rdi
call   1040 <runtest@plt>
lea    0xe78(%rip),%rsi
mov    %rbx,%rdi
call   1040 <runtest@plt>
lea    0xe6d(%rip),%rsi
mov    %rbx,%rdi
call   1040 <runtest@plt>
lea    0xe61(%rip),%rsi
mov    %rbx,%rdi
call   1040 <runtest@plt>
lea    0xe56(%rip),%rsi
mov    %rbx,%rdi
call   1040 <runtest@plt>
lea    0xe4a(%rip),%rsi
mov    %rbx,%rdi
call   1040 <runtest@plt>
lea    0xe3f(%rip),%rsi
mov    %rbx,%rdi
call   1040 <runtest@plt>
lea    0xe34(%rip),%rsi
mov    %rbx,%rdi
call   1040 <runtest@plt>
lea    0xe29(%rip),%rsi
mov    %rbx,%rdi
call   1040 <runtest@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"1..45\0A\00"
@.str.1 = [10 x i8] c"/dev/null\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [3 x i8] c"r+\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [3 x i8] c"w+\00"
@.str.6 = [2 x i8] c"a\00"
@.str.7 = [3 x i8] c"a+\00"
@.str.8 = [3 x i8] c"re\00"
@.str.9 = [4 x i8] c"r+e\00"
@.str.10 = [3 x i8] c"we\00"
@.str.11 = [4 x i8] c"w+e\00"
@.str.12 = [3 x i8] c"ae\00"
@.str.13 = [4 x i8] c"a+e\00"
@.str.14 = [4 x i8] c"re+\00"
@.str.15 = [4 x i8] c"we+\00"
@.str.16 = [4 x i8] c"ae+\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 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%12 = call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%13 = call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%14 = call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%15 = call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%16 = call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%17 = call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%18 = call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%19 = call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%20 = call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%21 = call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"/dev/null\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [3 x i8] c"r+\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [3 x i8] c"w+\00"
@.str.6 = [2 x i8] c"a\00"
@.str.7 = [3 x i8] c"a+\00"
@.str.8 = [3 x i8] c"re\00"
@.str.9 = [4 x i8] c"r+e\00"
@.str.10 = [3 x i8] c"we\00"
@.str.11 = [4 x i8] c"w+e\00"
@.str.12 = [3 x i8] c"ae\00"
@.str.13 = [4 x i8] c"a+e\00"
@.str.14 = [4 x i8] c"re+\00"
@.str.15 = [4 x i8] c"we+\00"
@.str.16 = [4 x i8] c"ae+\00"
@str = [6 x i8] c"1..45\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%8 = tail call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%9 = tail call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%10 = tail call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%11 = tail call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%12 = tail call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%13 = tail call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%14 = tail call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%15 = tail call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%16 = tail call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%17 = tail call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%18 = tail call i32 @runtest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
ret i32 0
}