// File: /workspace/github_c_makefile_star2_O3/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
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, %r12d
cmpl $0x56, %r12d
jg 0x13ece
cmpl $0x41, %r12d
jg 0x13f26
cmpl $0x2c, %r12d
jg 0x13f69
cmpl $0x2b, %r12d
je 0x13fc9
testl %r12d, %r12d
je 0x14705
cmpl $0x20, %r12d
jne 0x143d5
jmp 0x14705
leal -0x61(%r12), %eax
cmpl $0x18, %eax
ja 0x14201
leaq 0xc0f9(%rip), %rcx      # 0x1ffdc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x1c0fa(%rip), %edi     # 0x2ffec
movl 0x1c0f8(%rip), %esi     # 0x2fff0
movl 0x1c0f6(%rip), %edx     # 0x2fff4
callq 0xab15
leaq 0x1a90a(%rip), %rcx     # 0x2e814
movslq (%rcx), %rcx
cltq
leaq (%rax,%rax,4), %rax
imulq $0x8c, %rcx, %rcx
addq 0x150b7(%rip), %rcx     # 0x28fd8
jmp 0x13fb8
cmpl $0x4c, %r12d
jg 0x14016
cmpl $0x42, %r12d
je 0x14196
cmpl $0x44, %r12d
jne 0x143d5
cmpl $0x0, (%rsp)
je 0x143ac
testl %ebp, %ebp
je 0x143ac
movl 0x1c090(%rip), %eax     # 0x2ffec
movq 0x8(%rsp), %rcx
imull %ebp, %ecx
jmp 0x14534
cmpl $0x2d, %r12d
je 0x13fc9
cmpl $0x30, %r12d
je 0x14502
cmpl $0x41, %r12d
jne 0x143d5
movl 0x1c063(%rip), %edi     # 0x2ffec
movl 0x1c061(%rip), %esi     # 0x2fff0
movl 0x1c05f(%rip), %edx     # 0x2fff4
callq 0xab15
leaq 0x1a873(%rip), %rcx     # 0x2e814
movslq (%rcx), %rcx
cltq
leaq (%rax,%rax,4), %rax
imulq $0x8c, %rcx, %rcx
addq 0x15018(%rip), %rcx     # 0x28fd0
leaq (%rcx,%rax,4), %rsi
movq %r14, %rdi
callq 0x50a0
jmp 0x14676
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 0x14676
movsbl %cl, %ecx
leal (%rbp,%rbp,4), %edx
leal (%rcx,%rdx,2), %ebp
addl $-0x30, %ebp
movsbq 0x1(%rbx), %rcx
incq %rbx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x13ff5
jmp 0x1459c
cmpl $0x4d, %r12d
je 0x14292
cmpl $0x55, %r12d
jne 0x143d5
callq 0x5330
movq (%rax), %rax
xorl %r15d, %r15d
cmpl $0x77, (%rax,%r12,4)
sete %r14b
movl 0x1bfb0(%rip), %edx     # 0x2fff4
movl $0x1, %edi
movl $0x1, %esi
callq 0xab15
movslq 0x1bf92(%rip), %rcx     # 0x2ffec
xorl %edx, %edx
cmpq $0x3, %rcx
jl 0x1409a
movl 0x1bf8c(%rip), %esi     # 0x2fff4
testb $0x3, %sil
jne 0x1409a
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 0x1409a
rorl $0x4, %esi
xorl %edx, %edx
cmpl $0xa3d70b, %esi         # imm = 0xA3D70B
setb %dl
movb %r14b, %r15b
leaq 0x19544(%rip), %rsi     # 0x2d5e8
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,%r15), %eax
addl $0xe, %eax
movzbl %al, %r15d
leal (%r15,%r15,8), %eax
leal (%r15,%rax,4), %eax
shrl $0x8, %eax
movl %r15d, %esi
subb %al, %sil
shrb %sil
addb %al, %sil
shrb $0x2, %sil
movzbl %sil, %eax
leal (,%rax,8), %esi
subl %eax, %esi
subb %sil, %r15b
movl %r15d, %eax
notb %al
movsbl %al, %eax
leaq 0x150b3(%rip), %rsi     # 0x291d0
movswl -0x2(%rsi,%rcx,2), %ecx
addl %eax, %ecx
addl %edx, %ecx
movl 0x1bec4(%rip), %eax     # 0x2fff0
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,%r12,2), %eax
shrl $0x9, %eax
testb %r15b, %r15b
setne %cl
andb %al, %cl
movzbl %cl, %r15d
addl %r14d, %r15d
cmpl $0x0, 0x4(%rsp)
leaq 0xf461(%rip), %rsi      # 0x235e2
leaq 0xc162(%rip), %rax      # 0x202ea
cmoveq %rax, %rsi
movq 0x20(%rsp), %r14
jmp 0x14669
leaq 0x1a677(%rip), %rax     # 0x2e814
movslq (%rax), %rax
movl 0x1be46(%rip), %ecx     # 0x2ffec
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 0x14dc7(%rip), %rax     # 0x28fa8
movq (%rax,%rcx,8), %rsi
movq %r14, %rdi
callq 0x50a0
cmpb $0x62, %r13b
jne 0x14676
movb $0x0, 0x3(%r14)
jmp 0x14676
cmpl $0x57, %r12d
je 0x1450f
cmpl $0x59, %r12d
jne 0x143d5
cmpl $0x0, (%rsp)
je 0x145e6
testl %ebp, %ebp
je 0x14576
movq 0x8(%rsp), %rax
movl %eax, %edx
imull %ebp, %edx
addl 0x1bdbd(%rip), %edx     # 0x2fff4
movl %edx, 0x1bdb7(%rip)     # 0x2fff4
movslq 0x1bda8(%rip), %rax     # 0x2ffec
xorl %ecx, %ecx
cmpq $0x2, %rax
jne 0x1427f
movl %edx, %esi
andl $0x3, %esi
jne 0x1427f
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 0x1427f
rorl $0x4, %edx
xorl %ecx, %ecx
cmpl $0xa3d70b, %edx         # imm = 0xA3D70B
setb %cl
leaq 0x14f3a(%rip), %rdx     # 0x291c0
movsbl -0x1(%rax,%rdx), %eax
addl %ecx, %eax
jmp 0x1438e
cmpl $0x0, (%rsp)
je 0x143ac
testl %ebp, %ebp
je 0x143ac
movq 0x8(%rsp), %rax
imull %ebp, %eax
addl 0x1bd3a(%rip), %eax     # 0x2ffec
movl %eax, 0x1bd34(%rip)     # 0x2ffec
movl 0x1bd36(%rip), %ecx     # 0x2fff4
cmpl $0xd, %eax
jl 0x14301
cmpl $0x18, %eax
movl $0x18, %edx
cmovbl %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, 0x1bcf1(%rip)     # 0x2ffec
movl %ecx, 0x1bcf3(%rip)     # 0x2fff4
testl %eax, %eax
jg 0x14345
cmpl $-0xa, %eax
movl $0xfffffff5, %edx       # imm = 0xFFFFFFF5
cmovgel %eax, %edx
xorl %esi, %esi
cmpl $-0xb, %eax
setl %sil
subl %eax, %edx
subl %esi, %edx
movl $0xaaaaaaab, %edi       # imm = 0xAAAAAAAB
imulq %rdi, %rdx
shrq $0x23, %rdx
addl %esi, %edx
leal (%rdx,%rdx,2), %esi
leal (%rax,%rsi,4), %eax
addl $0xc, %eax
notl %edx
addl %edx, %ecx
movl %eax, 0x1bcad(%rip)     # 0x2ffec
movl %ecx, 0x1bcaf(%rip)     # 0x2fff4
xorl %edx, %edx
cmpl $0x2, %eax
jne 0x1437f
movl %ecx, %esi
andl $0x3, %esi
jne 0x1437f
imull $0xc28f5c29, %ecx, %ecx # imm = 0xC28F5C29
addl $0x51eb850, %ecx        # imm = 0x51EB850
movl %ecx, %esi
rorl $0x2, %esi
movl $0x1, %edx
cmpl $0x28f5c28, %esi        # imm = 0x28F5C28
ja 0x1437f
rorl $0x4, %ecx
xorl %edx, %edx
cmpl $0xa3d70b, %ecx         # imm = 0xA3D70B
setb %dl
decl %eax
leaq 0x14e38(%rip), %rcx     # 0x291c0
movsbl (%rcx,%rax), %eax
addl %edx, %eax
movl $0x1, (%rsp)
cmpl %eax, 0x1bc55(%rip)     # 0x2fff0
jle 0x14676
movl %eax, 0x1bc49(%rip)     # 0x2fff0
jmp 0x14676
movl 0x1bc12(%rip), %eax     # 0x2ffc4
movl %eax, 0x1bc34(%rip)     # 0x2ffec
movl 0x1bc2a(%rip), %eax     # 0x2ffe8
movl %eax, 0x1bc2c(%rip)     # 0x2fff0
movl 0x1bbfe(%rip), %eax     # 0x2ffc8
movl %eax, 0x1bc24(%rip)     # 0x2fff4
jmp 0x14676
movb %r13b, (%r14)
movb $0x0, 0x1(%r14)
jmp 0x14676
movl 0x1bc04(%rip), %eax     # 0x2ffec
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 0x1444c
movl 0x1bbd7(%rip), %eax     # 0x2fff4
testb $0x3, %al
je 0x145a8
movslq 0x1bbc0(%rip), %rax     # 0x2ffec
leaq 0x14d9d(%rip), %rcx     # 0x291d0
movzwl -0x2(%rcx,%rax,2), %ecx
xorl %eax, %eax
movl $0x16d, %r15d           # imm = 0x16D
jmp 0x14643
movl 0x1bba4(%rip), %r15d    # 0x2fff0
cmpl $0x0, 0x4(%rsp)
leaq 0xf18a(%rip), %rsi      # 0x235e2
jmp 0x1465e
movslq 0x1bb88(%rip), %rax     # 0x2ffec
xorl %ecx, %ecx
cmpq $0x3, %rax
jl 0x144a3
movl 0x1bb82(%rip), %edx     # 0x2fff4
testb $0x3, %dl
jne 0x144a3
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 0x144a3
rorl $0x4, %edx
xorl %ecx, %ecx
cmpl $0xa3d70b, %edx         # imm = 0xA3D70B
setb %cl
leaq 0x14d26(%rip), %rdx     # 0x291d0
movswl -0x2(%rdx,%rax,2), %r15d
addl %ecx, %r15d
addl 0x1bb36(%rip), %r15d    # 0x2fff0
jmp 0x14652
movl 0x1bb2f(%rip), %eax     # 0x2fff4
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 0xf0f2(%rip), %rsi      # 0x235e2
jmp 0x1466c
movl $0x1, 0x1c(%rsp)
jmp 0x14676
movl $0x1, 0x4(%rsp)
jmp 0x14676
cmpl $0x0, (%rsp)
je 0x1402a
testl %ebp, %ebp
je 0x14576
movq 0x8(%rsp), %rax
imull %ebp, %eax
leal (,%rax,8), %ecx
subl %eax, %ecx
movl 0x1bab8(%rip), %eax     # 0x2ffec
addl 0x1bab6(%rip), %ecx     # 0x2fff0
movl %eax, 0x10(%rsp)
movl %ecx, 0x14(%rsp)
movl 0x1baac(%rip), %eax     # 0x2fff4
movl %eax, 0x18(%rsp)
leaq 0x10(%rsp), %rdi
callq 0xa792
movl 0x10(%rsp), %eax
movl 0x14(%rsp), %ecx
movl %eax, 0x1ba88(%rip)     # 0x2ffec
movl %ecx, 0x1ba86(%rip)     # 0x2fff0
movl 0x18(%rsp), %eax
movl %eax, 0x1ba80(%rip)     # 0x2fff4
jmp 0x1459c
movl 0x1ba48(%rip), %eax     # 0x2ffc4
movl %eax, 0x1ba6a(%rip)     # 0x2ffec
movl 0x1ba60(%rip), %eax     # 0x2ffe8
movl %eax, 0x1ba62(%rip)     # 0x2fff0
movl 0x1ba34(%rip), %eax     # 0x2ffc8
movl %eax, 0x1ba5a(%rip)     # 0x2fff4
xorl %ebp, %ebp
movl $0x1, (%rsp)
jmp 0x14676
imull $0xc28f5c29, %eax, %edx # imm = 0xC28F5C29
addl $0x51eb850, %edx        # imm = 0x51EB850
movl %edx, %eax
rorl $0x2, %eax
cmpl $0x28f5c28, %eax        # imm = 0x28F5C28
jbe 0x14605
movslq 0x1ba25(%rip), %rcx     # 0x2ffec
xorl %eax, %eax
cmpq $0x3, %rcx
setge %al
leaq 0x14bf9(%rip), %rdx     # 0x291d0
movzwl -0x2(%rdx,%rcx,2), %ecx
negl %eax
movl $0x16e, %r15d           # imm = 0x16E
jmp 0x14643
movl 0x1ba07(%rip), %r15d    # 0x2fff4
addl 0x8(%rsp), %r15d
movl $0x0, (%rsp)
movq %r14, %rdi
leaq 0xbce7(%rip), %rsi      # 0x202ea
jmp 0x1466c
rorl $0x4, %edx
xorl %eax, %eax
cmpl $0xa3d70b, %edx         # imm = 0xA3D70B
movl $0x0, %r15d
adcl $0x16d, %r15d           # imm = 0x16D
movslq 0x1b9c8(%rip), %rsi     # 0x2ffec
leaq 0x14ba5(%rip), %rcx     # 0x291d0
movzwl -0x2(%rcx,%rsi,2), %ecx
cmpq $0x3, %rsi
jl 0x14643
cmpl $0xa3d70b, %edx         # imm = 0xA3D70B
movl $0x0, %eax
sbbl %eax, %eax
addl %eax, %r15d
movswl %cx, %eax
addl 0x1b9a1(%rip), %eax     # 0x2fff0
subl %eax, %r15d
cmpl $0x0, 0x4(%rsp)
leaq 0xeef4(%rip), %rsi      # 0x23552
leaq 0xbc85(%rip), %rax      # 0x202ea
cmoveq %rax, %rsi
movq %r14, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x52f0
movsbl %r13b, %esi
movl $0x5, %edx
leaq 0xeec7(%rip), %rdi      # 0x2354d
callq 0x51e0
testq %rax, %rax
jne 0x13e85
cmpl $0x0, 0x1c(%rsp)
je 0x14702
testl %r15d, %r15d
js 0x14702
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 0x1535c(%rip), %rcx     # 0x29a40
movq (%rcx,%rax), %rsi
leaq 0x1b9d9(%rip), %r15     # 0x300c8
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