#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 failtest(unsigned int);
unsigned int get_attributes(int, char **);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ proteintest(unsigned int);
int main(int argc, char *argv[]) {
  unsigned int attributes = get_attributes(argc, argv);
  if (proteintest(attributes))
    printf("Test OK\n\n");
  int fail_retval = failtest(attributes);
  if (fail_retval)
    printf("Fail test OK (sequence %d)\n", fail_retval);
  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   1050 <get_attributes@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1060 <proteintest@plt>
cmp    $0x0,%rax
je     1185 <main+0x45>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
call   1040 <failtest@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     11ab <main+0x6b>
mov    -0x18(%rbp),%esi
lea    0xe66(%rip),%rdi
mov    $0x0,%al
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 <proteintest@plt>
test   %rax,%rax
je     1170 <main+0x20>
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1050 <failtest@plt>
test   %eax,%eax
je     118b <main+0x3b>
lea    0xe7e(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str.1 = [28 x i8] c"Fail test OK (sequence %d)\0A\00"
@str = [9 x i8] c"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 @proteintest(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 ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
%9 = tail call i32 @failtest(i32 %3)
%10 = icmp eq i32 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %13
13: ; preds = %11, %8
ret i32 1
}