#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 */
scalar_t__ ceil(float);
scalar_t__ floor(float);
double sin(double);
void flmoon(int n, int nph, long *jd, float *frac) {
  void nrerror(char error_text[]);
  int i;
  float am, as, c, t, t2, xtra;
  c = n + nph / 4.0;
  t = c / 1236.85;
  t2 = t * t;
  as = 359.2242 + 29.105356 * c;
  am = 306.0253 + 385.816918 * c + 0.010730 * t2;
  *jd = 2415020 + 28L * n + 7L * nph;
  xtra = 0.75933 + 1.53058868 * c + ((1.178e-4) - (1.55e-7) * t) * t2;
  if (nph == 0 || nph == 2)
    xtra += (0.1734 - 3.93e-4 * t) * sin((3.14159265 / 180.0) * as) -
            0.4068 * sin((3.14159265 / 180.0) * am);
  else if (nph == 1 || nph == 3)
    xtra += (0.1721 - 4.0e-4 * t) * sin((3.14159265 / 180.0) * as) -
            0.6280 * sin((3.14159265 / 180.0) * am);
  else
    nrerror("nph is unknown in flmoon");
  i = (int)(xtra >= 0.0 ? floor(xtra) : ceil(xtra - 1.0));
  *jd += i;
  *frac = xtra - i;
}


