#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 */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char, unsigned char, int);
int read_dat(char const *, unsigned char *, int);
int takeDataPacket(const char *filename, unsigned char *data, char *packet) {
  unsigned char buffer[32 * 1024];
  int i = 0, index = 0, j = 0;
  int size = read_dat(filename, buffer, 32 * 1024);
  unsigned char header[32] = {'V',  0x0,  0x86, 0x18, 0x64, 0x33, 0x87, 0x42,
                              0x90, 0x15, 0x09, 0x00, 0x02, 0x0,  0x0,  0x0,
                              0x0,  0x0,  0x0,  0x0,  0x0,  0x0,  0x0,  0x0,
                              0x0,  0x0,  0x0,  0x0,  0x0,  0x0,  0x0,  0x0};
  for (i = 0; i < 8; i++) {
    header[i + 1] = packet[i];
  }
  if (size % (1024 - 32)) {
    header[29] = size / (1024 - 32) + 1;
  } else {
    header[29] = size / (1024 - 32);
  }
  for (i = 0; i < size / (1024 - 32); i++) {
    header[13] = i;
    header[30] = (1024 - 32) / 256;
    header[31] = (1024 - 32) % 256;
    printf("header[30]: %d, header[31]:%d, total:%d\n", header[30], header[31],
           (1024 - 32));
    for (j = 0; j < 32; j++) {
      data[index++] = header[j];
    }
    for (j = 0; j < (1024 - 32); j++) {
      data[index++] = buffer[i * (1024 - 32) + j];
    }
  }
  if (size % (1024 - 32)) {
    header[13] = i;
    header[30] = (size % (1024 - 32)) / 256;
    header[31] = (size % (1024 - 32)) % 256;
    printf("header[30]: %d, header[31]:%d, total:%d\n", header[30], header[31],
           (size % (1024 - 32)));
    for (j = 0; j < 32; j++) {
      data[index++] = header[j];
    }
    for (j = 0; j < (size % (1024 - 32)); j++) {
      data[index++] = buffer[i * (1024 - 32) + j];
    }
  }
  return index;
}


