#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 *rand_array) {
  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,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, d=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\td = 0;\n");
      fprintf(fp_main, "\t\tFOO_array[n](n,d);\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    $0xa0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
lea    0xeb1(%rip),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xea4(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xe92(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xe84(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xe86(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xe89(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xe8c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xea0(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xed5(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xe91(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xf6d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xe8f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%edx
imul   -0x8(%rbp),%edx
imul   -0x4(%rbp),%edx
lea    0xe84(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xe89(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xe88(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xe8d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%edx
imul   -0x8(%rbp),%edx
imul   -0x4(%rbp),%edx
lea    0xe86(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xe7c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1342 <create_main+0x212>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    132f <create_main+0x1ff>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    131c <create_main+0x1ec>
mov    -0x30(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x24(%rbp),%r8d
lea    0xe41(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xe56(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12d4 <create_main+0x1a4>
jmp    1321 <create_main+0x1f1>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12c1 <create_main+0x191>
jmp    1334 <create_main+0x204>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    12ae <create_main+0x17e>
mov    -0x30(%rbp),%rdi
lea    0xe18(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xe1d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    13e6 <create_main+0x2b6>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    13d3 <create_main+0x2a3>
mov    -0x30(%rbp),%rdi
lea    0xdec(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xde4(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xde5(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1380 <create_main+0x250>
jmp    13d8 <create_main+0x2a8>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    136d <create_main+0x23d>
mov    -0x30(%rbp),%rdi
lea    0xdbb(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xcba(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xd9b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xd86(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
mov    %eax,-0x28(%rbp)
xor    %eax,%eax
add    $0xa0,%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    $0x25,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xe5e(%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    0xe4d(%rip),%rdi
mov    $0x21,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xf22(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xe3d(%rip),%rdi
mov    $0x11,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
mov    %ebp,0x8(%rsp)
imul   %r15d,%ebp
mov    %r14d,0x10(%rsp)
imul   %r14d,%ebp
lea    0xe25(%rip),%rsi
mov    %r13,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xe29(%rip),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xe21(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xe1f(%rip),%rdi
mov    $0x15,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xe1c(%rip),%rsi
mov    %r13,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xe11(%rip),%rdi
mov    $0x19,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
mov    %r15d,0xc(%rsp)
test   %r15d,%r15d
jle    1491 <create_main+0x341>
lea    0xe04(%rip),%rbp
lea    0xe24(%rip),%rbx
xor    %r15d,%r15d
mov    0x10(%rsp),%eax
jmp    135b <create_main+0x20b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%r15d
cmp    0xc(%rsp),%r15d
je     13ca <create_main+0x27a>
cmpl   $0x0,0x8(%rsp)
jle    1350 <create_main+0x200>
xor    %r14d,%r14d
jmp    137b <create_main+0x22b>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r14d
cmp    0x8(%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    0x10(%rsp),%eax
add    $0x1,%r12d
cmp    %r12d,%eax
jne    1390 <create_main+0x240>
jmp    1370 <create_main+0x220>
lea    0xd94(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xd92(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
cmpl   $0x0,0xc(%rsp)
jle    14c3 <create_main+0x373>
lea    0xd75(%rip),%r15
lea    0xd78(%rip),%r12
lea    0xd87(%rip),%rbx
xor    %eax,%eax
mov    0x10(%rsp),%r14d
jmp    1441 <create_main+0x2f1>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x14(%rsp),%eax
add    $0x1,%eax
cmp    0xc(%rsp),%eax
je     14c3 <create_main+0x373>
mov    %eax,0x14(%rsp)
cmpl   $0x0,0x8(%rsp)
jle    1430 <create_main+0x2e0>
mov    0x8(%rsp),%ebp
mov    $0x9,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %r13,%rcx
call   1070 <fwrite@plt>
mov    $0x15,%esi
mov    $0x1,%edx
mov    %r12,%rdi
mov    %r13,%rcx
call   1070 <fwrite@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
add    $0xffffffff,%ebp
jne    1450 <create_main+0x300>
jmp    1430 <create_main+0x2e0>
lea    0xccd(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xccb(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xce2(%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    0xcc0(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1070 <fwrite@plt>
lea    0xca4(%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 = [38 x i8] c"typedef long (*FOO_pt) (long,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 = [17 x i8] c"\09long i=0, d=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 = [10 x i8] c"\09\09d = 0;\0A\00"
@.str.23 = [22 x i8] c"\09\09FOO_array[n](n,d);\0A\00"
@.str.24 = [9 x i8] c"\09n+=%d;\0A\00"
@.str.25 = [4 x i8] c"\09}\0A\00"
@.str.26 = [12 x i8] c"\09return 0;\0A\00"
@.str.27 = [3 x i8] c"}\0A\00"
define i32 @create_main(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32*
%14 = alloca [100 x i8]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%15 = 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* %15, i32** %13
%16 = load i32*, i32** %13
%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** %13
%19 = call i32 (i32*, i8*, ...) @fprintf(i32* %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%20 = load i32*, i32** %13
%21 = call i32 (i32*, i8*, ...) @fprintf(i32* %20, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%22 = load i32*, i32** %13
%23 = call i32 (i32*, i8*, ...) @fprintf(i32* %22, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
%24 = load i32*, i32** %13
%25 = call i32 (i32*, i8*, ...) @fprintf(i32* %24, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
%26 = load i32*, i32** %13
%27 = call i32 (i32*, i8*, ...) @fprintf(i32* %26, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0))
%28 = load i32*, i32** %13
%29 = call i32 (i32*, i8*, ...) @fprintf(i32* %28, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
%30 = load i32*, i32** %13
%31 = call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%32 = load i32*, i32** %13
%33 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.9, i64 0, i64 0))
%34 = load i32*, i32** %13
%35 = call i32 (i32*, i8*, ...) @fprintf(i32* %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%36 = load i32*, i32** %13
%37 = call i32 (i32*, i8*, ...) @fprintf(i32* %36, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0))
%38 = load i32*, i32** %13
%39 = load i32, i32* %7
%40 = load i32, i32* %6
%41 = mul nsw i32 %39, %40
%42 = load i32, i32* %5
%43 = mul nsw i32 %41, %42
%44 = call i32 (i32*, i8*, ...) @fprintf(i32* %38, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), i32 %43)
%45 = load i32*, i32** %13
%46 = call i32 (i32*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0))
%47 = load i32*, i32** %13
%48 = call i32 (i32*, i8*, ...) @fprintf(i32* %47, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
%49 = load i32*, i32** %13
%50 = call i32 (i32*, i8*, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.15, i64 0, i64 0))
%51 = load i32*, i32** %13
%52 = load i32, i32* %7
%53 = load i32, i32* %6
%54 = mul nsw i32 %52, %53
%55 = load i32, i32* %5
%56 = mul nsw i32 %54, %55
%57 = call i32 (i32*, i8*, ...) @fprintf(i32* %51, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), i32 %56)
%58 = load i32*, i32** %13
%59 = call i32 (i32*, i8*, ...) @fprintf(i32* %58, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.17, i64 0, i64 0))
store i32 0, i32* %9
br label %60
60: ; preds = %90, %4
%61 = load i32, i32* %9
%62 = load i32, i32* %5
%63 = icmp slt i32 %61, %62
br i1 %63, label %64, label %93
64: ; preds = %60
store i32 0, i32* %10
br label %65
65: ; preds = %86, %64
%66 = load i32, i32* %10
%67 = load i32, i32* %6
%68 = icmp slt i32 %66, %67
br i1 %68, label %69, label %89
69: ; preds = %65
store i32 0, i32* %11
br label %70
70: ; preds = %82, %69
%71 = load i32, i32* %11
%72 = load i32, i32* %7
%73 = icmp slt i32 %71, %72
br i1 %73, label %74, label %85
74: ; preds = %70
%75 = load i32*, i32** %13
%76 = load i32, i32* %9
%77 = load i32, i32* %10
%78 = load i32, i32* %11
%79 = call i32 (i32*, i8*, ...) @fprintf(i32* %75, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.18, i64 0, i64 0), i32 %76, i32 %77, i32 %78)
%80 = load i32*, i32** %13
%81 = call i32 (i32*, i8*, ...) @fprintf(i32* %80, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
br label %82
82: ; preds = %74
%83 = load i32, i32* %11
%84 = add nsw i32 %83, 1
store i32 %84, i32* %11
br label %70
85: ; preds = %70
br label %86
86: ; preds = %85
%87 = load i32, i32* %10
%88 = add nsw i32 %87, 1
store i32 %88, i32* %10
br label %65
89: ; preds = %65
br label %90
90: ; preds = %89
%91 = load i32, i32* %9
%92 = add nsw i32 %91, 1
store i32 %92, i32* %9
br label %60
93: ; preds = %60
%94 = load i32*, i32** %13
%95 = call i32 (i32*, i8*, ...) @fprintf(i32* %94, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.20, i64 0, i64 0))
%96 = load i32*, i32** %13
%97 = call i32 (i32*, i8*, ...) @fprintf(i32* %96, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i64 0, i64 0))
store i32 0, i32* %9
br label %98
98: ; preds = %119, %93
%99 = load i32, i32* %9
%100 = load i32, i32* %5
%101 = icmp slt i32 %99, %100
br i1 %101, label %102, label %122
102: ; preds = %98
store i32 0, i32* %10
br label %103
103: ; preds = %115, %102
%104 = load i32, i32* %10
%105 = load i32, i32* %6
%106 = icmp slt i32 %104, %105
br i1 %106, label %107, label %118
107: ; preds = %103
%108 = load i32*, i32** %13
%109 = call i32 (i32*, i8*, ...) @fprintf(i32* %108, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.22, i64 0, i64 0))
%110 = load i32*, i32** %13
%111 = call i32 (i32*, i8*, ...) @fprintf(i32* %110, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.23, i64 0, i64 0))
%112 = load i32*, i32** %13
%113 = load i32, i32* %7
%114 = call i32 (i32*, i8*, ...) @fprintf(i32* %112, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.24, i64 0, i64 0), i32 %113)
br label %115
115: ; preds = %107
%116 = load i32, i32* %10
%117 = add nsw i32 %116, 1
store i32 %117, i32* %10
br label %103
118: ; preds = %103
br label %119
119: ; preds = %118
%120 = load i32, i32* %9
%121 = add nsw i32 %120, 1
store i32 %121, i32* %9
br label %98
122: ; preds = %98
%123 = load i32*, i32** %13
%124 = call i32 (i32*, i8*, ...) @fprintf(i32* %123, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.25, i64 0, i64 0))
%125 = load i32*, i32** %13
%126 = call i32 (i32*, i8*, ...) @fprintf(i32* %125, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%127 = load i32*, i32** %13
%128 = call i32 (i32*, i8*, ...) @fprintf(i32* %127, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.26, i64 0, i64 0))
%129 = load i32*, i32** %13
%130 = call i32 (i32*, i8*, ...) @fprintf(i32* %129, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.27, i64 0, i64 0))
%131 = load i32*, i32** %13
%132 = call i32 @fclose(i32* %131)
store i32 %132, i32* %12
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 = [38 x i8] c"typedef long (*FOO_pt) (long,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 = [17 x i8] c"\09long i=0, d=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 = [10 x i8] c"\09\09d = 0;\0A\00"
@.str.23 = [22 x i8] c"\09\09FOO_array[n](n,d);\0A\00"
@.str.24 = [9 x i8] c"\09n+=%d;\0A\00"
@.str.25 = [4 x i8] c"\09}\0A\00"
@.str.26 = [12 x i8] c"\09return 0;\0A\00"
@.str.27 = [3 x i8] c"}\0A\00"
define i32 @create_main(i32 %0, i32 %1, i32 %2, i32* nocapture readnone %3) {
%5 = 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))
%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* %5)
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 3, i64 1, i32* %5)
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i64 19, i64 1, i32* %5)
%9 = tail call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i64 20, i64 1, i32* %5)
%10 = tail call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i64 20, i64 1, i32* %5)
%11 = tail call i64 @fwrite(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0), i64 37, i64 1, i32* %5)
%12 = tail call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i64 20, i64 1, i32* %5)
%13 = tail call i32 @fputc(i32 10, i32* %5)
%14 = tail call i64 @fwrite(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.9, i64 0, i64 0), i64 33, i64 1, i32* %5)
%15 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i64 2, i64 1, i32* %5)
%16 = tail call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i64 17, i64 1, i32* %5)
%17 = mul i32 %1, %0
%18 = mul i32 %17, %2
%19 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), i32 %18)
%20 = tail call i64 @fwrite(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0), i64 16, i64 1, i32* %5)
%21 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0), i64 22, i64 1, i32* %5)
%22 = tail call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.15, i64 0, i64 0), i64 21, i64 1, i32* %5)
%23 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), i32 %18)
%24 = tail call i64 @fwrite(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.17, i64 0, i64 0), i64 25, i64 1, i32* %5)
%25 = icmp sgt i32 %0, 0
br i1 %25, label %26, label %62
26: ; preds = %4
%27 = icmp sgt i32 %1, 0
%28 = icmp sgt i32 %2, 0
br label %29
29: ; preds = %26, %42
%30 = phi i32 [ 0, %26 ], [ %43, %42 ]
br i1 %27, label %31, label %42
31: ; preds = %29, %39
%32 = phi i32 [ %40, %39 ], [ 0, %29 ]
br i1 %28, label %33, label %39
33: ; preds = %31, %33
%34 = phi i32 [ %37, %33 ], [ 0, %31 ]
%35 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.18, i64 0, i64 0), i32 %30, i32 %32, i32 %34)
%36 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0), i64 7, i64 1, i32* %5)
%37 = add nuw nsw i32 %34, 1
%38 = icmp eq i32 %37, %2
br i1 %38, label %39, label %33
39: ; preds = %33, %31
%40 = add nuw nsw i32 %32, 1
%41 = icmp eq i32 %40, %1
br i1 %41, label %42, label %31
42: ; preds = %39, %29
%43 = add nuw nsw i32 %30, 1
%44 = icmp eq i32 %43, %0
br i1 %44, label %45, label %29
45: ; preds = %42
%46 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.20, i64 0, i64 0), i64 22, i64 1, i32* %5)
%47 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i64 0, i64 0), i64 6, i64 1, i32* %5)
br i1 %25, label %48, label %65
48: ; preds = %45
%49 = icmp sgt i32 %1, 0
br label %50
50: ; preds = %48, %59
%51 = phi i32 [ 0, %48 ], [ %60, %59 ]
br i1 %49, label %52, label %59
52: ; preds = %50, %52
%53 = phi i32 [ %57, %52 ], [ 0, %50 ]
%54 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.22, i64 0, i64 0), i64 9, i64 1, i32* %5)
%55 = tail call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.23, i64 0, i64 0), i64 21, i64 1, i32* %5)
%56 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.24, i64 0, i64 0), i32 %2)
%57 = add nuw nsw i32 %53, 1
%58 = icmp eq i32 %57, %1
br i1 %58, label %59, label %52
59: ; preds = %52, %50
%60 = add nuw nsw i32 %51, 1
%61 = icmp eq i32 %60, %0
br i1 %61, label %65, label %50
62: ; preds = %4
%63 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.20, i64 0, i64 0), i64 22, i64 1, i32* %5)
%64 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i64 0, i64 0), i64 6, i64 1, i32* %5)
br label %65
65: ; preds = %59, %62, %45
%66 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.25, i64 0, i64 0), i64 3, i64 1, i32* %5)
%67 = tail call i32 @fputc(i32 10, i32* %5)
%68 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.26, i64 0, i64 0), i64 11, i64 1, i32* %5)
%69 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.27, i64 0, i64 0), i64 2, i64 1, i32* %5)
%70 = tail call i32 @fclose(i32* %5)
ret i32 0
}