#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*/ sgemv_(char *, int *, int *, float *, float const *, int *,
                          float const *, int *, float *, float *, int *);
void add_matvecmul(int d, int nb, const float *a, const float *b, int ldb,
                   float *dist2) {
  float minus_two = -2;
  float one = 1;
  int ione = 1;
  sgemv_("Transposed", &d, &nb, &minus_two, b, &ldb, a, &ione, &one, dist2,
         &ione);
}


x86 assembly (clang, -O0):
<add_matvecmul>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x68,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
movss  0xecd(%rip),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  0xebc(%rip),%xmm0
movss  %xmm0,-0x38(%rbp)
movl   $0x1,-0x3c(%rbp)
mov    -0x20(%rbp),%r8
mov    -0x18(%rbp),%rbx
mov    -0x30(%rbp),%r10
lea    0xea5(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x34(%rbp),%rcx
lea    -0x24(%rbp),%r9
lea    -0x3c(%rbp),%rax
lea    -0x38(%rbp),%r11
mov    %rbx,(%rsp)
mov    %rax,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   1030 <sgemv_@plt>
add    $0x68,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_matvecmul>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %r9,%r11
mov    %rcx,%rax
mov    %rdx,%r10
mov    %edi,0x14(%rsp)
mov    %esi,0x10(%rsp)
mov    %r8d,0xc(%rsp)
movl   $0xc0000000,0x8(%rsp)
c0
movl   $0x3f800000,0x4(%rsp)
3f
movl   $0x1,(%rsp)
sub    $0x8,%rsp
lea    0x8(%rsp),%rbx
lea    0xc(%rsp),%r14
lea    0xea7(%rip),%rdi
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0x14(%rsp),%r9
mov    %rax,%r8
push   %rbx
push   %r11
push   %r14
push   %rbx
push   %r10
call   1030 <sgemv_@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Transposed\00"
define void @add_matvecmul(i32 %0, i32 %1, float* %2, float* %3, i32 %4, float* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca float*
%10 = alloca float*
%11 = alloca i32
%12 = alloca float*
%13 = alloca float
%14 = alloca float
%15 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store float* %2, float** %9
store float* %3, float** %10
store i32 %4, i32* %11
store float* %5, float** %12
store float -2.000000e+00, float* %13
store float 1.000000e+00, float* %14
store i32 1, i32* %15
%16 = load float*, float** %10
%17 = load float*, float** %9
%18 = load float*, float** %12
%19 = call i32 @sgemv_(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* %7, i32* %8, float* %13, float* %16, i32* %11, float* %17, i32* %15, float* %14, float* %18, i32* %15)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Transposed\00"
define void @add_matvecmul(i32 %0, i32 %1, float* %2, float* %3, i32 %4, float* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca float
%11 = alloca float
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %4, i32* %9
%13 = bitcast float* %10 to i8*
store float -2.000000e+00, float* %10
%14 = bitcast float* %11 to i8*
store float 1.000000e+00, float* %11
%15 = bitcast i32* %12 to i8*
store i32 1, i32* %12
%16 = call i32 @sgemv_(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* %7, i32* %8, float* %10, float* %3, i32* %9, float* %2, i32* %12, float* %11, float* %5, i32* %12)
ret void
}