#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*/ dgemv_(char *, int *, int *, double *, double *, int *,
                          double *, int *, double *, double *, int *);
void matvec(double *A, double *B, double *C, double alpha, double beta,
            int nB) {
  char TRANS = 't';
  int m = nB;
  int n = nB;
  int LDA = nB;
  int INCX = 1;
  int INCY = 1;
  dgemv_(&TRANS, &m, &n, &alpha, A, &LDA, B, &INCX, &beta, C, &INCY);
  return;
}


x86 assembly (clang, -O0):
<matvec>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
movsd  %xmm0,-0x30(%rbp)
movsd  %xmm1,-0x38(%rbp)
mov    %ecx,-0x3c(%rbp)
movb   $0x74,-0x3d(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x4c(%rbp)
movl   $0x1,-0x50(%rbp)
movl   $0x1,-0x54(%rbp)
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r14
mov    -0x28(%rbp),%r10
lea    -0x3d(%rbp),%rdi
lea    -0x44(%rbp),%rsi
lea    -0x48(%rbp),%rdx
lea    -0x30(%rbp),%rcx
lea    -0x4c(%rbp),%r9
lea    -0x50(%rbp),%rbx
lea    -0x38(%rbp),%r11
lea    -0x54(%rbp),%rax
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   1030 <dgemv_@plt>
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<matvec>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdx,%rax
mov    %rsi,%r10
mov    %rdi,%r8
movsd  %xmm0,0x20(%rsp)
movsd  %xmm1,0x18(%rsp)
movb   $0x74,0x3(%rsp)
mov    %ecx,0x14(%rsp)
mov    %ecx,0x10(%rsp)
mov    %ecx,0xc(%rsp)
movl   $0x1,0x8(%rsp)
movl   $0x1,0x4(%rsp)
sub    $0x8,%rsp
lea    0xc(%rsp),%r11
lea    0x20(%rsp),%rbx
lea    0x10(%rsp),%r14
lea    0xb(%rsp),%rdi
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x28(%rsp),%rcx
lea    0x14(%rsp),%r9
push   %r11
push   %rax
push   %rbx
push   %r14
push   %r10
call   1030 <dgemv_@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @matvec(double* %0, double* %1, double* %2, double %3, double %4, i32 %5) {
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double
%11 = alloca double
%12 = alloca i32
%13 = alloca i8
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store double* %0, double** %7
store double* %1, double** %8
store double* %2, double** %9
store double %3, double* %10
store double %4, double* %11
store i32 %5, i32* %12
store i8 116, i8* %13
%19 = load i32, i32* %12
store i32 %19, i32* %14
%20 = load i32, i32* %12
store i32 %20, i32* %15
%21 = load i32, i32* %12
store i32 %21, i32* %16
store i32 1, i32* %17
store i32 1, i32* %18
%22 = load double*, double** %7
%23 = load double*, double** %8
%24 = load double*, double** %9
%25 = call i32 @dgemv_(i8* %13, i32* %14, i32* %15, double* %10, double* %22, i32* %16, double* %23, i32* %17, double* %11, double* %24, i32* %18)
ret void
}

LLVM IR (-O2):
define void @matvec(double* %0, double* %1, double* %2, double %3, double %4, i32 %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store double %3, double* %7
store double %4, double* %8
store i8 116, i8* %9
%15 = bitcast i32* %10 to i8*
store i32 %5, i32* %10
%16 = bitcast i32* %11 to i8*
store i32 %5, i32* %11
%17 = bitcast i32* %12 to i8*
store i32 %5, i32* %12
%18 = bitcast i32* %13 to i8*
store i32 1, i32* %13
%19 = bitcast i32* %14 to i8*
store i32 1, i32* %14
%20 = call i32 @dgemv_(i8* %9, i32* %10, i32* %11, double* %7, double* %0, i32* %12, double* %1, i32* %13, double* %8, double* %2, i32* %14)
ret void
}