// File: /workspace/github_cpp_makefile_star2_O2/afborchert[P]fmt/./printf.hpp
// Function: fmt::impl::format_segment<char> fmt::impl::parse_format_segment<char>(char 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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
xorl %eax, %eax
movb %al, (%rdi)
andq $0x0, 0x28(%rdi)
andw $0x0, 0x30(%rdi)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x8(%rdi)
movdqu %xmm0, 0x16(%rdi)
movdqu %xmm0, 0x38(%rdi)
orq $-0x1, 0x58(%rdi)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x48(%rdi)
movb %al, 0x60(%rdi)
testq %rsi, %rsi
je 0xb837
movq %rdx, %r14
movq %rsi, %r15
leaq 0x8(%rbx), %rax
leaq 0x38(%rbx), %r12
movq %rsi, (%rax)
incq %r15
movzbl -0x1(%r15), %eax
testl %eax, %eax
je 0xb43c
cmpl $0x25, %eax
je 0xb43c
movq %r15, 0x8(%rsp)
jmp 0xb424
leaq -0x1(%r15), %rcx
movq %rcx, 0x10(%rbx)
testb %al, %al
je 0xb46d
movq %r15, 0x8(%rsp)
movzbl (%r15), %edx
testl %edx, %edx
je 0xb837
cmpl $0x25, %edx
jne 0xb475
movb $0x1, (%rbx)
movq %r15, 0x10(%rbx)
incq %r15
jmp 0xb833
movb $0x1, (%rbx)
jmp 0xb837
leal -0x31(%rdx), %eax
xorl %ecx, %ecx
cmpb $0x8, %al
ja 0xb4be
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0xbbb5
testb %al, %al
je 0xb4ad
movq 0x8(%rsp), %rax
cmpb $0x24, (%rax)
jne 0xb4ad
movq 0x18(%rsp), %rcx
decq %rcx
movq %rcx, 0x58(%rbx)
incq %rax
movq %rax, %r15
movq %r15, 0x8(%rsp)
movb (%r15), %dl
movzwl 0x24(%rbx), %eax
movl 0x20(%rbx), %ecx
jmp 0xb4c0
xorl %eax, %eax
incq %r15
leaq 0x2ec72(%rip), %rsi     # 0x3a13c
movzbl %dl, %edi
leal -0x27(%rdi), %r8d
cmpl $0x9, %r8d
ja 0xb4e7
movslq (%rsi,%r8,4), %rdi
addq %rsi, %rdi
jmpq *%rdi
orl $0x2000, %eax           # imm = 0x2000
jmp 0xb52c
cmpl $0x20, %edi
je 0xb529
cmpl $0x23, %edi
jne 0xb53d
orl $0x1000, %eax           # imm = 0x1000
movw %ax, 0x24(%rbx)
orl $0x600, %ecx            # imm = 0x600
jmp 0xb524
orl $0x800, %eax            # imm = 0x800
movw %ax, 0x24(%rbx)
orl $0x20, %ecx
jmp 0xb524
orl $0x400, %eax            # imm = 0x400
jmp 0xb52c
orl $0x40, %eax
movw %ax, 0x24(%rbx)
orl $0x800, %ecx            # imm = 0x800
movl %ecx, 0x20(%rbx)
jmp 0xb530
orl $0x20, %eax
movw %ax, 0x24(%rbx)
movq %r15, 0x8(%rsp)
movb (%r15), %dl
incq %r15
jmp 0xb4ca
movl %eax, %ecx
notl %ecx
movl %eax, %esi
andl $0xfffffbff, %esi       # imm = 0xFFFFFBFF
testw $0xc00, %cx             # imm = 0xC00
sete %cl
cmovnel %eax, %esi
movl %esi, %edi
notl %edi
movl %esi, %eax
andl $-0x21, %eax
testb $0x60, %dil
sete %dil
cmovnel %esi, %eax
orb %cl, %dil
cmpb $0x1, %dil
jne 0xb575
movw %ax, 0x24(%rbx)
andq $0x0, 0x18(%rsp)
cmpb $0x2a, %dl
jne 0xb5dc
orl $0x80, %eax
movw %ax, 0x24(%rbx)
movq %r15, 0x8(%rsp)
movb (%r15), %al
leal -0x31(%rax), %ecx
cmpb $0x8, %cl
ja 0xb606
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xbbb5
testb %al, %al
je 0xb837
movq 0x8(%rsp), %rax
cmpb $0x24, (%rax)
jne 0xb837
leaq 0x1(%rax), %r15
movq %r15, 0x8(%rsp)
movb 0x1(%rax), %al
movq 0x10(%rsp), %rcx
decq %rcx
movq %rcx, 0x48(%rbx)
movzwl 0x30(%rbx), %ecx
jmp 0xb614
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0xbbb5
testb %al, %al
je 0xb837
movq 0x8(%rsp), %r15
movb (%r15), %al
movq 0x18(%rsp), %rcx
movq %rcx, (%r12)
jmp 0xb61a
movzwl 0x30(%rbx), %ecx
movq %rcx, %rdx
addq %r14, %rdx
movq %rdx, 0x48(%rbx)
incl %ecx
movw %cx, 0x30(%rbx)
cmpb $0x2e, %al
jne 0xb708
movl 0x24(%rbx), %edx
movl %edx, %eax
orl $0x100, %eax            # imm = 0x100
movw %ax, 0x24(%rbx)
leaq 0x1(%r15), %rcx
movq %rcx, 0x8(%rsp)
movb 0x1(%r15), %al
andq $0x0, 0x10(%rsp)
cmpb $0x2a, %al
jne 0xb6a9
orl $0x300, %edx            # imm = 0x300
movw %dx, 0x24(%rbx)
leaq 0x2(%r15), %rcx
movq %rcx, 0x8(%rsp)
movb 0x2(%r15), %al
leal -0x31(%rax), %edx
cmpb $0x8, %dl
ja 0xb6d6
leaq 0x8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0xbbb5
testb %al, %al
je 0xb837
movq 0x8(%rsp), %rax
cmpb $0x24, (%rax)
jne 0xb837
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rsp)
movb 0x1(%rax), %al
movq 0x20(%rsp), %rdx
decq %rdx
movq %rdx, 0x50(%rbx)
movzwl 0x30(%rbx), %edx
jmp 0xb6e4
leal -0x30(%rax), %edx
cmpb $0x9, %dl
ja 0xb6ec
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xbbb5
testb %al, %al
je 0xb837
movq 0x8(%rsp), %rcx
movb (%rcx), %al
movq 0x10(%rsp), %rdx
jmp 0xb6ee
movzwl 0x30(%rbx), %edx
movq %rdx, %rsi
addq %r14, %rsi
movq %rsi, 0x50(%rbx)
incl %edx
movw %dx, 0x30(%rbx)
jmp 0xb6f2
xorl %edx, %edx
movq %rdx, 0x40(%rbx)
movq %rcx, %r15
movl 0x24(%rbx), %ecx
btl $0xa, %ecx
jae 0xb708
andl $0xfbff, %ecx           # imm = 0xFBFF
movw %cx, 0x24(%rbx)
incq %r15
movabsq $0x410150000001, %rcx   # imm = 0x410150000001
movzbl %al, %eax
leal -0x4c(%rax), %edx
cmpl $0x2e, %edx
ja 0xb733
btq %rdx, %rcx
jae 0xb733
movq %r15, 0x8(%rsp)
movb (%r15), %al
incq %r15
jmp 0xb715
movb %al, 0x60(%rbx)
leal -0x58(%rax), %ecx
cmpl $0x20, %ecx
ja 0xb758
leaq 0x2ea3b(%rip), %rax     # 0x3a180
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
orb $0x40, 0x21(%rbx)
orb $0x4, 0x24(%rbx)
jmp 0xb7cb
leal -0x41(%rax), %ecx
cmpl $0x6, %ecx
ja 0xb783
leaq 0x2e9fd(%rip), %rax     # 0x3a164
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
orl $0x4104, 0x20(%rbx)     # imm = 0x4104
orb $0x10, 0x24(%rbx)
jmp 0xb7cb
orb $0x2, 0x24(%rbx)
jmp 0xb7f4
cmpl $0x53, %eax
jne 0xb837
orb $0x1, 0x20(%rbx)
jmp 0xb7f4
orb $0x8, 0x24(%rbx)
orb $0x4, 0x24(%rbx)
jmp 0xb7ec
orb $0x4, 0x20(%rbx)
jmp 0xb7ec
movq $0x10, 0x28(%rbx)
orb $0x1, 0x24(%rbx)
jmp 0xb7f4
orb $0x1, 0x21(%rbx)
jmp 0xb7ec
orb $0x4, 0x24(%rbx)
movq $0x8, 0x28(%rbx)
jmp 0xb7f4
orl $0x104, 0x20(%rbx)      # imm = 0x104
movq $0x10, 0x28(%rbx)
jmp 0xb7f4
orb $0x40, 0x21(%rbx)
jmp 0xb7e8
orl $0x4004, 0x20(%rbx)     # imm = 0x4004
jmp 0xb7e8
orb $0x41, 0x21(%rbx)
orb $0x10, 0x24(%rbx)
movq $0xa, 0x28(%rbx)
movl 0x24(%rbx), %eax
btl $0xd, %eax
jae 0xb80d
cmpq $0xa, 0x28(%rbx)
je 0xb80d
andl $0xdfff, %eax           # imm = 0xDFFF
movw %ax, 0x24(%rbx)
movb $0x1, (%rbx)
cmpq $0x0, 0x58(%rbx)
movzwl 0x30(%rbx), %eax
jns 0xb822
addq %rax, %r14
movq %r14, 0x58(%rbx)
incl %eax
movw %ax, 0x30(%rbx)
movq %r15, 0x8(%rsp)
cmpb $0x0, (%r15)
je 0xb837
movq %r15, 0x18(%rbx)
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq