#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 int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ run_test();
int /*<<< orphan*/ waitpid(int /*<<< orphan*/, int *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  pid_t pid1 = run_test();
  pid_t pid2 = run_test();
  pid_t pid3 = run_test();
  pid_t pid4 = run_test();
  int status;
  waitpid(pid1, &status, 0);
  waitpid(pid2, &status, 0);
  waitpid(pid3, &status, 0);
  waitpid(pid4, &status, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <run_test@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <run_test@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <run_test@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <run_test@plt>
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x24(%rbp),%rsi
xor    %edx,%edx
call   1040 <waitpid@plt>
mov    -0x18(%rbp),%edi
lea    -0x24(%rbp),%rsi
xor    %edx,%edx
call   1040 <waitpid@plt>
mov    -0x1c(%rbp),%edi
lea    -0x24(%rbp),%rsi
xor    %edx,%edx
call   1040 <waitpid@plt>
mov    -0x20(%rbp),%edi
lea    -0x24(%rbp),%rsi
xor    %edx,%edx
call   1040 <waitpid@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <run_test@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <run_test@plt>
mov    %eax,%r12d
xor    %eax,%eax
call   1030 <run_test@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1030 <run_test@plt>
mov    %eax,%r15d
lea    0xc(%rsp),%rbp
mov    %ebx,%edi
mov    %rbp,%rsi
xor    %edx,%edx
call   1040 <waitpid@plt>
mov    %r12d,%edi
mov    %rbp,%rsi
xor    %edx,%edx
call   1040 <waitpid@plt>
mov    %r14d,%edi
mov    %rbp,%rsi
xor    %edx,%edx
call   1040 <waitpid@plt>
mov    %r15d,%edi
mov    %rbp,%rsi
xor    %edx,%edx
call   1040 <waitpid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 (...) @run_test()
store i32 %11, i32* %6
%12 = call i32 (...) @run_test()
store i32 %12, i32* %7
%13 = call i32 (...) @run_test()
store i32 %13, i32* %8
%14 = call i32 (...) @run_test()
store i32 %14, i32* %9
%15 = load i32, i32* %6
%16 = call i32 @waitpid(i32 %15, i32* %10, i32 0)
%17 = load i32, i32* %7
%18 = call i32 @waitpid(i32 %17, i32* %10, i32 0)
%19 = load i32, i32* %8
%20 = call i32 @waitpid(i32 %19, i32* %10, i32 0)
%21 = load i32, i32* %9
%22 = call i32 @waitpid(i32 %21, i32* %10, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = tail call i32 (...) @run_test()
%5 = tail call i32 (...) @run_test()
%6 = tail call i32 (...) @run_test()
%7 = tail call i32 (...) @run_test()
%8 = bitcast i32* %3 to i8*
%9 = call i32 @waitpid(i32 %4, i32* %3, i32 0)
%10 = call i32 @waitpid(i32 %5, i32* %3, i32 0)
%11 = call i32 @waitpid(i32 %6, i32* %3, i32 0)
%12 = call i32 @waitpid(i32 %7, i32* %3, i32 0)
ret i32 0
}