#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*/ sgemm_(char *, char *, int *, int *, int *, float *,
                          float const *, int *, float const *, int *, float *,
                          float *, int *);
void add_matmul(int d, int na, int nb, const float *a, int lda, const float *b,
                int ldb, float *dist2, int ldd) {
  float minus_two = -2;
  float one = 1;
  sgemm_("Transposed", "Not trans", &na, &nb, &d, &minus_two, a, &lda, b, &ldb,
         &one, dist2, &ldd);
}


x86 assembly (clang, -O0):
<add_matmul>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x70,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %edi,-0x24(%rbp)
mov    %esi,-0x28(%rbp)
mov    %edx,-0x2c(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %r8d,-0x3c(%rbp)
mov    %r9,-0x48(%rbp)
movss  0xebe(%rip),%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  0xead(%rip),%xmm0
movss  %xmm0,-0x50(%rbp)
mov    -0x38(%rbp),%r12
mov    -0x48(%rbp),%r14
mov    0x18(%rbp),%r10
lea    0xe9d(%rip),%rdi
lea    0xea1(%rip),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x2c(%rbp),%rcx
lea    -0x24(%rbp),%r8
lea    -0x4c(%rbp),%r9
lea    -0x3c(%rbp),%r15
lea    0x10(%rbp),%rbx
lea    -0x50(%rbp),%r11
lea    0x20(%rbp),%rax
mov    %r12,(%rsp)
mov    %r15,0x8(%rsp)
mov    %r14,0x10(%rsp)
mov    %rbx,0x18(%rsp)
mov    %r11,0x20(%rsp)
mov    %r10,0x28(%rsp)
mov    %rax,0x30(%rsp)
call   1030 <sgemm_@plt>
add    $0x70,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_matmul>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,%rax
mov    %rcx,%r10
mov    0x48(%rsp),%r11
mov    %edi,0x14(%rsp)
mov    %esi,0x10(%rsp)
mov    %edx,0xc(%rsp)
mov    %r8d,0x8(%rsp)
movl   $0xc0000000,0x4(%rsp)
c0
movl   $0x3f800000,(%rsp)
sub    $0x8,%rsp
lea    0x58(%rsp),%rbx
lea    0x8(%rsp),%r14
lea    0x48(%rsp),%r15
lea    0x10(%rsp),%r12
lea    0xe9b(%rip),%rdi
lea    0xe9f(%rip),%rsi
lea    0x18(%rsp),%rdx
lea    0x14(%rsp),%rcx
lea    0x1c(%rsp),%r8
lea    0xc(%rsp),%r9
push   %rbx
push   %r11
push   %r14
push   %r15
push   %rax
push   %r12
push   %r10
call   1030 <sgemm_@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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