#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 /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int __attribute__((unused)) argc, char **argv) {
  int cnt = 0;
  int total_item = 0, total_data = 0;
  FILE *conf = NULL;
  FILE *init1 = NULL;
  FILE *init2 = NULL;
  FILE *init3 = NULL;
  char buffer[128];
  char filename[256];
  strcpy(filename, argv[1]);
  strcat(filename, ".hb");
  init1 = fopen(filename, "w");
  if (init1 == NULL) {
    fprintf(stderr, "open init hb file fail!\n");
    return -1;
  } else
    fprintf(stderr, "open file :%s\n", filename);
  strcpy(filename, argv[1]);
  strcat(filename, ".lb");
  init2 = fopen(filename, "w");
  if (init2 == NULL) {
    fprintf(stderr, "open init lb file fail!\n");
    return -1;
  } else
    fprintf(stderr, "open file :%s\n", filename);
  strcpy(filename, argv[1]);
  strcat(filename, ".data");
  init3 = fopen(filename, "w");
  if (init3 == NULL) {
    fprintf(stderr, "open init data file fail!\n");
    return -1;
  } else
    fprintf(stderr, "open file :%s\n", filename);
  strcpy(filename, argv[1]);
  strcat(filename, ".set");
  conf = fopen(filename, "r");
  if (conf == NULL) {
    fprintf(stderr, "open source file fail!\n");
    return -1;
  } else
    fprintf(stderr, "open file :%s\n", filename);
  while (fgets(buffer, 70, conf)) {
    printf("%s\n", buffer);
    cnt++;
    total_data++;
    total_item++;
    fprintf(init1, "0x%c%c, ", buffer[0], buffer[1]);
    fprintf(init2, "0x%c%c, ", buffer[2], buffer[3]);
    fprintf(init3, "0x%c%c, ", buffer[5], buffer[6]);
    if (cnt == 10) {
      fprintf(init1, "\n");
      fprintf(init2, "\n");
      fprintf(init3, "\n");
      cnt = 0;
    }
  }
  printf("Total_ITEM = %d\n", total_item);
  printf("Total_DATA = %d\n", total_data);
  fclose(conf);
  fclose(init1);
  fclose(init2);
  fclose(init3);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
