#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-0002.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("# The text is written to a named 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("  FILE *fp\n");
  printf("  fp=fopen(\"file0002.txt\",\"w\"); /* Open file for writing */\n");
  printf("\n");
  printf("  fprintf(fp,\"");
  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("  fprintf(fp,\"");
    } else if (c == EOF) {
      printf("\\n\");\n");
      printf("  fclose(fp); /* Close file */\n\n");
      break;
    } else
      putchar(c);
  }
  printf("  return 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    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xfb7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdbf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf7a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf75(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf42(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xefb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf0f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf04(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf02(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf23(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
mov    0x2c74(%rip),%rcx
cmp    (%rcx),%eax
je     1571 <main+0x421>
mov    -0x20(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x5c,-0x14(%rbp)
jne    13a5 <main+0x255>
lea    0xefc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    156c <main+0x41c>
cmpl   $0x25,-0x14(%rbp)
jne    13c2 <main+0x272>
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1567 <main+0x417>
cmpl   $0x27,-0x14(%rbp)
jne    13df <main+0x28f>
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1562 <main+0x412>
cmpl   $0x22,-0x14(%rbp)
jne    13fc <main+0x2ac>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    155d <main+0x40d>
cmpl   $0x3f,-0x14(%rbp)
jne    1419 <main+0x2c9>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1558 <main+0x408>
cmpl   $0x9,-0x14(%rbp)
jne    1436 <main+0x2e6>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1553 <main+0x403>
cmpl   $0xc,-0x14(%rbp)
jne    1453 <main+0x303>
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    154e <main+0x3fe>
cmpl   $0x7,-0x14(%rbp)
jne    1470 <main+0x320>
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1549 <main+0x3f9>
cmpl   $0x8,-0x14(%rbp)
jne    148d <main+0x33d>
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1544 <main+0x3f4>
cmpl   $0xb,-0x14(%rbp)
jne    14aa <main+0x35a>
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    153f <main+0x3ef>
cmpl   $0x7f,-0x14(%rbp)
jl     14ca <main+0x37a>
mov    -0x14(%rbp),%esi
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    153a <main+0x3ea>
cmpl   $0xa,-0x14(%rbp)
jne    14f5 <main+0x3a5>
lea    0xde1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd9d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1535 <main+0x3e5>
mov    -0x14(%rbp),%eax
mov    0x2ae9(%rip),%rcx
cmp    (%rcx),%eax
jne    1528 <main+0x3d8>
lea    0xdae(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xda7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1571 <main+0x421>
mov    -0x14(%rbp),%edi
call   1030 <putchar@plt>
jmp    1535 <main+0x3e5>
jmp    153a <main+0x3ea>
jmp    153f <main+0x3ef>
jmp    1544 <main+0x3f4>
jmp    1549 <main+0x3f9>
jmp    154e <main+0x3fe>
jmp    1553 <main+0x403>
jmp    1558 <main+0x408>
jmp    155d <main+0x40d>
jmp    1562 <main+0x412>
jmp    1567 <main+0x417>
jmp    156c <main+0x41c>
jmp    136a <main+0x21a>
lea    0xd6c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd6b(%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,%r12
mov    0x8(%rsi),%rdi
lea    0xfdf(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%rbx
lea    0x10c1(%rip),%r14
mov    %r14,%rdi
call   1040 <puts@plt>
lea    0x108d(%rip),%r15
mov    %r15,%rdi
call   1040 <puts@plt>
lea    0x10a1(%rip),%rbp
mov    %rbp,%rdi
call   1040 <puts@plt>
lea    0x100a(%rip),%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
call   1040 <puts@plt>
mov    0x8(%r12),%rsi
lea    0xf8c(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xfff(%rip),%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
call   1040 <puts@plt>
lea    0x1005(%rip),%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1040 <puts@plt>
lea    0x115a(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
lea    0x104c(%rip),%rbp
mov    %rbp,%rdi
call   1040 <puts@plt>
mov    0x8(%r12),%rsi
lea    0xf3d(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xff8(%rip),%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
call   1040 <puts@plt>
lea    0x112d(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1032(%rip),%rdi
call   1040 <puts@plt>
lea    0x1045(%rip),%rdi
call   1040 <puts@plt>
lea    0x104c(%rip),%rdi
call   1040 <puts@plt>
lea    0x1055(%rip),%rdi
call   1040 <puts@plt>
lea    0x1079(%rip),%rdi
call   1040 <puts@plt>
lea    0x1094(%rip),%rdi
call   1040 <puts@plt>
lea    0x10ac(%rip),%rdi
call   1040 <puts@plt>
lea    0x10c6(%rip),%rdi
call   1040 <puts@plt>
lea    0x10db(%rip),%rdi
call   1040 <puts@plt>
lea    0x10d1(%rip),%rdi
call   1040 <puts@plt>
lea    0x10d0(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe7d(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2cce(%rip),%rbp
lea    0xcdf(%rip),%r12
lea    0xe7e(%rip),%r15
lea    0xe69(%rip),%r14
nop
mov    %rbx,%rdi
call   1070 <fgetc@plt>
mov    %eax,%r13d
lea    -0x7(%r13),%eax
cmp    $0x55,%eax
ja     136e <main+0x20e>
movslq (%r12,%rax,4),%rax
add    %r12,%rax
jmp    *%rax
lea    0xe5b(%rip),%rdi
jmp    13e0 <main+0x280>
lea    0xe52(%rip),%rdi
jmp    13e0 <main+0x280>
lea    0xe3d(%rip),%rdi
jmp    13e0 <main+0x280>
cmp    $0x7f,%r13d
jl     13c7 <main+0x267>
lea    0xe3d(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    0x0(%rbp),%r13d
jne    1330 <main+0x1d0>
jmp    1425 <main+0x2c5>
lea    0xe1e(%rip),%rdi
jmp    13e0 <main+0x280>
lea    0xe0c(%rip),%rdi
jmp    13e0 <main+0x280>
lea    0xdfa(%rip),%rdi
jmp    13e0 <main+0x280>
lea    0xde9(%rip),%rdi
jmp    13e0 <main+0x280>
lea    0xde5(%rip),%rdi
jmp    13e0 <main+0x280>
mov    %r14,%rdi
jmp    13e0 <main+0x280>
mov    %r15,%rdi
jmp    13e0 <main+0x280>
cmp    $0xa,%r13d
jne    13f3 <main+0x293>
lea    0x105d(%rip),%rdi
call   1040 <puts@plt>
lea    0xda9(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    0x0(%rbp),%r13d
jne    1330 <main+0x1d0>
jmp    1425 <main+0x2c5>
cmp    0x0(%rbp),%r13d
je     140d <main+0x2ad>
mov    %r13d,%edi
call   1030 <putchar@plt>
cmp    0x0(%rbp),%r13d
jne    1330 <main+0x1d0>
jmp    1425 <main+0x2c5>
lea    0x101d(%rip),%rdi
call   1040 <puts@plt>
lea    0xff1(%rip),%rdi
call   1040 <puts@plt>
lea    0xfd6(%rip),%rdi
call   1040 <puts@plt>
lea    0xfd6(%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-0002.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 = [40 x i8] c"# The text is written to a named file.\0A\00"
@.str.8 = [5 x i8] c"*/\0A\0A\00"
@.str.9 = [61 x i8] c"===========================================================\0A\00"
@.str.10 = [16 x i8] c"----- %s -----\0A\00"
@.str.11 = [2 x i8] c"\0A\00"
@.str.12 = [41 x i8] c"Written in ISO/IEC 9899:2011 standard C\0A\00"
@.str.13 = [4 x i8] c"*/\0A\00"
@.str.14 = [32 x i8] c"/* ----- Header files ----- */\0A\00"
@.str.15 = [20 x i8] c"#include <stdio.h>\0A\00"
@.str.16 = [22 x i8] c"#include <stdlib.h>\0A\0A\00"
@.str.17 = [49 x i8] c"/* ----- Typedefs, structs and unions ----- */\0A\0A\00"
@.str.18 = [40 x i8] c"/* ----- Function Prototypes ----- */\0A\0A\00"
@.str.19 = [37 x i8] c"/* ----- Global variables ----- */\0A\0A\00"
@.str.20 = [39 x i8] c"/* ----- Program starts here ----- */\0A\00"
@.str.21 = [34 x i8] c"int main(int argc, char *argv[])\0A\00"
@.str.22 = [3 x i8] c"{\0A\00"
@.str.23 = [12 x i8] c" FILE *fp\0A\00"
@.str.24 = [61 x i8] c" fp=fopen(\22file0002.txt\22,\22w\22); /* Open file for writing */\0A\00"
@.str.25 = [15 x i8] c" fprintf(fp,\22\00"
@EOF = global i32 0
@.str.26 = [3 x i8] c"\\\\\00"
@.str.27 = [5 x i8] c"%%%%\00"
@.str.28 = [3 x i8] c"\\'\00"
@.str.29 = [3 x i8] c"\\\22\00"
@.str.30 = [3 x i8] c"\\?\00"
@.str.31 = [3 x i8] c"\\t\00"
@.str.32 = [3 x i8] c"\\f\00"
@.str.33 = [3 x i8] c"\\a\00"
@.str.34 = [3 x i8] c"\\b\00"
@.str.35 = [3 x i8] c"\\v\00"
@.str.36 = [7 x i8] c"\\x%02X\00"
@.str.37 = [7 x i8] c"\\n\22);\0A\00"
@.str.38 = [33 x i8] c" fclose(fp); /* Close file */\0A\0A\00"
@.str.39 = [13 x i8] c" return 0;\0A\00"
@.str.40 = [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 ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0))
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.9, i64 0, i64 0))
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i8* %32)
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.12, i64 0, i64 0))
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.9, i64 0, i64 0))
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.14, i64 0, i64 0))
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.15, i64 0, i64 0))
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.16, i64 0, i64 0))
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.17, i64 0, i64 0))
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.18, i64 0, i64 0))
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.19, i64 0, i64 0))
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.20, i64 0, i64 0))
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.21, i64 0, i64 0))
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.22, i64 0, i64 0))
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.23, i64 0, i64 0))
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.24, i64 0, i64 0))
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.25, i64 0, i64 0))
br label %52
52: ; preds = %142, %2
%53 = load i32, i32* %6
%54 = load i32, i32* @EOF
%55 = icmp ne i32 %53, %54
br i1 %55, label %56, label %143
56: ; preds = %52
%57 = load i32*, i32** %7
%58 = call i32 @fgetc(i32* %57)
store i32 %58, i32* %6
%59 = load i32, i32* %6
%60 = icmp eq i32 %59, 92
br i1 %60, label %61, label %63
61: ; preds = %56
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.26, i64 0, i64 0))
br label %142
63: ; preds = %56
%64 = load i32, i32* %6
%65 = icmp eq i32 %64, 37
br i1 %65, label %66, label %68
66: ; preds = %63
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0))
br label %141
68: ; preds = %63
%69 = load i32, i32* %6
%70 = icmp eq i32 %69, 39
br i1 %70, label %71, label %73
71: ; preds = %68
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.28, i64 0, i64 0))
br label %140
73: ; preds = %68
%74 = load i32, i32* %6
%75 = icmp eq i32 %74, 34
br i1 %75, label %76, label %78
76: ; preds = %73
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.29, i64 0, i64 0))
br label %139
78: ; preds = %73
%79 = load i32, i32* %6
%80 = icmp eq i32 %79, 63
br i1 %80, label %81, label %83
81: ; preds = %78
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.30, i64 0, i64 0))
br label %138
83: ; preds = %78
%84 = load i32, i32* %6
%85 = icmp eq i32 %84, 9
br i1 %85, label %86, label %88
86: ; preds = %83
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.31, i64 0, i64 0))
br label %137
88: ; preds = %83
%89 = load i32, i32* %6
%90 = icmp eq i32 %89, 12
br i1 %90, label %91, label %93
91: ; preds = %88
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.32, i64 0, i64 0))
br label %136
93: ; preds = %88
%94 = load i32, i32* %6
%95 = icmp eq i32 %94, 7
br i1 %95, label %96, label %98
96: ; preds = %93
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.33, i64 0, i64 0))
br label %135
98: ; preds = %93
%99 = load i32, i32* %6
%100 = icmp eq i32 %99, 8
br i1 %100, label %101, label %103
101: ; preds = %98
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.34, i64 0, i64 0))
br label %134
103: ; preds = %98
%104 = load i32, i32* %6
%105 = icmp eq i32 %104, 11
br i1 %105, label %106, label %108
106: ; preds = %103
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.35, i64 0, i64 0))
br label %133
108: ; preds = %103
%109 = load i32, i32* %6
%110 = icmp sge i32 %109, 127
br i1 %110, label %111, label %114
111: ; preds = %108
%112 = load i32, i32* %6
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.36, i64 0, i64 0), i32 %112)
br label %132
114: ; preds = %108
%115 = load i32, i32* %6
%116 = icmp eq i32 %115, 10
br i1 %116, label %117, label %120
117: ; preds = %114
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.37, i64 0, i64 0))
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.25, i64 0, i64 0))
br label %131
120: ; preds = %114
%121 = load i32, i32* %6
%122 = load i32, i32* @EOF
%123 = icmp eq i32 %121, %122
br i1 %123, label %124, label %127
124: ; preds = %120
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.37, i64 0, i64 0))
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.38, i64 0, i64 0))
br label %143
127: ; preds = %120
%128 = load i32, i32* %6
%129 = call i32 @putchar(i32 %128)
br label %130
130: ; preds = %127
br label %131
131: ; preds = %130, %117
br label %132
132: ; preds = %131, %111
br label %133
133: ; preds = %132, %106
br label %134
134: ; preds = %133, %101
br label %135
135: ; preds = %134, %96
br label %136
136: ; preds = %135, %91
br label %137
137: ; preds = %136, %86
br label %138
138: ; preds = %137, %81
br label %139
139: ; preds = %138, %76
br label %140
140: ; preds = %139, %71
br label %141
141: ; preds = %140, %66
br label %142
142: ; preds = %141, %61
br label %52
143: ; preds = %124, %52
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.39, i64 0, i64 0))
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.40, i64 0, i64 0))
%146 = load i32*, i32** %7
%147 = call i32 @fclose(i32* %146)
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.10 = [16 x i8] c"----- %s -----\0A\00"
@.str.25 = [15 x i8] c" fprintf(fp,\22\00"
@EOF = global i32 0
@.str.26 = [3 x i8] c"\\\\\00"
@.str.27 = [5 x i8] c"%%%%\00"
@.str.28 = [3 x i8] c"\\'\00"
@.str.29 = [3 x i8] c"\\\22\00"
@.str.30 = [3 x i8] c"\\?\00"
@.str.31 = [3 x i8] c"\\t\00"
@.str.32 = [3 x i8] c"\\f\00"
@.str.33 = [3 x i8] c"\\a\00"
@.str.34 = [3 x i8] c"\\b\00"
@.str.35 = [3 x i8] c"\\v\00"
@.str.36 = [7 x i8] c"\\x%02X\00"
@str.43 = [28 x i8] c"# --- MAKE-C-TPL-0002.C ---\00"
@str.45 = [34 x i8] c"# converted to a C Template file.\00"
@str.48 = [39 x i8] c"# The text is written to a named file.\00"
@str.49 = [2 x i8] c"#\00"
@str.50 = [37 x i8] c"####################################\00"
@str.51 = [4 x i8] c"*/\0A\00"
@str.52 = [3 x i8] c"/*\00"
@str.54 = [40 x i8] c"Written in ISO/IEC 9899:2011 standard C\00"
@str.55 = [60 x i8] c"===========================================================\00"
@str.56 = [3 x i8] c"*/\00"
@str.57 = [31 x i8] c"/* ----- Header files ----- */\00"
@str.58 = [19 x i8] c"#include <stdio.h>\00"
@str.59 = [21 x i8] c"#include <stdlib.h>\0A\00"
@str.60 = [48 x i8] c"/* ----- Typedefs, structs and unions ----- */\0A\00"
@str.61 = [39 x i8] c"/* ----- Function Prototypes ----- */\0A\00"
@str.62 = [36 x i8] c"/* ----- Global variables ----- */\0A\00"
@str.63 = [38 x i8] c"/* ----- Program starts here ----- */\00"
@str.64 = [33 x i8] c"int main(int argc, char *argv[])\00"
@str.65 = [2 x i8] c"{\00"
@str.66 = [11 x i8] c" FILE *fp\00"
@str.67 = [60 x i8] c" fp=fopen(\22file0002.txt\22,\22w\22); /* Open file for writing */\00"
@str.68 = [12 x i8] c" return 0;\00"
@str.69 = [3 x i8] c"}\0A\00"
@str.71 = [32 x i8] c" fclose(fp); /* Close file */\0A\00"
@str.72 = [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.52, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.50, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.49, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.43, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.49, 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.45, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.49, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.49, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.48, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.49, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.50, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.51, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.52, i64 0, i64 0))
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.55, i64 0, i64 0))
%22 = load i8*, i8** %3
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i8* %22)
%24 = tail call i32 @putchar(i32 10)
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.54, i64 0, i64 0))
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.55, i64 0, i64 0))
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.56, i64 0, i64 0))
%28 = tail call i32 @putchar(i32 10)
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.57, i64 0, i64 0))
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.58, i64 0, i64 0))
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.59, i64 0, i64 0))
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.60, i64 0, i64 0))
%33 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.61, i64 0, i64 0))
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.62, i64 0, i64 0))
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.63, i64 0, i64 0))
%36 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.64, i64 0, i64 0))
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.65, i64 0, i64 0))
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.66, i64 0, i64 0))
%39 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.67, i64 0, i64 0))
%40 = tail call i32 @putchar(i32 10)
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.25, i64 0, i64 0))
br label %42
42: ; preds = %2, %81
%43 = tail call i32 @fgetc(i32* %5)
switch i32 %43, label %64 [
i32 92, label %44
i32 37, label %46
i32 39, label %48
i32 34, label %50
i32 63, label %52
i32 9, label %54
i32 12, label %56
i32 7, label %58
i32 8, label %60
i32 11, label %62
]
44: ; preds = %42
%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 %81
46: ; preds = %42
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0))
br label %81
48: ; preds = %42
%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 %81
50: ; preds = %42
%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 %81
52: ; preds = %42
%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 %81
54: ; preds = %42
%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 %81
56: ; preds = %42
%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 %81
58: ; preds = %42
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.33, i64 0, i64 0))
br label %81
60: ; preds = %42
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.34, i64 0, i64 0))
br label %81
62: ; preds = %42
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.35, i64 0, i64 0))
br label %81
64: ; preds = %42
%65 = icmp sgt i32 %43, 126
br i1 %65, label %66, label %68
66: ; preds = %64
%67 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.36, i64 0, i64 0), i32 %43)
br label %81
68: ; preds = %64
%69 = icmp eq i32 %43, 10
br i1 %69, label %70, label %73
70: ; preds = %68
%71 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.72, i64 0, i64 0))
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.25, i64 0, i64 0))
br label %81
73: ; preds = %68
%74 = load i32, i32* @EOF
%75 = icmp eq i32 %43, %74
br i1 %75, label %76, label %79
76: ; preds = %73
%77 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.72, i64 0, i64 0))
%78 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.71, i64 0, i64 0))
br label %84
79: ; preds = %73
%80 = tail call i32 @putchar(i32 %43)
br label %81
81: ; preds = %46, %50, %54, %58, %62, %70, %79, %66, %60, %56, %52, %48, %44
%82 = load i32, i32* @EOF
%83 = icmp eq i32 %43, %82
br i1 %83, label %84, label %42
84: ; preds = %81, %76
%85 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.68, i64 0, i64 0))
%86 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.69, i64 0, i64 0))
%87 = tail call i32 @fclose(i32* %5)
ret i32 0
}