#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 M_PI;
double cos(double);
double pow(double, int);
double sin(double);
double Q_phi_diffusion(double Gamma, double L, double a_phix, double a_phiy,
                       double a_phiz, double phi_x, double phi_y, double phi_z,
                       double x, double y, double z) {
  return Gamma * pow(M_PI, 2) *
         (phi_x * pow(a_phix, 2) * cos(M_PI * a_phix * x / L) +
          phi_y * pow(a_phiy, 2) * cos(M_PI * a_phiy * y / L) +
          phi_z * pow(a_phiz, 2) * sin(M_PI * a_phiz * z / L)) /
         pow(L, 2);
}


x86 assembly (clang, -O0):
<Q_phi_diffusion>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movsd  0x20(%rbp),%xmm8
movsd  0x18(%rbp),%xmm8
movsd  0x10(%rbp),%xmm8
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  %xmm7,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    0x2e5f(%rip),%rax
movsd  (%rax),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x98(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x90(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    0x2e06(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  0x10(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    0x2db2(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  0x18(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movsd  -0x80(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x70(%rbp),%xmm0
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    0x2d46(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  0x20(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x60(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_phi_diffusion>:
push   %rbx
sub    $0x40,%rsp
movsd  %xmm7,0x38(%rsp)
movsd  %xmm6,0x30(%rsp)
movsd  %xmm5,0x20(%rsp)
movsd  %xmm4,0x8(%rsp)
movsd  %xmm3,(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x28(%rsp)
mov    0x2e7d(%rip),%rbx
movsd  (%rbx),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mulsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x10(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movsd  0x10(%rsp),%xmm1
mulsd  (%rbx),%xmm1
mulsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
mulsd  0x50(%rsp),%xmm1
divsd  0x18(%rsp),%xmm1
movapd %xmm1,%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0x20(%rsp)
movsd  (%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movsd  (%rsp),%xmm1
mulsd  (%rbx),%xmm1
mulsd  0x30(%rsp),%xmm0
movsd  %xmm0,(%rsp)
mulsd  0x58(%rsp),%xmm1
divsd  0x18(%rsp),%xmm1
movapd %xmm1,%xmm0
call   1040 <cos@plt>
mulsd  (%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movsd  0x8(%rsp),%xmm1
mulsd  (%rbx),%xmm1
mulsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mulsd  0x60(%rsp),%xmm1
divsd  0x18(%rsp),%xmm1
movapd %xmm1,%xmm0
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
addsd  (%rsp),%xmm0
mulsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @Q_phi_diffusion(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double %10) {
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
store double %0, double* %12
store double %1, double* %13
store double %2, double* %14
store double %3, double* %15
store double %4, double* %16
store double %5, double* %17
store double %6, double* %18
store double %7, double* %19
store double %8, double* %20
store double %9, double* %21
store double %10, double* %22
%23 = load double, double* %12
%24 = load double, double* @M_PI
%25 = call double @pow(double %24, i32 2)
%26 = fmul double %23, %25
%27 = load double, double* %17
%28 = load double, double* %14
%29 = call double @pow(double %28, i32 2)
%30 = fmul double %27, %29
%31 = load double, double* @M_PI
%32 = load double, double* %14
%33 = fmul double %31, %32
%34 = load double, double* %20
%35 = fmul double %33, %34
%36 = load double, double* %13
%37 = fdiv double %35, %36
%38 = call double @cos(double %37)
%39 = load double, double* %18
%40 = load double, double* %15
%41 = call double @pow(double %40, i32 2)
%42 = fmul double %39, %41
%43 = load double, double* @M_PI
%44 = load double, double* %15
%45 = fmul double %43, %44
%46 = load double, double* %21
%47 = fmul double %45, %46
%48 = load double, double* %13
%49 = fdiv double %47, %48
%50 = call double @cos(double %49)
%51 = fmul double %42, %50
%52 = call double @llvm.fmuladd.f64(double %30, double %38, double %51)
%53 = load double, double* %19
%54 = load double, double* %16
%55 = call double @pow(double %54, i32 2)
%56 = fmul double %53, %55
%57 = load double, double* @M_PI
%58 = load double, double* %16
%59 = fmul double %57, %58
%60 = load double, double* %22
%61 = fmul double %59, %60
%62 = load double, double* %13
%63 = fdiv double %61, %62
%64 = call double @sin(double %63)
%65 = call double @llvm.fmuladd.f64(double %56, double %64, double %52)
%66 = fmul double %26, %65
%67 = load double, double* %13
%68 = call double @pow(double %67, i32 2)
%69 = fdiv double %66, %68
ret double %69
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @Q_phi_diffusion(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double %10) {
%12 = load double, double* @M_PI
%13 = tail call double @pow(double %12, i32 2)
%14 = fmul double %13, %0
%15 = tail call double @pow(double %2, i32 2)
%16 = fmul double %15, %5
%17 = load double, double* @M_PI
%18 = fmul double %17, %2
%19 = fmul double %18, %8
%20 = fdiv double %19, %1
%21 = tail call double @cos(double %20)
%22 = tail call double @pow(double %3, i32 2)
%23 = fmul double %22, %6
%24 = load double, double* @M_PI
%25 = fmul double %24, %3
%26 = fmul double %25, %9
%27 = fdiv double %26, %1
%28 = tail call double @cos(double %27)
%29 = fmul double %23, %28
%30 = tail call double @llvm.fmuladd.f64(double %16, double %21, double %29)
%31 = tail call double @pow(double %4, i32 2)
%32 = fmul double %31, %7
%33 = load double, double* @M_PI
%34 = fmul double %33, %4
%35 = fmul double %34, %10
%36 = fdiv double %35, %1
%37 = tail call double @sin(double %36)
%38 = tail call double @llvm.fmuladd.f64(double %32, double %37, double %30)
%39 = fmul double %14, %38
%40 = tail call double @pow(double %1, i32 2)
%41 = fdiv double %39, %40
ret double %41
}