#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);
double sqrt(double);
double ms_f(double x, void *args) {
  double cs20 = ((double *)args)[0];
  double cA20 = ((double *)args)[1];
  double gam = ((double *)args)[2];
  double cs2 = cs20 * exp((gam - 1.0) * x);
  double cA2 = cA20 * exp(x);
  return sqrt(cs2 + cA2);
}


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

x86 assembly (clang, -O2):
<ms_f>:
sub    $0x38,%rsp
movapd %xmm0,%xmm1
movsd  %xmm0,0x8(%rsp)
movups (%rdi),%xmm0
movaps %xmm0,0x20(%rsp)
movsd  0x10(%rdi),%xmm0
addsd  0xebd(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movapd %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <exp@plt>
movapd 0x10(%rsp),%xmm1
unpcklpd %xmm0,%xmm1
mulpd  0x20(%rsp),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     118c <ms_f+0x6c>
sqrtsd %xmm0,%xmm0
add    $0x38,%rsp
ret
add    $0x38,%rsp
jmp    1040 <sqrt@plt>

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

LLVM IR (-O2):
define double @ms_f(double %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3
%5 = getelementptr inbounds i8, i8* %1, i64 16
%6 = bitcast i8* %5 to double*
%7 = load double, double* %6
%8 = fadd double %7, -1.000000e+00
%9 = fmul double %8, %0
%10 = tail call double @exp(double %9)
%11 = tail call double @exp(double %0)
%12 = insertelement <2 x double> poison, double %10, i64 0
%13 = insertelement <2 x double> %12, double %11, i64 1
%14 = fmul <2 x double> %4, %13
%15 = shufflevector <2 x double> %14, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%16 = fadd <2 x double> %14, %15
%17 = extractelement <2 x double> %16, i64 0
%18 = tail call double @sqrt(double %17)
ret double %18
}