#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*/ Aberration(double *, double *, int);
int /*<<< orphan*/ Nutation(double *, double *, int);
int /*<<< orphan*/ Precession(double *, double *, int);
void Apparent(double *ra, double *dec, int dirflag) {
  double tmpra, tmpdec;
  tmpra = *ra;
  tmpdec = *dec;
  if (dirflag > 0) {
    Precession(&tmpra, &tmpdec, 1);
    Nutation(&tmpra, &tmpdec, 1);
    Aberration(&tmpra, &tmpdec, 1);
    *ra = tmpra;
    *dec = tmpdec;
  } else if (dirflag < 0) {
    Aberration(&tmpra, &tmpdec, -1);
    Nutation(&tmpra, &tmpdec, -1);
    Precession(&tmpra, &tmpdec, -1);
    *ra = tmpra;
    *dec = tmpdec;
  }
}


x86 assembly (clang, -O0):
<Apparent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    11bc <Apparent+0x8c>
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x1,%edx
call   1040 <Precession@plt>
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x1,%edx
call   1050 <Nutation@plt>
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x1,%edx
call   1030 <Aberration@plt>
movsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    121b <Apparent+0xeb>
cmpl   $0x0,-0x14(%rbp)
jge    1216 <Apparent+0xe6>
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    $0xffffffff,%edx
call   1030 <Aberration@plt>
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    $0xffffffff,%edx
call   1050 <Nutation@plt>
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    $0xffffffff,%edx
call   1040 <Precession@plt>
movsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    121b <Apparent+0xeb>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Apparent>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  (%rsi),%xmm0
movsd  %xmm0,0x8(%rsp)
test   %edx,%edx
jle    11aa <Apparent+0x7a>
lea    0x10(%rsp),%r15
lea    0x8(%rsp),%r12
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x1,%edx
call   1040 <Precession@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x1,%edx
call   1050 <Nutation@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x1,%edx
call   1030 <Aberration@plt>
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
jmp    11ac <Apparent+0x7c>
js     11b8 <Apparent+0x88>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0x10(%rsp),%r15
lea    0x8(%rsp),%r12
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0xffffffff,%edx
call   1030 <Aberration@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0xffffffff,%edx
call   1050 <Nutation@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0xffffffff,%edx
call   1040 <Precession@plt>
jmp    1193 <Apparent+0x63>

LLVM IR (-O0):
define void @Apparent(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
%7 = alloca double
%8 = alloca double
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%9 = load double*, double** %4
%10 = load double, double* %9
store double %10, double* %7
%11 = load double*, double** %5
%12 = load double, double* %11
store double %12, double* %8
%13 = load i32, i32* %6
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %23
15: ; preds = %3
%16 = call i32 @Precession(double* %7, double* %8, i32 1)
%17 = call i32 @Nutation(double* %7, double* %8, i32 1)
%18 = call i32 @Aberration(double* %7, double* %8, i32 1)
%19 = load double, double* %7
%20 = load double*, double** %4
store double %19, double* %20
%21 = load double, double* %8
%22 = load double*, double** %5
store double %21, double* %22
br label %35
23: ; preds = %3
%24 = load i32, i32* %6
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %34
26: ; preds = %23
%27 = call i32 @Aberration(double* %7, double* %8, i32 -1)
%28 = call i32 @Nutation(double* %7, double* %8, i32 -1)
%29 = call i32 @Precession(double* %7, double* %8, i32 -1)
%30 = load double, double* %7
%31 = load double*, double** %4
store double %30, double* %31
%32 = load double, double* %8
%33 = load double*, double** %5
store double %32, double* %33
br label %34
34: ; preds = %26, %23
br label %35
35: ; preds = %34, %15
ret void
}

LLVM IR (-O2):
define void @Apparent(double* nocapture %0, double* nocapture %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = bitcast double* %4 to i8*
%7 = bitcast double* %5 to i8*
%8 = load double, double* %0
store double %8, double* %4
%9 = load double, double* %1
store double %9, double* %5
%10 = icmp sgt i32 %2, 0
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = call i32 @Precession(double* %4, double* %5, i32 1)
%13 = call i32 @Nutation(double* %4, double* %5, i32 1)
%14 = call i32 @Aberration(double* %4, double* %5, i32 1)
br label %21
15: ; preds = %3
%16 = icmp slt i32 %2, 0
br i1 %16, label %17, label %24
17: ; preds = %15
%18 = call i32 @Aberration(double* %4, double* %5, i32 -1)
%19 = call i32 @Nutation(double* %4, double* %5, i32 -1)
%20 = call i32 @Precession(double* %4, double* %5, i32 -1)
br label %21
21: ; preds = %11, %17
%22 = load double, double* %4
store double %22, double* %0
%23 = load double, double* %5
store double %23, double* %1
br label %24
24: ; preds = %21, %15
ret void
}