// File: /workspace/github_c_makefile_star2_O3/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 0xeb18(%rip), %rax      # 0x23561
leaq 0xeb0d(%rip), %rcx      # 0x2355d
cmoveq %rax, %rcx
movq %rcx, 0x18(%rsp)
movl %esi, 0xc(%rsp)
movl %esi, %edi
xorl %esi, %esi
callq 0xc8d0
testq %rax, %rax
je 0x14c2e
movslq 0x8(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0x14c2e
testl %ebx, %ebx
movl $0x20, %eax
movl $0x2a, %ecx
cmovel %eax, %ecx
movl %ecx, 0x10(%rsp)
movl $0x1, %r12d
leaq 0xe8c7(%rip), %r13      # 0x2336d
movq 0x20(%rsp), %rax
movq (%rax,%r12,8), %r14
testq %r14, %r14
je 0x14c21
cmpq $0x20, %r12
movl $0x1, %r15d
movl %r12d, %ebp
cmovael %r15d, %ebp
leal -0x1f(%r12), %eax
movl %eax, 0x14(%rsp)
cmpl %ebx, (%r14)
jne 0x14b9a
movq 0x8(%r14), %rdi
movq %r13, %rsi
movl $0x6, %edx
callq 0xa340
testl %eax, %eax
je 0x14b9a
testl %r15d, %r15d
je 0x14b24
movl %r12d, %esi
cmpq $0x20, %r12
jb 0x14b14
movl 0x8(%rsp), %edi
movl %r12d, %esi
movl 0xc(%rsp), %edx
callq 0xadfd
movl %eax, %esi
leaq 0xea4e(%rip), %rdi      # 0x23569
xorl %eax, %eax
callq 0x5130
jmp 0x14b44
movl $0xa, %edi
callq 0x5060
leaq 0xbca2(%rip), %rdi      # 0x207d7
callq 0x11eb4
movl $0xa, %edi
callq 0x5060
movl %ebp, 0x1b49e(%rip)     # 0x2ffe8
movl 0x1b474(%rip), %eax     # 0x2ffc4
movl %eax, 0x1b496(%rip)     # 0x2ffec
movl %ebp, 0x1b494(%rip)     # 0x2fff0
movl 0x1b466(%rip), %eax     # 0x2ffc8
movl %eax, 0x1b48c(%rip)     # 0x2fff4
cmpl $0x0, 0x1b451(%rip)     # 0x2ffc0
jne 0x14ba9
movq 0x8(%r14), %rdi
callq 0x147fb
xorl %r15d, %r15d
cmpl $0x0, 0x1b43c(%rip)     # 0x2ffc0
je 0x14b9a
movq 0x14463(%rip), %rax     # 0x28ff0
movq (%rax), %rsi
movl $0xa, %edi
callq 0x51c0
movq 0x10(%r14), %r14
testq %r14, %r14
jne 0x14ad2
jmp 0x14bfa
movq 0x14440(%rip), %rax     # 0x28ff0
movq (%rax), %rdi
cmpq $0x1f, %r12
ja 0x14bda
leaq 0xe9b0(%rip), %rsi      # 0x23570
movl 0x8(%rsp), %edx
movl %r12d, %ecx
movl 0xc(%rsp), %r8d
movl 0x10(%rsp), %r9d
xorl %eax, %eax
callq 0x5210
jmp 0x14b71
leaq 0xe99f(%rip), %rsi      # 0x23580
movl 0x8(%rsp), %edx
movl 0x14(%rsp), %ecx
movl 0xc(%rsp), %r8d
xorl %eax, %eax
callq 0x5210
jmp 0x14b71
testl %r15d, %r15d
jne 0x14c21
cmpq $0x20, %r12
movq 0x18(%rsp), %rsi
leaq 0xe987(%rip), %rax      # 0x23596
cmovaeq %rax, %rsi
leaq 0xe975(%rip), %rdi      # 0x2358f
xorl %eax, %eax
callq 0x5130
incq %r12
cmpq $0x2e, %r12
jne 0x14aa6
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq