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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xa0,%rsp
  mov    %edi,-0x94(%rbp)
  mov    %rsi,-0xa0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0xa0(%rbp),%rax
  mov    0x8(%rax),%rax
  mov    %rax,-0x68(%rbp)
  cmpl   $0x3,-0x94(%rbp)
  je     L135
  mov    $0x0,%eax
  call   <usage@plt>
L135:
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3d,%al
  je     L119
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  je     L119
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  je     L119
  mov    $0x0,%eax
  call   <usage@plt>
L119:
  mov    -0x68(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <atoi@plt>
  mov    %eax,-0x8c(%rbp)
  mov    -0x8c(%rbp),%eax
  mov    %rax,-0x60(%rbp)
  cmpl   $0xfff0,-0x8c(%rbp)
  jbe    L10
  mov    -0x68(%rbp),%rax
  add    $0x1,%rax
  lea    D106(%rip),%rdx
  mov    %rax,%rsi
  lea    D75(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <stderr3@plt>
L10:
  mov    -0xa0(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  mov    $0x2,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <open@plt>
  mov    %eax,-0x88(%rbp)
  cmpl   $0x0,-0x88(%rbp)
  jns    L75
  mov    -0xa0(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  lea    D104(%rip),%rdx
  mov    %rax,%rsi
  lea    D85(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <stderr3@plt>
L75:
  lea    -0x50(%rbp),%rcx
  mov    -0x88(%rbp),%eax
  mov    $0x40,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <read@plt>
  cmp    $0x40,%eax
  je     L156
  mov    -0xa0(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  lea    D14(%rip),%rdx
  mov    %rax,%rsi
  lea    D75(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <stderr3@plt>
L156:
  mov    -0x50(%rbp),%rax
  movzwl %ax,%eax
  cmp    $0x301,%rax
  je     L97
  mov    -0xa0(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  lea    D30(%rip),%rdx
  mov    %rax,%rsi
  lea    D75(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <stderr3@plt>
L97:
  mov    -0x50(%rbp),%rax
  sar    $0x15,%rax
  and    $0x1,%eax
  mov    %eax,-0x84(%rbp)
  mov    -0x20(%rbp),%rax
  mov    -0x38(%rbp),%rdx
  sub    %rdx,%rax
  mov    -0x30(%rbp),%rdx
  sub    %rdx,%rax
  mov    %rax,-0x78(%rbp)
  cmpl   $0x0,-0x84(%rbp)
  jne    L53
  mov    -0x40(%rbp),%rax
  sub    %rax,-0x78(%rbp)
L53:
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3d,%al
  jne    L8
  mov    -0x60(%rbp),%rax
  mov    %rax,-0x70(%rbp)
  jmp    L92
L8:
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  jne    L50
  mov    -0x78(%rbp),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x70(%rbp)
  jmp    L92
L50:
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L92
  mov    -0x78(%rbp),%rax
  sub    -0x60(%rbp),%rax
  mov    %rax,-0x70(%rbp)
L92:
  mov    -0x38(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x80(%rbp)
  mov    -0x80(%rbp),%rax
  mov    $0x10000,%edx
  cmp    %rdx,%rax
  cmovl  %rdx,%rax
  sub    $0x10000,%rax
  mov    %rax,-0x58(%rbp)
  mov    -0x58(%rbp),%rax
  sub    %rax,-0x70(%rbp)
  mov    -0x80(%rbp),%rax
  sub    -0x58(%rbp),%rax
  mov    %rax,-0x80(%rbp)
  cmpl   $0x0,-0x84(%rbp)
  jne    L141
  mov    -0x40(%rbp),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x80(%rbp)
L141:
  mov    -0x88(%rbp),%eax
  mov    $0x0,%edx
  mov    $0x18,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <lseek@plt>
  lea    -0x80(%rbp),%rcx
  mov    -0x88(%rbp),%eax
  mov    $0x4,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <write@plt>
  test   %eax,%eax
  jns    L83
  mov    -0xa0(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  lea    D104(%rip),%rdx
  mov    %rax,%rsi
  lea    D79(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <stderr3@plt>
L83:
  mov    -0xa0(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  mov    -0x70(%rbp),%rcx
  mov    -0x78(%rbp),%rdx
  mov    %rax,%rsi
  lea    D80(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%edi
  call   <exit@plt>
```

tool_calls: name: unpack_data
arguments: tag: D106
type_infered: string
name: unpack_data
arguments: tag: D75
type_infered: string
name: unpack_data
arguments: tag: D104
type_infered: string
name: unpack_data
arguments: tag: D85
type_infered: string
name: unpack_data
arguments: tag: D14
type_infered: string
name: unpack_data
arguments: tag: D30
type_infered: string
name: unpack_data
arguments: tag: D79
type_infered: string
name: unpack_data
arguments: tag: D80
type_infered: string

tool: D106:  too large


tool: D75: chmem: 

tool: D104: 


tool: D85: chmem: can't open 

tool: D14: bad header


tool: D30:  not executable


tool: D79: chmem: can't modify 

tool: D80: %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);
}
```