#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*/ exit(int);
int /*<<< orphan*/ test0();
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3();
int /*<<< orphan*/ test4();
int /*<<< orphan*/ test5();
int /*<<< orphan*/ test6();
int /*<<< orphan*/ write(int, char *, int);
void __fn_basic_tests(int r) {
  write(1,
        "\nIt seams that the 'fork()' wrapper is ok...\n"
        "\n--- STARTING BASIC TESTS ---\n",
        sizeof("\nIt seams that the 'fork()' wrapper is ok...\n"
               "\n--- STARTING BASIC TESTS ---\n") -
            1);
  if (r & 0x0001)
    test0();
  if (r & 0x0002)
    test1();
  if (r & 0x0004)
    test2();
  if (r & 0x0008)
    test3();
  if (r & 0x0010)
    test4();
  if (r & 0x0020)
    test5();
  if (r & 0x0040)
    test6();
  exit(42);
}


x86 assembly (clang, -O0):
<__fn_basic_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
lea    0xe59(%rip),%rsi
mov    $0x4b,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     11c7 <__fn_basic_tests+0x37>
mov    $0x0,%al
call   1080 <test0@plt>
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     11dd <__fn_basic_tests+0x4d>
mov    $0x0,%al
call   1060 <test1@plt>
mov    -0x4(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     11f3 <__fn_basic_tests+0x63>
mov    $0x0,%al
call   10a0 <test2@plt>
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1209 <__fn_basic_tests+0x79>
mov    $0x0,%al
call   1050 <test3@plt>
mov    -0x4(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     121f <__fn_basic_tests+0x8f>
mov    $0x0,%al
call   1090 <test4@plt>
mov    -0x4(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     1235 <__fn_basic_tests+0xa5>
mov    $0x0,%al
call   1040 <test5@plt>
mov    -0x4(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     124b <__fn_basic_tests+0xbb>
mov    $0x0,%al
call   1070 <test6@plt>
mov    $0x2a,%edi
call   10b0 <exit@plt>

x86 assembly (clang, -O2):
<__fn_basic_tests>:
push   %rbx
mov    %edi,%ebx
lea    0xe66(%rip),%rsi
mov    $0x1,%edi
mov    $0x4b,%edx
call   1030 <write@plt>
test   $0x1,%bl
jne    11d6 <__fn_basic_tests+0x46>
test   $0x2,%bl
jne    11e2 <__fn_basic_tests+0x52>
test   $0x4,%bl
jne    11ee <__fn_basic_tests+0x5e>
test   $0x8,%bl
jne    11fa <__fn_basic_tests+0x6a>
test   $0x10,%bl
jne    1206 <__fn_basic_tests+0x76>
test   $0x20,%bl
jne    1212 <__fn_basic_tests+0x82>
test   $0x40,%bl
jne    121e <__fn_basic_tests+0x8e>
mov    $0x2a,%edi
call   10b0 <exit@plt>
xor    %eax,%eax
call   1080 <test0@plt>
test   $0x2,%bl
je     11b3 <__fn_basic_tests+0x23>
xor    %eax,%eax
call   1060 <test1@plt>
test   $0x4,%bl
je     11b8 <__fn_basic_tests+0x28>
xor    %eax,%eax
call   10a0 <test2@plt>
test   $0x8,%bl
je     11bd <__fn_basic_tests+0x2d>
xor    %eax,%eax
call   1050 <test3@plt>
test   $0x10,%bl
je     11c2 <__fn_basic_tests+0x32>
xor    %eax,%eax
call   1090 <test4@plt>
test   $0x20,%bl
je     11c7 <__fn_basic_tests+0x37>
xor    %eax,%eax
call   1040 <test5@plt>
test   $0x40,%bl
je     11cc <__fn_basic_tests+0x3c>
xor    %eax,%eax
call   1070 <test6@plt>
mov    $0x2a,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [76 x i8] c"\0AIt seams that the 'fork()' wrapper is ok...\0A\0A--- STARTING BASIC TESTS ---\0A\00"
define void @__fn_basic_tests(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 75)
%4 = load i32, i32* %2
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @test0()
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
%11 = and i32 %10, 2
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 (...) @test1()
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %2
%17 = and i32 %16, 4
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 (...) @test2()
br label %21
21: ; preds = %19, %15
%22 = load i32, i32* %2
%23 = and i32 %22, 8
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = call i32 (...) @test3()
br label %27
27: ; preds = %25, %21
%28 = load i32, i32* %2
%29 = and i32 %28, 16
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = call i32 (...) @test4()
br label %33
33: ; preds = %31, %27
%34 = load i32, i32* %2
%35 = and i32 %34, 32
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = call i32 (...) @test5()
br label %39
39: ; preds = %37, %33
%40 = load i32, i32* %2
%41 = and i32 %40, 64
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = call i32 (...) @test6()
br label %45
45: ; preds = %43, %39
%46 = call i32 @exit(i32 42)
unreachable
}

LLVM IR (-O2):
@.str = [76 x i8] c"\0AIt seams that the 'fork()' wrapper is ok...\0A\0A--- STARTING BASIC TESTS ---\0A\00"
define void @__fn_basic_tests(i32 %0) {
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 75)
%3 = and i32 %0, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @test0()
br label %7
7: ; preds = %5, %1
%8 = and i32 %0, 2
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 (...) @test1()
br label %12
12: ; preds = %10, %7
%13 = and i32 %0, 4
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = tail call i32 (...) @test2()
br label %17
17: ; preds = %15, %12
%18 = and i32 %0, 8
%19 = icmp eq i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = tail call i32 (...) @test3()
br label %22
22: ; preds = %20, %17
%23 = and i32 %0, 16
%24 = icmp eq i32 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = tail call i32 (...) @test4()
br label %27
27: ; preds = %25, %22
%28 = and i32 %0, 32
%29 = icmp eq i32 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %27
%31 = tail call i32 (...) @test5()
br label %32
32: ; preds = %30, %27
%33 = and i32 %0, 64
%34 = icmp eq i32 %33, 0
br i1 %34, label %37, label %35
35: ; preds = %32
%36 = tail call i32 (...) @test6()
br label %37
37: ; preds = %35, %32
%38 = tail call i32 @exit(i32 42)
unreachable
}