// File: jaudoux[P]countTags/src/optionparser.h
// Function: option::PrintUsageImplementation::LinePartIterator::update_length()
void update_length()
    {
      screenlen = 0;
      for (len = 0; ptr[len] != 0 && ptr[len] != '\v' && ptr[len] != '\t' && ptr[len] != '\n'; ++len)
      {
        ++screenlen;
        unsigned ch = (unsigned char) ptr[len];
        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 (((unsigned char) ptr[len + 1] ^ 0x80) <= 0x3F) // while next byte is continuation byte
          {
            ch = (ch << 6) ^ (unsigned char) ptr[len + 1] ^ 0x80; // add continuation to char code
            ++len;
          }
          // 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
            ++screenlen;
        }
      }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, 0x28(%rax)
movl $0x0, 0x24(%rax)
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rax
movslq 0x24(%rcx), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x19(%rbp)
je 0x9289
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rax
movslq 0x24(%rcx), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0xb, %ecx
movb %al, -0x19(%rbp)
je 0x9289
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rax
movslq 0x24(%rcx), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x9, %ecx
movb %al, -0x19(%rbp)
je 0x9289
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rax
movslq 0x24(%rcx), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
setne %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
testb $0x1, %al
jne 0x9295
jmp 0x9369
movq -0x18(%rbp), %rcx
movl 0x28(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x28(%rcx)
movq 0x18(%rcx), %rax
movslq 0x24(%rcx), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0xc(%rbp)
cmpl $0xc1, -0xc(%rbp)
jbe 0x9355
movl -0xc(%rbp), %eax
xorl $0xff, %eax
bsrl %eax, %ecx
xorl $0x1f, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
shrl %cl, %eax
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
andl -0x10(%rbp), %eax
movl %eax, -0xc(%rbp)
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rax
movl 0x24(%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
xorl $0x80, %eax
cmpl $0x3f, %eax
jg 0x932f
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
shll $0x6, %ecx
movq 0x18(%rax), %rdx
movl 0x24(%rax), %esi
addl $0x1, %esi
movslq %esi, %rsi
movzbl (%rdx,%rsi), %edx
xorl %edx, %ecx
xorl $0x80, %ecx
movl %ecx, -0xc(%rbp)
movl 0x24(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x24(%rax)
jmp 0x92df
cmpl $0x1100, -0xc(%rbp)     # imm = 0x1100
jb 0x9353
movl -0xc(%rbp), %edi
callq 0x9370
testb $0x1, %al
jne 0x9346
jmp 0x9353
movq -0x18(%rbp), %rax
movl 0x28(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x28(%rax)
jmp 0x9355
jmp 0x9357
movq -0x18(%rbp), %rax
movl 0x24(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x24(%rax)
jmp 0x9222
addq $0x20, %rsp
popq %rbp
retq
nop