#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 boltzmann_cos(double, int);
double boltzmann_sin(double, int);
int /*<<< orphan*/ derivs_one(double *, double *, double const *);
void derivs_three(double *y, double *dxdt, const double *p, const double *kij) {
  double bm_cos[3], bm_sin[3];
  bm_cos[0] = boltzmann_cos(y[0], 10.);
  bm_cos[1] = boltzmann_cos(y[1], 10.);
  bm_cos[2] = boltzmann_cos(y[2 * 1], 10.);
  bm_sin[0] = boltzmann_sin(y[0], 10.);
  bm_sin[1] = boltzmann_sin(y[1], 10.);
  bm_sin[2] = boltzmann_sin(y[2 * 1], 10.);
  derivs_one(y, dxdt, p);
  derivs_one(y + 1, dxdt + 1, p + 2);
  derivs_one(y + 2 * 1, dxdt + 2 * 1, p + 2 * 2);
  dxdt[0] -= (kij[0] * bm_cos[1] + kij[1] * bm_cos[2]) * (1. - 2. * bm_sin[0]);
  dxdt[1] -= (kij[2] * bm_cos[0] + kij[3] * bm_cos[2]) * (1. - 2. * bm_sin[1]);
  dxdt[2 * 1] -=
      (kij[4] * bm_cos[0] + kij[5] * bm_cos[1]) * (1. - 2. * bm_sin[2]);
}


