// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rax
xorl %ecx, %ecx
movb %cl, (%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)
movb %cl, 0x60(%rdi)
testq %rsi, %rsi
je 0xdbb0
leaq 0x8(%rax), %rcx
leaq 0x38(%rax), %r10
leaq 0x48(%rax), %r9
movq %rsi, (%rcx)
incq %rsi
movzbl -0x1(%rsi), %ecx
testl %ecx, %ecx
je 0xd699
cmpl $0x25, %ecx
jne 0xd689
leaq -0x1(%rsi), %rdi
movq %rdi, 0x10(%rax)
testb %cl, %cl
je 0xd6c7
movzbl (%rsi), %r8d
testl %r8d, %r8d
je 0xdbb0
cmpl $0x25, %r8d
jne 0xd6cf
movb $0x1, (%rax)
movq %rsi, 0x10(%rax)
incq %rsi
jmp 0xdbac
movb $0x1, (%rax)
jmp 0xdbb0
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
movabsq $0xccccccccccccccc, %rdi # imm = 0xCCCCCCCCCCCCCCC
leal -0x31(%r8), %r11d
cmpb $0x8, %r11b
ja 0xd75e
xorl %r14d, %r14d
movq %rsi, %r11
movq %r14, %rbx
leal -0x3a(%r8), %ebp
cmpb $-0xa, %bpl
jb 0xd742
cmpq %rdi, %rbx
jle 0xd70d
xorl %r15d, %r15d
movq %rbx, %r14
jmp 0xd73d
movl %r8d, %r14d
andb $0xf, %r14b
movzbl %r14b, %r15d
leaq (%rbx,%rbx), %r14
leaq (%r14,%r14,4), %r14
movq %r15, %r12
xorq %rcx, %r12
cmpq %r12, %r14
jle 0xd730
xorl %r15d, %r15d
jmp 0xd73d
addq %r15, %r14
movb 0x1(%r11), %r8b
incq %r11
movb $0x1, %r15b
testb %r15b, %r15b
jne 0xd6f3
cmpb $-0xb, %bpl
ja 0xd75b
cmpb $0x24, (%r11)
jne 0xd75b
decq %rbx
movq %rbx, 0x58(%rax)
incq %r11
movq %r11, %rsi
movb (%rsi), %r8b
movzwl 0x24(%rax), %r11d
movl 0x20(%rax), %ebx
incq %rsi
leaq 0x3697c(%rip), %r14     # 0x440ec
movzbl %r8b, %r15d
leal -0x27(%r15), %r12d
cmpl $0x9, %r12d
ja 0xd791
movslq (%r14,%r12,4), %r15
addq %r14, %r15
jmpq *%r15
orl $0x2000, %r11d          # imm = 0x2000
jmp 0xd7e3
cmpl $0x20, %r15d
je 0xd7df
cmpl $0x23, %r15d
jne 0xd7f0
orl $0x1000, %r11d          # imm = 0x1000
movw %r11w, 0x24(%rax)
orl $0x600, %ebx            # imm = 0x600
jmp 0xd7da
orl $0x800, %r11d           # imm = 0x800
movw %r11w, 0x24(%rax)
orl $0x20, %ebx
jmp 0xd7da
orl $0x400, %r11d           # imm = 0x400
jmp 0xd7e3
orl $0x40, %r11d
movw %r11w, 0x24(%rax)
orl $0x800, %ebx            # imm = 0x800
movl %ebx, 0x20(%rax)
jmp 0xd7e8
orl $0x20, %r11d
movw %r11w, 0x24(%rax)
movb (%rsi), %r8b
incq %rsi
jmp 0xd770
movl 0x24(%rax), %r11d
movl %r11d, %ebx
notl %ebx
testl $0xc00, %ebx            # imm = 0xC00
jne 0xd80d
andl $0xfbff, %r11d          # imm = 0xFBFF
movw %r11w, 0x24(%rax)
movl 0x24(%rax), %r11d
movl %r11d, %ebx
notl %ebx
testb $0x60, %bl
jne 0xd827
andl $0xffdf, %r11d          # imm = 0xFFDF
movw %r11w, 0x24(%rax)
cmpb $0x2a, %r8b
jne 0xd8b4
orb $-0x80, 0x24(%rax)
movb (%rsi), %r8b
leal -0x31(%r8), %r10d
cmpb $0x8, %r10b
ja 0xd910
xorl %r14d, %r14d
movl %r8d, %r11d
movq %r14, %r10
leal -0x3a(%r11), %ebx
cmpb $-0xa, %bl
jb 0xd898
cmpq %rdi, %r10
jle 0xd864
xorl %ebp, %ebp
movq %r10, %r14
jmp 0xd893
movl %r11d, %ebp
andb $0xf, %bpl
movzbl %bpl, %r15d
leaq (%r10,%r10), %r14
leaq (%r14,%r14,4), %r14
movq %r15, %r12
xorq %rcx, %r12
cmpq %r12, %r14
jle 0xd886
xorl %ebp, %ebp
jmp 0xd893
addq %r15, %r14
movb 0x1(%rsi), %r11b
incq %rsi
movb $0x1, %bpl
testb %bpl, %bpl
jne 0xd84c
cmpb $-0xb, %bl
ja 0xd915
cmpb $0x24, (%rsi)
jne 0xd915
movb 0x1(%rsi), %r8b
incq %rsi
decq %r10
movq %r10, (%r9)
movb $0x1, %r9b
jmp 0xd918
decq %rsi
movb (%rsi), %r11b
xorl %r9d, %r9d
leal -0x3a(%r11), %r8d
cmpb $-0xa, %r8b
jb 0xd8fe
cmpq %rdi, %r9
jg 0xd8e7
movl %r11d, %ebx
andb $0xf, %bl
movzbl %bl, %ebx
addq %r9, %r9
leaq (%r9,%r9,4), %r9
movq %rbx, %r14
xorq %rcx, %r14
cmpq %r14, %r9
jle 0xd8eb
xorl %ebx, %ebx
jmp 0xd8f7
addq %rbx, %r9
movb 0x1(%rsi), %r11b
incq %rsi
movb $0x1, %bl
testb %bl, %bl
jne 0xd8bd
xorl %r9d, %r9d
cmpb $-0xb, %r8b
ja 0xdbb0
movb (%rsi), %r8b
movq %r9, (%r10)
jmp 0xd927
movq %rdx, (%r9)
jmp 0xd921
xorl %r9d, %r9d
testb %r9b, %r9b
je 0xdbb0
movw $0x1, 0x30(%rax)
cmpb $0x2e, %r8b
jne 0xda8a
movl 0x24(%rax), %r9d
movl %r9d, %r8d
orl $0x100, %r8d            # imm = 0x100
movw %r8w, 0x24(%rax)
movb 0x1(%rsi), %r8b
cmpb $0x2a, %r8b
jne 0xd9ea
orl $0x300, %r9d            # imm = 0x300
movw %r9w, 0x24(%rax)
movb 0x2(%rsi), %r8b
addq $0x2, %rsi
leal -0x31(%r8), %r9d
cmpb $0x8, %r9b
ja 0xda49
xorl %ebx, %ebx
movl %r8d, %r10d
movq %rbx, %r9
leal -0x3a(%r10), %r11d
cmpb $-0xa, %r11b
jb 0xd9c5
cmpq %rdi, %r9
jle 0xd992
xorl %ebp, %ebp
movq %r9, %rbx
jmp 0xd9c0
movl %r10d, %ebx
andb $0xf, %bl
movzbl %bl, %r14d
leaq (%r9,%r9), %rbx
leaq (%rbx,%rbx,4), %rbx
movq %r14, %r15
xorq %rcx, %r15
cmpq %r15, %rbx
jle 0xd9b3
xorl %ebp, %ebp
jmp 0xd9c0
addq %r14, %rbx
movb 0x1(%rsi), %r10b
incq %rsi
movb $0x1, %bpl
testb %bpl, %bpl
jne 0xd979
cmpb $-0xb, %r11b
ja 0xda5f
cmpb $0x24, (%rsi)
jne 0xda5f
movb 0x1(%rsi), %r8b
incq %rsi
decq %r9
movq %r9, 0x50(%rax)
movb $0x1, %cl
jmp 0xda61
incq %rsi
leal -0x30(%r8), %r9d
cmpb $0x9, %r9b
ja 0xda56
movl %r8d, %r11d
xorl %r9d, %r9d
leal -0x3a(%r11), %r10d
cmpb $-0xa, %r10b
jb 0xda3e
cmpq %rdi, %r9
jg 0xda27
movl %r11d, %ebx
andb $0xf, %bl
movzbl %bl, %ebx
addq %r9, %r9
leaq (%r9,%r9,4), %r9
movq %rbx, %r14
xorq %rcx, %r14
cmpq %r14, %r9
jle 0xda2b
xorl %ebx, %ebx
jmp 0xda37
addq %rbx, %r9
movb 0x1(%rsi), %r11b
incq %rsi
movb $0x1, %bl
testb %bl, %bl
jne 0xd9fd
xorl %r9d, %r9d
cmpb $-0xb, %r10b
ja 0xda80
movb (%rsi), %r8b
jmp 0xda59
movzwl 0x30(%rax), %ecx
addq %rdx, %rcx
movq %rcx, 0x50(%rax)
jmp 0xda65
xorl %r9d, %r9d
movq %r9, 0x40(%rax)
jmp 0xda69
xorl %ecx, %ecx
testb %cl, %cl
je 0xda80
incw 0x30(%rax)
movl 0x24(%rax), %edi
movb $0x1, %cl
btl $0xa, %edi
jae 0xda82
andl $0xfbff, %edi           # imm = 0xFBFF
movw %di, 0x24(%rax)
jmp 0xda82
xorl %ecx, %ecx
testb %cl, %cl
je 0xdbb0
incq %rsi
movabsq $0x410150000001, %rdi   # imm = 0x410150000001
movzbl %r8b, %ecx
leal -0x4c(%rcx), %r8d
cmpl $0x2e, %r8d
ja 0xdab3
btq %r8, %rdi
jae 0xdab3
movb (%rsi), %r8b
incq %rsi
jmp 0xda97
movb %cl, 0x60(%rax)
leal -0x58(%rcx), %edi
cmpl $0x20, %edi
ja 0xdad8
leaq 0x3666b(%rip), %rcx     # 0x44130
movslq (%rcx,%rdi,4), %rdi
addq %rcx, %rdi
jmpq *%rdi
orb $0x40, 0x21(%rax)
orb $0x4, 0x24(%rax)
jmp 0xdb4b
leal -0x41(%rcx), %edi
cmpl $0x6, %edi
ja 0xdb03
leaq 0x3662d(%rip), %rcx     # 0x44114
movslq (%rcx,%rdi,4), %rdi
addq %rcx, %rdi
jmpq *%rdi
orl $0x4104, 0x20(%rax)     # imm = 0x4104
orb $0x10, 0x24(%rax)
jmp 0xdb4b
orb $0x2, 0x24(%rax)
jmp 0xdb74
cmpl $0x53, %ecx
jne 0xdbb0
orb $0x1, 0x20(%rax)
jmp 0xdb74
orb $0x8, 0x24(%rax)
orb $0x4, 0x24(%rax)
jmp 0xdb6c
orb $0x4, 0x20(%rax)
jmp 0xdb6c
movq $0x10, 0x28(%rax)
orb $0x1, 0x24(%rax)
jmp 0xdb74
orb $0x1, 0x21(%rax)
jmp 0xdb6c
orb $0x4, 0x24(%rax)
movq $0x8, 0x28(%rax)
jmp 0xdb74
orl $0x104, 0x20(%rax)      # imm = 0x104
movq $0x10, 0x28(%rax)
jmp 0xdb74
orb $0x40, 0x21(%rax)
jmp 0xdb68
orl $0x4004, 0x20(%rax)     # imm = 0x4004
jmp 0xdb68
orb $0x41, 0x21(%rax)
orb $0x10, 0x24(%rax)
movq $0xa, 0x28(%rax)
movl 0x24(%rax), %ecx
btl $0xd, %ecx
jae 0xdb8e
cmpq $0xa, 0x28(%rax)
je 0xdb8e
andl $0xdfff, %ecx           # imm = 0xDFFF
movw %cx, 0x24(%rax)
movb $0x1, (%rax)
cmpq $0x0, 0x58(%rax)
jns 0xdba3
movzwl 0x30(%rax), %ecx
addq %rdx, %rcx
movq %rcx, 0x58(%rax)
incw 0x30(%rax)
cmpb $0x0, (%rsi)
je 0xdbb0
movq %rsi, 0x18(%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop