// File: /workspace/github_c_makefile_star2_O1/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 0x1788b(%rip), %rax     # 0x2c378
cmpl $0x0, (%rax)
je 0x14d44
movl %esi, %ebx
movl %edi, %ebp
leaq 0xda79(%rip), %rdi      # 0x2257a
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x5130
leaq 0x13abe(%rip), %rdi     # 0x285d0
callq 0x50c0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x14b23
jnp 0x14b38
leaq 0xda73(%rip), %rdi      # 0x2259d
leaq 0x13a9f(%rip), %rsi     # 0x285d0
xorl %eax, %eax
callq 0x5130
leaq 0xabfc(%rip), %rdi      # 0x1f73b
xorl %eax, %eax
callq 0x5130
movslq %ebp, %rcx
leaq 0x13670(%rip), %rax     # 0x281c0
movsbl -0x1(%rcx,%rax), %eax
xorl $0x2, %ecx
movl %ebx, %edx
andl $0x3, %edx
orl %ecx, %edx
jne 0x14b90
imull $0xc28f5c29, %ebx, %ecx # imm = 0xC28F5C29
addl $0x51eb850, %ecx        # imm = 0x51EB850
movl %ecx, %edx
rorl $0x2, %edx
movl $0x1, %r15d
cmpl $0x28f5c28, %edx        # imm = 0x28F5C28
ja 0x14b90
rorl $0x4, %ecx
xorl %r15d, %r15d
cmpl $0xa3d70b, %ecx         # imm = 0xA3D70B
setb %r15b
xorl %r14d, %r14d
movl %r15d, %ecx
addl %eax, %ecx
jle 0x14cdb
leal (%r15,%rax), %r12d
incl %r12d
movl $0x1, %r15d
xorl %r13d, %r13d
movl %ebp, %edi
movl %r15d, %esi
movl %ebx, %edx
leaq 0xc(%rsp), %rcx
callq 0x9ac1
leaq 0x17b16(%rip), %rax     # 0x2c6dc
testb $0x4, (%rax)
jne 0x14c85
leaq 0x177a2(%rip), %rax     # 0x2c378
movl (%rax), %eax
movl 0xc(%rsp), %ecx
cmpl $-0x1, %ecx
setne %dl
cmpl $0x1, %eax
sete %sil
orb %dl, %sil
cmpb $0x1, %sil
jne 0x14c5a
xorps %xmm1, %xmm1
cvtsi2sd %ecx, %xmm1
mulsd 0x9797(%rip), %xmm1     # 0x1e398
cmpl $-0x1, %ecx
jne 0x14c0a
movapd %xmm0, %xmm1
cmpl $0x2, %eax
je 0x14c13
movapd %xmm0, %xmm1
movsd 0xa2fd(%rip), %xmm0     # 0x1ef18
cmplesd %xmm1, %xmm0
andnpd %xmm1, %xmm0
imull $0xcccccccd, %r14d, %eax # imm = 0xCCCCCCCD
incl %r14d
addl $0xe6666665, %eax       # imm = 0xE6666665
rorl %eax
cmpl $0x19999999, %eax       # imm = 0x19999999
leaq 0xf30c(%rip), %rsi      # 0x23f4d
leaq 0xaaf3(%rip), %rax      # 0x1f73b
cmovbq %rax, %rsi
leaq 0xd984(%rip), %rdi      # 0x225d7
movb $0x1, %al
callq 0x5130
leal -0x1(%r15), %ecx
movl $0x1, %eax
shlq %cl, %rax
cmpl $-0x1, 0xc(%rsp)
movl $0x0, %ecx
cmovneq %rax, %rcx
orq %rcx, %r13
incq %r15
cmpq %r12, %r15
jne 0x14bae
jmp 0x14cde
movslq 0xc(%rsp), %rax
leaq 0xaaac(%rip), %r9       # 0x1f73d
cmpq $-0x1, %rax
je 0x14ca5
leaq 0xa33e(%rip), %rcx      # 0x1efdc
movslq (%rcx,%rax,4), %r9
addq %rcx, %r9
movq 0x13344(%rip), %rax     # 0x27ff0
movq (%rax), %rdi
leaq 0xd8fa(%rip), %rsi      # 0x225b0
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 0x14bcf
xorl %r13d, %r13d
leaq 0xdd19(%rip), %rdi      # 0x229fe
callq 0x50b0
leaq 0x17687(%rip), %rax     # 0x2c378
cmpl $0x2, (%rax)
jne 0x14d44
leaq 0xd8e1(%rip), %rdi      # 0x225de
xorl %eax, %eax
callq 0x5130
testq %r13, %r13
je 0x14d38
movl $0x1, %ebx
leaq 0xd8db(%rip), %r14      # 0x225f0
testb $0x1, %r13b
je 0x14d27
movq %r14, %rdi
movl %ebx, %esi
xorl %eax, %eax
callq 0x5130
incl %ebx
movq %r13, %rax
shrq %rax
cmpq $0x1, %r13
movq %rax, %r13
ja 0x14d15
leaq 0xdcbf(%rip), %rdi      # 0x229fe
callq 0x50b0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq