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

```asm
<string_line_pack>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%rbx
  cmpb   $0x20,(%rdi)
  jne    L11
  mov    %rdi,%rax
L235:
  add    $0x1,%rax
  cmpb   $0x20,(%rax)
  je     L235
L491:
  movzbl (%rax),%edx
  test   %dl,%dl
  je     L476
  mov    $0x1,%esi
  mov    $0x0,%ecx
  movl   $0x0,0x1c(%rsp)
  mov    $0x0,%r8d
  jmp    L505
L11:
  mov    %rdi,%rax
  jmp    L491
L87:
  test   %ecx,%ecx
  sete   %cl
  movzbl %cl,%ecx
  mov    %rax,%rdx
  jmp    L98
L104:
  test   %ecx,%ecx
  sete   %cl
  movzbl %cl,%ecx
  add    %ecx,%ecx
  mov    %rax,%rdx
  jmp    L98
L220:
  cmp    $0x20,%dl
  je     L243
L15:
  test   %ecx,%ecx
  sete   %sil
  cmp    $0x20,%dl
  sete   %dl
  movzbl %dl,%edx
  and    %edx,%esi
  mov    %rax,%rdx
L98:
  lea    0x1(%rdx),%rax
  movzbl 0x1(%rdx),%edx
  test   %dl,%dl
  je     L126
L505:
  cmp    $0x2,%ecx
  je     L61
  cmp    $0x27,%dl
  je     L87
L61:
  cmp    $0x1,%ecx
  setne  %dil
  cmp    $0x22,%dl
  jne    L291
  test   %dil,%dil
  jne    L104
L291:
  cmp    $0x5c,%dl
  jne    L220
  test   %dil,%dil
  je     L220
  cmpb   $0x0,0x1(%rax)
  je     L15
  lea    0x1(%rax),%rdx
  mov    %r8d,%esi
  jmp    L98
L243:
  or     %ecx,%esi
  cmp    $0x1,%esi
  adcl   $0x0,0x1c(%rsp)
  jmp    L15
L126:
  cmp    $0x1,%esi
  adcl   $0x0,0x1c(%rsp)
  mov    0x1c(%rsp),%r15d
  lea    0x8(,%r15,8),%edi
  call   <malloc@plt>
  mov    %rax,%rsi
  mov    %rax,0x28(%rsp)
  mov    %rax,0x20(%rsp)
  mov    %r15d,%eax
  test   %r15d,%r15d
  jle    L118
  mov    %rsi,%r15
  lea    -0x1(%rax),%eax
  lea    0x8(%rsi,%rax,8),%rax
  mov    %rax,0x8(%rsp)
  jmp    L306
L309:
  test   %edx,%edx
  sete   %dl
  movzbl %dl,%edx
  sub    $0x1,%edi
  mov    %rbp,%rax
  jmp    L368
L413:
  test   %edx,%edx
  sete   %dl
  movzbl %dl,%edx
  add    %edx,%edx
  sub    $0x1,%edi
  mov    %rbp,%rax
  jmp    L368
L181:
  cmpb   $0x0,0x1(%rbp)
  je     L143
  sub    $0x1,%edi
  lea    0x1(%rbp),%rax
  jmp    L368
L457:
  mov    %rbp,%rax
L368:
  lea    0x1(%rax),%rbp
  movzbl 0x1(%rax),%eax
  test   %al,%al
  je     L210
L239:
  cmp    $0x2,%edx
  je     L272
  cmp    $0x27,%al
  je     L309
L272:
  cmp    $0x1,%edx
  setne  %cl
  cmp    $0x22,%al
  jne    L69
  test   %cl,%cl
  jne    L413
L69:
  cmp    $0x5c,%al
  jne    L415
  test   %cl,%cl
  jne    L181
L415:
  cmp    $0x20,%al
  jne    L457
  test   %edx,%edx
  jne    L457
  jmp    L210
L13:
  mov    0x28(%rsp),%rdi
  call   <string_pack_free@plt>
  movq   $0x0,0x20(%rsp)
  jmp    L19
L128:
  test   %r12d,%r12d
  sete   %r12b
  movzbl %r12b,%r12d
  jmp    L351
L401:
  test   %r12d,%r12d
  sete   %r12b
  movzbl %r12b,%r12d
  add    %r12d,%r12d
  jmp    L351
L509:
  movslq %r13d,%rdx
  mov    %al,(%r14,%rdx,1)
  add    $0x1,%r13d
L351:
  add    $0x1,%rbx
  cmp    %rbp,%rbx
  je     L295
L106:
  movzbl (%rbx),%eax
  cmp    $0x2,%r12d
  je     L233
  cmp    $0x27,%al
  je     L128
L233:
  cmp    $0x1,%r12d
  setne  %dl
  cmp    $0x22,%al
  jne    L315
  test   %dl,%dl
  jne    L401
L315:
  cmp    $0x5c,%al
  jne    L509
  test   %dl,%dl
  je     L509
  movzbl 0x1(%rbx),%edi
  test   %dil,%dil
  je     L509
  movslq %r13d,%rax
  add    %r14,%rax
  mov    %rax,0x10(%rsp)
  movsbl %dil,%edi
  call   <char_unescape@plt>
  mov    0x10(%rsp),%rsi
  mov    %al,(%rsi)
  add    $0x1,%r13d
  add    $0x1,%rbx
  jmp    L351
L295:
  mov    %rbp,%rbx
L78:
  movslq 0x18(%rsp),%rax
  movb   $0x0,(%r14,%rax,1)
  mov    %r14,(%r15)
  add    $0x8,%r15
  cmp    0x8(%rsp),%r15
  je     L118
L306:
  cmpb   $0x20,(%rbx)
  jne    L7
L278:
  add    $0x1,%rbx
  cmpb   $0x20,(%rbx)
  je     L278
L7:
  movzbl (%rbx),%eax
  test   %al,%al
  je     L74
  mov    %rbx,%rbp
  mov    $0x0,%edi
  mov    $0x0,%edx
  jmp    L239
L74:
  mov    $0x1,%edi
  call   <malloc@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L13
  movl   $0x0,0x18(%rsp)
  jmp    L78
L143:
  add    $0x1,%rbp
L210:
  mov    %rbp,%rax
  sub    %rbx,%rax
  add    %eax,%edi
  mov    %edi,0x18(%rsp)
  add    $0x1,%edi
  call   <malloc@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L13
  mov    $0x0,%r13d
  mov    $0x0,%r12d
  cmp    %rbx,%rbp
  jne    L106
  jmp    L78
L476:
  mov    $0x8,%edi
  call   <malloc@plt>
  mov    %rax,0x20(%rsp)
  movl   $0x0,0x1c(%rsp)
L118:
  movslq 0x1c(%rsp),%rax
  mov    0x20(%rsp),%rsi
  movq   $0x0,(%rsi,%rax,8)
L19:
  mov    0x20(%rsp),%rax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
char **string_line_pack(const char *buf) {
  const char delimiter = ' ', *p = buf;
  int elements = 0, quote = 0;
  bool isdelimiter = true;
  while (*p == delimiter)
    ++p;
  while (*p != '\0') {
    if (*p == '\'' && quote != 2)
      quote = quote == 0 ? 1 : 0;
    else if (*p == '"' && quote != 1)
      quote = quote == 0 ? 2 : 0;
    else if (*p == '\\' && quote != 1 && *(p + 1) != '\0') {
      isdelimiter = false;
      ++p;
    } else {
      if (*p == delimiter && !isdelimiter && quote == 0)
        ++elements;
      isdelimiter = (*p == delimiter && quote == 0);
    }
    ++p;
  }
  if (!isdelimiter)
    ++elements;
  char **packed = (char **)malloc((elements + 1) * sizeof(char *));
  const char *q = buf;
  for (int i = 0; i < elements; i++) {
    int length = 0;
    quote = 0;
    while (*q == delimiter)
      ++q;
    p = q;
    while (*p != '\0') {
      if (*p == '\'' && quote != 2) {
        quote = quote == 0 ? 1 : 0;
        length -= 1;
      } else if (*p == '"' && quote != 1) {
        quote = quote == 0 ? 2 : 0;
        length -= 1;
      } else if (*p == '\\' && quote != 1 && *(p + 1) != '\0') {
        length -= 1;
        p += 1;
      } else if (quote == 0 && *p == delimiter)
        break;
      ++p;
    }
    length += p - q;
    char *newstr = (char *)malloc(length + 1);
    if (!newstr) {
      string_pack_free(packed);
      return NULL;
    }
    int j = 0;
    quote = 0;
    for (; q != p; q++) {
      if (*q == '\'' && quote != 2)
        quote = quote == 0 ? 1 : 0;
      else if (*q == '"' && quote != 1)
        quote = quote == 0 ? 2 : 0;
      else if (*q == '\\' && quote != 1 && *(q + 1) != '\0') {
        newstr[j] = char_unescape(*(q + 1));
        ++j;
        q += 1;
      } else {
        newstr[j] = *q;
        ++j;
      }
    }
    newstr[length] = '\0';
    packed[i] = newstr;
  }
  packed[elements] = NULL;
  return packed;
}
```