// File: /workspace/github_c_makefile_star2_O1/mmayer[P]pcal/src/writefil.c
// Function: expand_fmt
char *expand_fmt (char *buf,   /* output buffer (filled in) */
                   char *p)    /* character following percent sign */
{
   char c;
   static char *prefixes = "0o+-";
   int firstday, wkday;
   int adjust = 0, print_lz = FALSE, ordinal = FALSE, prev_num = -1;
   int num_present = FALSE, num_value = 0;
   date_str date;
   
   /* For compatibility with version 4.1, still support %[+-][bBdmY] (print
      the next/last month-name/day/month/year).  Version 4.11 introduces
      %[+-]<n>[DWMY], which adjusts the working date by [+-]<n>
      days/weeks/months/years; this method is preferred due to its greater
      flexibility.
   */

   buf[0] = '\0';   /* initialize output to null string */
   
   do {   /* loop until format character found */
      switch (c = *p++) {
      case 'a':   /* %a : abbreviated weekday */
         wkday = calc_weekday(work_month, work_day, work_year);
         strcpy(buf, days_ml_short[output_language][wkday]);
         break;
         
      case 'A':   /* %A : full weekday */
         wkday = calc_weekday(work_month, work_day, work_year);
         strcpy(buf, days_ml[output_language][wkday]);
         break;
         
      case 'b':   /* %b : abbreviated month name */
      case 'B':   /* %B : full month name */
         strcpy(buf, months_ml[output_language][(work_month + adjust + 11) % 12]);
         if (c == 'b')
            buf[ABBR_MONTH_LEN] = '\0';
         break;
         
      case 'd':   /* %d : day of month (01-31) */
         prev_num = work_day;
         sprintf(buf, print_lz ? "%02d" : "%d", prev_num);
         break;
         
      case 'D':   /* %D : adjust working date by <N> days (NEW) */
         if (!num_present || num_value == 0) RESET_DATE();
         else SET_DATE(adjust * num_value);
         break;
         
      case 'j':   /* %j : day of year (001-366) */
         prev_num = DAY_OF_YEAR(work_month, work_day, work_year);
         sprintf(buf, print_lz ? "%03d" : "%d", prev_num);
         break;
         
      case 'l':   /* %l : days left in year (000-365) (NEW) */
         prev_num = YEAR_LEN(work_year) - DAY_OF_YEAR(work_month, work_day, work_year);
         sprintf(buf, print_lz ? "%03d" : "%d", prev_num);
         break;
         
      case 'm':   /* %m : month (01-12) */
         prev_num = (work_month + adjust + 11) % 12 + 1;
         sprintf(buf, print_lz ? "%02d" : "%d", prev_num);
         break;
         
      case 'M':   /* %M : adjust date by <N> months (NEW) */
         if (!num_present || num_value == 0) {
            RESET_DATE();
         }
         else {
            int len;
            
            work_month += adjust * num_value;
            while (work_month > DEC) {
               work_month -= 12;
               work_year++;
            }
            while (work_month < JAN) {
               work_month += 12;
               work_year--;
            }
            
            /* make sure day of new month is legal */
            len = LENGTH_OF(work_month, work_year);
            if (work_day > len) work_day = len;
         }
         break;

         /* %u considers the week containing 1/1 to be week 1 and the next
            "logical Sunday" (the first day of the week as printed - cf. the
            -F option) to be the start of week 2; %U considers the first
            "logical Sunday" of the year to be the start of week 1.  %w and %W
            behave like %u and %U respectively, but use the first "logical
            Monday" instead.
         */
      case 'W':   /* %W : week number (00-53)       */
         /* %W, if prefaced by [+-]N, adjusts the date by [+-]N weeks (resets
            if N == 0); check for this case first
         */
         if (num_present) {
            if (num_value == 0) RESET_DATE();   /* N = 0: reset date */
            else SET_DATE(7 * adjust * num_value);
            break;
         }
         /* fall through */
      case 'u':   /* %u : week number (01-54) (NEW) */
      case 'U':   /* %U : week number (00-53)       */
      case 'w':   /* %w : week number (01-54) (NEW) */
         firstday = ((tolower(c) == 'w' ? 15 : 14) -
                     START_BOX(JAN, work_year)) % 7 + 1;
         prev_num = (DAY_OF_YEAR(work_month, work_day,
                                 work_year) - firstday + 7) / 7;
         if (islower((int)c) && firstday != 1) prev_num++;
         sprintf(buf, print_lz ? "%02d" : "%d", prev_num);
         break;
         
      case 'y':   /* %y : year w/o century (00-99) */
         prev_num = (work_year + adjust) % 100;
         sprintf(buf, "%02d", prev_num);
         break;
         
      case 'Y':   /* %Y : year w/century */
         /* %Y, if prefaced by [+-]N, adjusts the date by [+-]N years (resets
            if N == 0); check for this case first
          */
         if (num_present) {
            if (num_value == 0) { /* N = 0: reset date */
               RESET_DATE();
            }
            else {
               int len;
               
               work_year += adjust * num_value;
               
               /* make sure day is legal */
               len = LENGTH_OF(work_month, work_year);
               if (work_day > len) work_day = len;
            }
         } 
         else {
            prev_num = work_year + adjust;
            sprintf(buf, "%d", prev_num);
         }
         break;

         /* prefix flags [o0+-] : set flags for next pass */

      case 'o':   /* %o : ordinal suffix (NEW) */
         ordinal = TRUE;
         break;
         
      case '0':   /* %0 : add leading zeroes (NEW) */
         print_lz = TRUE;
         break;
         
      case '+':   /* %+ : increment next value (NEW) */
      case '-':   /* %- : decrement next value (NEW) */
         adjust = c == '-' ? -1 : 1;
         if (isdigit((int)*p)) {   /* get the number */
            num_present = TRUE;
            while (isdigit((int)*p)) {
               num_value = num_value * 10 + (*p++ - '0');
            }
         }
         break;
         
      case '\0':   /* accidental end-of-string */
      case ' ':
         return p - 1;
         
      default:   /* other - just copy it to output */
         sprintf(buf, "%c", c);
         break;
      };
      
   } while (strchr(prefixes, c) != NULL);
   
   /* append ordinal suffix if requested */
   if (ordinal && prev_num >= 0) strcat(buf, ordinal_suffix(prev_num));

   return p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movb $0x0, (%rdi)
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
leaq 0xeb30(%rip), %r12      # 0x224dd
movl $0x0, 0x4(%rsp)
movl $0x0, 0x1c(%rsp)
movl $0x0, (%rsp)
xorl %ebp, %ebp
movq $0x0, 0x8(%rsp)
movq %rdi, 0x20(%rsp)
movq %rbx, %rax
incq %rbx
movb (%rax), %r13b
movzbl %r13b, %ecx
cmpl $0x56, %ecx
jg 0x13a13
cmpl $0x41, %ecx
jg 0x13a69
cmpl $0x2c, %ecx
jg 0x13aa9
cmpl $0x2b, %ecx
je 0x13b06
testl %ecx, %ecx
je 0x14245
cmpl $0x20, %ecx
jne 0x13f2e
jmp 0x14245
leal -0x61(%rcx), %eax
cmpl $0x18, %eax
ja 0x13d57
leaq 0xb546(%rip), %rcx      # 0x1ef6c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x1b5b7(%rip), %edi     # 0x2efec
movl 0x1b5b5(%rip), %esi     # 0x2eff0
movl 0x1b5b3(%rip), %edx     # 0x2eff4
callq 0xa53f
leaq 0x19dc7(%rip), %rcx     # 0x2d814
movslq (%rcx), %rcx
cltq
leaq (%rax,%rax,4), %rax
imulq $0x8c, %rcx, %rcx
addq 0x14574(%rip), %rcx     # 0x27fd8
jmp 0x13af5
cmpl $0x4c, %ecx
jg 0x13b5f
cmpl $0x42, %ecx
je 0x13cec
cmpl $0x44, %ecx
jne 0x13f2e
cmpl $0x0, (%rsp)
je 0x13f05
testl %ebp, %ebp
je 0x13f05
movl 0x1b550(%rip), %eax     # 0x2efec
movq 0x8(%rsp), %rcx
imull %ebp, %ecx
jmp 0x14127
cmpl $0x2d, %ecx
je 0x13b06
cmpl $0x30, %ecx
je 0x140f5
cmpl $0x41, %ecx
jne 0x13f2e
movl 0x1b526(%rip), %edi     # 0x2efec
movl 0x1b524(%rip), %esi     # 0x2eff0
movl 0x1b522(%rip), %edx     # 0x2eff4
callq 0xa53f
leaq 0x19d36(%rip), %rcx     # 0x2d814
movslq (%rcx), %rcx
cltq
leaq (%rax,%rax,4), %rax
imulq $0x8c, %rcx, %rcx
addq 0x144db(%rip), %rcx     # 0x27fd0
leaq (%rcx,%rax,4), %rsi
movq %r14, %rdi
callq 0x50a0
jmp 0x14196
xorl %eax, %eax
cmpb $0x2d, %r13b
setne %al
leal -0x1(,%rax,2), %eax
movq %rax, 0x8(%rsp)
callq 0x5340
movq (%rax), %rax
movsbq (%rbx), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x14196
movsbq (%rbx), %rcx
movl $0x1, (%rsp)
testb $0x8, 0x1(%rax,%rcx,2)
je 0x14196
movsbl %cl, %ecx
leal (%rbp,%rbp,4), %edx
leal (%rcx,%rdx,2), %ebp
addl $-0x30, %ebp
movsbq 0x1(%rbx), %rcx
incq %rbx
jmp 0x13b3d
cmpl $0x4d, %ecx
je 0x13de4
cmpl $0x55, %ecx
jne 0x13f2e
movsbq %r13b, %r15
callq 0x5330
movq (%rax), %rax
xorl %r12d, %r12d
cmpl $0x77, (%rax,%r15,4)
sete %r14b
movl 0x1b465(%rip), %edx     # 0x2eff4
movl $0x1, %edi
movl $0x1, %esi
callq 0xa53f
movslq 0x1b447(%rip), %rcx     # 0x2efec
xorl %edx, %edx
cmpq $0x3, %rcx
jl 0x13be5
movl 0x1b441(%rip), %esi     # 0x2eff4
testb $0x3, %sil
jne 0x13be5
imull $0xc28f5c29, %esi, %esi # imm = 0xC28F5C29
addl $0x51eb850, %esi        # imm = 0x51EB850
movl %esi, %edi
rorl $0x2, %edi
movl $0x1, %edx
cmpl $0x28f5c28, %edi        # imm = 0x28F5C28
ja 0x13be5
rorl $0x4, %esi
xorl %edx, %edx
cmpl $0xa3d70b, %esi         # imm = 0xA3D70B
setb %dl
movb %r14b, %r12b
leaq 0x189f9(%rip), %rsi     # 0x2c5e8
movl (%rsi), %esi
movl %eax, %edi
subl %esi, %edi
negl %esi
addl %esi, %eax
addl $0x7, %eax
cltq
imulq $-0x6db6db6d, %rax, %rsi # imm = 0x92492493
shrq $0x20, %rsi
addl %edi, %esi
addl $0x7, %esi
movl %esi, %edi
shrl $0x1f, %edi
sarl $0x2, %esi
addl %edi, %esi
leal (,%rsi,8), %edi
subl %esi, %edi
subl %eax, %edi
leal (%rdi,%r12), %eax
addl $0xe, %eax
imulq $0x24924925, %rax, %rsi # imm = 0x24924925
shrq $0x20, %rsi
movl %eax, %r12d
subl %esi, %r12d
shrl %r12d
addl %esi, %r12d
shrl $0x2, %r12d
leal (,%r12,8), %esi
subl %esi, %r12d
addl %eax, %r12d
movl %r12d, %eax
notl %eax
leaq 0x14571(%rip), %rsi     # 0x281d0
movswl -0x2(%rsi,%rcx,2), %ecx
addl %eax, %ecx
addl %edx, %ecx
movl 0x1b382(%rip), %eax     # 0x2eff0
leal (%rcx,%rax), %edx
addl %ecx, %eax
addl $0x7, %eax
cltq
imulq $-0x6db6db6d, %rax, %rax # imm = 0x92492493
shrq $0x20, %rax
leal (%rax,%rdx), %r14d
addl $0x7, %r14d
movl %r14d, %eax
shrl $0x1f, %eax
sarl $0x2, %r14d
addl %eax, %r14d
callq 0x5340
movq (%rax), %rax
movzwl (%rax,%r15,2), %eax
shrl $0x9, %eax
testl %r12d, %r12d
setne %cl
andb %al, %cl
movzbl %cl, %r15d
addl %r14d, %r15d
cmpl $0x0, 0x4(%rsp)
leaq 0xe8af(%rip), %rsi      # 0x22572
leaq 0xb5b0(%rip), %rax      # 0x1f27a
cmoveq %rax, %rsi
movq 0x20(%rsp), %r14
movq %r14, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x52f0
leaq 0xe7f6(%rip), %r12      # 0x224dd
jmp 0x14196
leaq 0x19b21(%rip), %rax     # 0x2d814
movslq (%rax), %rax
movl 0x1b2f0(%rip), %ecx     # 0x2efec
movq 0x8(%rsp), %rdx
addl %edx, %ecx
addl $0xb, %ecx
movslq %ecx, %rcx
imulq $0x2aaaaaab, %rcx, %rdx # imm = 0x2AAAAAAB
movq %rdx, %rsi
shrq $0x3f, %rsi
shrq $0x21, %rdx
addl %esi, %edx
shll $0x2, %edx
leal (%rdx,%rdx,2), %edx
subl %edx, %ecx
movslq %ecx, %rcx
leaq (%rax,%rax,2), %rax
shlq $0x5, %rax
addq 0x14271(%rip), %rax     # 0x27fa8
movq (%rax,%rcx,8), %rsi
movq %r14, %rdi
callq 0x50a0
cmpb $0x62, %r13b
jne 0x14196
movb $0x0, 0x3(%r14)
jmp 0x14196
cmpl $0x57, %ecx
je 0x14102
cmpl $0x59, %ecx
jne 0x13f2e
cmpl $0x0, (%rsp)
je 0x141b2
testl %ebp, %ebp
je 0x14169
movq 0x8(%rsp), %rax
movl %eax, %edx
imull %ebp, %edx
addl 0x1b269(%rip), %edx     # 0x2eff4
movl %edx, 0x1b263(%rip)     # 0x2eff4
movslq 0x1b254(%rip), %rax     # 0x2efec
xorl %ecx, %ecx
cmpq $0x2, %rax
jne 0x13dd3
movl %edx, %esi
andl $0x3, %esi
jne 0x13dd3
imull $0xc28f5c29, %edx, %edx # imm = 0xC28F5C29
addl $0x51eb850, %edx        # imm = 0x51EB850
movl %edx, %esi
rorl $0x2, %esi
movl $0x1, %ecx
cmpl $0x28f5c28, %esi        # imm = 0x28F5C28
ja 0x13dd3
rorl $0x4, %edx
xorl %ecx, %ecx
cmpl $0xa3d70b, %edx         # imm = 0xA3D70B
setb %cl
leaq 0x143e6(%rip), %rdx     # 0x281c0
movsbl -0x1(%rax,%rdx), %eax
jmp 0x13ee5
cmpl $0x0, (%rsp)
je 0x13f05
testl %ebp, %ebp
je 0x13f05
movq 0x8(%rsp), %rax
imull %ebp, %eax
addl 0x1b1e8(%rip), %eax     # 0x2efec
movl %eax, 0x1b1e2(%rip)     # 0x2efec
cmpl $0xd, %eax
jl 0x13e53
movl 0x1b1df(%rip), %ecx     # 0x2eff4
cmpl $0x18, %eax
movl $0x18, %edx
cmovll %eax, %edx
movl %eax, %esi
subl %edx, %esi
addl $0xb, %esi
movl $0xaaaaaaab, %edx       # imm = 0xAAAAAAAB
imulq %rdx, %rsi
shrq $0x23, %rsi
leal (,%rsi,4), %edx
leal (%rdx,%rdx,2), %edx
subl %edx, %eax
addl $-0xc, %eax
addl %esi, %ecx
incl %ecx
movl %eax, 0x1b19f(%rip)     # 0x2efec
movl %ecx, 0x1b1a1(%rip)     # 0x2eff4
movl 0x1b193(%rip), %eax     # 0x2efec
testl %eax, %eax
jg 0x13e9a
cmpl $-0xa, %eax
movl $0xfffffff5, %ecx       # imm = 0xFFFFFFF5
cmovgel %eax, %ecx
xorl %edx, %edx
cmpl $-0xb, %eax
setl %dl
subl %eax, %ecx
subl %edx, %ecx
movl $0xaaaaaaab, %esi       # imm = 0xAAAAAAAB
imulq %rsi, %rcx
shrq $0x23, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,2), %edx
leal (%rax,%rdx,4), %eax
addl $0xc, %eax
notl %ecx
movl %eax, 0x1b158(%rip)     # 0x2efec
addl %ecx, 0x1b15a(%rip)     # 0x2eff4
xorl %ecx, %ecx
cmpl $0x2, %eax
jne 0x13ed8
movl 0x1b14d(%rip), %edx     # 0x2eff4
testb $0x3, %dl
jne 0x13ed8
imull $0xc28f5c29, %edx, %edx # imm = 0xC28F5C29
addl $0x51eb850, %edx        # imm = 0x51EB850
movl %edx, %esi
rorl $0x2, %esi
movl $0x1, %ecx
cmpl $0x28f5c28, %esi        # imm = 0x28F5C28
ja 0x13ed8
rorl $0x4, %edx
xorl %ecx, %ecx
cmpl $0xa3d70b, %edx         # imm = 0xA3D70B
setb %cl
decl %eax
leaq 0x142df(%rip), %rdx     # 0x281c0
movsbl (%rdx,%rax), %eax
addl %ecx, %eax
movl $0x1, (%rsp)
cmpl %eax, 0x1b0fc(%rip)     # 0x2eff0
jle 0x14196
movl %eax, 0x1b0f0(%rip)     # 0x2eff0
jmp 0x14196
movl 0x1b0b9(%rip), %eax     # 0x2efc4
movl %eax, 0x1b0db(%rip)     # 0x2efec
movl 0x1b0d1(%rip), %eax     # 0x2efe8
movl %eax, 0x1b0d3(%rip)     # 0x2eff0
movl 0x1b0a5(%rip), %eax     # 0x2efc8
movl %eax, 0x1b0cb(%rip)     # 0x2eff4
jmp 0x14196
movb %r13b, (%r14)
movb $0x0, 0x1(%r14)
jmp 0x14196
movl 0x1b0ab(%rip), %eax     # 0x2efec
movq 0x8(%rsp), %rcx
addl %ecx, %eax
addl $0xb, %eax
movslq %eax, %r15
imulq $0x2aaaaaab, %r15, %rax # imm = 0x2AAAAAAB
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x21, %rax
addl %ecx, %eax
shll $0x2, %eax
leal (%rax,%rax,2), %eax
subl %eax, %r15d
incl %r15d
jmp 0x14021
movl 0x1b07b(%rip), %eax     # 0x2eff4
movl $0x16d, %r15d           # imm = 0x16D
testb $0x3, %al
jne 0x13fb8
imull $0xc28f5c29, %eax, %ecx # imm = 0xC28F5C29
addl $0x51eb850, %ecx        # imm = 0x51EB850
movl %ecx, %edx
rorl $0x2, %edx
movl $0x16e, %r15d           # imm = 0x16E
cmpl $0x28f5c28, %edx        # imm = 0x28F5C28
ja 0x13fb8
rorl $0x4, %ecx
cmpl $0xa3d70b, %ecx         # imm = 0xA3D70B
movl $0x0, %r15d
adcl $0x16d, %r15d           # imm = 0x16D
testb $0x3, %al
setne %sil
movslq 0x1b027(%rip), %rcx     # 0x2efec
cmpq $0x3, %rcx
setl %dil
xorl %edx, %edx
orb %sil, %dil
jne 0x14000
imull $0xc28f5c29, %eax, %eax # imm = 0xC28F5C29
addl $0x51eb850, %eax        # imm = 0x51EB850
movl %eax, %esi
rorl $0x2, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpl $0x28f5c28, %esi        # imm = 0x28F5C28
ja 0x14000
rorl $0x4, %eax
cmpl $0xa3d70b, %eax         # imm = 0xA3D70B
movl $0x0, %edx
sbbl %edx, %edx
addl %edx, %r15d
leaq 0x141c6(%rip), %rax     # 0x281d0
movswl -0x2(%rax,%rcx,2), %eax
addl 0x1afdb(%rip), %eax     # 0x2eff0
subl %eax, %r15d
jmp 0x1408c
movl 0x1afcf(%rip), %r15d    # 0x2eff0
cmpl $0x0, 0x4(%rsp)
leaq 0xe545(%rip), %rsi      # 0x22572
jmp 0x14098
movslq 0x1afb6(%rip), %rax     # 0x2efec
xorl %ecx, %ecx
cmpq $0x3, %rax
jl 0x14075
movl 0x1afb0(%rip), %edx     # 0x2eff4
testb $0x3, %dl
jne 0x14075
imull $0xc28f5c29, %edx, %edx # imm = 0xC28F5C29
addl $0x51eb850, %edx        # imm = 0x51EB850
movl %edx, %esi
rorl $0x2, %esi
movl $0x1, %ecx
cmpl $0x28f5c28, %esi        # imm = 0x28F5C28
ja 0x14075
rorl $0x4, %edx
xorl %ecx, %ecx
cmpl $0xa3d70b, %edx         # imm = 0xA3D70B
setb %cl
leaq 0x14154(%rip), %rdx     # 0x281d0
movswl -0x2(%rdx,%rax,2), %r15d
addl %ecx, %r15d
addl 0x1af64(%rip), %r15d    # 0x2eff0
cmpl $0x0, 0x4(%rsp)
leaq 0xe44a(%rip), %rsi      # 0x224e2
leaq 0xb1db(%rip), %rax      # 0x1f27a
cmoveq %rax, %rsi
movq %r14, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x52f0
jmp 0x14196
movl 0x1af39(%rip), %eax     # 0x2eff4
addl 0x8(%rsp), %eax
movslq %eax, %r15
imulq $0x51eb851f, %r15, %rax # imm = 0x51EB851F
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x25, %rax
addl %ecx, %eax
imull $0x64, %eax, %eax
subl %eax, %r15d
movq %r14, %rdi
leaq 0xe48c(%rip), %rsi      # 0x22572
jmp 0x140a6
movl $0x1, 0x1c(%rsp)
jmp 0x14196
movl $0x1, 0x4(%rsp)
jmp 0x14196
cmpl $0x0, (%rsp)
je 0x13b71
testl %ebp, %ebp
je 0x14169
movq 0x8(%rsp), %rax
imull %ebp, %eax
leal (,%rax,8), %ecx
subl %eax, %ecx
movl 0x1aec5(%rip), %eax     # 0x2efec
addl 0x1aec3(%rip), %ecx     # 0x2eff0
movl %eax, 0x10(%rsp)
movl %ecx, 0x14(%rsp)
movl 0x1aeb9(%rip), %eax     # 0x2eff4
movl %eax, 0x18(%rsp)
leaq 0x10(%rsp), %rdi
callq 0xa1b1
movl 0x10(%rsp), %eax
movl 0x14(%rsp), %ecx
movl %eax, 0x1ae95(%rip)     # 0x2efec
movl %ecx, 0x1ae93(%rip)     # 0x2eff0
movl 0x18(%rsp), %eax
movl %eax, 0x1ae8d(%rip)     # 0x2eff4
jmp 0x1418f
movl 0x1ae55(%rip), %eax     # 0x2efc4
movl %eax, 0x1ae77(%rip)     # 0x2efec
movl 0x1ae6d(%rip), %eax     # 0x2efe8
movl %eax, 0x1ae6f(%rip)     # 0x2eff0
movl 0x1ae41(%rip), %eax     # 0x2efc8
movl %eax, 0x1ae67(%rip)     # 0x2eff4
xorl %ebp, %ebp
movl $0x1, (%rsp)
movsbl %r13b, %esi
movl $0x5, %edx
movq %r12, %rdi
callq 0x51e0
testq %rax, %rax
jne 0x139d4
jmp 0x141d4
movl 0x1ae3b(%rip), %r15d    # 0x2eff4
addl 0x8(%rsp), %r15d
movl $0x0, (%rsp)
movq %r14, %rdi
leaq 0xb0ab(%rip), %rsi      # 0x1f27a
jmp 0x140a6
cmpl $0x0, 0x1c(%rsp)
je 0x14242
testl %r15d, %r15d
js 0x14242
movl %r15d, %eax
movl $0xcccccccd, %ecx       # imm = 0xCCCCCCCD
imulq %rax, %rcx
shrq $0x23, %rcx
leal (%rcx,%rcx), %eax
leal (%rax,%rax,4), %eax
subl %eax, %r15d
imull $0xcccccccd, %ecx, %eax # imm = 0xCCCCCCCD
addl $0x33333333, %eax       # imm = 0x33333333
rorl %eax
xorl %ecx, %ecx
cmpl $0x1999999a, %eax       # imm = 0x1999999A
movl %r15d, %eax
cmovbl %ecx, %eax
cmpl $0x4, %r15d
cmovael %ecx, %eax
shll $0x3, %eax
leaq 0x1481c(%rip), %rcx     # 0x28a40
movq (%rcx,%rax), %rsi
leaq 0x1ae99(%rip), %r15     # 0x2f0c8
movq %r15, %rdi
callq 0x50a0
movq %r14, %rdi
movq %r15, %rsi
callq 0x52e0
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq