#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 fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int create_main(int max_so, int max_chain, int max_depth) {
  int i, j, k, rval;
  FILE *fp_main;
  char filename[100];
  fp_main = fopen("FOO_main.c", "w+");
  fprintf(fp_main, "//\n");
  fprintf(fp_main, "//\n");
  fprintf(fp_main, "#include <stdio.h>\n");
  fprintf(fp_main, "#include <stdlib.h>\n");
  fprintf(fp_main, "#include <malloc.h>\n");
  fprintf(fp_main, "typedef long (*FOO_pt) (long);\n");
  fprintf(fp_main, "FOO_pt *FOO_global;\n");
  fprintf(fp_main, "\n");
  fprintf(fp_main, "int main(int argc, char* argv[])\n");
  fprintf(fp_main, "{\n");
  fprintf(fp_main, "#include \"FOO.h\"\n");
  fprintf(fp_main, "\tlong i=0;\n");
  fprintf(fp_main, "\tlong j,k,m,n=0,loop;\n");
  fprintf(fp_main, "\tloop=atol(argv[1]);\n");
  fprintf(fp_main, "\tm=%d;\n", max_depth * max_chain * max_so);
  fprintf(fp_main, "\tFOO_array = (FOO_pt *) malloc(sizeof(FOO_pt)*m);\n");
  fprintf(fp_main, "\tFOO_global = FOO_array;\n");
  for (i = 0; i < max_so; i++) {
    for (j = 0; j < max_chain; j++) {
      for (k = 0; k < max_depth; k++) {
        fprintf(fp_main, "\t\tFOO_array[n] = &FOO_%03d_%03d_%03d;\n", i, j, k);
        fprintf(fp_main, "\t\tn++;\n");
      }
    }
  }
  fprintf(fp_main, "\tfor(k=0;k<loop;k++){\n");
  fprintf(fp_main, "\tn=0;\n");
  for (i = 0; i < max_so; i++) {
    for (j = 0; j < max_chain; j++) {
      fprintf(fp_main, "\t\tFOO_array[n](n);\n");
      fprintf(fp_main, "\tn+=%d;\n", max_depth);
    }
  }
  fprintf(fp_main, "\t}\n");
  fprintf(fp_main, "\n");
  fprintf(fp_main, "\treturn 0;\n");
  fprintf(fp_main, "}\n");
  rval = fclose(fp_main);
  return 0;
}


