#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*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(void) {
  char szTemp1[1024], szTemp2[1024];
  FILE *fp = fopen("dict.txt", "r");
  FILE *fp1 = fopen("dictList.h", "w");
  FILE *fp2 = fopen("dictType.h", "w");
  if (fp == NULL || fp1 == NULL || fp2 == NULL) {
    printf("Open file(s) error\n");
    return 0;
  }
  fprintf(fp1, "char g_szDictList[][20] = {\n");
  fprintf(fp2, "char g_szDictType[][20] = {\n");
  while (!feof(fp)) {
    fscanf(fp, "%s\t%s\n", szTemp1, szTemp2);
    if (szTemp1[0] == '"')
      strcpy(szTemp1, &szTemp1[1]);
    fprintf(fp1, "\"%s\",\n", szTemp1);
    fprintf(fp2, "\"%s\",\n", szTemp2);
  }
  fprintf(fp1, "\"结束符号\"};\n");
  fprintf(fp2, "\"生活\"};\n");
  fclose(fp);
  fclose(fp1);
  fclose(fp2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x830,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe77(%rip),%rdi
lea    0xe79(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x818(%rbp)
lea    0xe68(%rip),%rdi
lea    0xe6c(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x820(%rbp)
lea    0xe5b(%rip),%rdi
lea    0xe52(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x828(%rbp)
cmpq   $0x0,-0x818(%rbp)
je     11fa <main+0x8a>
cmpq   $0x0,-0x820(%rbp)
je     11fa <main+0x8a>
cmpq   $0x0,-0x828(%rbp)
jne    1212 <main+0xa2>
lea    0xe22(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1337 <main+0x1c7>
mov    -0x820(%rbp),%rdi
lea    0xe17(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x828(%rbp),%rdi
lea    0xe1f(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x818(%rbp),%rdi
call   1080 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    125d <main+0xed>
jmp    12e2 <main+0x172>
mov    -0x818(%rbp),%rdi
lea    -0x410(%rbp),%rdx
lea    -0x810(%rbp),%rcx
lea    0xdf8(%rip),%rsi
call   1060 <fscanf@plt>
movsbl -0x410(%rbp),%eax
cmp    $0x22,%eax
jne    12a5 <main+0x135>
lea    -0x410(%rbp),%rdi
lea    -0x410(%rbp),%rsi
add    $0x1,%rsi
call   1030 <strcpy@plt>
mov    -0x820(%rbp),%rdi
lea    -0x410(%rbp),%rdx
lea    0xdbe(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x828(%rbp),%rdi
lea    -0x810(%rbp),%rdx
lea    0xda2(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    123c <main+0xcc>
mov    -0x820(%rbp),%rdi
lea    0xd8f(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x828(%rbp),%rdi
lea    0xd8c(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x818(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x820(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x828(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x830,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x808,%rsp
lea    0xe68(%rip),%rdi
lea    0xef9(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%rbx
lea    0xe5b(%rip),%rdi
lea    0xe5f(%rip),%rbp
mov    %rbp,%rsi
call   1090 <fopen@plt>
mov    %rax,%r14
lea    0xe4f(%rip),%rdi
mov    %rbp,%rsi
call   1090 <fopen@plt>
test   %rbx,%rbx
je     1277 <main+0xf7>
test   %r14,%r14
je     1277 <main+0xf7>
mov    %rax,%r15
test   %rax,%rax
je     1277 <main+0xf7>
lea    0xe2d(%rip),%rdi
mov    $0x1c,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10a0 <fwrite@plt>
lea    0xe31(%rip),%rdi
mov    $0x1c,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10a0 <fwrite@plt>
mov    %rbx,%rdi
call   1080 <feof@plt>
test   %eax,%eax
je     1297 <main+0x117>
lea    0xe37(%rip),%rdi
mov    $0x11,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10a0 <fwrite@plt>
lea    0xe30(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10a0 <fwrite@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %r15,%rdi
call   1050 <fclose@plt>
jmp    1283 <main+0x103>
lea    0xe09(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x808,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rsp,%rbp
lea    0x400(%rsp),%r12
lea    0xdb9(%rip),%r13
jmp    12e0 <main+0x160>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rbx,%rdi
call   1080 <feof@plt>
test   %eax,%eax
jne    122b <main+0xab>
mov    %rbx,%rdi
lea    0xd71(%rip),%rsi
mov    %rbp,%rdx
mov    %r12,%rcx
call   1060 <fscanf@plt>
cmpb   $0x22,(%rsp)
jne    12b0 <main+0x130>
mov    %rbp,%rdi
lea    0x1(%rsp),%rsi
call   1030 <strcpy@plt>
jmp    12b0 <main+0x130>

LLVM IR (-O0):
@.str = [9 x i8] c"dict.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"dictList.h\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [11 x i8] c"dictType.h\00"
@.str.5 = [20 x i8] c"Open file(s) error\0A\00"
@.str.6 = [29 x i8] c"char g_szDictList[][20] = {\0A\00"
@.str.7 = [29 x i8] c"char g_szDictType[][20] = {\0A\00"
@.str.8 = [7 x i8] c"%s\09%s\0A\00"
@.str.9 = [7 x i8] c"\22%s\22,\0A\00"
@.str.10 = [18 x i8] c"\22\E7\BB\93\E6\9D\9F\E7\AC\A6\E5\8F\B7\22};\0A\00"
@.str.11 = [12 x i8] c"\22\E7\94\9F\E6\B4\BB\22};\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
%3 = alloca [1024 x i8]
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32 0, i32* %1
%7 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %7, i32** %4
%8 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %8, i32** %5
%9 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %9, i32** %6
%10 = load i32*, i32** %4
%11 = icmp eq i32* %10, null
br i1 %11, label %18, label %12
12: ; preds = %0
%13 = load i32*, i32** %5
%14 = icmp eq i32* %13, null
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load i32*, i32** %6
%17 = icmp eq i32* %16, null
br i1 %17, label %18, label %20
18: ; preds = %15, %12, %0
%19 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %1
br label %61
20: ; preds = %15
%21 = load i32*, i32** %5
%22 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0))
%23 = load i32*, i32** %6
%24 = call i32 (i32*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0))
br label %25
25: ; preds = %43, %20
%26 = load i32*, i32** %4
%27 = call i32 @feof(i32* %26)
%28 = icmp ne i32 %27, 0
%29 = xor i1 %28, true
br i1 %29, label %30, label %50
30: ; preds = %25
%31 = load i32*, i32** %4
%32 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%33 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%34 = call i32 @fscanf(i32* %31, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %32, i8* %33)
%35 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 34
br i1 %38, label %39, label %43
39: ; preds = %30
%40 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%41 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 1
%42 = call i32 @strcpy(i8* %40, i8* %41)
br label %43
43: ; preds = %39, %30
%44 = load i32*, i32** %5
%45 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%46 = call i32 (i32*, i8*, ...) @fprintf(i32* %44, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* %45)
%47 = load i32*, i32** %6
%48 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%49 = call i32 (i32*, i8*, ...) @fprintf(i32* %47, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* %48)
br label %25
50: ; preds = %25
%51 = load i32*, i32** %5
%52 = call i32 (i32*, i8*, ...) @fprintf(i32* %51, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0))
%53 = load i32*, i32** %6
%54 = call i32 (i32*, i8*, ...) @fprintf(i32* %53, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0))
%55 = load i32*, i32** %4
%56 = call i32 @fclose(i32* %55)
%57 = load i32*, i32** %5
%58 = call i32 @fclose(i32* %57)
%59 = load i32*, i32** %6
%60 = call i32 @fclose(i32* %59)
store i32 0, i32* %1
br label %61
61: ; preds = %50, %18
%62 = load i32, i32* %1
ret i32 %62
}

LLVM IR (-O2):
@.str = [9 x i8] c"dict.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"dictList.h\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [11 x i8] c"dictType.h\00"
@.str.6 = [29 x i8] c"char g_szDictList[][20] = {\0A\00"
@.str.7 = [29 x i8] c"char g_szDictType[][20] = {\0A\00"
@.str.8 = [7 x i8] c"%s\09%s\0A\00"
@.str.9 = [7 x i8] c"\22%s\22,\0A\00"
@.str.10 = [18 x i8] c"\22\E7\BB\93\E6\9D\9F\E7\AC\A6\E5\8F\B7\22};\0A\00"
@.str.11 = [12 x i8] c"\22\E7\94\9F\E6\B4\BB\22};\0A\00"
@str = [19 x i8] c"Open file(s) error\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%8 = icmp eq i32* %5, null
%9 = icmp eq i32* %6, null
%10 = or i1 %8, %9
%11 = icmp eq i32* %7, null
%12 = or i1 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %39
15: ; preds = %0
%16 = tail call i64 @fwrite(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i64 28, i64 1, i32* %6)
%17 = tail call i64 @fwrite(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i64 28, i64 1, i32* %7)
%18 = call i32 @feof(i32* %5)
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %33
20: ; preds = %15
%21 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 1
br label %22
22: ; preds = %20, %28
%23 = call i32 @fscanf(i32* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %3, i8* %4)
%24 = load i8, i8* %3
%25 = icmp eq i8 %24, 34
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 @strcpy(i8* %3, i8* %21)
br label %28
28: ; preds = %26, %22
%29 = call i32 (i32*, i8*, ...) @fprintf(i32* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* %3)
%30 = call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* %4)
%31 = call i32 @feof(i32* %5)
%32 = icmp eq i32 %31, 0
br i1 %32, label %22, label %33
33: ; preds = %28, %15
%34 = call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i64 17, i64 1, i32* %6)
%35 = call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i64 11, i64 1, i32* %7)
%36 = call i32 @fclose(i32* %5)
%37 = call i32 @fclose(i32* %6)
%38 = call i32 @fclose(i32* %7)
br label %39
39: ; preds = %33, %13
ret i32 0
}