#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*/ owen_pre_matrix(double, double *, int);
int /*<<< orphan*/ pre_pmat(double, double *);
int precess_3(double *R, double J, int direction, int iflag, int prec_meth) {
  double x[3], pmat[9];
  int i, j;
  if (J == 2451545.0)
    return (0);
  if (prec_meth == 10)
    owen_pre_matrix(J, pmat, iflag);
  else
    pre_pmat(J, pmat);
  if (direction == -1) {
    for (i = 0, j = 0; i <= 2; i++, j = i * 3) {
      x[i] = R[0] * pmat[j + 0] + R[1] * pmat[j + 1] + R[2] * pmat[j + 2];
    }
  } else {
    for (i = 0, j = 0; i <= 2; i++, j = i * 3) {
      x[i] = R[0] * pmat[i + 0] + R[1] * pmat[i + 3] + R[2] * pmat[i + 6];
    }
  }
  for (i = 0; i < 3; i++)
    R[i] = x[i];
  return (0);
}


x86 assembly (clang, -O0):
<precess_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    %edx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xeb6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1166 <precess_3+0x46>
jp     1166 <precess_3+0x46>
movl   $0x0,-0x4(%rbp)
jmp    1367 <precess_3+0x247>
cmpl   $0xa,-0x24(%rbp)
jne    1189 <precess_3+0x69>
movsd  -0x18(%rbp),%xmm0
lea    -0x90(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1040 <owen_pre_matrix@plt>
jmp    119a <precess_3+0x7a>
movsd  -0x18(%rbp),%xmm0
lea    -0x90(%rbp),%rdi
call   1030 <pre_pmat@plt>
cmpl   $0xffffffff,-0x1c(%rbp)
jne    125e <precess_3+0x13e>
movl   $0x0,-0x94(%rbp)
movl   $0x0,-0x98(%rbp)
cmpl   $0x2,-0x94(%rbp)
jg     1259 <precess_3+0x139>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x98(%rbp),%eax
add    $0x0,%eax
cltq
movsd  -0x90(%rbp,%rax,8),%xmm2
ff ff
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x98(%rbp),%eax
add    $0x1,%eax
cltq
mulsd  -0x90(%rbp,%rax,8),%xmm0
ff ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x98(%rbp),%eax
add    $0x2,%eax
cltq
movsd  -0x90(%rbp,%rax,8),%xmm2
ff ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movslq -0x94(%rbp),%rax
movsd  %xmm0,-0x40(%rbp,%rax,8)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
imul   $0x3,-0x94(%rbp),%eax
mov    %eax,-0x98(%rbp)
jmp    11b8 <precess_3+0x98>
jmp    1318 <precess_3+0x1f8>
movl   $0x0,-0x94(%rbp)
movl   $0x0,-0x98(%rbp)
cmpl   $0x2,-0x94(%rbp)
jg     1313 <precess_3+0x1f3>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x94(%rbp),%eax
add    $0x0,%eax
cltq
movsd  -0x90(%rbp,%rax,8),%xmm2
ff ff
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x94(%rbp),%eax
add    $0x3,%eax
cltq
mulsd  -0x90(%rbp,%rax,8),%xmm0
ff ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x94(%rbp),%eax
add    $0x6,%eax
cltq
movsd  -0x90(%rbp,%rax,8),%xmm2
ff ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movslq -0x94(%rbp),%rax
movsd  %xmm0,-0x40(%rbp,%rax,8)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
imul   $0x3,-0x94(%rbp),%eax
mov    %eax,-0x98(%rbp)
jmp    1272 <precess_3+0x152>
jmp    1318 <precess_3+0x1f8>
movl   $0x0,-0x94(%rbp)
cmpl   $0x3,-0x94(%rbp)
jge    1360 <precess_3+0x240>
movslq -0x94(%rbp),%rax
movsd  -0x40(%rbp,%rax,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x94(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1322 <precess_3+0x202>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<precess_3>:
push   %rbp
push   %rbx
sub    $0x48,%rsp
ucomisd 0xed2(%rip),%xmm0
jne    1136 <precess_3+0x16>
jnp    11f7 <precess_3+0xd7>
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rsp,%rdi
cmp    $0xa,%ecx
jne    114c <precess_3+0x2c>
mov    %edx,%esi
call   1040 <owen_pre_matrix@plt>
jmp    1151 <precess_3+0x31>
call   1030 <pre_pmat@plt>
xor    %eax,%eax
xor    %ecx,%ecx
cmp    $0xffffffff,%ebp
sete   %al
setne  %cl
movsd  (%rbx),%xmm0
movsd  0x8(%rbx),%xmm2
movsd  0x10(%rbx),%xmm1
movapd (%rsp),%xmm3
mov    %rcx,%rsi
shl    $0x5,%rsi
shl    $0x4,%rcx
mov    %rax,%rdx
shl    $0x5,%rdx
shl    $0x4,%rax
movapd %xmm2,%xmm4
unpcklpd %xmm2,%xmm4
mov    %rsp,%rdi
movsd  0x8(%rcx,%rdi,1),%xmm5
movhpd 0x20(%rsp),%xmm5
mulpd  %xmm4,%xmm5
movapd %xmm0,%xmm4
unpcklpd %xmm0,%xmm4
movhpd 0x8(%rax,%rdi,1),%xmm3
mulpd  %xmm4,%xmm3
addpd  %xmm5,%xmm3
movapd %xmm1,%xmm4
unpcklpd %xmm1,%xmm4
movsd  0x10(%rsi,%rdi,1),%xmm5
movhpd 0x28(%rcx,%rdi,1),%xmm5
mulpd  %xmm4,%xmm5
addpd  %xmm3,%xmm5
mulsd  0x28(%rax,%rdi,1),%xmm2
mulsd  0x10(%rdx,%rdi,1),%xmm0
mulsd  0x40(%rsp),%xmm1
addsd  %xmm2,%xmm0
addsd  %xmm0,%xmm1
movupd %xmm5,(%rbx)
movsd  %xmm1,0x10(%rbx)
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @precess_3(double* %0, double %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [3 x double]
%13 = alloca [9 x double]
%14 = alloca i32
%15 = alloca i32
store double* %0, double** %7
store double %1, double* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
%16 = load double, double* %8
%17 = fcmp oeq double %16, 0x4142B42C80000000
br i1 %17, label %18, label %19
18: ; preds = %5
store i32 0, i32* %6
br label %133
19: ; preds = %5
%20 = load i32, i32* %11
%21 = icmp eq i32 %20, 10
br i1 %21, label %22, label %27
22: ; preds = %19
%23 = load double, double* %8
%24 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 0
%25 = load i32, i32* %10
%26 = call i32 @owen_pre_matrix(double %23, double* %24, i32 %25)
br label %31
27: ; preds = %19
%28 = load double, double* %8
%29 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 0
%30 = call i32 @pre_pmat(double %28, double* %29)
br label %31
31: ; preds = %27, %22
%32 = load i32, i32* %9
%33 = icmp eq i32 %32, -1
br i1 %33, label %34, label %75
34: ; preds = %31
store i32 0, i32* %14
store i32 0, i32* %15
br label %35
35: ; preds = %69, %34
%36 = load i32, i32* %14
%37 = icmp sle i32 %36, 2
br i1 %37, label %38, label %74
38: ; preds = %35
%39 = load double*, double** %7
%40 = getelementptr inbounds double, double* %39, i64 0
%41 = load double, double* %40
%42 = load i32, i32* %15
%43 = add nsw i32 %42, 0
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 %44
%46 = load double, double* %45
%47 = load double*, double** %7
%48 = getelementptr inbounds double, double* %47, i64 1
%49 = load double, double* %48
%50 = load i32, i32* %15
%51 = add nsw i32 %50, 1
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 %52
%54 = load double, double* %53
%55 = fmul double %49, %54
%56 = call double @llvm.fmuladd.f64(double %41, double %46, double %55)
%57 = load double*, double** %7
%58 = getelementptr inbounds double, double* %57, i64 2
%59 = load double, double* %58
%60 = load i32, i32* %15
%61 = add nsw i32 %60, 2
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 %62
%64 = load double, double* %63
%65 = call double @llvm.fmuladd.f64(double %59, double %64, double %56)
%66 = load i32, i32* %14
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 %67
store double %65, double* %68
br label %69
69: ; preds = %38
%70 = load i32, i32* %14
%71 = add nsw i32 %70, 1
store i32 %71, i32* %14
%72 = load i32, i32* %14
%73 = mul nsw i32 %72, 3
store i32 %73, i32* %15
br label %35
74: ; preds = %35
br label %116
75: ; preds = %31
store i32 0, i32* %14
store i32 0, i32* %15
br label %76
76: ; preds = %110, %75
%77 = load i32, i32* %14
%78 = icmp sle i32 %77, 2
br i1 %78, label %79, label %115
79: ; preds = %76
%80 = load double*, double** %7
%81 = getelementptr inbounds double, double* %80, i64 0
%82 = load double, double* %81
%83 = load i32, i32* %14
%84 = add nsw i32 %83, 0
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 %85
%87 = load double, double* %86
%88 = load double*, double** %7
%89 = getelementptr inbounds double, double* %88, i64 1
%90 = load double, double* %89
%91 = load i32, i32* %14
%92 = add nsw i32 %91, 3
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 %93
%95 = load double, double* %94
%96 = fmul double %90, %95
%97 = call double @llvm.fmuladd.f64(double %82, double %87, double %96)
%98 = load double*, double** %7
%99 = getelementptr inbounds double, double* %98, i64 2
%100 = load double, double* %99
%101 = load i32, i32* %14
%102 = add nsw i32 %101, 6
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 %103
%105 = load double, double* %104
%106 = call double @llvm.fmuladd.f64(double %100, double %105, double %97)
%107 = load i32, i32* %14
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 %108
store double %106, double* %109
br label %110
110: ; preds = %79
%111 = load i32, i32* %14
%112 = add nsw i32 %111, 1
store i32 %112, i32* %14
%113 = load i32, i32* %14
%114 = mul nsw i32 %113, 3
store i32 %114, i32* %15
br label %76
115: ; preds = %76
br label %116
116: ; preds = %115, %74
store i32 0, i32* %14
br label %117
117: ; preds = %129, %116
%118 = load i32, i32* %14
%119 = icmp slt i32 %118, 3
br i1 %119, label %120, label %132
120: ; preds = %117
%121 = load i32, i32* %14
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 %122
%124 = load double, double* %123
%125 = load double*, double** %7
%126 = load i32, i32* %14
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds double, double* %125, i64 %127
store double %124, double* %128
br label %129
129: ; preds = %120
%130 = load i32, i32* %14
%131 = add nsw i32 %130, 1
store i32 %131, i32* %14
br label %117
132: ; preds = %117
store i32 0, i32* %6
br label %133
133: ; preds = %132, %18
%134 = load i32, i32* %6
ret i32 %134
}

LLVM IR (-O2):
define i32 @precess_3(double* nocapture %0, double %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca [9 x double]
%7 = bitcast [9 x double]* %6 to i8*
%8 = fcmp oeq double %1, 0x4142B42C80000000
br i1 %8, label %66, label %9
9: ; preds = %5
%10 = icmp eq i32 %4, 10
%11 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 0
br i1 %10, label %12, label %14
12: ; preds = %9
%13 = call i32 @owen_pre_matrix(double %1, double* %11, i32 %3)
br label %16
14: ; preds = %9
%15 = call i32 @pre_pmat(double %1, double* %11)
br label %16
16: ; preds = %14, %12
%17 = icmp eq i32 %2, -1
%18 = load double, double* %0
%19 = getelementptr inbounds double, double* %0, i64 1
%20 = load double, double* %19
%21 = getelementptr inbounds double, double* %0, i64 2
%22 = load double, double* %21
%23 = bitcast [9 x double]* %6 to <2 x double>*
%24 = load <2 x double>, <2 x double>* %23
%25 = select i1 %17, i64 1, i64 3
%26 = select i1 %17, i64 2, i64 6
%27 = select i1 %17, i64 3, i64 1
%28 = select i1 %17, i64 5, i64 7
%29 = select i1 %17, i64 6, i64 2
%30 = select i1 %17, i64 7, i64 5
%31 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 %25
%32 = load double, double* %31
%33 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 %26
%34 = load double, double* %33
%35 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 %27
%36 = load double, double* %35
%37 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 4
%38 = load double, double* %37
%39 = insertelement <2 x double> poison, double %20, i64 0
%40 = shufflevector <2 x double> %39, <2 x double> poison, <2 x i32> zeroinitializer
%41 = insertelement <2 x double> poison, double %32, i64 0
%42 = insertelement <2 x double> %41, double %38, i64 1
%43 = fmul <2 x double> %40, %42
%44 = insertelement <2 x double> poison, double %18, i64 0
%45 = shufflevector <2 x double> %44, <2 x double> poison, <2 x i32> zeroinitializer
%46 = insertelement <2 x double> %24, double %36, i64 1
%47 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %45, <2 x double> %46, <2 x double> %43)
%48 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 %28
%49 = load double, double* %48
%50 = insertelement <2 x double> poison, double %22, i64 0
%51 = shufflevector <2 x double> %50, <2 x double> poison, <2 x i32> zeroinitializer
%52 = insertelement <2 x double> poison, double %34, i64 0
%53 = insertelement <2 x double> %52, double %49, i64 1
%54 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %51, <2 x double> %53, <2 x double> %47)
%55 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 %29
%56 = load double, double* %55
%57 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 %30
%58 = load double, double* %57
%59 = fmul double %20, %58
%60 = call double @llvm.fmuladd.f64(double %18, double %56, double %59)
%61 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 8
%62 = load double, double* %61
%63 = call double @llvm.fmuladd.f64(double %22, double %62, double %60)
%64 = bitcast double* %0 to <2 x double>*
store <2 x double> %54, <2 x double>* %64
%65 = getelementptr inbounds double, double* %0, i64 2
store double %63, double* %65
br label %66
66: ; preds = %16, %5
ret i32 0
}