#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*/ fclose(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(int);
int main(int argc, char *argv[]) {
  int c;
  FILE *fp;
  fp = fopen(argv[1], "r");
  printf("/*\n");
  printf("####################################\n");
  printf("#\n");
  printf("# --- MAKE-C-TPL-0003.C ---\n");
  printf("#\n");
  printf("# This file named %s has been\n", argv[1]);
  printf("# converted to a C Template file.\n");
  printf("#\n");
  printf("####################################\n");
  printf("*/\n\n");
  printf("/*\n");
  printf("===========================================================\n");
  printf("----- %s -----\n", argv[1]);
  printf("\n");
  printf("Written in ISO/IEC 9899:2011 standard C\n");
  printf("===========================================================\n");
  printf("*/\n");
  printf("\n");
  printf("/* ----- Header files ----- */\n");
  printf("#include <stdio.h>\n");
  printf("#include <stdlib.h>\n\n");
  printf("/* ----- Typedefs, structs and unions ----- */\n\n");
  printf("/* ----- Function Prototypes ----- */\n\n");
  printf("/* ----- Global variables ----- */\n\n");
  printf("/* ----- Program starts here ----- */\n");
  printf("int main(int argc, char *argv[])\n");
  printf("{\n");
  printf("\tprintf(\"");
  while (c != EOF) {
    c = fgetc(fp);
    if (c == '\\') {
      printf("\\\\");
    } else if (c == '%') {
      printf("%%%%");
    } else if (c == '\'') {
      printf("\\\'");
    } else if (c == '\"') {
      printf("\\\"");
    } else if (c == '\?') {
      printf("\\?");
    } else if (c == '\t') {
      printf("\\t");
    } else if (c == '\f') {
      printf("\\f");
    } else if (c == '\a') {
      printf("\\a");
    } else if (c == '\b') {
      printf("\\b");
    } else if (c == '\v') {
      printf("\\v");
    } else if (c >= 127) {
      printf("\\x%02X", c);
    } else if (c == '\n') {
      printf("\\n\");\n");
      printf("\tprintf(\"");
    } else if (c == EOF) {
      printf("\\n\");\n\n");
      break;
    } else
      putchar(c);
  }
  printf("\treturn 0;\n");
  printf("}\n\n");
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe8b(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x20(%rbp)
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xfb9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf7c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf77(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf44(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xefd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf11(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf06(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
mov    0x2cc8(%rip),%rcx
cmp    (%rcx),%eax
je     150f <main+0x3bf>
mov    -0x20(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x5c,-0x14(%rbp)
jne    1351 <main+0x201>
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    150a <main+0x3ba>
cmpl   $0x25,-0x14(%rbp)
jne    136e <main+0x21e>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1505 <main+0x3b5>
cmpl   $0x27,-0x14(%rbp)
jne    138b <main+0x23b>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1500 <main+0x3b0>
cmpl   $0x22,-0x14(%rbp)
jne    13a8 <main+0x258>
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    14fb <main+0x3ab>
cmpl   $0x3f,-0x14(%rbp)
jne    13c5 <main+0x275>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    14f6 <main+0x3a6>
cmpl   $0x9,-0x14(%rbp)
jne    13e2 <main+0x292>
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    14f1 <main+0x3a1>
cmpl   $0xc,-0x14(%rbp)
jne    13ff <main+0x2af>
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    14ec <main+0x39c>
cmpl   $0x7,-0x14(%rbp)
jne    141c <main+0x2cc>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    14e7 <main+0x397>
cmpl   $0x8,-0x14(%rbp)
jne    1439 <main+0x2e9>
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    14e2 <main+0x392>
cmpl   $0xb,-0x14(%rbp)
jne    1456 <main+0x306>
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    14dd <main+0x38d>
cmpl   $0x7f,-0x14(%rbp)
jl     1476 <main+0x326>
mov    -0x14(%rbp),%esi
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    14d8 <main+0x388>
cmpl   $0xa,-0x14(%rbp)
jne    14a1 <main+0x351>
lea    0xdbf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd80(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    14d3 <main+0x383>
mov    -0x14(%rbp),%eax
mov    0x2b3d(%rip),%rcx
cmp    (%rcx),%eax
jne    14c6 <main+0x376>
lea    0xd93(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    150f <main+0x3bf>
mov    -0x14(%rbp),%edi
call   1030 <putchar@plt>
jmp    14d3 <main+0x383>
jmp    14d8 <main+0x388>
jmp    14dd <main+0x38d>
jmp    14e2 <main+0x392>
jmp    14e7 <main+0x397>
jmp    14ec <main+0x39c>
jmp    14f1 <main+0x3a1>
jmp    14f6 <main+0x3a6>
jmp    14fb <main+0x3ab>
jmp    1500 <main+0x3b0>
jmp    1505 <main+0x3b5>
jmp    150a <main+0x3ba>
jmp    1316 <main+0x1c6>
lea    0xd3f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd3d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbp
mov    0x8(%rsi),%rdi
lea    0xfdf(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%rbx
lea    0x1095(%rip),%r14
mov    %r14,%rdi
call   1040 <puts@plt>
lea    0x1061(%rip),%r15
mov    %r15,%rdi
call   1040 <puts@plt>
lea    0x1075(%rip),%r12
mov    %r12,%rdi
call   1040 <puts@plt>
lea    0x1005(%rip),%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
call   1040 <puts@plt>
mov    0x8(%rbp),%rsi
lea    0xf8d(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xffb(%rip),%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1040 <puts@plt>
lea    0x114b(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
lea    0x103d(%rip),%r14
mov    %r14,%rdi
call   1040 <puts@plt>
mov    0x8(%rbp),%rsi
lea    0xf5b(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xfea(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
lea    0x111f(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1024(%rip),%rdi
call   1040 <puts@plt>
lea    0x1037(%rip),%rdi
call   1040 <puts@plt>
lea    0x103e(%rip),%rdi
call   1040 <puts@plt>
lea    0x1047(%rip),%rdi
call   1040 <puts@plt>
lea    0x106b(%rip),%rdi
call   1040 <puts@plt>
lea    0x1086(%rip),%rdi
call   1040 <puts@plt>
lea    0x109e(%rip),%rdi
call   1040 <puts@plt>
lea    0x10b8(%rip),%rdi
call   1040 <puts@plt>
lea    0x10cd(%rip),%rdi
call   1040 <puts@plt>
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2d0e(%rip),%rbp
lea    0xd1f(%rip),%r12
lea    0xeb9(%rip),%r15
lea    0xea4(%rip),%r14
nop
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %eax,%r13d
lea    -0x7(%r13),%eax
cmp    $0x55,%eax
ja     132e <main+0x1ce>
movslq (%r12,%rax,4),%rax
add    %r12,%rax
jmp    *%rax
lea    0xe96(%rip),%rdi
jmp    13a0 <main+0x240>
lea    0xe8d(%rip),%rdi
jmp    13a0 <main+0x240>
lea    0xe78(%rip),%rdi
jmp    13a0 <main+0x240>
cmp    $0x7f,%r13d
jl     1387 <main+0x227>
lea    0xe78(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    0x0(%rbp),%r13d
jne    12f0 <main+0x190>
jmp    13d9 <main+0x279>
lea    0xe59(%rip),%rdi
jmp    13a0 <main+0x240>
lea    0xe47(%rip),%rdi
jmp    13a0 <main+0x240>
lea    0xe35(%rip),%rdi
jmp    13a0 <main+0x240>
lea    0xe24(%rip),%rdi
jmp    13a0 <main+0x240>
lea    0xe20(%rip),%rdi
jmp    13a0 <main+0x240>
mov    %r14,%rdi
jmp    13a0 <main+0x240>
mov    %r15,%rdi
jmp    13a0 <main+0x240>
cmp    $0xa,%r13d
jne    13b3 <main+0x253>
lea    0x1010(%rip),%rdi
call   1040 <puts@plt>
lea    0xde9(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    0x0(%rbp),%r13d
jne    12f0 <main+0x190>
jmp    13d9 <main+0x279>
cmp    0x0(%rbp),%r13d
je     13cd <main+0x26d>
mov    %r13d,%edi
call   1030 <putchar@plt>
cmp    0x0(%rbp),%r13d
jne    12f0 <main+0x190>
jmp    13d9 <main+0x279>
lea    0xfc9(%rip),%rdi
call   1040 <puts@plt>
lea    0xfaf(%rip),%rdi
call   1040 <puts@plt>
lea    0xfae(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [4 x i8] c"/*\0A\00"
@.str.2 = [38 x i8] c"####################################\0A\00"
@.str.3 = [3 x i8] c"#\0A\00"
@.str.4 = [29 x i8] c"# --- MAKE-C-TPL-0003.C ---\0A\00"
@.str.5 = [31 x i8] c"# This file named %s has been\0A\00"
@.str.6 = [35 x i8] c"# converted to a C Template file.\0A\00"
@.str.7 = [5 x i8] c"*/\0A\0A\00"
@.str.8 = [61 x i8] c"===========================================================\0A\00"
@.str.9 = [16 x i8] c"----- %s -----\0A\00"
@.str.10 = [2 x i8] c"\0A\00"
@.str.11 = [41 x i8] c"Written in ISO/IEC 9899:2011 standard C\0A\00"
@.str.12 = [4 x i8] c"*/\0A\00"
@.str.13 = [32 x i8] c"/* ----- Header files ----- */\0A\00"
@.str.14 = [20 x i8] c"#include <stdio.h>\0A\00"
@.str.15 = [22 x i8] c"#include <stdlib.h>\0A\0A\00"
@.str.16 = [49 x i8] c"/* ----- Typedefs, structs and unions ----- */\0A\0A\00"
@.str.17 = [40 x i8] c"/* ----- Function Prototypes ----- */\0A\0A\00"
@.str.18 = [37 x i8] c"/* ----- Global variables ----- */\0A\0A\00"
@.str.19 = [39 x i8] c"/* ----- Program starts here ----- */\0A\00"
@.str.20 = [34 x i8] c"int main(int argc, char *argv[])\0A\00"
@.str.21 = [3 x i8] c"{\0A\00"
@.str.22 = [10 x i8] c"\09printf(\22\00"
@EOF = global i32 0
@.str.23 = [3 x i8] c"\\\\\00"
@.str.24 = [5 x i8] c"%%%%\00"
@.str.25 = [3 x i8] c"\\'\00"
@.str.26 = [3 x i8] c"\\\22\00"
@.str.27 = [3 x i8] c"\\?\00"
@.str.28 = [3 x i8] c"\\t\00"
@.str.29 = [3 x i8] c"\\f\00"
@.str.30 = [3 x i8] c"\\a\00"
@.str.31 = [3 x i8] c"\\b\00"
@.str.32 = [3 x i8] c"\\v\00"
@.str.33 = [7 x i8] c"\\x%02X\00"
@.str.34 = [7 x i8] c"\\n\22);\0A\00"
@.str.35 = [8 x i8] c"\\n\22);\0A\0A\00"
@.str.36 = [12 x i8] c"\09return 0;\0A\00"
@.str.37 = [4 x i8] c"}\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*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32* @fopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %11, i32** %7
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i8* %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.8, i64 0, i64 0))
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i8* %29)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.11, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.8, i64 0, i64 0))
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.13, i64 0, i64 0))
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0))
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.15, i64 0, i64 0))
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.16, i64 0, i64 0))
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.17, i64 0, i64 0))
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.18, i64 0, i64 0))
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.19, i64 0, i64 0))
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.20, i64 0, i64 0))
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.21, i64 0, i64 0))
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.22, i64 0, i64 0))
br label %46
46: ; preds = %135, %2
%47 = load i32, i32* %6
%48 = load i32, i32* @EOF
%49 = icmp ne i32 %47, %48
br i1 %49, label %50, label %136
50: ; preds = %46
%51 = load i32*, i32** %7
%52 = call i32 @fgetc(i32* %51)
store i32 %52, i32* %6
%53 = load i32, i32* %6
%54 = icmp eq i32 %53, 92
br i1 %54, label %55, label %57
55: ; preds = %50
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.23, i64 0, i64 0))
br label %135
57: ; preds = %50
%58 = load i32, i32* %6
%59 = icmp eq i32 %58, 37
br i1 %59, label %60, label %62
60: ; preds = %57
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0))
br label %134
62: ; preds = %57
%63 = load i32, i32* %6
%64 = icmp eq i32 %63, 39
br i1 %64, label %65, label %67
65: ; preds = %62
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0))
br label %133
67: ; preds = %62
%68 = load i32, i32* %6
%69 = icmp eq i32 %68, 34
br i1 %69, label %70, label %72
70: ; preds = %67
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.26, i64 0, i64 0))
br label %132
72: ; preds = %67
%73 = load i32, i32* %6
%74 = icmp eq i32 %73, 63
br i1 %74, label %75, label %77
75: ; preds = %72
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.27, i64 0, i64 0))
br label %131
77: ; preds = %72
%78 = load i32, i32* %6
%79 = icmp eq i32 %78, 9
br i1 %79, label %80, label %82
80: ; preds = %77
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.28, i64 0, i64 0))
br label %130
82: ; preds = %77
%83 = load i32, i32* %6
%84 = icmp eq i32 %83, 12
br i1 %84, label %85, label %87
85: ; preds = %82
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.29, i64 0, i64 0))
br label %129
87: ; preds = %82
%88 = load i32, i32* %6
%89 = icmp eq i32 %88, 7
br i1 %89, label %90, label %92
90: ; preds = %87
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.30, i64 0, i64 0))
br label %128
92: ; preds = %87
%93 = load i32, i32* %6
%94 = icmp eq i32 %93, 8
br i1 %94, label %95, label %97
95: ; preds = %92
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.31, i64 0, i64 0))
br label %127
97: ; preds = %92
%98 = load i32, i32* %6
%99 = icmp eq i32 %98, 11
br i1 %99, label %100, label %102
100: ; preds = %97
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.32, i64 0, i64 0))
br label %126
102: ; preds = %97
%103 = load i32, i32* %6
%104 = icmp sge i32 %103, 127
br i1 %104, label %105, label %108
105: ; preds = %102
%106 = load i32, i32* %6
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.33, i64 0, i64 0), i32 %106)
br label %125
108: ; preds = %102
%109 = load i32, i32* %6
%110 = icmp eq i32 %109, 10
br i1 %110, label %111, label %114
111: ; preds = %108
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.34, i64 0, i64 0))
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.22, i64 0, i64 0))
br label %124
114: ; preds = %108
%115 = load i32, i32* %6
%116 = load i32, i32* @EOF
%117 = icmp eq i32 %115, %116
br i1 %117, label %118, label %120
118: ; preds = %114
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.35, i64 0, i64 0))
br label %136
120: ; preds = %114
%121 = load i32, i32* %6
%122 = call i32 @putchar(i32 %121)
br label %123
123: ; preds = %120
br label %124
124: ; preds = %123, %111
br label %125
125: ; preds = %124, %105
br label %126
126: ; preds = %125, %100
br label %127
127: ; preds = %126, %95
br label %128
128: ; preds = %127, %90
br label %129
129: ; preds = %128, %85
br label %130
130: ; preds = %129, %80
br label %131
131: ; preds = %130, %75
br label %132
132: ; preds = %131, %70
br label %133
133: ; preds = %132, %65
br label %134
134: ; preds = %133, %60
br label %135
135: ; preds = %134, %55
br label %46
136: ; preds = %118, %46
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.36, i64 0, i64 0))
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.37, i64 0, i64 0))
%139 = load i32*, i32** %7
%140 = call i32 @fclose(i32* %139)
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.5 = [31 x i8] c"# This file named %s has been\0A\00"
@.str.9 = [16 x i8] c"----- %s -----\0A\00"
@.str.22 = [10 x i8] c"\09printf(\22\00"
@EOF = global i32 0
@.str.23 = [3 x i8] c"\\\\\00"
@.str.24 = [5 x i8] c"%%%%\00"
@.str.25 = [3 x i8] c"\\'\00"
@.str.26 = [3 x i8] c"\\\22\00"
@.str.27 = [3 x i8] c"\\?\00"
@.str.28 = [3 x i8] c"\\t\00"
@.str.29 = [3 x i8] c"\\f\00"
@.str.30 = [3 x i8] c"\\a\00"
@.str.31 = [3 x i8] c"\\b\00"
@.str.32 = [3 x i8] c"\\v\00"
@.str.33 = [7 x i8] c"\\x%02X\00"
@str.40 = [28 x i8] c"# --- MAKE-C-TPL-0003.C ---\00"
@str.42 = [34 x i8] c"# converted to a C Template file.\00"
@str.43 = [2 x i8] c"#\00"
@str.44 = [37 x i8] c"####################################\00"
@str.45 = [4 x i8] c"*/\0A\00"
@str.46 = [3 x i8] c"/*\00"
@str.48 = [40 x i8] c"Written in ISO/IEC 9899:2011 standard C\00"
@str.49 = [60 x i8] c"===========================================================\00"
@str.50 = [3 x i8] c"*/\00"
@str.51 = [31 x i8] c"/* ----- Header files ----- */\00"
@str.52 = [19 x i8] c"#include <stdio.h>\00"
@str.53 = [21 x i8] c"#include <stdlib.h>\0A\00"
@str.54 = [48 x i8] c"/* ----- Typedefs, structs and unions ----- */\0A\00"
@str.55 = [39 x i8] c"/* ----- Function Prototypes ----- */\0A\00"
@str.56 = [36 x i8] c"/* ----- Global variables ----- */\0A\00"
@str.57 = [38 x i8] c"/* ----- Program starts here ----- */\00"
@str.58 = [33 x i8] c"int main(int argc, char *argv[])\00"
@str.59 = [2 x i8] c"{\00"
@str.60 = [11 x i8] c"\09return 0;\00"
@str.61 = [3 x i8] c"}\0A\00"
@str.62 = [7 x i8] c"\\n\22);\0A\00"
@str.63 = [6 x i8] c"\\n\22);\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.46, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.44, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.43, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.40, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.43, i64 0, i64 0))
%11 = load i8*, i8** %3
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i8* %11)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.42, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.43, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.44, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.45, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.46, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.49, i64 0, i64 0))
%19 = load i8*, i8** %3
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i8* %19)
%21 = tail call i32 @putchar(i32 10)
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.48, i64 0, i64 0))
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.49, i64 0, i64 0))
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.50, i64 0, i64 0))
%25 = tail call i32 @putchar(i32 10)
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.51, i64 0, i64 0))
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.52, i64 0, i64 0))
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.53, i64 0, i64 0))
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.54, i64 0, i64 0))
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.55, i64 0, i64 0))
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.56, i64 0, i64 0))
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.57, i64 0, i64 0))
%33 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.58, i64 0, i64 0))
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.59, i64 0, i64 0))
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.22, i64 0, i64 0))
br label %36
36: ; preds = %2, %74
%37 = tail call i32 @fgetc(i32* %5)
switch i32 %37, label %58 [
i32 92, label %38
i32 37, label %40
i32 39, label %42
i32 34, label %44
i32 63, label %46
i32 9, label %48
i32 12, label %50
i32 7, label %52
i32 8, label %54
i32 11, label %56
]
38: ; preds = %36
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.23, i64 0, i64 0))
br label %74
40: ; preds = %36
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0))
br label %74
42: ; preds = %36
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0))
br label %74
44: ; preds = %36
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.26, i64 0, i64 0))
br label %74
46: ; preds = %36
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.27, i64 0, i64 0))
br label %74
48: ; preds = %36
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.28, i64 0, i64 0))
br label %74
50: ; preds = %36
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.29, i64 0, i64 0))
br label %74
52: ; preds = %36
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.30, i64 0, i64 0))
br label %74
54: ; preds = %36
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.31, i64 0, i64 0))
br label %74
56: ; preds = %36
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.32, i64 0, i64 0))
br label %74
58: ; preds = %36
%59 = icmp sgt i32 %37, 126
br i1 %59, label %60, label %62
60: ; preds = %58
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.33, i64 0, i64 0), i32 %37)
br label %74
62: ; preds = %58
%63 = icmp eq i32 %37, 10
br i1 %63, label %64, label %67
64: ; preds = %62
%65 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.63, i64 0, i64 0))
%66 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.22, i64 0, i64 0))
br label %74
67: ; preds = %62
%68 = load i32, i32* @EOF
%69 = icmp eq i32 %37, %68
br i1 %69, label %70, label %72
70: ; preds = %67
%71 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.62, i64 0, i64 0))
br label %77
72: ; preds = %67
%73 = tail call i32 @putchar(i32 %37)
br label %74
74: ; preds = %40, %44, %48, %52, %56, %64, %72, %60, %54, %50, %46, %42, %38
%75 = load i32, i32* @EOF
%76 = icmp eq i32 %37, %75
br i1 %76, label %77, label %36
77: ; preds = %74, %70
%78 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.60, i64 0, i64 0))
%79 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.61, i64 0, i64 0))
%80 = tail call i32 @fclose(i32* %5)
ret i32 0
}