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

```asm
<knapSack>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x68,%rsp
  mov    %edi,-0x64(%rbp)
  mov    %rsi,-0x70(%rbp)
  mov    %rdx,-0x78(%rbp)
  mov    %ecx,-0x68(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,-0x80(%rbp)
  mov    -0x64(%rbp),%eax
  lea    0x1(%rax),%esi
  mov    -0x68(%rbp),%eax
  lea    0x1(%rax),%edi
  movslq %esi,%rax
  sub    $0x1,%rax
  mov    %rax,-0x50(%rbp)
  movslq %esi,%rax
  mov    %rax,-0x90(%rbp)
  movq   $0x0,-0x88(%rbp)
  movslq %esi,%rax
  lea    0x0(,%rax,4),%rcx
  movslq %edi,%rax
  sub    $0x1,%rax
  mov    %rax,-0x48(%rbp)
  movslq %esi,%rax
  mov    %rax,%r14
  mov    $0x0,%r15d
  movslq %edi,%rax
  mov    %rax,%r12
  mov    $0x0,%r13d
  mov    %r15,%rdx
  imul   %r12,%rdx
  mov    %r13,%rax
  imul   %r14,%rax
  lea    (%rdx,%rax,1),%rbx
  mov    %r14,%rax
  mul    %r12
  add    %rdx,%rbx
  mov    %rbx,%rdx
  movslq %esi,%rax
  mov    %rax,%r10
  mov    $0x0,%r11d
  movslq %edi,%rax
  mov    %rax,%r8
  mov    $0x0,%r9d
  mov    %r11,%rdx
  imul   %r8,%rdx
  mov    %r9,%rax
  imul   %r10,%rax
  lea    (%rdx,%rax,1),%rbx
  mov    %r10,%rax
  mul    %r8
  lea    (%rbx,%rdx,1),%r8
  mov    %r8,%rdx
  movslq %esi,%rdx
  movslq %edi,%rax
  imul   %rdx,%rax
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%ebx
  mov    $0x0,%edx
  div    %rbx
  imul   $0x10,%rax,%rax
  mov    %rax,%rsi
  and    $0xfffffffffffff000,%rsi
  mov    %rsp,%rdx
  sub    %rsi,%rdx
L77:
  cmp    %rdx,%rsp
  je     L53
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L77
L53:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L19
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L19:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x40(%rbp)
  movl   $0x0,-0x58(%rbp)
  jmp    L56
L100:
  movl   $0x0,-0x54(%rbp)
  jmp    L54
L18:
  cmpl   $0x0,-0x58(%rbp)
  je     L20
  cmpl   $0x0,-0x54(%rbp)
  jne    L80
L20:
  mov    %rcx,%rsi
  shr    $0x2,%rsi
  mov    -0x40(%rbp),%rax
  mov    -0x54(%rbp),%edx
  movslq %edx,%rdi
  mov    -0x58(%rbp),%edx
  movslq %edx,%rdx
  imul   %rsi,%rdx
  add    %rdi,%rdx
  movl   $0x0,(%rax,%rdx,4)
  jmp    L47
L80:
  mov    -0x58(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x54(%rbp)
  jl     L89
  mov    %rcx,%rsi
  shr    $0x2,%rsi
  mov    -0x58(%rbp),%eax
  lea    -0x1(%rax),%edi
  mov    -0x40(%rbp),%rax
  mov    -0x54(%rbp),%edx
  movslq %edx,%r8
  movslq %edi,%rdx
  imul   %rsi,%rdx
  add    %r8,%rdx
  mov    (%rax,%rdx,4),%eax
  mov    -0x58(%rbp),%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  lea    -0x4(%rdx),%rsi
  mov    -0x78(%rbp),%rdx
  add    %rsi,%rdx
  mov    (%rdx),%r9d
  mov    %rcx,%rdi
  shr    $0x2,%rdi
  mov    -0x58(%rbp),%edx
  lea    -0x1(%rdx),%esi
  mov    -0x58(%rbp),%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  lea    -0x4(%rdx),%r8
  mov    -0x70(%rbp),%rdx
  add    %r8,%rdx
  mov    (%rdx),%r10d
  mov    -0x54(%rbp),%edx
  sub    %r10d,%edx
  mov    %edx,%r8d
  mov    -0x40(%rbp),%rdx
  movslq %r8d,%r8
  movslq %esi,%rsi
  imul   %rdi,%rsi
  add    %r8,%rsi
  mov    (%rdx,%rsi,4),%edx
  add    %r9d,%edx
  mov    %rcx,%rdi
  shr    $0x2,%rdi
  cmp    %edx,%eax
  cmovge %eax,%edx
  mov    -0x40(%rbp),%rax
  mov    -0x54(%rbp),%esi
  movslq %esi,%r8
  mov    -0x58(%rbp),%esi
  movslq %esi,%rsi
  imul   %rdi,%rsi
  add    %r8,%rsi
  mov    %edx,(%rax,%rsi,4)
  jmp    L47
L89:
  mov    %rcx,%rsi
  shr    $0x2,%rsi
  mov    -0x58(%rbp),%eax
  lea    -0x1(%rax),%r8d
  mov    %rcx,%rdi
  shr    $0x2,%rdi
  mov    -0x40(%rbp),%rax
  mov    -0x54(%rbp),%edx
  movslq %edx,%r9
  movslq %r8d,%rdx
  imul   %rsi,%rdx
  add    %r9,%rdx
  mov    (%rax,%rdx,4),%edx
  mov    -0x40(%rbp),%rax
  mov    -0x54(%rbp),%esi
  movslq %esi,%r8
  mov    -0x58(%rbp),%esi
  movslq %esi,%rsi
  imul   %rdi,%rsi
  add    %r8,%rsi
  mov    %edx,(%rax,%rsi,4)
L47:
  addl   $0x1,-0x54(%rbp)
L54:
  mov    -0x54(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jle    L18
  addl   $0x1,-0x58(%rbp)
L56:
  mov    -0x58(%rbp),%eax
  cmp    -0x68(%rbp),%eax
  jle    L100
  shr    $0x2,%rcx
  mov    -0x40(%rbp),%rax
  mov    -0x64(%rbp),%edx
  movslq %edx,%rsi
  mov    -0x68(%rbp),%edx
  movslq %edx,%rdx
  imul   %rcx,%rdx
  add    %rsi,%rdx
  mov    (%rax,%rdx,4),%eax
  mov    -0x80(%rbp),%rsp
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L43
  call   <__stack_chk_fail@plt>
L43:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

assistant: ```c
int knapSack(int W, int wt[], int val[], int n) {
  int i, w;
  int K[n + 1][W + 1];
  for (i = 0; i <= n; i++) {
    for (w = 0; w <= W; w++) {
      if (i == 0 || w == 0)
        K[i][w] = 0;
      else if (wt[i - 1] <= w)
        K[i][w] = ((val[i - 1] + K[i - 1][w - wt[i - 1]] > K[i - 1][w]) ? val[i - 1] + K[i - 1][w - wt[i - 1]] : K[i - 1][w]);
      else
        K[i][w] = K[i - 1][w];
    }
  }
  return K[n][W];
}
```