#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*/ SIGHUP;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup(int);
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ exit(int);
int fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ kill(int, int /*<<< orphan*/);
char **malloc(int);
int pipe(int *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage(char *);
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
main(int argc, char *argv[]) {
  int i;
  char **cppargv, **pbargv;
  int cppargc, pbargc;
  int pipefd[2];
  int cpppid, pbpid;
  cppargv = malloc(sizeof(char *) * (argc * 2 + 1));
  cppargv[0] = "cpp";
  cppargc = 1;
  pbargv = malloc(sizeof(char *) * argc);
  pbargv[0] = "pb";
  pbargc = 1;
  for (i = 1; argv[i][0] == '-'; i++) {
    switch (argv[i][1]) {
    case 'D':
      cppargv[cppargc++] = argv[i];
      break;
    case 'o':
    case 'r':
    case 's':
      pbargv[pbargc++] = argv[i++];
    case 'd':
      pbargv[pbargc++] = argv[i];
      break;
    case '-':
      goto endflags;
    };
  };
endflags:
  if (i >= argc)
    usage(argv[0]);
  for (; i < argc - 1; i++) {
    cppargv[cppargc++] = "-include";
    cppargv[cppargc++] = argv[i];
  };
  cppargv[cppargc++] = argv[i];
  cppargv[cppargc++] = "-";
  cppargv[cppargc++] = NULL;
  if (pipe(pipefd) == -1) {
    fprintf(stderr, "%s: %s\n", argv[0], "cannot create pipe.");
    exit(1);
  };
  if ((pbpid = fork()) == 0) {
    close(0);
    dup(pipefd[0]);
    close(pipefd[0]);
    execvp("pb", pbargv);
    {
      fprintf(stderr, "%s: %s\n", argv[0],
              "cannot execvp "
              "pb");
      exit(1);
    };
  } else if (pbpid == -1) {
    fprintf(stderr, "%s: %s\n", argv[0], "cannot fork.");
    exit(1);
  };
  if ((cpppid = fork()) == 0) {
    close(1);
    dup(pipefd[1]);
    close(pipefd[1]);
    execvp("cpp", cppargv);
    kill(pbpid, SIGHUP);
    {
      fprintf(stderr, "%s: %s\n", argv[0],
              "cannot execvp "
              "cpp");
      exit(1);
    };
  } else if (cpppid == -1) {
    kill(pbpid, SIGHUP);
    {
      fprintf(stderr, "%s: %s\n", argv[0], "cannot fork.");
      exit(1);
    };
  };
  close(pipefd[0]);
  close(pipefd[1]);
  wait(NULL);
  fprintf(stderr, "wait() returned\n");
  wait(NULL);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
lea    0xe68(%rip),%rcx
mov    %rcx,(%rax)
movl   $0x1,-0x2c(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
lea    0xe22(%rip),%rcx
mov    %rcx,(%rax)
movl   $0x1,-0x30(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1336 <main+0x186>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x44(%rbp)
sub    $0x2d,%eax
je     131e <main+0x16e>
jmp    125d <main+0xad>
mov    -0x44(%rbp),%eax
sub    $0x44,%eax
je     12a4 <main+0xf4>
jmp    126e <main+0xbe>
mov    -0x44(%rbp),%eax
sub    $0x64,%eax
je     12f7 <main+0x147>
jmp    127f <main+0xcf>
mov    -0x44(%rbp),%eax
sub    $0x6f,%eax
je     12cb <main+0x11b>
jmp    1290 <main+0xe0>
mov    -0x44(%rbp),%eax
add    $0xffffff8e,%eax
sub    $0x2,%eax
jb     12cb <main+0x11b>
jmp    1323 <main+0x173>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x2c(%rbp)
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
jmp    1323 <main+0x173>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x30(%rbp)
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x30(%rbp)
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
jmp    1323 <main+0x173>
jmp    133b <main+0x18b>
jmp    1328 <main+0x178>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1224 <main+0x74>
jmp    133b <main+0x18b>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1353 <main+0x1a3>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1090 <usage@plt>
jmp    1358 <main+0x1a8>
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    13b6 <main+0x206>
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x2c(%rbp)
movslq %ecx,%rcx
lea    0xc7e(%rip),%rdx
mov    %rdx,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x2c(%rbp)
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1358 <main+0x1a8>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x2c(%rbp)
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x2c(%rbp)
movslq %ecx,%rcx
lea    0xc18(%rip),%rdx
mov    %rdx,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x2c(%rbp)
movslq %ecx,%rcx
movq   $0x0,(%rax,%rcx,8)
lea    -0x38(%rbp),%rdi
call   1050 <pipe@plt>
cmp    $0xffffffff,%eax
jne    1450 <main+0x2a0>
mov    0x2bb0(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xbd3(%rip),%rsi
lea    0xbd4(%rip),%rcx
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    $0x0,%al
call   10d0 <fork@plt>
mov    %eax,-0x40(%rbp)
cmp    $0x0,%eax
jne    14b9 <main+0x309>
xor    %edi,%edi
call   1040 <close@plt>
mov    -0x38(%rbp),%edi
call   1030 <dup@plt>
mov    -0x38(%rbp),%edi
call   1040 <close@plt>
mov    -0x28(%rbp),%rsi
lea    0xbb0(%rip),%rdi
call   10a0 <execvp@plt>
mov    0x2b47(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xb6a(%rip),%rsi
lea    0xb7f(%rip),%rcx
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
cmpl   $0xffffffff,-0x40(%rbp)
jne    14f2 <main+0x342>
mov    0x2b0e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xb31(%rip),%rsi
lea    0xb57(%rip),%rcx
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
jmp    14f7 <main+0x347>
mov    $0x0,%al
call   10d0 <fork@plt>
mov    %eax,-0x3c(%rbp)
cmp    $0x0,%eax
jne    1574 <main+0x3c4>
mov    $0x1,%edi
call   1040 <close@plt>
mov    -0x34(%rbp),%edi
call   1030 <dup@plt>
mov    -0x34(%rbp),%edi
call   1040 <close@plt>
mov    -0x20(%rbp),%rsi
lea    0xb24(%rip),%rdi
call   10a0 <execvp@plt>
mov    -0x40(%rbp),%edi
mov    0x2ab2(%rip),%rax
mov    (%rax),%esi
call   1070 <kill@plt>
mov    0x2a8c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xaaf(%rip),%rsi
lea    0xae2(%rip),%rcx
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
cmpl   $0xffffffff,-0x3c(%rbp)
jne    15be <main+0x40e>
mov    -0x40(%rbp),%edi
mov    0x2a68(%rip),%rax
mov    (%rax),%esi
call   1070 <kill@plt>
mov    0x2a42(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xa65(%rip),%rsi
lea    0xa8b(%rip),%rcx
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
jmp    15c3 <main+0x413>
mov    -0x38(%rbp),%edi
call   1040 <close@plt>
mov    -0x34(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10c0 <wait@plt>
mov    0x29f5(%rip),%rax
mov    (%rax),%edi
lea    0xa6b(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10c0 <wait@plt>
xor    %edi,%edi
call   10b0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%r12d
shl    $0x4,%edi
or     $0x8,%edi
call   1080 <malloc@plt>
mov    %rax,%r13
lea    0xf3d(%rip),%rax
mov    %rax,0x0(%r13)
lea    0x0(,%r12,8),%edi
call   1080 <malloc@plt>
mov    %rax,%r15
lea    0xf04(%rip),%rax
mov    %rax,(%r15)
mov    0x8(%r14),%rdx
mov    $0x1,%ebp
cmpb   $0x2d,(%rdx)
mov    $0x1,%ebx
jne    1277 <main+0xc7>
mov    $0x1,%ebx
lea    0xded(%rip),%rax
mov    $0x1,%ebp
mov    $0x1,%ecx
jmp    1253 <main+0xa3>
nop
add    $0x1,%ebx
movslq %ecx,%rsi
add    $0x1,%ecx
mov    %rdx,(%r15,%rsi,8)
movslq %ebx,%rdx
mov    (%r14,%rdx,8),%rdx
mov    %ecx,%esi
add    $0x1,%ecx
mov    %r15,%rdi
movslq %esi,%rsi
mov    %rdx,(%rdi,%rsi,8)
movslq %ebx,%rdx
add    $0x1,%ebx
mov    0x8(%r14,%rdx,8),%rdx
cmpb   $0x2d,(%rdx)
jne    1277 <main+0xc7>
movsbl 0x1(%rdx),%esi
lea    -0x44(%rsi),%edi
cmp    $0x2f,%edi
ja     1272 <main+0xc2>
movslq (%rax,%rdi,4),%rsi
add    %rax,%rsi
jmp    *%rsi
mov    %ebp,%esi
add    $0x1,%ebp
mov    %r13,%rdi
jmp    123c <main+0x8c>
cmp    $0x2d,%esi
jne    1243 <main+0x93>
cmp    %r12d,%ebx
jl     1284 <main+0xd4>
mov    (%r14),%rdi
call   1090 <usage@plt>
add    $0xffffffff,%r12d
movslq %ebx,%rcx
cmp    %r12d,%ebx
jge    12fc <main+0x14c>
movslq %ebp,%rbp
movslq %r12d,%rax
sub    %ebx,%r12d
mov    %rcx,%rdx
not    %rdx
test   $0x1,%r12b
je     12c2 <main+0x112>
lea    0xe14(%rip),%rsi
mov    %rsi,0x0(%r13,%rbp,8)
mov    (%r14,%rcx,8),%rsi
mov    %rsi,0x8(%r13,%rbp,8)
add    $0x2,%rbp
add    $0x1,%rcx
add    %rax,%rdx
je     12ff <main+0x14f>
lea    0xdf2(%rip),%rdx
xchg   %ax,%ax
mov    %rdx,0x0(%r13,%rbp,8)
mov    (%r14,%rcx,8),%rsi
mov    %rsi,0x8(%r13,%rbp,8)
mov    %rdx,0x10(%r13,%rbp,8)
mov    0x8(%r14,%rcx,8),%rsi
mov    %rsi,0x18(%r13,%rbp,8)
add    $0x4,%rbp
add    $0x2,%rcx
cmp    %rcx,%rax
jne    12d0 <main+0x120>
jmp    12ff <main+0x14f>
mov    %rcx,%rax
mov    (%r14,%rax,8),%rax
movslq %ebp,%rcx
mov    %rax,0x0(%r13,%rcx,8)
lea    0xdb7(%rip),%rax
mov    %rax,0x8(%r13,%rcx,8)
movq   $0x0,0x10(%r13,%rcx,8)
mov    %rsp,%rdi
call   1050 <pipe@plt>
cmp    $0xffffffff,%eax
jne    134c <main+0x19c>
mov    0x2ca4(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rdx
lea    0xd8b(%rip),%rsi
lea    0xd8c(%rip),%rcx
jmp    143c <main+0x28c>
xor    %eax,%eax
call   10d0 <fork@plt>
cmp    $0xffffffff,%eax
je     1422 <main+0x272>
mov    %eax,%ebp
test   %eax,%eax
jne    13a7 <main+0x1f7>
xor    %edi,%edi
call   1040 <close@plt>
mov    (%rsp),%edi
call   1030 <dup@plt>
mov    (%rsp),%edi
call   1040 <close@plt>
lea    0xd75(%rip),%rdi
mov    %r15,%rsi
call   10a0 <execvp@plt>
mov    0x2c49(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rdx
lea    0xd30(%rip),%rsi
lea    0xd45(%rip),%rcx
jmp    143c <main+0x28c>
xor    %eax,%eax
call   10d0 <fork@plt>
cmp    $0xffffffff,%eax
je     1412 <main+0x262>
test   %eax,%eax
jne    144d <main+0x29d>
mov    $0x1,%edi
call   1040 <close@plt>
mov    0x4(%rsp),%edi
call   1030 <dup@plt>
mov    0x4(%rsp),%edi
call   1040 <close@plt>
lea    0xd35(%rip),%rdi
mov    %r13,%rsi
call   10a0 <execvp@plt>
mov    0x2c03(%rip),%rax
mov    (%rax),%esi
mov    %ebp,%edi
call   1070 <kill@plt>
mov    0x2bdb(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rdx
lea    0xcc2(%rip),%rsi
lea    0xcf5(%rip),%rcx
jmp    143c <main+0x28c>
mov    0x2bd7(%rip),%rax
mov    (%rax),%esi
mov    %ebp,%edi
call   1070 <kill@plt>
mov    0x2baf(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rdx
lea    0xc96(%rip),%rsi
lea    0xcbc(%rip),%rcx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    (%rsp),%edi
call   1040 <close@plt>
mov    0x4(%rsp),%edi
call   1040 <close@plt>
xor    %edi,%edi
call   10c0 <wait@plt>
mov    0x2b6c(%rip),%rax
mov    (%rax),%edi
lea    0xca2(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
xor    %edi,%edi
call   10c0 <wait@plt>
xor    %edi,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"cpp\00"
@.str.1 = [3 x i8] c"pb\00"
@.str.2 = [9 x i8] c"-include\00"
@.str.3 = [2 x i8] c"-\00"
@stderr = global i32 0
@.str.4 = [8 x i8] c"%s: %s\0A\00"
@.str.5 = [20 x i8] c"cannot create pipe.\00"
@.str.6 = [17 x i8] c"cannot execvp pb\00"
@.str.7 = [13 x i8] c"cannot fork.\00"
@SIGHUP = global i32 0
@.str.8 = [18 x i8] c"cannot execvp cpp\00"
@.str.9 = [17 x i8] c"wait() returned\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8**
%9 = alloca i32
%10 = alloca i32
%11 = alloca [2 x i32]
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i32, i32* %4
%15 = mul nsw i32 %14, 2
%16 = add nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = mul i64 8, %17
%19 = trunc i64 %18 to i32
%20 = call i8** @malloc(i32 %19)
store i8** %20, i8*** %7
%21 = load i8**, i8*** %7
%22 = getelementptr inbounds i8*, i8** %21, i64 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %22
store i32 1, i32* %9
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = mul i64 8, %24
%26 = trunc i64 %25 to i32
%27 = call i8** @malloc(i32 %26)
store i8** %27, i8*** %8
%28 = load i8**, i8*** %8
%29 = getelementptr inbounds i8*, i8** %28, i64 0
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %29
store i32 1, i32* %10
store i32 1, i32* %6
br label %30
30: ; preds = %85, %2
%31 = load i8**, i8*** %5
%32 = load i32, i32* %6
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8*, i8** %31, i64 %33
%35 = load i8*, i8** %34
%36 = getelementptr inbounds i8, i8* %35, i64 0
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %38, 45
br i1 %39, label %40, label %88
40: ; preds = %30
%41 = load i8**, i8*** %5
%42 = load i32, i32* %6
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8*, i8** %41, i64 %43
%45 = load i8*, i8** %44
%46 = getelementptr inbounds i8, i8* %45, i64 1
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
switch i32 %48, label %84 [
i32 68, label %49
i32 111, label %60
i32 114, label %60
i32 115, label %60
i32 100, label %72
i32 45, label %83
]
49: ; preds = %40
%50 = load i8**, i8*** %5
%51 = load i32, i32* %6
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8*, i8** %50, i64 %52
%54 = load i8*, i8** %53
%55 = load i8**, i8*** %7
%56 = load i32, i32* %9
%57 = add nsw i32 %56, 1
store i32 %57, i32* %9
%58 = sext i32 %56 to i64
%59 = getelementptr inbounds i8*, i8** %55, i64 %58
store i8* %54, i8** %59
br label %84
60: ; preds = %40, %40, %40
%61 = load i8**, i8*** %5
%62 = load i32, i32* %6
%63 = add nsw i32 %62, 1
store i32 %63, i32* %6
%64 = sext i32 %62 to i64
%65 = getelementptr inbounds i8*, i8** %61, i64 %64
%66 = load i8*, i8** %65
%67 = load i8**, i8*** %8
%68 = load i32, i32* %10
%69 = add nsw i32 %68, 1
store i32 %69, i32* %10
%70 = sext i32 %68 to i64
%71 = getelementptr inbounds i8*, i8** %67, i64 %70
store i8* %66, i8** %71
br label %72
72: ; preds = %40, %60
%73 = load i8**, i8*** %5
%74 = load i32, i32* %6
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i8*, i8** %73, i64 %75
%77 = load i8*, i8** %76
%78 = load i8**, i8*** %8
%79 = load i32, i32* %10
%80 = add nsw i32 %79, 1
store i32 %80, i32* %10
%81 = sext i32 %79 to i64
%82 = getelementptr inbounds i8*, i8** %78, i64 %81
store i8* %77, i8** %82
br label %84
83: ; preds = %40
br label %89
84: ; preds = %40, %72, %49
br label %85
85: ; preds = %84
%86 = load i32, i32* %6
%87 = add nsw i32 %86, 1
store i32 %87, i32* %6
br label %30
88: ; preds = %30
br label %89
89: ; preds = %88, %83
%90 = load i32, i32* %6
%91 = load i32, i32* %4
%92 = icmp sge i32 %90, %91
br i1 %92, label %93, label %98
93: ; preds = %89
%94 = load i8**, i8*** %5
%95 = getelementptr inbounds i8*, i8** %94, i64 0
%96 = load i8*, i8** %95
%97 = call i32 @usage(i8* %96)
br label %98
98: ; preds = %93, %89
br label %99
99: ; preds = %120, %98
%100 = load i32, i32* %6
%101 = load i32, i32* %4
%102 = sub nsw i32 %101, 1
%103 = icmp slt i32 %100, %102
br i1 %103, label %104, label %123
104: ; preds = %99
%105 = load i8**, i8*** %7
%106 = load i32, i32* %9
%107 = add nsw i32 %106, 1
store i32 %107, i32* %9
%108 = sext i32 %106 to i64
%109 = getelementptr inbounds i8*, i8** %105, i64 %108
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %109
%110 = load i8**, i8*** %5
%111 = load i32, i32* %6
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds i8*, i8** %110, i64 %112
%114 = load i8*, i8** %113
%115 = load i8**, i8*** %7
%116 = load i32, i32* %9
%117 = add nsw i32 %116, 1
store i32 %117, i32* %9
%118 = sext i32 %116 to i64
%119 = getelementptr inbounds i8*, i8** %115, i64 %118
store i8* %114, i8** %119
br label %120
120: ; preds = %104
%121 = load i32, i32* %6
%122 = add nsw i32 %121, 1
store i32 %122, i32* %6
br label %99
123: ; preds = %99
%124 = load i8**, i8*** %5
%125 = load i32, i32* %6
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds i8*, i8** %124, i64 %126
%128 = load i8*, i8** %127
%129 = load i8**, i8*** %7
%130 = load i32, i32* %9
%131 = add nsw i32 %130, 1
store i32 %131, i32* %9
%132 = sext i32 %130 to i64
%133 = getelementptr inbounds i8*, i8** %129, i64 %132
store i8* %128, i8** %133
%134 = load i8**, i8*** %7
%135 = load i32, i32* %9
%136 = add nsw i32 %135, 1
store i32 %136, i32* %9
%137 = sext i32 %135 to i64
%138 = getelementptr inbounds i8*, i8** %134, i64 %137
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8** %138
%139 = load i8**, i8*** %7
%140 = load i32, i32* %9
%141 = add nsw i32 %140, 1
store i32 %141, i32* %9
%142 = sext i32 %140 to i64
%143 = getelementptr inbounds i8*, i8** %139, i64 %142
store i8* null, i8** %143
%144 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%145 = call i32 @pipe(i32* %144)
%146 = icmp eq i32 %145, -1
br i1 %146, label %147, label %154
147: ; preds = %123
%148 = load i32, i32* @stderr
%149 = load i8**, i8*** %5
%150 = getelementptr inbounds i8*, i8** %149, i64 0
%151 = load i8*, i8** %150
%152 = call i32 (i32, i8*, ...) @fprintf(i32 %148, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %151, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%153 = call i32 @exit(i32 1)
unreachable
154: ; preds = %123
%155 = call i32 (...) @fork()
store i32 %155, i32* %13
%156 = icmp eq i32 %155, 0
br i1 %156, label %157, label %173
157: ; preds = %154
%158 = call i32 @close(i32 0)
%159 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%160 = load i32, i32* %159
%161 = call i32 @dup(i32 %160)
%162 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%163 = load i32, i32* %162
%164 = call i32 @close(i32 %163)
%165 = load i8**, i8*** %8
%166 = call i32 @execvp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %165)
%167 = load i32, i32* @stderr
%168 = load i8**, i8*** %5
%169 = getelementptr inbounds i8*, i8** %168, i64 0
%170 = load i8*, i8** %169
%171 = call i32 (i32, i8*, ...) @fprintf(i32 %167, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %170, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
%172 = call i32 @exit(i32 1)
unreachable
173: ; preds = %154
%174 = load i32, i32* %13
%175 = icmp eq i32 %174, -1
br i1 %175, label %176, label %183
176: ; preds = %173
%177 = load i32, i32* @stderr
%178 = load i8**, i8*** %5
%179 = getelementptr inbounds i8*, i8** %178, i64 0
%180 = load i8*, i8** %179
%181 = call i32 (i32, i8*, ...) @fprintf(i32 %177, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %180, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%182 = call i32 @exit(i32 1)
unreachable
183: ; preds = %173
br label %184
184: ; preds = %183
%185 = call i32 (...) @fork()
store i32 %185, i32* %12
%186 = icmp eq i32 %185, 0
br i1 %186, label %187, label %206
187: ; preds = %184
%188 = call i32 @close(i32 1)
%189 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 1
%190 = load i32, i32* %189
%191 = call i32 @dup(i32 %190)
%192 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 1
%193 = load i32, i32* %192
%194 = call i32 @close(i32 %193)
%195 = load i8**, i8*** %7
%196 = call i32 @execvp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %195)
%197 = load i32, i32* %13
%198 = load i32, i32* @SIGHUP
%199 = call i32 @kill(i32 %197, i32 %198)
%200 = load i32, i32* @stderr
%201 = load i8**, i8*** %5
%202 = getelementptr inbounds i8*, i8** %201, i64 0
%203 = load i8*, i8** %202
%204 = call i32 (i32, i8*, ...) @fprintf(i32 %200, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %203, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
%205 = call i32 @exit(i32 1)
unreachable
206: ; preds = %184
%207 = load i32, i32* %12
%208 = icmp eq i32 %207, -1
br i1 %208, label %209, label %219
209: ; preds = %206
%210 = load i32, i32* %13
%211 = load i32, i32* @SIGHUP
%212 = call i32 @kill(i32 %210, i32 %211)
%213 = load i32, i32* @stderr
%214 = load i8**, i8*** %5
%215 = getelementptr inbounds i8*, i8** %214, i64 0
%216 = load i8*, i8** %215
%217 = call i32 (i32, i8*, ...) @fprintf(i32 %213, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %216, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%218 = call i32 @exit(i32 1)
unreachable
219: ; preds = %206
br label %220
220: ; preds = %219
%221 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%222 = load i32, i32* %221
%223 = call i32 @close(i32 %222)
%224 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 1
%225 = load i32, i32* %224
%226 = call i32 @close(i32 %225)
%227 = call i32 @wait(i32* null)
%228 = load i32, i32* @stderr
%229 = call i32 (i32, i8*, ...) @fprintf(i32 %228, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0))
%230 = call i32 @wait(i32* null)
%231 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"cpp\00"
@.str.1 = [3 x i8] c"pb\00"
@.str.2 = [9 x i8] c"-include\00"
@.str.3 = [2 x i8] c"-\00"
@stderr = global i32 0
@.str.4 = [8 x i8] c"%s: %s\0A\00"
@.str.5 = [20 x i8] c"cannot create pipe.\00"
@.str.6 = [17 x i8] c"cannot execvp pb\00"
@.str.7 = [13 x i8] c"cannot fork.\00"
@SIGHUP = global i32 0
@.str.8 = [18 x i8] c"cannot execvp cpp\00"
@.str.9 = [17 x i8] c"wait() returned\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = shl i32 %0, 4
%6 = or i32 %5, 8
%7 = tail call i8** @malloc(i32 %6)
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %7
%8 = shl i32 %0, 3
%9 = tail call i8** @malloc(i32 %8)
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %9
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 45
br i1 %13, label %14, label %55
14: ; preds = %2, %45
%15 = phi i8* [ %52, %45 ], [ %11, %2 ]
%16 = phi i32 [ %49, %45 ], [ 1, %2 ]
%17 = phi i32 [ %47, %45 ], [ 1, %2 ]
%18 = phi i32 [ %46, %45 ], [ 1, %2 ]
%19 = getelementptr inbounds i8, i8* %15, i64 1
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
switch i32 %21, label %45 [
i32 68, label %22
i32 111, label %24
i32 114, label %24
i32 115, label %24
i32 100, label %29
i32 45, label %55
]
22: ; preds = %14
%23 = add nsw i32 %17, 1
br label %36
24: ; preds = %14, %14, %14
%25 = add nsw i32 %16, 1
%26 = add nsw i32 %18, 1
%27 = sext i32 %18 to i64
%28 = getelementptr inbounds i8*, i8** %9, i64 %27
store i8* %15, i8** %28
br label %29
29: ; preds = %14, %24
%30 = phi i32 [ %18, %14 ], [ %26, %24 ]
%31 = phi i32 [ %16, %14 ], [ %25, %24 ]
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8*, i8** %1, i64 %32
%34 = load i8*, i8** %33
%35 = add nsw i32 %30, 1
br label %36
36: ; preds = %29, %22
%37 = phi i32 [ %17, %22 ], [ %30, %29 ]
%38 = phi i8** [ %7, %22 ], [ %9, %29 ]
%39 = phi i8* [ %15, %22 ], [ %34, %29 ]
%40 = phi i32 [ %18, %22 ], [ %35, %29 ]
%41 = phi i32 [ %23, %22 ], [ %17, %29 ]
%42 = phi i32 [ %16, %22 ], [ %31, %29 ]
%43 = sext i32 %37 to i64
%44 = getelementptr inbounds i8*, i8** %38, i64 %43
store i8* %39, i8** %44
br label %45
45: ; preds = %36, %14
%46 = phi i32 [ %18, %14 ], [ %40, %36 ]
%47 = phi i32 [ %17, %14 ], [ %41, %36 ]
%48 = phi i32 [ %16, %14 ], [ %42, %36 ]
%49 = add nsw i32 %48, 1
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8*, i8** %1, i64 %50
%52 = load i8*, i8** %51
%53 = load i8, i8* %52
%54 = icmp eq i8 %53, 45
br i1 %54, label %14, label %55
55: ; preds = %14, %45, %2
%56 = phi i32 [ 1, %2 ], [ %47, %45 ], [ %17, %14 ]
%57 = phi i32 [ 1, %2 ], [ %49, %45 ], [ %16, %14 ]
%58 = icmp slt i32 %57, %0
br i1 %58, label %62, label %59
59: ; preds = %55
%60 = load i8*, i8** %1
%61 = tail call i32 @usage(i8* %60)
br label %62
62: ; preds = %59, %55
%63 = add i32 %0, -1
%64 = icmp slt i32 %57, %63
%65 = sext i32 %57 to i64
br i1 %64, label %66, label %108
66: ; preds = %62
%67 = sext i32 %56 to i64
%68 = sext i32 %63 to i64
%69 = sub nsw i64 %68, %65
%70 = xor i64 %65, -1
%71 = and i64 %69, 1
%72 = icmp eq i64 %71, 0
br i1 %72, label %81, label %73
73: ; preds = %66
%74 = add nsw i64 %67, 1
%75 = getelementptr inbounds i8*, i8** %7, i64 %67
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %75
%76 = getelementptr inbounds i8*, i8** %1, i64 %65
%77 = load i8*, i8** %76
%78 = add nsw i64 %67, 2
%79 = getelementptr inbounds i8*, i8** %7, i64 %74
store i8* %77, i8** %79
%80 = add nsw i64 %65, 1
br label %81
81: ; preds = %73, %66
%82 = phi i64 [ undef, %66 ], [ %78, %73 ]
%83 = phi i64 [ %67, %66 ], [ %78, %73 ]
%84 = phi i64 [ %65, %66 ], [ %80, %73 ]
%85 = sub nsw i64 0, %68
%86 = icmp eq i64 %70, %85
br i1 %86, label %105, label %87
87: ; preds = %81, %87
%88 = phi i64 [ %101, %87 ], [ %83, %81 ]
%89 = phi i64 [ %103, %87 ], [ %84, %81 ]
%90 = add nsw i64 %88, 1
%91 = getelementptr inbounds i8*, i8** %7, i64 %88
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %91
%92 = getelementptr inbounds i8*, i8** %1, i64 %89
%93 = load i8*, i8** %92
%94 = add nsw i64 %88, 2
%95 = getelementptr inbounds i8*, i8** %7, i64 %90
store i8* %93, i8** %95
%96 = add nsw i64 %89, 1
%97 = add nsw i64 %88, 3
%98 = getelementptr inbounds i8*, i8** %7, i64 %94
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %98
%99 = getelementptr inbounds i8*, i8** %1, i64 %96
%100 = load i8*, i8** %99
%101 = add nsw i64 %88, 4
%102 = getelementptr inbounds i8*, i8** %7, i64 %97
store i8* %100, i8** %102
%103 = add nsw i64 %89, 2
%104 = icmp eq i64 %103, %68
br i1 %104, label %105, label %87
105: ; preds = %87, %81
%106 = phi i64 [ %82, %81 ], [ %101, %87 ]
%107 = trunc i64 %106 to i32
br label %108
108: ; preds = %62, %105
%109 = phi i64 [ %68, %105 ], [ %65, %62 ]
%110 = phi i32 [ %107, %105 ], [ %56, %62 ]
%111 = getelementptr inbounds i8*, i8** %1, i64 %109
%112 = load i8*, i8** %111
%113 = add nsw i32 %110, 1
%114 = sext i32 %110 to i64
%115 = getelementptr inbounds i8*, i8** %7, i64 %114
store i8* %112, i8** %115
%116 = add nsw i32 %110, 2
%117 = sext i32 %113 to i64
%118 = getelementptr inbounds i8*, i8** %7, i64 %117
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8** %118
%119 = sext i32 %116 to i64
%120 = getelementptr inbounds i8*, i8** %7, i64 %119
store i8* null, i8** %120
%121 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%122 = call i32 @pipe(i32* %121)
%123 = icmp eq i32 %122, -1
br i1 %123, label %124, label %129
124: ; preds = %108
%125 = load i32, i32* @stderr
%126 = load i8*, i8** %1
%127 = call i32 (i32, i8*, ...) @fprintf(i32 %125, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %126, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%128 = call i32 @exit(i32 1)
unreachable
129: ; preds = %108
%130 = call i32 (...) @fork()
switch i32 %130, label %147 [
i32 0, label %131
i32 -1, label %142
]
131: ; preds = %129
%132 = call i32 @close(i32 0)
%133 = load i32, i32* %121
%134 = call i32 @dup(i32 %133)
%135 = load i32, i32* %121
%136 = call i32 @close(i32 %135)
%137 = call i32 @execvp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %9)
%138 = load i32, i32* @stderr
%139 = load i8*, i8** %1
%140 = call i32 (i32, i8*, ...) @fprintf(i32 %138, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %139, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
%141 = call i32 @exit(i32 1)
unreachable
142: ; preds = %129
%143 = load i32, i32* @stderr
%144 = load i8*, i8** %1
%145 = call i32 (i32, i8*, ...) @fprintf(i32 %143, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %144, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%146 = call i32 @exit(i32 1)
unreachable
147: ; preds = %129
%148 = call i32 (...) @fork()
switch i32 %148, label %170 [
i32 0, label %149
i32 -1, label %163
]
149: ; preds = %147
%150 = call i32 @close(i32 1)
%151 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%152 = load i32, i32* %151
%153 = call i32 @dup(i32 %152)
%154 = load i32, i32* %151
%155 = call i32 @close(i32 %154)
%156 = call i32 @execvp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %7)
%157 = load i32, i32* @SIGHUP
%158 = call i32 @kill(i32 %130, i32 %157)
%159 = load i32, i32* @stderr
%160 = load i8*, i8** %1
%161 = call i32 (i32, i8*, ...) @fprintf(i32 %159, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %160, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
%162 = call i32 @exit(i32 1)
unreachable
163: ; preds = %147
%164 = load i32, i32* @SIGHUP
%165 = call i32 @kill(i32 %130, i32 %164)
%166 = load i32, i32* @stderr
%167 = load i8*, i8** %1
%168 = call i32 (i32, i8*, ...) @fprintf(i32 %166, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %167, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%169 = call i32 @exit(i32 1)
unreachable
170: ; preds = %147
%171 = load i32, i32* %121
%172 = call i32 @close(i32 %171)
%173 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%174 = load i32, i32* %173
%175 = call i32 @close(i32 %174)
%176 = call i32 @wait(i32* null)
%177 = load i32, i32* @stderr
%178 = call i32 (i32, i8*, ...) @fprintf(i32 %177, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0))
%179 = call i32 @wait(i32* null)
%180 = call i32 @exit(i32 0)
unreachable
}