#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 cos(double);
int sin(double);
double WidthMoon(double AltO, double AziO, double AltS, double AziS,
                 double parallax) {
  double GeoAltO = AltO + parallax;
  return 0.27245 * parallax *
         (1 + sin(GeoAltO * (3.14159265358979323846 / 180.0)) *
                  sin(parallax * (3.14159265358979323846 / 180.0))) *
         (1 - cos((AltS - GeoAltO) * (3.14159265358979323846 / 180.0)) *
                  cos((AziS - AziO) * (3.14159265358979323846 / 180.0)));
}


x86 assembly (clang, -O0):
<WidthMoon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xeb0(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe96(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1030 <sin@plt>
mov    %eax,-0x40(%rbp)
movsd  0xe81(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x48(%rbp),%xmm0
mov    %eax,%ecx
mov    -0x40(%rbp),%eax
imul   %ecx,%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  0xe48(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <cos@plt>
mov    %eax,-0x3c(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  0xe2a(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <cos@plt>
mov    -0x3c(%rbp),%ecx
movsd  -0x38(%rbp),%xmm0
imul   %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WidthMoon>:
push   %rbx
sub    $0x30,%rsp
movsd  %xmm3,0x28(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x20(%rsp)
movsd  %xmm4,0x8(%rsp)
addsd  %xmm4,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xeb1(%rip),%xmm1
mulsd  %xmm4,%xmm1
movsd  %xmm1,(%rsp)
mulsd  0xea8(%rip),%xmm0
call   1030 <sin@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
mulsd  0xe93(%rip),%xmm0
call   1030 <sin@plt>
imul   %ebx,%eax
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x18(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
mulsd  0xe63(%rip),%xmm0
call   1040 <cos@plt>
mov    %eax,%ebx
movsd  0x28(%rsp),%xmm0
subsd  0x20(%rsp),%xmm0
mulsd  0xe48(%rip),%xmm0
call   1040 <cos@plt>
imul   %ebx,%eax
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
mulsd  (%rsp),%xmm0
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @WidthMoon(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%12 = load double, double* %6
%13 = load double, double* %10
%14 = fadd double %12, %13
store double %14, double* %11
%15 = load double, double* %10
%16 = fmul double 2.724500e-01, %15
%17 = load double, double* %11
%18 = fmul double %17, 0x3F91DF46A2529D39
%19 = call i32 @sin(double %18)
%20 = load double, double* %10
%21 = fmul double %20, 0x3F91DF46A2529D39
%22 = call i32 @sin(double %21)
%23 = mul nsw i32 %19, %22
%24 = add nsw i32 1, %23
%25 = sitofp i32 %24 to double
%26 = fmul double %16, %25
%27 = load double, double* %8
%28 = load double, double* %11
%29 = fsub double %27, %28
%30 = fmul double %29, 0x3F91DF46A2529D39
%31 = call i32 @cos(double %30)
%32 = load double, double* %9
%33 = load double, double* %7
%34 = fsub double %32, %33
%35 = fmul double %34, 0x3F91DF46A2529D39
%36 = call i32 @cos(double %35)
%37 = mul nsw i32 %31, %36
%38 = sub nsw i32 1, %37
%39 = sitofp i32 %38 to double
%40 = fmul double %26, %39
ret double %40
}

LLVM IR (-O2):
define double @WidthMoon(double %0, double %1, double %2, double %3, double %4) {
%6 = fadd double %0, %4
%7 = fmul double %4, 2.724500e-01
%8 = fmul double %6, 0x3F91DF46A2529D39
%9 = tail call i32 @sin(double %8)
%10 = fmul double %4, 0x3F91DF46A2529D39
%11 = tail call i32 @sin(double %10)
%12 = mul nsw i32 %11, %9
%13 = add nsw i32 %12, 1
%14 = sitofp i32 %13 to double
%15 = fmul double %7, %14
%16 = fsub double %2, %6
%17 = fmul double %16, 0x3F91DF46A2529D39
%18 = tail call i32 @cos(double %17)
%19 = fsub double %3, %1
%20 = fmul double %19, 0x3F91DF46A2529D39
%21 = tail call i32 @cos(double %20)
%22 = mul nsw i32 %21, %18
%23 = sub nsw i32 1, %22
%24 = sitofp i32 %23 to double
%25 = fmul double %15, %24
ret double %25
}