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

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ exit(int);
scalar_t__ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
scalar_t__ ferror(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ mkdir(char *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
char *strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int generateFramework() {
  printf("Generating Framework\n");
  char name[50];
  printf("NAEM? ");
  fgets(name, sizeof(name), stdin);
  name[strlen(name) - 1] = '\0';
  mkdir(name, 0755);
  char HTMLol[60];
  char Testing[60];
  char Controllers[63];
  char MySQLinfo[60];
  char READMEfile[60];
  char testpage[60];
  char Media[60];
  strcpy(Media, name);
  strcat(Media, "/Media");
  mkdir(Media, 0755);
  strcpy(HTMLol, name);
  strcat(HTMLol, "/HTMLol");
  mkdir(HTMLol, 0755);
  strcpy(Controllers, name);
  strcat(Controllers, "/Controllers");
  mkdir(Controllers, 0755);
  strcpy(Testing, name);
  strcat(Testing, "/DB");
  mkdir(Testing, 0755);
  strcpy(MySQLinfo, name);
  strcat(MySQLinfo, "/MySQL config.txt");
  FILE *newFile;
  newFile = fopen(MySQLinfo, "w");
  fprintf(newFile, "username: \npassword: \n");
  strcpy(READMEfile, name);
  strcat(READMEfile, "/README.txt");
  newFile = fopen(READMEfile, "w");
  fprintf(newFile,
          "ROFL On Rails\nVersion 0.1\nA Web Application Framework for "
          "LOLCODE\n\nUse of ROFL On Rails (enter into shell):\nTo create "
          "Controller files type: CAN HAS CONTROLLR\nTo generate scaffolding "
          "type: SCAFFOLD\nTo migrate htmlol files: MIGRATE");
  strcpy(testpage, name);
  strcat(testpage, "/HTMLol/test.htmlol");
  newFile = fopen(testpage, "w");
  fprintf(
      newFile,
      "#!/usr/bin/ruby /usr/bin/ROR.tab.rb\n<HTML>\n  <HEAD>\n    <TITLE>ROFL "
      "On Rails - Test Page</TITLE>\n\n  </HEAD>\n  "
      "<BODY>\n<CENTER>\n<?HAI\n\n      VISIBLE \"<H1>LOLCode Works!</H1>\"\n  "
      "\nKTHXBYE?>\n\n<img src=\"../Roflcopter.gif\" />\n<H3>LOLCODE: ALL "
      "LOLCATS, LOL, ALL CAPS</H3>\n</CENTER>\n  </BODY>\n\n</HTML>");
  FILE *from, *to;
  char ch;
  if ((from = fopen("/var/www/Media/Roflcopter.gif", "rb")) == NULL) {
    printf("Cannot open source file.\n");
    exit(1);
  }
  if ((to = fopen(strcat(name, "/Media/Roflcopter.gif"), "wb")) == NULL) {
    printf("Cannot open destination file.\n");
    exit(1);
  }
  while (!feof(from)) {
    ch = fgetc(from);
    if (ferror(from)) {
      printf("Error reading source file.\n");
      exit(1);
    }
    if (!feof(from))
      fputc(ch, to);
    if (ferror(to)) {
      printf("Error writing destination file.\n");
      exit(1);
    }
  }
  if (fclose(from) == EOF) {
    printf("Error closing source file.\n");
    exit(1);
  }
  if (fclose(to) == EOF) {
    printf("Error closing destination file.\n");
    exit(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<generateFramework>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
lea    0xe0e(%rip),%rdi
call   1080 <printf@plt>
lea    0xe18(%rip),%rdi
call   1080 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    0x2dda(%rip),%rax
mov    (%rax),%edx
mov    $0x32,%esi
call   10b0 <fgets@plt>
lea    -0x40(%rbp),%rdi
call   1070 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0x40(%rbp,%rax,1)
lea    -0x40(%rbp),%rdi
mov    $0x1ed,%esi
call   1040 <mkdir@plt>
lea    -0x200(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x200(%rbp),%rdi
lea    0xdc4(%rip),%rsi
call   10f0 <strcat@plt>
lea    -0x200(%rbp),%rdi
mov    $0x1ed,%esi
call   1040 <mkdir@plt>
lea    -0x80(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x80(%rbp),%rdi
lea    0xd9d(%rip),%rsi
call   10f0 <strcat@plt>
lea    -0x80(%rbp),%rdi
mov    $0x1ed,%esi
call   1040 <mkdir@plt>
lea    -0x100(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x100(%rbp),%rdi
lea    0xd74(%rip),%rsi
call   10f0 <strcat@plt>
lea    -0x100(%rbp),%rdi
mov    $0x1ed,%esi
call   1040 <mkdir@plt>
lea    -0xc0(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0xc0(%rbp),%rdi
lea    0xd4d(%rip),%rsi
call   10f0 <strcat@plt>
lea    -0xc0(%rbp),%rdi
mov    $0x1ed,%esi
call   1040 <mkdir@plt>
lea    -0x140(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x140(%rbp),%rdi
lea    0xd1d(%rip),%rsi
call   10f0 <strcat@plt>
lea    -0x140(%rbp),%rdi
lea    0xd1c(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x208(%rbp)
mov    -0x208(%rbp),%rdi
lea    0xd04(%rip),%rsi
call   10c0 <fprintf@plt>
lea    -0x180(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x180(%rbp),%rdi
lea    0xcf8(%rip),%rsi
call   10f0 <strcat@plt>
lea    -0x180(%rbp),%rdi
lea    0xccc(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x208(%rbp)
mov    -0x208(%rbp),%rdi
lea    0xcd7(%rip),%rsi
call   10c0 <fprintf@plt>
lea    -0x1c0(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x1c0(%rbp),%rdi
lea    0xd9b(%rip),%rsi
call   10f0 <strcat@plt>
lea    -0x1c0(%rbp),%rdi
lea    0xc7c(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x208(%rbp)
mov    -0x208(%rbp),%rdi
lea    0xd82(%rip),%rsi
call   10c0 <fprintf@plt>
lea    0xe9b(%rip),%rdi
lea    0xeb2(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x210(%rbp)
cmp    $0x0,%rax
jne    142c <generateFramework+0x24c>
lea    0xe98(%rip),%rdi
call   1080 <printf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    -0x40(%rbp),%rdi
lea    0xe65(%rip),%rsi
call   10f0 <strcat@plt>
mov    %rax,%rdi
lea    0xe89(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x218(%rbp)
cmp    $0x0,%rax
jne    1472 <generateFramework+0x292>
lea    0xe6f(%rip),%rdi
call   1080 <printf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
jmp    1477 <generateFramework+0x297>
mov    -0x210(%rbp),%rdi
call   10d0 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1498 <generateFramework+0x2b8>
jmp    1531 <generateFramework+0x351>
mov    -0x210(%rbp),%rdi
call   1090 <fgetc@plt>
mov    %al,-0x219(%rbp)
mov    -0x210(%rbp),%rdi
call   1050 <ferror@plt>
cmp    $0x0,%rax
je     14d6 <generateFramework+0x2f6>
lea    0xe2a(%rip),%rdi
call   1080 <printf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    -0x210(%rbp),%rdi
call   10d0 <feof@plt>
cmp    $0x0,%eax
jne    1500 <generateFramework+0x320>
mov    -0x219(%rbp),%al
mov    -0x218(%rbp),%rsi
movsbl %al,%edi
call   10a0 <fputc@plt>
mov    -0x218(%rbp),%rdi
call   1050 <ferror@plt>
cmp    $0x0,%rax
je     152c <generateFramework+0x34c>
lea    0xdf0(%rip),%rdi
call   1080 <printf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
jmp    1477 <generateFramework+0x297>
mov    -0x210(%rbp),%rdi
call   1060 <fclose@plt>
mov    0x2a9c(%rip),%rcx
cmp    (%rcx),%rax
jne    1563 <generateFramework+0x383>
lea    0xdda(%rip),%rdi
call   1080 <printf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    -0x218(%rbp),%rdi
call   1060 <fclose@plt>
mov    0x2a6a(%rip),%rcx
cmp    (%rcx),%rax
jne    1595 <generateFramework+0x3b5>
lea    0xdc4(%rip),%rdi
call   1080 <printf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
xor    %eax,%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateFramework>:
push   %r15
push   %r14
push   %rbx
sub    $0x200,%rsp
lea    0x10a3(%rip),%rdi
call   1050 <puts@plt>
lea    0xe01(%rip),%rdi
call   1090 <printf@plt>
mov    0x2ddd(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x32,%esi
call   10c0 <fgets@plt>
mov    %r15,%rdi
call   1080 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%r15,1)
mov    %r15,%rdi
mov    $0x1ed,%esi
call   1040 <mkdir@plt>
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1080 <strlen@plt>
movl   $0x64654d2f,0x40(%rsp,%rax,1)
64
movl   $0x616964,0x43(%rsp,%rax,1)
mov    %rbx,%rdi
mov    $0x1ed,%esi
call   1040 <mkdir@plt>
lea    0x1c0(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1080 <strlen@plt>
movabs $0x6c6f4c4d54482f,%rcx
mov    %rcx,0x1c0(%rsp,%rax,1)
mov    %rbx,%rdi
mov    $0x1ed,%esi
call   1040 <mkdir@plt>
lea    0x140(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1080 <strlen@plt>
movabs $0x6c6f72746e6f432f,%rcx
72 6f 6c
mov    %rcx,0x140(%rsp,%rax,1)
movabs $0x7372656c6c6f72,%rcx
mov    %rcx,0x145(%rsp,%rax,1)
mov    %rbx,%rdi
mov    $0x1ed,%esi
call   1040 <mkdir@plt>
lea    0x180(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1080 <strlen@plt>
movl   $0x42442f,0x180(%rsp,%rax,1)
mov    %rbx,%rdi
mov    $0x1ed,%esi
call   1040 <mkdir@plt>
lea    0x100(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1080 <strlen@plt>
movups 0xcd1(%rip),%xmm0
movups %xmm0,0x100(%rsp,%rax,1)
movw   $0x74,0x110(%rsp,%rax,1)
lea    0xcca(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   10e0 <fopen@plt>
lea    0xcba(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1100 <fwrite@plt>
lea    0xc0(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1080 <strlen@plt>
movabs $0x2e454d444145522f,%rcx
4d 45 2e
mov    %rcx,0xc0(%rsp,%rax,1)
movl   $0x747874,0xc8(%rsp,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   10e0 <fopen@plt>
lea    0xc81(%rip),%rdi
mov    $0xe6,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1100 <fwrite@plt>
lea    0x80(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1080 <strlen@plt>
movups 0xd34(%rip),%xmm0
movups %xmm0,0x80(%rsp,%rax,1)
movl   $0x6c6f6c,0x90(%rsp,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   10e0 <fopen@plt>
lea    0xd23(%rip),%rdi
mov    $0x124,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1100 <fwrite@plt>
lea    0xe2f(%rip),%rdi
lea    0xe46(%rip),%rsi
call   10e0 <fopen@plt>
test   %rax,%rax
je     1538 <generateFramework+0x358>
mov    %rax,%r15
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1080 <strlen@plt>
movabs $0x6669672e726574,%rcx
mov    %rcx,0xe(%rsp,%rax,1)
movups 0xdfe(%rip),%xmm0
movups %xmm0,(%rsp,%rax,1)
lea    0xe0c(%rip),%rsi
mov    %rbx,%rdi
call   10e0 <fopen@plt>
test   %rax,%rax
je     1541 <generateFramework+0x361>
mov    %rax,%r14
jmp    14ad <generateFramework+0x2cd>
nopl   (%rax)
mov    %r14,%rdi
call   1060 <ferror@plt>
test   %rax,%rax
jne    1519 <generateFramework+0x339>
mov    %r15,%rdi
call   10d0 <feof@plt>
test   %eax,%eax
jne    14e9 <generateFramework+0x309>
mov    %r15,%rdi
call   10a0 <fgetc@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1060 <ferror@plt>
test   %rax,%rax
jne    1522 <generateFramework+0x342>
mov    %r15,%rdi
call   10d0 <feof@plt>
test   %eax,%eax
jne    14a0 <generateFramework+0x2c0>
movsbl %bl,%edi
mov    %r14,%rsi
call   10b0 <fputc@plt>
jmp    14a0 <generateFramework+0x2c0>
mov    %r15,%rdi
call   1070 <fclose@plt>
mov    0x2ae8(%rip),%rbx
cmp    (%rbx),%rax
je     154a <generateFramework+0x36a>
mov    %r14,%rdi
call   1070 <fclose@plt>
cmp    (%rbx),%rax
je     1553 <generateFramework+0x373>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xdc6(%rip),%rdi
jmp    1529 <generateFramework+0x349>
lea    0xddd(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    0xe00(%rip),%rdi
jmp    1529 <generateFramework+0x349>
lea    0xdd9(%rip),%rdi
jmp    1529 <generateFramework+0x349>
lea    0xd7a(%rip),%rdi
jmp    1529 <generateFramework+0x349>
lea    0xd51(%rip),%rdi
jmp    1529 <generateFramework+0x349>

LLVM IR (-O0):
@.str = [22 x i8] c"Generating Framework\0A\00"
@.str.1 = [7 x i8] c"NAEM? \00"
@stdin = global i32 0
@.str.2 = [7 x i8] c"/Media\00"
@.str.3 = [8 x i8] c"/HTMLol\00"
@.str.4 = [13 x i8] c"/Controllers\00"
@.str.5 = [4 x i8] c"/DB\00"
@.str.6 = [18 x i8] c"/MySQL config.txt\00"
@.str.7 = [2 x i8] c"w\00"
@.str.8 = [23 x i8] c"username: \0Apassword: \0A\00"
@.str.9 = [12 x i8] c"/README.txt\00"
@.str.10 = [231 x i8] c"ROFL On Rails\0AVersion 0.1\0AA Web Application Framework for LOLCODE\0A\0AUse of ROFL On Rails (enter into shell):\0ATo create Controller files type: CAN HAS CONTROLLR\0ATo generate scaffolding type: SCAFFOLD\0ATo migrate htmlol files: MIGRATE\00"
@.str.11 = [20 x i8] c"/HTMLol/test.htmlol\00"
@.str.12 = [293 x i8] c"#!/usr/bin/ruby /usr/bin/ROR.tab.rb\0A<HTML>\0A <HEAD>\0A <TITLE>ROFL On Rails - Test Page</TITLE>\0A\0A </HEAD>\0A <BODY>\0A<CENTER>\0A<?HAI\0A\0A VISIBLE \22<H1>LOLCode Works!</H1>\22\0A \0AKTHXBYE?>\0A\0A<img src=\22../Roflcopter.gif\22 />\0A<H3>LOLCODE: ALL LOLCATS, LOL, ALL CAPS</H3>\0A</CENTER>\0A </BODY>\0A\0A</HTML>\00"
@.str.13 = [30 x i8] c"/var/www/Media/Roflcopter.gif\00"
@.str.14 = [3 x i8] c"rb\00"
@.str.15 = [26 x i8] c"Cannot open source file.\0A\00"
@.str.16 = [22 x i8] c"/Media/Roflcopter.gif\00"
@.str.17 = [3 x i8] c"wb\00"
@.str.18 = [31 x i8] c"Cannot open destination file.\0A\00"
@.str.19 = [28 x i8] c"Error reading source file.\0A\00"
@.str.20 = [33 x i8] c"Error writing destination file.\0A\00"
@EOF = global i64 0
@.str.21 = [28 x i8] c"Error closing source file.\0A\00"
@.str.22 = [33 x i8] c"Error closing destination file.\0A\00"
define i32 @generateFramework() {
%1 = alloca [50 x i8]
%2 = alloca [60 x i8]
%3 = alloca [60 x i8]
%4 = alloca [63 x i8]
%5 = alloca [60 x i8]
%6 = alloca [60 x i8]
%7 = alloca [60 x i8]
%8 = alloca [60 x i8]
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i8
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%15 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%16 = load i32, i32* @stdin
%17 = call i32 @fgets(i8* %15, i32 50, i32 %16)
%18 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%19 = call i32 @strlen(i8* %18)
%20 = sub nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 %21
store i8 0, i8* %22
%23 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%24 = call i32 @mkdir(i8* %23, i32 493)
%25 = getelementptr inbounds [60 x i8], [60 x i8]* %8, i64 0, i64 0
%26 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%27 = call i32 @strcpy(i8* %25, i8* %26)
%28 = getelementptr inbounds [60 x i8], [60 x i8]* %8, i64 0, i64 0
%29 = call i8* @strcat(i8* %28, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%30 = getelementptr inbounds [60 x i8], [60 x i8]* %8, i64 0, i64 0
%31 = call i32 @mkdir(i8* %30, i32 493)
%32 = getelementptr inbounds [60 x i8], [60 x i8]* %2, i64 0, i64 0
%33 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%34 = call i32 @strcpy(i8* %32, i8* %33)
%35 = getelementptr inbounds [60 x i8], [60 x i8]* %2, i64 0, i64 0
%36 = call i8* @strcat(i8* %35, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%37 = getelementptr inbounds [60 x i8], [60 x i8]* %2, i64 0, i64 0
%38 = call i32 @mkdir(i8* %37, i32 493)
%39 = getelementptr inbounds [63 x i8], [63 x i8]* %4, i64 0, i64 0
%40 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%41 = call i32 @strcpy(i8* %39, i8* %40)
%42 = getelementptr inbounds [63 x i8], [63 x i8]* %4, i64 0, i64 0
%43 = call i8* @strcat(i8* %42, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%44 = getelementptr inbounds [63 x i8], [63 x i8]* %4, i64 0, i64 0
%45 = call i32 @mkdir(i8* %44, i32 493)
%46 = getelementptr inbounds [60 x i8], [60 x i8]* %3, i64 0, i64 0
%47 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%48 = call i32 @strcpy(i8* %46, i8* %47)
%49 = getelementptr inbounds [60 x i8], [60 x i8]* %3, i64 0, i64 0
%50 = call i8* @strcat(i8* %49, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%51 = getelementptr inbounds [60 x i8], [60 x i8]* %3, i64 0, i64 0
%52 = call i32 @mkdir(i8* %51, i32 493)
%53 = getelementptr inbounds [60 x i8], [60 x i8]* %5, i64 0, i64 0
%54 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%55 = call i32 @strcpy(i8* %53, i8* %54)
%56 = getelementptr inbounds [60 x i8], [60 x i8]* %5, i64 0, i64 0
%57 = call i8* @strcat(i8* %56, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%58 = getelementptr inbounds [60 x i8], [60 x i8]* %5, i64 0, i64 0
%59 = call i32* @fopen(i8* %58, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %59, i32** %9
%60 = load i32*, i32** %9
%61 = call i32 @fprintf(i32* %60, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
%62 = getelementptr inbounds [60 x i8], [60 x i8]* %6, i64 0, i64 0
%63 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%64 = call i32 @strcpy(i8* %62, i8* %63)
%65 = getelementptr inbounds [60 x i8], [60 x i8]* %6, i64 0, i64 0
%66 = call i8* @strcat(i8* %65, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
%67 = getelementptr inbounds [60 x i8], [60 x i8]* %6, i64 0, i64 0
%68 = call i32* @fopen(i8* %67, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %68, i32** %9
%69 = load i32*, i32** %9
%70 = call i32 @fprintf(i32* %69, i8* getelementptr inbounds ([231 x i8], [231 x i8]* @.str.10, i64 0, i64 0))
%71 = getelementptr inbounds [60 x i8], [60 x i8]* %7, i64 0, i64 0
%72 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%73 = call i32 @strcpy(i8* %71, i8* %72)
%74 = getelementptr inbounds [60 x i8], [60 x i8]* %7, i64 0, i64 0
%75 = call i8* @strcat(i8* %74, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0))
%76 = getelementptr inbounds [60 x i8], [60 x i8]* %7, i64 0, i64 0
%77 = call i32* @fopen(i8* %76, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %77, i32** %9
%78 = load i32*, i32** %9
%79 = call i32 @fprintf(i32* %78, i8* getelementptr inbounds ([293 x i8], [293 x i8]* @.str.12, i64 0, i64 0))
%80 = call i32* @fopen(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
store i32* %80, i32** %10
%81 = icmp eq i32* %80, null
br i1 %81, label %82, label %85
82: ; preds = %0
%83 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.15, i64 0, i64 0))
%84 = call i32 @exit(i32 1)
unreachable
85: ; preds = %0
%86 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%87 = call i8* @strcat(i8* %86, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.16, i64 0, i64 0))
%88 = call i32* @fopen(i8* %87, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0))
store i32* %88, i32** %11
%89 = icmp eq i32* %88, null
br i1 %89, label %90, label %93
90: ; preds = %85
%91 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.18, i64 0, i64 0))
%92 = call i32 @exit(i32 1)
unreachable
93: ; preds = %85
br label %94
94: ; preds = %123, %93
%95 = load i32*, i32** %10
%96 = call i32 @feof(i32* %95)
%97 = icmp ne i32 %96, 0
%98 = xor i1 %97, true
br i1 %98, label %99, label %124
99: ; preds = %94
%100 = load i32*, i32** %10
%101 = call signext i8 @fgetc(i32* %100)
store i8 %101, i8* %12
%102 = load i32*, i32** %10
%103 = call i64 @ferror(i32* %102)
%104 = icmp ne i64 %103, 0
br i1 %104, label %105, label %108
105: ; preds = %99
%106 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.19, i64 0, i64 0))
%107 = call i32 @exit(i32 1)
unreachable
108: ; preds = %99
%109 = load i32*, i32** %10
%110 = call i32 @feof(i32* %109)
%111 = icmp ne i32 %110, 0
br i1 %111, label %116, label %112
112: ; preds = %108
%113 = load i8, i8* %12
%114 = load i32*, i32** %11
%115 = call i32 @fputc(i8 signext %113, i32* %114)
br label %116
116: ; preds = %112, %108
%117 = load i32*, i32** %11
%118 = call i64 @ferror(i32* %117)
%119 = icmp ne i64 %118, 0
br i1 %119, label %120, label %123
120: ; preds = %116
%121 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.20, i64 0, i64 0))
%122 = call i32 @exit(i32 1)
unreachable
123: ; preds = %116
br label %94
124: ; preds = %94
%125 = load i32*, i32** %10
%126 = call i64 @fclose(i32* %125)
%127 = load i64, i64* @EOF
%128 = icmp eq i64 %126, %127
br i1 %128, label %129, label %132
129: ; preds = %124
%130 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.21, i64 0, i64 0))
%131 = call i32 @exit(i32 1)
unreachable
132: ; preds = %124
%133 = load i32*, i32** %11
%134 = call i64 @fclose(i32* %133)
%135 = load i64, i64* @EOF
%136 = icmp eq i64 %134, %135
br i1 %136, label %137, label %140
137: ; preds = %132
%138 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.22, i64 0, i64 0))
%139 = call i32 @exit(i32 1)
unreachable
140: ; preds = %132
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"NAEM? \00"
@stdin = global i32 0
@.str.2 = [7 x i8] c"/Media\00"
@.str.4 = [13 x i8] c"/Controllers\00"
@.str.6 = [18 x i8] c"/MySQL config.txt\00"
@.str.7 = [2 x i8] c"w\00"
@.str.8 = [23 x i8] c"username: \0Apassword: \0A\00"
@.str.9 = [12 x i8] c"/README.txt\00"
@.str.10 = [231 x i8] c"ROFL On Rails\0AVersion 0.1\0AA Web Application Framework for LOLCODE\0A\0AUse of ROFL On Rails (enter into shell):\0ATo create Controller files type: CAN HAS CONTROLLR\0ATo generate scaffolding type: SCAFFOLD\0ATo migrate htmlol files: MIGRATE\00"
@.str.11 = [20 x i8] c"/HTMLol/test.htmlol\00"
@.str.12 = [293 x i8] c"#!/usr/bin/ruby /usr/bin/ROR.tab.rb\0A<HTML>\0A <HEAD>\0A <TITLE>ROFL On Rails - Test Page</TITLE>\0A\0A </HEAD>\0A <BODY>\0A<CENTER>\0A<?HAI\0A\0A VISIBLE \22<H1>LOLCode Works!</H1>\22\0A \0AKTHXBYE?>\0A\0A<img src=\22../Roflcopter.gif\22 />\0A<H3>LOLCODE: ALL LOLCATS, LOL, ALL CAPS</H3>\0A</CENTER>\0A </BODY>\0A\0A</HTML>\00"
@.str.13 = [30 x i8] c"/var/www/Media/Roflcopter.gif\00"
@.str.14 = [3 x i8] c"rb\00"
@.str.16 = [22 x i8] c"/Media/Roflcopter.gif\00"
@.str.17 = [3 x i8] c"wb\00"
@EOF = global i64 0
@str = [21 x i8] c"Generating Framework\00"
@str.23 = [32 x i8] c"Error closing destination file.\00"
@str.24 = [27 x i8] c"Error closing source file.\00"
@str.25 = [32 x i8] c"Error writing destination file.\00"
@str.26 = [27 x i8] c"Error reading source file.\00"
@str.27 = [30 x i8] c"Cannot open destination file.\00"
@str.28 = [25 x i8] c"Cannot open source file.\00"
define i32 @generateFramework() {
%1 = alloca [50 x i8]
%2 = alloca [60 x i8]
%3 = alloca [60 x i8]
%4 = alloca [63 x i8]
%5 = alloca [60 x i8]
%6 = alloca [60 x i8]
%7 = alloca [60 x i8]
%8 = alloca [60 x i8]
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%10 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* @stdin
%13 = call i32 @fgets(i8* %10, i32 50, i32 %12)
%14 = call i32 @strlen(i8* %10)
%15 = add nsw i32 %14, -1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 %16
store i8 0, i8* %17
%18 = call i32 @mkdir(i8* %10, i32 493)
%19 = getelementptr inbounds [60 x i8], [60 x i8]* %2, i64 0, i64 0
%20 = getelementptr inbounds [60 x i8], [60 x i8]* %3, i64 0, i64 0
%21 = getelementptr inbounds [63 x i8], [63 x i8]* %4, i64 0, i64 0
%22 = getelementptr inbounds [60 x i8], [60 x i8]* %5, i64 0, i64 0
%23 = getelementptr inbounds [60 x i8], [60 x i8]* %6, i64 0, i64 0
%24 = getelementptr inbounds [60 x i8], [60 x i8]* %7, i64 0, i64 0
%25 = getelementptr inbounds [60 x i8], [60 x i8]* %8, i64 0, i64 0
%26 = call i32 @strcpy(i8* %25, i8* %10)
%27 = call i64 bitcast (i32 (i8*)* @strlen to i64 (i8*)*)(i8* %25)
%28 = getelementptr [60 x i8], [60 x i8]* %8, i64 0, i64 %27
%29 = call i32 @mkdir(i8* %25, i32 493)
%30 = call i32 @strcpy(i8* %19, i8* %10)
%31 = call i64 bitcast (i32 (i8*)* @strlen to i64 (i8*)*)(i8* %19)
%32 = getelementptr [60 x i8], [60 x i8]* %2, i64 0, i64 %31
%33 = bitcast i8* %32 to i64*
store i64 30521670990317615, i64* %33
%34 = call i32 @mkdir(i8* %19, i32 493)
%35 = call i32 @strcpy(i8* %21, i8* %10)
%36 = call i64 bitcast (i32 (i8*)* @strlen to i64 (i8*)*)(i8* %21)
%37 = getelementptr [63 x i8], [63 x i8]* %4, i64 0, i64 %36
%38 = call i32 @mkdir(i8* %21, i32 493)
%39 = call i32 @strcpy(i8* %20, i8* %10)
%40 = call i64 bitcast (i32 (i8*)* @strlen to i64 (i8*)*)(i8* %20)
%41 = getelementptr [60 x i8], [60 x i8]* %3, i64 0, i64 %40
%42 = bitcast i8* %41 to i32*
store i32 4342831, i32* %42
%43 = call i32 @mkdir(i8* %20, i32 493)
%44 = call i32 @strcpy(i8* %22, i8* %10)
%45 = call i64 bitcast (i32 (i8*)* @strlen to i64 (i8*)*)(i8* %22)
%46 = getelementptr [60 x i8], [60 x i8]* %5, i64 0, i64 %45
%47 = call i32* @fopen(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%48 = call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i64 22, i64 1, i32* %47)
%49 = call i32 @strcpy(i8* %23, i8* %10)
%50 = call i64 bitcast (i32 (i8*)* @strlen to i64 (i8*)*)(i8* %23)
%51 = getelementptr [60 x i8], [60 x i8]* %6, i64 0, i64 %50
%52 = call i32* @fopen(i8* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%53 = call i64 @fwrite(i8* getelementptr inbounds ([231 x i8], [231 x i8]* @.str.10, i64 0, i64 0), i64 230, i64 1, i32* %52)
%54 = call i32 @strcpy(i8* %24, i8* %10)
%55 = call i64 bitcast (i32 (i8*)* @strlen to i64 (i8*)*)(i8* %24)
%56 = getelementptr [60 x i8], [60 x i8]* %7, i64 0, i64 %55
%57 = call i32* @fopen(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%58 = call i64 @fwrite(i8* getelementptr inbounds ([293 x i8], [293 x i8]* @.str.12, i64 0, i64 0), i64 292, i64 1, i32* %57)
%59 = call i32* @fopen(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
%60 = icmp eq i32* %59, null
br i1 %60, label %61, label %64
61: ; preds = %0
%62 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.28, i64 0, i64 0))
%63 = call i32 @exit(i32 1)
unreachable
64: ; preds = %0
%65 = call i64 bitcast (i32 (i8*)* @strlen to i64 (i8*)*)(i8* %10)
%66 = getelementptr [50 x i8], [50 x i8]* %1, i64 0, i64 %65
%67 = call i32* @fopen(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0))
%68 = icmp eq i32* %67, null
br i1 %68, label %69, label %72
69: ; preds = %64
%70 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.27, i64 0, i64 0))
%71 = call i32 @exit(i32 1)
unreachable
72: ; preds = %64, %87
%73 = call i32 @feof(i32* %59)
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %93
75: ; preds = %72
%76 = call signext i8 @fgetc(i32* %59)
%77 = call i64 @ferror(i32* %59)
%78 = icmp eq i64 %77, 0
br i1 %78, label %82, label %79
79: ; preds = %75
%80 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.26, i64 0, i64 0))
%81 = call i32 @exit(i32 1)
unreachable
82: ; preds = %75
%83 = call i32 @feof(i32* %59)
%84 = icmp eq i32 %83, 0
br i1 %84, label %85, label %87
85: ; preds = %82
%86 = call i32 @fputc(i8 signext %76, i32* %67)
br label %87
87: ; preds = %85, %82
%88 = call i64 @ferror(i32* %67)
%89 = icmp eq i64 %88, 0
br i1 %89, label %72, label %90
90: ; preds = %87
%91 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.25, i64 0, i64 0))
%92 = call i32 @exit(i32 1)
unreachable
93: ; preds = %72
%94 = call i64 @fclose(i32* %59)
%95 = load i64, i64* @EOF
%96 = icmp eq i64 %94, %95
br i1 %96, label %97, label %100
97: ; preds = %93
%98 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.24, i64 0, i64 0))
%99 = call i32 @exit(i32 1)
unreachable
100: ; preds = %93
%101 = call i64 @fclose(i32* %67)
%102 = load i64, i64* @EOF
%103 = icmp eq i64 %101, %102
br i1 %103, label %104, label %107
104: ; preds = %100
%105 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.23, i64 0, i64 0))
%106 = call i32 @exit(i32 1)
unreachable
107: ; preds = %100
ret i32 0
}