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


x86 assembly (clang, -O0):
<derivs_three>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <boltzmann@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <boltzmann@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <boltzmann@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <derivs_one@plt>
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
mov    -0x10(%rbp),%rsi
add    $0x10,%rsi
mov    -0x18(%rbp),%rdx
add    $0x30,%rdx
call   1040 <derivs_one@plt>
mov    -0x8(%rbp),%rdi
add    $0x20,%rdi
mov    -0x10(%rbp),%rsi
add    $0x20,%rsi
mov    -0x18(%rbp),%rdx
add    $0x60,%rdx
call   1040 <derivs_one@plt>
mov    -0x18(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x38(%rbp),%xmm3
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0x50(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm2
movsd  -0x40(%rbp),%xmm3
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x18(%rbp),%rax
movsd  0x80(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x20(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  0x20(%rax),%xmm2
movsd  -0x40(%rbp),%xmm3
mov    -0x20(%rbp),%rax
movsd  0x28(%rax),%xmm1
mulsd  -0x38(%rbp),%xmm1
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x20(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<derivs_three>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%r14
mov    %rdx,%r12
mov    %rsi,%r15
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <boltzmann@plt>
movsd  %xmm0,0x10(%rsp)
lea    0x10(%rbx),%r13
movsd  0x10(%rbx),%xmm0
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <boltzmann@plt>
movsd  %xmm0,0x8(%rsp)
lea    0x20(%rbx),%rbp
movsd  0x20(%rbx),%xmm0
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <boltzmann@plt>
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1040 <derivs_one@plt>
lea    0x10(%r15),%rsi
lea    0x30(%r12),%rdx
mov    %r13,%rdi
call   1040 <derivs_one@plt>
lea    0x20(%r15),%rsi
lea    0x60(%r12),%rdx
mov    %rbp,%rdi
call   1040 <derivs_one@plt>
movsd  0x20(%r12),%xmm0
subsd  (%rbx),%xmm0
movsd  0x8(%r14),%xmm1
movsd  (%rsp),%xmm4
mulsd  %xmm4,%xmm1
movsd  (%r14),%xmm2
movsd  0x8(%rsp),%xmm3
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
addsd  (%r15),%xmm2
movsd  %xmm2,(%r15)
movsd  0x50(%r12),%xmm0
subsd  0x10(%rbx),%xmm0
mulsd  0x18(%r14),%xmm4
movsd  0x10(%r14),%xmm1
movsd  0x10(%rsp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm4,%xmm1
mulsd  %xmm0,%xmm1
addsd  0x10(%r15),%xmm1
movsd  %xmm1,0x10(%r15)
movsd  0x80(%r12),%xmm0
subsd  0x20(%rbx),%xmm0
mulsd  0x28(%r14),%xmm3
movapd %xmm2,%xmm1
mulsd  0x20(%r14),%xmm1
addsd  %xmm3,%xmm1
mulsd  %xmm0,%xmm1
addsd  0x20(%r15),%xmm1
movsd  %xmm1,0x20(%r15)
add    $0x18,%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]
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = call double @boltzmann(double %12, i32 0, i32 100)
%14 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 0
store double %13, double* %14
%15 = load double*, double** %5
%16 = getelementptr inbounds double, double* %15, i64 2
%17 = load double, double* %16
%18 = call double @boltzmann(double %17, i32 0, i32 100)
%19 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 1
store double %18, double* %19
%20 = load double*, double** %5
%21 = getelementptr inbounds double, double* %20, i64 4
%22 = load double, double* %21
%23 = call double @boltzmann(double %22, i32 0, i32 100)
%24 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 2
store double %23, double* %24
%25 = load double*, double** %5
%26 = load double*, double** %6
%27 = load double*, double** %7
%28 = call i32 @derivs_one(double* %25, double* %26, double* %27)
%29 = load double*, double** %5
%30 = getelementptr inbounds double, double* %29, i64 2
%31 = load double*, double** %6
%32 = getelementptr inbounds double, double* %31, i64 2
%33 = load double*, double** %7
%34 = getelementptr inbounds double, double* %33, i64 6
%35 = call i32 @derivs_one(double* %30, double* %32, double* %34)
%36 = load double*, double** %5
%37 = getelementptr inbounds double, double* %36, i64 4
%38 = load double*, double** %6
%39 = getelementptr inbounds double, double* %38, i64 4
%40 = load double*, double** %7
%41 = getelementptr inbounds double, double* %40, i64 12
%42 = call i32 @derivs_one(double* %37, double* %39, double* %41)
%43 = load double*, double** %7
%44 = getelementptr inbounds double, double* %43, i64 4
%45 = load double, double* %44
%46 = load double*, double** %5
%47 = getelementptr inbounds double, double* %46, i64 0
%48 = load double, double* %47
%49 = fsub double %45, %48
%50 = load double*, double** %8
%51 = getelementptr inbounds double, double* %50, i64 0
%52 = load double, double* %51
%53 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 1
%54 = load double, double* %53
%55 = load double*, double** %8
%56 = getelementptr inbounds double, double* %55, i64 1
%57 = load double, double* %56
%58 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 2
%59 = load double, double* %58
%60 = fmul double %57, %59
%61 = call double @llvm.fmuladd.f64(double %52, double %54, double %60)
%62 = load double*, double** %6
%63 = getelementptr inbounds double, double* %62, i64 0
%64 = load double, double* %63
%65 = call double @llvm.fmuladd.f64(double %49, double %61, double %64)
store double %65, double* %63
%66 = load double*, double** %7
%67 = getelementptr inbounds double, double* %66, i64 10
%68 = load double, double* %67
%69 = load double*, double** %5
%70 = getelementptr inbounds double, double* %69, i64 2
%71 = load double, double* %70
%72 = fsub double %68, %71
%73 = load double*, double** %8
%74 = getelementptr inbounds double, double* %73, i64 2
%75 = load double, double* %74
%76 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 0
%77 = load double, double* %76
%78 = load double*, double** %8
%79 = getelementptr inbounds double, double* %78, i64 3
%80 = load double, double* %79
%81 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 2
%82 = load double, double* %81
%83 = fmul double %80, %82
%84 = call double @llvm.fmuladd.f64(double %75, double %77, double %83)
%85 = load double*, double** %6
%86 = getelementptr inbounds double, double* %85, i64 2
%87 = load double, double* %86
%88 = call double @llvm.fmuladd.f64(double %72, double %84, double %87)
store double %88, double* %86
%89 = load double*, double** %7
%90 = getelementptr inbounds double, double* %89, i64 16
%91 = load double, double* %90
%92 = load double*, double** %5
%93 = getelementptr inbounds double, double* %92, i64 4
%94 = load double, double* %93
%95 = fsub double %91, %94
%96 = load double*, double** %8
%97 = getelementptr inbounds double, double* %96, i64 4
%98 = load double, double* %97
%99 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 0
%100 = load double, double* %99
%101 = load double*, double** %8
%102 = getelementptr inbounds double, double* %101, i64 5
%103 = load double, double* %102
%104 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 1
%105 = load double, double* %104
%106 = fmul double %103, %105
%107 = call double @llvm.fmuladd.f64(double %98, double %100, double %106)
%108 = load double*, double** %6
%109 = getelementptr inbounds double, double* %108, i64 4
%110 = load double, double* %109
%111 = call double @llvm.fmuladd.f64(double %95, double %107, double %110)
store double %111, double* %109
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(double %5, i32 0, i32 100)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call double @boltzmann(double %8, i32 0, i32 100)
%10 = getelementptr inbounds double, double* %0, i64 4
%11 = load double, double* %10
%12 = tail call double @boltzmann(double %11, i32 0, i32 100)
%13 = tail call i32 @derivs_one(double* %0, double* %1, double* %2)
%14 = getelementptr inbounds double, double* %1, i64 2
%15 = getelementptr inbounds double, double* %2, i64 6
%16 = tail call i32 @derivs_one(double* %7, double* %14, double* %15)
%17 = getelementptr inbounds double, double* %1, i64 4
%18 = getelementptr inbounds double, double* %2, i64 12
%19 = tail call i32 @derivs_one(double* %10, double* %17, double* %18)
%20 = getelementptr inbounds double, double* %2, i64 4
%21 = load double, double* %20
%22 = load double, double* %0
%23 = fsub double %21, %22
%24 = load double, double* %3
%25 = getelementptr inbounds double, double* %3, i64 1
%26 = load double, double* %25
%27 = fmul double %12, %26
%28 = tail call double @llvm.fmuladd.f64(double %24, double %9, double %27)
%29 = load double, double* %1
%30 = tail call double @llvm.fmuladd.f64(double %23, double %28, double %29)
store double %30, double* %1
%31 = getelementptr inbounds double, double* %2, i64 10
%32 = load double, double* %31
%33 = load double, double* %7
%34 = fsub double %32, %33
%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 = load double, double* %14
%42 = tail call double @llvm.fmuladd.f64(double %34, double %40, double %41)
store double %42, double* %14
%43 = getelementptr inbounds double, double* %2, i64 16
%44 = load double, double* %43
%45 = load double, double* %10
%46 = fsub double %44, %45
%47 = getelementptr inbounds double, double* %3, i64 4
%48 = load double, double* %47
%49 = getelementptr inbounds double, double* %3, i64 5
%50 = load double, double* %49
%51 = fmul double %9, %50
%52 = tail call double @llvm.fmuladd.f64(double %48, double %6, double %51)
%53 = load double, double* %17
%54 = tail call double @llvm.fmuladd.f64(double %46, double %52, double %53)
store double %54, double* %17
ret void
}