x86 assembly (clang, -O0):
<flmoon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xee8(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xebe(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
mulss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe81(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe7d(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe47(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe43(%rip),%xmm0
addsd  %xmm0,%xmm1
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe1e(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movslq -0x4(%rbp),%rax
imul   $0x1c,%rax,%rcx
add    $0x24d9ac,%rcx
movslq -0x8(%rbp),%rax
imul   $0x7,%rax,%rax
add    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdcb(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xdc7(%rip),%xmm0
addsd  %xmm0,%xmm1
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd9a(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  0xd96(%rip),%xmm2
addsd  %xmm2,%xmm0
movss  -0x30(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     12a4 <flmoon+0x164>
cmpl   $0x2,-0x8(%rbp)
jne    1356 <flmoon+0x216>
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdcb(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdc7(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd85(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1050 <sin@plt>
movsd  %xmm0,-0x40(%rbp)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd66(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1050 <sin@plt>
movsd  -0x48(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  0xd60(%rip),%xmm0
mulsd  %xmm3,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
jmp    142d <flmoon+0x2ed>
cmpl   $0x1,-0x8(%rbp)
je     136a <flmoon+0x22a>
cmpl   $0x3,-0x8(%rbp)
jne    141c <flmoon+0x2dc>
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xced(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xce9(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xcbf(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1050 <sin@plt>
movsd  %xmm0,-0x50(%rbp)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xca0(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1050 <sin@plt>
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  0xc7a(%rip),%xmm0
mulsd  %xmm3,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
jmp    1428 <flmoon+0x2e8>
lea    0xc75(%rip),%rdi
call   1040 <nrerror@plt>
jmp    142d <flmoon+0x2ed>
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1456 <flmoon+0x316>
movss  -0x34(%rbp),%xmm0
call   1060 <floor@plt>
mov    %rax,-0x60(%rbp)
jmp    1478 <flmoon+0x338>
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc29(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <ceil@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    %eax,-0x1c(%rbp)
movslq -0x1c(%rbp),%rcx
mov    -0x10(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
movss  -0x34(%rbp),%xmm0
cvtsi2ssl -0x1c(%rbp),%xmm1
subss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flmoon>:
push   %r14
push   %rbx
sub    $0x18,%rsp
cvtsi2sd %edi,%xmm0
cvtsi2sd %esi,%xmm1
mulsd  0xea9(%rip),%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movaps %xmm1,%xmm0
divsd  0xe94(%rip),%xmm0
mov    %rcx,%r14
mov    %rdx,%rbx
cvtsd2ss %xmm0,%xmm2
movaps %xmm2,%xmm3
mulss  %xmm2,%xmm3
movsd  0xe83(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xe7f(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0xe7b(%rip),%xmm4
mulsd  %xmm1,%xmm4
addsd  0xe77(%rip),%xmm4
cvtss2sd %xmm3,%xmm3
movsd  0xe73(%rip),%xmm5
mulsd  %xmm3,%xmm5
addsd  %xmm4,%xmm5
cvtsd2ss %xmm5,%xmm5
xorps  %xmm4,%xmm4
cvtss2sd %xmm2,%xmm4
movslq %edi,%rax
lea    (%rax,%rax,8),%rcx
lea    (%rcx,%rcx,2),%rcx
add    %rax,%rcx
movslq %esi,%rax
lea    0x0(,%rax,8),%rdx
sub    %rax,%rdx
add    %rdx,%rcx
add    $0x24d9ac,%rcx
mov    %rcx,(%rbx)
mulsd  0xe37(%rip),%xmm1
addsd  0xe37(%rip),%xmm1
movsd  0xe37(%rip),%xmm2
mulsd  %xmm4,%xmm2
addsd  0xe33(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtsd2ss %xmm2,%xmm1
and    $0xfffffffd,%eax
cmp    $0x1,%eax
movss  %xmm1,(%rsp)
je     1295 <flmoon+0x155>
test   %eax,%eax
jne    130d <flmoon+0x1cd>
mulsd  0xe2f(%rip),%xmm4
addsd  0xe2f(%rip),%xmm4
movsd  %xmm4,0x10(%rsp)
cvtss2sd %xmm0,%xmm0
mulsd  0xe05(%rip),%xmm0
movss  %xmm5,0x4(%rsp)
call   1050 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xde2(%rip),%xmm0
call   1050 <sin@plt>
mulsd  0xdf5(%rip),%xmm0
jmp    12e7 <flmoon+0x1a7>
mulsd  0xdbb(%rip),%xmm4
addsd  0xdbb(%rip),%xmm4
movsd  %xmm4,0x10(%rsp)
cvtss2sd %xmm0,%xmm0
mulsd  0xdb1(%rip),%xmm0
movss  %xmm5,0x4(%rsp)
call   1050 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xd8e(%rip),%xmm0
call   1050 <sin@plt>
mulsd  0xd89(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
addsd  %xmm0,%xmm1
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
jmp    131e <flmoon+0x1de>
lea    0xd80(%rip),%rdi
call   1040 <nrerror@plt>
movss  (%rsp),%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
movss  %xmm1,(%rsp)
jae    133e <flmoon+0x1fe>
movss  0xd5d(%rip),%xmm0
addss  %xmm1,%xmm0
call   1030 <ceil@plt>
jmp    1346 <flmoon+0x206>
movaps %xmm1,%xmm0
call   1060 <floor@plt>
cltq
add    %rax,(%rbx)
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  (%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"nph is unknown in flmoon\00"
define void @flmoon(i32 %0, i32 %1, i64* %2, float* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64*
%8 = alloca float*
%9 = alloca i32
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
store i32 %0, i32* %5
store i32 %1, i32* %6
store i64* %2, i64** %7
store float* %3, float** %8
%16 = load i32, i32* %5
%17 = sitofp i32 %16 to double
%18 = load i32, i32* %6
%19 = sitofp i32 %18 to double
%20 = fdiv double %19, 4.000000e+00
%21 = fadd double %17, %20
%22 = fptrunc double %21 to float
store float %22, float* %12
%23 = load float, float* %12
%24 = fpext float %23 to double
%25 = fdiv double %24, 1.236850e+03
%26 = fptrunc double %25 to float
store float %26, float* %13
%27 = load float, float* %13
%28 = load float, float* %13
%29 = fmul float %27, %28
store float %29, float* %14
%30 = load float, float* %12
%31 = fpext float %30 to double
%32 = call double @llvm.fmuladd.f64(double 0x403D1AF89C5E6FF8, double %31, double 0x4076739652BD3C36)
%33 = fptrunc double %32 to float
store float %33, float* %11
%34 = load float, float* %12
%35 = fpext float %34 to double
%36 = call double @llvm.fmuladd.f64(double 0x40781D12189BD838, double %35, double 0x40732067A0F9096C)
%37 = load float, float* %14
%38 = fpext float %37 to double
%39 = call double @llvm.fmuladd.f64(double 1.073000e-02, double %38, double %36)
%40 = fptrunc double %39 to float
store float %40, float* %10
%41 = load i32, i32* %5
%42 = sext i32 %41 to i64
%43 = mul nsw i64 28, %42
%44 = add nsw i64 2415020, %43
%45 = load i32, i32* %6
%46 = sext i32 %45 to i64
%47 = mul nsw i64 7, %46
%48 = add nsw i64 %44, %47
%49 = load i64*, i64** %7
store i64 %48, i64* %49
%50 = load float, float* %12
%51 = fpext float %50 to double
%52 = call double @llvm.fmuladd.f64(double 0x3FF87D4A8E43A51B, double %51, double 7.593300e-01)
%53 = load float, float* %13
%54 = fpext float %53 to double
%55 = call double @llvm.fmuladd.f64(double -1.550000e-07, double %54, double 1.178000e-04)
%56 = load float, float* %14
%57 = fpext float %56 to double
%58 = call double @llvm.fmuladd.f64(double %55, double %57, double %52)
%59 = fptrunc double %58 to float
store float %59, float* %15
%60 = load i32, i32* %6
%61 = icmp eq i32 %60, 0
br i1 %61, label %65, label %62
62: ; preds = %4
%63 = load i32, i32* %6
%64 = icmp eq i32 %63, 2
br i1 %64, label %65, label %84
65: ; preds = %62, %4
%66 = load float, float* %13
%67 = fpext float %66 to double
%68 = call double @llvm.fmuladd.f64(double -3.930000e-04, double %67, double 1.734000e-01)
%69 = load float, float* %11
%70 = fpext float %69 to double
%71 = fmul double 0x3F91DF46A1FAE712, %70
%72 = call double @sin(double %71)
%73 = load float, float* %10
%74 = fpext float %73 to double
%75 = fmul double 0x3F91DF46A1FAE712, %74
%76 = call double @sin(double %75)
%77 = fmul double 4.068000e-01, %76
%78 = fneg double %77
%79 = call double @llvm.fmuladd.f64(double %68, double %72, double %78)
%80 = load float, float* %15
%81 = fpext float %80 to double
%82 = fadd double %81, %79
%83 = fptrunc double %82 to float
store float %83, float* %15
br label %111
84: ; preds = %62
%85 = load i32, i32* %6
%86 = icmp eq i32 %85, 1
br i1 %86, label %90, label %87
87: ; preds = %84
%88 = load i32, i32* %6
%89 = icmp eq i32 %88, 3
br i1 %89, label %90, label %109
90: ; preds = %87, %84
%91 = load float, float* %13
%92 = fpext float %91 to double
%93 = call double @llvm.fmuladd.f64(double -4.000000e-04, double %92, double 1.721000e-01)
%94 = load float, float* %11
%95 = fpext float %94 to double
%96 = fmul double 0x3F91DF46A1FAE712, %95
%97 = call double @sin(double %96)
%98 = load float, float* %10
%99 = fpext float %98 to double
%100 = fmul double 0x3F91DF46A1FAE712, %99
%101 = call double @sin(double %100)
%102 = fmul double 6.280000e-01, %101
%103 = fneg double %102
%104 = call double @llvm.fmuladd.f64(double %93, double %97, double %103)
%105 = load float, float* %15
%106 = fpext float %105 to double
%107 = fadd double %106, %104
%108 = fptrunc double %107 to float
store float %108, float* %15
br label %110
109: ; preds = %87
br label %110
110: ; preds = %109, %90
br label %111
111: ; preds = %110, %65
%112 = load float, float* %15
%113 = fpext float %112 to double
%114 = fcmp oge double %113, 0.000000e+00
br i1 %114, label %115, label %118
115: ; preds = %111
%116 = load float, float* %15
%117 = call i64 @floor(float %116)
br label %124
118: ; preds = %111
%119 = load float, float* %15
%120 = fpext float %119 to double
%121 = fsub double %120, 1.000000e+00
%122 = fptrunc double %121 to float
%123 = call i64 @ceil(float %122)
br label %124
124: ; preds = %118, %115
%125 = phi i64 [ %117, %115 ], [ %123, %118 ]
%126 = trunc i64 %125 to i32
store i32 %126, i32* %9
%127 = load i32, i32* %9
%128 = sext i32 %127 to i64
%129 = load i64*, i64** %7
%130 = load i64, i64* %129
%131 = add nsw i64 %130, %128
store i64 %131, i64* %129
%132 = load float, float* %15
%133 = load i32, i32* %9
%134 = sitofp i32 %133 to float
%135 = fsub float %132, %134
%136 = load float*, float** %8
store float %135, float* %136
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"nph is unknown in flmoon\00"
define void @flmoon(i32 %0, i32 %1, i64* nocapture %2, float* nocapture writeonly %3) {
%5 = sitofp i32 %0 to double
%6 = sitofp i32 %1 to double
%7 = fmul double %6, 2.500000e-01
%8 = fadd double %7, %5
%9 = fptrunc double %8 to float
%10 = fpext float %9 to double
%11 = fdiv double %10, 1.236850e+03
%12 = fptrunc double %11 to float
%13 = fmul float %12, %12
%14 = tail call double @llvm.fmuladd.f64(double %10, double 0x403D1AF89C5E6FF8, double 0x4076739652BD3C36)
%15 = fptrunc double %14 to float
%16 = tail call double @llvm.fmuladd.f64(double %10, double 0x40781D12189BD838, double 0x40732067A0F9096C)
%17 = fpext float %13 to double
%18 = tail call double @llvm.fmuladd.f64(double %17, double 1.073000e-02, double %16)
%19 = fptrunc double %18 to float
%20 = sext i32 %0 to i64
%21 = mul nsw i64 %20, 28
%22 = add nsw i64 %21, 2415020
%23 = sext i32 %1 to i64
%24 = mul nsw i64 %23, 7
%25 = add nsw i64 %22, %24
store i64 %25, i64* %2
%26 = tail call double @llvm.fmuladd.f64(double %10, double 0x3FF87D4A8E43A51B, double 7.593300e-01)
%27 = fpext float %12 to double
%28 = tail call double @llvm.fmuladd.f64(double %27, double -1.550000e-07, double 1.178000e-04)
%29 = tail call double @llvm.fmuladd.f64(double %28, double %17, double %26)
%30 = fptrunc double %29 to float
%31 = and i32 %1, -3
switch i32 %31, label %58 [
i32 0, label %32
i32 1, label %45
]
32: ; preds = %4
%33 = tail call double @llvm.fmuladd.f64(double %27, double -3.930000e-04, double 1.734000e-01)
%34 = fpext float %15 to double
%35 = fmul double %34, 0x3F91DF46A1FAE712
%36 = tail call double @sin(double %35)
%37 = fpext float %19 to double
%38 = fmul double %37, 0x3F91DF46A1FAE712
%39 = tail call double @sin(double %38)
%40 = fmul double %39, -4.068000e-01
%41 = tail call double @llvm.fmuladd.f64(double %33, double %36, double %40)
%42 = fpext float %30 to double
%43 = fadd double %41, %42
%44 = fptrunc double %43 to float
br label %59
45: ; preds = %4
%46 = tail call double @llvm.fmuladd.f64(double %27, double -4.000000e-04, double 1.721000e-01)
%47 = fpext float %15 to double
%48 = fmul double %47, 0x3F91DF46A1FAE712
%49 = tail call double @sin(double %48)
%50 = fpext float %19 to double
%51 = fmul double %50, 0x3F91DF46A1FAE712
%52 = tail call double @sin(double %51)
%53 = fmul double %52, -6.280000e-01
%54 = tail call double @llvm.fmuladd.f64(double %46, double %49, double %53)
%55 = fpext float %30 to double
%56 = fadd double %54, %55
%57 = fptrunc double %56 to float
br label %59
58: ; preds = %4
tail call void @nrerror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %59
59: ; preds = %45, %58, %32
%60 = phi float [ %44, %32 ], [ %57, %45 ], [ %30, %58 ]
%61 = fcmp ult float %60, 0.000000e+00
br i1 %61, label %64, label %62
62: ; preds = %59
%63 = tail call i64 @floor(float %60)
br label %67
64: ; preds = %59
%65 = fadd float %60, -1.000000e+00
%66 = tail call i64 @ceil(float %65)
br label %67
67: ; preds = %64, %62
%68 = phi i64 [ %63, %62 ], [ %66, %64 ]
%69 = trunc i64 %68 to i32
%70 = shl i64 %68, 32
%71 = ashr exact i64 %70, 32
%72 = load i64, i64* %2
%73 = add nsw i64 %71, %72
store i64 %73, i64* %2
%74 = sitofp i32 %69 to float
%75 = fsub float %60, %74
store float %75, float* %3
ret void
}