#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 */
scalar_t__ chdir(int /*<<< orphan*/);
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ getenv(char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ waitpid(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  char buf[1024];
  char *vec[8192];
  char *fvec[200];
  char **svec;
  char type[64];
  int i;
  int vp = 2;
  pid_t pid;
  if (chdir(getenv("TOPDIR"))) {
    perror("chdir");
    exit(1);
  }
  vec[0] = "kernel-doc";
  vec[1] = "-docbook";
  for (i = 1; vp < 8189; i++) {
    if (argv[i] == NULL)
      break;
    vec[vp++] = type;
    vec[vp++] = argv[i];
  }
  vec[vp++] = buf + 2;
  vec[vp++] = NULL;
  while (fgets(buf, 1024, stdin)) {
    if (*buf != '!') {
      printf("%s", buf);
      continue;
    }
    fflush(stdout);
    svec = vec;
    if (buf[1] == 'E')
      strcpy(type, "-function");
    else if (buf[1] == 'I')
      strcpy(type, "-nofunction");
    else if (buf[1] == 'F') {
      int snarf = 0;
      fvec[0] = "kernel-doc";
      fvec[1] = "-docbook";
      strcpy(type, "-function");
      vp = 2;
      for (i = 2; buf[i]; i++) {
        if (buf[i] == ' ' || buf[i] == '\n') {
          buf[i] = '\0';
          snarf = 1;
          continue;
        }
        if (snarf) {
          snarf = 0;
          fvec[vp++] = type;
          fvec[vp++] = &buf[i];
        }
      }
      fvec[vp++] = &buf[2];
      fvec[vp] = NULL;
      svec = fvec;
    } else {
      fprintf(stderr, "Unknown ! escape.\n");
      exit(1);
    }
    switch (pid = fork()) {
    case -1:
      perror("fork");
      exit(1);
    case 0:
      execvp("scripts/kernel-doc", svec);
      perror("exec scripts/kernel-doc");
      exit(1);
    default:
      waitpid(pid, NULL, 0);
    }
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10ac0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x10aa8(%rbp)
lea    0xe16(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1050 <chdir@plt>
cmp    $0x0,%rax
je     1216 <main+0x56>
lea    0xe00(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
lea    0xe37(%rip),%rax
mov    %rax,-0x10410(%rbp)
lea    0xde2(%rip),%rax
mov    %rax,-0x10408(%rbp)
movl   $0x1,-0x10aa4(%rbp)
cmpl   $0x1ffd,-0x10aa8(%rbp)
jge    12c7 <main+0x107>
mov    -0x10(%rbp),%rax
movslq -0x10aa4(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
jne    1267 <main+0xa7>
jmp    12c7 <main+0x107>
lea    -0x10aa0(%rbp),%rcx
mov    -0x10aa8(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x10aa8(%rbp)
cltq
mov    %rcx,-0x10410(%rbp,%rax,8)
ff
mov    -0x10(%rbp),%rax
movslq -0x10aa4(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
mov    -0x10aa8(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x10aa8(%rbp)
cltq
mov    %rcx,-0x10410(%rbp,%rax,8)
ff
mov    -0x10aa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10aa4(%rbp)
jmp    123c <main+0x7c>
lea    -0x410(%rbp),%rcx
add    $0x2,%rcx
mov    -0x10aa8(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x10aa8(%rbp)
cltq
mov    %rcx,-0x10410(%rbp,%rax,8)
ff
mov    -0x10aa8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x10aa8(%rbp)
cltq
movq   $0x0,-0x10410(%rbp,%rax,8)
lea    -0x410(%rbp),%rdi
mov    0x2cce(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     1602 <main+0x442>
movsbl -0x410(%rbp),%eax
cmp    $0x21,%eax
je     1358 <main+0x198>
lea    -0x410(%rbp),%rsi
lea    0xcc8(%rip),%rdi
call   1060 <printf@plt>
jmp    130c <main+0x14c>
mov    0x2c71(%rip),%rax
mov    (%rax),%edi
call   1090 <fflush@plt>
lea    -0x10410(%rbp),%rax
mov    %rax,-0x10a58(%rbp)
movsbl -0x40f(%rbp),%eax
cmp    $0x45,%eax
jne    139c <main+0x1dc>
lea    -0x10aa0(%rbp),%rdi
lea    0xc87(%rip),%rsi
call   1040 <strcpy@plt>
jmp    1577 <main+0x3b7>
movsbl -0x40f(%rbp),%eax
cmp    $0x49,%eax
jne    13c4 <main+0x204>
lea    -0x10aa0(%rbp),%rdi
lea    0xc69(%rip),%rsi
call   1040 <strcpy@plt>
jmp    1572 <main+0x3b2>
movsbl -0x40f(%rbp),%eax
cmp    $0x46,%eax
jne    154e <main+0x38e>
movl   $0x0,-0x10ab0(%rbp)
lea    0xc6f(%rip),%rax
mov    %rax,-0x10a50(%rbp)
lea    0xc1a(%rip),%rax
mov    %rax,-0x10a48(%rbp)
lea    -0x10aa0(%rbp),%rdi
lea    0xc11(%rip),%rsi
call   1040 <strcpy@plt>
movl   $0x2,-0x10aa8(%rbp)
movl   $0x2,-0x10aa4(%rbp)
movslq -0x10aa4(%rbp),%rax
cmpb   $0x0,-0x410(%rbp,%rax,1)
je     1502 <main+0x342>
movslq -0x10aa4(%rbp),%rax
movsbl -0x410(%rbp,%rax,1),%eax
ff
cmp    $0x20,%eax
je     1466 <main+0x2a6>
movslq -0x10aa4(%rbp),%rax
movsbl -0x410(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
jne    1484 <main+0x2c4>
movslq -0x10aa4(%rbp),%rax
movb   $0x0,-0x410(%rbp,%rax,1)
movl   $0x1,-0x10ab0(%rbp)
jmp    14ee <main+0x32e>
cmpl   $0x0,-0x10ab0(%rbp)
je     14e9 <main+0x329>
movl   $0x0,-0x10ab0(%rbp)
lea    -0x10aa0(%rbp),%rcx
mov    -0x10aa8(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x10aa8(%rbp)
cltq
mov    %rcx,-0x10a50(%rbp,%rax,8)
ff
movslq -0x10aa4(%rbp),%rax
lea    -0x410(%rbp),%rcx
add    %rax,%rcx
mov    -0x10aa8(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x10aa8(%rbp)
cltq
mov    %rcx,-0x10a50(%rbp,%rax,8)
ff
jmp    14ee <main+0x32e>
mov    -0x10aa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10aa4(%rbp)
jmp    1421 <main+0x261>
lea    -0x410(%rbp),%rcx
add    $0x2,%rcx
mov    -0x10aa8(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x10aa8(%rbp)
cltq
mov    %rcx,-0x10a50(%rbp,%rax,8)
ff
movslq -0x10aa8(%rbp),%rax
movq   $0x0,-0x10a50(%rbp,%rax,8)
lea    -0x10a50(%rbp),%rax
mov    %rax,-0x10a58(%rbp)
jmp    156d <main+0x3ad>
mov    0x2a83(%rip),%rax
mov    (%rax),%edi
lea    0xad1(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
jmp    1572 <main+0x3b2>
jmp    1577 <main+0x3b7>
xor    %eax,%eax
call   10e0 <fork@plt>
mov    %eax,-0x10aac(%rbp)
mov    %eax,%ecx
mov    %ecx,-0x10ab4(%rbp)
sub    $0xffffffff,%eax
je     15ad <main+0x3ed>
jmp    159a <main+0x3da>
mov    -0x10ab4(%rbp),%eax
test   %eax,%eax
je     15c3 <main+0x403>
jmp    15ec <main+0x42c>
lea    0xa8e(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x10a58(%rbp),%rsi
lea    0xa7b(%rip),%rdi
call   10c0 <execvp@plt>
lea    0xa6a(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x10aac(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   10a0 <waitpid@plt>
jmp    130c <main+0x14c>
xor    %edi,%edi
call   10d0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10a88,%rsp
mov    %rsi,%rbx
lea    0xe25(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1050 <chdir@plt>
test   %rax,%rax
jne    1257 <main+0x97>
lea    0xe61(%rip),%rax
mov    %rax,0xa80(%rsp)
lea    0xe0b(%rip),%rax
mov    %rax,0xa88(%rsp)
xor    %eax,%eax
mov    %rsp,%rbp
nop
mov    0x8(%rbx,%rax,4),%rcx
test   %rcx,%rcx
je     126d <main+0xad>
mov    %rbp,0xa90(%rsp,%rax,8)
mov    %rcx,0xa98(%rsp,%rax,8)
mov    0x10(%rbx,%rax,4),%rcx
test   %rcx,%rcx
je     1273 <main+0xb3>
mov    %rbp,0xaa0(%rsp,%rax,8)
mov    %rcx,0xaa8(%rsp,%rax,8)
add    $0x4,%rax
cmp    $0x1ffc,%rax
jne    1210 <main+0x50>
mov    $0x1ffe,%eax
jmp    1277 <main+0xb7>
lea    0xda9(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
add    $0x2,%rax
jmp    1277 <main+0xb7>
add    $0x4,%rax
lea    0x42(%rsp),%rdx
mov    %eax,%ecx
or     $0x1,%eax
mov    %rdx,0xa80(%rsp,%rcx,8)
movq   $0x0,0xa80(%rsp,%rax,8)
mov    0x2d4c(%rip),%r14
mov    (%r14),%edx
lea    0x40(%rsp),%rdi
mov    $0x400,%esi
call   1070 <fgets@plt>
test   %rax,%rax
jne    12ba <main+0xfa>
xor    %edi,%edi
call   10d0 <exit@plt>
mov    0x2d0f(%rip),%r15
lea    0x40(%rsp),%r12
lea    0xd49(%rip),%r13
jmp    12f0 <main+0x130>
nop
mov    %r13,%rdi
mov    %r12,%rsi
call   1060 <printf@plt>
mov    (%r14),%edx
mov    %r12,%rdi
mov    $0x400,%esi
call   1070 <fgets@plt>
test   %rax,%rax
je     12b3 <main+0xf3>
cmpb   $0x21,0x40(%rsp)
jne    12d0 <main+0x110>
mov    (%r15),%edi
call   1090 <fflush@plt>
mov    0x41(%rsp),%al
cmp    $0x49,%al
je     131f <main+0x15f>
cmp    $0x46,%al
je     133b <main+0x17b>
cmp    $0x45,%al
jne    1427 <main+0x267>
mov    %rbp,%rdi
lea    0xcfc(%rip),%rsi
jmp    1329 <main+0x169>
mov    %rbp,%rdi
lea    0xcfa(%rip),%rsi
call   1040 <strcpy@plt>
lea    0xa80(%rsp),%rbx
jmp    13e0 <main+0x220>
lea    0xd12(%rip),%rax
mov    %rax,0x440(%rsp)
lea    0xcbc(%rip),%rax
mov    %rax,0x448(%rsp)
mov    %rbp,%rdi
lea    0xcb6(%rip),%rsi
call   1040 <strcpy@plt>
xor    %esi,%esi
mov    $0x2,%eax
lea    0x42(%rsp),%rcx
jmp    138e <main+0x1ce>
cs nopw 0x0(%rax,%rax,1)
movb   $0x0,(%rcx)
mov    $0x1,%edx
add    $0x1,%rcx
mov    %edx,%esi
movzbl (%rcx),%edx
cmp    $0xa,%dl
je     1380 <main+0x1c0>
cmp    $0x20,%dl
je     1380 <main+0x1c0>
test   %dl,%dl
je     13bd <main+0x1fd>
xor    %edx,%edx
test   %esi,%esi
je     1388 <main+0x1c8>
movslq %eax,%rsi
mov    %rbp,0x440(%rsp,%rsi,8)
add    $0x2,%eax
mov    %rcx,0x448(%rsp,%rsi,8)
jmp    1388 <main+0x1c8>
cltq
lea    0x42(%rsp),%rcx
mov    %rcx,0x440(%rsp,%rax,8)
movq   $0x0,0x448(%rsp,%rax,8)
lea    0x440(%rsp),%rbx
xor    %eax,%eax
call   10e0 <fork@plt>
test   %eax,%eax
je     1400 <main+0x240>
cmp    $0xffffffff,%eax
je     141b <main+0x25b>
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
call   10a0 <waitpid@plt>
jmp    12db <main+0x11b>
lea    0xc45(%rip),%rdi
mov    %rbx,%rsi
call   10c0 <execvp@plt>
lea    0xc31(%rip),%rdi
jmp    125e <main+0x9e>
lea    0xc20(%rip),%rdi
jmp    125e <main+0x9e>
mov    0x2baa(%rip),%rax
mov    (%rax),%edi
lea    0xbf8(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"TOPDIR\00"
@.str.1 = [6 x i8] c"chdir\00"
@.str.2 = [11 x i8] c"kernel-doc\00"
@.str.3 = [9 x i8] c"-docbook\00"
@stdin = global i32 0
@.str.4 = [3 x i8] c"%s\00"
@stdout = global i32 0
@.str.5 = [10 x i8] c"-function\00"
@.str.6 = [12 x i8] c"-nofunction\00"
@stderr = global i32 0
@.str.7 = [19 x i8] c"Unknown ! escape.\0A\00"
@.str.8 = [5 x i8] c"fork\00"
@.str.9 = [19 x i8] c"scripts/kernel-doc\00"
@.str.10 = [24 x i8] c"exec scripts/kernel-doc\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = alloca [8192 x i8*]
%5 = alloca [200 x i8*]
%6 = alloca [64 x i8]
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = bitcast [8192 x i8*]* %4 to i8*
%9 = bitcast [200 x i8*]* %5 to i8*
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%11 = tail call i32 @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%12 = tail call i64 @chdir(i32 %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %2
%15 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%16 = tail call i32 @exit(i32 1)
unreachable
17: ; preds = %2
%18 = getelementptr inbounds [8192 x i8*], [8192 x i8*]* %4, i64 0, i64 0
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8** %18
%19 = getelementptr inbounds [8192 x i8*], [8192 x i8*]* %4, i64 0, i64 1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8** %19
br label %20
20: ; preds = %35, %17
%21 = phi i64 [ 1, %17 ], [ %40, %35 ]
%22 = phi i64 [ 2, %17 ], [ %38, %35 ]
%23 = getelementptr inbounds i8*, i8** %1, i64 %21
%24 = load i8*, i8** %23
%25 = icmp eq i8* %24, null
br i1 %25, label %42, label %26
26: ; preds = %20
%27 = or i64 %22, 1
%28 = getelementptr inbounds [8192 x i8*], [8192 x i8*]* %4, i64 0, i64 %22
store i8* %10, i8** %28
%29 = add nuw nsw i64 %22, 2
%30 = getelementptr inbounds [8192 x i8*], [8192 x i8*]* %4, i64 0, i64 %27
store i8* %24, i8** %30
%31 = add nuw nsw i64 %21, 1
%32 = getelementptr inbounds i8*, i8** %1, i64 %31
%33 = load i8*, i8** %32
%34 = icmp eq i8* %33, null
br i1 %34, label %42, label %35
35: ; preds = %26
%36 = or i64 %29, 1
%37 = getelementptr inbounds [8192 x i8*], [8192 x i8*]* %4, i64 0, i64 %29
store i8* %10, i8** %37
%38 = add nuw nsw i64 %22, 4
%39 = getelementptr inbounds [8192 x i8*], [8192 x i8*]* %4, i64 0, i64 %36
store i8* %33, i8** %39
%40 = add nuw nsw i64 %21, 2
%41 = icmp eq i64 %40, 4095
br i1 %41, label %45, label %20
42: ; preds = %26, %20
%43 = phi i64 [ %22, %20 ], [ %29, %26 ]
%44 = trunc i64 %43 to i32
br label %45
45: ; preds = %35, %42
%46 = phi i32 [ %44, %42 ], [ 8190, %35 ]
%47 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 2
%48 = or i32 %46, 1
%49 = zext i32 %46 to i64
%50 = getelementptr inbounds [8192 x i8*], [8192 x i8*]* %4, i64 0, i64 %49
store i8* %47, i8** %50
%51 = zext i32 %48 to i64
%52 = getelementptr inbounds [8192 x i8*], [8192 x i8*]* %4, i64 0, i64 %51
store i8* null, i8** %52
%53 = load i32, i32* @stdin
%54 = call i64 @fgets(i8* %7, i32 1024, i32 %53)
%55 = icmp eq i64 %54, 0
br i1 %55, label %121, label %56
56: ; preds = %45
%57 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 1
%58 = getelementptr inbounds [200 x i8*], [200 x i8*]* %5, i64 0, i64 0
%59 = getelementptr inbounds [200 x i8*], [200 x i8*]* %5, i64 0, i64 1
br label %60
60: ; preds = %56, %65
%61 = load i8, i8* %7
%62 = icmp eq i8 %61, 33
br i1 %62, label %69, label %63
63: ; preds = %60
%64 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %7)
br label %65
65: ; preds = %63, %119
%66 = load i32, i32* @stdin
%67 = call i64 @fgets(i8* %7, i32 1024, i32 %66)
%68 = icmp eq i64 %67, 0
br i1 %68, label %121, label %60
69: ; preds = %60
%70 = load i32, i32* @stdout
%71 = call i32 @fflush(i32 %70)
%72 = load i8, i8* %57
switch i8 %72, label %105 [
i8 69, label %73
i8 73, label %75
i8 70, label %77
]
73: ; preds = %69
%74 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %109
75: ; preds = %69
%76 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
br label %109
77: ; preds = %69
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8** %58
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8** %59
%78 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %79
79: ; preds = %95, %77
%80 = phi i64 [ %98, %95 ], [ 2, %77 ]
%81 = phi i32 [ %96, %95 ], [ 2, %77 ]
%82 = phi i32 [ %97, %95 ], [ 0, %77 ]
%83 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %80
%84 = load i8, i8* %83
switch i8 %84, label %86 [
i8 0, label %99
i8 32, label %85
i8 10, label %85
]
85: ; preds = %79, %79
store i8 0, i8* %83
br label %95
86: ; preds = %79
%87 = icmp eq i32 %82, 0
br i1 %87, label %95, label %88
88: ; preds = %86
%89 = add nsw i32 %81, 1
%90 = sext i32 %81 to i64
%91 = getelementptr inbounds [200 x i8*], [200 x i8*]* %5, i64 0, i64 %90
store i8* %10, i8** %91
%92 = add nsw i32 %81, 2
%93 = sext i32 %89 to i64
%94 = getelementptr inbounds [200 x i8*], [200 x i8*]* %5, i64 0, i64 %93
store i8* %83, i8** %94
br label %95
95: ; preds = %86, %88, %85
%96 = phi i32 [ %81, %85 ], [ %92, %88 ], [ %81, %86 ]
%97 = phi i32 [ 1, %85 ], [ 0, %88 ], [ 0, %86 ]
%98 = add nuw i64 %80, 1
br label %79
99: ; preds = %79
%100 = add nsw i32 %81, 1
%101 = sext i32 %81 to i64
%102 = getelementptr inbounds [200 x i8*], [200 x i8*]* %5, i64 0, i64 %101
store i8* %47, i8** %102
%103 = sext i32 %100 to i64
%104 = getelementptr inbounds [200 x i8*], [200 x i8*]* %5, i64 0, i64 %103
store i8* null, i8** %104
br label %109
105: ; preds = %69
%106 = load i32, i32* @stderr
%107 = call i32 @fprintf(i32 %106, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
%108 = call i32 @exit(i32 1)
unreachable
109: ; preds = %75, %99, %73
%110 = phi i8** [ %18, %73 ], [ %18, %75 ], [ %58, %99 ]
%111 = call i32 (...) @fork()
switch i32 %111, label %119 [
i32 -1, label %112
i32 0, label %115
]
112: ; preds = %109
%113 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%114 = call i32 @exit(i32 1)
unreachable
115: ; preds = %109
%116 = call i32 @execvp(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i8** %110)
%117 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0))
%118 = call i32 @exit(i32 1)
unreachable
119: ; preds = %109
%120 = call i32 @waitpid(i32 %111, i32* null, i32 0)
br label %65
121: ; preds = %65, %45
%122 = call i32 @exit(i32 0)
unreachable
}