lea    -0x1c0(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x1c0(%rbp),%rdi
lea    0xe20(%rip),%rsi
call   1090 <strcat@plt>
lea    -0x1c0(%rbp),%rdi
lea    0xe11(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    122b <main+0xbb>
mov    0x2dd2(%rip),%rax
mov    (%rax),%rdi
lea    0xdee(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    153b <main+0x3cb>
mov    0x2dae(%rip),%rax
mov    (%rax),%rdi
lea    -0x1c0(%rbp),%rdx
lea    0xddc(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
lea    -0x1c0(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x1c0(%rbp),%rdi
lea    0xdc2(%rip),%rsi
call   1090 <strcat@plt>
lea    -0x1c0(%rbp),%rdi
lea    0xd85(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    12b7 <main+0x147>
mov    0x2d46(%rip),%rax
mov    (%rax),%rdi
lea    0xd8e(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    153b <main+0x3cb>
mov    0x2d22(%rip),%rax
mov    (%rax),%rdi
lea    -0x1c0(%rbp),%rdx
lea    0xd50(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
lea    -0x1c0(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x1c0(%rbp),%rdi
lea    0xd53(%rip),%rsi
call   1090 <strcat@plt>
lea    -0x1c0(%rbp),%rdi
lea    0xcf9(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1343 <main+0x1d3>
mov    0x2cba(%rip),%rax
mov    (%rax),%rdi
lea    0xd21(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    153b <main+0x3cb>
mov    0x2c96(%rip),%rax
mov    (%rax),%rdi
lea    -0x1c0(%rbp),%rdx
lea    0xcc4(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
lea    -0x1c0(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x1c0(%rbp),%rdi
lea    0xce8(%rip),%rsi
call   1090 <strcat@plt>
lea    -0x1c0(%rbp),%rdi
lea    0xcda(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    13cf <main+0x25f>
mov    0x2c2e(%rip),%rax
mov    (%rax),%rdi
lea    0xcb7(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    153b <main+0x3cb>
mov    0x2c0a(%rip),%rax
mov    (%rax),%rdi
lea    -0x1c0(%rbp),%rdx
lea    0xc38(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    13f3 <main+0x283>
lea    -0xc0(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    $0x46,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     14ee <main+0x37e>
lea    -0xc0(%rbp),%rsi
lea    0xc0a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x30(%rbp),%rdi
movsbl -0xc0(%rbp),%edx
movsbl -0xbf(%rbp),%ecx
lea    0xc30(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x38(%rbp),%rdi
movsbl -0xbe(%rbp),%edx
movsbl -0xbd(%rbp),%ecx
lea    0xc10(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x40(%rbp),%rdi
movsbl -0xbb(%rbp),%edx
movsbl -0xba(%rbp),%ecx
lea    0xbf0(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
cmpl   $0xa,-0x14(%rbp)
jne    14e9 <main+0x379>
mov    -0x30(%rbp),%rdi
lea    0xbb3(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xba1(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x40(%rbp),%rdi
lea    0xb8f(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x14(%rbp)
jmp    13f3 <main+0x283>
mov    -0x18(%rbp),%esi
lea    0xb9c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xb9c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x30(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x38(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x40(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x198,%rsp
mov    %rsi,%rbx
mov    0x8(%rsi),%rsi
lea    0x90(%rsp),%rbp
mov    %rbp,%rdi
call   1030 <strcpy@plt>
lea    0xe31(%rip),%rsi
mov    %rbp,%rdi
call   10b0 <strcat@plt>
lea    0xe26(%rip),%rsi
mov    %rbp,%rdi
call   10a0 <fopen@plt>
mov    0x2df3(%rip),%r15
mov    (%r15),%rcx
mov    %rax,0x8(%rsp)
test   %rax,%rax
je     13f8 <main+0x258>
lea    0xe1a(%rip),%rsi
lea    0x90(%rsp),%rbp
mov    %rcx,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x8(%rbx),%rsi
mov    %rbp,%rdi
call   1030 <strcpy@plt>
lea    0xe01(%rip),%rsi
mov    %rbp,%rdi
call   10b0 <strcat@plt>
lea    0xdc8(%rip),%rsi
mov    %rbp,%rdi
call   10a0 <fopen@plt>
mov    (%r15),%rcx
mov    %rax,(%rsp)
test   %rax,%rax
je     1401 <main+0x261>
lea    0xdc4(%rip),%rsi
lea    0x90(%rsp),%rbp
mov    %rcx,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x8(%rbx),%rsi
mov    %rbp,%rdi
call   1030 <strcpy@plt>
lea    0xdc8(%rip),%rsi
mov    %rbp,%rdi
call   10b0 <strcat@plt>
lea    0xd72(%rip),%rsi
mov    %rbp,%rdi
call   10a0 <fopen@plt>
mov    (%r15),%rcx
test   %rax,%rax
je     1478 <main+0x2d8>
mov    %rax,%r13
lea    0xd6f(%rip),%rsi
xor    %ebp,%ebp
lea    0x90(%rsp),%r14
mov    %rcx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x8(%rbx),%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
lea    0xd92(%rip),%rsi
mov    %r14,%rdi
call   10b0 <strcat@plt>
lea    0xd88(%rip),%rsi
mov    %r14,%rdi
call   10a0 <fopen@plt>
mov    (%r15),%rcx
test   %rax,%rax
je     1486 <main+0x2e6>
mov    %rax,%r12
lea    0xd18(%rip),%rsi
lea    0x90(%rsp),%rdx
mov    %rcx,%rdi
xor    %eax,%eax
call   1090 <fprintf@plt>
lea    0x10(%rsp),%rdi
mov    $0x46,%esi
mov    %r12,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     142e <main+0x28e>
lea    0x10(%rsp),%rbx
lea    0xd4b(%rip),%r14
xor    %ebp,%ebp
xor    %r15d,%r15d
jmp    136c <main+0x1cc>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x46,%esi
mov    %r12,%rdx
call   1080 <fgets@plt>
add    $0x1,%ebp
test   %rax,%rax
je     142e <main+0x28e>
mov    %rbx,%rdi
call   1040 <puts@plt>
add    $0x1,%r15d
movsbl 0x10(%rsp),%edx
movsbl 0x11(%rsp),%ecx
mov    0x8(%rsp),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
movsbl 0x12(%rsp),%edx
movsbl 0x13(%rsp),%ecx
mov    (%rsp),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
movsbl 0x15(%rsp),%edx
movsbl 0x16(%rsp),%ecx
mov    %r13,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
cmp    $0xa,%r15d
jne    1350 <main+0x1b0>
mov    $0xa,%edi
mov    0x8(%rsp),%rsi
call   1070 <fputc@plt>
mov    $0xa,%edi
mov    (%rsp),%rsi
call   1070 <fputc@plt>
mov    $0xa,%edi
mov    %r13,%rsi
call   1070 <fputc@plt>
xor    %r15d,%r15d
jmp    1350 <main+0x1b0>
lea    0xc07(%rip),%rdi
jmp    1408 <main+0x268>
lea    0xc2a(%rip),%rdi
mov    $0x18,%esi
mov    $0x1,%edx
call   10c0 <fwrite@plt>
mov    $0xffffffff,%eax
add    $0x198,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc5f(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xc60(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r12,%rdi
call   1050 <fclose@plt>
mov    0x8(%rsp),%rdi
call   1050 <fclose@plt>
mov    (%rsp),%rdi
call   1050 <fclose@plt>
mov    %r13,%rdi
call   1050 <fclose@plt>
mov    $0x1,%eax
jmp    141c <main+0x27c>
lea    0xbd2(%rip),%rdi
mov    $0x1a,%esi
jmp    140d <main+0x26d>
lea    0xbe6(%rip),%rdi
mov    $0x17,%esi
jmp    140d <main+0x26d>

LLVM IR (-O0):
@.str = [4 x i8] c".hb\00"
@.str.1 = [2 x i8] c"w\00"
@stderr = global i32* null
@.str.2 = [25 x i8] c"open init hb file fail!\0A\00"
@.str.3 = [15 x i8] c"open file :%s\0A\00"
@.str.4 = [4 x i8] c".lb\00"
@.str.5 = [25 x i8] c"open init lb file fail!\0A\00"
@.str.6 = [6 x i8] c".data\00"
@.str.7 = [27 x i8] c"open init data file fail!\0A\00"
@.str.8 = [5 x i8] c".set\00"
@.str.9 = [2 x i8] c"r\00"
@.str.10 = [24 x i8] c"open source file fail!\0A\00"
@.str.11 = [4 x i8] c"%s\0A\00"
@.str.12 = [9 x i8] c"0x%c%c, \00"
@.str.13 = [2 x i8] c"\0A\00"
@.str.14 = [17 x i8] c"Total_ITEM = %d\0A\00"
@.str.15 = [17 x i8] c"Total_DATA = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca [128 x i8]
%14 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32* null, i32** %9
store i32* null, i32** %10
store i32* null, i32** %11
store i32* null, i32** %12
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @strcpy(i8* %15, i8* %18)
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%21 = call i32 @strcat(i8* %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%22 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%23 = call i32* @fopen(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %23, i32** %10
%24 = load i32*, i32** %10
%25 = icmp eq i32* %24, null
br i1 %25, label %26, label %29
26: ; preds = %2
%27 = load i32*, i32** @stderr
%28 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %3
br label %152
29: ; preds = %2
%30 = load i32*, i32** @stderr
%31 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%32 = call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %31)
br label %33
33: ; preds = %29
%34 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 1
%37 = load i8*, i8** %36
%38 = call i32 @strcpy(i8* %34, i8* %37)
%39 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%40 = call i32 @strcat(i8* %39, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%41 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%42 = call i32* @fopen(i8* %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %42, i32** %11
%43 = load i32*, i32** %11
%44 = icmp eq i32* %43, null
br i1 %44, label %45, label %48
45: ; preds = %33
%46 = load i32*, i32** @stderr
%47 = call i32 (i32*, i8*, ...) @fprintf(i32* %46, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
store i32 -1, i32* %3
br label %152
48: ; preds = %33
%49 = load i32*, i32** @stderr
%50 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%51 = call i32 (i32*, i8*, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %50)
br label %52
52: ; preds = %48
%53 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 1
%56 = load i8*, i8** %55
%57 = call i32 @strcpy(i8* %53, i8* %56)
%58 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%59 = call i32 @strcat(i8* %58, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%60 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%61 = call i32* @fopen(i8* %60, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %61, i32** %12
%62 = load i32*, i32** %12
%63 = icmp eq i32* %62, null
br i1 %63, label %64, label %67
64: ; preds = %52
%65 = load i32*, i32** @stderr
%66 = call i32 (i32*, i8*, ...) @fprintf(i32* %65, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
store i32 -1, i32* %3
br label %152
67: ; preds = %52
%68 = load i32*, i32** @stderr
%69 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%70 = call i32 (i32*, i8*, ...) @fprintf(i32* %68, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %69)
br label %71
71: ; preds = %67
%72 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%73 = load i8**, i8*** %5
%74 = getelementptr inbounds i8*, i8** %73, i64 1
%75 = load i8*, i8** %74
%76 = call i32 @strcpy(i8* %72, i8* %75)
%77 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%78 = call i32 @strcat(i8* %77, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%79 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%80 = call i32* @fopen(i8* %79, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32* %80, i32** %9
%81 = load i32*, i32** %9
%82 = icmp eq i32* %81, null
br i1 %82, label %83, label %86
83: ; preds = %71
%84 = load i32*, i32** @stderr
%85 = call i32 (i32*, i8*, ...) @fprintf(i32* %84, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0))
store i32 -1, i32* %3
br label %152
86: ; preds = %71
%87 = load i32*, i32** @stderr
%88 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%89 = call i32 (i32*, i8*, ...) @fprintf(i32* %87, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %88)
br label %90
90: ; preds = %86
br label %91
91: ; preds = %138, %90
%92 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%93 = load i32*, i32** %9
%94 = call i64 @fgets(i8* %92, i32 70, i32* %93)
%95 = icmp ne i64 %94, 0
br i1 %95, label %96, label %139
96: ; preds = %91
%97 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* %97)
%99 = load i32, i32* %6
%100 = add nsw i32 %99, 1
store i32 %100, i32* %6
%101 = load i32, i32* %8
%102 = add nsw i32 %101, 1
store i32 %102, i32* %8
%103 = load i32, i32* %7
%104 = add nsw i32 %103, 1
store i32 %104, i32* %7
%105 = load i32*, i32** %10
%106 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%107 = load i8, i8* %106
%108 = sext i8 %107 to i32
%109 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 1
%110 = load i8, i8* %109
%111 = sext i8 %110 to i32
%112 = call i32 (i32*, i8*, ...) @fprintf(i32* %105, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i32 %108, i32 %111)
%113 = load i32*, i32** %11
%114 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 2
%115 = load i8, i8* %114
%116 = sext i8 %115 to i32
%117 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 3
%118 = load i8, i8* %117
%119 = sext i8 %118 to i32
%120 = call i32 (i32*, i8*, ...) @fprintf(i32* %113, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i32 %116, i32 %119)
%121 = load i32*, i32** %12
%122 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 5
%123 = load i8, i8* %122
%124 = sext i8 %123 to i32
%125 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 6
%126 = load i8, i8* %125
%127 = sext i8 %126 to i32
%128 = call i32 (i32*, i8*, ...) @fprintf(i32* %121, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i32 %124, i32 %127)
%129 = load i32, i32* %6
%130 = icmp eq i32 %129, 10
br i1 %130, label %131, label %138
131: ; preds = %96
%132 = load i32*, i32** %10
%133 = call i32 (i32*, i8*, ...) @fprintf(i32* %132, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%134 = load i32*, i32** %11
%135 = call i32 (i32*, i8*, ...) @fprintf(i32* %134, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%136 = load i32*, i32** %12
%137 = call i32 (i32*, i8*, ...) @fprintf(i32* %136, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
store i32 0, i32* %6
br label %138
138: ; preds = %131, %96
br label %91
139: ; preds = %91
%140 = load i32, i32* %7
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i32 %140)
%142 = load i32, i32* %8
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.15, i64 0, i64 0), i32 %142)
%144 = load i32*, i32** %9
%145 = call i32 @fclose(i32* %144)
%146 = load i32*, i32** %10
%147 = call i32 @fclose(i32* %146)
%148 = load i32*, i32** %11
%149 = call i32 @fclose(i32* %148)
%150 = load i32*, i32** %12
%151 = call i32 @fclose(i32* %150)
store i32 1, i32* %3
br label %152
152: ; preds = %139, %83, %64, %45, %26
%153 = load i32, i32* %3
ret i32 %153
}

LLVM IR (-O2):
@.str = [4 x i8] c".hb\00"
@.str.1 = [2 x i8] c"w\00"
@stderr = global i32* null
@.str.2 = [25 x i8] c"open init hb file fail!\0A\00"
@.str.3 = [15 x i8] c"open file :%s\0A\00"
@.str.4 = [4 x i8] c".lb\00"
@.str.5 = [25 x i8] c"open init lb file fail!\0A\00"
@.str.6 = [6 x i8] c".data\00"
@.str.7 = [27 x i8] c"open init data file fail!\0A\00"
@.str.8 = [5 x i8] c".set\00"
@.str.9 = [2 x i8] c"r\00"
@.str.10 = [24 x i8] c"open source file fail!\0A\00"
@.str.12 = [9 x i8] c"0x%c%c, \00"
@.str.14 = [17 x i8] c"Total_ITEM = %d\0A\00"
@.str.15 = [17 x i8] c"Total_DATA = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [128 x i8]
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @strcpy(i8* %6, i8* %8)
%10 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%11 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32* %11, null
%13 = load i32*, i32** @stderr
br i1 %12, label %14, label %16
14: ; preds = %2
%15 = call i64 @fwrite(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i64 24, i64 1, i32* %13)
br label %94
16: ; preds = %2
%17 = call i32 (i32*, i8*, ...) @fprintf(i32* %13, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %6)
%18 = load i8*, i8** %7
%19 = call i32 @strcpy(i8* %6, i8* %18)
%20 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%21 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i32* %21, null
%23 = load i32*, i32** @stderr
br i1 %22, label %24, label %26
24: ; preds = %16
%25 = call i64 @fwrite(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i64 24, i64 1, i32* %23)
br label %94
26: ; preds = %16
%27 = call i32 (i32*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %6)
%28 = load i8*, i8** %7
%29 = call i32 @strcpy(i8* %6, i8* %28)
%30 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%31 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%32 = icmp eq i32* %31, null
%33 = load i32*, i32** @stderr
br i1 %32, label %34, label %36
34: ; preds = %26
%35 = call i64 @fwrite(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i64 26, i64 1, i32* %33)
br label %94
36: ; preds = %26
%37 = call i32 (i32*, i8*, ...) @fprintf(i32* %33, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %6)
%38 = load i8*, i8** %7
%39 = call i32 @strcpy(i8* %6, i8* %38)
%40 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%41 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%42 = icmp eq i32* %41, null
%43 = load i32*, i32** @stderr
br i1 %42, label %44, label %46
44: ; preds = %36
%45 = call i64 @fwrite(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0), i64 23, i64 1, i32* %43)
br label %94
46: ; preds = %36
%47 = call i32 (i32*, i8*, ...) @fprintf(i32* %43, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %6)
%48 = call i64 @fgets(i8* %5, i32 70, i32* %41)
%49 = icmp eq i64 %48, 0
br i1 %49, label %86, label %50
50: ; preds = %46
%51 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 1
%52 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 2
%53 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 3
%54 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 5
%55 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 6
br label %56
56: ; preds = %50, %82
%57 = phi i32 [ 0, %50 ], [ %61, %82 ]
%58 = phi i32 [ 0, %50 ], [ %83, %82 ]
%59 = call i32 @puts(i8* %5)
%60 = add nsw i32 %58, 1
%61 = add nuw nsw i32 %57, 1
%62 = load i8, i8* %5
%63 = sext i8 %62 to i32
%64 = load i8, i8* %51
%65 = sext i8 %64 to i32
%66 = call i32 (i32*, i8*, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i32 %63, i32 %65)
%67 = load i8, i8* %52
%68 = sext i8 %67 to i32
%69 = load i8, i8* %53
%70 = sext i8 %69 to i32
%71 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i32 %68, i32 %70)
%72 = load i8, i8* %54
%73 = sext i8 %72 to i32
%74 = load i8, i8* %55
%75 = sext i8 %74 to i32
%76 = call i32 (i32*, i8*, ...) @fprintf(i32* %31, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i32 %73, i32 %75)
%77 = icmp eq i32 %60, 10
br i1 %77, label %78, label %82
78: ; preds = %56
%79 = call i32 @fputc(i32 10, i32* %11)
%80 = call i32 @fputc(i32 10, i32* %21)
%81 = call i32 @fputc(i32 10, i32* %31)
br label %82
82: ; preds = %78, %56
%83 = phi i32 [ 0, %78 ], [ %60, %56 ]
%84 = call i64 @fgets(i8* %5, i32 70, i32* %41)
%85 = icmp eq i64 %84, 0
br i1 %85, label %86, label %56
86: ; preds = %82, %46
%87 = phi i32 [ 0, %46 ], [ %61, %82 ]
%88 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i32 %87)
%89 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.15, i64 0, i64 0), i32 %87)
%90 = call i32 @fclose(i32* %41)
%91 = call i32 @fclose(i32* %11)
%92 = call i32 @fclose(i32* %21)
%93 = call i32 @fclose(i32* %31)
br label %94
94: ; preds = %86, %44, %34, %24, %14
%95 = phi i32 [ -1, %14 ], [ -1, %24 ], [ -1, %34 ], [ -1, %44 ], [ 1, %86 ]
ret i32 %95
}