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

/* Variables and functions */
int /*<<< orphan*/ buffer_compute(int, char **, char **, char **, char **);
int /*<<< orphan*/ buffer_load(int, int /*<<< orphan*/ *, char **,
                               int /*<<< orphan*/ *, char **);
int /*<<< orphan*/ buffer_store(int, int /*<<< orphan*/ *, char **,
                                int /*<<< orphan*/ *, char **);
void workload(uint64_t *SEQA, uint64_t *SEQB, uint64_t *alignedA,
              uint64_t *alignedB, int num_jobs) {
#pragma HLS INTERFACE m_axi port = SEQA offset = slave bundle = gmem
#pragma HLS INTERFACE m_axi port = SEQB offset = slave bundle = gmem
#pragma HLS INTERFACE m_axi port = alignedA offset = slave bundle = gmem
#pragma HLS INTERFACE m_axi port = alignedB offset = slave bundle = gmem
#pragma HLS INTERFACE s_axilite port = SEQA bundle = control
#pragma HLS INTERFACE s_axilite port = SEQB bundle = control
#pragma HLS INTERFACE s_axilite port = alignedA bundle = control
#pragma HLS INTERFACE s_axilite port = alignedB bundle = control
#pragma HLS INTERFACE s_axilite port = num_jobs bundle = control
#pragma HLS INTERFACE s_axilite port = return bundle = control
  int num_batches = num_jobs / 512;
  char seqA_buf_x[64][128 * ((512) / (64))];
#pragma HLS ARRAY_PARTITION variable = seqA_buf_x complete dim = 1
  char seqA_buf_y[64][128 * ((512) / (64))];
#pragma HLS ARRAY_PARTITION variable = seqA_buf_y complete dim = 1
  char seqB_buf_x[64][128 * ((512) / (64))];
#pragma HLS ARRAY_PARTITION variable = seqB_buf_x complete dim = 1
  char seqB_buf_y[64][128 * ((512) / (64))];
#pragma HLS ARRAY_PARTITION variable = seqB_buf_y complete dim = 1
  char alignedA_buf_x[64][(128 + 128) * ((512) / (64))];
#pragma HLS ARRAY_PARTITION variable = alignedA_buf_x complete dim = 1
  char alignedA_buf_y[64][(128 + 128) * ((512) / (64))];
#pragma HLS ARRAY_PARTITION variable = alignedA_buf_y complete dim = 1
  char alignedB_buf_x[64][(128 + 128) * ((512) / (64))];
#pragma HLS ARRAY_PARTITION variable = alignedB_buf_x complete dim = 1
  char alignedB_buf_y[64][(128 + 128) * ((512) / (64))];
#pragma HLS ARRAY_PARTITION variable = alignedB_buf_y complete dim = 1
  int i;
  for (i = 0; i < num_batches + 2; i++) {
    int load_flag = i >= 0 && i < num_batches;
    int compute_flag = i >= 1 && i < num_batches + 1;
    int store_flag = i >= 2 && i < num_batches + 2;
    if (i % 2 == 0) {
      buffer_compute(compute_flag, seqA_buf_y, seqB_buf_y, alignedA_buf_y,
                     alignedB_buf_y);
      buffer_store(store_flag, alignedA + (i - 2) * (128 + 128) * 512 / 8,
                   alignedA_buf_x, alignedB + (i - 2) * (128 + 128) * 512 / 8,
                   alignedB_buf_x);
      buffer_load(load_flag, SEQA + i * 128 * 512 / 8, seqA_buf_x,
                  SEQB + i * 128 * 512 / 8, seqB_buf_x);
    } else {
      buffer_compute(compute_flag, seqA_buf_x, seqB_buf_x, alignedA_buf_x,
                     alignedB_buf_x);
      buffer_store(store_flag, alignedA + (i - 2) * (128 + 128) * 512 / 8,
                   alignedA_buf_y, alignedB + (i - 2) * (128 + 128) * 512 / 8,
                   alignedB_buf_y);
      buffer_load(load_flag, SEQA + i * 128 * 512 / 8, seqA_buf_y,
                  SEQB + i * 128 * 512 / 8, seqB_buf_y);
    }
  }
  return;
}


