#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 const cos(double const);
int /*<<< orphan*/ power_1(double *, double const *, double const *);
void csw2_value(const double r, const double *p, double *f) {
  static double power;
  power_1(&power, &r, &p[3]);
  *f = (1.0 + p[0] * cos(p[1] * r + p[2])) / power;
}


x86 assembly (clang, -O0):
<csw2_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
add    $0x18,%rdx
lea    0x2ef4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <power_1@plt>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x8(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe6e(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  0x2e9a(%rip),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csw2_value>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,0x8(%rsp)
lea    0x18(%rdi),%rdx
lea    0x2efa(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <power_1@plt>
movsd  (%rbx),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rbx),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rbx),%xmm0
call   1040 <cos@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0xe8b(%rip),%xmm0
divsd  0x2ebb(%rip),%xmm0
movsd  %xmm0,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@csw2_value.power = internal global double 0.000000e+00
define void @csw2_value(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = getelementptr inbounds double, double* %7, i64 3
%9 = call i32 @power_1(double* @csw2_value.power, double* %4, double* %8)
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = load double*, double** %5
%14 = getelementptr inbounds double, double* %13, i64 1
%15 = load double, double* %14
%16 = load double, double* %4
%17 = load double*, double** %5
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = call double @llvm.fmuladd.f64(double %15, double %16, double %19)
%21 = call double @cos(double %20)
%22 = call double @llvm.fmuladd.f64(double %12, double %21, double 1.000000e+00)
%23 = load double, double* @csw2_value.power
%24 = fdiv double %22, %23
%25 = load double*, double** %6
store double %24, double* %25
ret void
}

LLVM IR (-O2):
@csw2_value.power = internal global double 0.000000e+00
define void @csw2_value(double %0, double* %1, double* nocapture writeonly %2) {
%4 = alloca double
store double %0, double* %4
%5 = getelementptr inbounds double, double* %1, i64 3
%6 = call i32 @power_1(double* @csw2_value.power, double* %4, double* %5)
%7 = load double, double* %1
%8 = getelementptr inbounds double, double* %1, i64 1
%9 = load double, double* %8
%10 = load double, double* %4
%11 = getelementptr inbounds double, double* %1, i64 2
%12 = load double, double* %11
%13 = call double @llvm.fmuladd.f64(double %9, double %10, double %12)
%14 = call double @cos(double %13)
%15 = call double @llvm.fmuladd.f64(double %7, double %14, double 1.000000e+00)
%16 = load double, double* @csw2_value.power
%17 = fdiv double %15, %16
store double %17, double* %2
ret void
}