#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 */
long double cos(long double);
long double sin(long double);
void setupPulsar_GWsim(long double ra_p, long double dec_p, long double *kp) {
  kp[0] = cos(dec_p) * cos(ra_p);
  kp[1] = cos(dec_p) * sin(ra_p);
  kp[2] = sin(dec_p);
}


x86 assembly (clang, -O0):
<setupPulsar_GWsim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
mov    %rdi,-0x28(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <cos@plt>
fstpt  -0x40(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <cos@plt>
fldt   -0x40(%rbp)
fmulp  %st,%st(1)
mov    -0x28(%rbp),%rax
fstpt  (%rax)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <cos@plt>
fstpt  -0x34(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sin@plt>
fldt   -0x34(%rbp)
fmulp  %st,%st(1)
mov    -0x28(%rbp),%rax
fstpt  0x10(%rax)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sin@plt>
mov    -0x28(%rbp),%rax
fstpt  0x20(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setupPulsar_GWsim>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rbx
fldt   0x50(%rsp)
fstpt  0x28(%rsp)
fldt   0x60(%rsp)
fld    %st(0)
fstpt  0x34(%rsp)
fstpt  (%rsp)
call   1040 <cos@plt>
fstpt  0x1c(%rsp)
fldt   0x28(%rsp)
fstpt  (%rsp)
call   1040 <cos@plt>
fldt   0x1c(%rsp)
fmulp  %st,%st(1)
fstpt  (%rbx)
fldt   0x34(%rsp)
fstpt  (%rsp)
call   1040 <cos@plt>
fstpt  0x1c(%rsp)
fldt   0x28(%rsp)
fstpt  (%rsp)
call   1030 <sin@plt>
fldt   0x1c(%rsp)
fmulp  %st,%st(1)
fstpt  0x10(%rbx)
fldt   0x34(%rsp)
fstpt  (%rsp)
call   1030 <sin@plt>
fstpt  0x20(%rbx)
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @setupPulsar_GWsim(x86_fp80 %0, x86_fp80 %1, x86_fp80* %2) {
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca x86_fp80*
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
store x86_fp80* %2, x86_fp80** %6
%7 = load x86_fp80, x86_fp80* %5
%8 = call x86_fp80 @cos(x86_fp80 %7)
%9 = load x86_fp80, x86_fp80* %4
%10 = call x86_fp80 @cos(x86_fp80 %9)
%11 = fmul x86_fp80 %8, %10
%12 = load x86_fp80*, x86_fp80** %6
%13 = getelementptr inbounds x86_fp80, x86_fp80* %12, i64 0
store x86_fp80 %11, x86_fp80* %13
%14 = load x86_fp80, x86_fp80* %5
%15 = call x86_fp80 @cos(x86_fp80 %14)
%16 = load x86_fp80, x86_fp80* %4
%17 = call x86_fp80 @sin(x86_fp80 %16)
%18 = fmul x86_fp80 %15, %17
%19 = load x86_fp80*, x86_fp80** %6
%20 = getelementptr inbounds x86_fp80, x86_fp80* %19, i64 1
store x86_fp80 %18, x86_fp80* %20
%21 = load x86_fp80, x86_fp80* %5
%22 = call x86_fp80 @sin(x86_fp80 %21)
%23 = load x86_fp80*, x86_fp80** %6
%24 = getelementptr inbounds x86_fp80, x86_fp80* %23, i64 2
store x86_fp80 %22, x86_fp80* %24
ret void
}

LLVM IR (-O2):
define void @setupPulsar_GWsim(x86_fp80 %0, x86_fp80 %1, x86_fp80* nocapture writeonly %2) {
%4 = tail call x86_fp80 @cos(x86_fp80 %1)
%5 = tail call x86_fp80 @cos(x86_fp80 %0)
%6 = fmul x86_fp80 %4, %5
store x86_fp80 %6, x86_fp80* %2
%7 = tail call x86_fp80 @cos(x86_fp80 %1)
%8 = tail call x86_fp80 @sin(x86_fp80 %0)
%9 = fmul x86_fp80 %7, %8
%10 = getelementptr inbounds x86_fp80, x86_fp80* %2, i64 1
store x86_fp80 %9, x86_fp80* %10
%11 = tail call x86_fp80 @sin(x86_fp80 %1)
%12 = getelementptr inbounds x86_fp80, x86_fp80* %2, i64 2
store x86_fp80 %11, x86_fp80* %12
ret void
}