void hls_macc(int a, int b, int *accum, _Bool accum_clr) {
  _ssdm_op_SpecInterface(0, "s_axilite", 0, 0, "", 0, 0, "HLS_MACC_PERIPH_BUS",
                         "", "", 0, 0, 0, 0, "", "");
  _ssdm_op_SpecInterface(a, "s_axilite", 0, 0, "", 0, 0, "HLS_MACC_PERIPH_BUS",
                         "", "", 0, 0, 0, 0, "", "");
  _ssdm_op_SpecInterface(b, "s_axilite", 0, 0, "", 0, 0, "HLS_MACC_PERIPH_BUS",
                         "", "", 0, 0, 0, 0, "", "");
  _ssdm_op_SpecInterface(accum, "s_axilite", 0, 0, "", 0, 0,
                         "HLS_MACC_PERIPH_BUS", "", "", 0, 0, 0, 0, "", "");
  _ssdm_op_SpecInterface(accum_clr, "s_axilite", 0, 0, "", 0, 0,
                         "HLS_MACC_PERIPH_BUS", "", "", 0, 0, 0, 0, "", "");
  static acc_reg = 0;
  if (accum_clr)
    acc_reg = 0;
  acc_reg += a * b;
  *accum = acc_reg;
}


x86 assembly (clang, -O0):
<hls_macc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %cl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
and    $0x1,%al
mov    %al,-0x11(%rbp)
xor    %r9d,%r9d
lea    0xecd(%rip),%rsi
lea    0xee3(%rip),%rax
lea    0xec9(%rip),%r10
mov    %r9d,%edi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %rax,%r8
movl   $0x0,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    %rax,0x18(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x0,0x28(%rsp)
movl   $0x0,0x30(%rsp)
movl   $0x0,0x38(%rsp)
mov    %rax,0x40(%rsp)
mov    %rax,0x48(%rsp)
mov    $0x0,%al
call   1030 <_ssdm_op_SpecInterface@plt>
mov    -0x4(%rbp),%edi
lea    0xe62(%rip),%rsi
xor    %r9d,%r9d
lea    0xe75(%rip),%rax
lea    0xe5b(%rip),%r10
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %rax,%r8
movl   $0x0,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    %rax,0x18(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x0,0x28(%rsp)
movl   $0x0,0x30(%rsp)
movl   $0x0,0x38(%rsp)
mov    %rax,0x40(%rsp)
mov    %rax,0x48(%rsp)
mov    $0x0,%al
call   1030 <_ssdm_op_SpecInterface@plt>
mov    -0x8(%rbp),%edi
lea    0xdf7(%rip),%rsi
xor    %r9d,%r9d
lea    0xe0a(%rip),%rax
lea    0xdf0(%rip),%r10
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %rax,%r8
movl   $0x0,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    %rax,0x18(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x0,0x28(%rsp)
movl   $0x0,0x30(%rsp)
movl   $0x0,0x38(%rsp)
mov    %rax,0x40(%rsp)
mov    %rax,0x48(%rsp)
mov    $0x0,%al
call   1030 <_ssdm_op_SpecInterface@plt>
mov    -0x10(%rbp),%rdi
lea    0xd8b(%rip),%rsi
xor    %r9d,%r9d
lea    0xd9e(%rip),%rax
lea    0xd84(%rip),%r10
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %rax,%r8
movl   $0x0,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    %rax,0x18(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x0,0x28(%rsp)
movl   $0x0,0x30(%rsp)
movl   $0x0,0x38(%rsp)
mov    %rax,0x40(%rsp)
mov    %rax,0x48(%rsp)
mov    $0x0,%al
call   1030 <_ssdm_op_SpecInterface@plt>
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
lea    0xd1b(%rip),%rsi
xor    %r9d,%r9d
lea    0xd2e(%rip),%rax
lea    0xd14(%rip),%r10
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %rax,%r8
movl   $0x0,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    %rax,0x18(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x0,0x28(%rsp)
movl   $0x0,0x30(%rsp)
movl   $0x0,0x38(%rsp)
mov    %rax,0x40(%rsp)
mov    %rax,0x48(%rsp)
mov    $0x0,%al
call   1030 <_ssdm_op_SpecInterface@plt>
testb  $0x1,-0x11(%rbp)
je     135a <hls_macc+0x24a>
movl   $0x0,0x2cd2(%rip)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
add    0x2cc5(%rip),%eax
mov    %eax,0x2cbf(%rip)
mov    0x2cb9(%rip),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hls_macc>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,(%rsp)
mov    %rdx,%r15
mov    %esi,%r14d
mov    %edi,%ebp
lea    0xef0(%rip),%rbx
lea    0xed6(%rip),%r10
lea    0xec5(%rip),%r13
xor    %edi,%edi
mov    %r13,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
xor    %r9d,%r9d
xor    %eax,%eax
push   %rbx
push   %rbx
push   $0x0
push   $0x0
push   $0x0
push   $0x0
push   %rbx
push   %rbx
push   %r10
mov    %r10,%r12
push   $0x0
call   1030 <_ssdm_op_SpecInterface@plt>
add    $0x50,%rsp
mov    %ebp,0x4(%rsp)
mov    %ebp,%edi
mov    %r13,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
xor    %r9d,%r9d
xor    %eax,%eax
push   %rbx
push   %rbx
push   $0x0
push   $0x0
push   $0x0
push   $0x0
push   %rbx
push   %rbx
push   %r12
push   $0x0
call   1030 <_ssdm_op_SpecInterface@plt>
add    $0x50,%rsp
mov    %r14d,%edi
mov    %r13,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
xor    %r9d,%r9d
xor    %eax,%eax
push   %rbx
push   %rbx
push   $0x0
push   $0x0
push   $0x0
push   $0x0
push   %rbx
push   %rbx
push   %r12
mov    %r12,%rbp
push   $0x0
call   1030 <_ssdm_op_SpecInterface@plt>
add    $0x50,%rsp
mov    %r15,%r12
mov    %r15,%rdi
mov    %r13,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
xor    %r9d,%r9d
xor    %eax,%eax
push   %rbx
push   %rbx
push   $0x0
push   $0x0
push   $0x0
push   $0x0
push   %rbx
push   %rbx
push   %rbp
mov    %rbp,%r15
push   $0x0
call   1030 <_ssdm_op_SpecInterface@plt>
add    $0x50,%rsp
mov    (%rsp),%ebp
mov    %ebp,%edi
mov    %r13,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
xor    %r9d,%r9d
xor    %eax,%eax
push   %rbx
push   %rbx
push   $0x0
push   $0x0
push   $0x0
push   $0x0
push   %rbx
push   %rbx
push   %r15
push   $0x0
call   1030 <_ssdm_op_SpecInterface@plt>
xor    %eax,%eax
add    $0x50,%rsp
test   %ebp,%ebp
jne    122d <hls_macc+0x11d>
mov    0x2dff(%rip),%eax
imul   0x4(%rsp),%r14d
add    %eax,%r14d
mov    %r14d,0x2def(%rip)
mov    %r14d,(%r12)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"s_axilite\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [20 x i8] c"HLS_MACC_PERIPH_BUS\00"
@hls_macc.acc_reg = internal global i32 0
define void @hls_macc(i32 %0, i32 %1, i32* %2, i1 zeroext %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i8
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%9 = zext i1 %3 to i8
store i8 %9, i8* %8
%10 = call i32 (i32, i8*, i32, i32, i8*, i32, i32, i8*, i8*, i8*, i32, i32, i32, i32, i8*, i8*, ...) bitcast (i32 (...)* @_ssdm_op_SpecInterface to i32 (i32, i8*, i32, i32, i8*, i32, i32, i8*, i8*, i8*, i32, i32, i32, i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, 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), 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))
%11 = load i32, i32* %5
%12 = call i32 (i32, i8*, i32, i32, i8*, i32, i32, i8*, i8*, i8*, i32, i32, i32, i32, i8*, i8*, ...) bitcast (i32 (...)* @_ssdm_op_SpecInterface to i32 (i32, i8*, i32, i32, i8*, i32, i32, i8*, i8*, i8*, i32, i32, i32, i32, i8*, i8*, ...)*)(i32 %11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, 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), 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))
%13 = load i32, i32* %6
%14 = call i32 (i32, i8*, i32, i32, i8*, i32, i32, i8*, i8*, i8*, i32, i32, i32, i32, i8*, i8*, ...) bitcast (i32 (...)* @_ssdm_op_SpecInterface to i32 (i32, i8*, i32, i32, i8*, i32, i32, i8*, i8*, i8*, i32, i32, i32, i32, i8*, i8*, ...)*)(i32 %13, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, 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), 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))
%15 = load i32*, i32** %7
%16 = call i32 (i32*, i8*, i32, i32, i8*, i32, i32, i8*, i8*, i8*, i32, i32, i32, i32, i8*, i8*, ...) bitcast (i32 (...)* @_ssdm_op_SpecInterface to i32 (i32*, i8*, i32, i32, i8*, i32, i32, i8*, i8*, i8*, i32, i32, i32, i32, i8*, i8*, ...)*)(i32* %15, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, 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), 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))
%17 = load i8, i8* %8
%18 = trunc i8 %17 to i1
%19 = zext i1 %18 to i32
%20 = call i32 (i32, i8*, i32, i32, i8*, i32, i32, i8*, i8*, i8*, i32, i32, i32, i32, i8*, i8*, ...) bitcast (i32 (...)* @_ssdm_op_SpecInterface to i32 (i32, i8*, i32, i32, i8*, i32, i32, i8*, i8*, i8*, i32, i32, i32, i32, i8*, i8*, ...)*)(i32 %19, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, 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), 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))
%21 = load i8, i8* %8
%22 = trunc i8 %21 to i1
br i1 %22, label %23, label %24
23: ; preds = %4
store i32 0, i32* @hls_macc.acc_reg
br label %24
24: ; preds = %23, %4
%25 = load i32, i32* %5
%26 = load i32, i32* %6
%27 = mul nsw i32 %25, %26
%28 = load i32, i32* @hls_macc.acc_reg
%29 = add nsw i32 %28, %27
store i32 %29, i32* @hls_macc.acc_reg
%30 = load i32, i32* @hls_macc.acc_reg
%31 = load i32*, i32** %7
store i32 %30, i32* %31
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"s_axilite\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [20 x i8] c"HLS_MACC_PERIPH_BUS\00"
@hls_macc.acc_reg = internal unnamed_addr global i32 0
define void @hls_macc(i32 %0, i32 %1, i32* %2, i1 zeroext %3) {
%5 = tail call i32 (i32, i8*, i32, i32, i8*, i32, i32, i8*, i8*, i8*, i32, i32, i32, i32, i8*, i8*, ...) bitcast (i32 (...)* @_ssdm_op_SpecInterface to i32 (i32, i8*, i32, i32, i8*, i32, i32, i8*, i8*, i8*, i32, i32, i32, i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, 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), 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))
%6 = tail call i32 (i32, i8*, i32, i32, i8*, i32, i32, i8*, i8*, i8*, i32, i32, i32, i32, i8*, i8*, ...) bitcast (i32 (...)* @_ssdm_op_SpecInterface to i32 (i32, i8*, i32, i32, i8*, i32, i32, i8*, i8*, i8*, i32, i32, i32, i32, i8*, i8*, ...)*)(i32 %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, 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), 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))
%7 = tail call i32 (i32, i8*, i32, i32, i8*, i32, i32, i8*, i8*, i8*, i32, i32, i32, i32, i8*, i8*, ...) bitcast (i32 (...)* @_ssdm_op_SpecInterface to i32 (i32, i8*, i32, i32, i8*, i32, i32, i8*, i8*, i8*, i32, i32, i32, i32, i8*, i8*, ...)*)(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, 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), 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))
%8 = tail call i32 (i32*, i8*, i32, i32, i8*, i32, i32, i8*, i8*, i8*, i32, i32, i32, i32, i8*, i8*, ...) bitcast (i32 (...)* @_ssdm_op_SpecInterface to i32 (i32*, i8*, i32, i32, i8*, i32, i32, i8*, i8*, i8*, i32, i32, i32, i32, i8*, i8*, ...)*)(i32* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, 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), 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))
%9 = zext i1 %3 to i32
%10 = tail call i32 (i32, i8*, i32, i32, i8*, i32, i32, i8*, i8*, i8*, i32, i32, i32, i32, i8*, i8*, ...) bitcast (i32 (...)* @_ssdm_op_SpecInterface to i32 (i32, i8*, i32, i32, i8*, i32, i32, i8*, i8*, i8*, i32, i32, i32, i32, i8*, i8*, ...)*)(i32 %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, 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), 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))
%11 = load i32, i32* @hls_macc.acc_reg
%12 = select i1 %3, i32 0, i32 %11
%13 = mul nsw i32 %1, %0
%14 = add nsw i32 %12, %13
store i32 %14, i32* @hls_macc.acc_reg
store i32 %14, i32* %2
ret void
}