#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__ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
unsigned char getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, unsigned char);
int dat2h(char *infname, char *outfname, char *varname, char *deffname,
          const char *mode) {
  int ret = 0;
  FILE *infile, *outfile, *definfile;
  unsigned char c;
  unsigned int fgDefTable = 0;
  infile = fopen(infname, "r");
  if (infile == (FILE *)NULL) {
    printf("Can't read file %s\n", infname);
    printf("System would automatically apply default table !!\n");
    fgDefTable = 1;
    definfile = fopen(deffname, "r");
    if (definfile == (FILE *)NULL) {
      printf("Can't read def file %s\n", deffname);
      return -1;
    }
  }
  outfile = fopen(outfname, mode);
  if (outfile == (FILE *)NULL) {
    printf("Can't open write file %s\n", outfname);
    if (fgDefTable == 0)
      fclose(infile);
    else
      fclose(definfile);
    return -1;
  }
  fputs("/* AUTO GEN PLEASE DO NOT MODIFY IT */\n", outfile);
  fputs("/* AUTO GEN PLEASE DO NOT MODIFY IT */\n", outfile);
  fputs("\n", outfile);
  fputs("\n", outfile);
  fprintf(outfile, "UCHAR %s[] = \"", varname);
  while (1) {
    char cc[1];
    if (fgDefTable == 0)
      c = getc(infile);
    else
      c = getc(definfile);
    if (c == '#') {
      c = '!';
      sprintf(cc, "%c", c);
      fputs(cc, outfile);
    }
    if (fgDefTable == 0) {
      if (feof(infile))
        break;
    } else {
      if (feof(definfile))
        break;
    }
    if (c == '\r')
      continue;
    else if (c == '\n') {
      c = '\t';
      sprintf(cc, "%c", c);
      fputs(cc, outfile);
      c = '\"';
      sprintf(cc, "%c", c);
      fputs(cc, outfile);
      c = '\n';
      sprintf(cc, "%c", c);
      fputs(cc, outfile);
      c = '\"';
      sprintf(cc, "%c", c);
      fputs(cc, outfile);
    } else {
      sprintf(cc, "%c", c);
      fputs(cc, outfile);
    }
  }
  fputs("\";\n", outfile);
  if (fgDefTable == 0)
    fclose(infile);
  else
    fclose(definfile);
  fclose(outfile);
}


