user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<wrap>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %edx,-0x54(%rbp)
  mov    %rcx,-0x60(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x2c(%rbp)
  mov    -0x50(%rbp),%rax
  add    $0x1,%rax
  shl    $0x3,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x28(%rbp)
  mov    -0x50(%rbp),%rax
  shl    $0x3,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  movl   $0x0,-0x38(%rbp)
  jmp    L49
L2:
  mov    -0x50(%rbp),%rax
  shl    $0x2,%rax
  mov    -0x38(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x20(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,(%rbx)
  addl   $0x1,-0x38(%rbp)
L49:
  mov    -0x38(%rbp),%eax
  cltq
  cmp    %rax,-0x50(%rbp)
  jg     L2
  mov    -0x50(%rbp),%rax
  sub    $0x1,%eax
  mov    %eax,-0x38(%rbp)
  jmp    L130
L26:
  movl   $0x0,-0x30(%rbp)
  mov    -0x38(%rbp),%eax
  mov    %eax,-0x34(%rbp)
  jmp    L6
L131:
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x30(%rbp),%eax
  add    %edx,%eax
  add    $0x1,%eax
  mov    %eax,-0x30(%rbp)
  mov    -0x30(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x54(%rbp)
  jge    L168
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  movl   $0xffffffff,(%rax)
  jmp    L119
L168:
  mov    -0x38(%rbp),%eax
  add    $0x1,%eax
  cltq
  cmp    %rax,-0x50(%rbp)
  jne    L15
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  jmp    L60
L15:
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    -0x30(%rbp),%edx
  sub    $0x1,%edx
  mov    %edx,(%rax)
L60:
  subl   $0x1,-0x34(%rbp)
L6:
  cmpl   $0x0,-0x34(%rbp)
  jns    L131
L119:
  subl   $0x1,-0x38(%rbp)
L130:
  cmpl   $0x0,-0x38(%rbp)
  jns    L26
  movl   $0x0,-0x38(%rbp)
  jmp    L171
L128:
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    $0x8,%edi
  call   <malloc@plt>
  mov    %rax,(%rbx)
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movl   $0xffffffff,(%rax)
  addl   $0x1,-0x38(%rbp)
L171:
  mov    -0x38(%rbp),%eax
  cltq
  cmp    %rax,-0x50(%rbp)
  jge    L128
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  movl   $0x0,(%rax)
  mov    -0x50(%rbp),%rax
  mov    %eax,-0x38(%rbp)
  jmp    L99
L100:
  mov    -0x38(%rbp),%eax
  cltq
  cmp    %rax,-0x50(%rbp)
  jne    L94
  mov    -0x28(%rbp),%r8
  lea    -0x3c(%rbp),%rdi
  mov    -0x54(%rbp),%ecx
  mov    -0x50(%rbp),%rdx
  mov    -0x48(%rbp),%rsi
  mov    -0x38(%rbp),%eax
  sub    $0x8,%rsp
  push   -0x20(%rbp)
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <f@plt>
  add    $0x10,%rsp
  mov    %eax,-0x2c(%rbp)
  jmp    L197
L94:
  mov    -0x28(%rbp),%r8
  lea    -0x3c(%rbp),%rdi
  mov    -0x54(%rbp),%ecx
  mov    -0x50(%rbp),%rdx
  mov    -0x48(%rbp),%rsi
  mov    -0x38(%rbp),%eax
  sub    $0x8,%rsp
  push   -0x20(%rbp)
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <f@plt>
  add    $0x10,%rsp
L197:
  mov    -0x3c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x38(%rbp)
  mov    -0x38(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movb   $0x1,(%rax)
L99:
  cmpl   $0x1,-0x38(%rbp)
  jg     L100
  movl   $0x0,-0x38(%rbp)
  jmp    L30
L75:
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <free@plt>
  addl   $0x1,-0x38(%rbp)
L30:
  mov    -0x38(%rbp),%eax
  cltq
  cmp    %rax,-0x50(%rbp)
  jg     L75
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movl   $0x0,-0x38(%rbp)
  jmp    L148
L121:
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <free@plt>
  addl   $0x1,-0x38(%rbp)
L148:
  mov    -0x38(%rbp),%eax
  cltq
  cmp    %rax,-0x50(%rbp)
  jge    L121
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x2c(%rbp),%eax
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L170
  call   <__stack_chk_fail@plt>
L170:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int wrap(char **words, long words_no, int w, char *allages) {
  int i, j, wij, x, k, cmin, temp_min_i, min;
  int cost = 0, min_i;
  int **costs = malloc((words_no + 1) * sizeof(int *));
  int **line_costs = malloc(words_no * sizeof(int *));
  for (i = 0; i < words_no; i++)
    line_costs[i] = malloc(words_no * sizeof(int));
  for (i = words_no - 1; i >= 0; i--) {
    wij = 0;
    for (j = i; j >= 0; j--) {
      wij = wij + strlen(words[j]) + 1;
      if (wij - 1 > w) {
        line_costs[j][i] = -1;
        break;
      } else if (i + 1 == words_no)
        line_costs[j][i] = 0;
      else
        line_costs[j][i] = wij - 1;
    }
  }
  for (i = 0; i < words_no + 1; i++) {
    costs[i] = malloc(2 * sizeof(int));
    costs[i][0] = -1;
  }
  costs[0][0] = 0;
  i = words_no;
  while (i > 1) {
    if (i == words_no)
      cost = f(i, words, words_no, w, &min_i, costs, line_costs);
    else {
      f(i, words, words_no, w, &min_i, costs, line_costs);
    }
    i = min_i - 1;
    allages[i] = 1;
  }
  for (i = 0; i < words_no; i++)
    free(line_costs[i]);
  free(line_costs);
  for (i = 0; i <= words_no; i++)
    free(costs[i]);
  free(costs);
  return cost;
}
```