#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*/ _ssdm_RegionBegin(char *);
int /*<<< orphan*/ _ssdm_RegionEnd(char *);
int /*<<< orphan*/ _ssdm_SpecArrayDimSize(int *, int);
int /*<<< orphan*/ _ssdm_op_SpecInterface(int volatile *, char *,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/, int, char *,
                                          char *, char *);
int /*<<< orphan*/ _ssdm_op_SpecLoopName(char *);
int /*<<< orphan*/ _ssdm_op_SpecResource(int *, char *, char *, char *, char *,
                                         char *, char *);
void vectoradd(volatile int *cmd, volatile int *resp, int a[4096], int b[4096],
               int result[4096]) {
  _ssdm_SpecArrayDimSize(result, 4096);
  _ssdm_SpecArrayDimSize(b, 4096);
  _ssdm_SpecArrayDimSize(a, 4096);
  _ssdm_op_SpecInterface(0, "ap_ctrl_none", 0, 0, 0, 0, "", "", "");
  _ssdm_op_SpecInterface(cmd, "axis", 0, 0, 0, 0, "", "", "");
  _ssdm_op_SpecInterface(resp, "axis", 0, 0, 0, 0, "", "", "");
  _ssdm_op_SpecInterface(a, "bram", 0, 0, 0, 1024, "", "", "");
  _ssdm_op_SpecInterface(b, "bram", 0, 0, 0, 1024, "", "", "");
  _ssdm_op_SpecInterface(result, "bram", 0, 0, 0, 1024, "", "", "");
  _ssdm_op_SpecResource(a, "", "RAM_1P_BRAM", "", "", "", "");
  _ssdm_op_SpecResource(b, "", "RAM_1P_BRAM", "", "", "", "");
  _ssdm_op_SpecResource(result, "", "RAM_1P_BRAM", "", "", "", "");
  int i, op, start, end;
For_Loop:
  while (1) {
    _ssdm_op_SpecLoopName("For_Loop");
    _ssdm_RegionBegin("For_Loop");
    op = *cmd;
    end = *cmd;
    start = *cmd;
    if (op == 1)
    add_Loop:
      for (i = start; i < end; i++) {
        _ssdm_op_SpecLoopName("add_Loop");
        _ssdm_RegionBegin("add_Loop");
        result[i] = a[i] + b[i];
        if (i == end - 1)
          *resp = 1;
        _ssdm_RegionEnd("add_Loop");
      }
    else if (op == 2)
    sub_Loop:
      for (i = start; i < end; i++) {
        _ssdm_op_SpecLoopName("sub_Loop");
        _ssdm_RegionBegin("sub_Loop");
        result[i] = a[i] - b[i];
        if (i == end - 1)
          *resp = 1;
        _ssdm_RegionEnd("sub_Loop");
      }
    _ssdm_RegionEnd("For_Loop");
  }
}


x86 assembly (clang, -O0):
<vectoradd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x1000,%esi
call   1060 <_ssdm_SpecArrayDimSize@plt>
mov    -0x20(%rbp),%rdi
mov    $0x1000,%esi
call   1060 <_ssdm_SpecArrayDimSize@plt>
mov    -0x18(%rbp),%rdi
mov    $0x1000,%esi
call   1060 <_ssdm_SpecArrayDimSize@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe4f(%rip),%rsi
xor    %r9d,%r9d
lea    0xe67(%rip),%rax
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
mov    %rax,(%rsp)
mov    %rax,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1070 <_ssdm_op_SpecInterface@plt>
mov    -0x8(%rbp),%rdi
lea    0xe2b(%rip),%rsi
xor    %r9d,%r9d
lea    0xe36(%rip),%rax
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
mov    %rax,(%rsp)
mov    %rax,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1070 <_ssdm_op_SpecInterface@plt>
mov    -0x10(%rbp),%rdi
lea    0xdfa(%rip),%rsi
xor    %r9d,%r9d
lea    0xe05(%rip),%rax
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
mov    %rax,(%rsp)
mov    %rax,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1070 <_ssdm_op_SpecInterface@plt>
mov    -0x18(%rbp),%rdi
lea    0xdce(%rip),%rsi
xor    %r8d,%r8d
mov    $0x400,%r9d
lea    0xdce(%rip),%rax
mov    %r8d,%edx
mov    %r8d,%ecx
mov    %rax,(%rsp)
mov    %rax,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1070 <_ssdm_op_SpecInterface@plt>
mov    -0x20(%rbp),%rdi
lea    0xd9a(%rip),%rsi
xor    %r8d,%r8d
mov    $0x400,%r9d
lea    0xd9a(%rip),%rax
mov    %r8d,%edx
mov    %r8d,%ecx
mov    %rax,(%rsp)
mov    %rax,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1070 <_ssdm_op_SpecInterface@plt>
mov    -0x28(%rbp),%rdi
lea    0xd66(%rip),%rsi
xor    %r8d,%r8d
mov    $0x400,%r9d
lea    0xd66(%rip),%rax
mov    %r8d,%edx
mov    %r8d,%ecx
mov    %rax,(%rsp)
mov    %rax,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1070 <_ssdm_op_SpecInterface@plt>
mov    -0x18(%rbp),%rdi
lea    0xd42(%rip),%rax
lea    0xd30(%rip),%rdx
mov    %rax,%rsi
mov    %rax,%rcx
mov    %rax,%r8
mov    %rax,%r9
mov    %rax,(%rsp)
call   1030 <_ssdm_op_SpecResource@plt>
mov    -0x20(%rbp),%rdi
lea    0xd1b(%rip),%rax
lea    0xd09(%rip),%rdx
mov    %rax,%rsi
mov    %rax,%rcx
mov    %rax,%r8
mov    %rax,%r9
mov    %rax,(%rsp)
call   1030 <_ssdm_op_SpecResource@plt>
mov    -0x28(%rbp),%rdi
lea    0xcf4(%rip),%rax
lea    0xce2(%rip),%rdx
mov    %rax,%rsi
mov    %rax,%rcx
mov    %rax,%r8
mov    %rax,%r9
mov    %rax,(%rsp)
call   1030 <_ssdm_op_SpecResource@plt>
jmp    134f <vectoradd+0x1ef>
lea    0xccd(%rip),%rdi
call   1040 <_ssdm_op_SpecLoopName@plt>
lea    0xcc1(%rip),%rdi
call   1050 <_ssdm_RegionBegin@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x1,-0x30(%rbp)
jne    1416 <vectoradd+0x2b6>
jmp    1391 <vectoradd+0x231>
mov    -0x34(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    1411 <vectoradd+0x2b1>
lea    0xc82(%rip),%rdi
call   1040 <_ssdm_op_SpecLoopName@plt>
lea    0xc76(%rip),%rdi
call   1050 <_ssdm_RegionBegin@plt>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
add    (%rax,%rcx,4),%edx
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x2c(%rbp),%eax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    13f7 <vectoradd+0x297>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
lea    0xc2e(%rip),%rdi
call   1080 <_ssdm_RegionEnd@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1397 <vectoradd+0x237>
jmp    14af <vectoradd+0x34f>
cmpl   $0x2,-0x30(%rbp)
jne    14aa <vectoradd+0x34a>
jmp    1425 <vectoradd+0x2c5>
mov    -0x34(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    14a5 <vectoradd+0x345>
lea    0xbf7(%rip),%rdi
call   1040 <_ssdm_op_SpecLoopName@plt>
lea    0xbeb(%rip),%rdi
call   1050 <_ssdm_RegionBegin@plt>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
sub    (%rax,%rcx,4),%edx
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x2c(%rbp),%eax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    148b <vectoradd+0x32b>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
lea    0xba3(%rip),%rdi
call   1080 <_ssdm_RegionEnd@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    142b <vectoradd+0x2cb>
jmp    14aa <vectoradd+0x34a>
jmp    14af <vectoradd+0x34f>
lea    0xb6d(%rip),%rdi
call   1080 <_ssdm_RegionEnd@plt>
jmp    134f <vectoradd+0x1ef>

x86 assembly (clang, -O2):
<vectoradd>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r8,0x8(%rsp)
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %r8,%rdi
mov    $0x1000,%esi
call   1060 <_ssdm_SpecArrayDimSize@plt>
mov    %r12,%rdi
mov    $0x1000,%esi
call   1060 <_ssdm_SpecArrayDimSize@plt>
mov    %r13,%rdi
mov    $0x1000,%esi
call   1060 <_ssdm_SpecArrayDimSize@plt>
sub    $0x8,%rsp
lea    0xe71(%rip),%rbp
lea    0xe48(%rip),%rsi
xor    %edi,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rbp
push   %rbp
push   %rbp
call   1070 <_ssdm_op_SpecInterface@plt>
add    $0x18,%rsp
lea    0xe36(%rip),%r14
mov    %r15,0x38(%rsp)
mov    %r15,%rdi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rbp
push   %rbp
push   %rbp
call   1070 <_ssdm_op_SpecInterface@plt>
add    $0x18,%rsp
mov    %rbx,0x30(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rbp
push   %rbp
push   %rbp
call   1070 <_ssdm_op_SpecInterface@plt>
add    $0x18,%rsp
lea    0xdf2(%rip),%r14
mov    %r13,%rdi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    $0x400,%r9d
push   %rbp
push   %rbp
push   %rbp
call   1070 <_ssdm_op_SpecInterface@plt>
add    $0x18,%rsp
mov    %r12,%rdi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    $0x400,%r9d
push   %rbp
push   %rbp
push   %rbp
call   1070 <_ssdm_op_SpecInterface@plt>
add    $0x18,%rsp
mov    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    $0x400,%r9d
push   %rbp
push   %rbp
push   %rbp
call   1070 <_ssdm_op_SpecInterface@plt>
add    $0x18,%rsp
lea    0xd8e(%rip),%r14
mov    %r13,0x20(%rsp)
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
mov    %rbp,%rcx
mov    %rbp,%r8
mov    %rbp,%r9
push   %rbp
call   1030 <_ssdm_op_SpecResource@plt>
add    $0x8,%rsp
mov    %r12,0x28(%rsp)
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
mov    %rbp,%rcx
mov    %rbp,%r8
mov    %rbp,%r9
push   %rbp
call   1030 <_ssdm_op_SpecResource@plt>
add    $0x8,%rsp
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
mov    %rbp,%rcx
mov    %rbp,%r8
mov    %rbp,%r9
push   %rbp
call   1030 <_ssdm_op_SpecResource@plt>
add    $0x10,%rsp
lea    0xd35(%rip),%rbx
jmp    12ff <vectoradd+0x19f>
lea    0xd2c(%rip),%rbx
mov    %rbx,%rdi
call   1080 <_ssdm_RegionEnd@plt>
mov    %rbx,%rdi
call   1040 <_ssdm_op_SpecLoopName@plt>
mov    %rbx,%rdi
call   1050 <_ssdm_RegionBegin@plt>
mov    0x30(%rsp),%rax
mov    (%rax),%ecx
movslq (%rax),%r12
movslq (%rax),%rax
cmp    $0x1,%ecx
je     13c0 <vectoradd+0x260>
cmp    $0x2,%ecx
jne    12f0 <vectoradd+0x190>
cmp    %r12d,%eax
jge    12f0 <vectoradd+0x190>
mov    %rax,%rbp
not    %rbp
add    %r12,%rbp
mov    0x18(%rsp),%rcx
lea    (%rcx,%rax,4),%rcx
mov    %rcx,0x10(%rsp)
mov    0x20(%rsp),%rcx
lea    (%rcx,%rax,4),%rbx
mov    0x8(%rsp),%rcx
lea    (%rcx,%rax,4),%r14
sub    %eax,%r12d
xor    %r15d,%r15d
jmp    1379 <vectoradd+0x219>
lea    0xcce(%rip),%rdi
call   1080 <_ssdm_RegionEnd@plt>
add    $0x1,%r15
cmp    %r15d,%r12d
je     12f0 <vectoradd+0x190>
lea    0xcb5(%rip),%r13
mov    %r13,%rdi
call   1040 <_ssdm_op_SpecLoopName@plt>
mov    %r13,%rdi
call   1050 <_ssdm_RegionBegin@plt>
mov    0x10(%rsp),%rax
mov    (%rax,%r15,4),%eax
sub    (%rbx,%r15,4),%eax
mov    %eax,(%r14,%r15,4)
cmp    %r15,%rbp
jne    1360 <vectoradd+0x200>
mov    0x28(%rsp),%rax
movl   $0x1,(%rax)
jmp    1360 <vectoradd+0x200>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    %r12d,%eax
jge    12f0 <vectoradd+0x190>
mov    %rax,%rbp
not    %rbp
add    %r12,%rbp
mov    0x18(%rsp),%rcx
lea    (%rcx,%rax,4),%rcx
mov    %rcx,0x10(%rsp)
mov    0x20(%rsp),%rcx
lea    (%rcx,%rax,4),%r13
mov    0x8(%rsp),%rcx
lea    (%rcx,%rax,4),%r15
sub    %eax,%r12d
xor    %ebx,%ebx
jmp    1419 <vectoradd+0x2b9>
nopl   0x0(%rax)
lea    0xc25(%rip),%rdi
call   1080 <_ssdm_RegionEnd@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
je     12f0 <vectoradd+0x190>
lea    0xc0c(%rip),%r14
mov    %r14,%rdi
call   1040 <_ssdm_op_SpecLoopName@plt>
mov    %r14,%rdi
call   1050 <_ssdm_RegionBegin@plt>
mov    0x0(%r13,%rbx,4),%eax
mov    0x10(%rsp),%rcx
add    (%rcx,%rbx,4),%eax
mov    %eax,(%r15,%rbx,4)
cmp    %rbx,%rbp
jne    1400 <vectoradd+0x2a0>
mov    0x28(%rsp),%rax
movl   $0x1,(%rax)
jmp    1400 <vectoradd+0x2a0>

LLVM IR (-O0):
@.str = [13 x i8] c"ap_ctrl_none\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [5 x i8] c"axis\00"
@.str.3 = [5 x i8] c"bram\00"
@.str.4 = [12 x i8] c"RAM_1P_BRAM\00"
@.str.5 = [9 x i8] c"For_Loop\00"
@.str.6 = [9 x i8] c"add_Loop\00"
@.str.7 = [9 x i8] c"sub_Loop\00"
define void @vectoradd(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 i32
%13 = alloca i32
%14 = 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
%15 = load i32*, i32** %10
%16 = call i32 @_ssdm_SpecArrayDimSize(i32* %15, i32 4096)
%17 = load i32*, i32** %9
%18 = call i32 @_ssdm_SpecArrayDimSize(i32* %17, i32 4096)
%19 = load i32*, i32** %8
%20 = call i32 @_ssdm_SpecArrayDimSize(i32* %19, i32 4096)
%21 = call i32 @_ssdm_op_SpecInterface(i32* null, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%22 = load i32*, i32** %6
%23 = call i32 @_ssdm_op_SpecInterface(i32* %22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%24 = load i32*, i32** %7
%25 = call i32 @_ssdm_op_SpecInterface(i32* %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%26 = load i32*, i32** %8
%27 = call i32 @_ssdm_op_SpecInterface(i32* %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 0, i32 0, i32 1024, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%28 = load i32*, i32** %9
%29 = call i32 @_ssdm_op_SpecInterface(i32* %28, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 0, i32 0, i32 1024, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%30 = load i32*, i32** %10
%31 = call i32 @_ssdm_op_SpecInterface(i32* %30, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 0, i32 0, i32 1024, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%32 = load i32*, i32** %8
%33 = call i32 @_ssdm_op_SpecResource(i32* %32, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%34 = load i32*, i32** %9
%35 = call i32 @_ssdm_op_SpecResource(i32* %34, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%36 = load i32*, i32** %10
%37 = call i32 @_ssdm_op_SpecResource(i32* %36, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %38
38: ; preds = %5
br label %39
39: ; preds = %38, %128
%40 = call i32 @_ssdm_op_SpecLoopName(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%41 = call i32 @_ssdm_RegionBegin(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%42 = load i32*, i32** %6
%43 = load volatile i32, i32* %42
store i32 %43, i32* %12
%44 = load i32*, i32** %6
%45 = load volatile i32, i32* %44
store i32 %45, i32* %14
%46 = load i32*, i32** %6
%47 = load volatile i32, i32* %46
store i32 %47, i32* %13
%48 = load i32, i32* %12
%49 = icmp eq i32 %48, 1
br i1 %49, label %50, label %87
50: ; preds = %39
br label %51
51: ; preds = %50
%52 = load i32, i32* %13
store i32 %52, i32* %11
br label %53
53: ; preds = %83, %51
%54 = load i32, i32* %11
%55 = load i32, i32* %14
%56 = icmp slt i32 %54, %55
br i1 %56, label %57, label %86
57: ; preds = %53
%58 = call i32 @_ssdm_op_SpecLoopName(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%59 = call i32 @_ssdm_RegionBegin(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%60 = load i32*, i32** %8
%61 = load i32, i32* %11
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i32, i32* %60, i64 %62
%64 = load i32, i32* %63
%65 = load i32*, i32** %9
%66 = load i32, i32* %11
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i32, i32* %65, i64 %67
%69 = load i32, i32* %68
%70 = add nsw i32 %64, %69
%71 = load i32*, i32** %10
%72 = load i32, i32* %11
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i32, i32* %71, i64 %73
store i32 %70, i32* %74
%75 = load i32, i32* %11
%76 = load i32, i32* %14
%77 = sub nsw i32 %76, 1
%78 = icmp eq i32 %75, %77
br i1 %78, label %79, label %81
79: ; preds = %57
%80 = load i32*, i32** %7
store volatile i32 1, i32* %80
br label %81
81: ; preds = %79, %57
%82 = call i32 @_ssdm_RegionEnd(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
br label %83
83: ; preds = %81
%84 = load i32, i32* %11
%85 = add nsw i32 %84, 1
store i32 %85, i32* %11
br label %53
86: ; preds = %53
br label %128
87: ; preds = %39
%88 = load i32, i32* %12
%89 = icmp eq i32 %88, 2
br i1 %89, label %90, label %127
90: ; preds = %87
br label %91
91: ; preds = %90
%92 = load i32, i32* %13
store i32 %92, i32* %11
br label %93
93: ; preds = %123, %91
%94 = load i32, i32* %11
%95 = load i32, i32* %14
%96 = icmp slt i32 %94, %95
br i1 %96, label %97, label %126
97: ; preds = %93
%98 = call i32 @_ssdm_op_SpecLoopName(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%99 = call i32 @_ssdm_RegionBegin(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%100 = load i32*, i32** %8
%101 = load i32, i32* %11
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds i32, i32* %100, i64 %102
%104 = load i32, i32* %103
%105 = load i32*, i32** %9
%106 = load i32, i32* %11
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds i32, i32* %105, i64 %107
%109 = load i32, i32* %108
%110 = sub nsw i32 %104, %109
%111 = load i32*, i32** %10
%112 = load i32, i32* %11
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds i32, i32* %111, i64 %113
store i32 %110, i32* %114
%115 = load i32, i32* %11
%116 = load i32, i32* %14
%117 = sub nsw i32 %116, 1
%118 = icmp eq i32 %115, %117
br i1 %118, label %119, label %121
119: ; preds = %97
%120 = load i32*, i32** %7
store volatile i32 1, i32* %120
br label %121
121: ; preds = %119, %97
%122 = call i32 @_ssdm_RegionEnd(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
br label %123
123: ; preds = %121
%124 = load i32, i32* %11
%125 = add nsw i32 %124, 1
store i32 %125, i32* %11
br label %93
126: ; preds = %93
br label %127
127: ; preds = %126, %87
br label %128
128: ; preds = %127, %86
%129 = call i32 @_ssdm_RegionEnd(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
br label %39
}

LLVM IR (-O2):
@.str = [13 x i8] c"ap_ctrl_none\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [5 x i8] c"axis\00"
@.str.3 = [5 x i8] c"bram\00"
@.str.4 = [12 x i8] c"RAM_1P_BRAM\00"
@.str.5 = [9 x i8] c"For_Loop\00"
@.str.6 = [9 x i8] c"add_Loop\00"
@.str.7 = [9 x i8] c"sub_Loop\00"
define void @vectoradd(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = tail call i32 @_ssdm_SpecArrayDimSize(i32* %4, i32 4096)
%7 = tail call i32 @_ssdm_SpecArrayDimSize(i32* %3, i32 4096)
%8 = tail call i32 @_ssdm_SpecArrayDimSize(i32* %2, i32 4096)
%9 = tail call i32 @_ssdm_op_SpecInterface(i32* null, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 @_ssdm_op_SpecInterface(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i32 @_ssdm_op_SpecInterface(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%12 = tail call i32 @_ssdm_op_SpecInterface(i32* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 0, i32 0, i32 1024, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 @_ssdm_op_SpecInterface(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 0, i32 0, i32 1024, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%14 = tail call i32 @_ssdm_op_SpecInterface(i32* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 0, i32 0, i32 1024, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%15 = tail call i32 @_ssdm_op_SpecResource(i32* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%16 = tail call i32 @_ssdm_op_SpecResource(i32* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%17 = tail call i32 @_ssdm_op_SpecResource(i32* %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %70, %5
%19 = tail call i32 @_ssdm_op_SpecLoopName(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%20 = tail call i32 @_ssdm_RegionBegin(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%21 = load volatile i32, i32* %0
%22 = load volatile i32, i32* %0
%23 = load volatile i32, i32* %0
switch i32 %21, label %70 [
i32 1, label %30
i32 2, label %24
]
24: ; preds = %18
%25 = icmp slt i32 %23, %22
br i1 %25, label %26, label %70
26: ; preds = %24
%27 = add nsw i32 %22, -1
%28 = sext i32 %23 to i64
%29 = sext i32 %27 to i64
br label %53
30: ; preds = %18
%31 = icmp slt i32 %23, %22
br i1 %31, label %32, label %70
32: ; preds = %30
%33 = add nsw i32 %22, -1
%34 = sext i32 %23 to i64
%35 = sext i32 %33 to i64
br label %36
36: ; preds = %32, %48
%37 = phi i64 [ %34, %32 ], [ %50, %48 ]
%38 = tail call i32 @_ssdm_op_SpecLoopName(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%39 = tail call i32 @_ssdm_RegionBegin(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%40 = getelementptr inbounds i32, i32* %2, i64 %37
%41 = load i32, i32* %40
%42 = getelementptr inbounds i32, i32* %3, i64 %37
%43 = load i32, i32* %42
%44 = add nsw i32 %43, %41
%45 = getelementptr inbounds i32, i32* %4, i64 %37
store i32 %44, i32* %45
%46 = icmp eq i64 %37, %35
br i1 %46, label %47, label %48
47: ; preds = %36
store volatile i32 1, i32* %1
br label %48
48: ; preds = %47, %36
%49 = tail call i32 @_ssdm_RegionEnd(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%50 = add nsw i64 %37, 1
%51 = trunc i64 %50 to i32
%52 = icmp eq i32 %22, %51
br i1 %52, label %70, label %36
53: ; preds = %26, %65
%54 = phi i64 [ %28, %26 ], [ %67, %65 ]
%55 = tail call i32 @_ssdm_op_SpecLoopName(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%56 = tail call i32 @_ssdm_RegionBegin(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%57 = getelementptr inbounds i32, i32* %2, i64 %54
%58 = load i32, i32* %57
%59 = getelementptr inbounds i32, i32* %3, i64 %54
%60 = load i32, i32* %59
%61 = sub nsw i32 %58, %60
%62 = getelementptr inbounds i32, i32* %4, i64 %54
store i32 %61, i32* %62
%63 = icmp eq i64 %54, %29
br i1 %63, label %64, label %65
64: ; preds = %53
store volatile i32 1, i32* %1
br label %65
65: ; preds = %64, %53
%66 = tail call i32 @_ssdm_RegionEnd(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%67 = add nsw i64 %54, 1
%68 = trunc i64 %67 to i32
%69 = icmp eq i32 %22, %68
br i1 %69, label %70, label %53
70: ; preds = %65, %48, %24, %30, %18
%71 = tail call i32 @_ssdm_RegionEnd(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
br label %18
}