x86 assembly (clang, -O0):
<derivs_three>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    $0xa,%edi
call   1040 <boltzmann_cos@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    $0xa,%edi
call   1040 <boltzmann_cos@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    $0xa,%edi
call   1040 <boltzmann_cos@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    $0xa,%edi
call   1030 <boltzmann_sin@plt>
movsd  %xmm0,-0x60(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    $0xa,%edi
call   1030 <boltzmann_sin@plt>
movsd  %xmm0,-0x58(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    $0xa,%edi
call   1030 <boltzmann_sin@plt>
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <derivs_one@plt>
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
mov    -0x18(%rbp),%rdx
add    $0x10,%rdx
call   1050 <derivs_one@plt>
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
mov    -0x10(%rbp),%rsi
add    $0x10,%rsi
mov    -0x18(%rbp),%rdx
add    $0x20,%rdx
call   1050 <derivs_one@plt>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x60(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xdab(%rip),%xmm2
subsd  %xmm1,%xmm2
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
movq   %xmm0,%rcx
movabs $0x8000000000000000,%rdx
xor    %rdx,%rcx
movq   %rcx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x40(%rbp),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x58(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xd47(%rip),%xmm2
subsd  %xmm1,%xmm2
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
movq   %xmm0,%rcx
movabs $0x8000000000000000,%rdx
xor    %rdx,%rcx
movq   %rcx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x20(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  -0x40(%rbp),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x28(%rax),%xmm1
mulsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x50(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xce1(%rip),%xmm2
subsd  %xmm1,%xmm2
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
movq   %xmm0,%rcx
movabs $0x8000000000000000,%rdx
xor    %rdx,%rcx
movq   %rcx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<derivs_three>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
mov    $0xa,%edi
call   1040 <boltzmann_cos@plt>
movsd  %xmm0,0x30(%rsp)
lea    0x8(%rbx),%rbp
movsd  0x8(%rbx),%xmm0
mov    $0xa,%edi
call   1040 <boltzmann_cos@plt>
movsd  %xmm0,0x18(%rsp)
lea    0x10(%rbx),%r13
movsd  0x10(%rbx),%xmm0
mov    $0xa,%edi
call   1040 <boltzmann_cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  (%rbx),%xmm0
mov    $0xa,%edi
call   1030 <boltzmann_sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rbx),%xmm0
mov    $0xa,%edi
call   1030 <boltzmann_sin@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x10(%rbx),%xmm0
mov    $0xa,%edi
call   1030 <boltzmann_sin@plt>
movsd  %xmm0,0x28(%rsp)
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1050 <derivs_one@plt>
lea    0x8(%r12),%rsi
lea    0x10(%r15),%rdx
mov    %rbp,%rdi
call   1050 <derivs_one@plt>
lea    0x10(%r12),%rsi
add    $0x20,%r15
mov    %r13,%rdi
mov    %r15,%rdx
call   1050 <derivs_one@plt>
movsd  0x8(%r14),%xmm0
movsd  0x10(%rsp),%xmm3
mulsd  %xmm3,%xmm0
movsd  (%r14),%xmm1
movsd  0x18(%rsp),%xmm5
mulsd  %xmm5,%xmm1
addsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm4
addsd  %xmm4,%xmm4
movsd  0xdca(%rip),%xmm0
movapd %xmm0,%xmm2
subsd  %xmm4,%xmm2
mulsd  %xmm1,%xmm2
movsd  (%r12),%xmm1
subsd  %xmm2,%xmm1
movsd  0x8(%r12),%xmm2
movsd  %xmm1,(%r12)
mulsd  0x18(%r14),%xmm3
movsd  0x10(%r14),%xmm1
movsd  0x30(%rsp),%xmm4
mulsd  %xmm4,%xmm1
addsd  %xmm3,%xmm1
movsd  0x20(%rsp),%xmm6
addsd  %xmm6,%xmm6
movapd %xmm0,%xmm3
subsd  %xmm6,%xmm3
mulsd  %xmm1,%xmm3
subsd  %xmm3,%xmm2
movsd  %xmm2,0x8(%r12)
movapd %xmm5,%xmm2
mulsd  0x28(%r14),%xmm2
movapd %xmm4,%xmm1
mulsd  0x20(%r14),%xmm1
addsd  %xmm2,%xmm1
movsd  0x28(%rsp),%xmm2
addsd  %xmm2,%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
movsd  0x10(%r12),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%r12)
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @derivs_three(double* %0, double* %1, double* %2, double* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca [3 x double]
%10 = alloca [3 x double]
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%11 = load double*, double** %5
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = call double @boltzmann_cos(double %13, i32 10)
%15 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 0
store double %14, double* %15
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = call double @boltzmann_cos(double %18, i32 10)
%20 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 1
store double %19, double* %20
%21 = load double*, double** %5
%22 = getelementptr inbounds double, double* %21, i64 2
%23 = load double, double* %22
%24 = call double @boltzmann_cos(double %23, i32 10)
%25 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 2
store double %24, double* %25
%26 = load double*, double** %5
%27 = getelementptr inbounds double, double* %26, i64 0
%28 = load double, double* %27
%29 = call double @boltzmann_sin(double %28, i32 10)
%30 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 0
store double %29, double* %30
%31 = load double*, double** %5
%32 = getelementptr inbounds double, double* %31, i64 1
%33 = load double, double* %32
%34 = call double @boltzmann_sin(double %33, i32 10)
%35 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 1
store double %34, double* %35
%36 = load double*, double** %5
%37 = getelementptr inbounds double, double* %36, i64 2
%38 = load double, double* %37
%39 = call double @boltzmann_sin(double %38, i32 10)
%40 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 2
store double %39, double* %40
%41 = load double*, double** %5
%42 = load double*, double** %6
%43 = load double*, double** %7
%44 = call i32 @derivs_one(double* %41, double* %42, double* %43)
%45 = load double*, double** %5
%46 = getelementptr inbounds double, double* %45, i64 1
%47 = load double*, double** %6
%48 = getelementptr inbounds double, double* %47, i64 1
%49 = load double*, double** %7
%50 = getelementptr inbounds double, double* %49, i64 2
%51 = call i32 @derivs_one(double* %46, double* %48, double* %50)
%52 = load double*, double** %5
%53 = getelementptr inbounds double, double* %52, i64 2
%54 = load double*, double** %6
%55 = getelementptr inbounds double, double* %54, i64 2
%56 = load double*, double** %7
%57 = getelementptr inbounds double, double* %56, i64 4
%58 = call i32 @derivs_one(double* %53, double* %55, double* %57)
%59 = load double*, double** %8
%60 = getelementptr inbounds double, double* %59, i64 0
%61 = load double, double* %60
%62 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 1
%63 = load double, double* %62
%64 = load double*, double** %8
%65 = getelementptr inbounds double, double* %64, i64 1
%66 = load double, double* %65
%67 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 2
%68 = load double, double* %67
%69 = fmul double %66, %68
%70 = call double @llvm.fmuladd.f64(double %61, double %63, double %69)
%71 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 0
%72 = load double, double* %71
%73 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %72, double 1.000000e+00)
%74 = load double*, double** %6
%75 = getelementptr inbounds double, double* %74, i64 0
%76 = load double, double* %75
%77 = fneg double %70
%78 = call double @llvm.fmuladd.f64(double %77, double %73, double %76)
store double %78, double* %75
%79 = load double*, double** %8
%80 = getelementptr inbounds double, double* %79, i64 2
%81 = load double, double* %80
%82 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 0
%83 = load double, double* %82
%84 = load double*, double** %8
%85 = getelementptr inbounds double, double* %84, i64 3
%86 = load double, double* %85
%87 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 2
%88 = load double, double* %87
%89 = fmul double %86, %88
%90 = call double @llvm.fmuladd.f64(double %81, double %83, double %89)
%91 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 1
%92 = load double, double* %91
%93 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %92, double 1.000000e+00)
%94 = load double*, double** %6
%95 = getelementptr inbounds double, double* %94, i64 1
%96 = load double, double* %95
%97 = fneg double %90
%98 = call double @llvm.fmuladd.f64(double %97, double %93, double %96)
store double %98, double* %95
%99 = load double*, double** %8
%100 = getelementptr inbounds double, double* %99, i64 4
%101 = load double, double* %100
%102 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 0
%103 = load double, double* %102
%104 = load double*, double** %8
%105 = getelementptr inbounds double, double* %104, i64 5
%106 = load double, double* %105
%107 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 1
%108 = load double, double* %107
%109 = fmul double %106, %108
%110 = call double @llvm.fmuladd.f64(double %101, double %103, double %109)
%111 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 2
%112 = load double, double* %111
%113 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %112, double 1.000000e+00)
%114 = load double*, double** %6
%115 = getelementptr inbounds double, double* %114, i64 2
%116 = load double, double* %115
%117 = fneg double %110
%118 = call double @llvm.fmuladd.f64(double %117, double %113, double %116)
store double %118, double* %115
ret void
}

LLVM IR (-O2):
define void @derivs_three(double* %0, double* %1, double* %2, double* nocapture %3) {
%5 = load double, double* %0
%6 = tail call double @boltzmann_cos(double %5, i32 10)
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = tail call double @boltzmann_cos(double %8, i32 10)
%10 = getelementptr inbounds double, double* %0, i64 2
%11 = load double, double* %10
%12 = tail call double @boltzmann_cos(double %11, i32 10)
%13 = load double, double* %0
%14 = tail call double @boltzmann_sin(double %13, i32 10)
%15 = load double, double* %7
%16 = tail call double @boltzmann_sin(double %15, i32 10)
%17 = load double, double* %10
%18 = tail call double @boltzmann_sin(double %17, i32 10)
%19 = tail call i32 @derivs_one(double* %0, double* %1, double* %2)
%20 = getelementptr inbounds double, double* %1, i64 1
%21 = getelementptr inbounds double, double* %2, i64 2
%22 = tail call i32 @derivs_one(double* %7, double* %20, double* %21)
%23 = getelementptr inbounds double, double* %1, i64 2
%24 = getelementptr inbounds double, double* %2, i64 4
%25 = tail call i32 @derivs_one(double* %10, double* %23, double* %24)
%26 = load double, double* %3
%27 = getelementptr inbounds double, double* %3, i64 1
%28 = load double, double* %27
%29 = fmul double %12, %28
%30 = tail call double @llvm.fmuladd.f64(double %26, double %9, double %29)
%31 = tail call double @llvm.fmuladd.f64(double %14, double -2.000000e+00, double 1.000000e+00)
%32 = load double, double* %1
%33 = fneg double %30
%34 = tail call double @llvm.fmuladd.f64(double %33, double %31, double %32)
store double %34, double* %1
%35 = getelementptr inbounds double, double* %3, i64 2
%36 = load double, double* %35
%37 = getelementptr inbounds double, double* %3, i64 3
%38 = load double, double* %37
%39 = fmul double %12, %38
%40 = tail call double @llvm.fmuladd.f64(double %36, double %6, double %39)
%41 = tail call double @llvm.fmuladd.f64(double %16, double -2.000000e+00, double 1.000000e+00)
%42 = load double, double* %20
%43 = fneg double %40
%44 = tail call double @llvm.fmuladd.f64(double %43, double %41, double %42)
store double %44, double* %20
%45 = getelementptr inbounds double, double* %3, i64 4
%46 = load double, double* %45
%47 = getelementptr inbounds double, double* %3, i64 5
%48 = load double, double* %47
%49 = fmul double %9, %48
%50 = tail call double @llvm.fmuladd.f64(double %46, double %6, double %49)
%51 = tail call double @llvm.fmuladd.f64(double %18, double -2.000000e+00, double 1.000000e+00)
%52 = load double, double* %23
%53 = fneg double %50
%54 = tail call double @llvm.fmuladd.f64(double %53, double %51, double %52)
store double %54, double* %23
ret void
}