// File: /workspace/github_c_makefile_star2_O2/mmayer[P]pcal/src/readfile.c
// Function: do_include
int do_include (char *path, char *name, int noerr)
{
   FILE *fp;
   char *p, incfile[STRSIZ], tmpnam[STRSIZ], sv_tmpnam[STRSIZ];
   int yy, yyfirst, yylast, sv_curr_year;
   
   if (!name) return 0;   /* whoops, no date file */

   /* copy name, stripping "" or <> */
   strcpy(tmpnam, name + (*name == '"' || *name == '<'));
   if ((p = P_LASTCHAR(tmpnam)) && (*p == '"' || *p == '>')) *p = '\0';

   /* save year and unmunged file name */
   sv_curr_year = curr_year;
   strcpy(sv_tmpnam, tmpnam);
   
   /* set up range of years to include: '%y', if present, is normally expanded
      to only the current year - except in "year all" mode where it is
      expanded to every applicable year
   */
   yyfirst = yylast = curr_year;
   if (curr_year == ALL_YEARS) {
      yyfirst = yylast = init_year;
      if ((p = strchr(tmpnam, '%')) != NULL && *(p+1) == 'y') yylast = final_year;
   }

   /*
    * loop over all years to be included
    */
   for (yy = yyfirst; yy <= yylast; yy++) {
      strcpy(tmpnam, sv_tmpnam);   /* restore unmunged name */
      
      /* replace each instance of %y with last two digits of year */
      while ((p = strchr(tmpnam, '%')) != NULL && *(p+1) == 'y') {
         *p++ = (yy / 10) % 10 + '0';
         *p = yy % 10 + '0';
      }
      
      if ((fp = fopen(mk_filespec(incfile, path, tmpnam), "r")) == NULL) {
         if (noerr) continue;   /* silently ignore in include? mode */
         fprintf(stderr, E_FOPEN_ERR, progname, incfile);
         exit(EXIT_FAILURE);
      }
      
      curr_year = yy;   /* avoid infinite recursion */
      read_datefile(fp, incfile);   /* recursive call */
      fclose(fp);
   }

   curr_year = sv_curr_year;   /* restore original value */
   
   return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movl %edx, 0x14(%rsp)
movq %rdi, 0x18(%rsp)
testq %rsi, %rsi
je 0xb3a5
movb (%rsi), %al
cmpb $0x22, %al
sete %cl
cmpb $0x3c, %al
sete %al
orb %cl, %al
movzbl %al, %eax
addq %rsi, %rax
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x50a0
cmpb $0x0, (%rbx)
je 0xb2b4
leaq 0x20(%rsp), %rdi
callq 0x5100
movzbl 0x1f(%rsp,%rax), %ecx
cmpl $0x3e, %ecx
je 0xb2af
cmpl $0x22, %ecx
jne 0xb2b4
movb $0x0, 0x1f(%rsp,%rax)
leaq 0x22315(%rip), %rax     # 0x2d5d0
movl (%rax), %ebx
leaq 0xf0(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x50a0
movl %ebx, %ebp
movl %ebx, 0xc(%rsp)
movl %ebx, 0x10(%rsp)
cmpl $-0x1, %ebx
je 0xb3b9
leaq 0x20(%rsp), %r15
pushq $0x25
popq %r13
leaq 0x1c0(%rsp), %rbx
cmpl 0xc(%rsp), %ebp
jg 0xb398
movq %r15, %rdi
leaq 0xf0(%rsp), %rsi
callq 0x50a0
movl %ebp, %eax
cltd
pushq $0xa
popq %rcx
idivl %ecx
movl %edx, %r12d
cltd
idivl %ecx
movl %edx, %r14d
addb $0x30, %r14b
addb $0x30, %r12b
movq %r15, %rdi
movl %r13d, %esi
callq 0x5120
testq %rax, %rax
je 0xb345
cmpb $0x79, 0x1(%rax)
jne 0xb345
movb %r14b, (%rax)
movb %r12b, 0x1(%rax)
jmp 0xb326
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
movq %r15, %rdx
callq 0xa8cf
movq %rax, %rdi
leaq 0x121d9(%rip), %rsi     # 0x1d538
callq 0x5290
testq %rax, %rax
je 0xb38a
movq %rax, %r14
leaq 0x2225d(%rip), %rax     # 0x2d5d0
movl %ebp, (%rax)
movq %r14, %rdi
movq %rbx, %rsi
callq 0xaaf8
movq %r14, %rdi
callq 0x50e0
jmp 0xb391
cmpl $0x0, 0x14(%rsp)
je 0xb3fd
incl %ebp
jmp 0xb2f3
leaq 0x22231(%rip), %rax     # 0x2d5d0
movl 0x10(%rsp), %ecx
movl %ecx, (%rax)
xorl %eax, %eax
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x220c8(%rip), %rax     # 0x2d488
movl (%rax), %ebp
leaq 0x20(%rsp), %rdi
pushq $0x25
popq %rsi
callq 0x5120
testq %rax, %rax
je 0xb3f4
cmpb $0x79, 0x1(%rax)
movl %ebp, 0xc(%rsp)
jne 0xb2e2
leaq 0x221e3(%rip), %rax     # 0x2d5cc
movl (%rax), %eax
movl %eax, 0xc(%rsp)
jmp 0xb2e2
movl %ebp, 0xc(%rsp)
jmp 0xb2e2
movq 0x1cbf4(%rip), %rax     # 0x27ff8
movq (%rax), %rdi
leaq 0x9cdc(%rip), %rsi      # 0x150ea
leaq 0x2140b(%rip), %rdx     # 0x2c820
leaq 0x1c0(%rsp), %rcx
xorl %eax, %eax
callq 0x5200
pushq $0x1
popq %rdi
callq 0x52f0