// File: /workspace/github_cpp_makefile_star2_O3/afborchert[P]fmt/./printf.hpp
// Function: fmt::impl::format_segment<wchar_t> fmt::impl::parse_format_segment<wchar_t>(wchar_t const*, long)
inline format_segment<CharT>
parse_format_segment(const CharT* format, integer arg_index) {
   format_segment<CharT> result;
   if (!format) return result;

   /* skip everything until we encounter a placeholder
      or the end of the format string */
   result.beginp = format;
   CharT ch = *format;
   while (ch && ch != '%') {
      ch = *++format;
   }
   result.endp = format;

   /* end of format string reached? */
   if (!ch) {
      result.valid = true;
      return result;
   }

   ch = *++format;
   if (!ch) return result; /* format ends with '%' */

   /* process %% */
   if (ch == '%') {
      result.valid = true;
      ++result.endp; /* include first '%' */
      result.nextp = format+1;
      return result;
   }

   /* check if we have an argument index */
   if (ch >= '1' && ch <= '9') {
      const CharT* begin = format;
      integer index;
      if (parse_integer(format, index) && *format == '$') {
	 /* accept argument index */
	 result.value_index = index - 1;
	 ch = *++format;
      } else {
	 /* reset parsing */
	 format = begin; ch = *format;
      }
   }

   /* process conversion flags */
   while (ch == '\'' || ch == '-' || ch == '0' || ch == '+' ||
	 ch == ' ' || ch == '#') {
      switch (ch) {
	 case '\'':
	    result.flags |= grouping_flag;
	    break;
	 case '-':
	    result.flags |= minus_flag;
	    result.fmtflags |= std::ios_base::left;
	    break;
	 case '0': result.flags |= zero_fill; break;
	 case '+':
	    result.flags |= plus_flag;
	    result.fmtflags |= std::ios_base::showpos;
	    break;
	 case ' ': result.flags |= space_flag; break;
	 case '#':
	    result.flags |= special_flag;
	    result.fmtflags |= (std::ios_base::showbase |
	       std::ios_base::showpoint);
	    break;
      }
      ch = *++format;
   }

   if ((result.flags & minus_flag) && (result.flags & zero_fill)) {
      /* if the 0 and - flags both appear, the 0 flag is ignored */
      result.flags &= ~zero_fill;
   }
   if ((result.flags & plus_flag) && (result.flags & space_flag)) {
      /* if the ' ' and '+' flags both appear,
	 the <space> flag shall be ignored */
      result.flags &= ~space_flag;
   }
   /* minimum field width */
   std::streamsize width = 0;
   if (ch == '*') {
      result.flags |= dyn_width; ch = *++format;
      if (ch >= '1' && ch <= '9') {
	 integer index;
	 if (!parse_integer(format, index) || *format != '$') return result;
	 ch = *++format;
	 result.width_index = index - 1;
      } else {
	 result.width_index = arg_index + result.nof_args;
      }
      result.nof_args++;
   } else {
      if (!parse_integer(format, width)) return result;
      ch = *format;
      result.width = width;
   }
   /* precision */
   if (ch == '.') {
      result.flags |= precision;
      ch = *++format;
      std::streamsize precision = 0;
      if (ch == '*') {
	 result.flags |= dyn_precision; ch = *++format;
	 if (ch >= '1' && ch <= '9') {
	    integer index;
	    if (!parse_integer(format, index) || *format != '$') return result;
	    ch = *++format;
	    result.precision_index = index - 1;
	 } else {
	    result.precision_index = arg_index + result.nof_args;
	 }
	 result.nof_args++;
      } else {
	 if (ch >= '0' && ch <= '9') {
	    if (!parse_integer(format, precision)) return result;
	    ch = *format;
	 }
	 result.precision = precision;
      }
      if (result.flags & zero_fill) {
	 /* if a precision is specified, the 0 flag is ignored */
	 result.flags &= ~zero_fill;
      }
   }
   /* skip size specification */
   while (ch == 'l' || ch == 'L' || ch == 'h' ||
	 ch == 'j' || ch == 'z' || ch == 't') {
      ch = *++format;
   }
   /* conversion operation */
   result.conversion = ch;
   switch (ch) {
      case 'u':
	 result.flags |= is_unsigned;
	 FMT_PRINTF_FALLTHROUGH
      case 'd':
      case 'i':
	 result.flags |= is_integer;
	 result.base = 10;
	 break;
      case 'o':
	 result.flags |= is_integer;
	 result.base = 8;
	 break;
      case 'x':
	 result.flags |= is_integer;
	 result.base = 16;
	 break;
      case 'X':
	 result.fmtflags |= std::ios_base::uppercase;
	 result.flags |= is_integer;
	 result.base = 16;
	 break;
      case 'f':
	 result.fmtflags |= std::ios_base::fixed;
	 result.base = 10;
	 break;
      case 'F':
	 result.fmtflags |= (std::ios_base::fixed | std::ios_base::uppercase);
	 result.flags |= toupper;
	 result.base = 10;
	 break;
      case 'e':
	 result.fmtflags |= std::ios_base::scientific;
	 result.base = 10;
	 break;
      case 'E':
	 result.fmtflags |=
	    std::ios_base::scientific | std::ios_base::uppercase;
	 result.flags |= toupper;
	 result.base = 10;
	 break;
      case 'g':
	 /* default behaviour */
	 result.base = 10;
	 break;
      case 'G':
	 result.fmtflags |= std::ios_base::uppercase;
	 result.flags |= toupper;
	 result.base = 10;
	 break;
      case 'a':
	 result.fmtflags |= std::ios_base::scientific | std::ios_base::fixed;
	 result.base = 16;
	 break;
      case 'A':
	 result.fmtflags |= std::ios_base::scientific |
	    std::ios_base::fixed | std::ios_base::uppercase;
	 result.flags |= toupper;
	 result.base = 16;
	 break;
      case 'p':
	 result.base = 16;
	 result.flags |= is_pointer;
	 break;
      case 'C':
	 /* POSIX extension, equivalent to 'lc' */
      case 'c':
	 result.flags |= is_charval;
	 break;
      case 'S':
	 /* POSIX extension, equivalent to 'ls' */
      case 's':
	 /* when boolean values are printed with %s, we get
	    more readable results; idea taken from N3506 */
	 result.fmtflags |= std::ios_base::boolalpha;
	 break;
      case 'n':
	 /* nothing to be done here */
	 break;
      default:
	 return result;
   }
   if ((result.flags & grouping_flag) && (result.base != 10)) {
      /* grouping is just supported for %i, %d, %u, %f, %F,
         %g, and %G, i.e. all cases with base == 10 */
      result.flags &= ~grouping_flag;
   }
   result.valid = true;
   if (result.value_index < 0) {
      result.value_index = arg_index + result.nof_args;
   }
   result.nof_args++;
   ch = *++format;
   if (ch) {
      result.nextp = format;
   }
   return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rax
movb $0x0, (%rdi)
movq $0x0, 0x28(%rdi)
movw $0x0, 0x30(%rdi)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x8(%rdi)
movdqu %xmm0, 0x16(%rdi)
movdqu %xmm0, 0x38(%rdi)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x48(%rdi)
movq $-0x1, 0x58(%rdi)
movl $0x0, 0x60(%rdi)
testq %rsi, %rsi
je 0xf9ad
leaq 0x8(%rax), %rcx
leaq 0x38(%rax), %r11
movq %rsi, (%rcx)
addq $0x4, %rsi
movl -0x4(%rsi), %ecx
testl %ecx, %ecx
je 0xf527
cmpl $0x25, %ecx
jne 0xf517
leaq -0x4(%rsi), %rdi
movq %rdi, 0x10(%rax)
testl %ecx, %ecx
je 0xf555
movl (%rsi), %r8d
testl %r8d, %r8d
je 0xf9ad
cmpl $0x25, %r8d
jne 0xf55d
movb $0x1, (%rax)
movq %rsi, 0x10(%rax)
addq $0x4, %rsi
jmp 0xf9a9
movb $0x1, (%rax)
jmp 0xf9ad
movabsq $0x7fffffffffffffff, %r9 # imm = 0x7FFFFFFFFFFFFFFF
movabsq $0xccccccccccccccc, %r10 # imm = 0xCCCCCCCCCCCCCCC
leal -0x31(%r8), %edi
movb $0x1, %cl
cmpl $0x8, %edi
ja 0xf5cd
leaq 0x4(%rsi), %rdi
xorl %ebx, %ebx
movl %r8d, %r14d
cmpq %r10, %rbx
jg 0xf5cd
addl $-0x30, %r14d
addq %rbx, %rbx
leaq (%rbx,%rbx,4), %rbx
movq %r14, %r15
xorq %r9, %r15
cmpq %r15, %rbx
jg 0xf5cd
addq %r14, %rbx
movl (%rdi), %r14d
leal -0x3a(%r14), %ebp
addq $0x4, %rdi
cmpl $-0xb, %ebp
ja 0xf585
cmpl $0x24, %r14d
jne 0xf5cd
leaq -0x1(%rbx), %rcx
movq %rcx, 0x58(%rax)
movl (%rdi), %r8d
testq %rbx, %rbx
setle %cl
movq %rdi, %rsi
movzwl 0x24(%rax), %r15d
movl 0x20(%rax), %ebp
addq $0x4, %rsi
xorl %edi, %edi
leaq 0x35c42(%rip), %rbx     # 0x45224
xorl %r14d, %r14d
leal -0x27(%r8), %r12d
cmpl $0x9, %r12d
ja 0xf602
movslq (%rbx,%r12,4), %r12
addq %rbx, %r12
jmpq *%r12
orl $0x2000, %r14d          # imm = 0x2000
jmp 0xf644
cmpl $0x20, %r8d
je 0xf640
cmpl $0x23, %r8d
jne 0xf650
orl $0x1000, %r14d          # imm = 0x1000
orl $0x600, %edi            # imm = 0x600
jmp 0xf63c
orl $0x800, %r14d           # imm = 0x800
orl $0x20, %edi
jmp 0xf63c
orl $0x400, %r14d           # imm = 0x400
jmp 0xf644
orl $0x40, %r14d
orl $0x800, %edi            # imm = 0x800
movl %edi, %ebp
jmp 0xf644
orl $0x20, %r14d
movl %r14d, %r15d
movl (%rsi), %r8d
addq $0x4, %rsi
jmp 0xf5e5
movw %r15w, 0x24(%rax)
movl %ebp, 0x20(%rax)
movl %r14d, %ebx
notl %ebx
movl %r14d, %ebp
andl $0xfffffbff, %ebp       # imm = 0xFFFFFBFF
testl $0xc00, %ebx            # imm = 0xC00
sete %r15b
cmovnel %r14d, %ebp
movl %ebp, %r14d
notl %r14d
movl %ebp, %ebx
andl $-0x21, %ebx
testb $0x60, %r14b
sete %r14b
cmovnel %ebp, %ebx
orb %r15b, %r14b
cmpb $0x1, %r14b
jne 0xf697
movw %bx, 0x24(%rax)
cmpl $0x2a, %r8d
jne 0xf707
orl $0x80, %ebx
movw %bx, 0x24(%rax)
movl (%rsi), %r8d
leal -0x31(%r8), %r11d
cmpl $0x8, %r11d
ja 0xf756
addq $0x4, %rsi
xorl %r11d, %r11d
cmpq %r10, %r11
jg 0xf9ad
addl $-0x30, %r8d
addq %r11, %r11
leaq (%r11,%r11,4), %r11
movq %r8, %r14
xorq %r9, %r14
cmpq %r14, %r11
jg 0xf9ad
addq %r8, %r11
movl (%rsi), %r8d
leal -0x3a(%r8), %ebp
addq $0x4, %rsi
cmpl $-0xb, %ebp
ja 0xf6bf
cmpl $0x24, %r8d
jne 0xf9ad
movl (%rsi), %r8d
decq %r11
jmp 0xf759
addq $-0x4, %rsi
leal -0x3a(%r8), %ebp
xorl %r14d, %r14d
cmpl $-0xa, %ebp
jb 0xf74e
cmpq %r10, %r14
jg 0xf9ad
addl $-0x30, %r8d
addq %r14, %r14
leaq (%r14,%r14,4), %r14
movq %r8, %r15
xorq %r9, %r15
cmpq %r15, %r14
jg 0xf9ad
addq %r8, %r14
movl 0x4(%rsi), %r8d
addq $0x4, %rsi
leal -0x3a(%r8), %ebp
cmpl $-0xb, %ebp
ja 0xf717
movq %r14, (%r11)
xorl %r11d, %r11d
jmp 0xf768
movq %rdx, %r11
movq %r11, 0x48(%rax)
movw $0x1, 0x30(%rax)
movw $0x1, %r11w
cmpl $0x2e, %r8d
jne 0xf86f
movl %ebx, %ebp
orl $0x100, %ebp            # imm = 0x100
movw %bp, 0x24(%rax)
movl 0x4(%rsi), %r8d
cmpl $0x2a, %r8d
jne 0xf7f8
orl $0x300, %ebx            # imm = 0x300
movl %ebx, %ebp
movw %bx, 0x24(%rax)
movl 0x8(%rsi), %r8d
leal -0x31(%r8), %ebx
movzwl %r11w, %r11d
cmpl $0x8, %ebx
ja 0xf841
addq $0xc, %rsi
xorl %ebx, %ebx
cmpq %r10, %rbx
jg 0xf9ad
addl $-0x30, %r8d
addq %rbx, %rbx
leaq (%rbx,%rbx,4), %rbx
movq %r8, %r14
xorq %r9, %r14
cmpq %r14, %rbx
jg 0xf9ad
addq %r8, %rbx
movl (%rsi), %r8d
leal -0x3a(%r8), %r14d
addq $0x4, %rsi
cmpl $-0xb, %r14d
ja 0xf7af
cmpl $0x24, %r8d
jne 0xf9ad
movl (%rsi), %r8d
decq %rbx
jmp 0xf849
addq $0x4, %rsi
leal -0x30(%r8), %ebx
cmpl $0x9, %ebx
ja 0xf857
xorl %ebx, %ebx
cmpq %r10, %rbx
jg 0xf9ad
addl $-0x30, %r8d
addq %rbx, %rbx
leaq (%rbx,%rbx,4), %rbx
movq %r8, %r14
xorq %r9, %r14
cmpq %r14, %rbx
jg 0xf9ad
addq %r8, %rbx
movl 0x4(%rsi), %r8d
addq $0x4, %rsi
leal -0x3a(%r8), %r14d
cmpl $-0xb, %r14d
ja 0xf807
jmp 0xf859
addq $0x8, %rsi
leaq (%r11,%rdx), %rbx
movq %rbx, 0x50(%rax)
incl %r11d
movw %r11w, 0x30(%rax)
jmp 0xf85d
xorl %ebx, %ebx
movq %rbx, 0x40(%rax)
btl $0xa, %ebp
jae 0xf86d
andl $0xfbff, %ebp           # imm = 0xFBFF
movw %bp, 0x24(%rax)
movl %ebp, %ebx
addq $0x4, %rsi
movabsq $0x410150000001, %r9    # imm = 0x410150000001
leal -0x4c(%r8), %r10d
cmpl $0x2e, %r10d
ja 0xf896
btq %r10, %r9
jae 0xf896
movl (%rsi), %r8d
addq $0x4, %rsi
jmp 0xf87d
movl %r8d, 0x60(%rax)
leal -0x58(%r8), %r9d
cmpl $0x20, %r9d
ja 0xf8c3
leaq 0x359bd(%rip), %r8      # 0x45268
movslq (%r8,%r9,4), %r9
addq %r8, %r9
jmpq *%r9
orl $0x4000, %edi           # imm = 0x4000
movl %edi, 0x20(%rax)
orl $0x4, %ebx
jmp 0xf8ea
leal -0x41(%r8), %r9d
cmpl $0x6, %r9d
ja 0xf8f5
leaq 0x35978(%rip), %r8      # 0x4524c
movslq (%r8,%r9,4), %r9
addq %r8, %r9
jmpq *%r9
orl $0x4104, %edi           # imm = 0x4104
movl %edi, 0x20(%rax)
orl $0x10, %ebx
movw %bx, 0x24(%rax)
jmp 0xf94a
orl $0x2, %ebx
jmp 0xf91f
cmpl $0x53, %r8d
jne 0xf9ad
orl $0x1, %edi
movl %edi, 0x20(%rax)
jmp 0xf952
orl $0x8, %ebx
orl $0x4, %ebx
jmp 0xf980
orl $0x4, %edi
jmp 0xf92b
movq $0x10, 0x28(%rax)
orl $0x1, %ebx
movw %bx, 0x24(%rax)
jmp 0xf952
orl $0x100, %edi            # imm = 0x100
movl %edi, 0x20(%rax)
jmp 0xf984
orl $0x4, %ebx
movw %bx, 0x24(%rax)
movq $0x8, 0x28(%rax)
jmp 0xf952
orl $0x104, %edi            # imm = 0x104
movl %edi, 0x20(%rax)
movq $0x10, 0x28(%rax)
btl $0xd, %ebx
jae 0xf98c
andl $0xdfff, %ebx           # imm = 0xDFFF
movw %bx, 0x24(%rax)
jmp 0xf98c
orl $0x4000, %edi           # imm = 0x4000
jmp 0xf97a
orl $0x4004, %edi           # imm = 0x4004
jmp 0xf97a
orl $0x4100, %edi           # imm = 0x4100
movl %edi, 0x20(%rax)
orl $0x10, %ebx
movw %bx, 0x24(%rax)
movq $0xa, 0x28(%rax)
movb $0x1, (%rax)
movzwl %r11w, %edi
testb %cl, %cl
je 0xf99e
addq %rdi, %rdx
movq %rdx, 0x58(%rax)
incl %edi
movw %di, 0x30(%rax)
cmpl $0x0, (%rsi)
je 0xf9ad
movq %rsi, 0x18(%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq