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

```asm
<wrap>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  push   %rbx
  lea    0x8(,%rsi,8),%rbx
  sub    $0x68,%rsp
  mov    %rdi,0x40(%rsp)
  mov    %rbx,%rdi
  sub    $0x8,%rbx
  mov    %rcx,0x30(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  call   <malloc@plt>
  mov    %rbx,%rdi
  mov    %rbx,0x48(%rsp)
  mov    %rax,0x38(%rsp)
  call   <malloc@plt>
  lea    -0x1(%r13),%esi
  mov    %rax,0x20(%rsp)
  mov    %esi,0xc(%rsp)
  test   %r13,%r13
  jle    L70
  lea    0x0(,%r13,4),%rbp
  mov    %rax,%r14
  add    %rax,%rbx
  nopl   0x0(%rax)
L52:
  mov    %rbp,%rdi
  add    $0x8,%r14
  call   <malloc@plt>
  mov    %rax,-0x8(%r14)
  cmp    %rbx,%r14
  jne    L52
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  js     L10
L187:
  movslq 0xc(%rsp),%rax
  mov    0x20(%rsp),%rsi
  mov    %r13,0x28(%rsp)
  lea    0x0(,%rax,8),%rcx
  lea    0x0(,%rax,4),%rbp
  lea    (%rsi,%rcx,1),%rdx
  add    0x40(%rsp),%rcx
  mov    %rcx,0x10(%rsp)
  xchg   %ax,%ax
L113:
  mov    0xc(%rsp),%esi
  lea    0x1(%rsi),%ecx
  movslq %ecx,%rcx
  cmp    0x28(%rsp),%rcx
  lea    -0x8(%rdx),%rcx
  mov    %rcx,0x18(%rsp)
  je     L33
  shl    $0x3,%rax
  mov    0x10(%rsp),%r13
  mov    %rdx,%r14
  xor    %ebx,%ebx
  sub    %rax,%rcx
  mov    %rcx,%r15
  nopw   0x0(%rax,%rax,1)
L88:
  mov    0x0(%r13),%rdi
  call   <strlen@plt>
  mov    %r14,%rsi
  add    %ebx,%eax
  lea    0x1(%rax),%ebx
  cmp    %eax,%r12d
  jl     L249
  mov    (%r14),%rdx
  sub    $0x8,%r14
  sub    $0x8,%r13
  mov    %eax,(%rdx,%rbp,1)
  cmp    %r14,%r15
  jne    L88
L150:
  subl   $0x1,0xc(%rsp)
  movslq 0xc(%rsp),%rax
  sub    $0x4,%rbp
  subq   $0x8,0x10(%rsp)
  mov    0x18(%rsp),%rdx
  cmp    $0xffffffff,%eax
  jne    L113
  mov    0x28(%rsp),%r13
L48:
  test   %r13,%r13
  js     L128
L10:
  mov    0x38(%rsp),%rbp
  xor    %ebx,%ebx
  nopl   0x0(%rax,%rax,1)
L80:
  mov    $0x8,%edi
  call   <malloc@plt>
  mov    %rax,0x0(%rbp,%rbx,8)
  add    $0x1,%rbx
  movl   $0xffffffff,(%rax)
  cmp    %rbx,%r13
  jge    L80
L128:
  mov    0x38(%rsp),%rax
  movslq %r13d,%rdx
  xor    %r14d,%r14d
  lea    0x54(%rsp),%rbx
  mov    %rdx,%rdi
  mov    (%rax),%rax
  movl   $0x0,(%rax)
  cmp    $0x1,%r13d
  jle    L223
  mov    0x38(%rsp),%rbp
  mov    0x40(%rsp),%r15
  nopw   0x0(%rax,%rax,1)
L196:
  cmp    %r13,%rdx
  je     L143
  sub    $0x8,%rsp
  mov    %r12d,%ecx
  mov    %r13,%rdx
  mov    %r15,%rsi
  push   0x28(%rsp)
  mov    %rbp,%r9
  mov    %rbx,%r8
  xor    %eax,%eax
  call   <f@plt>
  mov    0x64(%rsp),%eax
  lea    -0x1(%rax),%edi
  mov    0x40(%rsp),%rax
  movslq %edi,%rdx
  movb   $0x1,(%rax,%rdx,1)
  pop    %rcx
  pop    %rsi
  cmp    $0x1,%edi
  jg     L196
L223:
  test   %r13,%r13
  jle    L120
L44:
  mov    0x20(%rsp),%rax
  mov    0x48(%rsp),%rbp
  mov    %rax,%rbx
  add    %rax,%rbp
  nopw   0x0(%rax,%rax,1)
L7:
  mov    (%rbx),%rdi
  add    $0x8,%rbx
  call   <free@plt>
  cmp    %rbx,%rbp
  jne    L7
  mov    0x20(%rsp),%rdi
  xor    %ebx,%ebx
  call   <free@plt>
  mov    0x38(%rsp),%rbp
  nopw   0x0(%rax,%rax,1)
L103:
  mov    0x0(%rbp,%rbx,8),%rdi
  add    $0x1,%rbx
  call   <free@plt>
  cmp    %rbx,%r13
  jge    L103
L111:
  mov    0x38(%rsp),%rdi
  call   <free@plt>
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L185
  add    $0x68,%rsp
  mov    %r14d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L249:
  mov    (%rsi),%rax
  movl   $0xffffffff,(%rax,%rbp,1)
  jmp    L150
  nop
L143:
  sub    $0x8,%rsp
  mov    %rbp,%r9
  mov    %rbx,%r8
  mov    %r12d,%ecx
  push   0x28(%rsp)
  mov    %r15,%rsi
  xor    %eax,%eax
  call   <f@plt>
  mov    %eax,%r14d
  mov    0x64(%rsp),%eax
  lea    -0x1(%rax),%edi
  mov    0x40(%rsp),%rax
  movslq %edi,%rdx
  movb   $0x1,(%rax,%rdx,1)
  pop    %r8
  pop    %r9
  cmp    $0x1,%edi
  jg     L196
  jmp    L44
  nopl   0x0(%rax,%rax,1)
L33:
  shl    $0x3,%rax
  mov    0x10(%rsp),%r14
  mov    %rdx,%r15
  xor    %ebx,%ebx
  sub    %rax,%rcx
  mov    %rcx,%r13
  nopl   0x0(%rax)
L171:
  mov    (%r14),%rdi
  call   <strlen@plt>
  mov    %r15,%rsi
  add    %ebx,%eax
  lea    0x1(%rax),%ebx
  cmp    %r12d,%eax
  jg     L249
  mov    (%r15),%rax
  sub    $0x8,%r15
  sub    $0x8,%r14
  movl   $0x0,(%rax,%rbp,1)
  cmp    %r13,%r15
  jne    L171
  jmp    L150
L70:
  mov    0xc(%rsp),%r10d
  test   %r10d,%r10d
  jns    L187
  jmp    L48
L120:
  mov    0x20(%rsp),%rdi
  call   <free@plt>
  test   %r13,%r13
  jne    L111
  mov    0x38(%rsp),%rax
  mov    (%rax),%rdi
  call   <free@plt>
  jmp    L111
L185:
  call   <__stack_chk_fail@plt>
```

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;
}
```