user: 请从给定的汇编指令推导出C源代码：

```asm
<string_output_width>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    %ecx,-0x28(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L22
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x24(%rbp)
  jge    L180
  mov    -0x20(%rbp),%rax
  mov    -0x24(%rbp),%edx
  mov    %edx,(%rax)
L180:
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  jmp    L44
L22:
  movl   $0x0,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x8(%rbp)
  cmpl   $0x0,-0x28(%rbp)
  je     L107
  jmp    L140
L121:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <utf8char@plt>
  mov    %eax,%edi
  call   <output_width@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0xc(%rbp),%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x24(%rbp)
  jge    L128
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  mov    -0x8(%rbp),%edx
  lea    0x1(%rdx),%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L216
L128:
  mov    -0x4(%rbp),%eax
  add    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jns    L224
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xbf,%al
  jbe    L17
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xdf,%al
  jbe    L86
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xef,%al
  jbe    L56
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xf7,%al
  jbe    L39
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xfb,%al
  ja     L81
  mov    $0x5,%eax
  jmp    L112
L81:
  mov    $0x6,%eax
  jmp    L112
L39:
  mov    $0x4,%eax
  jmp    L112
L56:
  mov    $0x3,%eax
  jmp    L112
L86:
  mov    $0x2,%eax
  jmp    L112
L17:
  mov    $0xffffffffffffffff,%rax
  jmp    L112
L224:
  mov    $0x1,%eax
L112:
  add    %rax,-0x18(%rbp)
L140:
  mov    -0x8(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  test   %eax,%eax
  jne    L121
  jmp    L216
L143:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <output_width@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0xc(%rbp),%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x24(%rbp)
  jge    L194
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  mov    -0x8(%rbp),%edx
  lea    0x1(%rdx),%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L216
L194:
  mov    -0x4(%rbp),%eax
  add    %eax,-0xc(%rbp)
L107:
  mov    -0x8(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  test   %eax,%eax
  jne    L143
L216:
  mov    -0xc(%rbp),%eax
L44:
  leave
  ret
```

assistant: ```c
int string_output_width(const char *s, int *len, int maxWidth, bool utf8) {
  if (s == NULL) {
    if (*len > maxWidth)
      *len = maxWidth;
    return *len;
  } else {
    int width = 0, char_width, l = *len;
    if (utf8) {
      while (l-- != 0) {
        char_width = output_width(utf8char(s));
        if (width + char_width > maxWidth) {
          *len -= l + 1;
          break;
        }
        width += char_width;
        s += (((unsigned char)(*s)) < 0x80 ? 1 : ((unsigned char)(*s)) < 0xC0 ? -1 : ((unsigned char)(*s)) < 0xE0 ? 2 : ((unsigned char)(*s)) < 0xF0 ? 3 : ((unsigned char)(*s)) < 0xF8 ? 4 : ((unsigned char)(*s)) < 0xFC ? 5 : 6);
      }
    } else
      while (l-- != 0) {
        char_width = output_width(*(s++));
        if (width + char_width > maxWidth) {
          *len -= l + 1;
          break;
        }
        width += char_width;
      }
    return width;
  }
}
```