#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 */
double exp(double);
double sin(double);
double get_bij(int i, int j, double *adirissa, double *weight) {
  double ret;
  ret = weight[j] * exp(-2.0 * adirissa[j]) * sin(adirissa[i]);
  return ret;
}


x86 assembly (clang, -O0):
<get_bij>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  0xea8(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
call   1040 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bij>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %edi,%ebp
movslq %esi,%rax
movsd  (%rcx,%rax,8),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rdx,%rax,8),%xmm0
mulsd  0xebe(%rip),%xmm0
call   1040 <exp@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movslq %ebp,%rax
movsd  (%rbx,%rax,8),%xmm0
call   1030 <sin@plt>
mulsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @get_bij(i32 %0, i32 %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
store i32 %0, i32* %5
store i32 %1, i32* %6
store double* %2, double** %7
store double* %3, double** %8
%10 = load double*, double** %8
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds double, double* %10, i64 %12
%14 = load double, double* %13
%15 = load double*, double** %7
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %15, i64 %17
%19 = load double, double* %18
%20 = fmul double -2.000000e+00, %19
%21 = call double @exp(double %20)
%22 = fmul double %14, %21
%23 = load double*, double** %7
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %23, i64 %25
%27 = load double, double* %26
%28 = call double @sin(double %27)
%29 = fmul double %22, %28
store double %29, double* %9
%30 = load double, double* %9
ret double %30
}

LLVM IR (-O2):
define double @get_bij(i32 %0, i32 %1, double* nocapture %2, double* nocapture %3) {
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds double, double* %3, i64 %5
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %2, i64 %5
%9 = load double, double* %8
%10 = fmul double %9, -2.000000e+00
%11 = tail call double @exp(double %10)
%12 = fmul double %7, %11
%13 = sext i32 %0 to i64
%14 = getelementptr inbounds double, double* %2, i64 %13
%15 = load double, double* %14
%16 = tail call double @sin(double %15)
%17 = fmul double %12, %16
ret double %17
}