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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %rsi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  mov    0x8(%rsi),%r14
  cmp    $0x3,%edi
  jne    L16
L85:
  movzbl (%r14),%eax
  mov    %eax,%edx
  and    $0xffffffef,%edx
  cmp    $0x2d,%dl
  je     L159
  cmp    $0x2b,%al
  jne    L149
L159:
  lea    0x1(%r14),%rbp
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <atoi@plt>
  mov    %eax,%r13d
  cmp    $0xfff0,%eax
  ja     L11
L236:
  mov    0x10(%rbx),%rdi
  mov    $0x2,%esi
  mov    $0x0,%eax
  call   <open@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  js     L129
L84:
  lea    0x10(%rsp),%rsi
  mov    $0x40,%edx
  mov    %r12d,%edi
  mov    $0x0,%eax
  call   <read@plt>
  cmp    $0x40,%eax
  jne    L183
L68:
  cmpw   $0x301,0x10(%rsp)
  jne    L243
L218:
  mov    0x10(%rsp),%rdx
  sar    $0x15,%rdx
  mov    0x28(%rsp),%rax
  mov    0x30(%rsp),%rsi
  mov    0x40(%rsp),%rbp
  sub    %rax,%rbp
  sub    %rsi,%rbp
  mov    %edx,%ecx
  and    $0x1,%ecx
  jne    L168
  sub    0x20(%rsp),%rbp
  movzbl (%r14),%edx
  cmp    $0x3d,%dl
  jne    L208
  add    %rsi,%rax
  add    %r13,%rax
  mov    $0x10000,%edx
  cmp    %rdx,%rax
  cmovge %rax,%rdx
  sub    $0x10000,%rdx
  mov    %r13,%r15
  sub    %rdx,%r15
  sub    %rdx,%rax
  jmp    L120
L16:
  call   <usage@plt>
  jmp    L85
L149:
  mov    $0x0,%eax
  call   <usage@plt>
  jmp    L159
L11:
  lea    D78(%rip),%rdx
  mov    %rbp,%rsi
  lea    D96(%rip),%rdi
  mov    $0x0,%eax
  call   <stderr3@plt>
  jmp    L236
L129:
  mov    0x10(%rbx),%rsi
  lea    D64(%rip),%rdx
  lea    D91(%rip),%rdi
  mov    $0x0,%eax
  call   <stderr3@plt>
  jmp    L84
L183:
  mov    0x10(%rbx),%rsi
  lea    D16(%rip),%rdx
  lea    D96(%rip),%rdi
  mov    $0x0,%eax
  call   <stderr3@plt>
  jmp    L68
L243:
  mov    0x10(%rbx),%rsi
  lea    D62(%rip),%rdx
  lea    D96(%rip),%rdi
  mov    $0x0,%eax
  call   <stderr3@plt>
  jmp    L218
L125:
  lea    0x0(%r13,%rbp,1),%r15
  jmp    L133
L150:
  mov    %rbp,%r15
  sub    %r13,%r15
  jmp    L133
L122:
  mov    0x10(%rbx),%rsi
  lea    D64(%rip),%rdx
  lea    D73(%rip),%rdi
  mov    $0x0,%eax
  call   <stderr3@plt>
  jmp    L206
L198:
  add    %rsi,%rax
  add    %r13,%rax
  mov    $0x10000,%edx
  cmp    %rdx,%rax
  cmovge %rax,%rdx
  sub    $0x10000,%rdx
  mov    %r13,%r15
  sub    %rdx,%r15
  sub    %rdx,%rax
  mov    %rax,0x8(%rsp)
  jmp    L62
L168:
  movzbl (%r14),%edx
  cmp    $0x3d,%dl
  je     L198
L208:
  cmp    $0x2b,%dl
  je     L125
  cmp    $0x2d,%dl
  je     L150
L133:
  add    %rsi,%rax
  add    %r15,%rax
  mov    $0x10000,%edx
  cmp    %rdx,%rax
  cmovge %rax,%rdx
  sub    $0x10000,%rdx
  sub    %rdx,%r15
  sub    %rdx,%rax
  mov    %rax,0x8(%rsp)
  test   %ecx,%ecx
  jne    L62
L120:
  add    0x20(%rsp),%rax
  mov    %rax,0x8(%rsp)
L62:
  mov    $0x0,%edx
  mov    $0x18,%esi
  mov    %r12d,%edi
  mov    $0x0,%eax
  call   <lseek@plt>
  lea    0x8(%rsp),%rsi
  mov    $0x4,%edx
  mov    %r12d,%edi
  mov    $0x0,%eax
  call   <write@plt>
  test   %eax,%eax
  js     L122
L206:
  mov    0x10(%rbx),%rsi
  mov    %r15,%rcx
  mov    %rbp,%rdx
  lea    D97(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%edi
  call   <exit@plt>
```

tool_calls: name: read_data
arguments: data_label: D78
type: string
name: read_data
arguments: data_label: D96
type: string
name: read_data
arguments: data_label: D64
type: string
name: read_data
arguments: data_label: D91
type: string
name: read_data
arguments: data_label: D16
type: string
name: read_data
arguments: data_label: D62
type: string
name: read_data
arguments: data_label: D73
type: string
name: read_data
arguments: data_label: D97
type: string

tool: D78:  too large


tool: D96: chmem: 

tool: D64: 


tool: D91: chmem: can't open 

tool: D16: bad header


tool: D62:  not executable


tool: D73: chmem: can't modify 

tool: D97: %s: Stack+malloc area changed from %D to %D bytes.


assistant: ```c
main(argc, argv) int argc;
char *argv[];
{
  char *p;
  unsigned int n;
  int fd, separate;
  long lsize, olddynam, newdynam, newtot, overflow, header[8];
  p = argv[1];
  if (argc != 3)
    usage();
  if (*p != '=' && *p != '+' && *p != '-')
    usage();
  n = atoi(p + 1);
  lsize = n;
  if (n > 65520)
    stderr3("chmem: ", p + 1, " too large\n");
  fd = open(argv[2], 2);
  if (fd < 0)
    stderr3("chmem: can't open ", argv[2], "\n");
  if (read(fd, header, sizeof(header)) != sizeof(header))
    stderr3("chmem: ", argv[2], "bad header\n");
  if ((header[0] & 0xFFFF) != 0x0301)
    stderr3("chmem: ", argv[2], " not executable\n");
  separate = (header[0] & 0x00200000 ? 1 : 0);
  olddynam = header[6] - header[3] - header[4];
  if (separate == 0)
    olddynam -= header[2];
  if (*p == '=')
    newdynam = lsize;
  else if (*p == '+')
    newdynam = olddynam + lsize;
  else if (*p == '-')
    newdynam = olddynam - lsize;
  newtot = header[3] + header[4] + newdynam;
  overflow = (newtot > 65536L ? newtot - 65536L : 0);
  newdynam -= overflow;
  newtot -= overflow;
  if (separate == 0)
    newtot += header[2];
  lseek(fd, (long)24, 0);
  if (write(fd, &newtot, 4) < 0)
    stderr3("chmem: can't modify ", argv[2], "\n");
  printf("%s: Stack+malloc area changed from %D to %D bytes.\n", argv[2], olddynam, newdynam);
  exit(0);
}
```