x86 assembly (clang, -O0):
<workload>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0070,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x200,%ecx
cltd
idiv   %ecx
mov    %eax,-0x28(%rbp)
movl   $0x0,-0xc0034(%rbp)
mov    -0xc0034(%rbp),%eax
mov    -0x28(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    1468 <workload+0x338>
xor    %eax,%eax
cmpl   $0x0,-0xc0034(%rbp)
mov    %al,-0xc0041(%rbp)
jl     11a2 <workload+0x72>
mov    -0xc0034(%rbp),%eax
cmp    -0x28(%rbp),%eax
setl   %al
mov    %al,-0xc0041(%rbp)
mov    -0xc0041(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc0038(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0xc0034(%rbp)
mov    %al,-0xc0042(%rbp)
jl     11df <workload+0xaf>
mov    -0xc0034(%rbp),%eax
mov    -0x28(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
setl   %al
mov    %al,-0xc0042(%rbp)
mov    -0xc0042(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc003c(%rbp)
xor    %eax,%eax
cmpl   $0x2,-0xc0034(%rbp)
mov    %al,-0xc0043(%rbp)
jl     121c <workload+0xec>
mov    -0xc0034(%rbp),%eax
mov    -0x28(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
setl   %al
mov    %al,-0xc0043(%rbp)
mov    -0xc0043(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc0040(%rbp)
mov    -0xc0034(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    134c <workload+0x21c>
mov    -0xc003c(%rbp),%edi
lea    -0x20030(%rbp),%rsi
lea    -0x40030(%rbp),%rdx
lea    -0x80030(%rbp),%rcx
lea    -0xc0030(%rbp),%r8
call   1040 <buffer_compute@plt>
mov    -0xc0040(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0xc0034(%rbp),%eax
sub    $0x2,%eax
shl    $0x8,%eax
shl    $0x9,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cltq
shl    $0x2,%rax
add    %rax,%rsi
lea    -0x60030(%rbp),%rax
mov    %rax,-0xc0058(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0xc0034(%rbp),%eax
sub    $0x2,%eax
shl    $0x8,%eax
shl    $0x9,%eax
mov    $0x8,%r8d
cltd
idiv   %r8d
mov    -0xc0058(%rbp),%rdx
cltq
shl    $0x2,%rax
add    %rax,%rcx
lea    -0xa0030(%rbp),%r8
call   1050 <buffer_store@plt>
mov    -0xc0038(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc0034(%rbp),%eax
shl    $0x7,%eax
shl    $0x9,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cltq
shl    $0x2,%rax
add    %rax,%rsi
lea    -0x10030(%rbp),%rax
mov    %rax,-0xc0050(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0xc0034(%rbp),%eax
shl    $0x7,%eax
shl    $0x9,%eax
mov    $0x8,%r8d
cltd
idiv   %r8d
mov    -0xc0050(%rbp),%rdx
cltq
shl    $0x2,%rax
add    %rax,%rcx
lea    -0x30030(%rbp),%r8
call   1030 <buffer_load@plt>
jmp    144f <workload+0x31f>
mov    -0xc003c(%rbp),%edi
lea    -0x10030(%rbp),%rsi
lea    -0x30030(%rbp),%rdx
lea    -0x60030(%rbp),%rcx
lea    -0xa0030(%rbp),%r8
call   1040 <buffer_compute@plt>
mov    -0xc0040(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0xc0034(%rbp),%eax
sub    $0x2,%eax
shl    $0x8,%eax
shl    $0x9,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cltq
shl    $0x2,%rax
add    %rax,%rsi
lea    -0x80030(%rbp),%rax
mov    %rax,-0xc0068(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0xc0034(%rbp),%eax
sub    $0x2,%eax
shl    $0x8,%eax
shl    $0x9,%eax
mov    $0x8,%r8d
cltd
idiv   %r8d
mov    -0xc0068(%rbp),%rdx
cltq
shl    $0x2,%rax
add    %rax,%rcx
lea    -0xc0030(%rbp),%r8
call   1050 <buffer_store@plt>
mov    -0xc0038(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc0034(%rbp),%eax
shl    $0x7,%eax
shl    $0x9,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cltq
shl    $0x2,%rax
add    %rax,%rsi
lea    -0x20030(%rbp),%rax
mov    %rax,-0xc0060(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0xc0034(%rbp),%eax
shl    $0x7,%eax
shl    $0x9,%eax
mov    $0x8,%r8d
cltd
idiv   %r8d
mov    -0xc0060(%rbp),%rdx
cltq
shl    $0x2,%rax
add    %rax,%rcx
lea    -0x40030(%rbp),%r8
call   1030 <buffer_load@plt>
jmp    1454 <workload+0x324>
mov    -0xc0034(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc0034(%rbp)
jmp    1167 <workload+0x37>
add    $0xc0070,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<workload>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc0028,%rsp
mov    %rcx,0x18(%rsp)
mov    %rdx,0x10(%rsp)
mov    %rsi,0x8(%rsp)
lea    0x1ff(%r8),%eax
test   %r8d,%r8d
cmovns %r8d,%eax
cmp    $0xfffffc01,%r8d
jl     12eb <workload+0x1bb>
mov    %rdi,%rbx
sar    $0x9,%eax
movslq %eax,%r14
test   %r14d,%r14d
mov    $0xffffffff,%r15d
cmovns %r14d,%r15d
add    $0x2,%r15d
xor    %r12d,%r12d
jmp    122e <workload+0xfe>
nopl   (%rax)
lea    0x30020(%rsp),%rsi
lea    0x10020(%rsp),%rdx
lea    0xa0020(%rsp),%rcx
lea    0x60020(%rsp),%r8
call   1040 <buffer_compute@plt>
mov    %r12d,%eax
shl    $0x11,%eax
lea    -0x40000(%rax),%ecx
add    $0xfffc0007,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x3,%eax
cltq
mov    0x10(%rsp),%rcx
lea    (%rcx,%rax,4),%rsi
mov    0x18(%rsp),%rcx
lea    (%rcx,%rax,4),%rcx
mov    %ebp,%edi
lea    0x80020(%rsp),%rdx
lea    0x40020(%rsp),%r8
call   1050 <buffer_store@plt>
mov    %r12d,%eax
shl    $0xd,%eax
lea    (%rbx,%rax,4),%rsi
mov    0x8(%rsp),%rcx
lea    (%rcx,%rax,4),%rcx
mov    %r13d,%edi
lea    0x20020(%rsp),%rdx
lea    0x20(%rsp),%r8
call   1030 <buffer_load@plt>
add    $0x1,%r12
cmp    %r15,%r12
je     12eb <workload+0x1bb>
test   %r12,%r12
setne  %al
xor    %r13d,%r13d
cmp    %r14,%r12
setl   %r13b
setle  %cl
and    %al,%cl
movzbl %cl,%edi
xor    %ebp,%ebp
cmp    $0x2,%r12
setae  %bpl
test   $0x1,%r12b
jne    1190 <workload+0x60>
lea    0x20020(%rsp),%rsi
lea    0x20(%rsp),%rdx
lea    0x80020(%rsp),%rcx
lea    0x40020(%rsp),%r8
call   1040 <buffer_compute@plt>
mov    %r12d,%eax
shl    $0x11,%eax
lea    -0x40000(%rax),%ecx
add    $0xfffc0007,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x3,%eax
cltq
mov    0x10(%rsp),%rcx
lea    (%rcx,%rax,4),%rsi
mov    0x18(%rsp),%rcx
lea    (%rcx,%rax,4),%rcx
mov    %ebp,%edi
lea    0xa0020(%rsp),%rdx
lea    0x60020(%rsp),%r8
call   1050 <buffer_store@plt>
mov    %r12d,%eax
shl    $0xd,%eax
lea    (%rbx,%rax,4),%rsi
mov    0x8(%rsp),%rcx
lea    (%rcx,%rax,4),%rcx
mov    %r13d,%edi
lea    0x30020(%rsp),%rdx
lea    0x10020(%rsp),%r8
jmp    121c <workload+0xec>
add    $0xc0028,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @workload(i32* %0, i32* %1, i32* %2, i32* %3, i32 %4) {
%6 = alloca [64 x [1024 x i8]]
%7 = alloca [64 x [1024 x i8]]
%8 = alloca [64 x [1024 x i8]]
%9 = alloca [64 x [1024 x i8]]
%10 = alloca [64 x [2048 x i8]]
%11 = alloca [64 x [2048 x i8]]
%12 = alloca [64 x [2048 x i8]]
%13 = alloca [64 x [2048 x i8]]
%14 = sdiv i32 %4, 512
%15 = getelementptr inbounds [64 x [1024 x i8]], [64 x [1024 x i8]]* %6, i64 0, i64 0, i64 0
%16 = getelementptr inbounds [64 x [1024 x i8]], [64 x [1024 x i8]]* %7, i64 0, i64 0, i64 0
%17 = getelementptr inbounds [64 x [1024 x i8]], [64 x [1024 x i8]]* %8, i64 0, i64 0, i64 0
%18 = getelementptr inbounds [64 x [1024 x i8]], [64 x [1024 x i8]]* %9, i64 0, i64 0, i64 0
%19 = getelementptr inbounds [64 x [2048 x i8]], [64 x [2048 x i8]]* %10, i64 0, i64 0, i64 0
%20 = getelementptr inbounds [64 x [2048 x i8]], [64 x [2048 x i8]]* %11, i64 0, i64 0, i64 0
%21 = getelementptr inbounds [64 x [2048 x i8]], [64 x [2048 x i8]]* %12, i64 0, i64 0, i64 0
%22 = getelementptr inbounds [64 x [2048 x i8]], [64 x [2048 x i8]]* %13, i64 0, i64 0, i64 0
%23 = icmp sgt i32 %4, -1024
br i1 %23, label %24, label %81
24: ; preds = %5
%25 = bitcast [64 x [1024 x i8]]* %6 to i8**
%26 = bitcast [64 x [1024 x i8]]* %8 to i8**
%27 = bitcast [64 x [2048 x i8]]* %10 to i8**
%28 = bitcast [64 x [2048 x i8]]* %12 to i8**
%29 = bitcast [64 x [2048 x i8]]* %11 to i8**
%30 = bitcast [64 x [2048 x i8]]* %13 to i8**
%31 = bitcast [64 x [1024 x i8]]* %7 to i8**
%32 = bitcast [64 x [1024 x i8]]* %9 to i8**
%33 = sext i32 %14 to i64
%34 = call i32 @llvm.smax.i32(i32 %14, i32 -1)
%35 = add nsw i32 %34, 2
%36 = zext i32 %35 to i64
br label %37
37: ; preds = %24, %78
%38 = phi i64 [ 0, %24 ], [ %79, %78 ]
%39 = icmp slt i64 %38, %33
%40 = zext i1 %39 to i32
%41 = icmp ne i64 %38, 0
%42 = icmp sle i64 %38, %33
%43 = and i1 %41, %42
%44 = zext i1 %43 to i32
%45 = icmp ugt i64 %38, 1
%46 = zext i1 %45 to i32
%47 = trunc i64 %38 to i32
%48 = and i32 %47, 1
%49 = icmp eq i32 %48, 0
br i1 %49, label %50, label %64
50: ; preds = %37
%51 = call i32 @buffer_compute(i32 %44, i8** %31, i8** %32, i8** %29, i8** %30)
%52 = shl i32 %47, 17
%53 = add i32 %52, -262144
%54 = sdiv i32 %53, 8
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i32, i32* %2, i64 %55
%57 = getelementptr inbounds i32, i32* %3, i64 %55
%58 = call i32 @buffer_store(i32 %46, i32* %56, i8** %27, i32* %57, i8** %28)
%59 = shl i64 %38, 13
%60 = and i64 %59, 4294959104
%61 = getelementptr inbounds i32, i32* %0, i64 %60
%62 = getelementptr inbounds i32, i32* %1, i64 %60
%63 = call i32 @buffer_load(i32 %40, i32* %61, i8** %25, i32* %62, i8** %26)
br label %78
64: ; preds = %37
%65 = call i32 @buffer_compute(i32 %44, i8** %25, i8** %26, i8** %27, i8** %28)
%66 = shl i32 %47, 17
%67 = add i32 %66, -262144
%68 = sdiv i32 %67, 8
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i32, i32* %2, i64 %69
%71 = getelementptr inbounds i32, i32* %3, i64 %69
%72 = call i32 @buffer_store(i32 %46, i32* %70, i8** %29, i32* %71, i8** %30)
%73 = shl i64 %38, 13
%74 = and i64 %73, 4294959104
%75 = getelementptr inbounds i32, i32* %0, i64 %74
%76 = getelementptr inbounds i32, i32* %1, i64 %74
%77 = call i32 @buffer_load(i32 %40, i32* %75, i8** %31, i32* %76, i8** %32)
br label %78
78: ; preds = %64, %50
%79 = add nuw nsw i64 %38, 1
%80 = icmp eq i64 %79, %36
br i1 %80, label %81, label %37
81: ; preds = %78, %5
ret void
}