#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 */
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ run_adviser();
int /*<<< orphan*/ run_weeder_tfbs(char *, char *, char *, char *);
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
void run_small_analysis() {
  pid_t pid = fork();
  if (pid == 0)
    run_weeder_tfbs("-W", "6", "-e", "1");
  else {
    wait(NULL);
    pid = fork();
    if (pid == 0)
      run_weeder_tfbs("-W", "8", "-e", "2");
    else
      run_adviser();
  }
}


x86 assembly (clang, -O0):
<run_small_analysis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <fork@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1184 <run_small_analysis+0x44>
lea    0xe9b(%rip),%rdi
lea    0xe97(%rip),%rsi
lea    0xe92(%rip),%rdx
lea    0xe8e(%rip),%rcx
call   1030 <run_weeder_tfbs@plt>
jmp    11d5 <run_small_analysis+0x95>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <wait@plt>
mov    $0x0,%al
call   1060 <fork@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    11c9 <run_small_analysis+0x89>
lea    0xe56(%rip),%rdi
lea    0xe59(%rip),%rsi
lea    0xe4d(%rip),%rdx
lea    0xe4d(%rip),%rcx
call   1030 <run_weeder_tfbs@plt>
jmp    11d0 <run_small_analysis+0x90>
mov    $0x0,%al
call   1040 <run_adviser@plt>
jmp    11d5 <run_small_analysis+0x95>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_small_analysis>:
push   %rax
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
je     1168 <run_small_analysis+0x28>
xor    %edi,%edi
call   1050 <wait@plt>
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
je     118a <run_small_analysis+0x4a>
xor    %eax,%eax
pop    %rcx
jmp    1040 <run_adviser@plt>
lea    0xe91(%rip),%rdi
lea    0xe8d(%rip),%rsi
lea    0xe88(%rip),%rdx
lea    0xe84(%rip),%rcx
pop    %rax
jmp    1030 <run_weeder_tfbs@plt>
lea    0xe6f(%rip),%rdi
lea    0xe72(%rip),%rsi
lea    0xe66(%rip),%rdx
lea    0xe66(%rip),%rcx
pop    %rax
jmp    1030 <run_weeder_tfbs@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"-W\00"
@.str.1 = [2 x i8] c"6\00"
@.str.2 = [3 x i8] c"-e\00"
@.str.3 = [2 x i8] c"1\00"
@.str.4 = [2 x i8] c"8\00"
@.str.5 = [2 x i8] c"2\00"
define void @run_small_analysis() {
%1 = alloca i64
%2 = call i64 (...) @fork()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @run_weeder_tfbs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %17
7: ; preds = %0
%8 = call i32 @wait(i32* null)
%9 = call i64 (...) @fork()
store i64 %9, i64* %1
%10 = load i64, i64* %1
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = call i32 @run_weeder_tfbs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %16
14: ; preds = %7
%15 = call i32 (...) @run_adviser()
br label %16
16: ; preds = %14, %12
br label %17
17: ; preds = %16, %5
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"-W\00"
@.str.1 = [2 x i8] c"6\00"
@.str.2 = [3 x i8] c"-e\00"
@.str.3 = [2 x i8] c"1\00"
@.str.4 = [2 x i8] c"8\00"
@.str.5 = [2 x i8] c"2\00"
define void @run_small_analysis() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @run_weeder_tfbs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %13
5: ; preds = %0
%6 = tail call i32 @wait(i32* null)
%7 = tail call i64 (...) @fork()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 @run_weeder_tfbs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %13
11: ; preds = %5
%12 = tail call i32 (...) @run_adviser()
br label %13
13: ; preds = %9, %11, %3
ret void
}