#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*/ needwun(char *, char *, char *, char *, int *, char *);
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
  int M[(128 + 1) * (128 + 1)];
  char ptr[(128 + 1) * (128 + 1)];
  int i;
  for (i = 0; i < num_jobs; i++) {
    needwun(SEQA + i * 128, SEQB + i * 128, alignedA + i * (128 + 128),
            alignedB + i * (128 + 128), M, ptr);
  }
  return;
}


x86 assembly (clang, -O0):
<workload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x14550,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
movl   $0x0,-0x14544(%rbp)
mov    -0x14544(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    11b7 <workload+0xa7>
mov    -0x8(%rbp),%rdi
mov    -0x14544(%rbp),%eax
shl    $0x7,%eax
cltq
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14544(%rbp),%eax
shl    $0x7,%eax
cltq
add    %rax,%rsi
mov    -0x18(%rbp),%rdx
mov    -0x14544(%rbp),%eax
shl    $0x8,%eax
cltq
add    %rax,%rdx
mov    -0x20(%rbp),%rcx
mov    -0x14544(%rbp),%eax
shl    $0x8,%eax
cltq
add    %rax,%rcx
lea    -0x10430(%rbp),%r8
lea    -0x14540(%rbp),%r9
call   1030 <needwun@plt>
mov    -0x14544(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14544(%rbp)
jmp    1139 <workload+0x29>
add    $0x14550,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<workload>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x14518,%rsp
test   %r8d,%r8d
jle    1178 <workload+0x68>
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
mov    %r8d,%r13d
mov    %rsp,%rbp
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
lea    0x4110(%rsp),%r8
mov    %rbp,%r9
call   1030 <needwun@plt>
sub    $0xffffffffffffff80,%r12
sub    $0xffffffffffffff80,%rbx
add    $0x100,%r14
add    $0x100,%r15
add    $0xffffffffffffffff,%r13
jne    1140 <workload+0x30>
add    $0x14518,%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 [16641 x i32]
%12 = alloca [16641 x i8]
%13 = 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
store i32 0, i32* %13
br label %14
14: ; preds = %42, %5
%15 = load i32, i32* %13
%16 = load i32, i32* %10
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %45
18: ; preds = %14
%19 = load i8*, i8** %6
%20 = load i32, i32* %13
%21 = mul nsw i32 %20, 128
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %19, i64 %22
%24 = load i8*, i8** %7
%25 = load i32, i32* %13
%26 = mul nsw i32 %25, 128
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %24, i64 %27
%29 = load i8*, i8** %8
%30 = load i32, i32* %13
%31 = mul nsw i32 %30, 256
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %29, i64 %32
%34 = load i8*, i8** %9
%35 = load i32, i32* %13
%36 = mul nsw i32 %35, 256
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8, i8* %34, i64 %37
%39 = getelementptr inbounds [16641 x i32], [16641 x i32]* %11, i64 0, i64 0
%40 = getelementptr inbounds [16641 x i8], [16641 x i8]* %12, i64 0, i64 0
%41 = call i32 @needwun(i8* %23, i8* %28, i8* %33, i8* %38, i32* %39, i8* %40)
br label %42
42: ; preds = %18
%43 = load i32, i32* %13
%44 = add nsw i32 %43, 1
store i32 %44, i32* %13
br label %14
45: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @workload(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca [16641 x i32]
%7 = alloca [16641 x i8]
%8 = bitcast [16641 x i32]* %6 to i8*
%9 = getelementptr inbounds [16641 x i8], [16641 x i8]* %7, i64 0, i64 0
%10 = icmp sgt i32 %4, 0
br i1 %10, label %11, label %25
11: ; preds = %5
%12 = getelementptr inbounds [16641 x i32], [16641 x i32]* %6, i64 0, i64 0
%13 = zext i32 %4 to i64
br label %14
14: ; preds = %11, %14
%15 = phi i64 [ 0, %11 ], [ %23, %14 ]
%16 = shl nsw i64 %15, 7
%17 = getelementptr inbounds i8, i8* %0, i64 %16
%18 = getelementptr inbounds i8, i8* %1, i64 %16
%19 = shl nsw i64 %15, 8
%20 = getelementptr inbounds i8, i8* %2, i64 %19
%21 = getelementptr inbounds i8, i8* %3, i64 %19
%22 = call i32 @needwun(i8* %17, i8* %18, i8* %20, i8* %21, i32* %12, i8* %9)
%23 = add nuw nsw i64 %15, 1
%24 = icmp eq i64 %23, %13
br i1 %24, label %25, label %14
25: ; preds = %14, %5
ret void
}