#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*/ palEl2ue(double, int, double, double, double, double, double,
                            double, double, double, double *, int *);
int /*<<< orphan*/ palPertue(double, double *, int *);
int /*<<< orphan*/ palUe2el(double *, int, int *, double *, double *, double *,
                            double *, double *, double *, double *, double *,
                            int *);
void palPertel(int jform, double date0, double date1, double epoch0,
               double orbi0, double anode0, double perih0, double aorq0,
               double e0, double am0, double *epoch1, double *orbi1,
               double *anode1, double *perih1, double *aorq1, double *e1,
               double *am1, int *jstat) {
  double u[13], dm;
  int j, jf;
  if (jform < 2 || jform > 3) {
    *jstat = -1;
    return;
  } else {
    *jstat = 0;
  }
  palEl2ue(date0, jform, epoch0, orbi0, anode0, perih0, aorq0, e0, am0, 0.0, u,
           &j);
  if (j != 0) {
    *jstat = j;
    return;
  }
  palPertue(date1, u, &j);
  if (j > 0) {
    *jstat = j;
  } else if (j < 0) {
    *jstat = -5;
    return;
  }
  palUe2el(u, jform, &jf, epoch1, orbi1, anode1, perih1, aorq1, e1, am1, &dm,
           &j);
  if (jf != jform || j != 0)
    *jstat = -5;
}


