#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 */
scalar_t__ bigtest(unsigned int);
scalar_t__ failtest(unsigned int);
unsigned int get_attributes(int, char **);
int /*<<< orphan*/ printf(char *);
scalar_t__ smalltest(unsigned int);
int main(int argc, char *argv[]) {
  unsigned int attributes = get_attributes(argc, argv);
  if (bigtest(attributes))
    printf("Big test OK\n\n");
  if (smalltest(attributes))
    printf("Small test OK\n\n");
  if (failtest(attributes))
    printf("Fail test OK\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <get_attributes@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1070 <bigtest@plt>
cmp    $0x0,%rax
je     1193 <main+0x43>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
call   1040 <smalltest@plt>
cmp    $0x0,%rax
je     11b1 <main+0x61>
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
call   1050 <failtest@plt>
cmp    $0x0,%rax
je     11cf <main+0x7f>
lea    0xe54(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1060 <get_attributes@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1070 <bigtest@plt>
test   %rax,%rax
je     1170 <main+0x20>
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <smalltest@plt>
test   %rax,%rax
je     1188 <main+0x38>
lea    0xe8a(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1050 <failtest@plt>
test   %rax,%rax
je     11a0 <main+0x50>
lea    0xe65(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Big test OK\0A\0A\00"
@.str.1 = [16 x i8] c"Small test OK\0A\0A\00"
@.str.2 = [14 x i8] c"Fail test OK\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @get_attributes(i32 %7, i8** %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = call i64 @bigtest(i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
%16 = load i32, i32* %6
%17 = call i64 @smalltest(i32 %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %19, %15
%22 = load i32, i32* %6
%23 = call i64 @failtest(i32 %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %27
27: ; preds = %25, %21
ret i32 1
}

LLVM IR (-O2):
@str = [13 x i8] c"Fail test OK\00"
@str.3 = [15 x i8] c"Small test OK\0A\00"
@str.4 = [13 x i8] c"Big test OK\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @get_attributes(i32 %0, i8** %1)
%4 = tail call i64 @bigtest(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.4, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
%9 = tail call i64 @smalltest(i32 %3)
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.3, i64 0, i64 0))
br label %13
13: ; preds = %11, %8
%14 = tail call i64 @failtest(i32 %3)
%15 = icmp eq i64 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %13
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %18
18: ; preds = %16, %13
ret i32 1
}