#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 */
struct option {
  char *member_0;
  char member_3;
  int /*<<< orphan*/ member_2;
  int /*<<< orphan*/ member_1;
};
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int WEXITSTATUS(int);
scalar_t__ WIFEXITED(int);
int /*<<< orphan*/ err(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ errx(int /*<<< orphan*/, char *, char *);
int exec(int, int, char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getopt_long(int, char **, char const *, struct option *, int *);
int optind;
int pipe(int *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ usage(char *);
int /*<<< orphan*/ version(char *);
int /*<<< orphan*/ waitpid(int, int *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  int ch, opt_ind = 0;
  const char *sopt = "hV";
  struct option lopt[] = {{"help", 0, 0, 'h'}, {"version", 0, 0, 'V'}, {0}};
  int host_stdout[2];
  int host_stdin[2];
  int res;
  pid_t pid1, pid2;
  int status;
  while ((ch = getopt_long(argc, argv, sopt, lopt, &opt_ind)) != -1) {
    switch (ch) {
    case 'h':
      usage(argv[0]);
      exit(0);
    case 'V':
      version(argv[0]);
      exit(0);
    case '?':
      errx(EINVAL, "Try `%s --help' for more information.", argv[0]);
    }
  }
  if ((argc - optind) != 2) {
    errx(EINVAL,
         "Two commands are required.\n"
         "Try `%s --help' for more information.",
         argv[0]);
  }
  res = pipe(host_stdout);
  if (res == -1) {
    err(errno, "pipe() failed");
  }
  res = pipe(host_stdin);
  if (res == -1) {
    err(errno, "pipe() failed");
  }
  pid1 = exec(host_stdout[1], host_stdin[0], argv[optind]);
  if (pid1 == -1) {
    err(errno, "exec(%s)", argv[optind]);
  }
  pid2 = exec(host_stdin[1], host_stdout[0], argv[optind + 1]);
  if (pid2 == -1) {
    err(errno, "exec(%s)", argv[optind + 1]);
  }
  waitpid(pid1, &status, 0);
  if (WIFEXITED(status))
    status = WEXITSTATUS(status);
  if (status != 0) {
    printf("Child exited with status %d\n", status);
  }
  waitpid(pid2, &status, 0);
  if (WIFEXITED(status))
    status = WEXITSTATUS(status);
  if (status != 0) {
    printf("Child2 exited with status %d\n", status);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xe09(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x48,%edx
call   1060 <memset@plt>
lea    0xdf1(%rip),%rax
mov    %rax,-0x70(%rbp)
movl   $0x68,-0x60(%rbp)
lea    0xde4(%rip),%rax
mov    %rax,-0x58(%rbp)
movl   $0x56,-0x48(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x70(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1030 <getopt_long@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     12d9 <main+0x109>
mov    -0x14(%rbp),%eax
mov    %eax,-0x94(%rbp)
sub    $0x3f,%eax
je     12b8 <main+0xe8>
jmp    126a <main+0x9a>
mov    -0x94(%rbp),%eax
sub    $0x56,%eax
je     12a5 <main+0xd5>
jmp    127e <main+0xae>
mov    -0x94(%rbp),%eax
sub    $0x68,%eax
jne    12d4 <main+0x104>
jmp    1292 <main+0xc2>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10a0 <usage@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1080 <version@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
mov    0x2d11(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xd5c(%rip),%rsi
call   1040 <errx@plt>
jmp    122f <main+0x5f>
mov    -0x8(%rbp),%eax
mov    0x2d05(%rip),%rcx
sub    (%rcx),%eax
cmp    $0x2,%eax
je     130a <main+0x13a>
mov    0x2cdb(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xd0b(%rip),%rsi
call   1040 <errx@plt>
lea    -0x78(%rbp),%rdi
call   1070 <pipe@plt>
mov    %eax,-0x84(%rbp)
cmpl   $0xffffffff,-0x84(%rbp)
jne    133d <main+0x16d>
mov    0x2cab(%rip),%rax
mov    (%rax),%edi
lea    0xd1b(%rip),%rsi
mov    $0x0,%al
call   1090 <err@plt>
lea    -0x80(%rbp),%rdi
call   1070 <pipe@plt>
mov    %eax,-0x84(%rbp)
cmpl   $0xffffffff,-0x84(%rbp)
jne    1370 <main+0x1a0>
mov    0x2c78(%rip),%rax
mov    (%rax),%edi
lea    0xce8(%rip),%rsi
mov    $0x0,%al
call   1090 <err@plt>
mov    -0x74(%rbp),%edi
mov    -0x80(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    0x2c67(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdx
call   10f0 <exec@plt>
mov    %eax,-0x88(%rbp)
cmpl   $0xffffffff,-0x88(%rbp)
jne    13c9 <main+0x1f9>
mov    0x2c31(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x2c34(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xc9d(%rip),%rsi
mov    $0x0,%al
call   1090 <err@plt>
mov    -0x7c(%rbp),%edi
mov    -0x78(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    0x2c0e(%rip),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
call   10f0 <exec@plt>
mov    %eax,-0x8c(%rbp)
cmpl   $0xffffffff,-0x8c(%rbp)
jne    142c <main+0x25c>
mov    0x2bd3(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x2bd6(%rip),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xc3a(%rip),%rsi
mov    $0x0,%al
call   1090 <err@plt>
mov    -0x88(%rbp),%edi
lea    -0x90(%rbp),%rsi
xor    %edx,%edx
call   10c0 <waitpid@plt>
mov    -0x90(%rbp),%edi
call   10d0 <WIFEXITED@plt>
cmp    $0x0,%rax
je     1466 <main+0x296>
mov    -0x90(%rbp),%edi
call   10b0 <WEXITSTATUS@plt>
mov    %eax,-0x90(%rbp)
cmpl   $0x0,-0x90(%rbp)
je     1485 <main+0x2b5>
mov    -0x90(%rbp),%esi
lea    0xbe8(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8c(%rbp),%edi
lea    -0x90(%rbp),%rsi
xor    %edx,%edx
call   10c0 <waitpid@plt>
mov    -0x90(%rbp),%edi
call   10d0 <WIFEXITED@plt>
cmp    $0x0,%rax
je     14bf <main+0x2ef>
mov    -0x90(%rbp),%edi
call   10b0 <WEXITSTATUS@plt>
mov    %eax,-0x90(%rbp)
cmpl   $0x0,-0x90(%rbp)
je     14de <main+0x30e>
mov    -0x90(%rbp),%esi
lea    0xbac(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
movl   $0x0,0xc(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
movq   $0x0,0x60(%rsp)
lea    0xe01(%rip),%rax
mov    %rax,0x20(%rsp)
movl   $0x68,0x30(%rsp)
lea    0xdf2(%rip),%rax
mov    %rax,0x38(%rsp)
movl   $0x56,0x48(%rsp)
lea    0xdd6(%rip),%r14
lea    0x20(%rsp),%r15
lea    0xc(%rsp),%r12
lea    0xdf0(%rip),%r13
jmp    1254 <main+0x94>
nopl   (%rax)
mov    0x2d89(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
mov    %r13,%rsi
call   1040 <errx@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
mov    %r12,%r8
call   1030 <getopt_long@plt>
cmp    $0x3e,%eax
jle    1290 <main+0xd0>
cmp    $0x3f,%eax
je     1240 <main+0x80>
cmp    $0x56,%eax
je     140f <main+0x24f>
cmp    $0x68,%eax
jne    1254 <main+0x94>
jmp    141e <main+0x25e>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    $0xffffffff,%eax
jne    1254 <main+0x94>
mov    0x2d4c(%rip),%r15
sub    (%r15),%ebp
cmp    $0x2,%ebp
je     12bc <main+0xfc>
mov    0x2d25(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xd59(%rip),%rsi
call   1040 <errx@plt>
lea    0x18(%rsp),%rdi
call   1060 <pipe@plt>
cmp    $0xffffffff,%eax
jne    12e2 <main+0x122>
mov    0x2d06(%rip),%rax
mov    (%rax),%edi
lea    0xd76(%rip),%rsi
xor    %eax,%eax
call   1080 <err@plt>
lea    0x10(%rsp),%rdi
call   1060 <pipe@plt>
cmp    $0xffffffff,%eax
jne    1308 <main+0x148>
mov    0x2ce0(%rip),%rax
mov    (%rax),%edi
lea    0xd50(%rip),%rsi
xor    %eax,%eax
call   1080 <err@plt>
mov    0x1c(%rsp),%edi
mov    0x10(%rsp),%esi
movslq (%r15),%rax
mov    (%rbx,%rax,8),%rdx
call   10e0 <exec@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    1341 <main+0x181>
mov    0x2cae(%rip),%rax
mov    (%rax),%edi
movslq (%r15),%rax
mov    (%rbx,%rax,8),%rdx
lea    0xd25(%rip),%rsi
xor    %eax,%eax
call   1080 <err@plt>
mov    0x14(%rsp),%edi
mov    0x18(%rsp),%esi
movslq (%r15),%rax
mov    0x8(%rbx,%rax,8),%rdx
call   10e0 <exec@plt>
mov    %eax,%r14d
cmp    $0xffffffff,%eax
jne    137d <main+0x1bd>
mov    0x2c73(%rip),%rax
mov    (%rax),%edi
movslq (%r15),%rax
mov    0x8(%rbx,%rax,8),%rdx
lea    0xce9(%rip),%rsi
xor    %eax,%eax
call   1080 <err@plt>
lea    0x8(%rsp),%rsi
mov    %ebp,%edi
xor    %edx,%edx
call   10b0 <waitpid@plt>
mov    0x8(%rsp),%edi
call   10c0 <WIFEXITED@plt>
mov    %rax,%rcx
mov    0x8(%rsp),%eax
test   %rcx,%rcx
je     13ab <main+0x1eb>
mov    %eax,%edi
call   10a0 <WEXITSTATUS@plt>
mov    %eax,0x8(%rsp)
test   %eax,%eax
je     13bd <main+0x1fd>
lea    0xcb2(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %r14d,%edi
xor    %edx,%edx
call   10b0 <waitpid@plt>
mov    0x8(%rsp),%edi
call   10c0 <WIFEXITED@plt>
mov    %rax,%rcx
mov    0x8(%rsp),%eax
test   %rcx,%rcx
je     13ec <main+0x22c>
mov    %eax,%edi
call   10a0 <WEXITSTATUS@plt>
mov    %eax,0x8(%rsp)
test   %eax,%eax
je     13fe <main+0x23e>
lea    0xc8e(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rbx),%rdi
call   1070 <version@plt>
xor    %edi,%edi
call   10d0 <exit@plt>
mov    (%rbx),%rdi
call   1090 <usage@plt>
xor    %edi,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
%struct.option = type { i8*, i8, i32, i32 }
@.str = [3 x i8] c"hV\00"
@.str.1 = [5 x i8] c"help\00"
@.str.2 = [8 x i8] c"version\00"
@EINVAL = global i32 0
@.str.3 = [38 x i8] c"Try `%s --help' for more information.\00"
@optind = global i32 0
@.str.4 = [65 x i8] c"Two commands are required.\0ATry `%s --help' for more information.\00"
@errno = global i32 0
@.str.5 = [14 x i8] c"pipe() failed\00"
@.str.6 = [9 x i8] c"exec(%s)\00"
@.str.7 = [29 x i8] c"Child exited with status %d\0A\00"
@.str.8 = [30 x i8] c"Child2 exited with status %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca [3 x %struct.option]
%10 = alloca [2 x i32]
%11 = alloca [2 x i32]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %8
%16 = bitcast [3 x %struct.option]* %9 to i8*
%17 = bitcast i8* %16 to [3 x %struct.option]*
%18 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %17, i32 0, i32 0
%19 = getelementptr inbounds %struct.option, %struct.option* %18, i32 0, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8** %19
%20 = getelementptr inbounds %struct.option, %struct.option* %18, i32 0, i32 3
store i32 104, i32* %20
%21 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %17, i32 0, i32 1
%22 = getelementptr inbounds %struct.option, %struct.option* %21, i32 0, i32 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0), i8** %22
%23 = getelementptr inbounds %struct.option, %struct.option* %21, i32 0, i32 3
store i32 86, i32* %23
br label %24
24: ; preds = %51, %2
%25 = load i32, i32* %4
%26 = load i8**, i8*** %5
%27 = load i8*, i8** %8
%28 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %9, i64 0, i64 0
%29 = call i32 @getopt_long(i32 %25, i8** %26, i8* %27, %struct.option* %28, i32* %7)
store i32 %29, i32* %6
%30 = icmp ne i32 %29, -1
br i1 %30, label %31, label %52
31: ; preds = %24
%32 = load i32, i32* %6
switch i32 %32, label %51 [
i32 104, label %33
i32 86, label %39
i32 63, label %45
]
33: ; preds = %31
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 0
%36 = load i8*, i8** %35
%37 = call i32 @usage(i8* %36)
%38 = call i32 @exit(i32 0)
unreachable
39: ; preds = %31
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 0
%42 = load i8*, i8** %41
%43 = call i32 @version(i8* %42)
%44 = call i32 @exit(i32 0)
unreachable
45: ; preds = %31
%46 = load i32, i32* @EINVAL
%47 = load i8**, i8*** %5
%48 = getelementptr inbounds i8*, i8** %47, i64 0
%49 = load i8*, i8** %48
%50 = call i32 @errx(i32 %46, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %49)
br label %51
51: ; preds = %45, %31
br label %24
52: ; preds = %24
%53 = load i32, i32* %4
%54 = load i32, i32* @optind
%55 = sub nsw i32 %53, %54
%56 = icmp ne i32 %55, 2
br i1 %56, label %57, label %63
57: ; preds = %52
%58 = load i32, i32* @EINVAL
%59 = load i8**, i8*** %5
%60 = getelementptr inbounds i8*, i8** %59, i64 0
%61 = load i8*, i8** %60
%62 = call i32 @errx(i32 %58, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.4, i64 0, i64 0), i8* %61)
br label %63
63: ; preds = %57, %52
%64 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%65 = call i32 @pipe(i32* %64)
store i32 %65, i32* %12
%66 = load i32, i32* %12
%67 = icmp eq i32 %66, -1
br i1 %67, label %68, label %71
68: ; preds = %63
%69 = load i32, i32* @errno
%70 = call i32 (i32, i8*, ...) @err(i32 %69, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
br label %71
71: ; preds = %68, %63
%72 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%73 = call i32 @pipe(i32* %72)
store i32 %73, i32* %12
%74 = load i32, i32* %12
%75 = icmp eq i32 %74, -1
br i1 %75, label %76, label %79
76: ; preds = %71
%77 = load i32, i32* @errno
%78 = call i32 (i32, i8*, ...) @err(i32 %77, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
br label %79
79: ; preds = %76, %71
%80 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 1
%81 = load i32, i32* %80
%82 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%83 = load i32, i32* %82
%84 = load i8**, i8*** %5
%85 = load i32, i32* @optind
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds i8*, i8** %84, i64 %86
%88 = load i8*, i8** %87
%89 = call i32 @exec(i32 %81, i32 %83, i8* %88)
store i32 %89, i32* %13
%90 = load i32, i32* %13
%91 = icmp eq i32 %90, -1
br i1 %91, label %92, label %100
92: ; preds = %79
%93 = load i32, i32* @errno
%94 = load i8**, i8*** %5
%95 = load i32, i32* @optind
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i8*, i8** %94, i64 %96
%98 = load i8*, i8** %97
%99 = call i32 (i32, i8*, ...) @err(i32 %93, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* %98)
br label %100
100: ; preds = %92, %79
%101 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 1
%102 = load i32, i32* %101
%103 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%104 = load i32, i32* %103
%105 = load i8**, i8*** %5
%106 = load i32, i32* @optind
%107 = add nsw i32 %106, 1
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds i8*, i8** %105, i64 %108
%110 = load i8*, i8** %109
%111 = call i32 @exec(i32 %102, i32 %104, i8* %110)
store i32 %111, i32* %14
%112 = load i32, i32* %14
%113 = icmp eq i32 %112, -1
br i1 %113, label %114, label %123
114: ; preds = %100
%115 = load i32, i32* @errno
%116 = load i8**, i8*** %5
%117 = load i32, i32* @optind
%118 = add nsw i32 %117, 1
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds i8*, i8** %116, i64 %119
%121 = load i8*, i8** %120
%122 = call i32 (i32, i8*, ...) @err(i32 %115, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* %121)
br label %123
123: ; preds = %114, %100
%124 = load i32, i32* %13
%125 = call i32 @waitpid(i32 %124, i32* %15, i32 0)
%126 = load i32, i32* %15
%127 = call i64 @WIFEXITED(i32 %126)
%128 = icmp ne i64 %127, 0
br i1 %128, label %129, label %132
129: ; preds = %123
%130 = load i32, i32* %15
%131 = call i32 @WEXITSTATUS(i32 %130)
store i32 %131, i32* %15
br label %132
132: ; preds = %129, %123
%133 = load i32, i32* %15
%134 = icmp ne i32 %133, 0
br i1 %134, label %135, label %138
135: ; preds = %132
%136 = load i32, i32* %15
%137 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i32 %136)
br label %138
138: ; preds = %135, %132
%139 = load i32, i32* %14
%140 = call i32 @waitpid(i32 %139, i32* %15, i32 0)
%141 = load i32, i32* %15
%142 = call i64 @WIFEXITED(i32 %141)
%143 = icmp ne i64 %142, 0
br i1 %143, label %144, label %147
144: ; preds = %138
%145 = load i32, i32* %15
%146 = call i32 @WEXITSTATUS(i32 %145)
store i32 %146, i32* %15
br label %147
147: ; preds = %144, %138
%148 = load i32, i32* %15
%149 = icmp ne i32 %148, 0
br i1 %149, label %150, label %153
150: ; preds = %147
%151 = load i32, i32* %15
%152 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0), i32 %151)
br label %153
153: ; preds = %150, %147
ret i32 0
}

LLVM IR (-O2):
%struct.option = type { i8*, i8, i32, i32 }
@.str = [3 x i8] c"hV\00"
@.str.1 = [5 x i8] c"help\00"
@.str.2 = [8 x i8] c"version\00"
@EINVAL = global i32 0
@.str.3 = [38 x i8] c"Try `%s --help' for more information.\00"
@optind = global i32 0
@.str.4 = [65 x i8] c"Two commands are required.\0ATry `%s --help' for more information.\00"
@errno = global i32 0
@.str.5 = [14 x i8] c"pipe() failed\00"
@.str.6 = [9 x i8] c"exec(%s)\00"
@.str.7 = [29 x i8] c"Child exited with status %d\0A\00"
@.str.8 = [30 x i8] c"Child2 exited with status %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca [3 x %struct.option]
%5 = alloca [2 x i32]
%6 = alloca [2 x i32]
%7 = alloca i32
%8 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%9 = bitcast [3 x %struct.option]* %4 to i8*
%10 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %4, i64 0, i64 0, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %4, i64 0, i64 0, i32 3
store i32 104, i32* %11
%12 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %4, i64 0, i64 1, i32 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %12
%13 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %4, i64 0, i64 1, i32 3
store i32 86, i32* %13
%14 = bitcast [2 x i32]* %5 to i8*
%15 = bitcast [2 x i32]* %6 to i8*
%16 = bitcast i32* %7 to i8*
%17 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %4, i64 0, i64 0
br label %18
18: ; preds = %20, %2
%19 = call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.option* %17, i32* %3)
switch i32 %19, label %20 [
i32 -1, label %33
i32 104, label %21
i32 86, label %25
i32 63, label %29
]
20: ; preds = %18, %29
br label %18
21: ; preds = %18
%22 = load i8*, i8** %1
%23 = call i32 @usage(i8* %22)
%24 = call i32 @exit(i32 0)
unreachable
25: ; preds = %18
%26 = load i8*, i8** %1
%27 = call i32 @version(i8* %26)
%28 = call i32 @exit(i32 0)
unreachable
29: ; preds = %18
%30 = load i32, i32* @EINVAL
%31 = load i8*, i8** %1
%32 = call i32 @errx(i32 %30, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %31)
br label %20
33: ; preds = %18
%34 = load i32, i32* @optind
%35 = sub nsw i32 %0, %34
%36 = icmp eq i32 %35, 2
br i1 %36, label %41, label %37
37: ; preds = %33
%38 = load i32, i32* @EINVAL
%39 = load i8*, i8** %1
%40 = call i32 @errx(i32 %38, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.4, i64 0, i64 0), i8* %39)
br label %41
41: ; preds = %37, %33
%42 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%43 = call i32 @pipe(i32* %42)
%44 = icmp eq i32 %43, -1
br i1 %44, label %45, label %48
45: ; preds = %41
%46 = load i32, i32* @errno
%47 = call i32 (i32, i8*, ...) @err(i32 %46, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
br label %48
48: ; preds = %45, %41
%49 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%50 = call i32 @pipe(i32* %49)
%51 = icmp eq i32 %50, -1
br i1 %51, label %52, label %55
52: ; preds = %48
%53 = load i32, i32* @errno
%54 = call i32 (i32, i8*, ...) @err(i32 %53, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
br label %55
55: ; preds = %52, %48
%56 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%57 = load i32, i32* %56
%58 = load i32, i32* %49
%59 = load i32, i32* @optind
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8*, i8** %1, i64 %60
%62 = load i8*, i8** %61
%63 = call i32 @exec(i32 %57, i32 %58, i8* %62)
%64 = icmp eq i32 %63, -1
br i1 %64, label %65, label %72
65: ; preds = %55
%66 = load i32, i32* @errno
%67 = load i32, i32* @optind
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i8*, i8** %1, i64 %68
%70 = load i8*, i8** %69
%71 = call i32 (i32, i8*, ...) @err(i32 %66, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* %70)
br label %72
72: ; preds = %65, %55
%73 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%74 = load i32, i32* %73
%75 = load i32, i32* %42
%76 = load i32, i32* @optind
%77 = add nsw i32 %76, 1
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i8*, i8** %1, i64 %78
%80 = load i8*, i8** %79
%81 = call i32 @exec(i32 %74, i32 %75, i8* %80)
%82 = icmp eq i32 %81, -1
br i1 %82, label %83, label %91
83: ; preds = %72
%84 = load i32, i32* @errno
%85 = load i32, i32* @optind
%86 = add nsw i32 %85, 1
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i8*, i8** %1, i64 %87
%89 = load i8*, i8** %88
%90 = call i32 (i32, i8*, ...) @err(i32 %84, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* %89)
br label %91
91: ; preds = %83, %72
%92 = call i32 @waitpid(i32 %63, i32* %7, i32 0)
%93 = load i32, i32* %7
%94 = call i64 @WIFEXITED(i32 %93)
%95 = icmp eq i64 %94, 0
%96 = load i32, i32* %7
br i1 %95, label %99, label %97
97: ; preds = %91
%98 = call i32 @WEXITSTATUS(i32 %96)
store i32 %98, i32* %7
br label %99
99: ; preds = %91, %97
%100 = phi i32 [ %98, %97 ], [ %96, %91 ]
%101 = icmp eq i32 %100, 0
br i1 %101, label %104, label %102
102: ; preds = %99
%103 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i32 %100)
br label %104
104: ; preds = %102, %99
%105 = call i32 @waitpid(i32 %81, i32* %7, i32 0)
%106 = load i32, i32* %7
%107 = call i64 @WIFEXITED(i32 %106)
%108 = icmp eq i64 %107, 0
%109 = load i32, i32* %7
br i1 %108, label %112, label %110
110: ; preds = %104
%111 = call i32 @WEXITSTATUS(i32 %109)
store i32 %111, i32* %7
br label %112
112: ; preds = %104, %110
%113 = phi i32 [ %111, %110 ], [ %109, %104 ]
%114 = icmp eq i32 %113, 0
br i1 %114, label %117, label %115
115: ; preds = %112
%116 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0), i32 %113)
br label %117
117: ; preds = %115, %112
ret i32 0
}