#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*/ O_RDONLY;
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
unsigned long lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int read(int, unsigned char *, int);
int main(int argc, char *argv[]) {
  int fdi, j, ret;
  unsigned char buf[4096];
  unsigned long l;
  FILE *fdo;
  if (argc < 2) {
    printf("bin2hex sourcefile dstfile\n");
    exit(1);
  }
  fdi = open(argv[1], O_RDONLY);
  if (fdi < 0) {
    printf("fdi err\n");
    exit(1);
  }
  l = lseek(fdi, 0, SEEK_END);
  lseek(fdi, 0, SEEK_SET);
  fdo = fopen(argv[2], "w");
  if (fdo < 0) {
    printf("fdo err\n");
    exit(1);
  }
  fprintf(fdo, "/* Auto generated hex data from file:\n * %s\n */\n", argv[1]);
  fprintf(fdo, "const unsigned char imapfb_oem_logo_data[0x%lx] = {\n",
          l * 2 / 3);
  while (1) {
    if ((ret = read(fdi, buf, 24))) {
      fprintf(fdo, "\t");
      for (j = 0; j < ret; j++)
        if (!(j % 3)) {
          fprintf(
              fdo, "0x%02x, ",
              (unsigned char)((unsigned char)(64.0 * buf[j + 1] / 256.0) << 5) |
                  ((unsigned char)(32.0 * buf[j + 2] / 256.0)));
          fprintf(fdo, "0x%02x, ",
                  (unsigned char)((unsigned char)(32.0 * buf[j] / 256.0) << 3) |
                      ((unsigned char)(64.0 * buf[j + 1] / 256.0) >> 3));
        }
      fprintf(fdo, "\n");
      if (ret % 3)
        printf("warning: the source may be not 888.\n");
    } else
      break;
  }
  fprintf(fdo, "};");
  fclose(fdo);
  close(fdi);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1050,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11c9 <main+0x39>
lea    0xe5e(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2e08(%rip),%rax
mov    (%rax),%esi
call   1090 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1202 <main+0x72>
lea    0xe41(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x14(%rbp),%edi
mov    0x2ddc(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <lseek@plt>
mov    %rax,-0x1028(%rbp)
mov    -0x14(%rbp),%edi
mov    0x2daa(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <lseek@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdff(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x1030(%rbp)
cmpq   $0x0,-0x1030(%rbp)
jae    126e <main+0xde>
lea    0xde0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x1030(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xdc4(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x1030(%rbp),%rdi
mov    -0x1028(%rbp),%rax
shl    $0x1,%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rdx
lea    0xdc8(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x14(%rbp),%edi
lea    -0x1020(%rbp),%rsi
mov    $0x18,%edx
call   1070 <read@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1452 <main+0x2c2>
mov    -0x1030(%rbp),%rdi
lea    0xdc8(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1418 <main+0x288>
mov    -0x18(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1405 <main+0x275>
mov    -0x1030(%rbp),%rdi
movslq -0x18(%rbp),%rcx
lea    -0x1020(%rbp),%rdx
movzbl 0x1(%rcx,%rdx,1),%eax
cvtsi2sd %eax,%xmm0
movsd  0xcc9(%rip),%xmm1
movsd  %xmm1,-0x1040(%rbp)
ff
mulsd  %xmm1,%xmm0
movsd  0xcbd(%rip),%xmm1
movsd  %xmm1,-0x1038(%rbp)
ff
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
shl    $0x5,%eax
movzbl 0x2(%rcx,%rdx,1),%ecx
cvtsi2sd %ecx,%xmm0
movsd  0xca1(%rip),%xmm2
movsd  %xmm2,-0x1048(%rbp)
ff
mulsd  %xmm2,%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
or     %ecx,%eax
movzbl %al,%edx
lea    0xd21(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
movsd  -0x1048(%rbp),%xmm3
ff
movsd  -0x1040(%rbp),%xmm2
ff
movsd  -0x1038(%rbp),%xmm1
ff
mov    -0x1030(%rbp),%rdi
movslq -0x18(%rbp),%rax
movzbl -0x1020(%rbp,%rax,1),%ecx
ff
cvtsi2sd %ecx,%xmm0
mulsd  %xmm3,%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
shl    $0x3,%ecx
movzbl %cl,%edx
movzbl -0x101f(%rbp,%rax,1),%eax
ff
cvtsi2sd %eax,%xmm0
mulsd  %xmm2,%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
movzbl %al,%eax
sar    $0x3,%eax
or     %eax,%edx
lea    0xcb2(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    140a <main+0x27a>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12f4 <main+0x164>
mov    -0x1030(%rbp),%rdi
lea    0xcb6(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x1c(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     144d <main+0x2bd>
lea    0xc71(%rip),%rdi
call   1040 <printf@plt>
jmp    1457 <main+0x2c7>
jmp    145c <main+0x2cc>
jmp    12b8 <main+0x128>
mov    -0x1030(%rbp),%rdi
lea    0xc74(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x1030(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x14(%rbp),%edi
call   1060 <close@plt>
xor    %eax,%eax
add    $0x1050,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1018,%rsp
cmp    $0x1,%edi
jle    1437 <main+0x287>
mov    %rsi,%r15
mov    0x8(%rsi),%rdi
mov    0x2e08(%rip),%rax
mov    (%rax),%esi
call   10a0 <open@plt>
test   %eax,%eax
js     1440 <main+0x290>
mov    %eax,%r12d
mov    0x2df7(%rip),%rax
mov    (%rax),%edx
mov    %r12d,%edi
xor    %esi,%esi
call   1050 <lseek@plt>
mov    %rax,%r14
mov    0x2dc9(%rip),%rax
mov    (%rax),%edx
mov    %r12d,%edi
xor    %esi,%esi
call   1050 <lseek@plt>
mov    0x10(%r15),%rdi
lea    0xdfa(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%rbx
mov    0x8(%r15),%rdx
lea    0xde9(%rip),%rsi
mov    %rax,%rdi
xor    %eax,%eax
call   1090 <fprintf@plt>
add    %r14,%r14
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mov    %r14,%rax
mul    %rcx
shr    %rdx
lea    0xdf3(%rip),%rsi
mov    %rbx,0x8(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1090 <fprintf@plt>
lea    0x10(%rsp),%rsi
mov    %r12d,%edi
mov    $0x18,%edx
call   1080 <read@plt>
test   %eax,%eax
je     13f5 <main+0x245>
mov    %eax,%ebx
mov    $0xaaaaaaab,%ebp
mov    %r12d,0x4(%rsp)
jmp    12b1 <main+0x101>
nop
mov    0x4(%rsp),%r12d
mov    %r12d,%edi
lea    0x10(%rsp),%rsi
mov    $0x18,%edx
call   1080 <read@plt>
mov    %eax,%ebx
test   %eax,%eax
je     13f5 <main+0x245>
mov    $0x9,%edi
mov    0x8(%rsp),%r14
mov    %r14,%rsi
call   1070 <fputc@plt>
mov    %ebx,(%rsp)
test   %ebx,%ebx
mov    %r14,%rbx
jle    13c0 <main+0x210>
mov    (%rsp),%r15d
xor    %r14d,%r14d
jmp    12ec <main+0x13c>
nopw   0x0(%rax,%rax,1)
mov    %r13,%r14
cmp    %r13,%r15
je     13c0 <main+0x210>
mov    %r14d,%eax
imul   %rbp,%rax
shr    $0x21,%rax
lea    (%rax,%rax,2),%eax
lea    0x1(%r14),%r13
cmp    %eax,%r14d
jne    12e0 <main+0x130>
movzbl 0x11(%rsp,%r14,1),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xce8(%rip),%xmm0
movsd  0xce8(%rip),%xmm1
mulsd  %xmm1,%xmm0
movapd %xmm1,%xmm2
cvttsd2si %xmm0,%ebp
mov    %ebp,%eax
shl    $0x5,%al
movzbl 0x12(%rsp,%r14,1),%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
movsd  0xcca(%rip),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
cvttsd2si %xmm0,%ecx
or     %al,%cl
movzbl %cl,%edx
mov    %rbx,%rdi
lea    0xd1f(%rip),%r12
mov    %r12,%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
movzbl 0x10(%rsp,%r14,1),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xc90(%rip),%xmm0
mulsd  0xc80(%rip),%xmm0
cvttsd2si %xmm0,%eax
shl    $0x3,%al
shr    $0x3,%bpl
or     %al,%bpl
movzbl %bpl,%edx
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0xaaaaaaab,%ebp
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    12e0 <main+0x130>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
mov    %rbx,%rsi
call   1070 <fputc@plt>
imul   $0xaaaaaaab,(%rsp),%eax
add    $0x2aaaaaaa,%eax
cmp    $0x55555555,%eax
jb     1290 <main+0xe0>
lea    0xca1(%rip),%rdi
call   1030 <puts@plt>
jmp    1290 <main+0xe0>
lea    0xc8d(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    0x8(%rsp),%rbx
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r12d,%edi
call   1060 <close@plt>
xor    %eax,%eax
add    $0x1018,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc7a(%rip),%rdi
jmp    1447 <main+0x297>
lea    0xc69(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"bin2hex sourcefile dstfile\0A\00"
@O_RDONLY = global i32 0
@.str.1 = [9 x i8] c"fdi err\0A\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [9 x i8] c"fdo err\0A\00"
@.str.4 = [49 x i8] c"/* Auto generated hex data from file:\0A * %s\0A */\0A\00"
@.str.5 = [53 x i8] c"const unsigned char imapfb_oem_logo_data[0x%lx] = {\0A\00"
@.str.6 = [2 x i8] c"\09\00"
@.str.7 = [9 x i8] c"0x%02x, \00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [37 x i8] c"warning: the source may be not 888.\0A\00"
@.str.10 = [3 x i8] c"};\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 [4096 x i8]
%10 = alloca i64
%11 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 2
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = load i32, i32* @O_RDONLY
%22 = call i32 @open(i8* %20, i32 %21)
store i32 %22, i32* %6
%23 = load i32, i32* %6
%24 = icmp slt i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %17
%26 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%27 = call i32 @exit(i32 1)
unreachable
28: ; preds = %17
%29 = load i32, i32* %6
%30 = load i32, i32* @SEEK_END
%31 = call i64 @lseek(i32 %29, i32 0, i32 %30)
store i64 %31, i64* %10
%32 = load i32, i32* %6
%33 = load i32, i32* @SEEK_SET
%34 = call i64 @lseek(i32 %32, i32 0, i32 %33)
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 2
%37 = load i8*, i8** %36
%38 = call i32* @fopen(i8* %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %38, i32** %11
%39 = load i32*, i32** %11
%40 = icmp ult i32* %39, null
br i1 %40, label %41, label %44
41: ; preds = %28
%42 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%43 = call i32 @exit(i32 1)
unreachable
44: ; preds = %28
%45 = load i32*, i32** %11
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 1
%48 = load i8*, i8** %47
%49 = call i32 (i32*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0), i8* %48)
%50 = load i32*, i32** %11
%51 = load i64, i64* %10
%52 = mul i64 %51, 2
%53 = udiv i64 %52, 3
%54 = call i32 (i32*, i8*, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.5, i64 0, i64 0), i64 %53)
br label %55
55: ; preds = %44, %142
%56 = load i32, i32* %6
%57 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%58 = call i32 @read(i32 %56, i8* %57, i32 24)
store i32 %58, i32* %8
%59 = icmp ne i32 %58, 0
br i1 %59, label %60, label %141
60: ; preds = %55
%61 = load i32*, i32** %11
%62 = call i32 (i32*, i8*, ...) @fprintf(i32* %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %7
br label %63
63: ; preds = %129, %60
%64 = load i32, i32* %7
%65 = load i32, i32* %8
%66 = icmp slt i32 %64, %65
br i1 %66, label %67, label %132
67: ; preds = %63
%68 = load i32, i32* %7
%69 = srem i32 %68, 3
%70 = icmp ne i32 %69, 0
br i1 %70, label %128, label %71
71: ; preds = %67
%72 = load i32*, i32** %11
%73 = load i32, i32* %7
%74 = add nsw i32 %73, 1
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 %75
%77 = load i8, i8* %76
%78 = zext i8 %77 to i32
%79 = sitofp i32 %78 to double
%80 = fmul double 6.400000e+01, %79
%81 = fdiv double %80, 2.560000e+02
%82 = fptoui double %81 to i8
%83 = zext i8 %82 to i32
%84 = shl i32 %83, 5
%85 = trunc i32 %84 to i8
%86 = zext i8 %85 to i32
%87 = load i32, i32* %7
%88 = add nsw i32 %87, 2
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 %89
%91 = load i8, i8* %90
%92 = zext i8 %91 to i32
%93 = sitofp i32 %92 to double
%94 = fmul double 3.200000e+01, %93
%95 = fdiv double %94, 2.560000e+02
%96 = fptoui double %95 to i8
%97 = zext i8 %96 to i32
%98 = or i32 %86, %97
%99 = call i32 (i32*, i8*, ...) @fprintf(i32* %72, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %98)
%100 = load i32*, i32** %11
%101 = load i32, i32* %7
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 %102
%104 = load i8, i8* %103
%105 = zext i8 %104 to i32
%106 = sitofp i32 %105 to double
%107 = fmul double 3.200000e+01, %106
%108 = fdiv double %107, 2.560000e+02
%109 = fptoui double %108 to i8
%110 = zext i8 %109 to i32
%111 = shl i32 %110, 3
%112 = trunc i32 %111 to i8
%113 = zext i8 %112 to i32
%114 = load i32, i32* %7
%115 = add nsw i32 %114, 1
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 %116
%118 = load i8, i8* %117
%119 = zext i8 %118 to i32
%120 = sitofp i32 %119 to double
%121 = fmul double 6.400000e+01, %120
%122 = fdiv double %121, 2.560000e+02
%123 = fptoui double %122 to i8
%124 = zext i8 %123 to i32
%125 = ashr i32 %124, 3
%126 = or i32 %113, %125
%127 = call i32 (i32*, i8*, ...) @fprintf(i32* %100, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %126)
br label %128
128: ; preds = %71, %67
br label %129
129: ; preds = %128
%130 = load i32, i32* %7
%131 = add nsw i32 %130, 1
store i32 %131, i32* %7
br label %63
132: ; preds = %63
%133 = load i32*, i32** %11
%134 = call i32 (i32*, i8*, ...) @fprintf(i32* %133, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%135 = load i32, i32* %8
%136 = srem i32 %135, 3
%137 = icmp ne i32 %136, 0
br i1 %137, label %138, label %140
138: ; preds = %132
%139 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0))
br label %140
140: ; preds = %138, %132
br label %142
141: ; preds = %55
br label %143
142: ; preds = %140
br label %55
143: ; preds = %141
%144 = load i32*, i32** %11
%145 = call i32 (i32*, i8*, ...) @fprintf(i32* %144, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%146 = load i32*, i32** %11
%147 = call i32 @fclose(i32* %146)
%148 = load i32, i32* %6
%149 = call i32 @close(i32 %148)
ret i32 0
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.2 = [2 x i8] c"w\00"
@.str.4 = [49 x i8] c"/* Auto generated hex data from file:\0A * %s\0A */\0A\00"
@.str.5 = [53 x i8] c"const unsigned char imapfb_oem_logo_data[0x%lx] = {\0A\00"
@.str.7 = [9 x i8] c"0x%02x, \00"
@.str.10 = [3 x i8] c"};\00"
@str = [36 x i8] c"warning: the source may be not 888.\00"
@str.11 = [8 x i8] c"fdi err\00"
@str.12 = [27 x i8] c"bin2hex sourcefile dstfile\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [4096 x i8]
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.12, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = load i32, i32* @O_RDONLY
%13 = tail call i32 @open(i8* %11, i32 %12)
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %9
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.11, i64 0, i64 0))
%17 = tail call i32 @exit(i32 1)
unreachable
18: ; preds = %9
%19 = load i32, i32* @SEEK_END
%20 = tail call i64 @lseek(i32 %13, i32 0, i32 %19)
%21 = load i32, i32* @SEEK_SET
%22 = tail call i64 @lseek(i32 %13, i32 0, i32 %21)
%23 = getelementptr inbounds i8*, i8** %1, i64 2
%24 = load i8*, i8** %23
%25 = tail call i32* @fopen(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%26 = load i8*, i8** %10
%27 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0), i8* %26)
%28 = shl i64 %20, 1
%29 = udiv i64 %28, 3
%30 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.5, i64 0, i64 0), i64 %29)
%31 = call i32 @read(i32 %13, i8* %4, i32 24)
%32 = icmp eq i32 %31, 0
br i1 %32, label %85, label %33
33: ; preds = %18, %82
%34 = phi i32 [ %83, %82 ], [ %31, %18 ]
%35 = tail call i32 @fputc(i32 9, i32* %25)
%36 = icmp sgt i32 %34, 0
br i1 %36, label %37, label %76
37: ; preds = %33
%38 = zext i32 %34 to i64
br label %39
39: ; preds = %37, %74
%40 = phi i64 [ 0, %37 ], [ %44, %74 ]
%41 = trunc i64 %40 to i32
%42 = urem i32 %41, 3
%43 = icmp eq i32 %42, 0
%44 = add nuw nsw i64 %40, 1
br i1 %43, label %45, label %74
45: ; preds = %39
%46 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %44
%47 = load i8, i8* %46
%48 = uitofp i8 %47 to double
%49 = fmul double %48, 6.400000e+01
%50 = fmul double %49, 3.906250e-03
%51 = fptoui double %50 to i8
%52 = shl i8 %51, 5
%53 = add nuw nsw i64 %40, 2
%54 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %53
%55 = load i8, i8* %54
%56 = uitofp i8 %55 to double
%57 = fmul double %56, 3.200000e+01
%58 = fmul double %57, 3.906250e-03
%59 = fptoui double %58 to i8
%60 = or i8 %52, %59
%61 = zext i8 %60 to i32
%62 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %61)
%63 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %40
%64 = load i8, i8* %63
%65 = uitofp i8 %64 to double
%66 = fmul double %65, 3.200000e+01
%67 = fmul double %66, 3.906250e-03
%68 = fptoui double %67 to i8
%69 = shl i8 %68, 3
%70 = lshr i8 %51, 3
%71 = or i8 %69, %70
%72 = zext i8 %71 to i32
%73 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %72)
br label %74
74: ; preds = %39, %45
%75 = icmp eq i64 %44, %38
br i1 %75, label %76, label %39
76: ; preds = %74, %33
%77 = tail call i32 @fputc(i32 10, i32* %25)
%78 = srem i32 %34, 3
%79 = icmp eq i32 %78, 0
br i1 %79, label %82, label %80
80: ; preds = %76
%81 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
br label %82
82: ; preds = %76, %80
%83 = call i32 @read(i32 %13, i8* %4, i32 24)
%84 = icmp eq i32 %83, 0
br i1 %84, label %85, label %33
85: ; preds = %82, %18
%86 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i64 2, i64 1, i32* %25)
%87 = tail call i32 @fclose(i32* %25)
%88 = tail call i32 @close(i32 %13)
ret i32 0
}