#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 *);
double const sin(double const);
void csw_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[2] * r) + p[1] * sin(p[2] * r)) / power;
}


x86 assembly (clang, -O0):
<csw_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
add    $0x18,%rdx
lea    0x2eec(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <power_1@plt>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe6f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1040 <sin@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  0x2e68(%rip),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@csw_value.power = internal global double 0.000000e+00
define void @csw_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* @csw_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 2
%15 = load double, double* %14
%16 = load double, double* %4
%17 = fmul double %15, %16
%18 = call double @cos(double %17)
%19 = call double @llvm.fmuladd.f64(double %12, double %18, double 1.000000e+00)
%20 = load double*, double** %5
%21 = getelementptr inbounds double, double* %20, i64 1
%22 = load double, double* %21
%23 = load double*, double** %5
%24 = getelementptr inbounds double, double* %23, i64 2
%25 = load double, double* %24
%26 = load double, double* %4
%27 = fmul double %25, %26
%28 = call double @sin(double %27)
%29 = call double @llvm.fmuladd.f64(double %22, double %28, double %19)
%30 = load double, double* @csw_value.power
%31 = fdiv double %29, %30
%32 = load double*, double** %6
store double %31, double* %32
ret void
}

LLVM IR (-O2):
@csw_value.power = internal global double 0.000000e+00
define void @csw_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* @csw_value.power, double* %4, double* %5)
%7 = load double, double* %1
%8 = getelementptr inbounds double, double* %1, i64 2
%9 = load double, double* %8
%10 = load double, double* %4
%11 = fmul double %9, %10
%12 = call double @cos(double %11)
%13 = call double @llvm.fmuladd.f64(double %7, double %12, double 1.000000e+00)
%14 = getelementptr inbounds double, double* %1, i64 1
%15 = load double, double* %14
%16 = load double, double* %8
%17 = load double, double* %4
%18 = fmul double %16, %17
%19 = call double @sin(double %18)
%20 = call double @llvm.fmuladd.f64(double %15, double %19, double %13)
%21 = load double, double* @csw_value.power
%22 = fdiv double %20, %21
store double %22, double* %2
ret void
}