#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 */
int /*<<< orphan*/ stumpff_cs(double *, double);
void stiefel_Gs(double *restrict Gs, double beta, double X) {
  double X2 = X * X;
  stumpff_cs(Gs, beta * X2);
  Gs[1] *= X;
  Gs[2] *= X2;
  double _pow = X2 * X;
  Gs[3] *= _pow;
  _pow *= X;
  Gs[4] *= _pow;
  _pow *= X;
  Gs[5] *= _pow;
  return;
}


x86 assembly (clang, -O0):
<stiefel_Gs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
call   1030 <stumpff_cs@plt>
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x10(%rax),%xmm0
movsd  %xmm0,0x10(%rax)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x18(%rax),%xmm0
movsd  %xmm0,0x18(%rax)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x20(%rax),%xmm0
movsd  %xmm0,0x20(%rax)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x28(%rax),%xmm0
movsd  %xmm0,0x28(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stiefel_Gs>:
push   %rbx
sub    $0x20,%rsp
movapd %xmm1,0x10(%rsp)
mov    %rdi,%rbx
mulsd  %xmm1,%xmm1
movapd %xmm1,(%rsp)
mulsd  %xmm1,%xmm0
call   1030 <stumpff_cs@plt>
movapd 0x10(%rsp),%xmm2
movapd %xmm2,%xmm0
movapd (%rsp),%xmm3
unpcklpd %xmm3,%xmm0
movupd 0x8(%rbx),%xmm1
mulpd  %xmm0,%xmm1
movupd 0x18(%rbx),%xmm0
movupd %xmm1,0x8(%rbx)
mulsd  %xmm2,%xmm3
movapd %xmm3,%xmm1
mulsd  %xmm2,%xmm1
unpcklpd %xmm1,%xmm3
mulpd  %xmm0,%xmm3
movupd %xmm3,0x18(%rbx)
mulsd  %xmm2,%xmm1
mulsd  0x28(%rbx),%xmm1
movsd  %xmm1,0x28(%rbx)
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @stiefel_Gs(double* noalias %0, double %1, double %2) {
%4 = alloca double*
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double* %0, double** %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %6
%10 = load double, double* %6
%11 = fmul double %9, %10
store double %11, double* %7
%12 = load double*, double** %4
%13 = load double, double* %5
%14 = load double, double* %7
%15 = fmul double %13, %14
%16 = call i32 @stumpff_cs(double* %12, double %15)
%17 = load double, double* %6
%18 = load double*, double** %4
%19 = getelementptr inbounds double, double* %18, i64 1
%20 = load double, double* %19
%21 = fmul double %20, %17
store double %21, double* %19
%22 = load double, double* %7
%23 = load double*, double** %4
%24 = getelementptr inbounds double, double* %23, i64 2
%25 = load double, double* %24
%26 = fmul double %25, %22
store double %26, double* %24
%27 = load double, double* %7
%28 = load double, double* %6
%29 = fmul double %27, %28
store double %29, double* %8
%30 = load double, double* %8
%31 = load double*, double** %4
%32 = getelementptr inbounds double, double* %31, i64 3
%33 = load double, double* %32
%34 = fmul double %33, %30
store double %34, double* %32
%35 = load double, double* %6
%36 = load double, double* %8
%37 = fmul double %36, %35
store double %37, double* %8
%38 = load double, double* %8
%39 = load double*, double** %4
%40 = getelementptr inbounds double, double* %39, i64 4
%41 = load double, double* %40
%42 = fmul double %41, %38
store double %42, double* %40
%43 = load double, double* %6
%44 = load double, double* %8
%45 = fmul double %44, %43
store double %45, double* %8
%46 = load double, double* %8
%47 = load double*, double** %4
%48 = getelementptr inbounds double, double* %47, i64 5
%49 = load double, double* %48
%50 = fmul double %49, %46
store double %50, double* %48
ret void
}

LLVM IR (-O2):
define void @stiefel_Gs(double* noalias %0, double %1, double %2) {
%4 = fmul double %2, %2
%5 = fmul double %4, %1
%6 = tail call i32 @stumpff_cs(double* %0, double %5)
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = bitcast double* %7 to <2 x double>*
%9 = load <2 x double>, <2 x double>* %8
%10 = insertelement <2 x double> poison, double %2, i64 0
%11 = insertelement <2 x double> %10, double %4, i64 1
%12 = fmul <2 x double> %11, %9
%13 = bitcast double* %7 to <2 x double>*
store <2 x double> %12, <2 x double>* %13
%14 = fmul double %4, %2
%15 = getelementptr inbounds double, double* %0, i64 3
%16 = fmul double %14, %2
%17 = bitcast double* %15 to <2 x double>*
%18 = load <2 x double>, <2 x double>* %17
%19 = insertelement <2 x double> poison, double %14, i64 0
%20 = insertelement <2 x double> %19, double %16, i64 1
%21 = fmul <2 x double> %20, %18
%22 = bitcast double* %15 to <2 x double>*
store <2 x double> %21, <2 x double>* %22
%23 = fmul double %16, %2
%24 = getelementptr inbounds double, double* %0, i64 5
%25 = load double, double* %24
%26 = fmul double %23, %25
store double %26, double* %24
ret void
}