#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, "FOO_pt FOO_array[%d];\n", max_depth * max_chain * max_so);
  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_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    0xf66(%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
mov    -0xc(%rbp),%edx
imul   -0x8(%rbp),%edx
imul   -0x4(%rbp),%edx
lea    0xe82(%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    0xe81(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe86(%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    0xe7f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe75(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    133e <create_main+0x20e>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    132b <create_main+0x1fb>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1318 <create_main+0x1e8>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xe3a(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe4f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12d0 <create_main+0x1a0>
jmp    131d <create_main+0x1ed>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12bd <create_main+0x18d>
jmp    1330 <create_main+0x200>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    12aa <create_main+0x17a>
mov    -0x28(%rbp),%rdi
lea    0xe11(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe16(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    13d0 <create_main+0x2a0>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    13bd <create_main+0x28d>
mov    -0x28(%rbp),%rdi
lea    0xde5(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xde4(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    137c <create_main+0x24c>
jmp    13c2 <create_main+0x292>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1369 <create_main+0x239>
mov    -0x28(%rbp),%rdi
lea    0xdba(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xcca(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xd9a(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xd85(%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,%ebp
mov    %edi,%r15d
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    0xf17(%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>
mov    %ebp,0xc(%rsp)
imul   %r15d,%ebp
mov    %r14d,0x14(%rsp)
imul   %r14d,%ebp
lea    0xe1f(%rip),%rsi
mov    %r13,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xe23(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xe16(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xe14(%rip),%rdi
mov    $0x15,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xe11(%rip),%rsi
mov    %r13,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xe06(%rip),%rdi
mov    $0x19,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
mov    %r15d,0x10(%rsp)
test   %r15d,%r15d
jle    146b <create_main+0x31b>
lea    0xdf9(%rip),%rbp
lea    0xe19(%rip),%rbx
xor    %r15d,%r15d
mov    0x14(%rsp),%eax
jmp    135b <create_main+0x20b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
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    0xd89(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xd87(%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    0xd6a(%rip),%r15
lea    0xd77(%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    0xce8(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xce6(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xcf1(%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    0xccf(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xcb3(%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 = [23 x i8] c"FOO_pt FOO_array[%d];\0A\00"
@.str.13 = [12 x i8] c"\09long i=0;\0A\00"
@.str.14 = [23 x i8] c"\09long j,k,m,n=0,loop;\0A\00"
@.str.15 = [22 x i8] c"\09loop=atol(argv[1]);\0A\00"
@.str.16 = [8 x i8] c"\09m=%d;\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 = load i32, i32* %6
%38 = load i32, i32* %5
%39 = mul nsw i32 %37, %38
%40 = load i32, i32* %4
%41 = mul nsw i32 %39, %40
%42 = call i32 (i32*, i8*, ...) @fprintf(i32* %36, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), i32 %41)
%43 = load i32*, i32** %11
%44 = call i32 (i32*, i8*, ...) @fprintf(i32* %43, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
%45 = load i32*, i32** %11
%46 = call i32 (i32*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
%47 = load i32*, i32** %11
%48 = call i32 (i32*, i8*, ...) @fprintf(i32* %47, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.15, i64 0, i64 0))
%49 = load i32*, i32** %11
%50 = load i32, i32* %6
%51 = load i32, i32* %5
%52 = mul nsw i32 %50, %51
%53 = load i32, i32* %4
%54 = mul nsw i32 %52, %53
%55 = call i32 (i32*, i8*, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), i32 %54)
%56 = load i32*, i32** %11
%57 = call i32 (i32*, i8*, ...) @fprintf(i32* %56, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.17, i64 0, i64 0))
store i32 0, i32* %7
br label %58
58: ; preds = %88, %3
%59 = load i32, i32* %7
%60 = load i32, i32* %4
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %91
62: ; preds = %58
store i32 0, i32* %8
br label %63
63: ; preds = %84, %62
%64 = load i32, i32* %8
%65 = load i32, i32* %5
%66 = icmp slt i32 %64, %65
br i1 %66, label %67, label %87
67: ; preds = %63
store i32 0, i32* %9
br label %68
68: ; preds = %80, %67
%69 = load i32, i32* %9
%70 = load i32, i32* %6
%71 = icmp slt i32 %69, %70
br i1 %71, label %72, label %83
72: ; preds = %68
%73 = load i32*, i32** %11
%74 = load i32, i32* %7
%75 = load i32, i32* %8
%76 = load i32, i32* %9
%77 = call i32 (i32*, i8*, ...) @fprintf(i32* %73, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.18, i64 0, i64 0), i32 %74, i32 %75, i32 %76)
%78 = load i32*, i32** %11
%79 = call i32 (i32*, i8*, ...) @fprintf(i32* %78, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
br label %80
80: ; preds = %72
%81 = load i32, i32* %9
%82 = add nsw i32 %81, 1
store i32 %82, i32* %9
br label %68
83: ; preds = %68
br label %84
84: ; preds = %83
%85 = load i32, i32* %8
%86 = add nsw i32 %85, 1
store i32 %86, i32* %8
br label %63
87: ; preds = %63
br label %88
88: ; preds = %87
%89 = load i32, i32* %7
%90 = add nsw i32 %89, 1
store i32 %90, i32* %7
br label %58
91: ; preds = %58
%92 = load i32*, i32** %11
%93 = call i32 (i32*, i8*, ...) @fprintf(i32* %92, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.20, i64 0, i64 0))
%94 = load i32*, i32** %11
%95 = call i32 (i32*, i8*, ...) @fprintf(i32* %94, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i64 0, i64 0))
store i32 0, i32* %7
br label %96
96: ; preds = %115, %91
%97 = load i32, i32* %7
%98 = load i32, i32* %4
%99 = icmp slt i32 %97, %98
br i1 %99, label %100, label %118
100: ; preds = %96
store i32 0, i32* %8
br label %101
101: ; preds = %111, %100
%102 = load i32, i32* %8
%103 = load i32, i32* %5
%104 = icmp slt i32 %102, %103
br i1 %104, label %105, label %114
105: ; preds = %101
%106 = load i32*, i32** %11
%107 = call i32 (i32*, i8*, ...) @fprintf(i32* %106, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.22, i64 0, i64 0))
%108 = load i32*, i32** %11
%109 = load i32, i32* %6
%110 = call i32 (i32*, i8*, ...) @fprintf(i32* %108, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.23, i64 0, i64 0), i32 %109)
br label %111
111: ; preds = %105
%112 = load i32, i32* %8
%113 = add nsw i32 %112, 1
store i32 %113, i32* %8
br label %101
114: ; preds = %101
br label %115
115: ; preds = %114
%116 = load i32, i32* %7
%117 = add nsw i32 %116, 1
store i32 %117, i32* %7
br label %96
118: ; preds = %96
%119 = load i32*, i32** %11
%120 = call i32 (i32*, i8*, ...) @fprintf(i32* %119, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.24, i64 0, i64 0))
%121 = load i32*, i32** %11
%122 = call i32 (i32*, i8*, ...) @fprintf(i32* %121, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%123 = load i32*, i32** %11
%124 = call i32 (i32*, i8*, ...) @fprintf(i32* %123, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.25, i64 0, i64 0))
%125 = load i32*, i32** %11
%126 = call i32 (i32*, i8*, ...) @fprintf(i32* %125, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.26, i64 0, i64 0))
%127 = load i32*, i32** %11
%128 = call i32 @fclose(i32* %127)
store i32 %128, 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 = [23 x i8] c"FOO_pt FOO_array[%d];\0A\00"
@.str.13 = [12 x i8] c"\09long i=0;\0A\00"
@.str.14 = [23 x i8] c"\09long j,k,m,n=0,loop;\0A\00"
@.str.15 = [22 x i8] c"\09loop=atol(argv[1]);\0A\00"
@.str.16 = [8 x i8] c"\09m=%d;\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 = mul i32 %1, %0
%17 = mul i32 %16, %2
%18 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), i32 %17)
%19 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0), i64 11, i64 1, i32* %4)
%20 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0), i64 22, i64 1, i32* %4)
%21 = tail call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.15, i64 0, i64 0), i64 21, i64 1, i32* %4)
%22 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), i32 %17)
%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
}