// File: /workspace/github_c_makefile_star2_O2/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 0x18bf9(%rip), %rax     # 0x2c368
cmpl $0x0, (%rax)
je 0x13997
movl %esi, %ebx
movl %edi, %ebp
leaq 0xde17(%rip), %rdi      # 0x2159a
xorl %eax, %eax
callq 0x5130
leaq 0x14e2f(%rip), %rdi     # 0x285c0
callq 0x50c0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x137a2
jnp 0x137b7
leaq 0xde14(%rip), %rdi      # 0x215bd
leaq 0x14e10(%rip), %rsi     # 0x285c0
xorl %eax, %eax
callq 0x5130
leaq 0xaf9d(%rip), %rdi      # 0x1e75b
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x5130
movslq %ebp, %rax
leaq 0x149de(%rip), %rcx     # 0x281b0
movsbq -0x1(%rax,%rcx), %rcx
xorl $0x2, %eax
movl %ebx, %edx
andl $0x3, %edx
orl %eax, %edx
jne 0x137f6
pushq $0x64
popq %rsi
movl %ebx, %eax
cltd
idivl %esi
testl %edx, %edx
je 0x137fb
pushq $0x1
popq %r12
jmp 0x1380e
xorl %r12d, %r12d
jmp 0x1380e
movl $0x190, %esi            # imm = 0x190
movl %ebx, %eax
cltd
idivl %esi
xorl %r12d, %r12d
testl %edx, %edx
sete %r12b
addq %rcx, %r12
pushq $0x1
popq %r14
xorl %r13d, %r13d
cmpq %r12, %r14
jg 0x1393d
movl %ebp, %edi
movl %r14d, %esi
movl %ebx, %edx
leaq 0xc(%rsp), %rcx
callq 0x93ed
leaq 0x18e93(%rip), %rax     # 0x2c6cc
testb $0x4, (%rax)
jne 0x138e7
leaq 0x18b1f(%rip), %rax     # 0x2c368
movl (%rax), %eax
movl 0xc(%rsp), %ecx
cmpl $-0x1, %ecx
setne %dl
cmpl $0x1, %eax
sete %sil
orb %dl, %sil
cmpb $0x1, %sil
jne 0x138da
cvtsi2sd %ecx, %xmm1
mulsd 0x9b27(%rip), %xmm1     # 0x1d398
cmpl $-0x1, %ecx
jne 0x1387a
movapd %xmm0, %xmm1
cmpl $0x2, %eax
je 0x13883
movapd %xmm0, %xmm1
incl %r15d
movl %r15d, %eax
cltd
pushq $0xa
popq %rcx
idivl %ecx
leaq 0xaec5(%rip), %rsi      # 0x1e75b
testl %edx, %edx
je 0x138a1
leaq 0xf6cc(%rip), %rsi      # 0x22f6d
movsd 0xa68f(%rip), %xmm0     # 0x1df38
cmplesd %xmm1, %xmm0
andnpd %xmm1, %xmm0
leaq 0xdd3e(%rip), %rdi      # 0x215f7
movb $0x1, %al
callq 0x5130
leal -0x1(%r14), %ecx
pushq $0x1
popq %rdx
shlq %cl, %rdx
cmpl $-0x1, 0xc(%rsp)
movl $0x0, %eax
cmovneq %rdx, %rax
jmp 0x138dc
xorl %eax, %eax
orq %rax, %r13
incq %r14
jmp 0x13818
movslq 0xc(%rsp), %rax
leaq 0xae6a(%rip), %r9       # 0x1e75d
cmpq $-0x1, %rax
je 0x13907
leaq 0xa6fc(%rip), %rcx      # 0x1dffc
movslq (%rcx,%rax,4), %r9
addq %rcx, %r9
movq 0x146ea(%rip), %rax     # 0x27ff8
movq (%rax), %rdi
leaq 0xdcb8(%rip), %rsi      # 0x215d0
movl %ebx, %edx
movl %ebp, %ecx
movl %r14d, %r8d
movsd %xmm0, 0x10(%rsp)
movsd 0x10(%rsp), %xmm0
movb $0x1, %al
callq 0x5200
movsd 0x10(%rsp), %xmm0
jmp 0x13842
leaq 0xe0da(%rip), %rdi      # 0x21a1e
callq 0x50b0
leaq 0x18a18(%rip), %rax     # 0x2c368
cmpl $0x2, (%rax)
jne 0x13997
leaq 0xdca2(%rip), %rdi      # 0x215fe
xorl %eax, %eax
callq 0x5130
pushq $0x1
popq %rbx
leaq 0xdca3(%rip), %r14      # 0x21610
testq %r13, %r13
je 0x1398b
testb $0x1, %r13b
je 0x13984
movq %r14, %rdi
movl %ebx, %esi
xorl %eax, %eax
callq 0x5130
incl %ebx
shrq %r13
jmp 0x1396d
leaq 0xe08c(%rip), %rdi      # 0x21a1e
callq 0x50b0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq