// File: /workspace/github_cpp_makefile_star2_O3/jaudoux[P]countTags/src/optionparser.h
// Function: option::PrintUsageImplementation::printUsage(option::PrintUsageImplementation::IStringWriter&, option::Descriptor const*, int, int, int)
static void printUsage(IStringWriter& write, const Descriptor usage[], int width = 80, //
                         int last_column_min_percent = 50, int last_column_own_line_max_percent = 75)
  {
    if (width < 1) // protect against nonsense values
      width = 80;

    if (width > 10000) // protect against overflow in the following computation
      width = 10000;

    int last_column_min_width = ((width * last_column_min_percent) + 50) / 100;
    int last_column_own_line_max_width = ((width * last_column_own_line_max_percent) + 50) / 100;
    if (last_column_own_line_max_width == 0)
      last_column_own_line_max_width = 1;

    LinePartIterator part(usage);
    while (part.nextTable())
    {

      /***************** Determine column widths *******************************/

      const int maxcolumns = 8; // 8 columns are enough for everyone
      int col_width[maxcolumns];
      int lastcolumn;
      int leftwidth;
      int overlong_column_threshold = 10000;
      do
      {
        lastcolumn = 0;
        for (int i = 0; i < maxcolumns; ++i)
          col_width[i] = 0;

        part.restartTable();
        while (part.nextRow())
        {
          while (part.next())
          {
            if (part.column() < maxcolumns)
            {
              upmax(lastcolumn, part.column());
              if (part.screenLength() < overlong_column_threshold)
                // We don't let rows that don't use table separators (\t or \v) influence
                // the width of column 0. This allows the user to interject section headers
                // or explanatory paragraphs that do not participate in the table layout.
                if (part.column() > 0 || part.line() > 0 || part.data()[part.length()] == '\t'
                    || part.data()[part.length()] == '\v')
                  upmax(col_width[part.column()], part.screenLength());
            }
          }
        }

        /*
         * If the last column doesn't fit on the same
         * line as the other columns, we can fix that by starting it on its own line.
         * However we can't do this for any of the columns 0..lastcolumn-1.
         * If their sum exceeds the maximum width we try to fix this by iteratively
         * ignoring the widest line parts in the width determination until
         * we arrive at a series of column widths that fit into one line.
         * The result is a layout where everything is nicely formatted
         * except for a few overlong fragments.
         * */

        leftwidth = 0;
        overlong_column_threshold = 0;
        for (int i = 0; i < lastcolumn; ++i)
        {
          leftwidth += col_width[i];
          upmax(overlong_column_threshold, col_width[i]);
        }

      } while (leftwidth > width);

      /**************** Determine tab stops and last column handling **********************/

      int tabstop[maxcolumns];
      tabstop[0] = 0;
      for (int i = 1; i < maxcolumns; ++i)
        tabstop[i] = tabstop[i - 1] + col_width[i - 1];

      int rightwidth = width - tabstop[lastcolumn];
      bool print_last_column_on_own_line = false;
      if (rightwidth < last_column_min_width && rightwidth < col_width[lastcolumn])
      {
        print_last_column_on_own_line = true;
        rightwidth = last_column_own_line_max_width;
      }

      // If lastcolumn == 0 we must disable print_last_column_on_own_line because
      // otherwise 2 copies of the last (and only) column would be output.
      // Actually this is just defensive programming. It is currently not
      // possible that lastcolumn==0 and print_last_column_on_own_line==true
      // at the same time, because lastcolumn==0 => tabstop[lastcolumn] == 0 =>
      // rightwidth==width => rightwidth>=last_column_min_width  (unless someone passes
      // a bullshit value >100 for last_column_min_percent) => the above if condition
      // is false => print_last_column_on_own_line==false
      if (lastcolumn == 0)
        print_last_column_on_own_line = false;

      LineWrapper lastColumnLineWrapper(width - rightwidth, width);
      LineWrapper interjectionLineWrapper(0, width);

      part.restartTable();

      /***************** Print out all rows of the table *************************************/

      while (part.nextRow())
      {
        int x = -1;
        while (part.next())
        {
          if (part.column() > lastcolumn)
            continue; // drop excess columns (can happen if lastcolumn == maxcolumns-1)

          if (part.column() == 0)
          {
            if (x >= 0)
              write("\n", 1);
            x = 0;
          }

          indent(write, x, tabstop[part.column()]);

          if ((part.column() < lastcolumn)
              && (part.column() > 0 || part.line() > 0 || part.data()[part.length()] == '\t'
                  || part.data()[part.length()] == '\v'))
          {
            write(part.data(), part.length());
            x += part.screenLength();
          }
          else // either part.column() == lastcolumn or we are in the special case of
               // an interjection that doesn't contain \v or \t
          {
            // NOTE: This code block is not necessarily executed for
            // each line, because some rows may have fewer columns.

            LineWrapper& lineWrapper = (part.column() == 0) ? interjectionLineWrapper : lastColumnLineWrapper;

            if (!print_last_column_on_own_line)
              lineWrapper.process(write, part.data(), part.length());
          }
        } // while

        if (print_last_column_on_own_line)
        {
          part.restartRow();
          while (part.next())
          {
            if (part.column() == lastcolumn)
            {
              write("\n", 1);
              int _ = 0;
              indent(write, _, width - rightwidth);
              lastColumnLineWrapper.process(write, part.data(), part.length());
            }
          }
        }

        write("\n", 1);
        lastColumnLineWrapper.flush(write);
        interjectionLineWrapper.flush(write);
      }
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
movl %ecx, %ebp
movl $0x2710, %eax           # imm = 0x2710
cmpl %eax, %edx
cmovbl %edx, %eax
testl %edx, %edx
movl $0x50, %r13d
cmovgl %eax, %r13d
imull %r13d, %r8d
leal 0x32(%r8), %eax
cltq
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x25, %rax
addl %ecx, %eax
addl $0x95, %r8d
cmpl $0xc7, %r8d
movl $0x1, %ecx
cmovael %eax, %ecx
movl %ecx, 0x50(%rsp)
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
movq %rsi, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
xorl %eax, %eax
movq %rax, 0x18(%rdi)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rcx, 0x20(%rdi)
movq %rax, 0x2c(%rdi)
movl $0x0, 0x34(%rdi)
movb $0x1, 0x38(%rdi)
callq 0x46a8
testb %al, %al
je 0x468a
imull %r13d, %ebp
addl $0x32, %ebp
movslq %ebp, %rax
imulq $0x51eb851f, %rax, %rcx # imm = 0x51EB851F
movq %rcx, %rax
shrq $0x3f, %rax
sarq $0x25, %rcx
addl %eax, %ecx
movq %rcx, 0x58(%rsp)
leaq 0x2c(%rsp), %r15
leaq 0x8(%rsp), %r14
movl %r13d, 0x4c(%rsp)
movl $0x2710, %r12d          # imm = 0x2710
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rax), %rax
movq %rax, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
xorl %eax, %eax
xorl %ebp, %ebp
testq %rax, %rax
je 0x427b
incq %rax
movzbl -0x1(%rax), %ecx
testl %ecx, %ecx
je 0x42af
cmpl $0xa, %ecx
je 0x42ca
movq %rax, 0x20(%rsp)
jmp 0x4264
movq 0x18(%rsp), %rax
movq %rax, 0x20(%rsp)
movl $0xffffffff, 0x28(%rsp) # imm = 0xFFFFFFFF
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movl $0x0, 0x10(%r15)
movb $0x1, 0x40(%rsp)
testq %rax, %rax
jne 0x4339
jmp 0x434f
movq 0x10(%rsp), %rcx
movq 0x48(%rcx), %rax
testq %rax, %rax
je 0x434f
addq $0x28, %rcx
movq %rcx, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movl $0xffffffff, 0x28(%rsp) # imm = 0xFFFFFFFF
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movl $0x0, 0x10(%r15)
movb $0x1, 0x40(%rsp)
jmp 0x4339
movslq 0x28(%rsp), %rax
cmpq $0x7, %rax
jg 0x4339
cmpl %eax, %ebp
cmovlel %eax, %ebp
movl 0x30(%rsp), %ecx
cmpl %r12d, %ecx
jge 0x4339
testl %eax, %eax
jg 0x432c
cmpl $0x0, 0x3c(%rsp)
jg 0x432c
movq 0x20(%rsp), %rdx
movslq 0x2c(%rsp), %rsi
movzbl (%rdx,%rsi), %edx
orl $0x2, %edx
cmpl $0xb, %edx
jne 0x4339
movl 0x60(%rsp,%rax,4), %edx
cmpl %ecx, %edx
cmovgl %edx, %ecx
movl %ecx, 0x60(%rsp,%rax,4)
movq %r14, %rdi
callq 0x471a
testb %al, %al
jne 0x42f2
movq 0x20(%rsp), %rax
jmp 0x425f
movl %ebp, %eax
testl %ebp, %ebp
jle 0x437f
xorl %ecx, %ecx
xorl %edx, %edx
xorl %r12d, %r12d
movl %r12d, %esi
movl 0x60(%rsp,%rcx,4), %r12d
addl %r12d, %edx
cmpl %r12d, %esi
cmovgl %esi, %r12d
incq %rcx
cmpq %rcx, %rax
jne 0x435c
cmpl %r13d, %edx
jg 0x4232
movl $0x0, 0x80(%rsp)
movl $0x1, %ecx
xorl %edx, %edx
addl 0x5c(%rsp,%rcx,4), %edx
movl %edx, 0x80(%rsp,%rcx,4)
incq %rcx
cmpq $0x8, %rcx
jne 0x4391
movl %r13d, %ecx
subl 0x80(%rsp,%rax,4), %ecx
cmpl 0x58(%rsp), %ecx
jge 0x43c3
cmpl 0x60(%rsp,%rax,4), %ecx
setl %al
cmovll 0x50(%rsp), %ecx
jmp 0x43c5
xorl %eax, %eax
subl %ecx, %r13d
movl %r13d, 0x168(%rsp)
movl %ecx, 0x16c(%rsp)
movabsq $0xf00000000, %rdx      # imm = 0xF00000000
movq %rdx, 0x170(%rsp)
cmpl $0x1, %ecx
jg 0x43f9
movl $0x2, 0x16c(%rsp)
movl $0x0, 0x240(%rsp)
movl 0x4c(%rsp), %ecx
movl %ecx, 0x244(%rsp)
movq %rdx, 0x248(%rsp)
cmpl $0x1, %ecx
ja 0x4427
movl $0x2, 0x244(%rsp)
testl %ebp, %ebp
setne %r12b
movq 0x8(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movq 0x20(%rcx), %rcx
movq %rcx, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
andb %al, %r12b
xorl %eax, %eax
testq %rax, %rax
je 0x446a
incq %rax
movzbl -0x1(%rax), %ecx
testl %ecx, %ecx
je 0x449a
cmpl $0xa, %ecx
je 0x44b5
movq %rax, 0x20(%rsp)
jmp 0x4453
movq 0x18(%rsp), %rax
movq %rax, 0x20(%rsp)
movl $0xffffffff, 0x28(%rsp) # imm = 0xFFFFFFFF
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movl $0x0, 0x10(%r15)
movb $0x1, 0x40(%rsp)
testq %rax, %rax
jne 0x44db
jmp 0x4675
movq 0x10(%rsp), %rcx
movq 0x48(%rcx), %rax
testq %rax, %rax
je 0x4675
addq $0x28, %rcx
movq %rcx, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movl $0xffffffff, 0x28(%rsp) # imm = 0xFFFFFFFF
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movl $0x0, 0x10(%r15)
movb $0x1, 0x40(%rsp)
movl $0xffffffff, 0x4(%rsp)  # imm = 0xFFFFFFFF
movq %r14, %rdi
callq 0x471a
testb %al, %al
je 0x45b3
movl 0x28(%rsp), %eax
cmpl %ebp, %eax
jg 0x44e3
testl %eax, %eax
jne 0x452a
cmpl $0x0, 0x4(%rsp)
js 0x4520
movq (%rbx), %rax
movq %rbx, %rdi
leaq 0x2da1(%rip), %rsi      # 0x72b4
movl $0x1, %edx
callq *(%rax)
movl 0x28(%rsp), %eax
jmp 0x4522
xorl %eax, %eax
movl $0x0, 0x4(%rsp)
cltq
movl 0x80(%rsp,%rax,4), %edx
movq %rbx, %rdi
leaq 0x4(%rsp), %rsi
callq 0x4818
movl 0x28(%rsp), %eax
cmpl %ebp, %eax
jge 0x457e
movq 0x20(%rsp), %rsi
movslq 0x2c(%rsp), %rdx
testl %eax, %eax
jg 0x4569
cmpl $0x0, 0x3c(%rsp)
jg 0x4569
movzbl (%rsi,%rdx), %ecx
orl $0x2, %ecx
cmpl $0xb, %ecx
jne 0x457e
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movl 0x30(%rsp), %eax
addl %eax, 0x4(%rsp)
jmp 0x44e3
testb %r12b, %r12b
jne 0x44e3
testl %eax, %eax
leaq 0xa8(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmoveq %rax, %rdi
movq 0x20(%rsp), %rdx
movl 0x2c(%rsp), %ecx
movq %rbx, %rsi
callq 0x487a
jmp 0x44e3
testb %r12b, %r12b
je 0x4637
movq 0x18(%rsp), %rax
movq %rax, 0x20(%rsp)
movl $0xffffffff, 0x28(%rsp) # imm = 0xFFFFFFFF
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movl $0x0, 0x10(%r15)
movb $0x1, 0x40(%rsp)
movq %r14, %rdi
callq 0x471a
testb %al, %al
je 0x4637
cmpl %ebp, 0x28(%rsp)
jne 0x45de
movq (%rbx), %rax
movq %rbx, %rdi
leaq 0x2cb7(%rip), %rsi      # 0x72b4
movl $0x1, %edx
callq *(%rax)
movl $0x0, 0x54(%rsp)
movq %rbx, %rdi
leaq 0x54(%rsp), %rsi
movl %r13d, %edx
callq 0x4818
movq 0x20(%rsp), %rdx
movl 0x2c(%rsp), %ecx
leaq 0xa8(%rsp), %rdi
movq %rbx, %rsi
callq 0x487a
jmp 0x45de
movq (%rbx), %rax
movq %rbx, %rdi
leaq 0x2c70(%rip), %rsi      # 0x72b4
movl $0x1, %edx
callq *(%rax)
leaq 0xa8(%rsp), %rdi
movq %rbx, %rsi
callq 0x4a04
leaq 0x180(%rsp), %rdi
movq %rbx, %rsi
callq 0x4a04
movq 0x20(%rsp), %rax
jmp 0x444e
movq %r14, %rdi
callq 0x46a8
testb %al, %al
movl 0x4c(%rsp), %r13d
jne 0x422c
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq