#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*/ FILE;

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ remove(char *);
int /*<<< orphan*/ stderr;
char *strchr(char *, char);
size_t strlen(char *);
char *strpbrk(char *, char *);
int main(int argc, char *argv[]) {
  FILE *in, *out;
  int i;
  char *str;
  char *strp;
  char *charp;
  int fline;
  int line = 0;
  int lindex = 0;
  size_t len;
  if (argc < 4) {
    fprintf(stderr, "Usage: %s <out> <var> <file> [<file> ...]\n", argv[0]);
    return EXIT_FAILURE;
  }
  out = fopen(argv[1], "wt");
  if (!out) {
    fprintf(stderr, "Could not open `%s'.\n", argv[1]);
    return EXIT_FAILURE;
  }
  str = malloc(1024);
  fprintf(out,
          "/* This file auto-generated from standard.mac by genmacro.c"
          " - don't edit it */\n\n#include <stddef.h>\n\n"
          "static const char *%s[] = {\n",
          argv[2]);
  for (i = 3; i < argc; i++) {
    in = fopen(argv[i], "rt");
    if (!in) {
      fprintf(stderr, "Could not open `%s'.\n", argv[i]);
      fclose(out);
      remove(argv[1]);
      return EXIT_FAILURE;
    }
    fline = 0;
    while (fgets(str, 1024, in)) {
      line++;
      fline++;
      strp = str;
      charp = strp;
      while ((charp = strpbrk(charp, "'\";"))) {
        if (charp[0] == ';') {
          *charp = '\0';
          break;
        }
        if ((charp = strchr(charp + 1, charp[0])) == NULL) {
          fprintf(stderr, "%s:%d: error: unterminated quote\n", argv[i], fline);
          fclose(out);
          remove(argv[1]);
          return EXIT_FAILURE;
        }
        charp++;
      }
      while (*strp == ' ' || *strp == '\t')
        strp++;
      len = strlen(strp);
      while (len > 0 && (strp[len - 1] == ' ' || strp[len - 1] == '\t' ||
                         strp[len - 1] == '\n')) {
        strp[len - 1] = '\0';
        len--;
      }
      if (len == 0)
        continue;
      fprintf(out, "    \"");
      while (*strp != '\0') {
        if (*strp == '\\' || *strp == '"')
          fputc('\\', out);
        fputc(*strp, out);
        strp++;
      }
      fprintf(out, "\",\n");
      lindex++;
    }
    fclose(in);
  }
  fprintf(out, "    NULL\n};\n");
  fclose(out);
  free(str);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    120e <main+0x5e>
mov    0x2dfb(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe0a(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    0x2dd4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    15ed <main+0x43d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe0e(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1262 <main+0xb2>
mov    0x2da8(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xde4(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    0x2d80(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    15ed <main+0x43d>
mov    $0x400,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xdc1(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movl   $0x3,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    15bd <main+0x40d>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe16(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    130f <main+0x15f>
mov    0x2d15(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xd4d(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <remove@plt>
mov    0x2cd3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    15ed <main+0x43d>
movl   $0x0,-0x44(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x400,%esi
call   1090 <fgets@plt>
cmp    $0x0,%rax
je     15a6 <main+0x3f6>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
lea    0xd6a(%rip),%rsi
call   10c0 <strpbrk@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
je     140f <main+0x25f>
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3b,%eax
jne    138e <main+0x1de>
mov    -0x40(%rbp),%rax
movb   $0x0,(%rax)
jmp    140f <main+0x25f>
mov    -0x40(%rbp),%rdi
add    $0x1,%rdi
mov    -0x40(%rbp),%rax
movsbl (%rax),%esi
call   1070 <strchr@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
jne    13fe <main+0x24e>
mov    0x2c29(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x44(%rbp),%ecx
lea    0xcfd(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <remove@plt>
mov    0x2be4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    15ed <main+0x43d>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    1354 <main+0x1a4>
jmp    1414 <main+0x264>
mov    -0x38(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x59(%rbp)
je     1439 <main+0x289>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x59(%rbp)
mov    -0x59(%rbp),%al
test   $0x1,%al
jne    1449 <main+0x299>
jmp    145a <main+0x2aa>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1414 <main+0x264>
mov    -0x38(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,-0x58(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x58(%rbp)
mov    %al,-0x5a(%rbp)
jbe    14d2 <main+0x322>
mov    -0x38(%rbp),%rax
mov    -0x58(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x5b(%rbp)
je     14cc <main+0x31c>
mov    -0x38(%rbp),%rax
mov    -0x58(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x5b(%rbp)
je     14cc <main+0x31c>
mov    -0x38(%rbp),%rax
mov    -0x58(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x5b(%rbp)
mov    -0x5b(%rbp),%al
mov    %al,-0x5a(%rbp)
mov    -0x5a(%rbp),%al
test   $0x1,%al
jne    14e2 <main+0x332>
jmp    1503 <main+0x353>
mov    -0x38(%rbp),%rax
mov    -0x58(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x58(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x58(%rbp)
jmp    1467 <main+0x2b7>
cmpq   $0x0,-0x58(%rbp)
jne    1513 <main+0x363>
jmp    1316 <main+0x166>
mov    -0x20(%rbp),%rdi
lea    0xbd1(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1586 <main+0x3d6>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
je     1555 <main+0x3a5>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    1563 <main+0x3b3>
mov    -0x20(%rbp),%rsi
mov    $0x5c,%edi
call   1080 <fputc@plt>
mov    -0x38(%rbp),%rax
mov    (%rax),%al
mov    -0x20(%rbp),%rsi
movsbl %al,%edi
call   1080 <fputc@plt>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1525 <main+0x375>
mov    -0x20(%rbp),%rdi
lea    0xb64(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1316 <main+0x166>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1291 <main+0xe1>
mov    -0x20(%rbp),%rdi
lea    0xb31(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    0x29e8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r15
cmp    $0x3,%edi
jg     11ef <main+0x2f>
mov    0x2e03(%rip),%rax
movslq (%rax),%rdi
mov    (%r15),%rdx
lea    0xe16(%rip),%rsi
jmp    148c <main+0x2cc>
mov    %edi,%ebp
mov    0x8(%r15),%rdi
lea    0xe2f(%rip),%rsi
call   10d0 <fopen@plt>
test   %rax,%rax
je     1477 <main+0x2b7>
mov    %rax,%rbx
mov    $0x400,%edi
call   10b0 <malloc@plt>
mov    %rax,%r14
mov    0x10(%r15),%rdx
lea    0xe1f(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    %ebp,%eax
mov    %rax,0x20(%rsp)
mov    $0x3,%eax
lea    0xe84(%rip),%rsi
lea    0xe80(%rip),%r13
movabs $0x100000600,%r12
mov    %r15,0x18(%rsp)
mov    %rax,0x10(%rsp)
mov    (%r15,%rax,8),%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
je     14ab <main+0x2eb>
mov    %rax,%rbp
mov    %r14,%rdi
mov    $0x400,%esi
mov    %rax,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     13e0 <main+0x220>
xor    %eax,%eax
jmp    12ad <main+0xed>
nop
mov    %r14,%rdi
mov    $0x400,%esi
mov    %rbp,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
mov    0xc(%rsp),%eax
je     13e0 <main+0x220>
add    $0x1,%eax
mov    %eax,0xc(%rsp)
mov    %r14,%rdi
mov    %r13,%rsi
call   10c0 <strpbrk@plt>
mov    %r14,%r15
test   %rax,%rax
je     1324 <main+0x164>
nopw   0x0(%rax,%rax,1)
movzbl (%rax),%ecx
cmp    $0x3b,%cl
je     1310 <main+0x150>
add    $0x1,%rax
movsbl %cl,%esi
mov    %rax,%rdi
call   1070 <strchr@plt>
test   %rax,%rax
je     143a <main+0x27a>
add    $0x1,%rax
mov    %rax,%rdi
mov    %r13,%rsi
call   10c0 <strpbrk@plt>
test   %rax,%rax
jne    12d0 <main+0x110>
jmp    1313 <main+0x153>
cs nopw 0x0(%rax,%rax,1)
movb   $0x0,(%rax)
mov    %r14,%r15
jmp    1324 <main+0x164>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15
movzbl (%r15),%eax
cmp    $0x20,%al
je     1320 <main+0x160>
cmp    $0x9,%al
je     1320 <main+0x160>
mov    %r15,%rdi
call   1060 <strlen@plt>
test   %rax,%rax
je     1290 <main+0xd0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl -0x1(%r15,%rax,1),%ecx
cmp    $0x20,%rcx
ja     1373 <main+0x1b3>
bt     %rcx,%r12
jae    1373 <main+0x1b3>
movb   $0x0,-0x1(%r15,%rax,1)
add    $0xffffffffffffffff,%rax
jne    1350 <main+0x190>
jmp    1290 <main+0xd0>
mov    $0x5,%esi
mov    $0x1,%edx
lea    0xd6b(%rip),%rdi
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
jmp    13b0 <main+0x1f0>
xchg   %ax,%ax
mov    $0x5c,%edi
mov    %rbx,%rsi
call   1080 <fputc@plt>
movzbl (%r15),%eax
movsbl %al,%edi
mov    %rbx,%rsi
call   1080 <fputc@plt>
add    $0x1,%r15
movzbl (%r15),%eax
cmp    $0x22,%al
je     1390 <main+0x1d0>
cmp    $0x5c,%al
je     1390 <main+0x1d0>
test   %al,%al
jne    13a1 <main+0x1e1>
mov    $0x3,%esi
mov    $0x1,%edx
lea    0xd24(%rip),%rdi
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
jmp    1290 <main+0xd0>
xchg   %ax,%ax
mov    %rbp,%rdi
call   1050 <fclose@plt>
mov    0x10(%rsp),%rax
add    $0x1,%rax
cmp    0x20(%rsp),%rax
mov    0x18(%rsp),%r15
lea    0xcc4(%rip),%rsi
jne    1258 <main+0x98>
lea    0xcea(%rip),%rdi
mov    $0xc,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    0x2b98(%rip),%rax
jmp    149a <main+0x2da>
mov    0x10(%rsp),%eax
mov    0x2b9b(%rip),%rcx
movslq (%rcx),%rdi
mov    0x18(%rsp),%rbp
mov    0x0(%rbp,%rax,8),%rdx
lea    0xc74(%rip),%rsi
mov    0xc(%rsp),%ecx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    0x8(%rbp),%rdi
call   1040 <remove@plt>
jmp    1493 <main+0x2d3>
mov    0x2b62(%rip),%rax
movslq (%rax),%rdi
mov    0x8(%r15),%rdx
lea    0xba2(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    0x2b3e(%rip),%rax
mov    (%rax),%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x10(%rsp),%eax
mov    0x2b2a(%rip),%rcx
movslq (%rcx),%rdi
mov    (%r15,%rax,8),%rdx
lea    0xb6a(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    0x8(%r15),%rdi
jmp    1470 <main+0x2b0>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"Usage: %s <out> <var> <file> [<file> ...]\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [3 x i8] c"wt\00"
@.str.2 = [22 x i8] c"Could not open `%s'.\0A\00"
@.str.3 = [130 x i8] c"/* This file auto-generated from standard.mac by genmacro.c - don't edit it */\0A\0A#include <stddef.h>\0A\0Astatic const char *%s[] = {\0A\00"
@.str.4 = [3 x i8] c"rt\00"
@.str.5 = [4 x i8] c"'\22;\00"
@.str.6 = [34 x i8] c"%s:%d: error: unterminated quote\0A\00"
@.str.7 = [6 x i8] c" \22\00"
@.str.8 = [4 x i8] c"\22,\0A\00"
@.str.9 = [13 x i8] c" NULL\0A};\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %13
store i32 0, i32* %14
%16 = load i32, i32* %4
%17 = icmp slt i32 %16, 4
br i1 %17, label %18, label %27
18: ; preds = %2
%19 = load i32, i32* @stderr
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = load i32, i32* @EXIT_FAILURE
store i32 %26, i32* %3
br label %242
27: ; preds = %2
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i32* @fopen(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %31, i32** %7
%32 = load i32*, i32** %7
%33 = icmp ne i32* %32, null
br i1 %33, label %43, label %34
34: ; preds = %27
%35 = load i32, i32* @stderr
%36 = sext i32 %35 to i64
%37 = inttoptr i64 %36 to i32*
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 1
%40 = load i8*, i8** %39
%41 = call i32 (i32*, i8*, ...) @fprintf(i32* %37, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %40)
%42 = load i32, i32* @EXIT_FAILURE
store i32 %42, i32* %3
br label %242
43: ; preds = %27
%44 = call i8* @malloc(i32 1024)
store i8* %44, i8** %9
%45 = load i32*, i32** %7
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 2
%48 = load i8*, i8** %47
%49 = call i32 (i32*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str.3, i64 0, i64 0), i8* %48)
store i32 3, i32* %8
br label %50
50: ; preds = %231, %43
%51 = load i32, i32* %8
%52 = load i32, i32* %4
%53 = icmp slt i32 %51, %52
br i1 %53, label %54, label %234
54: ; preds = %50
%55 = load i8**, i8*** %5
%56 = load i32, i32* %8
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8*, i8** %55, i64 %57
%59 = load i8*, i8** %58
%60 = call i32* @fopen(i8* %59, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32* %60, i32** %6
%61 = load i32*, i32** %6
%62 = icmp ne i32* %61, null
br i1 %62, label %80, label %63
63: ; preds = %54
%64 = load i32, i32* @stderr
%65 = sext i32 %64 to i64
%66 = inttoptr i64 %65 to i32*
%67 = load i8**, i8*** %5
%68 = load i32, i32* %8
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i8*, i8** %67, i64 %69
%71 = load i8*, i8** %70
%72 = call i32 (i32*, i8*, ...) @fprintf(i32* %66, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %71)
%73 = load i32*, i32** %7
%74 = call i32 @fclose(i32* %73)
%75 = load i8**, i8*** %5
%76 = getelementptr inbounds i8*, i8** %75, i64 1
%77 = load i8*, i8** %76
%78 = call i32 @remove(i8* %77)
%79 = load i32, i32* @EXIT_FAILURE
store i32 %79, i32* %3
br label %242
80: ; preds = %54
store i32 0, i32* %12
br label %81
81: ; preds = %223, %194, %80
%82 = load i8*, i8** %9
%83 = load i32*, i32** %6
%84 = call i64 @fgets(i8* %82, i32 1024, i32* %83)
%85 = icmp ne i64 %84, 0
br i1 %85, label %86, label %228
86: ; preds = %81
%87 = load i32, i32* %13
%88 = add nsw i32 %87, 1
store i32 %88, i32* %13
%89 = load i32, i32* %12
%90 = add nsw i32 %89, 1
store i32 %90, i32* %12
%91 = load i8*, i8** %9
store i8* %91, i8** %10
%92 = load i8*, i8** %10
store i8* %92, i8** %11
br label %93
93: ; preds = %131, %86
%94 = load i8*, i8** %11
%95 = call i8* @strpbrk(i8* %94, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
store i8* %95, i8** %11
%96 = icmp ne i8* %95, null
br i1 %96, label %97, label %134
97: ; preds = %93
%98 = load i8*, i8** %11
%99 = getelementptr inbounds i8, i8* %98, i64 0
%100 = load i8, i8* %99
%101 = sext i8 %100 to i32
%102 = icmp eq i32 %101, 59
br i1 %102, label %103, label %105
103: ; preds = %97
%104 = load i8*, i8** %11
store i8 0, i8* %104
br label %134
105: ; preds = %97
%106 = load i8*, i8** %11
%107 = getelementptr inbounds i8, i8* %106, i64 1
%108 = load i8*, i8** %11
%109 = getelementptr inbounds i8, i8* %108, i64 0
%110 = load i8, i8* %109
%111 = call i8* @strchr(i8* %107, i8 signext %110)
store i8* %111, i8** %11
%112 = icmp eq i8* %111, null
br i1 %112, label %113, label %131
113: ; preds = %105
%114 = load i32, i32* @stderr
%115 = sext i32 %114 to i64
%116 = inttoptr i64 %115 to i32*
%117 = load i8**, i8*** %5
%118 = load i32, i32* %8
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds i8*, i8** %117, i64 %119
%121 = load i8*, i8** %120
%122 = load i32, i32* %12
%123 = call i32 (i32*, i8*, ...) @fprintf(i32* %116, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i8* %121, i32 %122)
%124 = load i32*, i32** %7
%125 = call i32 @fclose(i32* %124)
%126 = load i8**, i8*** %5
%127 = getelementptr inbounds i8*, i8** %126, i64 1
%128 = load i8*, i8** %127
%129 = call i32 @remove(i8* %128)
%130 = load i32, i32* @EXIT_FAILURE
store i32 %130, i32* %3
br label %242
131: ; preds = %105
%132 = load i8*, i8** %11
%133 = getelementptr inbounds i8, i8* %132, i32 1
store i8* %133, i8** %11
br label %93
134: ; preds = %103, %93
br label %135
135: ; preds = %147, %134
%136 = load i8*, i8** %10
%137 = load i8, i8* %136
%138 = sext i8 %137 to i32
%139 = icmp eq i32 %138, 32
br i1 %139, label %145, label %140
140: ; preds = %135
%141 = load i8*, i8** %10
%142 = load i8, i8* %141
%143 = sext i8 %142 to i32
%144 = icmp eq i32 %143, 9
br label %145
145: ; preds = %140, %135
%146 = phi i1 [ true, %135 ], [ %144, %140 ]
br i1 %146, label %147, label %150
147: ; preds = %145
%148 = load i8*, i8** %10
%149 = getelementptr inbounds i8, i8* %148, i32 1
store i8* %149, i8** %10
br label %135
150: ; preds = %145
%151 = load i8*, i8** %10
%152 = call i64 @strlen(i8* %151)
store i64 %152, i64* %15
br label %153
153: ; preds = %184, %150
%154 = load i64, i64* %15
%155 = icmp ugt i64 %154, 0
br i1 %155, label %156, label %182
156: ; preds = %153
%157 = load i8*, i8** %10
%158 = load i64, i64* %15
%159 = sub i64 %158, 1
%160 = getelementptr inbounds i8, i8* %157, i64 %159
%161 = load i8, i8* %160
%162 = sext i8 %161 to i32
%163 = icmp eq i32 %162, 32
br i1 %163, label %180, label %164
164: ; preds = %156
%165 = load i8*, i8** %10
%166 = load i64, i64* %15
%167 = sub i64 %166, 1
%168 = getelementptr inbounds i8, i8* %165, i64 %167
%169 = load i8, i8* %168
%170 = sext i8 %169 to i32
%171 = icmp eq i32 %170, 9
br i1 %171, label %180, label %172
172: ; preds = %164
%173 = load i8*, i8** %10
%174 = load i64, i64* %15
%175 = sub i64 %174, 1
%176 = getelementptr inbounds i8, i8* %173, i64 %175
%177 = load i8, i8* %176
%178 = sext i8 %177 to i32
%179 = icmp eq i32 %178, 10
br label %180
180: ; preds = %172, %164, %156
%181 = phi i1 [ true, %164 ], [ true, %156 ], [ %179, %172 ]
br label %182
182: ; preds = %180, %153
%183 = phi i1 [ false, %153 ], [ %181, %180 ]
br i1 %183, label %184, label %191
184: ; preds = %182
%185 = load i8*, i8** %10
%186 = load i64, i64* %15
%187 = sub i64 %186, 1
%188 = getelementptr inbounds i8, i8* %185, i64 %187
store i8 0, i8* %188
%189 = load i64, i64* %15
%190 = add i64 %189, -1
store i64 %190, i64* %15
br label %153
191: ; preds = %182
%192 = load i64, i64* %15
%193 = icmp eq i64 %192, 0
br i1 %193, label %194, label %195
194: ; preds = %191
br label %81
195: ; preds = %191
%196 = load i32*, i32** %7
%197 = call i32 (i32*, i8*, ...) @fprintf(i32* %196, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
br label %198
198: ; preds = %216, %195
%199 = load i8*, i8** %10
%200 = load i8, i8* %199
%201 = sext i8 %200 to i32
%202 = icmp ne i32 %201, 0
br i1 %202, label %203, label %223
203: ; preds = %198
%204 = load i8*, i8** %10
%205 = load i8, i8* %204
%206 = sext i8 %205 to i32
%207 = icmp eq i32 %206, 92
br i1 %207, label %213, label %208
208: ; preds = %203
%209 = load i8*, i8** %10
%210 = load i8, i8* %209
%211 = sext i8 %210 to i32
%212 = icmp eq i32 %211, 34
br i1 %212, label %213, label %216
213: ; preds = %208, %203
%214 = load i32*, i32** %7
%215 = call i32 @fputc(i8 signext 92, i32* %214)
br label %216
216: ; preds = %213, %208
%217 = load i8*, i8** %10
%218 = load i8, i8* %217
%219 = load i32*, i32** %7
%220 = call i32 @fputc(i8 signext %218, i32* %219)
%221 = load i8*, i8** %10
%222 = getelementptr inbounds i8, i8* %221, i32 1
store i8* %222, i8** %10
br label %198
223: ; preds = %198
%224 = load i32*, i32** %7
%225 = call i32 (i32*, i8*, ...) @fprintf(i32* %224, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%226 = load i32, i32* %14
%227 = add nsw i32 %226, 1
store i32 %227, i32* %14
br label %81
228: ; preds = %81
%229 = load i32*, i32** %6
%230 = call i32 @fclose(i32* %229)
br label %231
231: ; preds = %228
%232 = load i32, i32* %8
%233 = add nsw i32 %232, 1
store i32 %233, i32* %8
br label %50
234: ; preds = %50
%235 = load i32*, i32** %7
%236 = call i32 (i32*, i8*, ...) @fprintf(i32* %235, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
%237 = load i32*, i32** %7
%238 = call i32 @fclose(i32* %237)
%239 = load i8*, i8** %9
%240 = call i32 @free(i8* %239)
%241 = load i32, i32* @EXIT_SUCCESS
store i32 %241, i32* %3
br label %242
242: ; preds = %234, %113, %63, %34, %18
%243 = load i32, i32* %3
ret i32 %243
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"Usage: %s <out> <var> <file> [<file> ...]\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [3 x i8] c"wt\00"
@.str.2 = [22 x i8] c"Could not open `%s'.\0A\00"
@.str.3 = [130 x i8] c"/* This file auto-generated from standard.mac by genmacro.c - don't edit it */\0A\0A#include <stddef.h>\0A\0Astatic const char *%s[] = {\0A\00"
@.str.4 = [3 x i8] c"rt\00"
@.str.5 = [4 x i8] c"'\22;\00"
@.str.6 = [34 x i8] c"%s:%d: error: unterminated quote\0A\00"
@.str.7 = [6 x i8] c" \22\00"
@.str.8 = [4 x i8] c"\22,\0A\00"
@.str.9 = [13 x i8] c" NULL\0A};\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 4
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load i8*, i8** %1
%9 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %120
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32* @fopen(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i32* %13, null
br i1 %14, label %15, label %21
15: ; preds = %10
%16 = load i32, i32* @stderr
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
%19 = load i8*, i8** %11
%20 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %18, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %19)
br label %120
21: ; preds = %10
%22 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
%23 = getelementptr inbounds i8*, i8** %1, i64 2
%24 = load i8*, i8** %23
%25 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %13, i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str.3, i64 0, i64 0), i8* %24)
%26 = zext i32 %0 to i64
br label %27
27: ; preds = %21, %112
%28 = phi i64 [ 3, %21 ], [ %114, %112 ]
%29 = getelementptr inbounds i8*, i8** %1, i64 %28
%30 = load i8*, i8** %29
%31 = tail call i32* @fopen(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%32 = icmp eq i32* %31, null
br i1 %32, label %36, label %33
33: ; preds = %27
%34 = tail call i64 @fgets(i8* %22, i32 1024, i32* %31)
%35 = icmp eq i64 %34, 0
br i1 %35, label %112, label %51
36: ; preds = %27
%37 = and i64 %28, 4294967295
%38 = getelementptr inbounds i8*, i8** %1, i64 %37
%39 = load i32, i32* @stderr
%40 = sext i32 %39 to i64
%41 = inttoptr i64 %40 to i32*
%42 = load i8*, i8** %38
%43 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %41, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %42)
%44 = tail call i32 @fclose(i32* %13)
%45 = load i8*, i8** %11
%46 = tail call i32 @remove(i8* %45)
br label %120
47: ; preds = %94, %86
%48 = tail call i64 @fgets(i8* %22, i32 1024, i32* %31)
%49 = icmp eq i64 %48, 0
br i1 %49, label %112, label %50
50: ; preds = %47, %108
br label %51
51: ; preds = %33, %50
%52 = phi i32 [ %53, %50 ], [ 0, %33 ]
%53 = add nuw nsw i32 %52, 1
%54 = tail call i8* @strpbrk(i8* %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%55 = icmp eq i8* %54, null
br i1 %55, label %65, label %60
56: ; preds = %66
%57 = getelementptr inbounds i8, i8* %68, i64 1
%58 = tail call i8* @strpbrk(i8* %57, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%59 = icmp eq i8* %58, null
br i1 %59, label %65, label %60
60: ; preds = %51, %56
%61 = phi i8* [ %58, %56 ], [ %54, %51 ]
%62 = load i8, i8* %61
%63 = icmp eq i8 %62, 59
br i1 %63, label %64, label %66
64: ; preds = %60
store i8 0, i8* %61
br label %65
65: ; preds = %56, %51, %64
br label %81
66: ; preds = %60
%67 = getelementptr inbounds i8, i8* %61, i64 1
%68 = tail call i8* @strchr(i8* %67, i8 signext %62)
%69 = icmp eq i8* %68, null
br i1 %69, label %70, label %56
70: ; preds = %66
%71 = and i64 %28, 4294967295
%72 = getelementptr inbounds i8*, i8** %1, i64 %71
%73 = load i32, i32* @stderr
%74 = sext i32 %73 to i64
%75 = inttoptr i64 %74 to i32*
%76 = load i8*, i8** %72
%77 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %75, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i8* %76, i32 %53)
%78 = tail call i32 @fclose(i32* %13)
%79 = load i8*, i8** %11
%80 = tail call i32 @remove(i8* %79)
br label %120
81: ; preds = %65, %84
%82 = phi i8* [ %85, %84 ], [ %22, %65 ]
%83 = load i8, i8* %82
switch i8 %83, label %86 [
i8 32, label %84
i8 9, label %84
]
84: ; preds = %81, %81
%85 = getelementptr inbounds i8, i8* %82, i64 1
br label %81
86: ; preds = %81
%87 = tail call i64 @strlen(i8* %82)
%88 = icmp eq i64 %87, 0
br i1 %88, label %47, label %89
89: ; preds = %86, %94
%90 = phi i64 [ %91, %94 ], [ %87, %86 ]
%91 = add i64 %90, -1
%92 = getelementptr inbounds i8, i8* %82, i64 %91
%93 = load i8, i8* %92
switch i8 %93, label %96 [
i8 32, label %94
i8 9, label %94
i8 10, label %94
]
94: ; preds = %89, %89, %89
store i8 0, i8* %92
%95 = icmp eq i64 %91, 0
br i1 %95, label %47, label %89
96: ; preds = %89
%97 = tail call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i64 5, i64 1, i32* %13)
br label %98
98: ; preds = %104, %96
%99 = phi i8* [ %82, %96 ], [ %107, %104 ]
%100 = load i8, i8* %99
switch i8 %100, label %104 [
i8 0, label %108
i8 92, label %101
i8 34, label %101
]
101: ; preds = %98, %98
%102 = tail call i32 @fputc(i8 signext 92, i32* %13)
%103 = load i8, i8* %99
br label %104
104: ; preds = %98, %101
%105 = phi i8 [ %100, %98 ], [ %103, %101 ]
%106 = tail call i32 @fputc(i8 signext %105, i32* %13)
%107 = getelementptr inbounds i8, i8* %99, i64 1
br label %98
108: ; preds = %98
%109 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i64 3, i64 1, i32* %13)
%110 = tail call i64 @fgets(i8* %22, i32 1024, i32* %31)
%111 = icmp eq i64 %110, 0
br i1 %111, label %112, label %50
112: ; preds = %108, %47, %33
%113 = tail call i32 @fclose(i32* %31)
%114 = add nuw nsw i64 %28, 1
%115 = icmp eq i64 %114, %26
br i1 %115, label %116, label %27
116: ; preds = %112
%117 = tail call i64 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i64 12, i64 1, i32* %13)
%118 = tail call i32 @fclose(i32* %13)
%119 = tail call i32 @free(i8* %22)
br label %120
120: ; preds = %116, %70, %36, %15, %4
%121 = phi i32* [ @EXIT_FAILURE, %4 ], [ @EXIT_FAILURE, %70 ], [ @EXIT_FAILURE, %36 ], [ @EXIT_SUCCESS, %116 ], [ @EXIT_FAILURE, %15 ]
%122 = load i32, i32* %121
ret i32 %122
}