user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  lea    D16(%rip),%r12
  push   %rbp
  mov    %r12,%rdi
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x20(%rsp),%rsi
  call   <scanf@plt>
  mov    0x20(%rsp),%eax
  lea    0x0(,%rax,4),%edi
  call   <malloc@plt>
  mov    %rax,0x10(%rsp)
  mov    %rax,%rbp
  mov    0x20(%rsp),%eax
  lea    0x0(,%rax,4),%edi
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  mov    0x20(%rsp),%eax
  test   %eax,%eax
  jle    L36
  nopl   (%rax)
L13:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  add    $0x1,%ebx
  add    $0x4,%rbp
  call   <scanf@plt>
  mov    0x20(%rsp),%eax
  cmp    %ebx,%eax
  jg     L13
  test   %eax,%eax
  jle    L36
  mov    0x8(%rsp),%rbp
  xor    %ebx,%ebx
  nopl   (%rax)
L110:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  add    $0x1,%ebx
  add    $0x4,%rbp
  call   <scanf@plt>
  cmp    %ebx,0x20(%rsp)
  jg     L110
L36:
  mov    %r12,%rdi
  lea    0x24(%rsp),%rsi
  call   <scanf@plt>
  mov    0x24(%rsp),%eax
  mov    0x20(%rsp),%esi
  lea    0x1(%rax),%edi
  call   <build_matrix@plt>
  mov    0x20(%rsp),%esi
  mov    %rax,0x18(%rsp)
  mov    0x24(%rsp),%eax
  lea    0x1(%rax),%edi
  call   <build_matrix@plt>
  mov    0x20(%rsp),%esi
  mov    %rax,%r12
  test   %esi,%esi
  jle    L120
  mov    (%rax),%rdx
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L82:
  movl   $0x0,(%rdx,%rax,4)
  mov    0x20(%rsp),%esi
  add    $0x1,%rax
  cmp    %eax,%esi
  jg     L82
L120:
  mov    0x24(%rsp),%eax
  test   %eax,%eax
  jle    L87
  mov    0x18(%rsp),%rcx
  mov    $0x1,%r13d
  lea    0x8(%rcx),%r14
  cs nopw 0x0(%rax,%rax,1)
L98:
  mov    %r13d,0x4(%rsp)
  test   %esi,%esi
  jle    L122
  mov    (%r12,%r13,8),%rbx
  xor    %r15d,%r15d
  xor    %ebp,%ebp
  xor    %edi,%edi
  jmp    L117
  cs nopw 0x0(%rax,%rax,1)
L4:
  mov    (%r12,%r13,8),%rbx
  mov    (%rbx,%r15,1),%edi
  add    $0x4,%r15
L117:
  mov    0x8(%rsp),%rcx
  mov    0x4(%rsp),%eax
  xor    %esi,%esi
  sub    (%rcx,%r15,1),%eax
  js     L3
  cltq
  mov    0x10(%rsp),%rcx
  mov    (%r12,%rax,8),%rax
  mov    (%rcx,%r15,1),%esi
  add    -0x4(%rax,%r15,1),%esi
L3:
  mov    (%r14),%rdx
  add    %r15,%rbx
  add    $0x1,%ebp
  add    %r15,%rdx
  call   <max@plt>
  mov    %eax,(%rbx)
  mov    0x20(%rsp),%esi
  cmp    %ebp,%esi
  jg     L4
  mov    0x24(%rsp),%eax
L122:
  add    $0x1,%r13
  add    $0x8,%r14
  cmp    %r13d,%eax
  jge    L98
L87:
  mov    %r12,%rdx
  lea    0x1(%rax),%edi
  lea    D18(%rip),%rbp
  call   <print_matrix@plt>
  mov    %rbp,%rdi
  call   <puts@plt>
  mov    0x18(%rsp),%rbx
  mov    0x24(%rsp),%eax
  mov    0x20(%rsp),%esi
  mov    %rbx,%rdx
  lea    0x1(%rax),%edi
  call   <print_matrix@plt>
  lea    D28(%rip),%rdi
  call   <printf@plt>
  mov    0x20(%rsp),%edi
  mov    0x24(%rsp),%esi
  mov    %rbx,%r8
  mov    0x8(%rsp),%rdx
  mov    %r12,%rcx
  call   <print_picked@plt>
  mov    %rbp,%rdi
  call   <puts@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L2
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L2:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D16
datatype: string
name: retrieve_data
arguments: label: D18
datatype: string
name: retrieve_data
arguments: label: D28
datatype: string

tool: D16: %d

tool: 

tool: D28: 
Picked: 

assistant: ```c
int main() {
  int i, j, x, y;
  int n, b;
  int *vs;
  int *ws;
  int **ps;
  int **zs;
  scanf("%d", &n);
  vs = (int *)malloc(sizeof(int) * n);
  ws = (int *)malloc(sizeof(int) * n);
  for (i = 0; i < n; i++)
    scanf("%d", &vs[i]);
  for (i = 0; i < n; i++)
    scanf("%d", &ws[i]);
  scanf("%d", &b);
  ps = build_matrix(b + 1, n);
  zs = build_matrix(b + 1, n);
  for (i = 0; i < n; i++)
    zs[0][i] = 0;
  for (i = 1; i <= b; i++)
    for (j = 0; j < n; j++) {
      x = (j - 1 < 0) ? 0 : zs[i][j - 1];
      y = (i - ws[j] < 0) ? 0 : vs[j] + zs[i - ws[j]][j - 1];
      zs[i][j] = max(x, y, &ps[i][j]);
    }
  print_matrix(b + 1, n, zs);
  puts("");
  print_matrix(b + 1, n, ps);
  printf("\nPicked: ");
  print_picked(n, b, ws, zs, ps);
  puts("");
}
```