x86 assembly (clang, -O0):
<dat2h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x58(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe4b(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1232 <dat2h+0xb2>
mov    -0x10(%rbp),%rsi
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x58(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe05(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    122d <dat2h+0xad>
mov    -0x28(%rbp),%rsi
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    149b <dat2h+0x31b>
jmp    1232 <dat2h+0xb2>
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    128d <dat2h+0x10d>
mov    -0x18(%rbp),%rsi
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x58(%rbp)
jne    1278 <dat2h+0xf8>
mov    -0x40(%rbp),%rdi
call   1030 <fclose@plt>
jmp    1281 <dat2h+0x101>
mov    -0x50(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    149b <dat2h+0x31b>
mov    -0x48(%rbp),%rsi
lea    0xde3(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x48(%rbp),%rsi
lea    0xdd3(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x48(%rbp),%rsi
lea    0xd8f(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x48(%rbp),%rsi
lea    0xd7f(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x48(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xdc7(%rip),%rsi
call   1060 <fprintf@plt>
cmpl   $0x0,-0x58(%rbp)
jne    12fc <dat2h+0x17c>
mov    -0x40(%rbp),%rdi
call   10a0 <getc@plt>
mov    %al,-0x51(%rbp)
jmp    1308 <dat2h+0x188>
mov    -0x50(%rbp),%rdi
call   10a0 <getc@plt>
mov    %al,-0x51(%rbp)
movzbl -0x51(%rbp),%eax
cmp    $0x23,%eax
jne    133a <dat2h+0x1ba>
movb   $0x21,-0x51(%rbp)
lea    -0x59(%rbp),%rdi
lea    0xd8e(%rip),%rsi
movzbl -0x51(%rbp),%edx
call   1090 <sprintf@plt>
lea    -0x59(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   1050 <fputs@plt>
cmpl   $0x0,-0x58(%rbp)
jne    1361 <dat2h+0x1e1>
mov    -0x40(%rbp),%rdi
call   1070 <feof@plt>
cmp    $0x0,%rax
je     135c <dat2h+0x1dc>
jmp    1461 <dat2h+0x2e1>
jmp    137e <dat2h+0x1fe>
mov    -0x50(%rbp),%rdi
call   1070 <feof@plt>
cmp    $0x0,%rax
je     1379 <dat2h+0x1f9>
jmp    1461 <dat2h+0x2e1>
jmp    137e <dat2h+0x1fe>
movzbl -0x51(%rbp),%eax
cmp    $0xd,%eax
jne    1390 <dat2h+0x210>
jmp    12e1 <dat2h+0x161>
movzbl -0x51(%rbp),%eax
cmp    $0xa,%eax
jne    1436 <dat2h+0x2b6>
movb   $0x9,-0x51(%rbp)
lea    -0x59(%rbp),%rdi
lea    0xd06(%rip),%rsi
movzbl -0x51(%rbp),%edx
call   1090 <sprintf@plt>
lea    -0x59(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   1050 <fputs@plt>
movb   $0x22,-0x51(%rbp)
lea    -0x59(%rbp),%rdi
lea    0xce1(%rip),%rsi
movzbl -0x51(%rbp),%edx
call   1090 <sprintf@plt>
lea    -0x59(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   1050 <fputs@plt>
movb   $0xa,-0x51(%rbp)
lea    -0x59(%rbp),%rdi
lea    0xcbc(%rip),%rsi
movzbl -0x51(%rbp),%edx
call   1090 <sprintf@plt>
lea    -0x59(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   1050 <fputs@plt>
movb   $0x22,-0x51(%rbp)
lea    -0x59(%rbp),%rdi
lea    0xc97(%rip),%rsi
movzbl -0x51(%rbp),%edx
call   1090 <sprintf@plt>
lea    -0x59(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   1050 <fputs@plt>
jmp    1457 <dat2h+0x2d7>
lea    -0x59(%rbp),%rdi
lea    0xc71(%rip),%rsi
movzbl -0x51(%rbp),%edx
call   1090 <sprintf@plt>
lea    -0x59(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   1050 <fputs@plt>
jmp    145c <dat2h+0x2dc>
jmp    12e1 <dat2h+0x161>
mov    -0x48(%rbp),%rsi
lea    0xc49(%rip),%rdi
call   1050 <fputs@plt>
cmpl   $0x0,-0x58(%rbp)
jne    1489 <dat2h+0x309>
mov    -0x40(%rbp),%rdi
call   1030 <fclose@plt>
jmp    1492 <dat2h+0x312>
mov    -0x50(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x48(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dat2h>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8,%rbx
mov    %rcx,%r15
mov    %rdx,0x10(%rsp)
mov    %rsi,%r13
mov    %rdi,%r12
lea    0xe3a(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    120b <dat2h+0x6b>
lea    0xe28(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe98(%rip),%rdi
call   1030 <puts@plt>
lea    0xe09(%rip),%rsi
mov    %r15,%rdi
call   10a0 <fopen@plt>
mov    %rax,%r14
test   %rax,%rax
je     13b2 <dat2h+0x212>
mov    %r13,%rdi
mov    %rbx,%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     135a <dat2h+0x1ba>
mov    %rax,%r15
lea    0xe1f(%rip),%rbx
mov    $0x27,%esi
mov    $0x1,%edx
mov    %rbx,%rdi
mov    %rax,%rcx
call   10b0 <fwrite@plt>
mov    $0x27,%esi
mov    $0x1,%edx
mov    %rbx,%rdi
mov    %r15,%rcx
call   10b0 <fwrite@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1070 <fputc@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1070 <fputc@plt>
lea    0xdfc(%rip),%rsi
mov    %r15,%rdi
mov    0x10(%rsp),%rdx
call   1080 <fprintf@plt>
lea    0xf(%rsp),%r12
jmp    12a0 <dat2h+0x100>
nopl   0x0(%rax,%rax,1)
movb   $0x0,0x10(%rsp)
mov    %r12,%rdi
mov    %r15,%rsi
call   1060 <fputs@plt>
test   %rbp,%rbp
je     12b0 <dat2h+0x110>
mov    %rbp,%rdi
jmp    12b3 <dat2h+0x113>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   10c0 <getc@plt>
mov    %eax,%ebx
cmp    $0x23,%al
jne    12d0 <dat2h+0x130>
movb   $0x0,0x10(%rsp)
mov    %r12,%rdi
mov    %r15,%rsi
call   1060 <fputs@plt>
mov    $0x21,%bl
test   %rbp,%rbp
je     12f0 <dat2h+0x150>
mov    %rbp,%rdi
call   1090 <feof@plt>
test   %rax,%rax
je     12fd <dat2h+0x15d>
jmp    133c <dat2h+0x19c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1090 <feof@plt>
test   %rax,%rax
jne    1375 <dat2h+0x1d5>
cmp    $0xd,%bl
je     12a0 <dat2h+0x100>
cmp    $0xa,%bl
jne    1290 <dat2h+0xf0>
movb   $0x0,0x10(%rsp)
mov    %r12,%rdi
mov    %r15,%rsi
call   1060 <fputs@plt>
movb   $0x0,0x10(%rsp)
mov    %r12,%rdi
mov    %r15,%rsi
call   1060 <fputs@plt>
movb   $0x0,0x10(%rsp)
mov    %r12,%rdi
mov    %r15,%rsi
call   1060 <fputs@plt>
jmp    1290 <dat2h+0xf0>
lea    0xd3c(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10b0 <fwrite@plt>
mov    %rbp,%rdi
jmp    1391 <dat2h+0x1f1>
lea    0xccd(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
test   %rbp,%rbp
je     13c5 <dat2h+0x225>
mov    %rbp,%rdi
jmp    1399 <dat2h+0x1f9>
lea    0xd03(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10b0 <fwrite@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
mov    $0xffffffff,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc5d(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    139e <dat2h+0x1fe>
mov    %r14,%rdi
jmp    1399 <dat2h+0x1f9>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [20 x i8] c"Can't read file %s\0A\00"
@.str.2 = [51 x i8] c"System would automatically apply default table !!\0A\00"
@.str.3 = [24 x i8] c"Can't read def file %s\0A\00"
@.str.4 = [26 x i8] c"Can't open write file %s\0A\00"
@.str.5 = [40 x i8] c"/* AUTO GEN PLEASE DO NOT MODIFY IT */\0A\00"
@.str.6 = [2 x i8] c"\0A\00"
@.str.7 = [15 x i8] c"UCHAR %s[] = \22\00"
@.str.8 = [3 x i8] c"%c\00"
@.str.9 = [4 x i8] c"\22;\0A\00"
define i32 @dat2h(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i8
%17 = alloca i32
%18 = alloca [1 x i8]
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i32 0, i32* %12
store i32 0, i32* %17
%19 = load i8*, i8** %7
%20 = call i32* @fopen(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %20, i32** %13
%21 = load i32*, i32** %13
%22 = icmp eq i32* %21, null
br i1 %22, label %23, label %35
23: ; preds = %5
%24 = load i8*, i8** %7
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %24)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %17
%27 = load i8*, i8** %10
%28 = call i32* @fopen(i8* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %28, i32** %15
%29 = load i32*, i32** %15
%30 = icmp eq i32* %29, null
br i1 %30, label %31, label %34
31: ; preds = %23
%32 = load i8*, i8** %10
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %32)
store i32 -1, i32* %6
br label %157
34: ; preds = %23
br label %35
35: ; preds = %34, %5
%36 = load i8*, i8** %8
%37 = load i8*, i8** %11
%38 = call i32* @fopen(i8* %36, i8* %37)
store i32* %38, i32** %14
%39 = load i32*, i32** %14
%40 = icmp eq i32* %39, null
br i1 %40, label %41, label %53
41: ; preds = %35
%42 = load i8*, i8** %8
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %42)
%44 = load i32, i32* %17
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %41
%47 = load i32*, i32** %13
%48 = call i32 @fclose(i32* %47)
br label %52
49: ; preds = %41
%50 = load i32*, i32** %15
%51 = call i32 @fclose(i32* %50)
br label %52
52: ; preds = %49, %46
store i32 -1, i32* %6
br label %157
53: ; preds = %35
%54 = load i32*, i32** %14
%55 = call i32 @fputs(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0), i32* %54)
%56 = load i32*, i32** %14
%57 = call i32 @fputs(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0), i32* %56)
%58 = load i32*, i32** %14
%59 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i32* %58)
%60 = load i32*, i32** %14
%61 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i32* %60)
%62 = load i32*, i32** %14
%63 = load i8*, i8** %9
%64 = call i32 @fprintf(i32* %62, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i8* %63)
br label %65
65: ; preds = %53, %104, %142
%66 = load i32, i32* %17
%67 = icmp eq i32 %66, 0
br i1 %67, label %68, label %71
68: ; preds = %65
%69 = load i32*, i32** %13
%70 = call zeroext i8 @getc(i32* %69)
store i8 %70, i8* %16
br label %74
71: ; preds = %65
%72 = load i32*, i32** %15
%73 = call zeroext i8 @getc(i32* %72)
store i8 %73, i8* %16
br label %74
74: ; preds = %71, %68
%75 = load i8, i8* %16
%76 = zext i8 %75 to i32
%77 = icmp eq i32 %76, 35
br i1 %77, label %78, label %85
78: ; preds = %74
store i8 33, i8* %16
%79 = getelementptr inbounds [1 x i8], [1 x i8]* %18, i64 0, i64 0
%80 = load i8, i8* %16
%81 = call i32 @sprintf(i8* %79, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8 zeroext %80)
%82 = getelementptr inbounds [1 x i8], [1 x i8]* %18, i64 0, i64 0
%83 = load i32*, i32** %14
%84 = call i32 @fputs(i8* %82, i32* %83)
br label %85
85: ; preds = %78, %74
%86 = load i32, i32* %17
%87 = icmp eq i32 %86, 0
br i1 %87, label %88, label %94
88: ; preds = %85
%89 = load i32*, i32** %13
%90 = call i64 @feof(i32* %89)
%91 = icmp ne i64 %90, 0
br i1 %91, label %92, label %93
92: ; preds = %88
br label %143
93: ; preds = %88
br label %100
94: ; preds = %85
%95 = load i32*, i32** %15
%96 = call i64 @feof(i32* %95)
%97 = icmp ne i64 %96, 0
br i1 %97, label %98, label %99
98: ; preds = %94
br label %143
99: ; preds = %94
br label %100
100: ; preds = %99, %93
%101 = load i8, i8* %16
%102 = zext i8 %101 to i32
%103 = icmp eq i32 %102, 13
br i1 %103, label %104, label %105
104: ; preds = %100
br label %65
105: ; preds = %100
%106 = load i8, i8* %16
%107 = zext i8 %106 to i32
%108 = icmp eq i32 %107, 10
br i1 %108, label %109, label %134
109: ; preds = %105
store i8 9, i8* %16
%110 = getelementptr inbounds [1 x i8], [1 x i8]* %18, i64 0, i64 0
%111 = load i8, i8* %16
%112 = call i32 @sprintf(i8* %110, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8 zeroext %111)
%113 = getelementptr inbounds [1 x i8], [1 x i8]* %18, i64 0, i64 0
%114 = load i32*, i32** %14
%115 = call i32 @fputs(i8* %113, i32* %114)
store i8 34, i8* %16
%116 = getelementptr inbounds [1 x i8], [1 x i8]* %18, i64 0, i64 0
%117 = load i8, i8* %16
%118 = call i32 @sprintf(i8* %116, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8 zeroext %117)
%119 = getelementptr inbounds [1 x i8], [1 x i8]* %18, i64 0, i64 0
%120 = load i32*, i32** %14
%121 = call i32 @fputs(i8* %119, i32* %120)
store i8 10, i8* %16
%122 = getelementptr inbounds [1 x i8], [1 x i8]* %18, i64 0, i64 0
%123 = load i8, i8* %16
%124 = call i32 @sprintf(i8* %122, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8 zeroext %123)
%125 = getelementptr inbounds [1 x i8], [1 x i8]* %18, i64 0, i64 0
%126 = load i32*, i32** %14
%127 = call i32 @fputs(i8* %125, i32* %126)
store i8 34, i8* %16
%128 = getelementptr inbounds [1 x i8], [1 x i8]* %18, i64 0, i64 0
%129 = load i8, i8* %16
%130 = call i32 @sprintf(i8* %128, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8 zeroext %129)
%131 = getelementptr inbounds [1 x i8], [1 x i8]* %18, i64 0, i64 0
%132 = load i32*, i32** %14
%133 = call i32 @fputs(i8* %131, i32* %132)
br label %141
134: ; preds = %105
%135 = getelementptr inbounds [1 x i8], [1 x i8]* %18, i64 0, i64 0
%136 = load i8, i8* %16
%137 = call i32 @sprintf(i8* %135, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8 zeroext %136)
%138 = getelementptr inbounds [1 x i8], [1 x i8]* %18, i64 0, i64 0
%139 = load i32*, i32** %14
%140 = call i32 @fputs(i8* %138, i32* %139)
br label %141
141: ; preds = %134, %109
br label %142
142: ; preds = %141
br label %65
143: ; preds = %98, %92
%144 = load i32*, i32** %14
%145 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32* %144)
%146 = load i32, i32* %17
%147 = icmp eq i32 %146, 0
br i1 %147, label %148, label %151
148: ; preds = %143
%149 = load i32*, i32** %13
%150 = call i32 @fclose(i32* %149)
br label %154
151: ; preds = %143
%152 = load i32*, i32** %15
%153 = call i32 @fclose(i32* %152)
br label %154
154: ; preds = %151, %148
%155 = load i32*, i32** %14
%156 = call i32 @fclose(i32* %155)
br label %157
157: ; preds = %154, %52, %31
%158 = load i32, i32* %6
ret i32 %158
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [20 x i8] c"Can't read file %s\0A\00"
@.str.3 = [24 x i8] c"Can't read def file %s\0A\00"
@.str.4 = [26 x i8] c"Can't open write file %s\0A\00"
@.str.5 = [40 x i8] c"/* AUTO GEN PLEASE DO NOT MODIFY IT */\0A\00"
@.str.7 = [15 x i8] c"UCHAR %s[] = \22\00"
@.str.9 = [4 x i8] c"\22;\0A\00"
@str = [50 x i8] c"System would automatically apply default table !!\00"
define i32 @dat2h(i8* %0, i8* %1, i8* %2, i8* %3, i8* nocapture %4) {
%6 = alloca [1 x i8]
%7 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%12 = tail call i32* @fopen(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %3)
br label %68
16: ; preds = %9, %5
%17 = phi i32* [ %12, %9 ], [ undef, %5 ]
%18 = tail call i32* @fopen(i8* %1, i8* %4)
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %26
20: ; preds = %16
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %1)
br i1 %8, label %24, label %22
22: ; preds = %20
%23 = tail call i32 @fclose(i32* %7)
br label %68
24: ; preds = %20
%25 = tail call i32 @fclose(i32* %17)
br label %68
26: ; preds = %16
%27 = tail call i64 @fwrite(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0), i64 39, i64 1, i32* %18)
%28 = tail call i64 @fwrite(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0), i64 39, i64 1, i32* %18)
%29 = tail call i32 @fputc(i32 10, i32* %18)
%30 = tail call i32 @fputc(i32 10, i32* %18)
%31 = tail call i32 @fprintf(i32* %18, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i8* %2)
%32 = getelementptr inbounds [1 x i8], [1 x i8]* %6, i64 0, i64 0
%33 = getelementptr inbounds [1 x i8], [1 x i8]* %6, i64 0, i64 1
br label %34
34: ; preds = %59, %26
br i1 %8, label %37, label %35
35: ; preds = %34
%36 = tail call zeroext i8 @getc(i32* %7)
br label %39
37: ; preds = %34
%38 = tail call zeroext i8 @getc(i32* %17)
br label %39
39: ; preds = %37, %35
%40 = phi i8 [ %36, %35 ], [ %38, %37 ]
%41 = icmp eq i8 %40, 35
br i1 %41, label %42, label %44
42: ; preds = %39
store i8 0, i8* %33
%43 = call i32 @fputs(i8* %32, i32* %18)
br label %44
44: ; preds = %42, %39
%45 = phi i8 [ 33, %42 ], [ %40, %39 ]
br i1 %8, label %49, label %46
46: ; preds = %44
%47 = tail call i64 @feof(i32* %7)
%48 = icmp eq i64 %47, 0
br i1 %48, label %52, label %60
49: ; preds = %44
%50 = tail call i64 @feof(i32* %17)
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %63
52: ; preds = %49, %46
switch i8 %45, label %57 [
i8 13, label %59
i8 10, label %53
]
53: ; preds = %52
store i8 0, i8* %33
%54 = call i32 @fputs(i8* %32, i32* %18)
store i8 0, i8* %33
%55 = call i32 @fputs(i8* %32, i32* %18)
store i8 0, i8* %33
%56 = call i32 @fputs(i8* %32, i32* %18)
br label %57
57: ; preds = %52, %53
store i8 0, i8* %33
%58 = call i32 @fputs(i8* %32, i32* %18)
br label %59
59: ; preds = %57, %52
br label %34
60: ; preds = %46
%61 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i64 3, i64 1, i32* %18)
%62 = tail call i32 @fclose(i32* %7)
br label %66
63: ; preds = %49
%64 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i64 3, i64 1, i32* %18)
%65 = tail call i32 @fclose(i32* %17)
br label %66
66: ; preds = %63, %60
%67 = tail call i32 @fclose(i32* %18)
br label %68
68: ; preds = %22, %24, %66, %14
ret i32 -1
}