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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x1f000(%rsp),%r11
L242:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L242
  sub    $0x658,%rsp
  lea    D28(%rip),%rbx
  lea    D29(%rip),%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x1f648(%rsp)
  xor    %eax,%eax
  lea    0x2c(%rsp),%rax
  movl   $0x1,0xc(%rsp)
  mov    %rax,0x18(%rsp)
  lea    0x28(%rsp),%rax
  mov    %rax,0x10(%rsp)
  nopl   0x0(%rax,%rax,1)
L118:
  mov    0x18(%rsp),%rdx
  mov    0x10(%rsp),%rsi
  xor    %eax,%eax
  mov    %rbx,%rdi
  call   <scanf@plt>
  cmp    $0x2,%eax
  jne    L287
  lea    0x24(%rsp),%rsi
  lea    D21(%rip),%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x24(%rsp),%r11d
  test   %r11d,%r11d
  jle    L333
  lea    0x134(%rsp),%r15
  mov    $0x1,%r14d
  lea    0x30(%rsp),%r13
  lea    0xb0(%rsp),%r12
  nopl   0x0(%rax)
L42:
  lea    0x0(%r13,%r14,4),%rdx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    (%r15),%eax
  imul   0x2c(%rsp),%eax
  add    $0x4,%r15
  mov    0x24(%rsp),%r11d
  lea    (%rax,%rax,2),%eax
  mov    %eax,(%r12,%r14,4)
  add    $0x1,%r14
  cmp    %r14d,%r11d
  jge    L42
  movslq 0x28(%rsp),%r15
  test   %r15d,%r15d
  js     L177
L239:
  lea    0x1(%r15),%r14d
  xor    %r8d,%r8d
  movslq %r15d,%r13
  movslq %r11d,%r10
  lea    0x1160(%rsp),%r12
  cs nopw 0x0(%rax,%rax,1)
L77:
  movl   $0x0,0x1160(%rsp,%r13,4)
  test   %r11d,%r11d
  jle    L76
  mov    (%r12),%edx
  mov    %r12,%rcx
  xor    %eax,%eax
  lea    0xb0(%rsp),%rdi
  jmp    L107
  nopl   0x0(%rax)
L300:
  mov    %r8d,%r9d
  sub    %esi,%r9d
  movslq %eax,%rsi
  imul   $0x3e9,%rsi,%rsi
  movslq %r9d,%r9
  add    %r9,%rsi
  mov    0x34(%rsp,%rax,4),%r9d
  add    0x1160(%rsp,%rsi,4),%r9d
  cmp    %r9d,%edx
  cmovl  %r9d,%edx
L223:
  add    $0x1,%rax
  mov    %edx,0xfa4(%rcx)
  add    $0xfa4,%rcx
  cmp    %r10,%rax
  je     L76
L107:
  mov    0x4(%rdi,%rax,4),%esi
  cmp    %r8d,%esi
  jle    L300
  xor    %esi,%esi
  test   %edx,%edx
  cmovs  %esi,%edx
  jmp    L223
  nopw   0x0(%rax,%rax,1)
L76:
  add    $0x1,%r8d
  add    $0x4,%r12
  cmp    %r14d,%r8d
  jne    L77
L177:
  test   %r11d,%r11d
  jle    L95
  movslq %r11d,%rdx
  mov    %r15d,%edi
  movslq %r15d,%rsi
  lea    0x1b0(%rsp),%r12
  lea    0xb0(%rsp),%r8
  nop
L93:
  lea    -0x1(%rdx),%eax
  movslq %edx,%rcx
  cltq
  imul   $0x3e9,%rcx,%rcx
  imul   $0x3e9,%rax,%rax
  add    %rsi,%rcx
  add    %rsi,%rax
  mov    0x1160(%rsp,%rax,4),%eax
  cmp    %eax,0x1160(%rsp,%rcx,4)
  je     L94
  movl   $0x1,(%r12,%rdx,4)
  sub    (%r8,%rdx,4),%edi
  sub    $0x1,%rdx
  test   %edx,%edx
  jle    L95
  movslq %edi,%rsi
  jmp    L93
  nopl   (%rax)
L94:
  movl   $0x0,(%r12,%rdx,4)
  sub    $0x1,%rdx
  test   %edx,%edx
  jg     L93
L95:
  mov    0xc(%rsp),%ecx
  test   %ecx,%ecx
  je     L114
L115:
  movslq %r11d,%rax
  lea    D49(%rip),%rdi
  imul   $0x3e9,%rax,%rax
  add    %r15,%rax
  mov    0x1160(%rsp,%rax,4),%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x24(%rsp),%edx
  test   %edx,%edx
  jle    L174
  lea    -0x1(%rdx),%eax
  cmp    $0x2,%eax
  jbe    L163
  mov    %edx,%ecx
  lea    0x1b4(%rsp),%rax
  pxor   %xmm0,%xmm0
  shr    $0x2,%ecx
  sub    $0x1,%ecx
  shl    $0x4,%rcx
  lea    0x1c4(%rsp,%rcx,1),%rcx
  xchg   %ax,%ax
