user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<lineout>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  jmp    L10
L129:
  addl   $0x1,-0x1c(%rbp)
L10:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L129
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L110
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x11,-0x4(%rbp)
  jg     L55
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rdx
  mov    $0x12,%esi
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printw@plt>
  mov    -0x4(%rbp),%eax
  add    %eax,-0x1c(%rbp)
  jmp    L110
L55:
  cmpl   $0x12,-0x4(%rbp)
  jle    L48
  movl   $0x12,-0x4(%rbp)
  jmp    L48
L106:
  subl   $0x1,-0x4(%rbp)
L48:
  mov    -0x1c(%rbp),%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L15
  cmpl   $0x0,-0x4(%rbp)
  jns    L106
L15:
  cmpl   $0x0,-0x4(%rbp)
  jns    L16
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rdx
  mov    $0x12,%esi
  lea    D22(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printw@plt>
  addl   $0x12,-0x1c(%rbp)
  jmp    L122
L128:
  addl   $0x1,-0x1c(%rbp)
L122:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L110
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L128
  jmp    L110
L16:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  mov    %rdx,%rcx
  mov    %eax,%edx
  mov    $0x12,%esi
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printw@plt>
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  add    %eax,-0x1c(%rbp)
L110:
  mov    -0x1c(%rbp),%eax
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D4
datatype: string
name: extract_symbolic_data
arguments: data_label: D22
datatype: string
name: extract_symbolic_data
arguments: data_label: D25
datatype: string

tool: D4: %*s

tool: D22: %.*s

tool: D25: %*.*s

assistant: ```c
int lineout(char const *str, int index) {
  int n;
  while (isspace(str[index]))
    ++index;
  if (str[index]) {
    n = strlen(str + index);
    if (n < 18) {
      printw("%*s", 18, str + index);
      index += n;
    } else {
      if (n > 18)
        n = 18;
      while (!isspace(str[index + n]) && n >= 0)
        --n;
      if (n < 0) {
        printw("%.*s", 18, str + index);
        index += 18;
        while (str[index] && !isspace(str[index]))
          ++index;
      } else {
        printw("%*.*s", 18, n, str + index);
        index += n + 1;
      }
    }
  }
  return index;
}
```