#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 */
int exp(double);
void updateWeight(double *w, double rU, double pspTilde, double rV,
                  double psp) {
  *w += .5 * .1 *
        ((1. - exp(-.1 * (1. / 9 - 1. / 600))) * rU * pspTilde - rV * psp);
}


x86 assembly (clang, -O0):
<updateWeight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  0xed8(%rip),%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm1
movsd  0xebf(%rip),%xmm0
subsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  0xe70(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateWeight>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm3,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,(%rsp)
mov    %rdi,%rbx
movsd  0xec9(%rip),%xmm0
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xebd(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
mulsd  0x18(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xe9e(%rip),%xmm1
addsd  (%rbx),%xmm1
movsd  %xmm1,(%rbx)
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @updateWeight(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 = call i32 @exp(double 0xBF866A0A77B1B88C)
%12 = sitofp i32 %11 to double
%13 = fsub double 1.000000e+00, %12
%14 = load double, double* %7
%15 = fmul double %13, %14
%16 = load double, double* %8
%17 = load double, double* %9
%18 = load double, double* %10
%19 = fmul double %17, %18
%20 = fneg double %19
%21 = call double @llvm.fmuladd.f64(double %15, double %16, double %20)
%22 = load double*, double** %6
%23 = load double, double* %22
%24 = call double @llvm.fmuladd.f64(double 5.000000e-02, double %21, double %23)
store double %24, double* %22
ret void
}

LLVM IR (-O2):
define void @updateWeight(double* nocapture %0, double %1, double %2, double %3, double %4) {
%6 = tail call i32 @exp(double 0xBF866A0A77B1B88C)
%7 = sitofp i32 %6 to double
%8 = fsub double 1.000000e+00, %7
%9 = fmul double %8, %1
%10 = fneg double %3
%11 = fmul double %10, %4
%12 = tail call double @llvm.fmuladd.f64(double %9, double %2, double %11)
%13 = load double, double* %0
%14 = tail call double @llvm.fmuladd.f64(double %12, double 5.000000e-02, double %13)
store double %14, double* %0
ret void
}