#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 */
double atan2(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ cos(double);
double cosd(double);
double sind(double);
int /*<<< orphan*/ tan(double);
void geo2topo(double *ra, double *dec, double ha, double par, double lat,
              double lon) {
  double topra, topdec, rho, gclat, g;
  gclat = lat - 0.1924 * sind(2 * lat);
  rho = 0.99883 + 0.00167 * cosd(2 * lat);
  g = 57.29577951 * atan2(tan(gclat), cos(ha));
  topra = *ra - par * rho * cosd(gclat) * sind(ha) / cosd(*dec);
  topdec = *dec - par * rho * sind(gclat) * sind(g - *dec) / sind(g);
  *ra = topra;
  *dec = topdec;
}


x86 assembly (clang, -O0):
<geo2topo>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  %xmm3,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0xe8c(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1030 <sind@plt>
movsd  -0xa8(%rbp),%xmm1
ff
movsd  0xe7a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe5d(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1050 <cosd@plt>
movsd  0xe3b(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe37(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x50(%rbp),%xmm0
call   1060 <tan@plt>
mov    %eax,-0x9c(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1070 <cos@plt>
mov    -0x9c(%rbp),%edi
mov    %eax,%esi
call   1040 <atan2@plt>
movaps %xmm0,%xmm1
movsd  0xdec(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
call   1050 <cosd@plt>
movaps %xmm0,%xmm1
movsd  -0x98(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
call   1030 <sind@plt>
movaps %xmm0,%xmm1
movsd  -0x90(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1050 <cosd@plt>
movsd  -0x88(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x80(%rbp),%xmm0
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x50(%rbp),%xmm0
call   1030 <sind@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x58(%rbp),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
call   1030 <sind@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x58(%rbp),%xmm0
call   1030 <sind@plt>
movsd  -0x68(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x60(%rbp),%xmm0
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geo2topo>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
movsd  %xmm2,(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    %rsi,%rbx
mov    %rdi,%r14
movapd %xmm2,%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,0x10(%rsp)
call   1030 <sind@plt>
mulsd  0xe76(%rip),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
call   1050 <cosd@plt>
mulsd  0xe60(%rip),%xmm0
addsd  0xe60(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x20(%rsp),%xmm0
call   1060 <tan@plt>
mov    %eax,%ebp
movsd  0x8(%rsp),%xmm0
call   1070 <cos@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <atan2@plt>
mulsd  0xe3a(%rip),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  (%r14),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x20(%rsp),%xmm0
call   1050 <cosd@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sind@plt>
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rbx),%xmm0
call   1050 <cosd@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  (%rbx),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x20(%rsp),%xmm0
call   1030 <sind@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x28(%rsp),%xmm0
subsd  (%rbx),%xmm0
call   1030 <sind@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x28(%rsp),%xmm0
call   1030 <sind@plt>
movsd  (%rsp),%xmm2
divsd  %xmm0,%xmm2
movsd  0x8(%rsp),%xmm1
subsd  %xmm2,%xmm1
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%r14)
movsd  %xmm1,(%rbx)
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @geo2topo(double* %0, double* %1, double %2, double %3, double %4, double %5) {
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
store double* %0, double** %7
store double* %1, double** %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%18 = load double, double* %11
%19 = load double, double* %11
%20 = fmul double 2.000000e+00, %19
%21 = call double @sind(double %20)
%22 = call double @llvm.fmuladd.f64(double -1.924000e-01, double %21, double %18)
store double %22, double* %16
%23 = load double, double* %11
%24 = fmul double 2.000000e+00, %23
%25 = call double @cosd(double %24)
%26 = call double @llvm.fmuladd.f64(double 1.670000e-03, double %25, double 0x3FEFF66A55087011)
store double %26, double* %15
%27 = load double, double* %16
%28 = call i32 @tan(double %27)
%29 = load double, double* %9
%30 = call i32 @cos(double %29)
%31 = call double @atan2(i32 %28, i32 %30)
%32 = fmul double 0x404CA5DC1A5D2372, %31
store double %32, double* %17
%33 = load double*, double** %7
%34 = load double, double* %33
%35 = load double, double* %10
%36 = load double, double* %15
%37 = fmul double %35, %36
%38 = load double, double* %16
%39 = call double @cosd(double %38)
%40 = fmul double %37, %39
%41 = load double, double* %9
%42 = call double @sind(double %41)
%43 = fmul double %40, %42
%44 = load double*, double** %8
%45 = load double, double* %44
%46 = call double @cosd(double %45)
%47 = fdiv double %43, %46
%48 = fsub double %34, %47
store double %48, double* %13
%49 = load double*, double** %8
%50 = load double, double* %49
%51 = load double, double* %10
%52 = load double, double* %15
%53 = fmul double %51, %52
%54 = load double, double* %16
%55 = call double @sind(double %54)
%56 = fmul double %53, %55
%57 = load double, double* %17
%58 = load double*, double** %8
%59 = load double, double* %58
%60 = fsub double %57, %59
%61 = call double @sind(double %60)
%62 = fmul double %56, %61
%63 = load double, double* %17
%64 = call double @sind(double %63)
%65 = fdiv double %62, %64
%66 = fsub double %50, %65
store double %66, double* %14
%67 = load double, double* %13
%68 = load double*, double** %7
store double %67, double* %68
%69 = load double, double* %14
%70 = load double*, double** %8
store double %69, double* %70
ret void
}

LLVM IR (-O2):
define void @geo2topo(double* nocapture %0, double* nocapture %1, double %2, double %3, double %4, double %5) {
%7 = fmul double %4, 2.000000e+00
%8 = tail call double @sind(double %7)
%9 = tail call double @llvm.fmuladd.f64(double %8, double -1.924000e-01, double %4)
%10 = tail call double @cosd(double %7)
%11 = tail call double @llvm.fmuladd.f64(double %10, double 1.670000e-03, double 0x3FEFF66A55087011)
%12 = tail call i32 @tan(double %9)
%13 = tail call i32 @cos(double %2)
%14 = tail call double @atan2(i32 %12, i32 %13)
%15 = fmul double %14, 0x404CA5DC1A5D2372
%16 = load double, double* %0
%17 = fmul double %11, %3
%18 = tail call double @cosd(double %9)
%19 = fmul double %17, %18
%20 = tail call double @sind(double %2)
%21 = fmul double %19, %20
%22 = load double, double* %1
%23 = tail call double @cosd(double %22)
%24 = fdiv double %21, %23
%25 = fsub double %16, %24
%26 = load double, double* %1
%27 = tail call double @sind(double %9)
%28 = fmul double %17, %27
%29 = load double, double* %1
%30 = fsub double %15, %29
%31 = tail call double @sind(double %30)
%32 = fmul double %28, %31
%33 = tail call double @sind(double %15)
%34 = fdiv double %32, %33
%35 = fsub double %26, %34
store double %25, double* %0
store double %35, double* %1
ret void
}