#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*/ pre_pecl(double, double *);
int /*<<< orphan*/ pre_pequ(double, double *);
double sqrt(double);
int /*<<< orphan*/ swi_cross_prod(double *, double *, double *);
void pre_pmat(double tjd, double *rp) {
  double peqr[3], pecl[3], v[3], w, eqx[3];
  pre_pequ(tjd, peqr);
  pre_pecl(tjd, pecl);
  swi_cross_prod(peqr, pecl, v);
  w = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
  eqx[0] = v[0] / w;
  eqx[1] = v[1] / w;
  eqx[2] = v[2] / w;
  swi_cross_prod(peqr, eqx, v);
  rp[0] = eqx[0];
  rp[1] = eqx[1];
  rp[2] = eqx[2];
  rp[3] = v[0];
  rp[4] = v[1];
  rp[5] = v[2];
  rp[6] = peqr[0];
  rp[7] = peqr[1];
  rp[8] = peqr[2];
}


x86 assembly (clang, -O0):
<pre_pmat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x30(%rbp),%rdi
call   1050 <pre_pequ@plt>
movsd  -0x8(%rbp),%xmm0
lea    -0x50(%rbp),%rdi
call   1040 <pre_pecl@plt>
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
lea    -0x70(%rbp),%rdx
call   1030 <swi_cross_prod@plt>
movsd  -0x70(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm0
divsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
divsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
divsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x90(%rbp),%rsi
lea    -0x70(%rbp),%rdx
call   1030 <swi_cross_prod@plt>
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x88(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x80(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x70(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
movsd  -0x68(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x20(%rax)
movsd  -0x60(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x28(%rax)
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x30(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x38(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x40(%rax)
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pre_pmat>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%rbx
movsd  %xmm0,0x18(%rsp)
lea    0x40(%rsp),%r14
mov    %r14,%rdi
call   1050 <pre_pequ@plt>
lea    0x60(%rsp),%r15
movsd  0x18(%rsp),%xmm0
mov    %r15,%rdi
call   1040 <pre_pecl@plt>
mov    %rsp,%rdx
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <swi_cross_prod@plt>
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11b8 <pre_pmat+0x78>
sqrtsd %xmm0,%xmm0
jmp    11bd <pre_pmat+0x7d>
call   1060 <sqrt@plt>
movapd (%rsp),%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
divpd  %xmm2,%xmm1
movapd %xmm1,0x20(%rsp)
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x30(%rsp)
lea    0x40(%rsp),%rdi
lea    0x20(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <swi_cross_prod@plt>
movaps 0x20(%rsp),%xmm0
movups %xmm0,(%rbx)
movsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x10(%rbx)
movaps (%rsp),%xmm0
movups %xmm0,0x18(%rbx)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x28(%rbx)
movaps 0x40(%rsp),%xmm0
movups %xmm0,0x30(%rbx)
movsd  0x50(%rsp),%xmm0
movsd  %xmm0,0x40(%rbx)
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @pre_pmat(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
%5 = alloca [3 x double]
%6 = alloca [3 x double]
%7 = alloca [3 x double]
%8 = alloca double
%9 = alloca [3 x double]
store double %0, double* %3
store double* %1, double** %4
%10 = load double, double* %3
%11 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%12 = call i32 @pre_pequ(double %10, double* %11)
%13 = load double, double* %3
%14 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%15 = call i32 @pre_pecl(double %13, double* %14)
%16 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%17 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%18 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%19 = call i32 @swi_cross_prod(double* %16, double* %17, double* %18)
%20 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%21 = load double, double* %20
%22 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%23 = load double, double* %22
%24 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
%25 = load double, double* %24
%26 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
%27 = load double, double* %26
%28 = fmul double %25, %27
%29 = call double @llvm.fmuladd.f64(double %21, double %23, double %28)
%30 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
%31 = load double, double* %30
%32 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
%33 = load double, double* %32
%34 = call double @llvm.fmuladd.f64(double %31, double %33, double %29)
%35 = call double @sqrt(double %34)
store double %35, double* %8
%36 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%37 = load double, double* %36
%38 = load double, double* %8
%39 = fdiv double %37, %38
%40 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 0
store double %39, double* %40
%41 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
%42 = load double, double* %41
%43 = load double, double* %8
%44 = fdiv double %42, %43
%45 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 1
store double %44, double* %45
%46 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
%47 = load double, double* %46
%48 = load double, double* %8
%49 = fdiv double %47, %48
%50 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 2
store double %49, double* %50
%51 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%52 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 0
%53 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%54 = call i32 @swi_cross_prod(double* %51, double* %52, double* %53)
%55 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 0
%56 = load double, double* %55
%57 = load double*, double** %4
%58 = getelementptr inbounds double, double* %57, i64 0
store double %56, double* %58
%59 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 1
%60 = load double, double* %59
%61 = load double*, double** %4
%62 = getelementptr inbounds double, double* %61, i64 1
store double %60, double* %62
%63 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 2
%64 = load double, double* %63
%65 = load double*, double** %4
%66 = getelementptr inbounds double, double* %65, i64 2
store double %64, double* %66
%67 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%68 = load double, double* %67
%69 = load double*, double** %4
%70 = getelementptr inbounds double, double* %69, i64 3
store double %68, double* %70
%71 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
%72 = load double, double* %71
%73 = load double*, double** %4
%74 = getelementptr inbounds double, double* %73, i64 4
store double %72, double* %74
%75 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
%76 = load double, double* %75
%77 = load double*, double** %4
%78 = getelementptr inbounds double, double* %77, i64 5
store double %76, double* %78
%79 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%80 = load double, double* %79
%81 = load double*, double** %4
%82 = getelementptr inbounds double, double* %81, i64 6
store double %80, double* %82
%83 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 1
%84 = load double, double* %83
%85 = load double*, double** %4
%86 = getelementptr inbounds double, double* %85, i64 7
store double %84, double* %86
%87 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 2
%88 = load double, double* %87
%89 = load double*, double** %4
%90 = getelementptr inbounds double, double* %89, i64 8
store double %88, double* %90
ret void
}

LLVM IR (-O2):
define void @pre_pmat(double %0, double* nocapture writeonly %1) {
%3 = alloca [3 x double]
%4 = alloca [3 x double]
%5 = alloca [3 x double]
%6 = alloca [3 x double]
%7 = bitcast [3 x double]* %3 to i8*
%8 = bitcast [3 x double]* %4 to i8*
%9 = bitcast [3 x double]* %5 to i8*
%10 = bitcast [3 x double]* %6 to i8*
%11 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%12 = call i32 @pre_pequ(double %0, double* %11)
%13 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%14 = call i32 @pre_pecl(double %0, double* %13)
%15 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%16 = call i32 @swi_cross_prod(double* %11, double* %13, double* %15)
%17 = load double, double* %15
%18 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 1
%19 = load double, double* %18
%20 = fmul double %19, %19
%21 = call double @llvm.fmuladd.f64(double %17, double %17, double %20)
%22 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 2
%23 = load double, double* %22
%24 = call double @llvm.fmuladd.f64(double %23, double %23, double %21)
%25 = call double @sqrt(double %24)
%26 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%27 = bitcast [3 x double]* %5 to <2 x double>*
%28 = load <2 x double>, <2 x double>* %27
%29 = insertelement <2 x double> poison, double %25, i64 0
%30 = shufflevector <2 x double> %29, <2 x double> poison, <2 x i32> zeroinitializer
%31 = fdiv <2 x double> %28, %30
%32 = bitcast [3 x double]* %6 to <2 x double>*
store <2 x double> %31, <2 x double>* %32
%33 = load double, double* %22
%34 = fdiv double %33, %25
%35 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 2
store double %34, double* %35
%36 = call i32 @swi_cross_prod(double* %11, double* %26, double* %15)
%37 = bitcast [3 x double]* %6 to <2 x double>*
%38 = load <2 x double>, <2 x double>* %37
%39 = bitcast double* %1 to <2 x double>*
store <2 x double> %38, <2 x double>* %39
%40 = load double, double* %35
%41 = getelementptr inbounds double, double* %1, i64 2
store double %40, double* %41
%42 = getelementptr inbounds double, double* %1, i64 3
%43 = bitcast [3 x double]* %5 to <2 x double>*
%44 = load <2 x double>, <2 x double>* %43
%45 = bitcast double* %42 to <2 x double>*
store <2 x double> %44, <2 x double>* %45
%46 = load double, double* %22
%47 = getelementptr inbounds double, double* %1, i64 5
store double %46, double* %47
%48 = getelementptr inbounds double, double* %1, i64 6
%49 = bitcast [3 x double]* %3 to <2 x double>*
%50 = load <2 x double>, <2 x double>* %49
%51 = bitcast double* %48 to <2 x double>*
store <2 x double> %50, <2 x double>* %51
%52 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 2
%53 = load double, double* %52
%54 = getelementptr inbounds double, double* %1, i64 8
store double %53, double* %54
ret void
}