#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*/ *fopen(char *, char *);
int fread(void *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(char *, int /*<<< orphan*/, int,
                          int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char *argv[]) {
  if (argc != 4) {
    printf(";======= help =========\n");
    printf("format: cmd <table name> <binary file> <output file>\n\n");
    return 0;
  }
  char *szTable = argv[1];
  char *szBinFile = argv[2];
  char *szOutFile = argv[3];
  char szline[512];
  FILE *fp1 = fopen(szBinFile, "rb+");
  FILE *fpout = fopen(szOutFile, "wb");
  if (fp1 == NULL || fpout == NULL) {
    printf("error - file open failed!\n");
  } else {
    int blocksize = 4 * 4;
    unsigned buff[4];
    int nreads;
    int withend = 0;
    sprintf(szline, "const unsigned %s[]={\n", szTable);
    fwrite(szline, strlen(szline), 1, fpout);
    while ((nreads = fread((void *)&buff, 1, blocksize, fp1)) > 0) {
      if (nreads != blocksize) {
        sprintf(szline, "\t0x%.8x , 0x%.8x , 0x%.8x , 0x%.8x\n};\n", buff[0],
                buff[1], buff[2], buff[3]);
        fwrite(szline, strlen(szline), 1, fpout);
        withend = 1;
      } else {
        sprintf(szline, "\t0x%.8x , 0x%.8x , 0x%.8x , 0x%.8x,\n", buff[0],
                buff[1], buff[2], buff[3]);
        fwrite(szline, strlen(szline), 1, fpout);
      }
      memset((void *)buff, 0, blocksize);
    }
    if (!withend) {
      sprintf(szline, "\t0x%.8x , 0x%.8x , 0x%.8x , 0x%.8x\n};\n", buff[0],
              buff[1], buff[2], buff[3]);
      fwrite(szline, strlen(szline), 1, fpout);
    }
    printf("convert ok!\n");
  }
  if (fp1)
    fclose(fp1);
  if (fpout)
    fclose(fpout);
  fp1 = NULL;
  fpout = NULL;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x290,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     11c7 <main+0x47>
lea    0xe56(%rip),%rdi
call   1060 <printf@plt>
lea    0xe63(%rip),%rdi
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14a1 <main+0x321>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe5a(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x238(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe47(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x240(%rbp)
cmpq   $0x0,-0x238(%rbp)
je     1235 <main+0xb5>
cmpq   $0x0,-0x240(%rbp)
jne    1246 <main+0xc6>
lea    0xe1b(%rip),%rdi
call   1060 <printf@plt>
jmp    1450 <main+0x2d0>
movl   $0x10,-0x244(%rbp)
movl   $0x0,-0x268(%rbp)
lea    -0x230(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe06(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
lea    -0x230(%rbp),%rax
mov    %rax,-0x270(%rbp)
lea    -0x230(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x270(%rbp),%rdi
mov    %eax,%esi
mov    -0x240(%rbp),%rcx
mov    $0x1,%edx
call   10a0 <fwrite@plt>
lea    -0x260(%rbp),%rdi
mov    -0x244(%rbp),%edx
mov    -0x238(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
mov    %eax,-0x264(%rbp)
cmp    $0x0,%eax
jle    13d4 <main+0x254>
mov    -0x264(%rbp),%eax
cmp    -0x244(%rbp),%eax
je     1358 <main+0x1d8>
lea    -0x230(%rbp),%rdi
mov    -0x260(%rbp),%edx
mov    -0x25c(%rbp),%ecx
mov    -0x258(%rbp),%r8d
mov    -0x254(%rbp),%r9d
lea    0xd7b(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
lea    -0x230(%rbp),%rax
mov    %rax,-0x278(%rbp)
lea    -0x230(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x278(%rbp),%rdi
mov    %eax,%esi
mov    -0x240(%rbp),%rcx
mov    $0x1,%edx
call   10a0 <fwrite@plt>
movl   $0x1,-0x268(%rbp)
jmp    13bb <main+0x23b>
lea    -0x230(%rbp),%rdi
mov    -0x260(%rbp),%edx
mov    -0x25c(%rbp),%ecx
mov    -0x258(%rbp),%r8d
mov    -0x254(%rbp),%r9d
lea    0xd30(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
lea    -0x230(%rbp),%rax
mov    %rax,-0x280(%rbp)
lea    -0x230(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x280(%rbp),%rdi
mov    %eax,%esi
mov    -0x240(%rbp),%rcx
mov    $0x1,%edx
call   10a0 <fwrite@plt>
lea    -0x260(%rbp),%rdi
mov    -0x244(%rbp),%edx
xor    %esi,%esi
call   1070 <memset@plt>
jmp    12a7 <main+0x127>
cmpl   $0x0,-0x268(%rbp)
jne    1444 <main+0x2c4>
lea    -0x230(%rbp),%rdi
mov    -0x260(%rbp),%edx
mov    -0x25c(%rbp),%ecx
mov    -0x258(%rbp),%r8d
mov    -0x254(%rbp),%r9d
lea    0xc80(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
lea    -0x230(%rbp),%rax
mov    %rax,-0x288(%rbp)
lea    -0x230(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x288(%rbp),%rdi
mov    %eax,%esi
mov    -0x240(%rbp),%rcx
mov    $0x1,%edx
call   10a0 <fwrite@plt>
lea    0xc8a(%rip),%rdi
call   1060 <printf@plt>
cmpq   $0x0,-0x238(%rbp)
je     146a <main+0x2ea>
mov    -0x238(%rbp),%rdi
call   1040 <fclose@plt>
cmpq   $0x0,-0x240(%rbp)
je     1484 <main+0x304>
mov    -0x240(%rbp),%rdi
call   1040 <fclose@plt>
movq   $0x0,-0x238(%rbp)
movq   $0x0,-0x240(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x290,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x218,%rsp
cmp    $0x4,%edi
jne    1304 <main+0x184>
mov    0x8(%rsi),%r12
mov    0x10(%rsi),%rdi
mov    0x18(%rsi),%rbx
lea    0xe53(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%r15
lea    0xe48(%rip),%rsi
mov    %rbx,%rdi
call   1080 <fopen@plt>
mov    %rax,%r14
test   %r15,%r15
je     131e <main+0x19e>
test   %r14,%r14
je     131e <main+0x19e>
lea    0xe27(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r12,%rdx
xor    %eax,%eax
call   1090 <sprintf@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10a0 <fwrite@plt>
mov    %rsp,%rdi
mov    $0x1,%esi
mov    $0x10,%edx
mov    %r15,%rcx
call   1040 <fread@plt>
test   %eax,%eax
jle    12ba <main+0x13a>
lea    0x10(%rsp),%rbx
mov    %rsp,%r12
mov    $0x1,%r13d
xor    %ebp,%ebp
nopl   0x0(%rax)
cmp    $0x10,%eax
mov    (%rsp),%edx
mov    0x4(%rsp),%ecx
mov    0x8(%rsp),%r8d
mov    0xc(%rsp),%r9d
lea    0xdc3(%rip),%rsi
lea    0xde3(%rip),%rax
cmove  %rax,%rsi
cmovne %r13d,%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1090 <sprintf@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10a0 <fwrite@plt>
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1070 <memset@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x10,%edx
mov    %r15,%rcx
call   1040 <fread@plt>
test   %eax,%eax
jg     1240 <main+0xc0>
test   %ebp,%ebp
jne    12fb <main+0x17b>
mov    (%rsp),%edx
mov    0x4(%rsp),%ecx
mov    0x8(%rsp),%r8d
mov    0xc(%rsp),%r9d
lea    0xd4c(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1090 <sprintf@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10a0 <fwrite@plt>
lea    0xd68(%rip),%rdi
jmp    1325 <main+0x1a5>
lea    0xd85(%rip),%rdi
call   1030 <puts@plt>
lea    0xd91(%rip),%rdi
call   1030 <puts@plt>
jmp    1344 <main+0x1c4>
lea    0xd51(%rip),%rdi
call   1030 <puts@plt>
test   %r15,%r15
je     1337 <main+0x1b7>
mov    %r15,%rdi
call   1050 <fclose@plt>
test   %r14,%r14
je     1344 <main+0x1c4>
mov    %r14,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0x218,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c";======= help =========\0A\00"
@.str.1 = [55 x i8] c"format: cmd <table name> <binary file> <output file>\0A\0A\00"
@.str.2 = [4 x i8] c"rb+\00"
@.str.3 = [3 x i8] c"wb\00"
@.str.4 = [27 x i8] c"error - file open failed!\0A\00"
@.str.5 = [23 x i8] c"const unsigned %s[]={\0A\00"
@.str.6 = [39 x i8] c"\090x%.8x , 0x%.8x , 0x%.8x , 0x%.8x\0A};\0A\00"
@.str.7 = [37 x i8] c"\090x%.8x , 0x%.8x , 0x%.8x , 0x%.8x,\0A\00"
@.str.8 = [13 x i8] c"convert ok!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [512 x i8]
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32
%13 = alloca [4 x i32]
%14 = alloca i32
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 4
br i1 %17, label %18, label %21
18: ; preds = %2
%19 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %132
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
store i8* %24, i8** %6
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 2
%27 = load i8*, i8** %26
store i8* %27, i8** %7
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 3
%30 = load i8*, i8** %29
store i8* %30, i8** %8
%31 = load i8*, i8** %7
%32 = call i32* @fopen(i8* %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
store i32* %32, i32** %10
%33 = load i8*, i8** %8
%34 = call i32* @fopen(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %34, i32** %11
%35 = load i32*, i32** %10
%36 = icmp eq i32* %35, null
br i1 %36, label %40, label %37
37: ; preds = %21
%38 = load i32*, i32** %11
%39 = icmp eq i32* %38, null
br i1 %39, label %40, label %42
40: ; preds = %37, %21
%41 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
br label %119
42: ; preds = %37
store i32 16, i32* %12
store i32 0, i32* %15
%43 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%44 = load i8*, i8** %6
%45 = call i32 (i8*, i8*, ...) @sprintf(i8* %43, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* %44)
%46 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%47 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%48 = call i32 @strlen(i8* %47)
%49 = load i32*, i32** %11
%50 = call i32 @fwrite(i8* %46, i32 %48, i32 1, i32* %49)
br label %51
51: ; preds = %93, %42
%52 = bitcast [4 x i32]* %13 to i8*
%53 = load i32, i32* %12
%54 = load i32*, i32** %10
%55 = call i32 @fread(i8* %52, i32 1, i32 %53, i32* %54)
store i32 %55, i32* %14
%56 = icmp sgt i32 %55, 0
br i1 %56, label %57, label %98
57: ; preds = %51
%58 = load i32, i32* %14
%59 = load i32, i32* %12
%60 = icmp ne i32 %58, %59
br i1 %60, label %61, label %77
61: ; preds = %57
%62 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%63 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 0
%64 = load i32, i32* %63
%65 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 1
%66 = load i32, i32* %65
%67 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 2
%68 = load i32, i32* %67
%69 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 3
%70 = load i32, i32* %69
%71 = call i32 (i8*, i8*, ...) @sprintf(i8* %62, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0), i32 %64, i32 %66, i32 %68, i32 %70)
%72 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%73 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%74 = call i32 @strlen(i8* %73)
%75 = load i32*, i32** %11
%76 = call i32 @fwrite(i8* %72, i32 %74, i32 1, i32* %75)
store i32 1, i32* %15
br label %93
77: ; preds = %57
%78 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%79 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 0
%80 = load i32, i32* %79
%81 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 1
%82 = load i32, i32* %81
%83 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 2
%84 = load i32, i32* %83
%85 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 3
%86 = load i32, i32* %85
%87 = call i32 (i8*, i8*, ...) @sprintf(i8* %78, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i32 %80, i32 %82, i32 %84, i32 %86)
%88 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%89 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%90 = call i32 @strlen(i8* %89)
%91 = load i32*, i32** %11
%92 = call i32 @fwrite(i8* %88, i32 %90, i32 1, i32* %91)
br label %93
93: ; preds = %77, %61
%94 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 0
%95 = bitcast i32* %94 to i8*
%96 = load i32, i32* %12
%97 = call i32 @memset(i8* %95, i32 0, i32 %96)
br label %51
98: ; preds = %51
%99 = load i32, i32* %15
%100 = icmp ne i32 %99, 0
br i1 %100, label %117, label %101
101: ; preds = %98
%102 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%103 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 0
%104 = load i32, i32* %103
%105 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 1
%106 = load i32, i32* %105
%107 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 2
%108 = load i32, i32* %107
%109 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 3
%110 = load i32, i32* %109
%111 = call i32 (i8*, i8*, ...) @sprintf(i8* %102, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0), i32 %104, i32 %106, i32 %108, i32 %110)
%112 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%113 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%114 = call i32 @strlen(i8* %113)
%115 = load i32*, i32** %11
%116 = call i32 @fwrite(i8* %112, i32 %114, i32 1, i32* %115)
br label %117
117: ; preds = %101, %98
%118 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
br label %119
119: ; preds = %117, %40
%120 = load i32*, i32** %10
%121 = icmp ne i32* %120, null
br i1 %121, label %122, label %125
122: ; preds = %119
%123 = load i32*, i32** %10
%124 = call i32 @fclose(i32* %123)
br label %125
125: ; preds = %122, %119
%126 = load i32*, i32** %11
%127 = icmp ne i32* %126, null
br i1 %127, label %128, label %131
128: ; preds = %125
%129 = load i32*, i32** %11
%130 = call i32 @fclose(i32* %129)
br label %131
131: ; preds = %128, %125
store i32* null, i32** %10
store i32* null, i32** %11
store i32 0, i32* %3
br label %132
132: ; preds = %131, %18
%133 = load i32, i32* %3
ret i32 %133
}

LLVM IR (-O2):
@.str.2 = [4 x i8] c"rb+\00"
@.str.3 = [3 x i8] c"wb\00"
@.str.5 = [23 x i8] c"const unsigned %s[]={\0A\00"
@.str.6 = [39 x i8] c"\090x%.8x , 0x%.8x , 0x%.8x , 0x%.8x\0A};\0A\00"
@.str.7 = [37 x i8] c"\090x%.8x , 0x%.8x , 0x%.8x , 0x%.8x,\0A\00"
@str = [12 x i8] c"convert ok!\00"
@str.9 = [26 x i8] c"error - file open failed!\00"
@str.10 = [24 x i8] c";======= help =========\00"
@str.11 = [54 x i8] c"format: cmd <table name> <binary file> <output file>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [512 x i8]
%4 = alloca [4 x i32]
%5 = icmp eq i32 %0, 4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.10, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.11, i64 0, i64 0))
br label %75
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8*, i8** %1, i64 3
%15 = load i8*, i8** %14
%16 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%17 = tail call i32* @fopen(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%18 = tail call i32* @fopen(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%19 = icmp eq i32* %17, null
%20 = icmp eq i32* %18, null
%21 = or i1 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %9
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.9, i64 0, i64 0))
br label %68
24: ; preds = %9
%25 = bitcast [4 x i32]* %4 to i8*
%26 = call i32 (i8*, i8*, ...) @sprintf(i8* %16, i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* %11)
%27 = call i32 @strlen(i8* %16)
%28 = call i32 @fwrite(i8* %16, i32 %27, i32 1, i32* %18)
%29 = call i32 @fread(i8* %25, i32 1, i32 16, i32* %17)
%30 = icmp sgt i32 %29, 0
br i1 %30, label %31, label %54
31: ; preds = %24
%32 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%33 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 1
%34 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 2
%35 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 3
br label %36
36: ; preds = %31, %36
%37 = phi i32 [ %29, %31 ], [ %50, %36 ]
%38 = phi i32 [ 0, %31 ], [ %45, %36 ]
%39 = icmp eq i32 %37, 16
%40 = load i32, i32* %32
%41 = load i32, i32* %33
%42 = load i32, i32* %34
%43 = load i32, i32* %35
%44 = select i1 %39, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0)
%45 = select i1 %39, i32 %38, i32 1
%46 = call i32 (i8*, i8*, ...) @sprintf(i8* %16, i8* dereferenceable(1) %44, i32 %40, i32 %41, i32 %42, i32 %43)
%47 = call i32 @strlen(i8* %16)
%48 = call i32 @fwrite(i8* %16, i32 %47, i32 1, i32* %18)
%49 = call i32 @memset(i8* %25, i32 0, i32 16)
%50 = call i32 @fread(i8* %25, i32 1, i32 16, i32* %17)
%51 = icmp sgt i32 %50, 0
br i1 %51, label %36, label %52
52: ; preds = %36
%53 = icmp eq i32 %45, 0
br i1 %53, label %54, label %66
54: ; preds = %24, %52
%55 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%56 = load i32, i32* %55
%57 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 1
%58 = load i32, i32* %57
%59 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 2
%60 = load i32, i32* %59
%61 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 3
%62 = load i32, i32* %61
%63 = call i32 (i8*, i8*, ...) @sprintf(i8* %16, i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0), i32 %56, i32 %58, i32 %60, i32 %62)
%64 = call i32 @strlen(i8* %16)
%65 = call i32 @fwrite(i8* %16, i32 %64, i32 1, i32* %18)
br label %66
66: ; preds = %54, %52
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %68
68: ; preds = %66, %22
br i1 %19, label %71, label %69
69: ; preds = %68
%70 = call i32 @fclose(i32* %17)
br label %71
71: ; preds = %69, %68
br i1 %20, label %74, label %72
72: ; preds = %71
%73 = call i32 @fclose(i32* %18)
br label %74
74: ; preds = %72, %71
br label %75
75: ; preds = %74, %6
ret i32 0
}