// File: /workspace/github_c_makefile_star2_O1/mmayer[P]pcal/src/writefil.c
// Function: find_daytext
void find_daytext (int month, int year, int is_holiday)
{
   register int day;
   year_info *py;
   month_info *pm;
   register day_info *pd;
   int first;
   char *fcn = is_holiday ? "holidaytext" : "daytext";
   char hol = is_holiday ? '*' : ' ';
   
   /* if no text for this year and month, return */
   
   if ((py = find_year(year, FALSE)) == NULL || (pm = py->month[month-1]) == NULL) {
      return;
   }
   
   /* walk array of day text pointers and linked lists of text */

   for (day = 1; day <= LAST_NOTE_DAY; day++) {
      for (pd = pm->day[day-1], first = TRUE;
           pd;
           pd = pd->next) {
         if (pd->is_holiday != is_holiday) continue;
         /* Skip lines specifying an EPS image... */
         if (ci_strncmp(pd->text, "image:", 6) == 0) continue;
         if (first) {
            printf("%d [ \n", day >= FIRST_NOTE_DAY ?
                   note_box(month, day, year) : day);
         }
         else {
            printf("\n");
            print_word(LINE_SEP);   /* separate lines */
            printf("\n");
         }
         this_day = day >= FIRST_NOTE_DAY ? 1 : day;
         RESET_DATE();   /* reset working date */
         if (debug_text) {
            if (day < FIRST_NOTE_DAY) {
               fprintf(stderr, "%02d/%02d/%d%c ", month, day, year, hol);
            }
            else {
               fprintf(stderr, "%02d[%02d]%d  ", month, day - FIRST_NOTE_DAY + 1, year);
            }
         }
         print_pstext(pd->text);
         if (debug_text) fprintf(stderr, "\n");
         first = FALSE;
      }
      if (! first) {   /* wrap up call (if one made) */
         printf("\n] %s\n", day >= FIRST_NOTE_DAY ? "notetext" : fcn);
      }
   }

   return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebx
movl %edi, 0x8(%rsp)
testl %edx, %edx
leaq 0xdf72(%rip), %rax      # 0x224f1
leaq 0xdf67(%rip), %rcx      # 0x224ed
cmoveq %rax, %rcx
movq %rcx, 0x18(%rsp)
movl %esi, 0xc(%rsp)
movl %esi, %edi
xorl %esi, %esi
callq 0xc3f7
testq %rax, %rax
je 0x14764
movslq 0x8(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0x14764
testl %ebx, %ebx
movl $0x20, %eax
movl $0x2a, %ecx
cmovel %eax, %ecx
movl %ecx, 0x10(%rsp)
movl $0x1, %r12d
leaq 0xdd21(%rip), %r13      # 0x222fd
movq 0x20(%rsp), %rax
movq (%rax,%r12,8), %r14
testq %r14, %r14
je 0x14757
cmpq $0x20, %r12
movl $0x1, %r15d
movl %r12d, %ebp
cmovael %r15d, %ebp
leal -0x1f(%r12), %eax
movl %eax, 0x14(%rsp)
cmpl %ebx, (%r14)
jne 0x146d0
movq 0x8(%r14), %rdi
movq %r13, %rsi
movl $0x6, %edx
callq 0x9d60
testl %eax, %eax
je 0x146d0
testl %r15d, %r15d
je 0x1465a
movl %r12d, %esi
cmpq $0x20, %r12
jb 0x1464a
movl 0x8(%rsp), %edi
movl %r12d, %esi
movl 0xc(%rsp), %edx
callq 0xa843
movl %eax, %esi
leaq 0xdea8(%rip), %rdi      # 0x224f9
xorl %eax, %eax
callq 0x5130
jmp 0x1467a
movl $0xa, %edi
callq 0x5060
leaq 0xb0fc(%rip), %rdi      # 0x1f767
callq 0x11a09
movl $0xa, %edi
callq 0x5060
movl %ebp, 0x1a968(%rip)     # 0x2efe8
movl 0x1a93e(%rip), %eax     # 0x2efc4
movl %eax, 0x1a960(%rip)     # 0x2efec
movl %ebp, 0x1a95e(%rip)     # 0x2eff0
movl 0x1a930(%rip), %eax     # 0x2efc8
movl %eax, 0x1a956(%rip)     # 0x2eff4
cmpl $0x0, 0x1a91b(%rip)     # 0x2efc0
jne 0x146df
movq 0x8(%r14), %rdi
callq 0x1433c
xorl %r15d, %r15d
cmpl $0x0, 0x1a906(%rip)     # 0x2efc0
je 0x146d0
movq 0x1392d(%rip), %rax     # 0x27ff0
movq (%rax), %rsi
movl $0xa, %edi
callq 0x51c0
movq 0x10(%r14), %r14
testq %r14, %r14
jne 0x14608
jmp 0x14730
movq 0x1390a(%rip), %rax     # 0x27ff0
movq (%rax), %rdi
cmpq $0x1f, %r12
ja 0x14710
leaq 0xde0a(%rip), %rsi      # 0x22500
movl 0x8(%rsp), %edx
movl %r12d, %ecx
movl 0xc(%rsp), %r8d
movl 0x10(%rsp), %r9d
xorl %eax, %eax
callq 0x5210
jmp 0x146a7
leaq 0xddf9(%rip), %rsi      # 0x22510
movl 0x8(%rsp), %edx
movl 0x14(%rsp), %ecx
movl 0xc(%rsp), %r8d
xorl %eax, %eax
callq 0x5210
jmp 0x146a7
testl %r15d, %r15d
jne 0x14757
cmpq $0x20, %r12
movq 0x18(%rsp), %rsi
leaq 0xdde1(%rip), %rax      # 0x22526
cmovaeq %rax, %rsi
leaq 0xddcf(%rip), %rdi      # 0x2251f
xorl %eax, %eax
callq 0x5130
incq %r12
cmpq $0x2e, %r12
jne 0x145dc
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq