user: 请从给定的汇编指令推导出C源代码:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x753000(%rsp),%r11
L107:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L107
  sub    $0x308,%rsp
  lea    D14(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x7532f8(%rsp)
  xor    %eax,%eax
  lea    0x1c(%rsp),%rdx
  lea    0x18(%rsp),%rsi
  lea    0x2f0(%rsp),%r13
  call   <scanf@plt>
  xor    %esi,%esi
  mov    $0x753000,%edx
  mov    %r13,%rdi
  call   <memset@plt>
  mov    0x1c(%rsp),%esi
  test   %esi,%esi
  jle    L149
  mov    $0x4,%ebx
  lea    0x110(%rsp),%rax
  mov    $0x1,%r12d
  mov    %rax,(%rsp)
  lea    0x200(%rsp),%r15
  lea    0x20(%rsp),%r14
  lea    D24(%rip),%rbp
  nopl   (%rax)
L19:
  mov    (%rsp),%rax
  lea    (%r14,%rbx,1),%rsi
  lea    (%r15,%rbx,1),%rcx
  mov    %rbp,%rdi
  add    $0x1,%r12d
  lea    (%rax,%rbx,1),%rdx
  xor    %eax,%eax
  add    $0x4,%rbx
  call   <scanf@plt>
  mov    0x1c(%rsp),%esi
  cmp    %r12d,%esi
  jge    L19
  mov    0x18(%rsp),%r10d
  movslq %r10d,%rax
  test   %esi,%esi
  jle    L103
  lea    0x1f6f0(%rsp),%rdx
  lea    0x204(%rsp),%r15
  mov    $0x2,%r12d
  lea    0x24(%rsp),%r14
  test   %r10d,%r10d
  jle    L103
  nopw   0x0(%rax,%rax,1)
L141:
  lea    -0x2(%r12),%ebp
  mov    $0x1,%ebx
  movslq %ebp,%rbp
  imul   $0x7d00,%rbp,%rbp
  jmp    L24
  cs nopw 0x0(%rax,%rax,1)
L158:
  cmp    %ebx,%esi
  jle    L3
L36:
  mov    %edi,(%rdx,%rbx,4)
  add    $0x1,%rbx
  movslq %r10d,%rax
  cmp    %ebx,%r10d
  jl     L33
L24:
  movslq (%r15),%rax
  mov    (%r14),%esi
  mov    %ebx,%r8d
  mov    0x0(%r13,%rbx,4),%edi
  test   %eax,%eax
  je     L158
  mov    0x20(%rsp,%rax,4),%r9d
  lea    (%r9,%rsi,1),%r11d
  cmp    %ebx,%r11d
  jg     L36
  sub    %r9d,%r8d
  mov    (%rsp),%rcx
  mov    %rdx,0x8(%rsp)
  imul   0x110(%rsp,%rax,4),%r9d
  sub    %esi,%r8d
  movslq %r8d,%r8
  imul   -0x4(%rcx,%r12,4),%esi
  add    %rbp,%r8
  add    0x2f0(%rsp,%r8,4),%esi
  add    %r9d,%esi
  call   <max@plt>
  mov    0x8(%rsp),%rdx
  mov    0x18(%rsp),%r10d
  mov    %eax,%edi
  mov    %edi,(%rdx,%rbx,4)
  add    $0x1,%rbx
  movslq %r10d,%rax
  cmp    %ebx,%r10d
  jge    L24
  cs nopw 0x0(%rax,%rax,1)
L33:
  mov    0x1c(%rsp),%esi
  cmp    %r12d,%esi
  jl     L103
  add    $0x1,%r12
  add    $0x1f400,%rdx
  add    $0x4,%r15
  add    $0x4,%r14
  add    $0x1f400,%r13
  test   %r10d,%r10d
  jg     L141
L103:
  movslq %esi,%rdx
  lea    D19(%rip),%rdi
  imul   $0x7d00,%rdx,%rdx
  add    %rdx,%rax
  mov    0x2f0(%rsp,%rax,4),%esi
  call   <printf@plt>
  mov    0x7532f8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L120
  add    $0x753308,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L3:
  sub    %esi,%r8d
  mov    (%rsp),%rax
  mov    %rdx,0x8(%rsp)
  movslq %r8d,%r8
  add    %rbp,%r8
  imul   -0x4(%rax,%r12,4),%esi
  add    0x2f0(%rsp,%r8,4),%esi
  call   <max@plt>
  mov    0x18(%rsp),%r10d
  mov    0x8(%rsp),%rdx
  mov    %eax,%edi
  jmp    L36
L149:
  movslq 0x18(%rsp),%rax
  jmp    L103
L120:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D14
datatype: string
name: read_data
arguments: data_label: D24
datatype: string
name: read_data
arguments: data_label: D19
datatype: string

tool: D14: %d %d

tool: D24: %d %d %d

tool: D19: %d


assistant: ```c
int main() {
  int N, m;
  int v[60], p[60], q[60];
  int cnt = 0;
  scanf("%d %d", &N, &m);
  int dp[60][32000] = {0};
  for (int i = 1; i <= m; i++) {
    scanf("%d %d %d", &v[i], &p[i], &q[i]);
  }
  for (int i = 1; i < m + 1; i++) {
    for (int j = 1; j < N + 1; j++) {
      if (q[i] == 0) {
        if (j >= v[i])
          dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - v[i]] + v[i] * p[i]);
        else
          dp[i][j] = dp[i - 1][j];
      } else {
        if (j >= v[q[i]] + v[i])
          dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - v[q[i]] - v[i]] + v[i] * p[i] + v[q[i]] * p[q[i]]);
        else
          dp[i][j] = dp[i - 1][j];
      }
    }
  }
  printf("%d\n", dp[m][N]);
  return 0;
}
```