user: What is the c source code of the assembly code below:

```asm
<solve2>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,%r12d
  mov    %esi,-0x4c(%rbp)
  mov    %rdx,%r15
  mov    %rcx,%r13
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    0x1(%rsi),%eax
  mov    %eax,-0x50(%rbp)
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    %rsi,-0x48(%rbp)
  lea    0xf(,%rax,8),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L49:
  cmp    %rdx,%rsp
  je     L144
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L49
L144:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L175
  orq    $0x0,-0x8(%rsp,%rax,1)
L175:
  mov    %rsp,%rbx
  mov    -0x50(%rbp),%eax
  lea    0x0(,%rax,8),%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  mov    -0x4c(%rbp),%eax
  test   %eax,%eax
  js     L21
  mov    (%r15),%ecx
  lea    0x1(%rax),%edx
  mov    $0x0,%eax
  jmp    L162
L64:
  mov    0x0(%r13),%esi
  mov    %esi,(%rbx,%rax,4)
L100:
  add    $0x1,%rax
  cmp    %rdx,%rax
  je     L21
L162:
  cmp    %eax,%ecx
  jle    L64
  movl   $0x0,(%rbx,%rax,4)
  jmp    L100
L21:
  mov    -0x48(%rbp),%r14
  shr    $0x2,%r14
  mov    -0x50(%rbp),%esi
  mov    %rbx,%rdi
  call   <pvector@plt>
  mov    %r12d,%eax
  cmp    $0x1,%r12d
  jle    L36
  lea    0x4(%r13),%r12
  add    $0x4,%r15
  lea    -0x2(%rax),%eax
  lea    0x8(%r13,%rax,4),%rax
  mov    %rax,-0x58(%rbp)
  mov    $0x1,%r13d
  mov    -0x4c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x5c(%rbp)
  jmp    L59
L124:
  movslq %edx,%rdx
  mov    %r13d,%ecx
  xor    $0x1,%ecx
  movslq %ecx,%rcx
  imul   %r14,%rcx
  add    %rcx,%rdx
  mov    (%rbx,%rdx,4),%ecx
L8:
  mov    %ecx,(%rdi,%rax,4)
  add    $0x1,%rax
  add    $0x1,%esi
  cmp    %r9,%rax
  je     L177
L173:
  mov    %eax,%edx
  cmp    %eax,%r8d
  jg     L124
  mov    %r13d,%r10d
  xor    $0x1,%r10d
  movslq %esi,%r11
  movslq %r10d,%r10
  imul   %r14,%r10
  add    %r10,%r11
  mov    (%r12),%ecx
  add    (%rbx,%r11,4),%ecx
  movslq %eax,%r11
  add    %r11,%r10
  cmp    %ecx,(%rbx,%r10,4)
  jl     L8
  jmp    L124
L177:
  movslq %r13d,%rdi
  imul   -0x48(%rbp),%rdi
  add    %rbx,%rdi
  mov    -0x50(%rbp),%esi
  call   <pvector@plt>
  xor    $0x1,%r13d
  add    $0x4,%r12
  add    $0x4,%r15
  cmp    -0x58(%rbp),%r12
  je     L110
L59:
  cmpl   $0x0,-0x4c(%rbp)
  js     L177
  mov    (%r15),%r8d
  mov    %r8d,%esi
  neg    %esi
  mov    -0x5c(%rbp),%r9d
  movslq %r13d,%rdi
  imul   -0x48(%rbp),%rdi
  add    %rbx,%rdi
  mov    $0x0,%eax
  jmp    L173
L36:
  mov    $0x1,%r13d
L110:
  movslq -0x4c(%rbp),%rdx
  xor    $0x1,%r13d
  movslq %r13d,%rax
  imul   %r14,%rax
  add    %rdx,%rax
  mov    (%rbx,%rax,4),%eax
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L31
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L31:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int solve2(int n, int c, int weight[n], int profit[n]) {
  int i, j;
  int total[2][c + 1];
  int curr = 0;
  memset(total, 0, sizeof total);
  for (j = 0; j <= c; j++) {
    if (weight[0] > j) {
      total[curr][j] = 0;
    } else {
      total[curr][j] = profit[0];
    }
  }
  pvector(total[curr], c + 1);
  curr = !curr;
  for (i = 1; i < n; i++) {
    for (j = 0; j <= c; j++) {
      if ((j < weight[i]) || (total[!curr][j] >= total[!curr][j - weight[i]] + profit[i])) {
        total[curr][j] = total[!curr][j];
      } else {
        total[curr][j] = total[!curr][j - weight[i]] + profit[i];
      }
    }
    pvector(total[curr], c + 1);
    curr = !curr;
  }
  return total[!curr][c];
}
```