// File: /workspace/github_cpp_makefile_star2_O2/jaudoux[P]countTags/src/optionparser.h
// Function: option::PrintUsageImplementation::LineWrapper::process(option::PrintUsageImplementation::IStringWriter&, char const*, int)
void process(IStringWriter& write, const char* data, int len)
    {
      wrote_something = false;

      while (len > 0)
      {
        if (len <= width) // quick test that works because utf8width <= len (all wide chars have at least 2 bytes)
        {
          output(write, data, len);
          len = 0;
        }
        else // if (len > width)  it's possible (but not guaranteed) that utf8len > width
        {
          int utf8width = 0;
          int maxi = 0;
          while (maxi < len && utf8width < width)
          {
            int charbytes = 1;
            unsigned ch = (unsigned char) data[maxi];
            if (ch > 0xC1) // everything <= 0xC1 (yes, even 0xC1 itself) is not a valid UTF-8 start byte
            {
              // int __builtin_clz (unsigned int x)
              // Returns the number of leading 0-bits in x, starting at the most significant bit
              unsigned mask = (unsigned) -1 >> __builtin_clz(ch ^ 0xff);
              ch = ch & mask; // mask out length bits, we don't verify their correctness
              while ((maxi + charbytes < len) && //
                  (((unsigned char) data[maxi + charbytes] ^ 0x80) <= 0x3F)) // while next byte is continuation byte
              {
                ch = (ch << 6) ^ (unsigned char) data[maxi + charbytes] ^ 0x80; // add continuation to char code
                ++charbytes;
              }
              // ch is the decoded unicode code point
              if (ch >= 0x1100 && isWideChar(ch)) // the test for 0x1100 is here to avoid the function call in the Latin case
              {
                if (utf8width + 2 > width)
                  break;
                ++utf8width;
              }
            }
            ++utf8width;
            maxi += charbytes;
          }

          // data[maxi-1] is the last byte of the UTF-8 sequence of the last character that fits
          // onto the 1st line. If maxi == len, all characters fit on the line.

          if (maxi == len)
          {
            output(write, data, len);
            len = 0;
          }
          else // if (maxi < len)  at least 1 character (data[maxi] that is) doesn't fit on the line
          {
            int i;
            for (i = maxi; i >= 0; --i)
              if (data[i] == ' ')
                break;

            if (i >= 0)
            {
              output(write, data, i);
              data += i + 1;
              len -= i + 1;
            }
            else // did not find a space to split at => split before data[maxi]
            { // data[maxi] is always the beginning of a character, never a continuation byte
              output(write, data, maxi);
              data += maxi;
              len -= maxi;
            }
          }
        }
      }
      if (!wrote_something) // if we didn't already write something to make space in the buffer
        write_one_line(write); // write at most one line of actual output
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %rbp
movq %rdi, %r14
movb $0x0, 0xd0(%rdi)
movq %rsi, (%rsp)
testl %ebx, %ebx
jle 0x44da
movl 0xc4(%r14), %edx
cmpl %edx, %ebx
jle 0x4462
xorl %r13d, %r13d
xorl %r12d, %r12d
movl %ebx, %ebp
subl %r12d, %ebp
jle 0x4467
cmpl %edx, %r13d
jge 0x4467
movl %r12d, %eax
movzbl (%r15,%rax), %edi
cmpl $0xc2, %edi
jb 0x442d
movl %edi, %ecx
xorl $0xff, %ecx
bsrl %ecx, %ecx
notl %ecx
shll %cl, %edi
shrl %cl, %edi
leaq (%r15,%rax), %rsi
pushq $0x1
popq %rcx
leal (%rax,%rcx), %r8d
cmpl %r8d, %ebx
jle 0x4434
movzbl (%rsi,%rcx), %r8d
movl %r8d, %r9d
xorl $0x80, %r9d
cmpl $0x3f, %r9d
ja 0x4432
shll $0x6, %edi
xorl %r8d, %edi
xorl $0x80, %edi
incq %rcx
jmp 0x43fe
pushq $0x1
popq %rbp
jmp 0x4457
movl %ecx, %ebp
cmpl $0x1100, %edi           # imm = 0x1100
jb 0x4457
callq 0x4620
movl 0xc4(%r14), %edx
testb %al, %al
je 0x4457
leal 0x2(%r13), %eax
cmpl %edx, %eax
jg 0x4467
incl %r13d
incl %r13d
addl %ebp, %r12d
jmp 0x43c2
movq %r14, %rdi
jmp 0x4473
cmpl %r12d, %ebx
jne 0x4487
movq %r14, %rdi
movq (%rsp), %rbp
movq %rbp, %rsi
movq %r15, %rdx
movl %ebx, %ecx
callq 0x4694
xorl %ebx, %ebx
jmp 0x43a5
movl %r12d, %r13d
movq (%rsp), %rbp
testl %r13d, %r13d
js 0x44a2
movl %r13d, %eax
cmpb $0x20, (%r15,%rax)
je 0x44b5
decl %r13d
jmp 0x448e
movq %r14, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x4694
jmp 0x44cc
movq %r14, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r13d, %ecx
callq 0x4694
incl %r13d
movl %r13d, %r12d
movl %r12d, %eax
addq %rax, %r15
subl %r12d, %ebx
jmp 0x43a5
cmpb $0x0, 0xd0(%r14)
je 0x44f3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movq %rbp, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x46de