#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 exp(double);
void ms_f(double *vars, double *ret, double *params, double v_pre) {
  double p1, p2, p3;
  p1 = params[0] * (1.0 - vars[0]);
  p2 = 1.0 + exp(params[2] * (params[3] - v_pre));
  p3 = params[1] * vars[0];
  ret[0] = (p1 / p2) - p3;
  return;
}


x86 assembly (clang, -O0):
<ms_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0xec3(%rip),%xmm1
subsd  (%rax),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm1
subsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xe8b(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms_f>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
movsd  0xed6(%rip),%xmm1
subsd  (%rdi),%xmm1
mulsd  (%rdx),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x18(%rdx),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x10(%rdx),%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
addsd  0xea9(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  0x8(%rbx),%xmm0
mulsd  (%r15),%xmm0
subsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ms_f(double* %0, double* %1, double* %2, double %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store double %3, double* %8
%12 = load double*, double** %7
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = load double*, double** %5
%16 = getelementptr inbounds double, double* %15, i64 0
%17 = load double, double* %16
%18 = fsub double 1.000000e+00, %17
%19 = fmul double %14, %18
store double %19, double* %9
%20 = load double*, double** %7
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = load double*, double** %7
%24 = getelementptr inbounds double, double* %23, i64 3
%25 = load double, double* %24
%26 = load double, double* %8
%27 = fsub double %25, %26
%28 = fmul double %22, %27
%29 = call double @exp(double %28)
%30 = fadd double 1.000000e+00, %29
store double %30, double* %10
%31 = load double*, double** %7
%32 = getelementptr inbounds double, double* %31, i64 1
%33 = load double, double* %32
%34 = load double*, double** %5
%35 = getelementptr inbounds double, double* %34, i64 0
%36 = load double, double* %35
%37 = fmul double %33, %36
store double %37, double* %11
%38 = load double, double* %9
%39 = load double, double* %10
%40 = fdiv double %38, %39
%41 = load double, double* %11
%42 = fsub double %40, %41
%43 = load double*, double** %6
%44 = getelementptr inbounds double, double* %43, i64 0
store double %42, double* %44
ret void
}

LLVM IR (-O2):
define void @ms_f(double* nocapture %0, double* nocapture writeonly %1, double* nocapture %2, double %3) {
%5 = load double, double* %2
%6 = load double, double* %0
%7 = fsub double 1.000000e+00, %6
%8 = fmul double %5, %7
%9 = getelementptr inbounds double, double* %2, i64 2
%10 = load double, double* %9
%11 = getelementptr inbounds double, double* %2, i64 3
%12 = load double, double* %11
%13 = fsub double %12, %3
%14 = fmul double %10, %13
%15 = tail call double @exp(double %14)
%16 = fadd double %15, 1.000000e+00
%17 = getelementptr inbounds double, double* %2, i64 1
%18 = load double, double* %17
%19 = load double, double* %0
%20 = fmul double %18, %19
%21 = fdiv double %8, %16
%22 = fsub double %21, %20
store double %22, double* %1
ret void
}