#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 */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ grcal_offsetToDate(int, int *, int *, int *);
int /*<<< orphan*/ grcal_printDate(int /*<<< orphan*/, int, int, int);
scalar_t__ nelsc_cycle_isLongMonth(int);
int nelsc_cycle_monthToDay(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void fullMoons(int32_t mfirst, int32_t mlast) {
  int32_t m = 0;
  int32_t lyear = -1;
  int32_t m_begin = 0;
  int32_t fmw_begin = 0;
  int32_t fmw_end = 0;
  int32_t b_year = 0;
  int32_t b_month = 0;
  int32_t b_day = 0;
  int32_t e_year = 0;
  int32_t e_month = 0;
  int32_t e_day = 0;
  if ((mfirst < (-1197)) || (mfirst > (5926)) || (mlast < (-1197)) ||
      (mlast > (5926)) || (mfirst > mlast)) {
    abort();
  }
  for (m = mfirst; m <= mlast; m++) {
    m_begin = nelsc_cycle_monthToDay(m);
    if (nelsc_cycle_isLongMonth(m)) {
      fmw_begin = m_begin + 21;
      fmw_end = m_begin + 27;
    } else {
      fmw_begin = m_begin + 14;
      fmw_end = m_begin + 20;
    }
    fmw_begin += (264773);
    fmw_end += (264773);
    grcal_offsetToDate(fmw_begin, &b_year, &b_month, &b_day);
    grcal_offsetToDate(fmw_end, &e_year, &e_month, &e_day);
    if ((lyear != -1) && (lyear != b_year)) {
      printf("\n");
    }
    lyear = b_year;
    grcal_printDate(stdout, b_year, b_month, b_day);
    printf(" - ");
    grcal_printDate(stdout, e_year, e_month, e_day);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<fullMoons>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0xfffffb53,-0x4(%rbp)
jl     11fb <fullMoons+0x9b>
cmpl   $0x1726,-0x4(%rbp)
jg     11fb <fullMoons+0x9b>
cmpl   $0xfffffb53,-0x8(%rbp)
jl     11fb <fullMoons+0x9b>
cmpl   $0x1726,-0x8(%rbp)
jg     11fb <fullMoons+0x9b>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1202 <fullMoons+0xa2>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1314 <fullMoons+0x1b4>
mov    -0xc(%rbp),%edi
call   1070 <nelsc_cycle_monthToDay@plt>
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
call   1080 <nelsc_cycle_isLongMonth@plt>
cmp    $0x0,%rax
je     1248 <fullMoons+0xe8>
mov    -0x14(%rbp),%eax
add    $0x15,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1b,%eax
mov    %eax,-0x1c(%rbp)
jmp    125a <fullMoons+0xfa>
mov    -0x14(%rbp),%eax
add    $0xe,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x40a45,%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x40a45,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
lea    -0x20(%rbp),%rsi
lea    -0x24(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1040 <grcal_offsetToDate@plt>
mov    -0x1c(%rbp),%edi
lea    -0x2c(%rbp),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x34(%rbp),%rcx
call   1040 <grcal_offsetToDate@plt>
cmpl   $0xffffffff,-0x10(%rbp)
je     12ba <fullMoons+0x15a>
mov    -0x10(%rbp),%eax
cmp    -0x20(%rbp),%eax
je     12ba <fullMoons+0x15a>
lea    0xd4b(%rip),%rdi
call   1060 <printf@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2d19(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
call   1050 <grcal_printDate@plt>
lea    0xd24(%rip),%rdi
call   1060 <printf@plt>
mov    0x2cf6(%rip),%rax
mov    (%rax),%edi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x34(%rbp),%ecx
call   1050 <grcal_printDate@plt>
lea    0xcff(%rip),%rdi
call   1060 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1208 <fullMoons+0xa8>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fullMoons>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x0,(%rsp)
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
cmp    %esi,%edi
jg     12d7 <fullMoons+0x167>
mov    %edi,%ebx
lea    -0x1727(%rbx),%eax
cmp    $0xffffe42c,%eax
jb     12d7 <fullMoons+0x167>
mov    %esi,%r14d
lea    -0x1727(%r14),%eax
cmp    $0xffffe42c,%eax
jb     12d7 <fullMoons+0x167>
add    $0x1,%r14d
mov    $0xffffffff,%r12d
mov    0x2df2(%rip),%r15
lea    0xe0b(%rip),%r13
jmp    1247 <fullMoons+0xd7>
nopw   0x0(%rax,%rax,1)
mov    (%r15),%edi
mov    0x14(%rsp),%edx
mov    0x10(%rsp),%ecx
mov    %ebp,%esi
call   1060 <grcal_printDate@plt>
mov    %r13,%rdi
call   1070 <printf@plt>
mov    (%r15),%edi
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0x4(%rsp),%ecx
call   1060 <grcal_printDate@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    %ebp,%r12d
cmp    %ebx,%r14d
je     12c8 <fullMoons+0x158>
mov    %ebx,%edi
call   1080 <nelsc_cycle_monthToDay@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1090 <nelsc_cycle_isLongMonth@plt>
lea    0x15(%rbp),%ecx
lea    0xe(%rbp),%edi
lea    0x40a60(%rbp),%edx
add    $0x40a59,%ebp
test   %rax,%rax
cmovne %ecx,%edi
cmovne %edx,%ebp
add    $0x40a45,%edi
mov    %rsp,%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1050 <grcal_offsetToDate@plt>
mov    %ebp,%edi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
call   1050 <grcal_offsetToDate@plt>
mov    (%rsp),%ebp
cmp    $0xffffffff,%r12d
je     1200 <fullMoons+0x90>
cmp    %ebp,%r12d
je     1200 <fullMoons+0x90>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%rsp),%ebp
jmp    1200 <fullMoons+0x90>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@stdout = global i32 0
@.str.1 = [4 x i8] c" - \00"
define void @fullMoons(i32 %0, i32 %1) {
%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 i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 -1, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
store i32 0, i32* %13
store i32 0, i32* %14
store i32 0, i32* %15
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, -1197
br i1 %17, label %31, label %18
18: ; preds = %2
%19 = load i32, i32* %3
%20 = icmp sgt i32 %19, 5926
br i1 %20, label %31, label %21
21: ; preds = %18
%22 = load i32, i32* %4
%23 = icmp slt i32 %22, -1197
br i1 %23, label %31, label %24
24: ; preds = %21
%25 = load i32, i32* %4
%26 = icmp sgt i32 %25, 5926
br i1 %26, label %31, label %27
27: ; preds = %24
%28 = load i32, i32* %3
%29 = load i32, i32* %4
%30 = icmp sgt i32 %28, %29
br i1 %30, label %31, label %33
31: ; preds = %27, %24, %21, %18, %2
%32 = call i32 (...) @abort()
unreachable
33: ; preds = %27
%34 = load i32, i32* %3
store i32 %34, i32* %5
br label %35
35: ; preds = %86, %33
%36 = load i32, i32* %5
%37 = load i32, i32* %4
%38 = icmp sle i32 %36, %37
br i1 %38, label %39, label %89
39: ; preds = %35
%40 = load i32, i32* %5
%41 = call i32 @nelsc_cycle_monthToDay(i32 %40)
store i32 %41, i32* %7
%42 = load i32, i32* %5
%43 = call i64 @nelsc_cycle_isLongMonth(i32 %42)
%44 = icmp ne i64 %43, 0
br i1 %44, label %45, label %50
45: ; preds = %39
%46 = load i32, i32* %7
%47 = add nsw i32 %46, 21
store i32 %47, i32* %8
%48 = load i32, i32* %7
%49 = add nsw i32 %48, 27
store i32 %49, i32* %9
br label %55
50: ; preds = %39
%51 = load i32, i32* %7
%52 = add nsw i32 %51, 14
store i32 %52, i32* %8
%53 = load i32, i32* %7
%54 = add nsw i32 %53, 20
store i32 %54, i32* %9
br label %55
55: ; preds = %50, %45
%56 = load i32, i32* %8
%57 = add nsw i32 %56, 264773
store i32 %57, i32* %8
%58 = load i32, i32* %9
%59 = add nsw i32 %58, 264773
store i32 %59, i32* %9
%60 = load i32, i32* %8
%61 = call i32 @grcal_offsetToDate(i32 %60, i32* %10, i32* %11, i32* %12)
%62 = load i32, i32* %9
%63 = call i32 @grcal_offsetToDate(i32 %62, i32* %13, i32* %14, i32* %15)
%64 = load i32, i32* %6
%65 = icmp ne i32 %64, -1
br i1 %65, label %66, label %72
66: ; preds = %55
%67 = load i32, i32* %6
%68 = load i32, i32* %10
%69 = icmp ne i32 %67, %68
br i1 %69, label %70, label %72
70: ; preds = %66
%71 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %72
72: ; preds = %70, %66, %55
%73 = load i32, i32* %10
store i32 %73, i32* %6
%74 = load i32, i32* @stdout
%75 = load i32, i32* %10
%76 = load i32, i32* %11
%77 = load i32, i32* %12
%78 = call i32 @grcal_printDate(i32 %74, i32 %75, i32 %76, i32 %77)
%79 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%80 = load i32, i32* @stdout
%81 = load i32, i32* %13
%82 = load i32, i32* %14
%83 = load i32, i32* %15
%84 = call i32 @grcal_printDate(i32 %80, i32 %81, i32 %82, i32 %83)
%85 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %86
86: ; preds = %72
%87 = load i32, i32* %5
%88 = add nsw i32 %87, 1
store i32 %88, i32* %5
br label %35
89: ; preds = %35
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str.1 = [4 x i8] c" - \00"
define void @fullMoons(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%10 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%11 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%12 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%13 = bitcast i32* %7 to i8*
store i32 0, i32* %7
%14 = bitcast i32* %8 to i8*
store i32 0, i32* %8
%15 = add i32 %0, -5927
%16 = icmp ult i32 %15, -7124
%17 = add i32 %1, -5927
%18 = icmp ult i32 %17, -7124
%19 = or i1 %16, %18
%20 = icmp sgt i32 %0, %1
%21 = or i1 %20, %19
br i1 %21, label %22, label %24
22: ; preds = %2
%23 = tail call i32 (...) @abort()
unreachable
24: ; preds = %2, %44
%25 = phi i32 [ %45, %44 ], [ -1, %2 ]
%26 = phi i32 [ %57, %44 ], [ %0, %2 ]
%27 = call i32 @nelsc_cycle_monthToDay(i32 %26)
%28 = call i64 @nelsc_cycle_isLongMonth(i32 %26)
%29 = icmp eq i64 %28, 0
%30 = select i1 %29, i32 14, i32 21
%31 = select i1 %29, i32 20, i32 27
%32 = add i32 %27, 264773
%33 = add i32 %32, %30
%34 = add i32 %32, %31
%35 = call i32 @grcal_offsetToDate(i32 %33, i32* %3, i32* %4, i32* %5)
%36 = call i32 @grcal_offsetToDate(i32 %34, i32* %6, i32* %7, i32* %8)
%37 = icmp eq i32 %25, -1
%38 = load i32, i32* %3
%39 = icmp eq i32 %25, %38
%40 = select i1 %37, i1 true, i1 %39
br i1 %40, label %44, label %41
41: ; preds = %24
%42 = call i32 @putchar(i32 10)
%43 = load i32, i32* %3
br label %44
44: ; preds = %41, %24
%45 = phi i32 [ %43, %41 ], [ %38, %24 ]
%46 = load i32, i32* @stdout
%47 = load i32, i32* %4
%48 = load i32, i32* %5
%49 = call i32 @grcal_printDate(i32 %46, i32 %45, i32 %47, i32 %48)
%50 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%51 = load i32, i32* @stdout
%52 = load i32, i32* %6
%53 = load i32, i32* %7
%54 = load i32, i32* %8
%55 = call i32 @grcal_printDate(i32 %51, i32 %52, i32 %53, i32 %54)
%56 = call i32 @putchar(i32 10)
%57 = add i32 %26, 1
%58 = icmp eq i32 %26, %1
br i1 %58, label %59, label %24
59: ; preds = %44
ret void
}