#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*/ assert(int);
int /*<<< orphan*/ compute(int, char **, char **, char **, char **, int);
int /*<<< orphan*/ load(int, char **, char *, int, char **, char *, int);
int /*<<< orphan*/ store(int, char *, char **, int, char *, char **, int);
void workload(char *SEQA, char *SEQB, char *alignedA, char *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
  assert(num_jobs == (1 << 16));
  char seqA_buf_x[2][128 * 256 / 2];
#pragma HLS array_partition variable = seqA_buf_x dim = 1 complete
  char seqB_buf_x[2][128 * 256 / 2];
#pragma HLS array_partition variable = seqB_buf_x dim = 1 complete
  char alignedA_buf_x[2][(128 + 128) * 256 / 2];
#pragma HLS array_partition variable = alignedA_buf_x dim = 1 complete
  char alignedB_buf_x[2][(128 + 128) * 256 / 2];
#pragma HLS array_partition variable = alignedB_buf_x dim = 1 complete
  char seqA_buf_y[2][128 * 256 / 2];
#pragma HLS array_partition variable = seqA_buf_y dim = 1 complete
  char seqB_buf_y[2][128 * 256 / 2];
#pragma HLS array_partition variable = seqB_buf_y dim = 1 complete
  char alignedA_buf_y[2][(128 + 128) * 256 / 2];
#pragma HLS array_partition variable = alignedA_buf_y dim = 1 complete
  char alignedB_buf_y[2][(128 + 128) * 256 / 2];
#pragma HLS array_partition variable = alignedB_buf_y dim = 1 complete
  int num_batches = (num_jobs + 256 - 1) / 256;
  int tail_jobs = num_jobs % 256;
  if (tail_jobs == 0)
    tail_jobs = 256;
  int i, j, k;
  for (i = 0; i < num_batches + 2; i++) {
    int load_jobs = i == num_batches - 1 ? tail_jobs : 256;
    int compute_jobs = i == num_batches ? tail_jobs : 256;
    int store_jobs = i == num_batches + 1 ? tail_jobs : 256;
    int load_flag = i < num_batches;
    int compute_flag = i > 0 && i < num_batches + 1;
    int store_flag = i > 1;
    if (i % 2 == 0) {
      load(load_flag, seqA_buf_x, SEQA + i * 128 * 256, 128 * load_jobs,
           seqB_buf_x, SEQB + i * 128 * 256, 128 * load_jobs);
      compute(compute_flag, seqA_buf_y, seqB_buf_y, alignedA_buf_y,
              alignedB_buf_y, compute_jobs);
      store(store_flag, alignedA + (i - 2) * (128 + 128) * 256, alignedA_buf_x,
            (128 + 128) * store_jobs, alignedB + (i - 2) * (128 + 128) * 256,
            alignedB_buf_x, (128 + 128) * store_jobs);
    } else {
      load(load_flag, seqA_buf_y, SEQA + i * 128 * 256, 128 * load_jobs,
           seqB_buf_y, SEQB + i * 128 * 256, 128 * load_jobs);
      compute(compute_flag, seqA_buf_x, seqB_buf_x, alignedA_buf_x,
              alignedB_buf_x, compute_jobs);
      store(store_flag, alignedA + (i - 2) * (128 + 128) * 256, alignedA_buf_y,
            (128 + 128) * store_jobs, alignedB + (i - 2) * (128 + 128) * 256,
            alignedB_buf_y, (128 + 128) * store_jobs);
    }
  }
  return;
}


