user: Please show me the C implementation that matches the assembly code listed below:

```asm
<funcMochila>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x68,%rsp
  mov    %edi,%r14d
  mov    %rsi,-0x48(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %ecx,-0x7c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    0x1(%rdi),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rax
  mov    %rax,-0x78(%rbp)
  lea    0x1(%rcx),%eax
  cltq
  imul   %rdx,%rax
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L181:
  cmp    %rdx,%rsp
  je     L165
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L181
L165:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L78
  orq    $0x0,-0x8(%rsp,%rax,1)
L78:
  mov    %rsp,%rsi
  mov    %rsi,-0x60(%rbp)
  cmpl   $0x0,-0x7c(%rbp)
  js     L105
  mov    -0x78(%rbp),%rax
  shr    $0x2,%rax
  mov    %rax,-0x88(%rbp)
  mov    %rax,%r15
  neg    %r15
  mov    %rsi,-0x58(%rbp)
  mov    $0x0,%r13d
  mov    %r15,-0x70(%rbp)
  jmp    L168
L170:
  movl   $0x0,(%r12)
L108:
  add    $0x1,%ebx
  add    $0x4,%r12
  cmp    %ebx,%r14d
  jl     L68
L75:
  test   %r13d,%r13d
  je     L170
  test   %ebx,%ebx
  je     L170
  mov    -0x48(%rbp),%rax
  mov    -0x4(%rax,%r13,4),%eax
  cmp    %ebx,%eax
  jle    L184
  mov    (%r12,%r15,4),%eax
  mov    %eax,(%r12)
  jmp    L108
L184:
  mov    -0x70(%rbp),%rcx
  mov    (%r12,%rcx,4),%esi
  mov    %ebx,%edx
  sub    %eax,%edx
  movslq %edx,%rax
  add    -0x50(%rbp),%rax
  mov    -0x68(%rbp),%rcx
  mov    -0x4(%rcx,%r13,4),%edi
  mov    -0x60(%rbp),%rcx
  add    (%rcx,%rax,4),%edi
  call   <max@plt>
  mov    %eax,(%r12)
  jmp    L108
L151:
  mov    $0x0,%ebx
L68:
  lea    0x1(%r13),%r12d
  add    $0x1,%r13
  mov    -0x78(%rbp),%rsi
  add    %rsi,-0x58(%rbp)
  cmp    %r13d,-0x7c(%rbp)
  jl     L1
L168:
  mov    -0x58(%rbp),%r12
  mov    $0x0,%ebx
  test   %r14d,%r14d
  js     L151
  lea    -0x1(%r13),%eax
  cltq
  imul   -0x88(%rbp),%rax
  mov    %rax,-0x50(%rbp)
  jmp    L75
L105:
  mov    $0x0,%r12d
L1:
  sub    $0x1,%ebx
  mov    -0x78(%rbp),%r13
  shr    $0x2,%r13
  movslq %r14d,%rax
  movslq -0x7c(%rbp),%rdx
  imul   %r13,%rdx
  add    %rdx,%rax
  mov    -0x60(%rbp),%r14
  mov    (%r14,%rax,4),%esi
  lea    D19(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D13(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movslq %ebx,%rdx
  lea    -0x1(%r12),%eax
  cltq
  imul   %r13,%rax
  add    %rdx,%rax
  mov    (%r14,%rax,4),%ecx
  test   %ecx,%ecx
  je     L35
  sub    $0x2,%r12d
  movslq %r12d,%r12
  lea    D10(%rip),%r15
  jmp    L94
L64:
  movslq %ebx,%rax
  movslq -0x50(%rbp),%rdx
  imul   %r13,%rdx
  add    %rdx,%rax
  mov    (%r14,%rax,4),%ecx
  sub    $0x1,%r12
  test   %ecx,%ecx
  je     L35
L94:
  lea    0x1(%r12),%esi
  mov    %r12d,-0x50(%rbp)
  movslq %ebx,%rax
  movslq %r12d,%rdx
  imul   %r13,%rdx
  add    %rdx,%rax
  cmp    %ecx,(%r14,%rax,4)
  je     L64
  mov    %r15,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x48(%rbp),%rax
  sub    (%rax,%r12,4),%ebx
  jmp    L64
L35:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L45
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L45:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D19
datatype: string
name: parse_data
arguments: data_label: D13
datatype: string
name: parse_data
arguments: data_label: D10
datatype: string

tool: D19: valor : %d 


tool: D13: posicoes escolhidas : 

tool: D10:  %d 

assistant: ```c
void funcMochila(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] = max(val[i - 1] + K[i - 1][w - wt[i - 1]], K[i - 1][w]);
      else
        K[i][w] = K[i - 1][w];
    }
  }
  i--;
  w--;
  printf("valor : %d \n", K[n][W]);
  printf("posicoes escolhidas : ");
  while (K[i][w]) {
    if (K[i][w] == K[i - 1][w])
      i--;
    else {
      printf(" %d ", i);
      i--;
      w = w - wt[i];
    }
  }
}
```