#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_tiling(char *, char *, char *, char *);
void buffer_compute(int flag, char seqA_buf[64][128 * ((256) / (64))],
                    char seqB_buf[64][128 * ((256) / (64))],
                    char alignedA_buf[64][(128 + 128) * ((256) / (64))],
                    char alignedB_buf[64][(128 + 128) * ((256) / (64))]) {
#pragma HLS INLINE off
  int j;
  if (flag) {
    for (j = 0; j < 64; j++) {
#pragma HLS UNROLL
      needwun_tiling(seqA_buf[j], seqB_buf[j], alignedA_buf[j],
                     alignedB_buf[j]);
    }
  }
  return;
}


x86 assembly (clang, -O0):
<buffer_compute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     119a <buffer_compute+0x8a>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x40,-0x2c(%rbp)
jge    1195 <buffer_compute+0x85>
mov    -0x10(%rbp),%rdi
movslq -0x2c(%rbp),%rax
shl    $0x9,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
movslq -0x2c(%rbp),%rax
shl    $0x9,%rax
add    %rax,%rsi
mov    -0x20(%rbp),%rdx
movslq -0x2c(%rbp),%rax
shl    $0xa,%rax
add    %rax,%rdx
mov    -0x28(%rbp),%rcx
movslq -0x2c(%rbp),%rax
shl    $0xa,%rax
add    %rax,%rcx
call   1030 <needwun_tiling@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    113c <buffer_compute+0x2c>
jmp    119a <buffer_compute+0x8a>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_compute>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edi,%edi
je     1161 <buffer_compute+0x51>
mov    %r8,%r14
mov    %rcx,%r13
mov    %rdx,%r15
mov    %rsi,%r12
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
lea    (%r12,%rbx,1),%rdi
lea    (%r15,%rbx,1),%rsi
mov    %r13,%rdx
mov    %r14,%rcx
call   1030 <needwun_tiling@plt>
add    $0x200,%rbx
add    $0x400,%r13
add    $0x400,%r14
cmp    $0x8000,%rbx
jne    1130 <buffer_compute+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @buffer_compute(i32 %0, [512 x i8]* %1, [512 x i8]* %2, [1024 x i8]* %3, [1024 x i8]* %4) {
%6 = alloca i32
%7 = alloca [512 x i8]*
%8 = alloca [512 x i8]*
%9 = alloca [1024 x i8]*
%10 = alloca [1024 x i8]*
%11 = alloca i32
store i32 %0, i32* %6
store [512 x i8]* %1, [512 x i8]** %7
store [512 x i8]* %2, [512 x i8]** %8
store [1024 x i8]* %3, [1024 x i8]** %9
store [1024 x i8]* %4, [1024 x i8]** %10
%12 = load i32, i32* %6
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %44
14: ; preds = %5
store i32 0, i32* %11
br label %15
15: ; preds = %40, %14
%16 = load i32, i32* %11
%17 = icmp slt i32 %16, 64
br i1 %17, label %18, label %43
18: ; preds = %15
%19 = load [512 x i8]*, [512 x i8]** %7
%20 = load i32, i32* %11
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [512 x i8], [512 x i8]* %19, i64 %21
%23 = getelementptr inbounds [512 x i8], [512 x i8]* %22, i64 0, i64 0
%24 = load [512 x i8]*, [512 x i8]** %8
%25 = load i32, i32* %11
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [512 x i8], [512 x i8]* %24, i64 %26
%28 = getelementptr inbounds [512 x i8], [512 x i8]* %27, i64 0, i64 0
%29 = load [1024 x i8]*, [1024 x i8]** %9
%30 = load i32, i32* %11
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [1024 x i8], [1024 x i8]* %29, i64 %31
%33 = getelementptr inbounds [1024 x i8], [1024 x i8]* %32, i64 0, i64 0
%34 = load [1024 x i8]*, [1024 x i8]** %10
%35 = load i32, i32* %11
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [1024 x i8], [1024 x i8]* %34, i64 %36
%38 = getelementptr inbounds [1024 x i8], [1024 x i8]* %37, i64 0, i64 0
%39 = call i32 @needwun_tiling(i8* %23, i8* %28, i8* %33, i8* %38)
br label %40
40: ; preds = %18
%41 = load i32, i32* %11
%42 = add nsw i32 %41, 1
store i32 %42, i32* %11
br label %15
43: ; preds = %15
br label %44
44: ; preds = %43, %5
ret void
}

LLVM IR (-O2):
define void @buffer_compute(i32 %0, [512 x i8]* %1, [512 x i8]* %2, [1024 x i8]* %3, [1024 x i8]* %4) {
%6 = icmp eq i32 %0, 0
br i1 %6, label %16, label %7
7: ; preds = %5, %7
%8 = phi i64 [ %14, %7 ], [ 0, %5 ]
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 %8, i64 0
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 %8, i64 0
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 %8, i64 0
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 %8, i64 0
%13 = tail call i32 @needwun_tiling(i8* %9, i8* %10, i8* %11, i8* %12)
%14 = add nuw nsw i64 %8, 1
%15 = icmp eq i64 %14, 64
br i1 %15, label %16, label %7
16: ; preds = %7, %5
ret void
}