L43:
  movdqu (%rax),%xmm2
  add    $0x10,%rax
  paddd  %xmm2,%xmm0
  cmp    %rcx,%rax
  jne    L43
  movdqa %xmm0,%xmm1
  mov    %edx,%ecx
  psrldq $0x8,%xmm1
  and    $0xfffffffc,%ecx
  paddd  %xmm1,%xmm0
  lea    0x1(%rcx),%eax
  movdqa %xmm0,%xmm1
  psrldq $0x4,%xmm1
  paddd  %xmm1,%xmm0
  movd   %xmm0,%esi
  cmp    %edx,%ecx
  je     L193
L198:
  movslq %eax,%rcx
  add    0x1b0(%rsp,%rcx,4),%esi
  lea    0x1(%rax),%ecx
  cmp    %ecx,%edx
  jl     L193
  movslq %ecx,%rcx
  add    $0x2,%eax
  add    0x1b0(%rsp,%rcx,4),%esi
  cmp    %eax,%edx
  jl     L193
  cltq
  add    0x1b0(%rsp,%rax,4),%esi
L193:
  lea    D49(%rip),%rdi
  xor    %eax,%eax
  mov    $0x1,%r13d
  call   <printf@plt>
  mov    0x24(%rsp),%eax
  lea    0x1b0(%rsp),%r12
  test   %eax,%eax
  jle    L24
  nopw   0x0(%rax,%rax,1)
L288:
  mov    (%r12,%r13,4),%edx
  test   %edx,%edx
  jne    L36
  add    $0x1,%r13
  cmp    %r13d,%eax
  jge    L288
L24:
  movl   $0x0,0xc(%rsp)
  jmp    L118
  xchg   %ax,%ax
L36:
  mov    0x30(%rsp,%r13,4),%edx
  mov    0x130(%rsp,%r13,4),%esi
  mov    %rbp,%rdi
  xor    %eax,%eax
  add    $0x1,%r13
  call   <printf@plt>
  mov    0x24(%rsp),%eax
  cmp    %r13d,%eax
  jge    L288
  movl   $0x0,0xc(%rsp)
  jmp    L118
L114:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x24(%rsp),%r11d
  movslq 0x28(%rsp),%r15
  jmp    L115
L287:
  mov    0x1f648(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L116
  add    $0x1f658,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L333:
  movslq 0x28(%rsp),%r15
  test   %r15d,%r15d
  jns    L239
  jmp    L95
L174:
  xor    %esi,%esi
  jmp    L193
L163:
  xor    %esi,%esi
  mov    $0x1,%eax
  jmp    L198
L116:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D28
type: string
name: extract_symbolic_data
arguments: data_label: D29
type: string
name: extract_symbolic_data
arguments: data_label: D21
type: string
name: extract_symbolic_data
arguments: data_label: D49
type: string

tool: D28: %d %d

tool: D29: %d %d


tool: D21: %d

tool: D49: %d


assistant: ```c
int main() {
  int n, W, k;
  int t[30 + 1][1000 + 1];
  int saida[1000 + 1];
  int nrecovered;
  int v[30 + 1], w[30 + 1], d[30 + 1];
  int a, b;
  int i, y;
  int primeiro;
  primeiro = 1;
  while (scanf("%d %d", &W, &k) == 2) {
    scanf("%d", &n);
    for (i = 1; i <= n; i++) {
      scanf("%d %d", &d[i], &v[i]);
      w[i] = d[i] * 3 * k;
    }
    if (0) {
      printf("W = %d, k = %d, n = %d\n", W, k, n);
      printf("i => d[i] , v[i] , w[i]\n");
      for (i = 0; i <= n; i++) {
        printf("%d => %d  , %d  , %d\n", i, d[i], v[i], w[i]);
      }
    }
    for (y = 0; y <= W; y++) {
      t[0][W] = 0;
      for (i = 1; i <= n; i++) {
        a = t[i - 1][y];
        if (w[i] > y)
          b = 0;
        else
          b = t[i - 1][y - w[i]] + v[i];
        if (a >= b)
          t[i][y] = a;
        else {
          t[i][y] = b;
        }
      }
    }
    y = W;
    for (i = n; i > 0; i--) {
      if (t[i][y] == t[i - 1][y]) {
        saida[i] = 0;
      } else {
        saida[i] = 1;
        y -= w[i];
      }
    }
    if (!primeiro)
      printf("\n");
    primeiro = 0;
    printf("%d\n", t[n][W]);
    nrecovered = 0;
    for (i = 1; i <= n; i++) {
      nrecovered += saida[i];
    }
    printf("%d\n", nrecovered);
    for (i = 1; i <= n; i++) {
      if (saida[i])
        printf("%d %d\n", d[i], v[i]);
    }
  }
  return 0;
}
```