#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*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
scalar_t__ ferror(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  FILE *in, *out;
  char buf[256];
  int len;
  int c;
  int line = 1;
  if (argc != 3) {
    printf("\nUsage: makehelp <infile> <outfile>\n");
    return 1;
  }
  in = fopen(argv[1], "rb");
  if (!in) {
    printf("\nError opening %s\n", argv[1]);
    return 1;
  }
  out = fopen(argv[2], "w");
  if (!in) {
    fclose(in);
    printf("\nError opening %s\n", argv[2]);
    return 1;
  }
  fprintf(out, "/* output from the makehelp utility program */\n\n");
  fprintf(out, "#include \"fed.h\"\n\n");
  fprintf(out, "char *help_text[] = \n{\n");
  len = 0;
  while (!feof(in)) {
    c = getc(in);
    if (ferror(in)) {
      printf("%s: file I/O error!\n", argv[1]);
      return 1;
    }
    if (len + 1 >= sizeof(buf)) {
      printf("%s:%d: line length too long\n", argv[1], line);
      return 1;
    }
    if ((c == '\r') || (c == '\n')) {
      if (c == '\r') {
        c = getc(in);
        if (c != '\n')
          ungetc(c, in);
      }
      buf[len] = 0;
      len = 0;
      if ((buf[0] == '#') || ((buf[0] == ' ') && (buf[1] == '#')))
        fprintf(out, "%s\n", buf);
      else
        fprintf(out, "   \"%s\",\n", buf);
      line++;
    } else if (c == '\t') {
      do {
        buf[len++] = ' ';
      } while (len != (len & 0xfff8));
    } else if (c == '"') {
      buf[len++] = '\\';
      buf[len++] = '"';
    } else if (c == '\\') {
      buf[len++] = c;
      c = getc(in);
      if (c == '@') {
        buf[len - 1] = '"';
      } else {
        if ((c != '\\') && (c != 'r') && (c != 'n') && (c != 't')) {
          printf("%s:%d: Warning: \\ will be interpreted as a control code\n",
                 argv[1], line);
          ungetc(c, in);
        } else
          buf[len++] = c;
      }
    } else {
      if (c == 0)
        printf("%s:%d: Warning: NULL will be interpreted as end of line\n",
               argv[1], line);
      buf[len++] = c;
    }
  }
  fprintf(out, "   NULL,\n};\n\n");
  fclose(in);
  fclose(out);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x12c(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11c7 <main+0x47>
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1637 <main+0x4b7>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe4f(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    120c <main+0x8c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1637 <main+0x4b7>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe20(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    125a <main+0xda>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xde1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1637 <main+0x4b7>
mov    -0x20(%rbp),%rdi
lea    0xdd8(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xdf7(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xdf8(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x124(%rbp)
mov    -0x18(%rbp),%rdi
call   1070 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    12b8 <main+0x138>
jmp    160c <main+0x48c>
mov    -0x18(%rbp),%rdi
call   10a0 <getc@plt>
mov    %eax,-0x128(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <ferror@plt>
cmp    $0x0,%rax
je     12fc <main+0x17c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xdb0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1637 <main+0x4b7>
mov    -0x124(%rbp),%eax
add    $0x1,%eax
cltq
cmp    $0x100,%rax
jb     133b <main+0x1bb>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x12c(%rbp),%edx
lea    0xd86(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1637 <main+0x4b7>
cmpl   $0xd,-0x128(%rbp)
je     1355 <main+0x1d5>
cmpl   $0xa,-0x128(%rbp)
jne    1426 <main+0x2a6>
cmpl   $0xd,-0x128(%rbp)
jne    1392 <main+0x212>
mov    -0x18(%rbp),%rdi
call   10a0 <getc@plt>
mov    %eax,-0x128(%rbp)
cmpl   $0xa,-0x128(%rbp)
je     138d <main+0x20d>
mov    -0x128(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1080 <ungetc@plt>
jmp    1392 <main+0x212>
movslq -0x124(%rbp),%rax
movb   $0x0,-0x120(%rbp,%rax,1)
movl   $0x0,-0x124(%rbp)
movsbl -0x120(%rbp),%eax
cmp    $0x23,%eax
je     13db <main+0x25b>
movsbl -0x120(%rbp),%eax
cmp    $0x20,%eax
jne    13f9 <main+0x279>
movsbl -0x11f(%rbp),%eax
cmp    $0x23,%eax
jne    13f9 <main+0x279>
mov    -0x20(%rbp),%rdi
lea    -0x120(%rbp),%rdx
lea    0xc4a(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    1412 <main+0x292>
mov    -0x20(%rbp),%rdi
lea    -0x120(%rbp),%rdx
lea    0xcc0(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x12c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12c(%rbp)
jmp    1607 <main+0x487>
cmpl   $0x9,-0x128(%rbp)
jne    1472 <main+0x2f2>
jmp    1438 <main+0x2b8>
mov    -0x124(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x124(%rbp)
cltq
movb   $0x20,-0x120(%rbp,%rax,1)
20
mov    -0x124(%rbp),%eax
mov    -0x124(%rbp),%ecx
and    $0xfff8,%ecx
cmp    %ecx,%eax
jne    1438 <main+0x2b8>
jmp    1602 <main+0x482>
cmpl   $0x22,-0x128(%rbp)
jne    14ba <main+0x33a>
mov    -0x124(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x124(%rbp)
cltq
movb   $0x5c,-0x120(%rbp,%rax,1)
5c
mov    -0x124(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x124(%rbp)
cltq
movb   $0x22,-0x120(%rbp,%rax,1)
22
jmp    15fd <main+0x47d>
cmpl   $0x5c,-0x128(%rbp)
jne    15ad <main+0x42d>
mov    -0x128(%rbp),%eax
mov    %al,%cl
mov    -0x124(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x124(%rbp)
cltq
mov    %cl,-0x120(%rbp,%rax,1)
mov    -0x18(%rbp),%rdi
call   10a0 <getc@plt>
mov    %eax,-0x128(%rbp)
cmpl   $0x40,-0x128(%rbp)
jne    151d <main+0x39d>
mov    -0x124(%rbp),%eax
sub    $0x1,%eax
cltq
movb   $0x22,-0x120(%rbp,%rax,1)
22
jmp    15a8 <main+0x428>
cmpl   $0x5c,-0x128(%rbp)
je     1581 <main+0x401>
cmpl   $0x72,-0x128(%rbp)
je     1581 <main+0x401>
cmpl   $0x6e,-0x128(%rbp)
je     1581 <main+0x401>
cmpl   $0x74,-0x128(%rbp)
je     1581 <main+0x401>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x12c(%rbp),%edx
lea    0xb6f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x128(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1080 <ungetc@plt>
jmp    15a3 <main+0x423>
mov    -0x128(%rbp),%eax
mov    %al,%cl
mov    -0x124(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x124(%rbp)
cltq
mov    %cl,-0x120(%rbp,%rax,1)
jmp    15a8 <main+0x428>
jmp    15f8 <main+0x478>
cmpl   $0x0,-0x128(%rbp)
jne    15d6 <main+0x456>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x12c(%rbp),%edx
lea    0xb3f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x128(%rbp),%eax
mov    %al,%cl
mov    -0x124(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x124(%rbp)
cltq
mov    %cl,-0x120(%rbp,%rax,1)
jmp    15fd <main+0x47d>
jmp    1602 <main+0x482>
jmp    1607 <main+0x487>
jmp    129a <main+0x11a>
mov    -0x20(%rbp),%rdi
lea    0xb30(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
cmp    $0x3,%edi
jne    127a <main+0xda>
mov    %rsi,%r14
mov    0x8(%rsi),%rdi
lea    0xec4(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1288 <main+0xe8>
mov    %rax,%rbx
mov    0x10(%r14),%rdi
lea    0xebe(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbp
lea    0xeb1(%rip),%rdi
mov    $0x30,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10b0 <fwrite@plt>
lea    0xec9(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   10b0 <fwrite@plt>
lea    0xec3(%rip),%rdi
mov    $0x17,%esi
mov    $0x1,%edx
mov    %rbp,0x8(%rsp)
mov    %rbp,%rcx
call   10b0 <fwrite@plt>
mov    %rbx,%rdi
call   1080 <feof@plt>
test   %eax,%eax
je     12b1 <main+0x111>
lea    0xf5f(%rip),%rdi
mov    $0xd,%esi
mov    $0x1,%edx
mov    0x8(%rsp),%rbp
mov    %rbp,%rcx
call   10b0 <fwrite@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    %rbp,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
jmp    129f <main+0xff>
lea    0xf3b(%rip),%rdi
call   1030 <puts@plt>
jmp    129a <main+0xfa>
mov    0x8(%r14),%rsi
lea    0xdfc(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movl   $0x1,0x4(%rsp)
xor    %ebp,%ebp
jmp    12ec <main+0x14c>
nopl   (%rax)
xor    %r12d,%r12d
mov    0x8(%rsp),%rdi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
addl   $0x1,0x4(%rsp)
mov    %rbx,%rdi
call   1080 <feof@plt>
mov    %r12d,%ebp
test   %eax,%eax
jne    1248 <main+0xa8>
mov    %rbx,%rdi
call   10c0 <getc@plt>
mov    %eax,%r13d
mov    %rbx,%rdi
call   1040 <ferror@plt>
test   %rax,%rax
jne    1479 <main+0x2d9>
movslq %ebp,%r15
lea    0x1(%r15),%r12
cmp    $0x100,%r12d
jae    1489 <main+0x2e9>
cmp    $0x22,%r13d
ja     1350 <main+0x1b0>
mov    %r13d,%eax
lea    0xcd4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x8(%r14),%rsi
lea    0xe35(%rip),%rdi
mov    0x4(%rsp),%edx
xor    %eax,%eax
call   1060 <printf@plt>
jmp    13a0 <main+0x200>
nopl   (%rax)
cmp    $0x5c,%r13d
jne    13a0 <main+0x200>
movb   $0x5c,0x10(%rsp,%r15,1)
mov    %rbx,%rdi
call   10c0 <getc@plt>
mov    %eax,%r13d
add    $0xffffffc0,%eax
cmp    $0x34,%eax
ja     1453 <main+0x2b3>
movabs $0x14400010000000,%rcx
bt     %rax,%rcx
jae    1443 <main+0x2a3>
add    $0x2,%ebp
mov    %r13b,0x10(%rsp,%r12,1)
mov    %ebp,%r12d
jmp    12d9 <main+0x139>
nopw   0x0(%rax,%rax,1)
mov    %r13b,0x10(%rsp,%r15,1)
jmp    12d9 <main+0x139>
lea    (%rsp,%r15,1),%rax
add    $0x10,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x20,(%rax)
add    $0x1,%ebp
add    $0x1,%rax
test   $0xffff0007,%ebp
jne    13c0 <main+0x220>
mov    %ebp,%r12d
jmp    12d9 <main+0x139>
mov    %rbx,%rdi
call   10c0 <getc@plt>
cmp    $0xa,%eax
je     13f1 <main+0x251>
mov    %eax,%edi
mov    %rbx,%rsi
call   1090 <ungetc@plt>
movb   $0x0,0x10(%rsp,%r15,1)
mov    0x10(%rsp),%al
lea    0xc9c(%rip),%rsi
cmp    $0x23,%al
je     12c0 <main+0x120>
xor    $0x20,%al
mov    0x11(%rsp),%cl
xor    $0x23,%cl
or     %al,%cl
lea    0xd16(%rip),%rsi
lea    0xc7b(%rip),%rax
cmove  %rax,%rsi
jmp    12c0 <main+0x120>
movb   $0x5c,0x10(%rsp,%r15,1)
add    $0x2,%ebp
movb   $0x22,0x10(%rsp,%r12,1)
mov    %ebp,%r12d
jmp    12d9 <main+0x139>
test   %rax,%rax
jne    1453 <main+0x2b3>
movb   $0x22,0x10(%rsp,%r15,1)
jmp    12d9 <main+0x139>
mov    0x8(%r14),%rsi
lea    0xcde(%rip),%rdi
mov    0x4(%rsp),%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r13d,%edi
mov    %rbx,%rsi
call   1090 <ungetc@plt>
jmp    12d9 <main+0x139>
mov    0x8(%r14),%rsi
lea    0xc7c(%rip),%rdi
jmp    1293 <main+0xf3>
mov    0x8(%r14),%rsi
lea    0xc81(%rip),%rdi
mov    0x4(%rsp),%edx
xor    %eax,%eax
call   1060 <printf@plt>
jmp    129a <main+0xfa>

LLVM IR (-O0):
@.str = [37 x i8] c"\0AUsage: makehelp <infile> <outfile>\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [19 x i8] c"\0AError opening %s\0A\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [49 x i8] c"/* output from the makehelp utility program */\0A\0A\00"
@.str.5 = [19 x i8] c"#include \22fed.h\22\0A\0A\00"
@.str.6 = [24 x i8] c"char *help_text[] = \0A{\0A\00"
@.str.7 = [21 x i8] c"%s: file I/O error!\0A\00"
@.str.8 = [29 x i8] c"%s:%d: line length too long\0A\00"
@.str.9 = [4 x i8] c"%s\0A\00"
@.str.10 = [10 x i8] c" \22%s\22,\0A\00"
@.str.11 = [57 x i8] c"%s:%d: Warning: \\ will be interpreted as a control code\0A\00"
@.str.12 = [57 x i8] c"%s:%d: Warning: NULL will be interpreted as end of line\0A\00"
@.str.13 = [14 x i8] c" NULL,\0A};\0A\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 [256 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %11
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 3
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %227
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32* @fopen(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %20, i32** %6
%21 = load i32*, i32** %6
%22 = icmp ne i32* %21, null
br i1 %22, label %28, label %23
23: ; preds = %16
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %26)
store i32 1, i32* %3
br label %227
28: ; preds = %16
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 2
%31 = load i8*, i8** %30
%32 = call i32* @fopen(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %32, i32** %7
%33 = load i32*, i32** %6
%34 = icmp ne i32* %33, null
br i1 %34, label %42, label %35
35: ; preds = %28
%36 = load i32*, i32** %6
%37 = call i32 @fclose(i32* %36)
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 2
%40 = load i8*, i8** %39
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %40)
store i32 1, i32* %3
br label %227
42: ; preds = %28
%43 = load i32*, i32** %7
%44 = call i32 (i32*, i8*, ...) @fprintf(i32* %43, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0))
%45 = load i32*, i32** %7
%46 = call i32 (i32*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%47 = load i32*, i32** %7
%48 = call i32 (i32*, i8*, ...) @fprintf(i32* %47, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %9
br label %49
49: ; preds = %219, %42
%50 = load i32*, i32** %6
%51 = call i32 @feof(i32* %50)
%52 = icmp ne i32 %51, 0
%53 = xor i1 %52, true
br i1 %53, label %54, label %220
54: ; preds = %49
%55 = load i32*, i32** %6
%56 = call i32 @getc(i32* %55)
store i32 %56, i32* %10
%57 = load i32*, i32** %6
%58 = call i64 @ferror(i32* %57)
%59 = icmp ne i64 %58, 0
br i1 %59, label %60, label %65
60: ; preds = %54
%61 = load i8**, i8*** %5
%62 = getelementptr inbounds i8*, i8** %61, i64 1
%63 = load i8*, i8** %62
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i8* %63)
store i32 1, i32* %3
br label %227
65: ; preds = %54
%66 = load i32, i32* %9
%67 = add nsw i32 %66, 1
%68 = sext i32 %67 to i64
%69 = icmp uge i64 %68, 256
br i1 %69, label %70, label %76
70: ; preds = %65
%71 = load i8**, i8*** %5
%72 = getelementptr inbounds i8*, i8** %71, i64 1
%73 = load i8*, i8** %72
%74 = load i32, i32* %11
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i8* %73, i32 %74)
store i32 1, i32* %3
br label %227
76: ; preds = %65
%77 = load i32, i32* %10
%78 = icmp eq i32 %77, 13
br i1 %78, label %82, label %79
79: ; preds = %76
%80 = load i32, i32* %10
%81 = icmp eq i32 %80, 10
br i1 %81, label %82, label %124
82: ; preds = %79, %76
%83 = load i32, i32* %10
%84 = icmp eq i32 %83, 13
br i1 %84, label %85, label %95
85: ; preds = %82
%86 = load i32*, i32** %6
%87 = call i32 @getc(i32* %86)
store i32 %87, i32* %10
%88 = load i32, i32* %10
%89 = icmp ne i32 %88, 10
br i1 %89, label %90, label %94
90: ; preds = %85
%91 = load i32, i32* %10
%92 = load i32*, i32** %6
%93 = call i32 @ungetc(i32 %91, i32* %92)
br label %94
94: ; preds = %90, %85
br label %95
95: ; preds = %94, %82
%96 = load i32, i32* %9
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %97
store i8 0, i8* %98
store i32 0, i32* %9
%99 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%100 = load i8, i8* %99
%101 = sext i8 %100 to i32
%102 = icmp eq i32 %101, 35
br i1 %102, label %113, label %103
103: ; preds = %95
%104 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%105 = load i8, i8* %104
%106 = sext i8 %105 to i32
%107 = icmp eq i32 %106, 32
br i1 %107, label %108, label %117
108: ; preds = %103
%109 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 1
%110 = load i8, i8* %109
%111 = sext i8 %110 to i32
%112 = icmp eq i32 %111, 35
br i1 %112, label %113, label %117
113: ; preds = %108, %95
%114 = load i32*, i32** %7
%115 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%116 = call i32 (i32*, i8*, ...) @fprintf(i32* %114, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* %115)
br label %121
117: ; preds = %108, %103
%118 = load i32*, i32** %7
%119 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%120 = call i32 (i32*, i8*, ...) @fprintf(i32* %118, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i8* %119)
br label %121
121: ; preds = %117, %113
%122 = load i32, i32* %11
%123 = add nsw i32 %122, 1
store i32 %123, i32* %11
br label %219
124: ; preds = %79
%125 = load i32, i32* %10
%126 = icmp eq i32 %125, 9
br i1 %126, label %127, label %139
127: ; preds = %124
br label %128
128: ; preds = %133, %127
%129 = load i32, i32* %9
%130 = add nsw i32 %129, 1
store i32 %130, i32* %9
%131 = sext i32 %129 to i64
%132 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %131
store i8 32, i8* %132
br label %133
133: ; preds = %128
%134 = load i32, i32* %9
%135 = load i32, i32* %9
%136 = and i32 %135, 65528
%137 = icmp ne i32 %134, %136
br i1 %137, label %128, label %138
138: ; preds = %133
br label %218
139: ; preds = %124
%140 = load i32, i32* %10
%141 = icmp eq i32 %140, 34
br i1 %141, label %142, label %151
142: ; preds = %139
%143 = load i32, i32* %9
%144 = add nsw i32 %143, 1
store i32 %144, i32* %9
%145 = sext i32 %143 to i64
%146 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %145
store i8 92, i8* %146
%147 = load i32, i32* %9
%148 = add nsw i32 %147, 1
store i32 %148, i32* %9
%149 = sext i32 %147 to i64
%150 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %149
store i8 34, i8* %150
br label %217
151: ; preds = %139
%152 = load i32, i32* %10
%153 = icmp eq i32 %152, 92
br i1 %153, label %154, label %200
154: ; preds = %151
%155 = load i32, i32* %10
%156 = trunc i32 %155 to i8
%157 = load i32, i32* %9
%158 = add nsw i32 %157, 1
store i32 %158, i32* %9
%159 = sext i32 %157 to i64
%160 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %159
store i8 %156, i8* %160
%161 = load i32*, i32** %6
%162 = call i32 @getc(i32* %161)
store i32 %162, i32* %10
%163 = load i32, i32* %10
%164 = icmp eq i32 %163, 64
br i1 %164, label %165, label %170
165: ; preds = %154
%166 = load i32, i32* %9
%167 = sub nsw i32 %166, 1
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %168
store i8 34, i8* %169
br label %199
170: ; preds = %154
%171 = load i32, i32* %10
%172 = icmp ne i32 %171, 92
br i1 %172, label %173, label %191
173: ; preds = %170
%174 = load i32, i32* %10
%175 = icmp ne i32 %174, 114
br i1 %175, label %176, label %191
176: ; preds = %173
%177 = load i32, i32* %10
%178 = icmp ne i32 %177, 110
br i1 %178, label %179, label %191
179: ; preds = %176
%180 = load i32, i32* %10
%181 = icmp ne i32 %180, 116
br i1 %181, label %182, label %191
182: ; preds = %179
%183 = load i8**, i8*** %5
%184 = getelementptr inbounds i8*, i8** %183, i64 1
%185 = load i8*, i8** %184
%186 = load i32, i32* %11
%187 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.11, i64 0, i64 0), i8* %185, i32 %186)
%188 = load i32, i32* %10
%189 = load i32*, i32** %6
%190 = call i32 @ungetc(i32 %188, i32* %189)
br label %198
191: ; preds = %179, %176, %173, %170
%192 = load i32, i32* %10
%193 = trunc i32 %192 to i8
%194 = load i32, i32* %9
%195 = add nsw i32 %194, 1
store i32 %195, i32* %9
%196 = sext i32 %194 to i64
%197 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %196
store i8 %193, i8* %197
br label %198
198: ; preds = %191, %182
br label %199
199: ; preds = %198, %165
br label %216
200: ; preds = %151
%201 = load i32, i32* %10
%202 = icmp eq i32 %201, 0
br i1 %202, label %203, label %209
203: ; preds = %200
%204 = load i8**, i8*** %5
%205 = getelementptr inbounds i8*, i8** %204, i64 1
%206 = load i8*, i8** %205
%207 = load i32, i32* %11
%208 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.12, i64 0, i64 0), i8* %206, i32 %207)
br label %209
209: ; preds = %203, %200
%210 = load i32, i32* %10
%211 = trunc i32 %210 to i8
%212 = load i32, i32* %9
%213 = add nsw i32 %212, 1
store i32 %213, i32* %9
%214 = sext i32 %212 to i64
%215 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %214
store i8 %211, i8* %215
br label %216
216: ; preds = %209, %199
br label %217
217: ; preds = %216, %142
br label %218
218: ; preds = %217, %138
br label %219
219: ; preds = %218, %121
br label %49
220: ; preds = %49
%221 = load i32*, i32** %7
%222 = call i32 (i32*, i8*, ...) @fprintf(i32* %221, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0))
%223 = load i32*, i32** %6
%224 = call i32 @fclose(i32* %223)
%225 = load i32*, i32** %7
%226 = call i32 @fclose(i32* %225)
store i32 0, i32* %3
br label %227
227: ; preds = %220, %70, %60, %35, %23, %14
%228 = load i32, i32* %3
ret i32 %228
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [19 x i8] c"\0AError opening %s\0A\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [49 x i8] c"/* output from the makehelp utility program */\0A\0A\00"
@.str.5 = [19 x i8] c"#include \22fed.h\22\0A\0A\00"
@.str.6 = [24 x i8] c"char *help_text[] = \0A{\0A\00"
@.str.7 = [21 x i8] c"%s: file I/O error!\0A\00"
@.str.8 = [29 x i8] c"%s:%d: line length too long\0A\00"
@.str.9 = [4 x i8] c"%s\0A\00"
@.str.10 = [10 x i8] c" \22%s\22,\0A\00"
@.str.11 = [57 x i8] c"%s:%d: Warning: \\ will be interpreted as a control code\0A\00"
@.str.12 = [57 x i8] c"%s:%d: Warning: NULL will be interpreted as end of line\0A\00"
@.str.13 = [14 x i8] c" NULL,\0A};\0A\0A\00"
@str = [36 x i8] c"\0AUsage: makehelp <infile> <outfile>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 3
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
br label %109
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32* @fopen(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i8*, i8** %9
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %14)
br label %109
16: ; preds = %8
%17 = getelementptr inbounds i8*, i8** %1, i64 2
%18 = load i8*, i8** %17
%19 = tail call i32* @fopen(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%20 = tail call i64 @fwrite(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0), i64 48, i64 1, i32* %19)
%21 = tail call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i64 18, i64 1, i32* %19)
%22 = tail call i64 @fwrite(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i64 23, i64 1, i32* %19)
%23 = call i32 @feof(i32* %11)
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %105
25: ; preds = %16
%26 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 1
br label %27
27: ; preds = %25, %100
%28 = phi i32 [ 1, %25 ], [ %102, %100 ]
%29 = phi i32 [ 0, %25 ], [ %101, %100 ]
%30 = call i32 @getc(i32* %11)
%31 = call i64 @ferror(i32* %11)
%32 = icmp eq i64 %31, 0
br i1 %32, label %36, label %33
33: ; preds = %27
%34 = load i8*, i8** %9
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i8* %34)
br label %109
36: ; preds = %27
%37 = add nsw i32 %29, 1
%38 = sext i32 %37 to i64
%39 = icmp ugt i32 %37, 255
br i1 %39, label %40, label %43
40: ; preds = %36
%41 = load i8*, i8** %9
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i8* %41, i32 %28)
br label %109
43: ; preds = %36
switch i32 %30, label %94 [
i32 13, label %46
i32 10, label %51
i32 9, label %44
i32 34, label %73
i32 92, label %78
i32 0, label %91
]
44: ; preds = %43
%45 = sext i32 %29 to i64
br label %66
46: ; preds = %43
%47 = call i32 @getc(i32* %11)
%48 = icmp eq i32 %47, 10
br i1 %48, label %51, label %49
49: ; preds = %46
%50 = call i32 @ungetc(i32 %47, i32* %11)
br label %51
51: ; preds = %43, %46, %49
%52 = sext i32 %29 to i64
%53 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %52
store i8 0, i8* %53
%54 = load i8, i8* %4
%55 = icmp eq i8 %54, 35
br i1 %55, label %62, label %56
56: ; preds = %51
%57 = icmp eq i8 %54, 32
%58 = load i8, i8* %26
%59 = icmp eq i8 %58, 35
%60 = select i1 %57, i1 %59, i1 false
%61 = select i1 %60, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0)
br label %62
62: ; preds = %56, %51
%63 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), %51 ], [ %61, %56 ]
%64 = call i32 (i32*, i8*, ...) @fprintf(i32* %19, i8* %63, i8* %4)
%65 = add nsw i32 %28, 1
br label %100
66: ; preds = %44, %66
%67 = phi i64 [ %45, %44 ], [ %68, %66 ]
%68 = add i64 %67, 1
%69 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %67
store i8 32, i8* %69
%70 = trunc i64 %68 to i32
%71 = and i32 %70, 65528
%72 = icmp eq i32 %71, %70
br i1 %72, label %98, label %66
73: ; preds = %43
%74 = sext i32 %29 to i64
%75 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %74
store i8 92, i8* %75
%76 = add nsw i32 %29, 2
%77 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %38
store i8 34, i8* %77
br label %100
78: ; preds = %43
%79 = sext i32 %29 to i64
%80 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %79
store i8 92, i8* %80
%81 = call i32 @getc(i32* %11)
switch i32 %81, label %83 [
i32 64, label %82
i32 116, label %87
i32 114, label %87
i32 110, label %87
i32 92, label %87
]
82: ; preds = %78
store i8 34, i8* %80
br label %100
83: ; preds = %78
%84 = load i8*, i8** %9
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.11, i64 0, i64 0), i8* %84, i32 %28)
%86 = call i32 @ungetc(i32 %81, i32* %11)
br label %100
87: ; preds = %78, %78, %78, %78
%88 = trunc i32 %81 to i8
%89 = add nsw i32 %29, 2
%90 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %38
store i8 %88, i8* %90
br label %100
91: ; preds = %43
%92 = load i8*, i8** %9
%93 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.12, i64 0, i64 0), i8* %92, i32 %28)
br label %94
94: ; preds = %43, %91
%95 = trunc i32 %30 to i8
%96 = sext i32 %29 to i64
%97 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %96
store i8 %95, i8* %97
br label %100
98: ; preds = %66
%99 = trunc i64 %68 to i32
br label %100
100: ; preds = %98, %94, %83, %87, %82, %73, %62
%101 = phi i32 [ 0, %62 ], [ %76, %73 ], [ %37, %82 ], [ %37, %83 ], [ %89, %87 ], [ %37, %94 ], [ %99, %98 ]
%102 = phi i32 [ %65, %62 ], [ %28, %73 ], [ %28, %82 ], [ %28, %83 ], [ %28, %87 ], [ %28, %94 ], [ %28, %98 ]
%103 = call i32 @feof(i32* %11)
%104 = icmp eq i32 %103, 0
br i1 %104, label %27, label %105
105: ; preds = %100, %16
%106 = call i64 @fwrite(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0), i64 13, i64 1, i32* %19)
%107 = call i32 @fclose(i32* %11)
%108 = call i32 @fclose(i32* %19)
br label %109
109: ; preds = %105, %40, %33, %13, %6
%110 = phi i32 [ 1, %6 ], [ 1, %33 ], [ 1, %40 ], [ 0, %105 ], [ 1, %13 ]
ret i32 %110
}