#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_cs3(double *, double);
void stiefel_Gs3(double *restrict Gs, double beta, double X) {
  double X2 = X * X;
  stumpff_cs3(Gs, beta * X2);
  Gs[1] *= X;
  Gs[2] *= X2;
  Gs[3] *= X2 * X;
  return;
}


x86 assembly (clang, -O0):
<stiefel_Gs3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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_cs3@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
mov    -0x8(%rbp),%rax
mulsd  0x18(%rax),%xmm0
movsd  %xmm0,0x18(%rax)
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @stiefel_Gs3(double* noalias %0, double %1, double %2) {
%4 = alloca double*
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double* %0, double** %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %6
%9 = load double, double* %6
%10 = fmul double %8, %9
store double %10, double* %7
%11 = load double*, double** %4
%12 = load double, double* %5
%13 = load double, double* %7
%14 = fmul double %12, %13
%15 = call i32 @stumpff_cs3(double* %11, double %14)
%16 = load double, double* %6
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = fmul double %19, %16
store double %20, double* %18
%21 = load double, double* %7
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = fmul double %24, %21
store double %25, double* %23
%26 = load double, double* %7
%27 = load double, double* %6
%28 = fmul double %26, %27
%29 = load double*, double** %4
%30 = getelementptr inbounds double, double* %29, i64 3
%31 = load double, double* %30
%32 = fmul double %31, %28
store double %32, double* %30
ret void
}

LLVM IR (-O2):
define void @stiefel_Gs3(double* noalias %0, double %1, double %2) {
%4 = fmul double %2, %2
%5 = fmul double %4, %1
%6 = tail call i32 @stumpff_cs3(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 = load double, double* %15
%17 = fmul double %14, %16
store double %17, double* %15
ret void
}