#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 Sq(double const);
double cos(double const);
double exp(double const);
double sin(double const);
int Integrand(const int *ndim, const double xx[], const int *ncomp, double ff[],
              void *userdata) {
  const double rsq = Sq(xx[0]) + Sq(xx[1]) + Sq(xx[2]);
  ff[0] = sin(xx[0]) * cos(xx[1]) * exp(xx[2]);
  return 0;
}


x86 assembly (clang, -O0):
<Integrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1050 <Sq@plt>
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
call   1050 <Sq@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
call   1050 <Sq@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
call   1040 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Integrand>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rsi,%rbx
movsd  (%rsi),%xmm0
call   1050 <Sq@plt>
movsd  0x8(%rbx),%xmm0
call   1050 <Sq@plt>
movsd  0x10(%rbx),%xmm0
call   1050 <Sq@plt>
movsd  (%rbx),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rbx),%xmm0
call   1060 <cos@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rbx),%xmm0
call   1040 <exp@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @Integrand(i32* %0, double* %1, i32* %2, double* %3, i8* %4) {
%6 = alloca i32*
%7 = alloca double*
%8 = alloca i32*
%9 = alloca double*
%10 = alloca i8*
%11 = alloca double
store i32* %0, i32** %6
store double* %1, double** %7
store i32* %2, i32** %8
store double* %3, double** %9
store i8* %4, i8** %10
%12 = load double*, double** %7
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = call double @Sq(double %14)
%16 = load double*, double** %7
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = call double @Sq(double %18)
%20 = fadd double %15, %19
%21 = load double*, double** %7
%22 = getelementptr inbounds double, double* %21, i64 2
%23 = load double, double* %22
%24 = call double @Sq(double %23)
%25 = fadd double %20, %24
store double %25, double* %11
%26 = load double*, double** %7
%27 = getelementptr inbounds double, double* %26, i64 0
%28 = load double, double* %27
%29 = call double @sin(double %28)
%30 = load double*, double** %7
%31 = getelementptr inbounds double, double* %30, i64 1
%32 = load double, double* %31
%33 = call double @cos(double %32)
%34 = fmul double %29, %33
%35 = load double*, double** %7
%36 = getelementptr inbounds double, double* %35, i64 2
%37 = load double, double* %36
%38 = call double @exp(double %37)
%39 = fmul double %34, %38
%40 = load double*, double** %9
%41 = getelementptr inbounds double, double* %40, i64 0
store double %39, double* %41
ret i32 0
}

LLVM IR (-O2):
define i32 @Integrand(i32* nocapture readnone %0, double* nocapture %1, i32* nocapture readnone %2, double* nocapture writeonly %3, i8* nocapture readnone %4) {
%6 = load double, double* %1
%7 = tail call double @Sq(double %6)
%8 = getelementptr inbounds double, double* %1, i64 1
%9 = load double, double* %8
%10 = tail call double @Sq(double %9)
%11 = getelementptr inbounds double, double* %1, i64 2
%12 = load double, double* %11
%13 = tail call double @Sq(double %12)
%14 = load double, double* %1
%15 = tail call double @sin(double %14)
%16 = load double, double* %8
%17 = tail call double @cos(double %16)
%18 = fmul double %15, %17
%19 = load double, double* %11
%20 = tail call double @exp(double %19)
%21 = fmul double %18, %20
store double %21, double* %3
ret i32 0
}