x86 assembly (clang, -O0):
<takeDataPacket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x8060,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x8024(%rbp)
movl   $0x0,-0x8028(%rbp)
movl   $0x0,-0x802c(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x8020(%rbp),%rsi
mov    $0x8000,%edx
call   1040 <read_dat@plt>
mov    %eax,-0x8030(%rbp)
mov    0xe89(%rip),%rax
mov    %rax,-0x8050(%rbp)
mov    0xe83(%rip),%rax
mov    %rax,-0x8048(%rbp)
mov    0xe7d(%rip),%rax
mov    %rax,-0x8040(%rbp)
mov    0xe77(%rip),%rax
mov    %rax,-0x8038(%rbp)
movl   $0x0,-0x8024(%rbp)
cmpl   $0x8,-0x8024(%rbp)
jge    11f3 <takeDataPacket+0xd3>
mov    -0x18(%rbp),%rax
movslq -0x8024(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x8024(%rbp),%eax
add    $0x1,%eax
cltq
mov    %cl,-0x8050(%rbp,%rax,1)
mov    -0x8024(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8024(%rbp)
jmp    11b2 <takeDataPacket+0x92>
mov    -0x8030(%rbp),%eax
mov    $0x3e0,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1226 <takeDataPacket+0x106>
mov    -0x8030(%rbp),%eax
mov    $0x3e0,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %al,-0x8033(%rbp)
jmp    123a <takeDataPacket+0x11a>
mov    -0x8030(%rbp),%eax
mov    $0x3e0,%ecx
cltd
idiv   %ecx
mov    %al,-0x8033(%rbp)
movl   $0x0,-0x8024(%rbp)
mov    -0x8024(%rbp),%eax
mov    %eax,-0x8054(%rbp)
mov    -0x8030(%rbp),%eax
mov    $0x3e0,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8054(%rbp),%eax
cmp    %ecx,%eax
jge    1378 <takeDataPacket+0x258>
mov    -0x8024(%rbp),%eax
mov    %al,-0x8043(%rbp)
movb   $0x3,-0x8032(%rbp)
movb   $0xe0,-0x8031(%rbp)
mov    -0x8032(%rbp),%al
lea    0xd8b(%rip),%rdi
mov    $0x3e0,%ecx
movzbl %al,%esi
movzbl -0x8031(%rbp),%edx
call   1030 <printf@plt>
movl   $0x0,-0x802c(%rbp)
cmpl   $0x20,-0x802c(%rbp)
jge    12fd <takeDataPacket+0x1dd>
movslq -0x802c(%rbp),%rax
mov    -0x8050(%rbp,%rax,1),%dl
mov    -0x10(%rbp),%rax
mov    -0x8028(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x8028(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x802c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x802c(%rbp)
jmp    12b3 <takeDataPacket+0x193>
movl   $0x0,-0x802c(%rbp)
cmpl   $0x3e0,-0x802c(%rbp)
jge    135f <takeDataPacket+0x23f>
imul   $0x3e0,-0x8024(%rbp),%eax
add    -0x802c(%rbp),%eax
cltq
mov    -0x8020(%rbp,%rax,1),%dl
mov    -0x10(%rbp),%rax
mov    -0x8028(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x8028(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x802c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x802c(%rbp)
jmp    1307 <takeDataPacket+0x1e7>
jmp    1364 <takeDataPacket+0x244>
mov    -0x8024(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8024(%rbp)
jmp    1244 <takeDataPacket+0x124>
mov    -0x8030(%rbp),%eax
mov    $0x3e0,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     14f2 <takeDataPacket+0x3d2>
mov    -0x8024(%rbp),%eax
mov    %al,-0x8043(%rbp)
mov    -0x8030(%rbp),%eax
mov    $0x3e0,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %al,-0x8032(%rbp)
mov    -0x8030(%rbp),%eax
mov    $0x3e0,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x8031(%rbp)
mov    -0x8032(%rbp),%al
mov    %al,-0x8055(%rbp)
mov    -0x8031(%rbp),%al
mov    %al,-0x8056(%rbp)
mov    -0x8030(%rbp),%eax
mov    $0x3e0,%ecx
cltd
idiv   %ecx
mov    -0x8056(%rbp),%al
mov    %edx,%ecx
mov    -0x8055(%rbp),%dl
lea    0xc0c(%rip),%rdi
movzbl %dl,%esi
movzbl %al,%edx
call   1030 <printf@plt>
movl   $0x0,-0x802c(%rbp)
cmpl   $0x20,-0x802c(%rbp)
jge    1473 <takeDataPacket+0x353>
movslq -0x802c(%rbp),%rax
mov    -0x8050(%rbp,%rax,1),%dl
mov    -0x10(%rbp),%rax
mov    -0x8028(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x8028(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x802c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x802c(%rbp)
jmp    1429 <takeDataPacket+0x309>
movl   $0x0,-0x802c(%rbp)
mov    -0x802c(%rbp),%eax
mov    %eax,-0x805c(%rbp)
mov    -0x8030(%rbp),%eax
mov    $0x3e0,%ecx
cltd
idiv   %ecx
mov    -0x805c(%rbp),%eax
cmp    %edx,%eax
jge    14ed <takeDataPacket+0x3cd>
imul   $0x3e0,-0x8024(%rbp),%eax
add    -0x802c(%rbp),%eax
cltq
mov    -0x8020(%rbp,%rax,1),%dl
mov    -0x10(%rbp),%rax
mov    -0x8028(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x8028(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x802c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x802c(%rbp)
jmp    147d <takeDataPacket+0x35d>
jmp    14f2 <takeDataPacket+0x3d2>
mov    -0x8028(%rbp),%eax
add    $0x8060,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<takeDataPacket>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x8028,%rsp
mov    %rdx,%rbx
mov    %rsi,%r15
lea    0x20(%rsp),%r12
mov    %r12,%rsi
mov    $0x8000,%edx
call   1050 <read_dat@plt>
mov    0xea5(%rip),%rcx
mov    %rcx,0x5(%rsp)
mov    0xe94(%rip),%rcx
mov    %rcx,(%rsp)
mov    (%rbx),%rcx
mov    %rcx,0x1(%rsp)
cltq
imul   $0xffffffff84210843,%rax,%r14
shr    $0x20,%r14
add    %eax,%r14d
mov    %r14d,%ecx
shr    $0x1f,%ecx
sar    $0x9,%r14d
add    %ecx,%r14d
imul   $0x3e0,%r14d,%ecx
mov    %eax,%edx
sub    %ecx,%edx
mov    %rdx,0x18(%rsp)
setne  %bpl
add    %r14b,%bpl
xor    %ebx,%ebx
mov    $0x0,%ecx
cmp    $0x3e0,%eax
jl     125f <takeDataPacket+0x12f>
xor    %r13d,%r13d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0xe49(%rip),%rdi
mov    $0x3,%esi
mov    $0xe0,%edx
mov    $0x3e0,%ecx
call   1030 <printf@plt>
movslq %ebx,%rax
mov    (%rsp),%rcx
mov    0x5(%rsp),%rdx
mov    %rcx,(%r15,%rax,1)
mov    %rdx,0x5(%r15,%rax,1)
mov    %r13b,0xd(%r15,%rax,1)
mov    0xe02(%rip),%rcx
mov    %rcx,0xe(%r15,%rax,1)
mov    0xdfd(%rip),%rcx
mov    %rcx,0x15(%r15,%rax,1)
mov    %bpl,0x1d(%r15,%rax,1)
movw   $0xe003,0x1e(%r15,%rax,1)
e0
add    $0x20,%eax
movslq %eax,%rbx
lea    (%r15,%rbx,1),%rdi
mov    $0x3e0,%edx
mov    %r12,%rsi
call   1040 <memcpy@plt>
add    $0x3e0,%rbx
add    $0x1,%r13
add    $0x3e0,%r12
cmp    %r13,%r14
jne    11d0 <takeDataPacket+0xa0>
mov    %r14d,%ecx
mov    0x18(%rsp),%r14
test   %r14d,%r14d
je     1313 <takeDataPacket+0x1e3>
lea    0xff(%r14),%eax
test   %r14d,%r14d
cmovns %r14d,%eax
sar    $0x8,%eax
movzbl %al,%r13d
movzbl %r14b,%r12d
lea    0xd93(%rip),%rdi
mov    %ecx,0x14(%rsp)
mov    %r13d,%esi
mov    %r12d,%edx
mov    %r14d,%ecx
call   1030 <printf@plt>
movslq %ebx,%rcx
lea    0x20(%rcx),%rax
mov    (%rsp),%rdx
mov    0x5(%rsp),%rsi
mov    %rdx,(%r15,%rcx,1)
mov    %rsi,0x5(%r15,%rcx,1)
mov    0x14(%rsp),%esi
mov    %sil,0xd(%r15,%rcx,1)
mov    0xd46(%rip),%rdx
mov    %rdx,0xe(%r15,%rcx,1)
mov    0xd41(%rip),%rdx
mov    %rdx,0x15(%r15,%rcx,1)
mov    %bpl,0x1d(%r15,%rcx,1)
mov    %r13b,0x1e(%r15,%rcx,1)
mov    %r12b,0x1f(%r15,%rcx,1)
test   %r14d,%r14d
jle    1311 <takeDataPacket+0x1e1>
imul   $0x3e0,%esi,%ecx
add    %rax,%r15
lea    (%rsp,%rcx,1),%rsi
add    $0x20,%rsi
mov    %r14d,%edx
mov    %r15,%rdi
call   1040 <memcpy@plt>
add    %r14d,%ebx
add    $0x20,%ebx
jmp    1313 <takeDataPacket+0x1e3>
mov    %eax,%ebx
mov    %ebx,%eax
add    $0x8028,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.takeDataPacket.header = <{ [13 x i8], [19 x i8] }> <{ [13 x i8] c"V\00\86\18d3\87B\90\15\09\00\02", [19 x i8] zeroinitializer }>
@.str = [41 x i8] c"header[30]: %d, header[31]:%d, total:%d\0A\00"
define i32 @takeDataPacket(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [32768 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [32 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
%13 = load i8*, i8** %4
%14 = getelementptr inbounds [32768 x i8], [32768 x i8]* %7, i64 0, i64 0
%15 = call i32 @read_dat(i8* %13, i8* %14, i32 32768)
store i32 %15, i32* %11
%16 = bitcast [32 x i8]* %12 to i8*
store i32 0, i32* %8
br label %17
17: ; preds = %30, %3
%18 = load i32, i32* %8
%19 = icmp slt i32 %18, 8
br i1 %19, label %20, label %33
20: ; preds = %17
%21 = load i8*, i8** %6
%22 = load i32, i32* %8
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i8, i8* %24
%26 = load i32, i32* %8
%27 = add nsw i32 %26, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [32 x i8], [32 x i8]* %12, i64 0, i64 %28
store i8 %25, i8* %29
br label %30
30: ; preds = %20
%31 = load i32, i32* %8
%32 = add nsw i32 %31, 1
store i32 %32, i32* %8
br label %17
33: ; preds = %17
%34 = load i32, i32* %11
%35 = srem i32 %34, 992
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %43
37: ; preds = %33
%38 = load i32, i32* %11
%39 = sdiv i32 %38, 992
%40 = add nsw i32 %39, 1
%41 = trunc i32 %40 to i8
%42 = getelementptr inbounds [32 x i8], [32 x i8]* %12, i64 0, i64 29
store i8 %41, i8* %42
br label %48
43: ; preds = %33
%44 = load i32, i32* %11
%45 = sdiv i32 %44, 992
%46 = trunc i32 %45 to i8
%47 = getelementptr inbounds [32 x i8], [32 x i8]* %12, i64 0, i64 29
store i8 %46, i8* %47
br label %48
48: ; preds = %43, %37
store i32 0, i32* %8
br label %49
49: ; preds = %102, %48
%50 = load i32, i32* %8
%51 = load i32, i32* %11
%52 = sdiv i32 %51, 992
%53 = icmp slt i32 %50, %52
br i1 %53, label %54, label %105
54: ; preds = %49
%55 = load i32, i32* %8
%56 = trunc i32 %55 to i8
%57 = getelementptr inbounds [32 x i8], [32 x i8]* %12, i64 0, i64 13
store i8 %56, i8* %57
%58 = getelementptr inbounds [32 x i8], [32 x i8]* %12, i64 0, i64 30
store i8 3, i8* %58
%59 = getelementptr inbounds [32 x i8], [32 x i8]* %12, i64 0, i64 31
store i8 -32, i8* %59
%60 = getelementptr inbounds [32 x i8], [32 x i8]* %12, i64 0, i64 30
%61 = load i8, i8* %60
%62 = getelementptr inbounds [32 x i8], [32 x i8]* %12, i64 0, i64 31
%63 = load i8, i8* %62
%64 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8 zeroext %61, i8 zeroext %63, i32 992)
store i32 0, i32* %10
br label %65
65: ; preds = %78, %54
%66 = load i32, i32* %10
%67 = icmp slt i32 %66, 32
br i1 %67, label %68, label %81
68: ; preds = %65
%69 = load i32, i32* %10
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [32 x i8], [32 x i8]* %12, i64 0, i64 %70
%72 = load i8, i8* %71
%73 = load i8*, i8** %5
%74 = load i32, i32* %9
%75 = add nsw i32 %74, 1
store i32 %75, i32* %9
%76 = sext i32 %74 to i64
%77 = getelementptr inbounds i8, i8* %73, i64 %76
store i8 %72, i8* %77
br label %78
78: ; preds = %68
%79 = load i32, i32* %10
%80 = add nsw i32 %79, 1
store i32 %80, i32* %10
br label %65
81: ; preds = %65
store i32 0, i32* %10
br label %82
82: ; preds = %98, %81
%83 = load i32, i32* %10
%84 = icmp slt i32 %83, 992
br i1 %84, label %85, label %101
85: ; preds = %82
%86 = load i32, i32* %8
%87 = mul nsw i32 %86, 992
%88 = load i32, i32* %10
%89 = add nsw i32 %87, %88
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [32768 x i8], [32768 x i8]* %7, i64 0, i64 %90
%92 = load i8, i8* %91
%93 = load i8*, i8** %5
%94 = load i32, i32* %9
%95 = add nsw i32 %94, 1
store i32 %95, i32* %9
%96 = sext i32 %94 to i64
%97 = getelementptr inbounds i8, i8* %93, i64 %96
store i8 %92, i8* %97
br label %98
98: ; preds = %85
%99 = load i32, i32* %10
%100 = add nsw i32 %99, 1
store i32 %100, i32* %10
br label %82
101: ; preds = %82
br label %102
102: ; preds = %101
%103 = load i32, i32* %8
%104 = add nsw i32 %103, 1
store i32 %104, i32* %8
br label %49
105: ; preds = %49
%106 = load i32, i32* %11
%107 = srem i32 %106, 992
%108 = icmp ne i32 %107, 0
br i1 %108, label %109, label %169
109: ; preds = %105
%110 = load i32, i32* %8
%111 = trunc i32 %110 to i8
%112 = getelementptr inbounds [32 x i8], [32 x i8]* %12, i64 0, i64 13
store i8 %111, i8* %112
%113 = load i32, i32* %11
%114 = srem i32 %113, 992
%115 = sdiv i32 %114, 256
%116 = trunc i32 %115 to i8
%117 = getelementptr inbounds [32 x i8], [32 x i8]* %12, i64 0, i64 30
store i8 %116, i8* %117
%118 = load i32, i32* %11
%119 = srem i32 %118, 992
%120 = srem i32 %119, 256
%121 = trunc i32 %120 to i8
%122 = getelementptr inbounds [32 x i8], [32 x i8]* %12, i64 0, i64 31
store i8 %121, i8* %122
%123 = getelementptr inbounds [32 x i8], [32 x i8]* %12, i64 0, i64 30
%124 = load i8, i8* %123
%125 = getelementptr inbounds [32 x i8], [32 x i8]* %12, i64 0, i64 31
%126 = load i8, i8* %125
%127 = load i32, i32* %11
%128 = srem i32 %127, 992
%129 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8 zeroext %124, i8 zeroext %126, i32 %128)
store i32 0, i32* %10
br label %130
130: ; preds = %143, %109
%131 = load i32, i32* %10
%132 = icmp slt i32 %131, 32
br i1 %132, label %133, label %146
133: ; preds = %130
%134 = load i32, i32* %10
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds [32 x i8], [32 x i8]* %12, i64 0, i64 %135
%137 = load i8, i8* %136
%138 = load i8*, i8** %5
%139 = load i32, i32* %9
%140 = add nsw i32 %139, 1
store i32 %140, i32* %9
%141 = sext i32 %139 to i64
%142 = getelementptr inbounds i8, i8* %138, i64 %141
store i8 %137, i8* %142
br label %143
143: ; preds = %133
%144 = load i32, i32* %10
%145 = add nsw i32 %144, 1
store i32 %145, i32* %10
br label %130
146: ; preds = %130
store i32 0, i32* %10
br label %147
147: ; preds = %165, %146
%148 = load i32, i32* %10
%149 = load i32, i32* %11
%150 = srem i32 %149, 992
%151 = icmp slt i32 %148, %150
br i1 %151, label %152, label %168
152: ; preds = %147
%153 = load i32, i32* %8
%154 = mul nsw i32 %153, 992
%155 = load i32, i32* %10
%156 = add nsw i32 %154, %155
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds [32768 x i8], [32768 x i8]* %7, i64 0, i64 %157
%159 = load i8, i8* %158
%160 = load i8*, i8** %5
%161 = load i32, i32* %9
%162 = add nsw i32 %161, 1
store i32 %162, i32* %9
%163 = sext i32 %161 to i64
%164 = getelementptr inbounds i8, i8* %160, i64 %163
store i8 %159, i8* %164
br label %165
165: ; preds = %152
%166 = load i32, i32* %10
%167 = add nsw i32 %166, 1
store i32 %167, i32* %10
br label %147
168: ; preds = %147
br label %169
169: ; preds = %168, %105
%170 = load i32, i32* %9
ret i32 %170
}

LLVM IR (-O2):
@__const.takeDataPacket.header = <{ [13 x i8], [19 x i8] }> <{ [13 x i8] c"V\00\86\18d3\87B\90\15\09\00\02", [19 x i8] zeroinitializer }>
@.str = [41 x i8] c"header[30]: %d, header[31]:%d, total:%d\0A\00"
define i32 @takeDataPacket(i8* %0, i8* nocapture writeonly %1, i8* nocapture %2) {
%4 = alloca [32768 x i8]
%5 = alloca [13 x i8]
%6 = getelementptr inbounds [32768 x i8], [32768 x i8]* %4, i64 0, i64 0
%7 = call i32 @read_dat(i8* %0, i8* %6, i32 32768)
%8 = getelementptr inbounds [13 x i8], [13 x i8]* %5, i64 0, i64 0
%9 = getelementptr inbounds [13 x i8], [13 x i8]* %5, i64 0, i64 1
%10 = bitcast i8* %2 to i64*
%11 = bitcast i8* %9 to i64*
%12 = load i64, i64* %10
store i64 %12, i64* %11
%13 = srem i32 %7, 992
%14 = icmp eq i32 %13, 0
%15 = sdiv i32 %7, 992
%16 = trunc i32 %15 to i8
%17 = xor i1 %14, true
%18 = zext i1 %17 to i8
%19 = add i8 %16, %18
%20 = icmp sgt i32 %7, 991
br i1 %20, label %21, label %47
21: ; preds = %3
%22 = zext i32 %15 to i64
br label %23
23: ; preds = %21, %23
%24 = phi i64 [ 0, %21 ], [ %43, %23 ]
%25 = phi i64 [ 0, %21 ], [ %42, %23 ]
%26 = mul nuw nsw i64 %24, 992
%27 = getelementptr [32768 x i8], [32768 x i8]* %4, i64 0, i64 %26
%28 = trunc i64 %24 to i8
%29 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8 zeroext 3, i8 zeroext -32, i32 992)
%30 = shl i64 %25, 32
%31 = ashr exact i64 %30, 32
%32 = getelementptr i8, i8* %1, i64 %31
%33 = getelementptr inbounds i8, i8* %32, i64 13
store i8 %28, i8* %33
%34 = getelementptr inbounds i8, i8* %32, i64 14
%35 = getelementptr inbounds i8, i8* %32, i64 29
store i8 %19, i8* %35
%36 = getelementptr inbounds i8, i8* %32, i64 30
store i8 3, i8* %36
%37 = getelementptr inbounds i8, i8* %32, i64 31
store i8 -32, i8* %37
%38 = shl i64 %25, 32
%39 = add i64 %38, 137438953472
%40 = ashr exact i64 %39, 32
%41 = getelementptr i8, i8* %1, i64 %40
%42 = add nsw i64 %40, 992
%43 = add nuw nsw i64 %24, 1
%44 = icmp eq i64 %43, %22
br i1 %44, label %45, label %23
45: ; preds = %23
%46 = trunc i64 %42 to i32
br label %47
47: ; preds = %45, %3
%48 = phi i32 [ 0, %3 ], [ %46, %45 ]
%49 = phi i32 [ 0, %3 ], [ %15, %45 ]
br i1 %14, label %75, label %50
50: ; preds = %47
%51 = trunc i32 %49 to i8
%52 = sdiv i32 %13, 256
%53 = trunc i32 %52 to i8
%54 = trunc i32 %13 to i8
%55 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8 zeroext %53, i8 zeroext %54, i32 %13)
%56 = sext i32 %48 to i64
%57 = getelementptr i8, i8* %1, i64 %56
%58 = getelementptr inbounds i8, i8* %57, i64 13
store i8 %51, i8* %58
%59 = getelementptr inbounds i8, i8* %57, i64 14
%60 = getelementptr inbounds i8, i8* %57, i64 29
store i8 %19, i8* %60
%61 = getelementptr inbounds i8, i8* %57, i64 30
store i8 %53, i8* %61
%62 = getelementptr inbounds i8, i8* %57, i64 31
store i8 %54, i8* %62
%63 = add nsw i64 %56, 32
%64 = trunc i64 %63 to i32
%65 = icmp sgt i32 %13, 0
br i1 %65, label %66, label %75
66: ; preds = %50
%67 = mul nsw i32 %49, 992
%68 = getelementptr i8, i8* %1, i64 %63
%69 = zext i32 %67 to i64
%70 = getelementptr [32768 x i8], [32768 x i8]* %4, i64 0, i64 %69
%71 = zext i32 %13 to i64
%72 = add nsw i32 %13, -1
%73 = add i32 %48, %72
%74 = add i32 %73, 33
br label %75
75: ; preds = %66, %50, %47
%76 = phi i32 [ %48, %47 ], [ %64, %50 ], [ %74, %66 ]
ret i32 %76
}