x86 assembly (clang, -O0):
<workload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60080,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
cmpl   $0x10000,-0x24(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x24(%rbp),%eax
add    $0x100,%eax
sub    $0x1,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %eax,-0x60034(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %edx,-0x60038(%rbp)
cmpl   $0x0,-0x60038(%rbp)
jne    11b4 <workload+0x74>
movl   $0x100,-0x60038(%rbp)
movl   $0x0,-0x6003c(%rbp)
mov    -0x6003c(%rbp),%eax
mov    -0x60034(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    1508 <workload+0x3c8>
mov    -0x6003c(%rbp),%eax
mov    -0x60034(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    11fd <workload+0xbd>
mov    -0x60038(%rbp),%eax
mov    %eax,-0x60060(%rbp)
jmp    120d <workload+0xcd>
mov    $0x100,%eax
mov    %eax,-0x60060(%rbp)
jmp    120d <workload+0xcd>
mov    -0x60060(%rbp),%eax
mov    %eax,-0x60048(%rbp)
mov    -0x6003c(%rbp),%eax
cmp    -0x60034(%rbp),%eax
jne    123c <workload+0xfc>
mov    -0x60038(%rbp),%eax
mov    %eax,-0x60064(%rbp)
jmp    124c <workload+0x10c>
mov    $0x100,%eax
mov    %eax,-0x60064(%rbp)
jmp    124c <workload+0x10c>
mov    -0x60064(%rbp),%eax
mov    %eax,-0x6004c(%rbp)
mov    -0x6003c(%rbp),%eax
mov    -0x60034(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jne    1280 <workload+0x140>
mov    -0x60038(%rbp),%eax
mov    %eax,-0x60068(%rbp)
jmp    1290 <workload+0x150>
mov    $0x100,%eax
mov    %eax,-0x60068(%rbp)
jmp    1290 <workload+0x150>
mov    -0x60068(%rbp),%eax
mov    %eax,-0x60050(%rbp)
mov    -0x6003c(%rbp),%eax
cmp    -0x60034(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x60054(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x6003c(%rbp)
mov    %al,-0x60069(%rbp)
jle    12e5 <workload+0x1a5>
mov    -0x6003c(%rbp),%eax
mov    -0x60034(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
setl   %al
mov    %al,-0x60069(%rbp)
mov    -0x60069(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x60058(%rbp)
cmpl   $0x1,-0x6003c(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x6005c(%rbp)
mov    -0x6003c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    140b <workload+0x2cb>
mov    -0x60054(%rbp),%edi
lea    -0x8030(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x6003c(%rbp),%eax
shl    $0x7,%eax
shl    $0x8,%eax
cltq
add    %rax,%rdx
mov    -0x60048(%rbp),%ecx
shl    $0x7,%ecx
lea    -0x10030(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    -0x6003c(%rbp),%eax
shl    $0x7,%eax
shl    $0x8,%eax
cltq
add    %rax,%r9
mov    -0x60048(%rbp),%eax
shl    $0x7,%eax
mov    %eax,(%rsp)
call   1050 <load@plt>
mov    -0x60058(%rbp),%edi
lea    -0x38030(%rbp),%rsi
lea    -0x40030(%rbp),%rdx
lea    -0x50030(%rbp),%rcx
lea    -0x60030(%rbp),%r8
mov    -0x6004c(%rbp),%r9d
call   1060 <compute@plt>
mov    -0x6005c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x6003c(%rbp),%eax
sub    $0x2,%eax
shl    $0x8,%eax
shl    $0x8,%eax
cltq
add    %rax,%rsi
lea    -0x20030(%rbp),%rdx
mov    -0x60050(%rbp),%ecx
shl    $0x8,%ecx
mov    -0x20(%rbp),%r8
mov    -0x6003c(%rbp),%eax
sub    $0x2,%eax
shl    $0x8,%eax
shl    $0x8,%eax
cltq
add    %rax,%r8
lea    -0x30030(%rbp),%r9
mov    -0x60050(%rbp),%eax
shl    $0x8,%eax
mov    %eax,(%rsp)
call   1030 <store@plt>
jmp    14ef <workload+0x3af>
mov    -0x60054(%rbp),%edi
lea    -0x38030(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x6003c(%rbp),%eax
shl    $0x7,%eax
shl    $0x8,%eax
cltq
add    %rax,%rdx
mov    -0x60048(%rbp),%ecx
shl    $0x7,%ecx
lea    -0x40030(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    -0x6003c(%rbp),%eax
shl    $0x7,%eax
shl    $0x8,%eax
cltq
add    %rax,%r9
mov    -0x60048(%rbp),%eax
shl    $0x7,%eax
mov    %eax,(%rsp)
call   1050 <load@plt>
mov    -0x60058(%rbp),%edi
lea    -0x8030(%rbp),%rsi
lea    -0x10030(%rbp),%rdx
lea    -0x20030(%rbp),%rcx
lea    -0x30030(%rbp),%r8
mov    -0x6004c(%rbp),%r9d
call   1060 <compute@plt>
mov    -0x6005c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x6003c(%rbp),%eax
sub    $0x2,%eax
shl    $0x8,%eax
shl    $0x8,%eax
cltq
add    %rax,%rsi
lea    -0x50030(%rbp),%rdx
mov    -0x60050(%rbp),%ecx
shl    $0x8,%ecx
mov    -0x20(%rbp),%r8
mov    -0x6003c(%rbp),%eax
sub    $0x2,%eax
shl    $0x8,%eax
shl    $0x8,%eax
cltq
add    %rax,%r8
lea    -0x60030(%rbp),%r9
mov    -0x60050(%rbp),%eax
shl    $0x8,%eax
mov    %eax,(%rsp)
call   1030 <store@plt>
jmp    14f4 <workload+0x3b4>
mov    -0x6003c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6003c(%rbp)
jmp    11be <workload+0x7e>
add    $0x60080,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<workload>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x60068,%rsp
mov    %r8d,%ebp
mov    %rcx,0x20(%rsp)
mov    %rdx,0x18(%rsp)
mov    %rsi,0x58(%rsp)
mov    %rdi,0x50(%rsp)
xor    %edi,%edi
cmp    $0x10000,%r8d
sete   %dil
call   1040 <assert@plt>
lea    0xff(%rbp),%eax
lea    0x1fe(%rbp),%ecx
test   %eax,%eax
cmovns %eax,%ecx
test   %ebp,%ebp
cmovns %ebp,%eax
and    $0xffffff00,%eax
mov    %ebp,%edx
sub    %eax,%edx
mov    $0x100,%eax
cmove  %eax,%edx
mov    %edx,0xc(%rsp)
cmp    $0xfffffd02,%ebp
jl     137e <workload+0x23e>
sar    $0x8,%ecx
lea    -0x1(%rcx),%eax
mov    %rax,0x40(%rsp)
movslq %ecx,%rax
add    $0x1,%ecx
mov    %rax,0x38(%rsp)
mov    %eax,%eax
mov    %rax,0x30(%rsp)
xor    %r12d,%r12d
test   %ecx,%ecx
mov    %rcx,0x48(%rsp)
cmovle %r12d,%ecx
add    $0x1,%ecx
mov    %rcx,0x28(%rsp)
mov    0xc(%rsp),%eax
shl    $0x7,%eax
mov    %eax,0x14(%rsp)
mov    $0xfffe0000,%ebx
xor    %r15d,%r15d
jmp    1290 <workload+0x150>
nopl   0x0(%rax)
mov    %ecx,(%rsp)
lea    0x8060(%rsp),%rsi
lea    0x60(%rsp),%r8
call   1050 <load@plt>
mov    0x10(%rsp),%edi
lea    0x18060(%rsp),%rsi
lea    0x10060(%rsp),%rdx
lea    0x50060(%rsp),%rcx
lea    0x40060(%rsp),%r8
mov    %r14d,%r9d
call   1060 <compute@plt>
movslq %ebx,%r8
mov    0x18(%rsp),%rax
lea    (%rax,%r8,1),%rsi
shl    $0x8,%r13d
add    0x20(%rsp),%r8
mov    %r13d,(%rsp)
mov    %ebp,%edi
lea    0x30060(%rsp),%rdx
mov    %r13d,%ecx
lea    0x20060(%rsp),%r9
call   1030 <store@plt>
add    $0x1,%r15
add    $0x8000,%r12
add    $0x10000,%ebx
cmp    %r15,0x28(%rsp)
je     137e <workload+0x23e>
cmp    %r15,0x30(%rsp)
mov    $0x100,%r14d
mov    0xc(%rsp),%eax
cmove  %eax,%r14d
cmp    %r15,0x48(%rsp)
mov    $0x100,%r13d
cmove  %eax,%r13d
test   %r15,%r15
setne  %al
xor    %edi,%edi
cmp    0x38(%rsp),%r15
setl   %dil
setle  %cl
and    %al,%cl
xor    %ebp,%ebp
cmp    $0x2,%r15
setae  %bpl
mov    %r12d,%r9d
and    $0xffff8000,%r9d
mov    0x50(%rsp),%rax
lea    (%rax,%r9,1),%rdx
cmp    %r15,0x40(%rsp)
movzbl %cl,%eax
mov    $0x8000,%ecx
cmove  0x14(%rsp),%ecx
add    0x58(%rsp),%r9
test   $0x1,%r15b
mov    %eax,0x10(%rsp)
jne    1200 <workload+0xc0>
mov    %ecx,(%rsp)
lea    0x18060(%rsp),%rsi
lea    0x10060(%rsp),%r8
call   1050 <load@plt>
mov    0x10(%rsp),%edi
lea    0x8060(%rsp),%rsi
lea    0x60(%rsp),%rdx
lea    0x30060(%rsp),%rcx
lea    0x20060(%rsp),%r8
mov    %r14d,%r9d
call   1060 <compute@plt>
movslq %ebx,%r8
mov    0x18(%rsp),%rax
lea    (%rax,%r8,1),%rsi
shl    $0x8,%r13d
add    0x20(%rsp),%r8
mov    %r13d,(%rsp)
mov    %ebp,%edi
lea    0x50060(%rsp),%rdx
mov    %r13d,%ecx
lea    0x40060(%rsp),%r9
jmp    126f <workload+0x12f>
add    $0x60068,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @workload(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca [2 x [16384 x i8]]
%7 = alloca [2 x [16384 x i8]]
%8 = alloca [2 x [32768 x i8]]
%9 = alloca [2 x [32768 x i8]]
%10 = alloca [2 x [16384 x i8]]
%11 = alloca [2 x [16384 x i8]]
%12 = alloca [2 x [32768 x i8]]
%13 = alloca [2 x [32768 x i8]]
%14 = icmp eq i32 %4, 65536
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = getelementptr inbounds [2 x [16384 x i8]], [2 x [16384 x i8]]* %6, i64 0, i64 0, i64 0
%18 = getelementptr inbounds [2 x [16384 x i8]], [2 x [16384 x i8]]* %7, i64 0, i64 0, i64 0
%19 = getelementptr inbounds [2 x [32768 x i8]], [2 x [32768 x i8]]* %8, i64 0, i64 0, i64 0
%20 = getelementptr inbounds [2 x [32768 x i8]], [2 x [32768 x i8]]* %9, i64 0, i64 0, i64 0
%21 = getelementptr inbounds [2 x [16384 x i8]], [2 x [16384 x i8]]* %10, i64 0, i64 0, i64 0
%22 = getelementptr inbounds [2 x [16384 x i8]], [2 x [16384 x i8]]* %11, i64 0, i64 0, i64 0
%23 = getelementptr inbounds [2 x [32768 x i8]], [2 x [32768 x i8]]* %12, i64 0, i64 0, i64 0
%24 = getelementptr inbounds [2 x [32768 x i8]], [2 x [32768 x i8]]* %13, i64 0, i64 0, i64 0
%25 = add nsw i32 %4, 255
%26 = sdiv i32 %25, 256
%27 = srem i32 %4, 256
%28 = icmp eq i32 %27, 0
%29 = select i1 %28, i32 256, i32 %27
%30 = icmp sgt i32 %4, -767
br i1 %30, label %31, label %96
31: ; preds = %5
%32 = add nsw i32 %26, -1
%33 = add nsw i32 %26, 1
%34 = bitcast [2 x [16384 x i8]]* %10 to i8**
%35 = bitcast [2 x [16384 x i8]]* %11 to i8**
%36 = bitcast [2 x [16384 x i8]]* %6 to i8**
%37 = bitcast [2 x [16384 x i8]]* %7 to i8**
%38 = bitcast [2 x [32768 x i8]]* %8 to i8**
%39 = bitcast [2 x [32768 x i8]]* %9 to i8**
%40 = bitcast [2 x [32768 x i8]]* %12 to i8**
%41 = bitcast [2 x [32768 x i8]]* %13 to i8**
%42 = sext i32 %26 to i64
%43 = zext i32 %32 to i64
%44 = zext i32 %26 to i64
%45 = zext i32 %33 to i64
%46 = call i32 @llvm.smax.i32(i32 %33, i32 0)
%47 = add nuw nsw i32 %46, 1
%48 = zext i32 %47 to i64
%49 = shl nsw i32 %29, 7
br label %50
50: ; preds = %31, %93
%51 = phi i64 [ 0, %31 ], [ %94, %93 ]
%52 = icmp eq i64 %51, %43
%53 = icmp eq i64 %51, %44
%54 = select i1 %53, i32 %29, i32 256
%55 = icmp eq i64 %51, %45
%56 = select i1 %55, i32 %29, i32 256
%57 = icmp slt i64 %51, %42
%58 = zext i1 %57 to i32
%59 = icmp ne i64 %51, 0
%60 = icmp sle i64 %51, %42
%61 = select i1 %59, i1 %60, i1 false
%62 = zext i1 %61 to i32
%63 = icmp ugt i64 %51, 1
%64 = zext i1 %63 to i32
%65 = trunc i64 %51 to i32
%66 = and i32 %65, 1
%67 = icmp eq i32 %66, 0
%68 = shl i64 %51, 15
%69 = and i64 %68, 4294934528
%70 = getelementptr inbounds i8, i8* %0, i64 %69
%71 = select i1 %52, i32 %49, i32 32768
%72 = getelementptr inbounds i8, i8* %1, i64 %69
br i1 %67, label %73, label %83
73: ; preds = %50
%74 = call i32 @load(i32 %58, i8** %36, i8* %70, i32 %71, i8** %37, i8* %72, i32 %71)
%75 = call i32 @compute(i32 %62, i8** %34, i8** %35, i8** %40, i8** %41, i32 %54)
%76 = shl i32 %65, 16
%77 = add i32 %76, -131072
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i8, i8* %2, i64 %78
%80 = shl nsw i32 %56, 8
%81 = getelementptr inbounds i8, i8* %3, i64 %78
%82 = call i32 @store(i32 %64, i8* %79, i8** %38, i32 %80, i8* %81, i8** %39, i32 %80)
br label %93
83: ; preds = %50
%84 = call i32 @load(i32 %58, i8** %34, i8* %70, i32 %71, i8** %35, i8* %72, i32 %71)
%85 = call i32 @compute(i32 %62, i8** %36, i8** %37, i8** %38, i8** %39, i32 %54)
%86 = shl i32 %65, 16
%87 = add i32 %86, -131072
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i8, i8* %2, i64 %88
%90 = shl nsw i32 %56, 8
%91 = getelementptr inbounds i8, i8* %3, i64 %88
%92 = call i32 @store(i32 %64, i8* %89, i8** %40, i32 %90, i8* %91, i8** %41, i32 %90)
br label %93
93: ; preds = %83, %73
%94 = add nuw nsw i64 %51, 1
%95 = icmp eq i64 %94, %48
br i1 %95, label %96, label %50
96: ; preds = %93, %5
ret void
}