#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*/ caldat(long, int *, int *, int *);
int /*<<< orphan*/ flmoon(int, int, long *, float *);
long julday(int, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main(void) {
  int i, i1, i2, i3, id, im, iy, n, nph = 2;
  float timzon = (-5.0) / 24.0, frac, secs;
  long j1, j2;
  static char *phase[] = {"new moon", "first quarter", "full moon",
                          "last quarter"};
  printf("Date of the next few phases of the moon\n");
  printf("Enter today\'s date (e.g. 12 15 1992)  :  \n");
  scanf("%d %d %d", &im, &id, &iy);
  n = (int)(12.37 * (iy - 1900 + ((im - 0.5) / 12.0)));
  j1 = julday(im, id, iy);
  flmoon(n, nph, &j2, &frac);
  n += (int)((j1 - j2) / 29.53 + (j1 >= j2 ? 0.5 : -0.5));
  printf("\n%10s %19s %9s\n", "date", "time(EST)", "phase");
  for (i = 1; i <= 20; i++) {
    flmoon(n, nph, &j2, &frac);
    frac = 24.0 * (frac + timzon);
    if (frac < 0.0) {
      --j2;
      frac += 24.0;
    }
    if (frac > 12.0) {
      ++j2;
      frac -= 12.0;
    } else
      frac += 12.0;
    i1 = (int)frac;
    secs = 3600.0 * (frac - i1);
    i2 = (int)(secs / 60.0);
    i3 = (int)(secs - 60 * i2 + 0.5);
    caldat(j2, &im, &id, &iy);
    printf("%5d %3d %5d %7d:%2d:%2d      %s\n", im, id, iy, i1, i2, i3,
           phase[nph]);
    if (nph == 3) {
      nph = 0;
      ++n;
    } else
      ++nph;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x28(%rbp)
movss  0xed2(%rip),%xmm0
movss  %xmm0,-0x2c(%rbp)
lea    0xef8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf13(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf30(%rip),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1050 <scanf@plt>
mov    -0x20(%rbp),%eax
sub    $0x76c,%eax
cvtsi2sd %eax,%xmm1
cvtsi2sdl -0x1c(%rbp),%xmm0
movsd  0xe40(%rip),%xmm2
subsd  %xmm2,%xmm0
movsd  0xe54(%rip),%xmm2
divsd  %xmm2,%xmm0
addsd  %xmm0,%xmm1
movsd  0xe3c(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1030 <julday@plt>
mov    %rax,-0x40(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
lea    -0x48(%rbp),%rdx
lea    -0x30(%rbp),%rcx
call   1060 <flmoon@plt>
mov    -0x40(%rbp),%rax
sub    -0x48(%rbp),%rax
cvtsi2sd %rax,%xmm0
movsd  0xdef(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x40(%rbp),%rax
mov    -0x48(%rbp),%rcx
movsd  0xdc6(%rip),%xmm0
movsd  0xdc6(%rip),%xmm1
movsd  %xmm1,-0x58(%rbp)
cmp    %rcx,%rax
movsd  %xmm0,-0x50(%rbp)
jge    125f <main+0x10f>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
lea    0xe51(%rip),%rdi
lea    0xe5a(%rip),%rsi
lea    0xe58(%rip),%rdx
lea    0xe5b(%rip),%rcx
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jg     1487 <main+0x337>
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
lea    -0x48(%rbp),%rdx
lea    -0x30(%rbp),%rcx
call   1060 <flmoon@plt>
movss  -0x30(%rbp),%xmm0
addss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd54(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1321 <main+0x1d1>
mov    -0x48(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x48(%rbp)
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd14(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcee(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    136b <main+0x21b>
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcc7(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
jmp    1389 <main+0x239>
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xca4(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
cvttss2si -0x30(%rbp),%eax
mov    %eax,-0xc(%rbp)
movss  -0x30(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xc8d(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc67(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
movss  -0x34(%rbp),%xmm0
imul   $0x3c,-0x10(%rbp),%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc0f(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
mov    -0x48(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1070 <caldat@plt>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    -0x10(%rbp),%r9d
mov    -0x14(%rbp),%r10d
movslq -0x28(%rbp),%rdi
lea    0x2c1f(%rip),%rax
mov    (%rax,%rdi,8),%rax
lea    0xcb8(%rip),%rdi
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x3,-0x28(%rbp)
jne    146b <main+0x31b>
movl   $0x0,-0x28(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1474 <main+0x324>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1479 <main+0x329>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12a1 <main+0x151>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xf70(%rip),%rdi
call   1030 <puts@plt>
lea    0xf8c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf09(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1060 <scanf@plt>
mov    0xc(%rsp),%edx
lea    -0x76c(%rdx),%eax
cvtsi2sd %eax,%xmm0
mov    0x10(%rsp),%edi
cvtsi2sd %edi,%xmm1
addsd  0xe41(%rip),%xmm1
divsd  0xe41(%rip),%xmm1
addsd  %xmm0,%xmm1
mulsd  0xe3d(%rip),%xmm1
cvttsd2si %xmm1,%r15d
mov    0x14(%rsp),%esi
call   1040 <julday@plt>
mov    %rax,%rbx
mov    $0x2,%ebp
lea    0x18(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %r15d,%edi
mov    $0x2,%esi
call   1070 <flmoon@plt>
xor    %eax,%eax
sub    0x18(%rsp),%rbx
xorps  %xmm0,%xmm0
cvtsi2sd %rbx,%xmm0
divsd  0xe01(%rip),%xmm0
setl   %al
lea    0xe0f(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%r14d
add    %r15d,%r14d
lea    0xe6a(%rip),%rdi
lea    0xe73(%rip),%rsi
lea    0xe71(%rip),%rdx
lea    0xe74(%rip),%rcx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x14,%r12d
jmp    1329 <main+0x1c9>
nopl   0x0(%rax)
addss  %xmm1,%xmm0
mov    0x18(%rsp),%rdi
movss  %xmm0,0x8(%rsp)
cvttss2si %xmm0,%eax
mov    %eax,0x24(%rsp)
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
subss  %xmm1,%xmm0
mulss  0xdc6(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
divsd  0xd87(%rip),%xmm1
cvttsd2si %xmm1,%r13d
imul   $0x3c,%r13d,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xd6f(%rip),%xmm0
cvttsd2si %xmm0,%r15d
lea    0x10(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1080 <caldat@plt>
mov    0x10(%rsp),%esi
mov    0x14(%rsp),%edx
mov    0xc(%rsp),%ecx
mov    %ebp,%eax
lea    0xd71(%rip),%rdi
movslq (%rdi,%rax,4),%rbx
add    %rdi,%rbx
lea    0xdcf(%rip),%rdi
mov    0x24(%rsp),%r8d
mov    %r13d,%r9d
xor    %eax,%eax
push   %rbx
push   %r15
call   1050 <printf@plt>
add    $0x10,%rsp
xor    %eax,%eax
cmp    $0x3,%ebp
lea    0x1(%rbp),%ecx
sete   %al
mov    $0x0,%edx
cmove  %edx,%ecx
add    %eax,%r14d
mov    %ecx,%ebp
add    $0xffffffff,%r12d
je     1395 <main+0x235>
mov    %r14d,%edi
mov    %ebp,%esi
lea    0x18(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1070 <flmoon@plt>
movss  0x8(%rsp),%xmm0
addss  0xcf5(%rip),%xmm0
movss  0xcf1(%rip),%xmm1
mulss  %xmm1,%xmm0
xorps  %xmm2,%xmm2
ucomiss %xmm0,%xmm2
jbe    1369 <main+0x209>
addq   $0xffffffffffffffff,0x18(%rsp)
addss  %xmm1,%xmm0
movss  0xcd7(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1260 <main+0x100>
mov    0x18(%rsp),%rdi
add    $0x1,%rdi
mov    %rdi,0x18(%rsp)
addss  0xcbc(%rip),%xmm0
jmp    1269 <main+0x109>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@main.phase = internal global [4 x i8*] [i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i32 0, i32 0)]
@.str = [9 x i8] c"new moon\00"
@.str.1 = [14 x i8] c"first quarter\00"
@.str.2 = [10 x i8] c"full moon\00"
@.str.3 = [13 x i8] c"last quarter\00"
@.str.4 = [41 x i8] c"Date of the next few phases of the moon\0A\00"
@.str.5 = [43 x i8] c"Enter today's date (e.g. 12 15 1992) : \0A\00"
@.str.6 = [9 x i8] c"%d %d %d\00"
@.str.7 = [16 x i8] c"\0A%10s %19s %9s\0A\00"
@.str.8 = [5 x i8] c"date\00"
@.str.9 = [10 x i8] c"time(EST)\00"
@.str.10 = [6 x i8] c"phase\00"
@.str.11 = [33 x i8] c"%5d %3d %5d %7d:%2d:%2d %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca i64
%15 = alloca i64
store i32 0, i32* %1
store i32 2, i32* %10
store float 0xBFCAAAAAA0000000, float* %11
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32* %7, i32* %6, i32* %8)
%19 = load i32, i32* %8
%20 = sub nsw i32 %19, 1900
%21 = sitofp i32 %20 to double
%22 = load i32, i32* %7
%23 = sitofp i32 %22 to double
%24 = fsub double %23, 5.000000e-01
%25 = fdiv double %24, 1.200000e+01
%26 = fadd double %21, %25
%27 = fmul double 1.237000e+01, %26
%28 = fptosi double %27 to i32
store i32 %28, i32* %9
%29 = load i32, i32* %7
%30 = load i32, i32* %6
%31 = load i32, i32* %8
%32 = call i64 @julday(i32 %29, i32 %30, i32 %31)
store i64 %32, i64* %14
%33 = load i32, i32* %9
%34 = load i32, i32* %10
%35 = call i32 @flmoon(i32 %33, i32 %34, i64* %15, float* %12)
%36 = load i64, i64* %14
%37 = load i64, i64* %15
%38 = sub nsw i64 %36, %37
%39 = sitofp i64 %38 to double
%40 = fdiv double %39, 2.953000e+01
%41 = load i64, i64* %14
%42 = load i64, i64* %15
%43 = icmp sge i64 %41, %42
%44 = zext i1 %43 to i64
%45 = select i1 %43, double 5.000000e-01, double -5.000000e-01
%46 = fadd double %40, %45
%47 = fptosi double %46 to i32
%48 = load i32, i32* %9
%49 = add nsw i32 %48, %47
store i32 %49, i32* %9
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
store i32 1, i32* %2
br label %51
51: ; preds = %134, %0
%52 = load i32, i32* %2
%53 = icmp sle i32 %52, 20
br i1 %53, label %54, label %137
54: ; preds = %51
%55 = load i32, i32* %9
%56 = load i32, i32* %10
%57 = call i32 @flmoon(i32 %55, i32 %56, i64* %15, float* %12)
%58 = load float, float* %12
%59 = load float, float* %11
%60 = fadd float %58, %59
%61 = fpext float %60 to double
%62 = fmul double 2.400000e+01, %61
%63 = fptrunc double %62 to float
store float %63, float* %12
%64 = load float, float* %12
%65 = fpext float %64 to double
%66 = fcmp olt double %65, 0.000000e+00
br i1 %66, label %67, label %74
67: ; preds = %54
%68 = load i64, i64* %15
%69 = add nsw i64 %68, -1
store i64 %69, i64* %15
%70 = load float, float* %12
%71 = fpext float %70 to double
%72 = fadd double %71, 2.400000e+01
%73 = fptrunc double %72 to float
store float %73, float* %12
br label %74
74: ; preds = %67, %54
%75 = load float, float* %12
%76 = fpext float %75 to double
%77 = fcmp ogt double %76, 1.200000e+01
br i1 %77, label %78, label %85
78: ; preds = %74
%79 = load i64, i64* %15
%80 = add nsw i64 %79, 1
store i64 %80, i64* %15
%81 = load float, float* %12
%82 = fpext float %81 to double
%83 = fsub double %82, 1.200000e+01
%84 = fptrunc double %83 to float
store float %84, float* %12
br label %90
85: ; preds = %74
%86 = load float, float* %12
%87 = fpext float %86 to double
%88 = fadd double %87, 1.200000e+01
%89 = fptrunc double %88 to float
store float %89, float* %12
br label %90
90: ; preds = %85, %78
%91 = load float, float* %12
%92 = fptosi float %91 to i32
store i32 %92, i32* %3
%93 = load float, float* %12
%94 = load i32, i32* %3
%95 = sitofp i32 %94 to float
%96 = fsub float %93, %95
%97 = fpext float %96 to double
%98 = fmul double 3.600000e+03, %97
%99 = fptrunc double %98 to float
store float %99, float* %13
%100 = load float, float* %13
%101 = fpext float %100 to double
%102 = fdiv double %101, 6.000000e+01
%103 = fptosi double %102 to i32
store i32 %103, i32* %4
%104 = load float, float* %13
%105 = load i32, i32* %4
%106 = mul nsw i32 60, %105
%107 = sitofp i32 %106 to float
%108 = fsub float %104, %107
%109 = fpext float %108 to double
%110 = fadd double %109, 5.000000e-01
%111 = fptosi double %110 to i32
store i32 %111, i32* %5
%112 = load i64, i64* %15
%113 = call i32 @caldat(i64 %112, i32* %7, i32* %6, i32* %8)
%114 = load i32, i32* %7
%115 = load i32, i32* %6
%116 = load i32, i32* %8
%117 = load i32, i32* %3
%118 = load i32, i32* %4
%119 = load i32, i32* %5
%120 = load i32, i32* %10
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds [4 x i8*], [4 x i8*]* @main.phase, i64 0, i64 %121
%123 = load i8*, i8** %122
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0), i32 %114, i32 %115, i32 %116, i32 %117, i32 %118, i32 %119, i8* %123)
%125 = load i32, i32* %10
%126 = icmp eq i32 %125, 3
br i1 %126, label %127, label %130
127: ; preds = %90
store i32 0, i32* %10
%128 = load i32, i32* %9
%129 = add nsw i32 %128, 1
store i32 %129, i32* %9
br label %133
130: ; preds = %90
%131 = load i32, i32* %10
%132 = add nsw i32 %131, 1
store i32 %132, i32* %10
br label %133
133: ; preds = %130, %127
br label %134
134: ; preds = %133
%135 = load i32, i32* %2
%136 = add nsw i32 %135, 1
store i32 %136, i32* %2
br label %51
137: ; preds = %51
ret i32 0
}

LLVM IR (-O2):
@reltable.main = internal unnamed_addr constant [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.1 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.2 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.3 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32)]
@.str = [9 x i8] c"new moon\00"
@.str.1 = [14 x i8] c"first quarter\00"
@.str.2 = [10 x i8] c"full moon\00"
@.str.3 = [13 x i8] c"last quarter\00"
@.str.6 = [9 x i8] c"%d %d %d\00"
@.str.7 = [16 x i8] c"\0A%10s %19s %9s\0A\00"
@.str.8 = [5 x i8] c"date\00"
@.str.9 = [10 x i8] c"time(EST)\00"
@.str.10 = [6 x i8] c"phase\00"
@.str.11 = [33 x i8] c"%5d %3d %5d %7d:%2d:%2d %s\0A\00"
@str = [40 x i8] c"Date of the next few phases of the moon\00"
@str.12 = [42 x i8] c"Enter today's date (e.g. 12 15 1992) : \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca i64
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast float* %4 to i8*
%10 = bitcast i64* %5 to i8*
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.12, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32* %2, i32* %1, i32* %3)
%14 = load i32, i32* %3
%15 = add nsw i32 %14, -1900
%16 = sitofp i32 %15 to double
%17 = load i32, i32* %2
%18 = sitofp i32 %17 to double
%19 = fadd double %18, -5.000000e-01
%20 = fdiv double %19, 1.200000e+01
%21 = fadd double %20, %16
%22 = fmul double %21, 1.237000e+01
%23 = fptosi double %22 to i32
%24 = load i32, i32* %1
%25 = call i64 @julday(i32 %17, i32 %24, i32 %14)
%26 = call i32 @flmoon(i32 %23, i32 2, i64* %5, float* %4)
%27 = load i64, i64* %5
%28 = sub nsw i64 %25, %27
%29 = sitofp i64 %28 to double
%30 = fdiv double %29, 2.953000e+01
%31 = icmp slt i64 %25, %27
%32 = select i1 %31, double -5.000000e-01, double 5.000000e-01
%33 = fadd double %32, %30
%34 = fptosi double %33 to i32
%35 = add nsw i32 %34, %23
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
br label %37
37: ; preds = %0, %60
%38 = phi i32 [ 1, %0 ], [ %89, %60 ]
%39 = phi i32 [ %35, %0 ], [ %88, %60 ]
%40 = phi i32 [ 2, %0 ], [ %86, %60 ]
%41 = call i32 @flmoon(i32 %39, i32 %40, i64* %5, float* %4)
%42 = load float, float* %4
%43 = fadd float %42, 0xBFCAAAAAA0000000
%44 = fmul float %43, 2.400000e+01
%45 = fcmp olt float %44, 0.000000e+00
br i1 %45, label %46, label %50
46: ; preds = %37
%47 = load i64, i64* %5
%48 = add nsw i64 %47, -1
store i64 %48, i64* %5
%49 = fadd float %44, 2.400000e+01
br label %50
50: ; preds = %46, %37
%51 = phi float [ %49, %46 ], [ %44, %37 ]
%52 = fcmp ogt float %51, 1.200000e+01
br i1 %52, label %53, label %57
53: ; preds = %50
%54 = load i64, i64* %5
%55 = add nsw i64 %54, 1
store i64 %55, i64* %5
%56 = fadd float %51, -1.200000e+01
br label %60
57: ; preds = %50
%58 = fadd float %51, 1.200000e+01
%59 = load i64, i64* %5
br label %60
60: ; preds = %57, %53
%61 = phi i64 [ %59, %57 ], [ %55, %53 ]
%62 = phi float [ %58, %57 ], [ %56, %53 ]
store float %62, float* %4
%63 = fptosi float %62 to i32
%64 = sitofp i32 %63 to float
%65 = fsub float %62, %64
%66 = fmul float %65, 3.600000e+03
%67 = fpext float %66 to double
%68 = fdiv double %67, 6.000000e+01
%69 = fptosi double %68 to i32
%70 = mul nsw i32 %69, 60
%71 = sitofp i32 %70 to float
%72 = fsub float %66, %71
%73 = fpext float %72 to double
%74 = fadd double %73, 5.000000e-01
%75 = fptosi double %74 to i32
%76 = call i32 @caldat(i64 %61, i32* %2, i32* %1, i32* %3)
%77 = load i32, i32* %2
%78 = load i32, i32* %1
%79 = load i32, i32* %3
%80 = zext i32 %40 to i64
%81 = shl i64 %80, 2
%82 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.main to i8*), i64 %81)
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0), i32 %77, i32 %78, i32 %79, i32 %63, i32 %69, i32 %75, i8* %82)
%84 = icmp eq i32 %40, 3
%85 = add nsw i32 %40, 1
%86 = select i1 %84, i32 0, i32 %85
%87 = zext i1 %84 to i32
%88 = add nsw i32 %39, %87
%89 = add nuw nsw i32 %38, 1
%90 = icmp eq i32 %89, 21
br i1 %90, label %91, label %37
91: ; preds = %60
ret i32 0
}