// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x2e0, %rsp            # imm = 0x2E0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xe309
movl $0x0, -0x4(%rbp)
jmp 0xe600
leaq -0x1d0(%rbp), %rax
movq %rax, -0x2c8(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x2c0(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x22, %ecx
movb %al, -0x2b1(%rbp)
je 0xe349
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3c, %eax
sete %al
movb %al, -0x2b1(%rbp)
movq -0x2c8(%rbp), %rdi
movq -0x2c0(%rbp), %rsi
movb -0x2b1(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cltq
addq %rax, %rsi
callq 0x5080
leaq -0x1d0(%rbp), %rax
cmpq $0x0, %rax
je 0xe3b9
movsbl -0x1d0(%rbp), %eax
cmpl $0x0, %eax
je 0xe3b9
leaq -0x1d0(%rbp), %rax
movq %rax, -0x2d8(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x50e0
movq %rax, %rcx
movq -0x2d8(%rbp), %rax
addq %rcx, %rax
addq $-0x1, %rax
movq %rax, -0x2d0(%rbp)
jmp 0xe3c4
xorl %eax, %eax
movq %rax, -0x2d0(%rbp)
jmp 0xe3c4
movq -0x2d0(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0xe3f4
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
je 0xe3ed
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3e, %eax
jne 0xe3f4
movq -0x30(%rbp), %rax
movb $0x0, (%rax)
leaq 0x25265(%rip), %rax     # 0x33660
movl (%rax), %eax
movl %eax, -0x2b0(%rbp)
leaq -0x2a0(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x5080
leaq 0x25243(%rip), %rax     # 0x33660
movl (%rax), %eax
movl %eax, -0x2ac(%rbp)
movl %eax, -0x2a8(%rbp)
leaq 0x2522e(%rip), %rax     # 0x33660
cmpl $-0x1, (%rax)
jne 0xe485
leaq 0x250da(%rip), %rax     # 0x33518
movl (%rax), %eax
movl %eax, -0x2ac(%rbp)
movl %eax, -0x2a8(%rbp)
leaq -0x1d0(%rbp), %rdi
movl $0x25, %esi
callq 0x5100
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0xe483
movq -0x30(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x79, %eax
jne 0xe483
leaq 0x251e1(%rip), %rax     # 0x3365c
movl (%rax), %eax
movl %eax, -0x2ac(%rbp)
jmp 0xe485
movl -0x2a8(%rbp), %eax
movl %eax, -0x2a4(%rbp)
movl -0x2a4(%rbp), %eax
cmpl -0x2ac(%rbp), %eax
jg 0xe5ea
leaq -0x1d0(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x5080
leaq -0x1d0(%rbp), %rdi
movl $0x25, %esi
callq 0x5100
movq %rax, %rcx
movq %rcx, -0x30(%rbp)
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x2d9(%rbp)
je 0xe4f0
movq -0x30(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x79, %eax
sete %al
movb %al, -0x2d9(%rbp)
movb -0x2d9(%rbp), %al
testb $0x1, %al
jne 0xe4fc
jmp 0xe546
movl -0x2a4(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl $0xa, %ecx
cltd
idivl %ecx
addl $0x30, %edx
movb %dl, %cl
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x30(%rbp)
movb %cl, (%rax)
movl -0x2a4(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
addl $0x30, %edx
movb %dl, %cl
movq -0x30(%rbp), %rax
movb %cl, (%rax)
jmp 0xe4b6
leaq -0x100(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x1d0(%rbp), %rdx
callq 0xd530
movq %rax, %rdi
leaq 0x160fa(%rip), %rsi     # 0x24661
callq 0x5250
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0xe5ae
cmpl $0x0, -0x1c(%rbp)
je 0xe57e
jmp 0xe5d6
movq 0x1fa73(%rip), %rax     # 0x2dff8
movq (%rax), %rdi
leaq -0x100(%rbp), %rcx
leaq 0xdb67(%rip), %rsi      # 0x1c0fd
leaq 0x24313(%rip), %rdx     # 0x328b0
movb $0x0, %al
callq 0x51b0
movl $0x1, %edi
callq 0x52b0
movl -0x2a4(%rbp), %ecx
leaq 0x250a5(%rip), %rax     # 0x33660
movl %ecx, (%rax)
movq -0x28(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0xd950
movq -0x28(%rbp), %rdi
callq 0x50c0
movl -0x2a4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2a4(%rbp)
jmp 0xe491
movl -0x2b0(%rbp), %ecx
leaq 0x25069(%rip), %rax     # 0x33660
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x2e0, %rsp            # imm = 0x2E0
popq %rbp
retq
nopl (%rax)