#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 chem_fast(double, double, double *, double *);
double chem_slow(double, double *, double *);
void chem_syn(double v_post, double v_pre, double *g, double *ret,
              double *aux) {
  *ret = -(chem_fast(v_post, v_pre, &(g[0]), aux) +
           chem_slow(v_post, &(g[1]), aux));
  return;
}


x86 assembly (clang, -O0):
<chem_syn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <chem_fast@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rdi
add    $0x8,%rdi
mov    -0x28(%rbp),%rsi
call   1040 <chem_slow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chem_syn>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,(%rsp)
mov    %rdx,%rsi
call   1030 <chem_fast@plt>
movsd  %xmm0,0x8(%rsp)
add    $0x8,%rbx
movsd  (%rsp),%xmm0
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <chem_slow@plt>
addsd  0x8(%rsp),%xmm0
xorpd  0xe99(%rip),%xmm0
movlpd %xmm0,(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @chem_syn(double %0, double %1, double* %2, double* %3, double* %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
store double %0, double* %6
store double %1, double* %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%11 = load double, double* %6
%12 = load double, double* %7
%13 = load double*, double** %8
%14 = getelementptr inbounds double, double* %13, i64 0
%15 = load double*, double** %10
%16 = call double @chem_fast(double %11, double %12, double* %14, double* %15)
%17 = load double, double* %6
%18 = load double*, double** %8
%19 = getelementptr inbounds double, double* %18, i64 1
%20 = load double*, double** %10
%21 = call double @chem_slow(double %17, double* %19, double* %20)
%22 = fadd double %16, %21
%23 = fneg double %22
%24 = load double*, double** %9
store double %23, double* %24
ret void
}

LLVM IR (-O2):
define void @chem_syn(double %0, double %1, double* %2, double* nocapture writeonly %3, double* %4) {
%6 = tail call double @chem_fast(double %0, double %1, double* %2, double* %4)
%7 = getelementptr inbounds double, double* %2, i64 1
%8 = tail call double @chem_slow(double %0, double* %7, double* %4)
%9 = fadd double %6, %8
%10 = fneg double %9
store double %10, double* %3
ret void
}