#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 EOF;
int /*<<< orphan*/ clean(char *);
scalar_t__ fclose(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *strrchr(char *, char);
int main(int argc, char **argv) {
  FILE *fi, *fo;
  char name[256];
  char *realname;
  int i, c;
  int bol = 1;
  if (argc < 3) {
    fprintf(stderr, "usage: cquote output.c lots of text files\n");
    return 1;
  }
  fo = fopen(argv[1], "wb");
  if (!fo) {
    fprintf(stderr, "cquote: could not open output file '%s'\n", argv[1]);
    return 1;
  }
  fprintf(fo, "/* This is an automatically generated file. Do not edit. */\n");
  for (i = 2; i < argc; i++) {
    realname = strrchr(argv[i], '/');
    if (!realname)
      realname = strrchr(argv[i], '\\');
    if (realname)
      realname++;
    else
      realname = argv[i];
    if (strlen(realname) > (sizeof name - 1)) {
      fprintf(stderr, "cquote: file name too long\n");
      if (fclose(fo)) {
        fprintf(stderr, "cquote: could not close output file '%s'\n", argv[1]);
        return 1;
      }
      return 1;
    }
    strcpy(name, realname);
    clean(name);
    fi = fopen(argv[i], "rb");
    fprintf(fo, "\n/* %s */\n\n", name);
    c = fgetc(fi);
    while (c != EOF) {
      int eol = 0;
      if (bol) {
        fputc('\"', fo);
        bol = 0;
      }
      switch (c) {
      case '\"':
        fprintf(fo, "\\\"");
        break;
      case '\\':
        fprintf(fo, "\\\\");
        break;
      case '\r':
      case '\n':
        eol = 1;
        break;
      default:
        fputc(c, fo);
        break;
      }
      if (eol) {
        fprintf(fo, "\\n\"\n");
        while ((c = fgetc(fi)) == '\r' || c == '\n')
          ;
        bol = 1;
      } else {
        c = fgetc(fi);
      }
    }
    if (!bol)
      fprintf(fi, "\\n\"\n");
    if (fclose(fi)) {
      fprintf(stderr, "cquote: could not close input file '%s'\n", argv[i]);
      return 1;
    }
  }
  if (fclose(fo)) {
    fprintf(stderr, "cquote: could not close output file '%s'\n", argv[1]);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x134(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11e1 <main+0x51>
mov    0x2e14(%rip),%rax
mov    (%rax),%rdi
lea    0xe32(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    15fd <main+0x46d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe3b(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1230 <main+0xa0>
mov    0x2dcd(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe11(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    15fd <main+0x46d>
mov    -0x20(%rbp),%rdi
lea    0xe1c(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x2,-0x12c(%rbp)
mov    -0x12c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    15b7 <main+0x427>
mov    -0x10(%rbp),%rax
movslq -0x12c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x2f,%esi
call   1060 <strrchr@plt>
mov    %rax,-0x128(%rbp)
cmpq   $0x0,-0x128(%rbp)
jne    12a9 <main+0x119>
mov    -0x10(%rbp),%rax
movslq -0x12c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x5c,%esi
call   1060 <strrchr@plt>
mov    %rax,-0x128(%rbp)
cmpq   $0x0,-0x128(%rbp)
je     12ce <main+0x13e>
mov    -0x128(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x128(%rbp)
jmp    12e4 <main+0x154>
mov    -0x10(%rbp),%rax
movslq -0x12c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x128(%rbp)
mov    -0x128(%rbp),%rdi
call   1050 <strlen@plt>
cltq
cmp    $0xff,%rax
jbe    1361 <main+0x1d1>
mov    0x2cd3(%rip),%rax
mov    (%rax),%rdi
lea    0xd85(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
cmp    $0x0,%rax
je     1355 <main+0x1c5>
mov    0x2ca8(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd6e(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    15fd <main+0x46d>
movl   $0x1,-0x4(%rbp)
jmp    15fd <main+0x46d>
lea    -0x120(%rbp),%rdi
mov    -0x128(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x120(%rbp),%rdi
call   10a0 <clean@plt>
mov    -0x10(%rbp),%rax
movslq -0x12c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd44(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x120(%rbp),%rdx
lea    0xd2c(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1070 <fgetc@plt>
mov    %eax,-0x130(%rbp)
mov    -0x130(%rbp),%eax
mov    0x2c14(%rip),%rcx
cmp    (%rcx),%eax
je     1539 <main+0x3a9>
movl   $0x0,-0x138(%rbp)
cmpl   $0x0,-0x134(%rbp)
je     140b <main+0x27b>
mov    -0x20(%rbp),%rsi
mov    $0x22,%edi
call   1080 <fputc@plt>
movl   $0x0,-0x134(%rbp)
mov    -0x130(%rbp),%eax
mov    %eax,-0x13c(%rbp)
sub    $0xa,%eax
je     148f <main+0x2ff>
jmp    1425 <main+0x295>
mov    -0x13c(%rbp),%eax
sub    $0xd,%eax
je     148f <main+0x2ff>
jmp    1439 <main+0x2a9>
mov    -0x13c(%rbp),%eax
sub    $0x22,%eax
je     1461 <main+0x2d1>
jmp    144d <main+0x2bd>
mov    -0x13c(%rbp),%eax
sub    $0x5c,%eax
je     1478 <main+0x2e8>
jmp    149e <main+0x30e>
mov    -0x20(%rbp),%rdi
lea    0xc7d(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    14ad <main+0x31d>
mov    -0x20(%rbp),%rdi
lea    0xc69(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    14ad <main+0x31d>
movl   $0x1,-0x138(%rbp)
jmp    14ad <main+0x31d>
mov    -0x130(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1080 <fputc@plt>
cmpl   $0x0,-0x138(%rbp)
je     1525 <main+0x395>
mov    -0x20(%rbp),%rdi
lea    0xc2a(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1070 <fgetc@plt>
mov    %eax,%ecx
mov    %ecx,-0x130(%rbp)
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x13d(%rbp)
je     14fe <main+0x36e>
cmpl   $0xa,-0x130(%rbp)
sete   %al
mov    %al,-0x13d(%rbp)
mov    -0x13d(%rbp),%al
test   $0x1,%al
jne    1511 <main+0x381>
jmp    1516 <main+0x386>
jmp    14cc <main+0x33c>
movl   $0x1,-0x134(%rbp)
jmp    1534 <main+0x3a4>
mov    -0x18(%rbp),%rdi
call   1070 <fgetc@plt>
mov    %eax,-0x130(%rbp)
jmp    13c7 <main+0x237>
cmpl   $0x0,-0x134(%rbp)
jne    1558 <main+0x3c8>
mov    -0x18(%rbp),%rdi
lea    0xb9e(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
cmp    $0x0,%rax
je     159e <main+0x40e>
mov    0x2a66(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
movslq -0x12c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xb69(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    15fd <main+0x46d>
jmp    15a3 <main+0x413>
mov    -0x12c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12c(%rbp)
jmp    124c <main+0xbc>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
cmp    $0x0,%rax
je     15f6 <main+0x466>
mov    0x2a07(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xacd(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    15fd <main+0x46d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x140,%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    $0x2,%edi
jg     11db <main+0x3b>
mov    0x2e1b(%rip),%rax
mov    (%rax),%rcx
lea    0xe39(%rip),%rdi
mov    $0x2a,%esi
mov    $0x1,%edx
call   10c0 <fwrite@plt>
jmp    1488 <main+0x2e8>
mov    %rsi,%r15
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
lea    0xe40(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1409 <main+0x269>
mov    %rax,%rbx
lea    0xe54(%rip),%rdi
mov    $0x3c,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10c0 <fwrite@plt>
mov    %ebp,%eax
mov    %rax,0x8(%rsp)
mov    $0x1,%r13d
mov    $0x2,%r14d
nopl   0x0(%rax,%rax,1)
mov    (%r15,%r14,8),%rbp
mov    %rbp,%rdi
mov    $0x2f,%esi
call   1060 <strrchr@plt>
test   %rax,%rax
jne    1258 <main+0xb8>
mov    %rbp,%rdi
mov    $0x5c,%esi
call   1060 <strrchr@plt>
test   %rax,%rax
je     125f <main+0xbf>
add    $0x1,%rax
mov    %rax,%rbp
mov    %rbp,%rdi
call   1050 <strlen@plt>
cmp    $0x100,%eax
jae    1420 <main+0x280>
lea    0x10(%rsp),%r12
mov    %r12,%rdi
mov    %rbp,%rsi
call   1030 <strcpy@plt>
mov    %r12,%rdi
call   10a0 <clean@plt>
mov    %r15,%rbp
mov    (%r15,%r14,8),%rdi
lea    0xe42(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%r15
mov    %rbx,%rdi
lea    0xe33(%rip),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %r15,%rdi
call   1070 <fgetc@plt>
mov    %eax,%r12d
jmp    12da <main+0x13a>
mov    %r12d,%edi
mov    %rbx,%rsi
call   1080 <fputc@plt>
mov    %r15,%rdi
call   1070 <fgetc@plt>
mov    %eax,%r12d
xor    %r13d,%r13d
mov    0x2d07(%rip),%rax
cmp    (%rax),%r12d
je     13a0 <main+0x200>
test   %r13d,%r13d
je     12fc <main+0x15c>
mov    $0x22,%edi
mov    %rbx,%rsi
call   1080 <fputc@plt>
cmp    $0x21,%r12d
jg     1350 <main+0x1b0>
cmp    $0xa,%r12d
je     130e <main+0x16e>
cmp    $0xd,%r12d
jne    12c1 <main+0x121>
mov    $0x4,%esi
mov    $0x1,%edx
lea    0xdd0(%rip),%rdi
mov    %rbx,%rcx
call   10c0 <fwrite@plt>
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1070 <fgetc@plt>
cmp    $0xa,%eax
je     1330 <main+0x190>
mov    %eax,%r12d
cmp    $0xd,%eax
je     1330 <main+0x190>
mov    $0x1,%r13d
jmp    12da <main+0x13a>
nopl   (%rax)
cmp    $0x5c,%r12d
je     1373 <main+0x1d3>
cmp    $0x22,%r12d
jne    12c1 <main+0x121>
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xd78(%rip),%rdi
jmp    1384 <main+0x1e4>
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xd68(%rip),%rdi
mov    %rbx,%rcx
call   10c0 <fwrite@plt>
jmp    12cc <main+0x12c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   %r13d,%r13d
jne    13be <main+0x21e>
mov    $0x4,%esi
mov    $0x1,%edx
lea    0xd39(%rip),%rdi
mov    %r15,%rcx
call   10c0 <fwrite@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
test   %rax,%rax
jne    146b <main+0x2cb>
add    $0x1,%r14
cmp    0x8(%rsp),%r14
mov    %rbp,%r15
jne    1230 <main+0x90>
mov    %rbx,%rdi
call   1040 <fclose@plt>
test   %rax,%rax
je     14a1 <main+0x301>
mov    0x2bdf(%rip),%rax
mov    (%rax),%rdi
mov    0x8(%r15),%rdx
lea    0xca9(%rip),%rsi
jmp    1481 <main+0x2e1>
mov    0x2bc8(%rip),%rax
mov    (%rax),%rdi
mov    0x8(%r15),%rdx
lea    0xc10(%rip),%rsi
jmp    1481 <main+0x2e1>
mov    0x2bb1(%rip),%rbp
mov    0x0(%rbp),%rcx
lea    0xc62(%rip),%rdi
mov    $0x1b,%esi
mov    $0x1,%edx
call   10c0 <fwrite@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    $0x1,%ebx
test   %rax,%rax
je     148d <main+0x2ed>
mov    0x0(%rbp),%rdi
mov    0x8(%r15),%rdx
lea    0xc4e(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    148d <main+0x2ed>
mov    0x2b66(%rip),%rax
mov    (%rax),%rdi
mov    0x0(%rbp,%r14,8),%rdx
lea    0xc73(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ebx,%ebx
jmp    148d <main+0x2ed>

LLVM IR (-O0):
@stderr = global i32* null
@.str = [43 x i8] c"usage: cquote output.c lots of text files\0A\00"
@.str.1 = [3 x i8] c"wb\00"
@.str.2 = [41 x i8] c"cquote: could not open output file '%s'\0A\00"
@.str.3 = [61 x i8] c"/* This is an automatically generated file. Do not edit. */\0A\00"
@.str.4 = [28 x i8] c"cquote: file name too long\0A\00"
@.str.5 = [42 x i8] c"cquote: could not close output file '%s'\0A\00"
@.str.6 = [3 x i8] c"rb\00"
@.str.7 = [12 x i8] c"\0A/* %s */\0A\0A\00"
@EOF = global i32 0
@.str.8 = [3 x i8] c"\\\22\00"
@.str.9 = [3 x i8] c"\\\\\00"
@.str.10 = [5 x i8] c"\\n\22\0A\00"
@.str.11 = [41 x i8] c"cquote: could not close input file '%s'\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 i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %12
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 3
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = load i32*, i32** @stderr
%18 = call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %179
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32* @fopen(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %23, i32** %7
%24 = load i32*, i32** %7
%25 = icmp ne i32* %24, null
br i1 %25, label %32, label %26
26: ; preds = %19
%27 = load i32*, i32** @stderr
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i8* %30)
store i32 1, i32* %3
br label %179
32: ; preds = %19
%33 = load i32*, i32** %7
%34 = call i32 (i32*, i8*, ...) @fprintf(i32* %33, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0))
store i32 2, i32* %10
br label %35
35: ; preds = %165, %32
%36 = load i32, i32* %10
%37 = load i32, i32* %4
%38 = icmp slt i32 %36, %37
br i1 %38, label %39, label %168
39: ; preds = %35
%40 = load i8**, i8*** %5
%41 = load i32, i32* %10
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i8*, i8** %40, i64 %42
%44 = load i8*, i8** %43
%45 = call i8* @strrchr(i8* %44, i8 signext 47)
store i8* %45, i8** %9
%46 = load i8*, i8** %9
%47 = icmp ne i8* %46, null
br i1 %47, label %55, label %48
48: ; preds = %39
%49 = load i8**, i8*** %5
%50 = load i32, i32* %10
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8*, i8** %49, i64 %51
%53 = load i8*, i8** %52
%54 = call i8* @strrchr(i8* %53, i8 signext 92)
store i8* %54, i8** %9
br label %55
55: ; preds = %48, %39
%56 = load i8*, i8** %9
%57 = icmp ne i8* %56, null
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = load i8*, i8** %9
%60 = getelementptr inbounds i8, i8* %59, i32 1
store i8* %60, i8** %9
br label %67
61: ; preds = %55
%62 = load i8**, i8*** %5
%63 = load i32, i32* %10
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8*, i8** %62, i64 %64
%66 = load i8*, i8** %65
store i8* %66, i8** %9
br label %67
67: ; preds = %61, %58
%68 = load i8*, i8** %9
%69 = call i32 @strlen(i8* %68)
%70 = sext i32 %69 to i64
%71 = icmp ugt i64 %70, 255
br i1 %71, label %72, label %85
72: ; preds = %67
%73 = load i32*, i32** @stderr
%74 = call i32 (i32*, i8*, ...) @fprintf(i32* %73, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%75 = load i32*, i32** %7
%76 = call i64 @fclose(i32* %75)
%77 = icmp ne i64 %76, 0
br i1 %77, label %78, label %84
78: ; preds = %72
%79 = load i32*, i32** @stderr
%80 = load i8**, i8*** %5
%81 = getelementptr inbounds i8*, i8** %80, i64 1
%82 = load i8*, i8** %81
%83 = call i32 (i32*, i8*, ...) @fprintf(i32* %79, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i8* %82)
store i32 1, i32* %3
br label %179
84: ; preds = %72
store i32 1, i32* %3
br label %179
85: ; preds = %67
%86 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%87 = load i8*, i8** %9
%88 = call i32 @strcpy(i8* %86, i8* %87)
%89 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%90 = call i32 @clean(i8* %89)
%91 = load i8**, i8*** %5
%92 = load i32, i32* %10
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i8*, i8** %91, i64 %93
%95 = load i8*, i8** %94
%96 = call i32* @fopen(i8* %95, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
store i32* %96, i32** %6
%97 = load i32*, i32** %7
%98 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%99 = call i32 (i32*, i8*, ...) @fprintf(i32* %97, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8* %98)
%100 = load i32*, i32** %6
%101 = call i32 @fgetc(i32* %100)
store i32 %101, i32* %11
br label %102
102: ; preds = %145, %85
%103 = load i32, i32* %11
%104 = load i32, i32* @EOF
%105 = icmp ne i32 %103, %104
br i1 %105, label %106, label %146
106: ; preds = %102
store i32 0, i32* %13
%107 = load i32, i32* %12
%108 = icmp ne i32 %107, 0
br i1 %108, label %109, label %112
109: ; preds = %106
%110 = load i32*, i32** %7
%111 = call i32 @fputc(i32 34, i32* %110)
store i32 0, i32* %12
br label %112
112: ; preds = %109, %106
%113 = load i32, i32* %11
switch i32 %113, label %121 [
i32 34, label %114
i32 92, label %117
i32 13, label %120
i32 10, label %120
]
114: ; preds = %112
%115 = load i32*, i32** %7
%116 = call i32 (i32*, i8*, ...) @fprintf(i32* %115, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
br label %125
117: ; preds = %112
%118 = load i32*, i32** %7
%119 = call i32 (i32*, i8*, ...) @fprintf(i32* %118, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
br label %125
120: ; preds = %112, %112
store i32 1, i32* %13
br label %125
121: ; preds = %112
%122 = load i32, i32* %11
%123 = load i32*, i32** %7
%124 = call i32 @fputc(i32 %122, i32* %123)
br label %125
125: ; preds = %121, %120, %117, %114
%126 = load i32, i32* %13
%127 = icmp ne i32 %126, 0
br i1 %127, label %128, label %142
128: ; preds = %125
%129 = load i32*, i32** %7
%130 = call i32 (i32*, i8*, ...) @fprintf(i32* %129, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
br label %131
131: ; preds = %140, %128
%132 = load i32*, i32** %6
%133 = call i32 @fgetc(i32* %132)
store i32 %133, i32* %11
%134 = icmp eq i32 %133, 13
br i1 %134, label %138, label %135
135: ; preds = %131
%136 = load i32, i32* %11
%137 = icmp eq i32 %136, 10
br label %138
138: ; preds = %135, %131
%139 = phi i1 [ true, %131 ], [ %137, %135 ]
br i1 %139, label %140, label %141
140: ; preds = %138
br label %131
141: ; preds = %138
store i32 1, i32* %12
br label %145
142: ; preds = %125
%143 = load i32*, i32** %6
%144 = call i32 @fgetc(i32* %143)
store i32 %144, i32* %11
br label %145
145: ; preds = %142, %141
br label %102
146: ; preds = %102
%147 = load i32, i32* %12
%148 = icmp ne i32 %147, 0
br i1 %148, label %152, label %149
149: ; preds = %146
%150 = load i32*, i32** %6
%151 = call i32 (i32*, i8*, ...) @fprintf(i32* %150, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
br label %152
152: ; preds = %149, %146
%153 = load i32*, i32** %6
%154 = call i64 @fclose(i32* %153)
%155 = icmp ne i64 %154, 0
br i1 %155, label %156, label %164
156: ; preds = %152
%157 = load i32*, i32** @stderr
%158 = load i8**, i8*** %5
%159 = load i32, i32* %10
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds i8*, i8** %158, i64 %160
%162 = load i8*, i8** %161
%163 = call i32 (i32*, i8*, ...) @fprintf(i32* %157, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.11, i64 0, i64 0), i8* %162)
store i32 1, i32* %3
br label %179
164: ; preds = %152
br label %165
165: ; preds = %164
%166 = load i32, i32* %10
%167 = add nsw i32 %166, 1
store i32 %167, i32* %10
br label %35
168: ; preds = %35
%169 = load i32*, i32** %7
%170 = call i64 @fclose(i32* %169)
%171 = icmp ne i64 %170, 0
br i1 %171, label %172, label %178
172: ; preds = %168
%173 = load i32*, i32** @stderr
%174 = load i8**, i8*** %5
%175 = getelementptr inbounds i8*, i8** %174, i64 1
%176 = load i8*, i8** %175
%177 = call i32 (i32*, i8*, ...) @fprintf(i32* %173, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i8* %176)
store i32 1, i32* %3
br label %179
178: ; preds = %168
store i32 0, i32* %3
br label %179
179: ; preds = %178, %172, %156, %84, %78, %26, %16
%180 = load i32, i32* %3
ret i32 %180
}

LLVM IR (-O2):
@stderr = global i32* null
@.str = [43 x i8] c"usage: cquote output.c lots of text files\0A\00"
@.str.1 = [3 x i8] c"wb\00"
@.str.2 = [41 x i8] c"cquote: could not open output file '%s'\0A\00"
@.str.3 = [61 x i8] c"/* This is an automatically generated file. Do not edit. */\0A\00"
@.str.4 = [28 x i8] c"cquote: file name too long\0A\00"
@.str.5 = [42 x i8] c"cquote: could not close output file '%s'\0A\00"
@.str.6 = [3 x i8] c"rb\00"
@.str.7 = [12 x i8] c"\0A/* %s */\0A\0A\00"
@EOF = global i32 0
@.str.8 = [3 x i8] c"\\\22\00"
@.str.9 = [3 x i8] c"\\\\\00"
@.str.10 = [5 x i8] c"\\n\22\0A\00"
@.str.11 = [41 x i8] c"cquote: could not close input file '%s'\0A\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 slt i32 %0, 3
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32*, i32** @stderr
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i64 42, i64 1, i32* %7)
br label %103
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32* @fopen(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %18
14: ; preds = %9
%15 = load i32*, i32** @stderr
%16 = load i8*, i8** %10
%17 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %15, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i8* %16)
br label %103
18: ; preds = %9
%19 = tail call i64 @fwrite(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0), i64 60, i64 1, i32* %12)
%20 = zext i32 %0 to i64
br label %23
21: ; preds = %88
%22 = icmp eq i64 %91, %20
br i1 %22, label %96, label %23
23: ; preds = %18, %21
%24 = phi i64 [ 2, %18 ], [ %91, %21 ]
%25 = phi i32 [ 1, %18 ], [ %84, %21 ]
%26 = getelementptr inbounds i8*, i8** %1, i64 %24
%27 = load i8*, i8** %26
%28 = call i8* @strrchr(i8* dereferenceable(1) %27, i8 signext 47)
%29 = icmp eq i8* %28, null
br i1 %29, label %30, label %33
30: ; preds = %23
%31 = call i8* @strrchr(i8* dereferenceable(1) %27, i8 signext 92)
%32 = icmp eq i8* %31, null
br i1 %32, label %36, label %33
33: ; preds = %23, %30
%34 = phi i8* [ %31, %30 ], [ %28, %23 ]
%35 = getelementptr inbounds i8, i8* %34, i64 1
br label %36
36: ; preds = %30, %33
%37 = phi i8* [ %35, %33 ], [ %27, %30 ]
%38 = call i32 @strlen(i8* %37)
%39 = icmp ugt i32 %38, 255
br i1 %39, label %40, label %49
40: ; preds = %36
%41 = load i32*, i32** @stderr
%42 = call i64 @fwrite(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i64 27, i64 1, i32* %41)
%43 = call i64 @fclose(i32* %12)
%44 = icmp eq i64 %43, 0
br i1 %44, label %103, label %45
45: ; preds = %40
%46 = load i32*, i32** @stderr
%47 = load i8*, i8** %10
%48 = call i32 (i32*, i8*, ...) @fprintf(i32* %46, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i8* %47)
br label %103
49: ; preds = %36
%50 = call i32 @strcpy(i8* %4, i8* %37)
%51 = call i32 @clean(i8* %4)
%52 = load i8*, i8** %26
%53 = call i32* @fopen(i8* %52, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%54 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8* %4)
%55 = call i32 @fgetc(i32* %53)
%56 = load i32, i32* @EOF
%57 = icmp eq i32 %55, %56
br i1 %57, label %83, label %58
58: ; preds = %49, %78
%59 = phi i32 [ %80, %78 ], [ %25, %49 ]
%60 = phi i32 [ %79, %78 ], [ %55, %49 ]
%61 = icmp eq i32 %59, 0
br i1 %61, label %64, label %62
62: ; preds = %58
%63 = call i32 @fputc(i32 34, i32* %12)
br label %64
64: ; preds = %62, %58
switch i32 %60, label %69 [
i32 34, label %65
i32 92, label %67
i32 13, label %71
i32 10, label %71
]
65: ; preds = %64
%66 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i64 2, i64 1, i32* %12)
br label %76
67: ; preds = %64
%68 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i64 2, i64 1, i32* %12)
br label %76
69: ; preds = %64
%70 = call i32 @fputc(i32 %60, i32* %12)
br label %76
71: ; preds = %64, %64
%72 = call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i64 4, i64 1, i32* %12)
br label %73
73: ; preds = %75, %71
%74 = call i32 @fgetc(i32* %53)
switch i32 %74, label %78 [
i32 13, label %75
i32 10, label %75
]
75: ; preds = %73, %73
br label %73
76: ; preds = %65, %67, %69
%77 = call i32 @fgetc(i32* %53)
br label %78
78: ; preds = %73, %76
%79 = phi i32 [ %77, %76 ], [ %74, %73 ]
%80 = phi i32 [ 0, %76 ], [ 1, %73 ]
%81 = load i32, i32* @EOF
%82 = icmp eq i32 %79, %81
br i1 %82, label %83, label %58
83: ; preds = %78, %49
%84 = phi i32 [ %25, %49 ], [ %80, %78 ]
%85 = icmp eq i32 %84, 0
br i1 %85, label %86, label %88
86: ; preds = %83
%87 = call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i64 4, i64 1, i32* %53)
br label %88
88: ; preds = %86, %83
%89 = call i64 @fclose(i32* %53)
%90 = icmp eq i64 %89, 0
%91 = add nuw nsw i64 %24, 1
br i1 %90, label %21, label %92
92: ; preds = %88
%93 = load i32*, i32** @stderr
%94 = load i8*, i8** %26
%95 = call i32 (i32*, i8*, ...) @fprintf(i32* %93, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.11, i64 0, i64 0), i8* %94)
br label %103
96: ; preds = %21
%97 = call i64 @fclose(i32* %12)
%98 = icmp eq i64 %97, 0
br i1 %98, label %103, label %99
99: ; preds = %96
%100 = load i32*, i32** @stderr
%101 = load i8*, i8** %10
%102 = call i32 (i32*, i8*, ...) @fprintf(i32* %100, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i8* %101)
br label %103
103: ; preds = %96, %40, %99, %92, %45, %14, %6
%104 = phi i32 [ 1, %6 ], [ 1, %45 ], [ 1, %92 ], [ 1, %99 ], [ 1, %14 ], [ 1, %40 ], [ 0, %96 ]
ret i32 %104
}