x86 assembly (clang, -O0):
<palPertel>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0x118,%rsp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
movsd  0x10(%rbp),%xmm8
mov    %edi,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
movsd  %xmm2,-0x38(%rbp)
movsd  %xmm3,-0x40(%rbp)
movsd  %xmm4,-0x48(%rbp)
movsd  %xmm5,-0x50(%rbp)
movsd  %xmm6,-0x58(%rbp)
movsd  %xmm7,-0x60(%rbp)
mov    %rsi,-0x68(%rbp)
mov    %rdx,-0x70(%rbp)
mov    %rcx,-0x78(%rbp)
mov    %r8,-0x80(%rbp)
mov    %r9,-0x88(%rbp)
cmpl   $0x2,-0x1c(%rbp)
jl     11a8 <palPertel+0x78>
cmpl   $0x3,-0x1c(%rbp)
jle    11b7 <palPertel+0x87>
mov    0x28(%rbp),%rax
movl   $0xffffffff,(%rax)
jmp    1304 <palPertel+0x1d4>
mov    0x28(%rbp),%rax
movl   $0x0,(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x1c(%rbp),%edi
movsd  -0x38(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm3
movsd  -0x50(%rbp),%xmm4
movsd  -0x58(%rbp),%xmm5
movsd  -0x60(%rbp),%xmm6
movsd  0x10(%rbp),%xmm7
lea    -0xf0(%rbp),%rsi
xorps  %xmm8,%xmm8
lea    -0xfc(%rbp),%rdx
movsd  %xmm8,(%rsp)
call   1050 <palEl2ue@plt>
cmpl   $0x0,-0xfc(%rbp)
je     1227 <palPertel+0xf7>
mov    -0xfc(%rbp),%ecx
mov    0x28(%rbp),%rax
mov    %ecx,(%rax)
jmp    1304 <palPertel+0x1d4>
movsd  -0x30(%rbp),%xmm0
lea    -0xf0(%rbp),%rdi
lea    -0xfc(%rbp),%rsi
call   1030 <palPertue@plt>
cmpl   $0x0,-0xfc(%rbp)
jle    125d <palPertel+0x12d>
mov    -0xfc(%rbp),%ecx
mov    0x28(%rbp),%rax
mov    %ecx,(%rax)
jmp    127e <palPertel+0x14e>
cmpl   $0x0,-0xfc(%rbp)
jge    1279 <palPertel+0x149>
mov    0x28(%rbp),%rax
movl   $0xfffffffb,(%rax)
jmp    1304 <palPertel+0x1d4>
jmp    127e <palPertel+0x14e>
lea    -0xf0(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x68(%rbp),%rcx
mov    -0x70(%rbp),%r8
mov    -0x78(%rbp),%r9
mov    -0x80(%rbp),%r15
mov    -0x88(%rbp),%r14
mov    0x18(%rbp),%rbx
mov    0x20(%rbp),%r11
lea    -0x100(%rbp),%rdx
lea    -0xf8(%rbp),%r10
lea    -0xfc(%rbp),%rax
mov    %r15,(%rsp)
mov    %r14,0x8(%rsp)
mov    %rbx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %rax,0x28(%rsp)
call   1040 <palUe2el@plt>
mov    -0x100(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    12fa <palPertel+0x1ca>
cmpl   $0x0,-0xfc(%rbp)
je     1304 <palPertel+0x1d4>
mov    0x28(%rbp),%rax
movl   $0xfffffffb,(%rax)
add    $0x118,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<palPertel>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %r8,0x10(%rsp)
mov    %rcx,%r12
mov    %edi,%ebx
mov    0xd8(%rsp),%r14
lea    -0x4(%rbx),%ecx
mov    $0xffffffff,%eax
cmp    $0xfffffffe,%ecx
jb     11be <palPertel+0x8e>
mov    %r9,%r15
mov    %rdx,%r13
mov    %rsi,%rbp
movsd  0xc0(%rsp),%xmm8
movl   $0x0,(%r14)
sub    $0x8,%rsp
lea    0x28(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %ebx,%edi
movsd  %xmm1,0x10(%rsp)
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
movaps %xmm4,%xmm3
movaps %xmm5,%xmm4
movaps %xmm6,%xmm5
movaps %xmm7,%xmm6
movaps %xmm8,%xmm7
push   $0x0
call   1050 <palEl2ue@plt>
movsd  0x18(%rsp),%xmm0
add    $0x10,%rsp
mov    (%rsp),%eax
test   %eax,%eax
je     11d3 <palPertel+0xa3>
mov    %eax,(%r14)
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x20(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <palPertue@plt>
mov    (%rsp),%eax
test   %eax,%eax
jle    11ec <palPertel+0xbc>
mov    %eax,(%r14)
jmp    11ee <palPertel+0xbe>
js     123d <palPertel+0x10d>
lea    0x18(%rsp),%rax
lea    0x20(%rsp),%rdi
lea    0x4(%rsp),%rdx
mov    %ebx,%esi
mov    %rbp,%rcx
mov    %r13,%r8
mov    %r12,%r9
mov    %rsp,%rbp
push   %rbp
push   %rax
push   0xe0(%rsp)
push   0xe0(%rsp)
push   %r15
push   0x38(%rsp)
call   1040 <palUe2el@plt>
add    $0x30,%rsp
mov    $0xfffffffb,%eax
cmp    %ebx,0x4(%rsp)
jne    11be <palPertel+0x8e>
cmpl   $0x0,(%rsp)
je     11c1 <palPertel+0x91>
jmp    11be <palPertel+0x8e>
mov    $0xfffffffb,%eax
jmp    11be <palPertel+0x8e>

LLVM IR (-O0):
define void @palPertel(i32 %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double* %10, double* %11, double* %12, double* %13, double* %14, double* %15, double* %16, i32* %17) {
%19 = alloca i32
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double*
%30 = alloca double*
%31 = alloca double*
%32 = alloca double*
%33 = alloca double*
%34 = alloca double*
%35 = alloca double*
%36 = alloca i32*
%37 = alloca [13 x double]
%38 = alloca double
%39 = alloca i32
%40 = alloca i32
store i32 %0, i32* %19
store double %1, double* %20
store double %2, double* %21
store double %3, double* %22
store double %4, double* %23
store double %5, double* %24
store double %6, double* %25
store double %7, double* %26
store double %8, double* %27
store double %9, double* %28
store double* %10, double** %29
store double* %11, double** %30
store double* %12, double** %31
store double* %13, double** %32
store double* %14, double** %33
store double* %15, double** %34
store double* %16, double** %35
store i32* %17, i32** %36
%41 = load i32, i32* %19
%42 = icmp slt i32 %41, 2
br i1 %42, label %46, label %43
43: ; preds = %18
%44 = load i32, i32* %19
%45 = icmp sgt i32 %44, 3
br i1 %45, label %46, label %48
46: ; preds = %43, %18
%47 = load i32*, i32** %36
store i32 -1, i32* %47
br label %101
48: ; preds = %43
%49 = load i32*, i32** %36
store i32 0, i32* %49
br label %50
50: ; preds = %48
%51 = load double, double* %20
%52 = load i32, i32* %19
%53 = load double, double* %22
%54 = load double, double* %23
%55 = load double, double* %24
%56 = load double, double* %25
%57 = load double, double* %26
%58 = load double, double* %27
%59 = load double, double* %28
%60 = getelementptr inbounds [13 x double], [13 x double]* %37, i64 0, i64 0
%61 = call i32 @palEl2ue(double %51, i32 %52, double %53, double %54, double %55, double %56, double %57, double %58, double %59, double 0.000000e+00, double* %60, i32* %39)
%62 = load i32, i32* %39
%63 = icmp ne i32 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %50
%65 = load i32, i32* %39
%66 = load i32*, i32** %36
store i32 %65, i32* %66
br label %101
67: ; preds = %50
%68 = load double, double* %21
%69 = getelementptr inbounds [13 x double], [13 x double]* %37, i64 0, i64 0
%70 = call i32 @palPertue(double %68, double* %69, i32* %39)
%71 = load i32, i32* %39
%72 = icmp sgt i32 %71, 0
br i1 %72, label %73, label %76
73: ; preds = %67
%74 = load i32, i32* %39
%75 = load i32*, i32** %36
store i32 %74, i32* %75
br label %82
76: ; preds = %67
%77 = load i32, i32* %39
%78 = icmp slt i32 %77, 0
br i1 %78, label %79, label %81
79: ; preds = %76
%80 = load i32*, i32** %36
store i32 -5, i32* %80
br label %101
81: ; preds = %76
br label %82
82: ; preds = %81, %73
%83 = getelementptr inbounds [13 x double], [13 x double]* %37, i64 0, i64 0
%84 = load i32, i32* %19
%85 = load double*, double** %29
%86 = load double*, double** %30
%87 = load double*, double** %31
%88 = load double*, double** %32
%89 = load double*, double** %33
%90 = load double*, double** %34
%91 = load double*, double** %35
%92 = call i32 @palUe2el(double* %83, i32 %84, i32* %40, double* %85, double* %86, double* %87, double* %88, double* %89, double* %90, double* %91, double* %38, i32* %39)
%93 = load i32, i32* %40
%94 = load i32, i32* %19
%95 = icmp ne i32 %93, %94
br i1 %95, label %99, label %96
96: ; preds = %82
%97 = load i32, i32* %39
%98 = icmp ne i32 %97, 0
br i1 %98, label %99, label %101
99: ; preds = %96, %82
%100 = load i32*, i32** %36
store i32 -5, i32* %100
br label %101
101: ; preds = %46, %64, %79, %99, %96
ret void
}

LLVM IR (-O2):
define void @palPertel(i32 %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double* %10, double* %11, double* %12, double* %13, double* %14, double* %15, double* %16, i32* nocapture writeonly %17) {
%19 = alloca [13 x double]
%20 = alloca double
%21 = alloca i32
%22 = alloca i32
%23 = bitcast [13 x double]* %19 to i8*
%24 = bitcast double* %20 to i8*
%25 = bitcast i32* %21 to i8*
%26 = bitcast i32* %22 to i8*
%27 = add i32 %0, -4
%28 = icmp ult i32 %27, -2
br i1 %28, label %48, label %29
29: ; preds = %18
store i32 0, i32* %17
%30 = getelementptr inbounds [13 x double], [13 x double]* %19, i64 0, i64 0
%31 = call i32 @palEl2ue(double %1, i32 %0, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double 0.000000e+00, double* %30, i32* %21)
%32 = load i32, i32* %21
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %48
34: ; preds = %29
%35 = call i32 @palPertue(double %2, double* %30, i32* %21)
%36 = load i32, i32* %21
%37 = icmp sgt i32 %36, 0
br i1 %37, label %38, label %39
38: ; preds = %34
store i32 %36, i32* %17
br label %41
39: ; preds = %34
%40 = icmp slt i32 %36, 0
br i1 %40, label %48, label %41
41: ; preds = %39, %38
%42 = call i32 @palUe2el(double* %30, i32 %0, i32* %22, double* %10, double* %11, double* %12, double* %13, double* %14, double* %15, double* %16, double* %20, i32* %21)
%43 = load i32, i32* %22
%44 = icmp ne i32 %43, %0
%45 = load i32, i32* %21
%46 = icmp ne i32 %45, 0
%47 = select i1 %44, i1 true, i1 %46
br i1 %47, label %48, label %50
48: ; preds = %41, %39, %29, %18
%49 = phi i32 [ -1, %18 ], [ %32, %29 ], [ -5, %39 ], [ -5, %41 ]
store i32 %49, i32* %17
br label %50
50: ; preds = %48, %41
ret void
}