#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*/ e(int);
int /*<<< orphan*/ execv(char *, char **);
scalar_t__ fork();
int /*<<< orphan*/ wait(int *);
test111() {
  int n;
  char *argv[5];
  if (fork()) {
    wait(&n);
    if (n != (75 << 8))
      e(20);
  } else {
    argv[0] = "t11b";
    argv[1] = "abc";
    argv[2] = "defghi";
    argv[3] = "j";
    argv[4] = 0;
    execv("t11b", argv);
    e(19);
  }
}


x86 assembly (clang, -O0):
<test111>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1060 <fork@plt>
cmp    $0x0,%rax
je     117e <test111+0x3e>
lea    -0x8(%rbp),%rdi
call   1040 <wait@plt>
cmpl   $0x4b00,-0x8(%rbp)
je     1179 <test111+0x39>
mov    $0x14,%edi
call   1030 <e@plt>
jmp    11cc <test111+0x8c>
lea    0xe7b(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe75(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe6e(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe6a(%rip),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xe43(%rip),%rdi
call   1050 <execv@plt>
mov    $0x13,%edi
call   1030 <e@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test111>:
sub    $0x28,%rsp
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
je     116b <test111+0x2b>
mov    %rsp,%rdi
call   1040 <wait@plt>
mov    $0x14,%edi
cmpl   $0x4b00,(%rsp)
jne    11b0 <test111+0x70>
add    $0x28,%rsp
ret
lea    0xe8e(%rip),%rdi
mov    %rdi,(%rsp)
lea    0xe88(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xe80(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xe7b(%rip),%rax
mov    %rax,0x18(%rsp)
movq   $0x0,0x20(%rsp)
mov    %rsp,%rsi
call   1050 <execv@plt>
mov    $0x13,%edi
call   1030 <e@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"t11b\00"
@.str.1 = [4 x i8] c"abc\00"
@.str.2 = [7 x i8] c"defghi\00"
@.str.3 = [2 x i8] c"j\00"
define i32 @test111() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [5 x i8*]
%4 = call i64 (...) @fork()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = call i32 @wait(i32* %2)
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 19200
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = call i32 @e(i32 20)
br label %12
12: ; preds = %10, %6
br label %22
13: ; preds = %0
%14 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %14
%15 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %15
%16 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %16
%17 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 3
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8** %17
%18 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 4
store i8* null, i8** %18
%19 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 0
%20 = call i32 @execv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %19)
%21 = call i32 @e(i32 19)
br label %22
22: ; preds = %13, %12
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str = [5 x i8] c"t11b\00"
@.str.1 = [4 x i8] c"abc\00"
@.str.2 = [7 x i8] c"defghi\00"
@.str.3 = [2 x i8] c"j\00"
define i32 @test111() {
%1 = alloca i32
%2 = alloca [5 x i8*]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [5 x i8*]* %2 to i8*
%5 = tail call i64 (...) @fork()
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %0
%8 = call i32 @wait(i32* %1)
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, 19200
br i1 %10, label %21, label %18
11: ; preds = %0
%12 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %12
%13 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %13
%14 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %14
%15 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 3
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8** %15
%16 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 4
store i8* null, i8** %16
%17 = call i32 @execv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %12)
br label %18
18: ; preds = %7, %11
%19 = phi i32 [ 19, %11 ], [ 20, %7 ]
%20 = call i32 @e(i32 %19)
br label %21
21: ; preds = %18, %7
ret i32 undef
}