#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 */
typedef struct TYPE_6__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ szName;
typedef int /*<<< orphan*/ szInfo;
struct TYPE_6__ {
  int /*<<< orphan*/ _offset;
  int /*<<< orphan*/ _fileno;
};
typedef TYPE_1__ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(TYPE_1__ *);
int /*<<< orphan*/ fflush(TYPE_1__ *);
TYPE_1__ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(TYPE_1__ *, char *, char *);
int /*<<< orphan*/ get_file_size(char *);
int /*<<< orphan*/ getchar();
int getpid();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ remove(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, ...);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  printf("my pid = [%d]\n", getpid());
  printf("you can run [ls -l /proc/%d/fd] to see \n"
         "which file is opend by this process\n",
         getpid());
  printf("Entering [Enter] to continue ...\n");
  getchar();
  int iNum = 10;
  FILE *fpList[16] = {0};
  int i = 0;
  for (i = 0; i < iNum; i++) {
    char szName[16] = {0};
    snprintf(szName, sizeof(szName) - 1, "%d.tmp", i);
    fpList[i] = fopen(szName, "w");
    if (NULL == fpList[i]) {
      printf("fopen file [%s] faild\n", szName);
      continue;
    }
    char szInfo[32] = {0};
    snprintf(szInfo, sizeof(szInfo) - 1, "This is file : [%s]\n", szName);
    if (i < 5) {
      write(fpList[i]->_fileno, szInfo, strlen(szInfo));
    } else {
      fprintf(fpList[i], "%s", szInfo);
      if (i > 7) {
        fflush(fpList[i]);
      }
    }
    printf("fpList[%d] : sizeof(_IO_off64_t) = [%lu], file size  [%ld]\n", i,
           sizeof(fpList[i]->_offset), fpList[i]->_offset);
    printf("file size : [%lu]\n", get_file_size(szName));
  }
  printf("you can run [ls -l /proc/%d/fd] to see \n"
         "which file is opend by this process\n",
         getpid());
  printf("Entering [Enter] to close files ...\n");
  getchar();
  for (i = 0; i < iNum; i++) {
    fclose(fpList[i]);
    char szName[16] = {0};
    snprintf(szName, sizeof(szName) - 1, "%d.tmp", i);
    remove(szName);
  }
  printf("Entering [Enter] to exit ...\n");
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <getpid@plt>
mov    %eax,%esi
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x0,%al
call   1050 <getpid@plt>
mov    %eax,%esi
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x0,%al
call   10b0 <getchar@plt>
movl   $0xa,-0x14(%rbp)
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   10a0 <memset@plt>
movl   $0x0,-0xa4(%rbp)
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1420 <main+0x250>
lea    -0xc0(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   10a0 <memset@plt>
lea    -0xc0(%rbp),%rdi
mov    -0xa4(%rbp),%ecx
mov    $0xf,%esi
lea    0xde9(%rip),%rdx
mov    $0x0,%al
call   1090 <snprintf@plt>
lea    -0xc0(%rbp),%rdi
lea    0xddb(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,%rcx
movslq -0xa4(%rbp),%rax
mov    %rcx,-0xa0(%rbp,%rax,8)
ff
movslq -0xa4(%rbp),%rcx
xor    %eax,%eax
cmp    -0xa0(%rbp,%rcx,8),%rax
ff
jne    12f2 <main+0x122>
lea    -0xc0(%rbp),%rsi
lea    0xda1(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    140c <main+0x23c>
lea    -0xe0(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   10a0 <memset@plt>
lea    -0xe0(%rbp),%rdi
lea    -0xc0(%rbp),%rcx
mov    $0x1f,%esi
lea    0xd7f(%rip),%rdx
mov    $0x0,%al
call   1090 <snprintf@plt>
cmpl   $0x5,-0xa4(%rbp)
jge    137e <main+0x1ae>
movslq -0xa4(%rbp),%rax
mov    -0xa0(%rbp,%rax,8),%rax
ff
mov    0x4(%rax),%eax
mov    %eax,-0xfc(%rbp)
lea    -0xe0(%rbp),%rax
mov    %rax,-0xf8(%rbp)
lea    -0xe0(%rbp),%rdi
call   1070 <strlen@plt>
mov    -0xfc(%rbp),%edi
mov    -0xf8(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
jmp    13c6 <main+0x1f6>
movslq -0xa4(%rbp),%rax
mov    -0xa0(%rbp,%rax,8),%rdi
ff
lea    -0xe0(%rbp),%rdx
lea    0xd18(%rip),%rsi
call   10c0 <fprintf@plt>
cmpl   $0x7,-0xa4(%rbp)
jle    13c1 <main+0x1f1>
movslq -0xa4(%rbp),%rax
mov    -0xa0(%rbp,%rax,8),%rdi
ff
call   10d0 <fflush@plt>
jmp    13c6 <main+0x1f6>
mov    -0xa4(%rbp),%esi
movslq -0xa4(%rbp),%rax
mov    -0xa0(%rbp,%rax,8),%rax
ff
mov    (%rax),%ecx
lea    0xcd2(%rip),%rdi
mov    $0x4,%edx
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0xc0(%rbp),%rdi
call   10e0 <get_file_size@plt>
mov    %eax,%esi
lea    0xced(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    125a <main+0x8a>
mov    $0x0,%al
call   1050 <getpid@plt>
mov    %eax,%esi
lea    0xbdf(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xcc7(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x0,%al
call   10b0 <getchar@plt>
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    14cc <main+0x2fc>
movslq -0xa4(%rbp),%rax
mov    -0xa0(%rbp,%rax,8),%rdi
ff
call   1060 <fclose@plt>
lea    -0xf0(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   10a0 <memset@plt>
lea    -0xf0(%rbp),%rdi
mov    -0xa4(%rbp),%ecx
mov    $0xf,%esi
lea    0xbd9(%rip),%rdx
mov    $0x0,%al
call   1090 <snprintf@plt>
lea    -0xf0(%rbp),%rdi
call   1030 <remove@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1456 <main+0x286>
lea    0xc57(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x0,%al
call   10b0 <getchar@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
xor    %eax,%eax
call   1060 <getpid@plt>
lea    0xe21(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1090 <printf@plt>
xor    %eax,%eax
call   1060 <getpid@plt>
lea    0xe19(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0xeda(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   10c0 <getchar@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
lea    0xe0f(%rip),%rbp
lea    0x20(%rsp),%rbx
mov    %rsp,%r14
xor    %r12d,%r12d
jmp    1292 <main+0xc2>
nopw   0x0(%rax,%rax,1)
lea    0xdfe(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
xorps  %xmm0,%xmm0
add    $0x1,%r12
cmp    $0xa,%r12
je     1370 <main+0x1a0>
movaps %xmm0,0x20(%rsp)
mov    %rbx,%rdi
mov    $0xf,%esi
mov    %rbp,%rdx
mov    %r12d,%ecx
xor    %eax,%eax
call   10a0 <snprintf@plt>
mov    %rbx,%rdi
lea    0xdbd(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,0x30(%rsp,%r12,8)
test   %rax,%rax
je     1270 <main+0xa0>
mov    %rax,%r13
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %r14,%r15
mov    %r14,%rdi
mov    $0x1f,%esi
lea    0xda6(%rip),%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   10a0 <snprintf@plt>
cmp    $0x4,%r12
ja     1320 <main+0x150>
mov    0x4(%r13),%ebx
mov    %r15,%rdi
call   1080 <strlen@plt>
mov    %ebx,%edi
lea    0x20(%rsp),%rbx
mov    %r15,%rsi
mov    %eax,%edx
call   1050 <write@plt>
jmp    1339 <main+0x169>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rdi
mov    %r13,%rsi
call   10b0 <fputs@plt>
cmp    $0x8,%r12
jb     1339 <main+0x169>
mov    %r13,%rdi
call   10d0 <fflush@plt>
mov    0x0(%r13),%ecx
mov    $0x4,%edx
lea    0xd58(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %rbx,%rdi
call   10e0 <get_file_size@plt>
lea    0xd7b(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1090 <printf@plt>
jmp    1281 <main+0xb1>
xor    %eax,%eax
call   1060 <getpid@plt>
lea    0xca1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0xd83(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   10c0 <getchar@plt>
mov    0x30(%rsp),%rdi
call   1070 <fclose@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
lea    0xcba(%rip),%r14
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xf,%esi
mov    %r14,%rdx
xor    %ecx,%ecx
xor    %eax,%eax
call   10a0 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <remove@plt>
mov    0x38(%rsp),%rdi
call   1070 <fclose@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rbx,%rdi
mov    $0xf,%esi
mov    %r14,%rdx
mov    $0x1,%ecx
xor    %eax,%eax
call   10a0 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <remove@plt>
mov    0x40(%rsp),%rdi
call   1070 <fclose@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rbx,%rdi
mov    $0xf,%esi
mov    %r14,%rdx
mov    $0x2,%ecx
xor    %eax,%eax
call   10a0 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <remove@plt>
mov    0x48(%rsp),%rdi
call   1070 <fclose@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rbx,%rdi
mov    $0xf,%esi
mov    %r14,%rdx
mov    $0x3,%ecx
xor    %eax,%eax
call   10a0 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <remove@plt>
mov    0x50(%rsp),%rdi
call   1070 <fclose@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rbx,%rdi
mov    $0xf,%esi
mov    %r14,%rdx
mov    $0x4,%ecx
xor    %eax,%eax
call   10a0 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <remove@plt>
mov    0x58(%rsp),%rdi
call   1070 <fclose@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rbx,%rdi
mov    $0xf,%esi
mov    %r14,%rdx
mov    $0x5,%ecx
xor    %eax,%eax
call   10a0 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <remove@plt>
mov    0x60(%rsp),%rdi
call   1070 <fclose@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rbx,%rdi
mov    $0xf,%esi
mov    %r14,%rdx
mov    $0x6,%ecx
xor    %eax,%eax
call   10a0 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <remove@plt>
mov    0x68(%rsp),%rdi
call   1070 <fclose@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rbx,%rdi
mov    $0xf,%esi
mov    %r14,%rdx
mov    $0x7,%ecx
xor    %eax,%eax
call   10a0 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <remove@plt>
mov    0x70(%rsp),%rdi
call   1070 <fclose@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rbx,%rdi
mov    $0xf,%esi
mov    %r14,%rdx
mov    $0x8,%ecx
xor    %eax,%eax
call   10a0 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <remove@plt>
mov    0x78(%rsp),%rdi
call   1070 <fclose@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rbx,%rdi
mov    $0xf,%esi
mov    %r14,%rdx
mov    $0x9,%ecx
xor    %eax,%eax
call   10a0 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <remove@plt>
lea    0xbad(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   10c0 <getchar@plt>
xor    %eax,%eax
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_6__ = type { i32, i32 }
@.str = [15 x i8] c"my pid = [%d]\0A\00"
@.str.1 = [77 x i8] c"you can run [ls -l /proc/%d/fd] to see \0Awhich file is opend by this process\0A\00"
@.str.2 = [34 x i8] c"Entering [Enter] to continue ...\0A\00"
@.str.3 = [7 x i8] c"%d.tmp\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [23 x i8] c"fopen file [%s] faild\0A\00"
@.str.6 = [21 x i8] c"This is file : [%s]\0A\00"
@.str.7 = [3 x i8] c"%s\00"
@.str.8 = [60 x i8] c"fpList[%d] : sizeof(_IO_off64_t) = [%lu], file size [%ld]\0A\00"
@.str.9 = [19 x i8] c"file size : [%lu]\0A\00"
@.str.10 = [37 x i8] c"Entering [Enter] to close files ...\0A\00"
@.str.11 = [30 x i8] c"Entering [Enter] to exit ...\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [16 x %struct.TYPE_6__*]
%8 = alloca i32
%9 = alloca [16 x i8]
%10 = alloca [32 x i8]
%11 = alloca [16 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = call i32 (...) @getpid()
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = call i32 (...) @getpid()
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 (...) @getchar()
store i32 10, i32* %6
%18 = bitcast [16 x %struct.TYPE_6__*]* %7 to i8*
store i32 0, i32* %8
store i32 0, i32* %8
br label %19
19: ; preds = %87, %2
%20 = load i32, i32* %8
%21 = load i32, i32* %6
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %90
23: ; preds = %19
%24 = bitcast [16 x i8]* %9 to i8*
%25 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%26 = load i32, i32* %8
%27 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %25, i32 15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%29 = call %struct.TYPE_6__* @fopen(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%30 = load i32, i32* %8
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [16 x %struct.TYPE_6__*], [16 x %struct.TYPE_6__*]* %7, i64 0, i64 %31
store %struct.TYPE_6__* %29, %struct.TYPE_6__** %32
%33 = load i32, i32* %8
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [16 x %struct.TYPE_6__*], [16 x %struct.TYPE_6__*]* %7, i64 0, i64 %34
%36 = load %struct.TYPE_6__*, %struct.TYPE_6__** %35
%37 = icmp eq %struct.TYPE_6__* null, %36
br i1 %37, label %38, label %41
38: ; preds = %23
%39 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* %39)
br label %87
41: ; preds = %23
%42 = bitcast [32 x i8]* %10 to i8*
%43 = getelementptr inbounds [32 x i8], [32 x i8]* %10, i64 0, i64 0
%44 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%45 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %43, i32 31, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8* %44)
%46 = load i32, i32* %8
%47 = icmp slt i32 %46, 5
br i1 %47, label %48, label %59
48: ; preds = %41
%49 = load i32, i32* %8
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [16 x %struct.TYPE_6__*], [16 x %struct.TYPE_6__*]* %7, i64 0, i64 %50
%52 = load %struct.TYPE_6__*, %struct.TYPE_6__** %51
%53 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %52, i32 0, i32 1
%54 = load i32, i32* %53
%55 = getelementptr inbounds [32 x i8], [32 x i8]* %10, i64 0, i64 0
%56 = getelementptr inbounds [32 x i8], [32 x i8]* %10, i64 0, i64 0
%57 = call i32 @strlen(i8* %56)
%58 = call i32 @write(i32 %54, i8* %55, i32 %57)
br label %75
59: ; preds = %41
%60 = load i32, i32* %8
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [16 x %struct.TYPE_6__*], [16 x %struct.TYPE_6__*]* %7, i64 0, i64 %61
%63 = load %struct.TYPE_6__*, %struct.TYPE_6__** %62
%64 = getelementptr inbounds [32 x i8], [32 x i8]* %10, i64 0, i64 0
%65 = call i32 @fprintf(%struct.TYPE_6__* %63, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %64)
%66 = load i32, i32* %8
%67 = icmp sgt i32 %66, 7
br i1 %67, label %68, label %74
68: ; preds = %59
%69 = load i32, i32* %8
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [16 x %struct.TYPE_6__*], [16 x %struct.TYPE_6__*]* %7, i64 0, i64 %70
%72 = load %struct.TYPE_6__*, %struct.TYPE_6__** %71
%73 = call i32 @fflush(%struct.TYPE_6__* %72)
br label %74
74: ; preds = %68, %59
br label %75
75: ; preds = %74, %48
%76 = load i32, i32* %8
%77 = load i32, i32* %8
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [16 x %struct.TYPE_6__*], [16 x %struct.TYPE_6__*]* %7, i64 0, i64 %78
%80 = load %struct.TYPE_6__*, %struct.TYPE_6__** %79
%81 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %80, i32 0, i32 0
%82 = load i32, i32* %81
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.8, i64 0, i64 0), i32 %76, i64 4, i32 %82)
%84 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%85 = call i32 @get_file_size(i8* %84)
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32 %85)
br label %87
87: ; preds = %75, %38
%88 = load i32, i32* %8
%89 = add nsw i32 %88, 1
store i32 %89, i32* %8
br label %19
90: ; preds = %19
%91 = call i32 (...) @getpid()
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.1, i64 0, i64 0), i32 %91)
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0))
%94 = call i32 (...) @getchar()
store i32 0, i32* %8
br label %95
95: ; preds = %111, %90
%96 = load i32, i32* %8
%97 = load i32, i32* %6
%98 = icmp slt i32 %96, %97
br i1 %98, label %99, label %114
99: ; preds = %95
%100 = load i32, i32* %8
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [16 x %struct.TYPE_6__*], [16 x %struct.TYPE_6__*]* %7, i64 0, i64 %101
%103 = load %struct.TYPE_6__*, %struct.TYPE_6__** %102
%104 = call i32 @fclose(%struct.TYPE_6__* %103)
%105 = bitcast [16 x i8]* %11 to i8*
%106 = getelementptr inbounds [16 x i8], [16 x i8]* %11, i64 0, i64 0
%107 = load i32, i32* %8
%108 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %106, i32 15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %107)
%109 = getelementptr inbounds [16 x i8], [16 x i8]* %11, i64 0, i64 0
%110 = call i32 @remove(i8* %109)
br label %111
111: ; preds = %99
%112 = load i32, i32* %8
%113 = add nsw i32 %112, 1
store i32 %113, i32* %8
br label %95
114: ; preds = %95
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0))
%116 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
%struct.TYPE_6__ = type { i32, i32 }
@.str = [15 x i8] c"my pid = [%d]\0A\00"
@.str.1 = [77 x i8] c"you can run [ls -l /proc/%d/fd] to see \0Awhich file is opend by this process\0A\00"
@.str.3 = [7 x i8] c"%d.tmp\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [23 x i8] c"fopen file [%s] faild\0A\00"
@.str.6 = [21 x i8] c"This is file : [%s]\0A\00"
@.str.8 = [60 x i8] c"fpList[%d] : sizeof(_IO_off64_t) = [%lu], file size [%ld]\0A\00"
@.str.9 = [19 x i8] c"file size : [%lu]\0A\00"
@str = [33 x i8] c"Entering [Enter] to continue ...\00"
@str.12 = [36 x i8] c"Entering [Enter] to close files ...\00"
@str.13 = [29 x i8] c"Entering [Enter] to exit ...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [16 x %struct.TYPE_6__*]
%4 = alloca [16 x i8]
%5 = alloca [32 x i8]
%6 = alloca [16 x i8]
%7 = tail call i32 (...) @getpid()
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 (...) @getpid()
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 (...) @getchar()
%13 = bitcast [16 x %struct.TYPE_6__*]* %3 to i8*
%14 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%15 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
br label %16
16: ; preds = %2, %44
%17 = phi i64 [ 0, %2 ], [ %45, %44 ]
%18 = trunc i64 %17 to i32
%19 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %14, i32 15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %18)
%20 = call %struct.TYPE_6__* @fopen(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%21 = getelementptr inbounds [16 x %struct.TYPE_6__*], [16 x %struct.TYPE_6__*]* %3, i64 0, i64 %17
store %struct.TYPE_6__* %20, %struct.TYPE_6__** %21
%22 = icmp eq %struct.TYPE_6__* %20, null
br i1 %22, label %23, label %25
23: ; preds = %16
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* %14)
br label %44
25: ; preds = %16
%26 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %15, i32 31, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8* %14)
%27 = icmp ult i64 %17, 5
br i1 %27, label %28, label %33
28: ; preds = %25
%29 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %20, i64 0, i32 1
%30 = load i32, i32* %29
%31 = call i32 @strlen(i8* %15)
%32 = call i32 @write(i32 %30, i8* %15, i32 %31)
br label %38
33: ; preds = %25
%34 = call i32 @fputs(i8* %15, %struct.TYPE_6__* %20)
%35 = icmp ugt i64 %17, 7
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = call i32 @fflush(%struct.TYPE_6__* %20)
br label %38
38: ; preds = %33, %36, %28
%39 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %20, i64 0, i32 0
%40 = load i32, i32* %39
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.8, i64 0, i64 0), i32 %18, i64 4, i32 %40)
%42 = call i32 @get_file_size(i8* %14)
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32 %42)
br label %44
44: ; preds = %38, %23
%45 = add nuw nsw i64 %17, 1
%46 = icmp eq i64 %45, 10
br i1 %46, label %47, label %16
47: ; preds = %44
%48 = call i32 (...) @getpid()
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str.1, i64 0, i64 0), i32 %48)
%50 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.12, i64 0, i64 0))
%51 = call i32 (...) @getchar()
%52 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%53 = getelementptr inbounds [16 x %struct.TYPE_6__*], [16 x %struct.TYPE_6__*]* %3, i64 0, i64 0
%54 = load %struct.TYPE_6__*, %struct.TYPE_6__** %53
%55 = call i32 @fclose(%struct.TYPE_6__* %54)
%56 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %52, i32 15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 0)
%57 = call i32 @remove(i8* %52)
%58 = getelementptr inbounds [16 x %struct.TYPE_6__*], [16 x %struct.TYPE_6__*]* %3, i64 0, i64 1
%59 = load %struct.TYPE_6__*, %struct.TYPE_6__** %58
%60 = call i32 @fclose(%struct.TYPE_6__* %59)
%61 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %52, i32 15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 1)
%62 = call i32 @remove(i8* %52)
%63 = getelementptr inbounds [16 x %struct.TYPE_6__*], [16 x %struct.TYPE_6__*]* %3, i64 0, i64 2
%64 = load %struct.TYPE_6__*, %struct.TYPE_6__** %63
%65 = call i32 @fclose(%struct.TYPE_6__* %64)
%66 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %52, i32 15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 2)
%67 = call i32 @remove(i8* %52)
%68 = getelementptr inbounds [16 x %struct.TYPE_6__*], [16 x %struct.TYPE_6__*]* %3, i64 0, i64 3
%69 = load %struct.TYPE_6__*, %struct.TYPE_6__** %68
%70 = call i32 @fclose(%struct.TYPE_6__* %69)
%71 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %52, i32 15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 3)
%72 = call i32 @remove(i8* %52)
%73 = getelementptr inbounds [16 x %struct.TYPE_6__*], [16 x %struct.TYPE_6__*]* %3, i64 0, i64 4
%74 = load %struct.TYPE_6__*, %struct.TYPE_6__** %73
%75 = call i32 @fclose(%struct.TYPE_6__* %74)
%76 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %52, i32 15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 4)
%77 = call i32 @remove(i8* %52)
%78 = getelementptr inbounds [16 x %struct.TYPE_6__*], [16 x %struct.TYPE_6__*]* %3, i64 0, i64 5
%79 = load %struct.TYPE_6__*, %struct.TYPE_6__** %78
%80 = call i32 @fclose(%struct.TYPE_6__* %79)
%81 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %52, i32 15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 5)
%82 = call i32 @remove(i8* %52)
%83 = getelementptr inbounds [16 x %struct.TYPE_6__*], [16 x %struct.TYPE_6__*]* %3, i64 0, i64 6
%84 = load %struct.TYPE_6__*, %struct.TYPE_6__** %83
%85 = call i32 @fclose(%struct.TYPE_6__* %84)
%86 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %52, i32 15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 6)
%87 = call i32 @remove(i8* %52)
%88 = getelementptr inbounds [16 x %struct.TYPE_6__*], [16 x %struct.TYPE_6__*]* %3, i64 0, i64 7
%89 = load %struct.TYPE_6__*, %struct.TYPE_6__** %88
%90 = call i32 @fclose(%struct.TYPE_6__* %89)
%91 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %52, i32 15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 7)
%92 = call i32 @remove(i8* %52)
%93 = getelementptr inbounds [16 x %struct.TYPE_6__*], [16 x %struct.TYPE_6__*]* %3, i64 0, i64 8
%94 = load %struct.TYPE_6__*, %struct.TYPE_6__** %93
%95 = call i32 @fclose(%struct.TYPE_6__* %94)
%96 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %52, i32 15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 8)
%97 = call i32 @remove(i8* %52)
%98 = getelementptr inbounds [16 x %struct.TYPE_6__*], [16 x %struct.TYPE_6__*]* %3, i64 0, i64 9
%99 = load %struct.TYPE_6__*, %struct.TYPE_6__** %98
%100 = call i32 @fclose(%struct.TYPE_6__* %99)
%101 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %52, i32 15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 9)
%102 = call i32 @remove(i8* %52)
%103 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.13, i64 0, i64 0))
%104 = call i32 (...) @getchar()
ret i32 0
}