// File: /workspace/github_c_makefile_star2_O2/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 0xe2c7(%rip), %rax      # 0x21511
leaq 0xe2bc(%rip), %rcx      # 0x2150d
cmoveq %rax, %rcx
movq %rcx, 0x20(%rsp)
movl %esi, 0xc(%rsp)
movl %esi, %edi
xorl %esi, %esi
callq 0xb9d3
testq %rax, %rax
je 0x13430
movslq 0x8(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0x13430
addq $0x8, 0x18(%rsp)
testl %ebx, %ebx
pushq $0x20
popq %rax
pushq $0x2a
popq %rcx
cmovel %eax, %ecx
movl %ecx, 0x10(%rsp)
pushq $0x1
popq %r12
pushq $0x6
popq %r15
cmpq $0x2e, %r12
je 0x13430
movq 0x18(%rsp), %rax
leaq (%rax,%r12,8), %rbp
addq $-0x8, %rbp
cmpq $0x20, %r12
movl %r12d, %r14d
pushq $0x1
popq %r13
cmovael %r13d, %r14d
leal -0x1f(%r12), %eax
movl %eax, 0x14(%rsp)
movq (%rbp), %rbp
testq %rbp, %rbp
je 0x13401
cmpl %ebx, (%rbp)
jne 0x133aa
movq 0x8(%rbp), %rdi
leaq 0xe029(%rip), %rsi      # 0x2131d
movl %r15d, %edx
callq 0x9665
testl %eax, %eax
je 0x133aa
testl %r13d, %r13d
je 0x13334
movl %r12d, %esi
cmpq $0x20, %r12
jb 0x13324
movl 0x8(%rsp), %edi
movl %r12d, %esi
movl 0xc(%rsp), %edx
callq 0xa004
movl %eax, %esi
leaq 0xe1ee(%rip), %rdi      # 0x21519
xorl %eax, %eax
callq 0x5130
jmp 0x13354
pushq $0xa
popq %r13
movl %r13d, %edi
callq 0x5060
leaq 0xb440(%rip), %rdi      # 0x1e787
callq 0x10cfd
movl %r13d, %edi
callq 0x5060
movl %r14d, 0x1bc7d(%rip)    # 0x2efd8
movl 0x1bc53(%rip), %eax     # 0x2efb4
movl %eax, 0x1bc75(%rip)     # 0x2efdc
movl %r14d, 0x1bc72(%rip)    # 0x2efe0
movl 0x1bc44(%rip), %eax     # 0x2efb8
movl %eax, 0x1bc6a(%rip)     # 0x2efe4
cmpl $0x0, 0x1bc2f(%rip)     # 0x2efb0
jne 0x133b3
movq 0x8(%rbp), %rdi
callq 0x13039
xorl %r13d, %r13d
cmpl $0x0, 0x1bc1a(%rip)     # 0x2efb0
je 0x133aa
movq 0x14c59(%rip), %rax     # 0x27ff8
movq (%rax), %rsi
pushq $0xa
popq %rdi
callq 0x51b0
addq $0x10, %rbp
jmp 0x132d3
movq 0x14c3e(%rip), %rax     # 0x27ff8
movq (%rax), %rdi
cmpq $0x1f, %r12
ja 0x133e4
leaq 0xe156(%rip), %rsi      # 0x21520
movl 0x8(%rsp), %edx
movl %r12d, %ecx
movl 0xc(%rsp), %r8d
movl 0x10(%rsp), %r9d
xorl %eax, %eax
callq 0x5200
jmp 0x13383
leaq 0xe145(%rip), %rsi      # 0x21530
movl 0x8(%rsp), %edx
movl 0x14(%rsp), %ecx
movl 0xc(%rsp), %r8d
xorl %eax, %eax
callq 0x5200
jmp 0x13383
testl %r13d, %r13d
jne 0x13428
cmpq $0x20, %r12
movq 0x20(%rsp), %rsi
leaq 0xe130(%rip), %rax      # 0x21546
cmovaeq %rax, %rsi
leaq 0xe11e(%rip), %rdi      # 0x2153f
xorl %eax, %eax
callq 0x5130
incq %r12
jmp 0x132a4
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq