// File: /workspace/github_c_makefile_star2_O3/mmayer[P]pcal/src/writefil.c
// Function: print_moon_info
void print_moon_info (int month, int year)
{
   int n, ndays, day, quarter;
   unsigned long qdays;
   double phase;
   static char *q[4] = {"NM", "1Q", "FM", "3Q"};
   
   if (draw_moons == NO_MOONS) return;

   /* print the phase of the moon for each day of the month */
   
   printf("/moon_phases [\t\t%% from algorithm ");
   if (atof(time_zone) != 0.0) printf(" (UTC offset = %s)", time_zone);
   printf("\n\t");
   
   for (n = 0, qdays = 0L, day = 1, ndays = LENGTH_OF(month, year);
        day <= ndays;
        day++) {

      phase = find_phase(month, day, year, &quarter);

      if (DEBUG(DEBUG_MOON)) {
         fprintf(stderr, "Moon phase on %04d-%02d-%02d: %.5f %s\n", year, month, day, phase, 
                 quarter != MOON_OTHER ? q[quarter] : "");
      }

      /* adjust phase to exact quarter if printing only quarters */
      if (draw_moons == SOME_MOONS && quarter != MOON_OTHER) phase = 0.25 * quarter;
      if (draw_moons == ALL_MOONS || quarter != MOON_OTHER) {
         printf("%.3f%s", PRT_TWEAK(phase), ++n % 10 == 0 ? "\n\t" : " ");
      }

      if (quarter != MOON_OTHER) qdays |= 1L << (day - 1);
   }
   printf("] def\n");
   
   /* if drawing only quarter moons, print days when they occur */
   
   if (draw_moons == SOME_MOONS) {
      printf("/quarter_moons [ ");
      for (day = 1; qdays; day++, qdays >>= 1) {
         if (qdays & 01) printf("%d ", day);
      }
      printf("] def\n");
   }
   
   return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x183cb(%rip), %rax     # 0x2d378
cmpl $0x0, (%rax)
je 0x15206
movl %esi, %ebx
movl %edi, %ebp
leaq 0xe629(%rip), %rdi      # 0x235ea
xorl %r13d, %r13d
xorl %eax, %eax
callq 0x5130
leaq 0x145fe(%rip), %rdi     # 0x295d0
callq 0x50c0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x14fe3
jnp 0x14ff8
leaq 0xe623(%rip), %rdi      # 0x2360d
leaq 0x145df(%rip), %rsi     # 0x295d0
xorl %eax, %eax
callq 0x5130
leaq 0xb7ac(%rip), %rdi      # 0x207ab
xorl %eax, %eax
callq 0x5130
movslq %ebp, %rcx
leaq 0x141b0(%rip), %rax     # 0x291c0
movsbl -0x1(%rcx,%rax), %eax
xorl $0x2, %ecx
movl %ebx, %edx
andl $0x3, %edx
orl %ecx, %edx
jne 0x15050
imull $0xc28f5c29, %ebx, %ecx # imm = 0xC28F5C29
addl $0x51eb850, %ecx        # imm = 0x51EB850
movl %ecx, %edx
rorl $0x2, %edx
movl $0x1, %r13d
cmpl $0x28f5c28, %edx        # imm = 0x28F5C28
ja 0x15050
rorl $0x4, %ecx
xorl %r13d, %r13d
cmpl $0xa3d70b, %ecx         # imm = 0xA3D70B
setb %r13b
xorl %r12d, %r12d
addl %eax, %r13d
jle 0x1519d
incl %r13d
movl $0x1, %r15d
xorl %r14d, %r14d
movl %ebp, %edi
movl %r15d, %esi
movl %ebx, %edx
leaq 0xc(%rsp), %rcx
callq 0xa099
leaq 0x1865c(%rip), %rax     # 0x2d6dc
testb $0x4, (%rax)
jne 0x15147
leaq 0x182e8(%rip), %rax     # 0x2d378
movl (%rax), %eax
movl 0xc(%rsp), %ecx
cmpl $-0x1, %ecx
setne %dl
cmpl $0x1, %eax
sete %sil
orb %dl, %sil
cmpb $0x1, %sil
jne 0x15134
xorps %xmm1, %xmm1
cvtsi2sd %ecx, %xmm1
mulsd 0xa331(%rip), %xmm1     # 0x1f3f0
cmpl $-0x1, %ecx
jne 0x150c8
movapd %xmm0, %xmm1
cmpl $0x2, %eax
je 0x150d1
movapd %xmm0, %xmm1
movsd 0xaeaf(%rip), %xmm0     # 0x1ff88
cmplesd %xmm1, %xmm0
andnpd %xmm1, %xmm0
imull $0xcccccccd, %r12d, %eax # imm = 0xCCCCCCCD
incl %r12d
addl $0xe6666665, %eax       # imm = 0xE6666665
rorl %eax
cmpl $0x19999999, %eax       # imm = 0x19999999
leaq 0xfebe(%rip), %rsi      # 0x24fbd
leaq 0xb6a5(%rip), %rax      # 0x207ab
cmovbq %rax, %rsi
leaq 0xe536(%rip), %rdi      # 0x23647
movb $0x1, %al
callq 0x5130
leal -0x1(%r15), %ecx
movl $0x1, %edx
shlq %cl, %rdx
cmpl $-0x1, 0xc(%rsp)
movl $0x0, %eax
cmovneq %rdx, %rax
jmp 0x15136
xorl %eax, %eax
orq %rax, %r14
incq %r15
cmpq %r15, %r13
jne 0x15068
jmp 0x151a0
movslq 0xc(%rsp), %rax
leaq 0xb65a(%rip), %r9       # 0x207ad
cmpq $-0x1, %rax
je 0x15167
leaq 0xaeec(%rip), %rcx      # 0x2004c
movslq (%rcx,%rax,4), %r9
addq %rcx, %r9
movq 0x13e82(%rip), %rax     # 0x28ff0
movq (%rax), %rdi
leaq 0xe4a8(%rip), %rsi      # 0x23620
movl %ebx, %edx
movl %ebp, %ecx
movl %r15d, %r8d
movsd %xmm0, 0x10(%rsp)
movsd 0x10(%rsp), %xmm0
movb $0x1, %al
callq 0x5210
movsd 0x10(%rsp), %xmm0
jmp 0x15089
xorl %r14d, %r14d
leaq 0xe8c7(%rip), %rdi      # 0x23a6e
callq 0x50b0
leaq 0x181c5(%rip), %rax     # 0x2d378
cmpl $0x2, (%rax)
jne 0x15206
leaq 0xe48f(%rip), %rdi      # 0x2364e
xorl %eax, %eax
callq 0x5130
testq %r14, %r14
je 0x151fa
movl $0x1, %ebx
leaq 0xe489(%rip), %r15      # 0x23660
testb $0x1, %r14b
je 0x151e9
movq %r15, %rdi
movl %ebx, %esi
xorl %eax, %eax
callq 0x5130
incl %ebx
movq %r14, %rax
shrq %rax
cmpq $0x1, %r14
movq %rax, %r14
ja 0x151d7
leaq 0xe86d(%rip), %rdi      # 0x23a6e
callq 0x50b0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq