#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*/ execv(char *, char *const *);
scalar_t__ fork();
int main() {
  char *const arg1[] = {"long1", "1", "100", NULL};
  char *const arg2[] = {"long2", "2", "100", NULL};
  char *const arg3[] = {"long3", "3", "100", NULL};
  if (fork() == 0) {
    execv("long1", arg1);
  }
  if (fork() == 0) {
    execv("long2", arg2);
  }
  if (fork() == 0) {
    execv("long3", arg3);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2c8a(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2c87(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2c84(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2c81(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2c7e(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0x2c7b(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0x2c78(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0x2c75(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0x2c72(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0x2c6f(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0x2c6c(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0x2c69(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
cmp    $0x0,%rax
jne    11d4 <main+0xb4>
lea    -0x30(%rbp),%rsi
lea    0xe31(%rip),%rdi
call   1030 <execv@plt>
mov    $0x0,%al
call   1040 <fork@plt>
cmp    $0x0,%rax
jne    11f5 <main+0xd5>
lea    -0x50(%rbp),%rsi
lea    0xe1a(%rip),%rdi
call   1030 <execv@plt>
mov    $0x0,%al
call   1040 <fork@plt>
cmp    $0x0,%rax
jne    1216 <main+0xf6>
lea    -0x70(%rbp),%rsi
lea    0xdff(%rip),%rdi
call   1030 <execv@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
movaps 0x2ca5(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0x2c89(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0x2cad(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0x2c91(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0x2cb5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x2c99(%rip),%xmm0
movaps %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
jne    1188 <main+0x68>
lea    0xe82(%rip),%rdi
lea    0x40(%rsp),%rsi
call   1030 <execv@plt>
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
jne    11a5 <main+0x85>
lea    0xe6f(%rip),%rdi
lea    0x20(%rsp),%rsi
call   1030 <execv@plt>
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
jne    11c0 <main+0xa0>
lea    0xe58(%rip),%rdi
mov    %rsp,%rsi
call   1030 <execv@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"long1\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [4 x i8] c"100\00"
@__const.main.arg1 = [4 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* null]
@.str.3 = [6 x i8] c"long2\00"
@.str.4 = [2 x i8] c"2\00"
@__const.main.arg2 = [4 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* null]
@.str.5 = [6 x i8] c"long3\00"
@.str.6 = [2 x i8] c"3\00"
@__const.main.arg3 = [4 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* null]
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8*]
%3 = alloca [4 x i8*]
%4 = alloca [4 x i8*]
store i32 0, i32* %1
%5 = bitcast [4 x i8*]* %2 to i8*
%6 = bitcast [4 x i8*]* %3 to i8*
%7 = bitcast [4 x i8*]* %4 to i8*
%8 = call i64 (...) @fork()
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 0
%12 = call i32 @execv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %11)
br label %13
13: ; preds = %10, %0
%14 = call i64 (...) @fork()
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 0
%18 = call i32 @execv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %17)
br label %19
19: ; preds = %16, %13
%20 = call i64 (...) @fork()
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = getelementptr inbounds [4 x i8*], [4 x i8*]* %4, i64 0, i64 0
%24 = call i32 @execv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8** %23)
br label %25
25: ; preds = %22, %19
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"long1\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [4 x i8] c"100\00"
@__const.main.arg1 = [4 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* null]
@.str.3 = [6 x i8] c"long2\00"
@.str.4 = [2 x i8] c"2\00"
@__const.main.arg2 = [4 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* null]
@.str.5 = [6 x i8] c"long3\00"
@.str.6 = [2 x i8] c"3\00"
@__const.main.arg3 = [4 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* null]
define i32 @main() {
%1 = alloca [4 x i8*]
%2 = alloca [4 x i8*]
%3 = alloca [4 x i8*]
%4 = bitcast [4 x i8*]* %1 to i8*
%5 = bitcast [4 x i8*]* %2 to i8*
%6 = bitcast [4 x i8*]* %3 to i8*
%7 = tail call i64 (...) @fork()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%11 = call i32 @execv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %10)
br label %12
12: ; preds = %9, %0
%13 = call i64 (...) @fork()
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 0
%17 = call i32 @execv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %16)
br label %18
18: ; preds = %15, %12
%19 = call i64 (...) @fork()
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 0
%23 = call i32 @execv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8** %22)
br label %24
24: ; preds = %21, %18
ret i32 0
}