x86 assembly (clang, -O0):
<create_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    0xeb5(%rip),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xea8(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe96(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe88(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe8a(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe8d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe90(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe9e(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xed3(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe8f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xf82(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe8d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe8d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe87(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe8c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
mov    -0xc(%rbp),%edx
imul   -0x8(%rbp),%edx
imul   -0x4(%rbp),%edx
lea    0xe85(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe7b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe9c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1333 <create_main+0x203>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1320 <create_main+0x1f0>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    130d <create_main+0x1dd>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xe61(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe76(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12c5 <create_main+0x195>
jmp    1312 <create_main+0x1e2>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12b2 <create_main+0x182>
jmp    1325 <create_main+0x1f5>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    129f <create_main+0x16f>
mov    -0x28(%rbp),%rdi
lea    0xe38(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe3d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    13c5 <create_main+0x295>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    13b2 <create_main+0x282>
mov    -0x28(%rbp),%rdi
lea    0xe0c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xe0b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1371 <create_main+0x241>
jmp    13b7 <create_main+0x287>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    135e <create_main+0x22e>
mov    -0x28(%rbp),%rdi
lea    0xde1(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xcd5(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xdc1(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xdac(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%ebp
lea    0xe93(%rip),%rdi
lea    0xe97(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r13
lea    0xe8b(%rip),%rbx
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbx,%rdi
mov    %rax,%rcx
call   1070 <fwrite@plt>
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbx,%rdi
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xe5e(%rip),%rdi
mov    $0x13,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xe59(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xe55(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xe51(%rip),%rdi
mov    $0x1f,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xe58(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
mov    $0xa,%edi
mov    %r13,%rsi
call   1040 <fputc@plt>
lea    0xe47(%rip),%rdi
mov    $0x21,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xf33(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xe37(%rip),%rdi
mov    $0x11,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xe30(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xe23(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xe21(%rip),%rdi
mov    $0x15,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
mov    %r15d,0xc(%rsp)
imul   %ebp,%r15d
mov    %r14d,0x14(%rsp)
imul   %r14d,%r15d
lea    0xe0c(%rip),%rsi
mov    %r13,%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xe00(%rip),%rdi
mov    $0x32,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xe1a(%rip),%rdi
mov    $0x19,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
mov    %ebp,0x10(%rsp)
test   %ebp,%ebp
jle    146b <create_main+0x31b>
lea    0xe0f(%rip),%rbp
lea    0xe2f(%rip),%rbx
xor    %r15d,%r15d
mov    0x14(%rsp),%eax
jmp    135b <create_main+0x20b>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15d
cmp    0x10(%rsp),%r15d
je     13ca <create_main+0x27a>
cmpl   $0x0,0xc(%rsp)
jle    1350 <create_main+0x200>
xor    %r14d,%r14d
jmp    137b <create_main+0x22b>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r14d
cmp    0xc(%rsp),%r14d
je     1350 <create_main+0x200>
test   %eax,%eax
jle    1370 <create_main+0x220>
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %r15d,%edx
mov    %r14d,%ecx
mov    %r12d,%r8d
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x7,%esi
mov    $0x1,%edx
mov    %rbx,%rdi
mov    %r13,%rcx
call   1070 <fwrite@plt>
mov    0x14(%rsp),%eax
add    $0x1,%r12d
cmp    %r12d,%eax
jne    1390 <create_main+0x240>
jmp    1370 <create_main+0x220>
lea    0xda5(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xda3(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
cmpl   $0x0,0x10(%rsp)
jle    149d <create_main+0x34d>
lea    0xd86(%rip),%r15
lea    0xd93(%rip),%r12
xor    %r14d,%r14d
mov    0x14(%rsp),%ebp
jmp    142b <create_main+0x2db>
xchg   %ax,%ax
add    $0x1,%r14d
cmp    0x10(%rsp),%r14d
je     149d <create_main+0x34d>
cmpl   $0x0,0xc(%rsp)
jle    1420 <create_main+0x2d0>
mov    0xc(%rsp),%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x13,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %r13,%rcx
call   1070 <fwrite@plt>
mov    %r13,%rdi
mov    %r12,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
add    $0xffffffff,%ebx
jne    1440 <create_main+0x2f0>
jmp    1420 <create_main+0x2d0>
lea    0xd04(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xd02(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xd0d(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
mov    $0xa,%edi
mov    %r13,%rsi
call   1040 <fputc@plt>
lea    0xceb(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xccf(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
mov    %r13,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"FOO_main.c\00"
@.str.1 = [3 x i8] c"w+\00"
@.str.2 = [4 x i8] c"//\0A\00"
@.str.3 = [20 x i8] c"#include <stdio.h>\0A\00"
@.str.4 = [21 x i8] c"#include <stdlib.h>\0A\00"
@.str.5 = [21 x i8] c"#include <malloc.h>\0A\00"
@.str.6 = [32 x i8] c"typedef long (*FOO_pt) (long);\0A\00"
@.str.7 = [21 x i8] c"FOO_pt *FOO_global;\0A\00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [34 x i8] c"int main(int argc, char* argv[])\0A\00"
@.str.10 = [3 x i8] c"{\0A\00"
@.str.11 = [18 x i8] c"#include \22FOO.h\22\0A\00"
@.str.12 = [12 x i8] c"\09long i=0;\0A\00"
@.str.13 = [23 x i8] c"\09long j,k,m,n=0,loop;\0A\00"
@.str.14 = [22 x i8] c"\09loop=atol(argv[1]);\0A\00"
@.str.15 = [8 x i8] c"\09m=%d;\0A\00"
@.str.16 = [51 x i8] c"\09FOO_array = (FOO_pt *) malloc(sizeof(FOO_pt)*m);\0A\00"
@.str.17 = [26 x i8] c"\09FOO_global = FOO_array;\0A\00"
@.str.18 = [39 x i8] c"\09\09FOO_array[n] = &FOO_%03d_%03d_%03d;\0A\00"
@.str.19 = [8 x i8] c"\09\09n++;\0A\00"
@.str.20 = [23 x i8] c"\09for(k=0;k<loop;k++){\0A\00"
@.str.21 = [7 x i8] c"\09n=0;\0A\00"
@.str.22 = [20 x i8] c"\09\09FOO_array[n](n);\0A\00"
@.str.23 = [9 x i8] c"\09n+=%d;\0A\00"
@.str.24 = [4 x i8] c"\09}\0A\00"
@.str.25 = [12 x i8] c"\09return 0;\0A\00"
@.str.26 = [3 x i8] c"}\0A\00"
define i32 @create_main(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
%12 = alloca [100 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%13 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %13, i32** %11
%14 = load i32*, i32** %11
%15 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%16 = load i32*, i32** %11
%17 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%18 = load i32*, i32** %11
%19 = call i32 (i32*, i8*, ...) @fprintf(i32* %18, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%20 = load i32*, i32** %11
%21 = call i32 (i32*, i8*, ...) @fprintf(i32* %20, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
%22 = load i32*, i32** %11
%23 = call i32 (i32*, i8*, ...) @fprintf(i32* %22, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
%24 = load i32*, i32** %11
%25 = call i32 (i32*, i8*, ...) @fprintf(i32* %24, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0))
%26 = load i32*, i32** %11
%27 = call i32 (i32*, i8*, ...) @fprintf(i32* %26, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
%28 = load i32*, i32** %11
%29 = call i32 (i32*, i8*, ...) @fprintf(i32* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%30 = load i32*, i32** %11
%31 = call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.9, i64 0, i64 0))
%32 = load i32*, i32** %11
%33 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%34 = load i32*, i32** %11
%35 = call i32 (i32*, i8*, ...) @fprintf(i32* %34, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0))
%36 = load i32*, i32** %11
%37 = call i32 (i32*, i8*, ...) @fprintf(i32* %36, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0))
%38 = load i32*, i32** %11
%39 = call i32 (i32*, i8*, ...) @fprintf(i32* %38, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0))
%40 = load i32*, i32** %11
%41 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.14, i64 0, i64 0))
%42 = load i32*, i32** %11
%43 = load i32, i32* %6
%44 = load i32, i32* %5
%45 = mul nsw i32 %43, %44
%46 = load i32, i32* %4
%47 = mul nsw i32 %45, %46
%48 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0), i32 %47)
%49 = load i32*, i32** %11
%50 = call i32 (i32*, i8*, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.16, i64 0, i64 0))
%51 = load i32*, i32** %11
%52 = call i32 (i32*, i8*, ...) @fprintf(i32* %51, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.17, i64 0, i64 0))
store i32 0, i32* %7
br label %53
53: ; preds = %83, %3
%54 = load i32, i32* %7
%55 = load i32, i32* %4
%56 = icmp slt i32 %54, %55
br i1 %56, label %57, label %86
57: ; preds = %53
store i32 0, i32* %8
br label %58
58: ; preds = %79, %57
%59 = load i32, i32* %8
%60 = load i32, i32* %5
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %82
62: ; preds = %58
store i32 0, i32* %9
br label %63
63: ; preds = %75, %62
%64 = load i32, i32* %9
%65 = load i32, i32* %6
%66 = icmp slt i32 %64, %65
br i1 %66, label %67, label %78
67: ; preds = %63
%68 = load i32*, i32** %11
%69 = load i32, i32* %7
%70 = load i32, i32* %8
%71 = load i32, i32* %9
%72 = call i32 (i32*, i8*, ...) @fprintf(i32* %68, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.18, i64 0, i64 0), i32 %69, i32 %70, i32 %71)
%73 = load i32*, i32** %11
%74 = call i32 (i32*, i8*, ...) @fprintf(i32* %73, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
br label %75
75: ; preds = %67
%76 = load i32, i32* %9
%77 = add nsw i32 %76, 1
store i32 %77, i32* %9
br label %63
78: ; preds = %63
br label %79
79: ; preds = %78
%80 = load i32, i32* %8
%81 = add nsw i32 %80, 1
store i32 %81, i32* %8
br label %58
82: ; preds = %58
br label %83
83: ; preds = %82
%84 = load i32, i32* %7
%85 = add nsw i32 %84, 1
store i32 %85, i32* %7
br label %53
86: ; preds = %53
%87 = load i32*, i32** %11
%88 = call i32 (i32*, i8*, ...) @fprintf(i32* %87, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.20, i64 0, i64 0))
%89 = load i32*, i32** %11
%90 = call i32 (i32*, i8*, ...) @fprintf(i32* %89, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i64 0, i64 0))
store i32 0, i32* %7
br label %91
91: ; preds = %110, %86
%92 = load i32, i32* %7
%93 = load i32, i32* %4
%94 = icmp slt i32 %92, %93
br i1 %94, label %95, label %113
95: ; preds = %91
store i32 0, i32* %8
br label %96
96: ; preds = %106, %95
%97 = load i32, i32* %8
%98 = load i32, i32* %5
%99 = icmp slt i32 %97, %98
br i1 %99, label %100, label %109
100: ; preds = %96
%101 = load i32*, i32** %11
%102 = call i32 (i32*, i8*, ...) @fprintf(i32* %101, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.22, i64 0, i64 0))
%103 = load i32*, i32** %11
%104 = load i32, i32* %6
%105 = call i32 (i32*, i8*, ...) @fprintf(i32* %103, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.23, i64 0, i64 0), i32 %104)
br label %106
106: ; preds = %100
%107 = load i32, i32* %8
%108 = add nsw i32 %107, 1
store i32 %108, i32* %8
br label %96
109: ; preds = %96
br label %110
110: ; preds = %109
%111 = load i32, i32* %7
%112 = add nsw i32 %111, 1
store i32 %112, i32* %7
br label %91
113: ; preds = %91
%114 = load i32*, i32** %11
%115 = call i32 (i32*, i8*, ...) @fprintf(i32* %114, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.24, i64 0, i64 0))
%116 = load i32*, i32** %11
%117 = call i32 (i32*, i8*, ...) @fprintf(i32* %116, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%118 = load i32*, i32** %11
%119 = call i32 (i32*, i8*, ...) @fprintf(i32* %118, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.25, i64 0, i64 0))
%120 = load i32*, i32** %11
%121 = call i32 (i32*, i8*, ...) @fprintf(i32* %120, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.26, i64 0, i64 0))
%122 = load i32*, i32** %11
%123 = call i32 @fclose(i32* %122)
store i32 %123, i32* %10
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"FOO_main.c\00"
@.str.1 = [3 x i8] c"w+\00"
@.str.2 = [4 x i8] c"//\0A\00"
@.str.3 = [20 x i8] c"#include <stdio.h>\0A\00"
@.str.4 = [21 x i8] c"#include <stdlib.h>\0A\00"
@.str.5 = [21 x i8] c"#include <malloc.h>\0A\00"
@.str.6 = [32 x i8] c"typedef long (*FOO_pt) (long);\0A\00"
@.str.7 = [21 x i8] c"FOO_pt *FOO_global;\0A\00"
@.str.9 = [34 x i8] c"int main(int argc, char* argv[])\0A\00"
@.str.10 = [3 x i8] c"{\0A\00"
@.str.11 = [18 x i8] c"#include \22FOO.h\22\0A\00"
@.str.12 = [12 x i8] c"\09long i=0;\0A\00"
@.str.13 = [23 x i8] c"\09long j,k,m,n=0,loop;\0A\00"
@.str.14 = [22 x i8] c"\09loop=atol(argv[1]);\0A\00"
@.str.15 = [8 x i8] c"\09m=%d;\0A\00"
@.str.16 = [51 x i8] c"\09FOO_array = (FOO_pt *) malloc(sizeof(FOO_pt)*m);\0A\00"
@.str.17 = [26 x i8] c"\09FOO_global = FOO_array;\0A\00"
@.str.18 = [39 x i8] c"\09\09FOO_array[n] = &FOO_%03d_%03d_%03d;\0A\00"
@.str.19 = [8 x i8] c"\09\09n++;\0A\00"
@.str.20 = [23 x i8] c"\09for(k=0;k<loop;k++){\0A\00"
@.str.21 = [7 x i8] c"\09n=0;\0A\00"
@.str.22 = [20 x i8] c"\09\09FOO_array[n](n);\0A\00"
@.str.23 = [9 x i8] c"\09n+=%d;\0A\00"
@.str.24 = [4 x i8] c"\09}\0A\00"
@.str.25 = [12 x i8] c"\09return 0;\0A\00"
@.str.26 = [3 x i8] c"}\0A\00"
define i32 @create_main(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 3, i64 1, i32* %4)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 3, i64 1, i32* %4)
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i64 19, i64 1, i32* %4)
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i64 20, i64 1, i32* %4)
%9 = tail call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i64 20, i64 1, i32* %4)
%10 = tail call i64 @fwrite(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i64 31, i64 1, i32* %4)
%11 = tail call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i64 20, i64 1, i32* %4)
%12 = tail call i32 @fputc(i32 10, i32* %4)
%13 = tail call i64 @fwrite(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.9, i64 0, i64 0), i64 33, i64 1, i32* %4)
%14 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i64 2, i64 1, i32* %4)
%15 = tail call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i64 17, i64 1, i32* %4)
%16 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0), i64 11, i64 1, i32* %4)
%17 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0), i64 22, i64 1, i32* %4)
%18 = tail call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.14, i64 0, i64 0), i64 21, i64 1, i32* %4)
%19 = mul i32 %1, %0
%20 = mul i32 %19, %2
%21 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0), i32 %20)
%22 = tail call i64 @fwrite(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.16, i64 0, i64 0), i64 50, i64 1, i32* %4)
%23 = tail call i64 @fwrite(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.17, i64 0, i64 0), i64 25, i64 1, i32* %4)
%24 = icmp sgt i32 %0, 0
br i1 %24, label %25, label %60
25: ; preds = %3
%26 = icmp sgt i32 %1, 0
%27 = icmp sgt i32 %2, 0
br label %28
28: ; preds = %25, %41
%29 = phi i32 [ 0, %25 ], [ %42, %41 ]
br i1 %26, label %30, label %41
30: ; preds = %28, %38
%31 = phi i32 [ %39, %38 ], [ 0, %28 ]
br i1 %27, label %32, label %38
32: ; preds = %30, %32
%33 = phi i32 [ %36, %32 ], [ 0, %30 ]
%34 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.18, i64 0, i64 0), i32 %29, i32 %31, i32 %33)
%35 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0), i64 7, i64 1, i32* %4)
%36 = add nuw nsw i32 %33, 1
%37 = icmp eq i32 %36, %2
br i1 %37, label %38, label %32
38: ; preds = %32, %30
%39 = add nuw nsw i32 %31, 1
%40 = icmp eq i32 %39, %1
br i1 %40, label %41, label %30
41: ; preds = %38, %28
%42 = add nuw nsw i32 %29, 1
%43 = icmp eq i32 %42, %0
br i1 %43, label %44, label %28
44: ; preds = %41
%45 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.20, i64 0, i64 0), i64 22, i64 1, i32* %4)
%46 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i64 0, i64 0), i64 6, i64 1, i32* %4)
br i1 %24, label %47, label %63
47: ; preds = %44
%48 = icmp sgt i32 %1, 0
br label %49
49: ; preds = %47, %57
%50 = phi i32 [ 0, %47 ], [ %58, %57 ]
br i1 %48, label %51, label %57
51: ; preds = %49, %51
%52 = phi i32 [ %55, %51 ], [ 0, %49 ]
%53 = tail call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.22, i64 0, i64 0), i64 19, i64 1, i32* %4)
%54 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.23, i64 0, i64 0), i32 %2)
%55 = add nuw nsw i32 %52, 1
%56 = icmp eq i32 %55, %1
br i1 %56, label %57, label %51
57: ; preds = %51, %49
%58 = add nuw nsw i32 %50, 1
%59 = icmp eq i32 %58, %0
br i1 %59, label %63, label %49
60: ; preds = %3
%61 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.20, i64 0, i64 0), i64 22, i64 1, i32* %4)
%62 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i64 0, i64 0), i64 6, i64 1, i32* %4)
br label %63
63: ; preds = %57, %60, %44
%64 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.24, i64 0, i64 0), i64 3, i64 1, i32* %4)
%65 = tail call i32 @fputc(i32 10, i32* %4)
%66 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.25, i64 0, i64 0), i64 11, i64 1, i32* %4)
%67 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.26, i64 0, i64 0), i64 2, i64 1, i32* %4)
%68 = tail call i32 @fclose(i32* %4)
ret i32 0
}