user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rsi,0x10(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  cmp    $0x3,%edi
  je     L96
  mov    (%rsi),%rsi
  lea    D58(%rip),%rdi
  xor    %eax,%eax
  call   <fail@plt>
L96:
  mov    0x10(%rsp),%rbx
  lea    D131(%rip),%r12
  lea    D186(%rip),%r13
  mov    %r12,%rdi
  lea    D111(%rip),%r14
  mov    0x8(%rbx),%rsi
  call   <read_file@plt>
  mov    0x10(%rbx),%rsi
  mov    %r13,%rdi
  mov    %eax,%r15d
  mov    %eax,0x8(%rsp)
  call   <read_file@plt>
  mov    %r14,%rdx
  mov    %r15d,%esi
  mov    %r12,%rdi
  mov    %eax,%ebx
  call   <md5@plt>
  test   %rax,%rax
  lea    D63(%rip),%rax
  mov    %rax,0x18(%rsp)
  js     L40
  mov    %rax,%rdx
  mov    %ebx,%esi
  mov    %r13,%rdi
  call   <md5@plt>
  test   %rax,%rax
  js     L40
L147:
  cmp    %ebx,0x8(%rsp)
  je     L118
  lea    D164(%rip),%rdi
  xor    %eax,%eax
  call   <fail@plt>
L118:
  mov    0x8(%rsp),%edx
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  je     L115
L15:
  xor    %edi,%edi
  lea    D19(%rip),%rbx
  call   <time@plt>
  lea    0x24(%rsp),%rdi
  mov    %eax,0x24(%rsp)
  call   <localtime@plt>
  lea    D72(%rip),%rdx
  mov    $0x1000,%esi
  mov    %rbx,%rdi
  mov    %eax,%ecx
  call   <strftime@plt>
  mov    0x10(%rsp),%r15
  lea    D16(%rip),%rdi
  xor    %eax,%eax
  mov    0x10(%r15),%rdx
  mov    0x8(%r15),%rsi
  call   <printf@plt>
  mov    %rbx,%rsi
  lea    D33(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D138(%rip),%rdi
  call   <puts@plt>
  mov    0x8(%r15),%rsi
  lea    D85(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D218(%rip),%rdi
  call   <puts@plt>
  mov    %r14,%rsi
  lea    D6(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  jle    L31
  xor    %r8d,%r8d
  lea    D3(%rip),%r14
  jmp    L189
  nopl   0x0(%rax)
L62:
  add    $0x1,%r8d
  cmp    %r8d,0x8(%rsp)
  jle    L31
L189:
  movslq %r8d,%rbp
  movzbl 0x0(%r13,%rbp,1),%eax
  cmp    %al,(%r12,%rbp,1)
  je     L62
  mov    %r8d,%esi
  lea    D74(%rip),%rdi
  xor    %eax,%eax
  xor    %r15d,%r15d
  call   <printf@plt>
  jmp    L5
  nopl   0x0(%rax)
L29:
  lea    0x1(%rbx),%r8d
  add    $0x1,%rbp
  cmp    %ebp,0x8(%rsp)
  jle    L37
L5:
  movzbl 0x0(%r13,%rbp,1),%esi
  mov    %ebp,%ebx
  mov    %ebp,%r8d
  cmp    %sil,(%r12,%rbp,1)
  je     L37
  mov    %r14,%rdi
  xor    %eax,%eax
  add    $0x1,%r15d
  call   <printf@plt>
  cmp    $0x10,%r15d
  jne    L29
  mov    $0xa,%edi
  xor    %r15d,%r15d
  add    $0x1,%rbp
  call   <putchar@plt>
  lea    0x1(%rbx),%r8d
  cmp    %ebp,0x8(%rsp)
  jg     L5
  cs nopw 0x0(%rax,%rax,1)
L37:
  mov    $0xa,%edi
  mov    %r8d,0xc(%rsp)
  call   <putchar@plt>
  test   %r15d,%r15d
  mov    0xc(%rsp),%r8d
  je     L62
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0xc(%rsp),%r8d
  add    $0x1,%r8d
  cmp    %r8d,0x8(%rsp)
  jg     L189
  nopl   0x0(%rax,%rax,1)
L31:
  lea    D123(%rip),%rdi
  call   <puts@plt>
  mov    0x18(%rsp),%rsi
  lea    D6(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D192(%rip),%rdi
  call   <puts@plt>
  mov    0x10(%rsp),%rax
  lea    D24(%rip),%rdi
  mov    0x10(%rax),%rsi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L78
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L40:
  lea    D49(%rip),%rdi
  xor    %eax,%eax
  call   <fail@plt>
  jmp    L147
L115:
  lea    D62(%rip),%rdi
  call   <fail@plt>
  jmp    L15
L78:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D58
data_type: string
name: retrieve_data
arguments: data_label: D164
data_type: string
name: retrieve_data
arguments: data_label: D72
data_type: string
name: retrieve_data
arguments: data_label: D16
data_type: string
name: retrieve_data
arguments: data_label: D33
data_type: string
name: retrieve_data
arguments: data_label: D138
data_type: string
name: retrieve_data
arguments: data_label: D85
data_type: string
name: retrieve_data
arguments: data_label: D218
data_type: string
name: retrieve_data
arguments: data_label: D6
data_type: string
name: retrieve_data
arguments: data_label: D3
data_type: string
name: retrieve_data
arguments: data_label: D74
data_type: string
name: retrieve_data
arguments: data_label: D123
data_type: string
name: retrieve_data
arguments: data_label: D192
data_type: string
name: retrieve_data
arguments: data_label: D24
data_type: string
name: retrieve_data
arguments: data_label: D49
data_type: string
name: retrieve_data
arguments: data_label: D62
data_type: string

tool: D58: usage: %s [old_file] [new_file]

tool: D164: file length mismatch

tool: D72: %Y/%m/%d %H:%M:%S

tool: D16: # patch script: %s -> %s


tool: D33: # generated at %s 


tool: D138: # read old file

tool: D85: <%s


tool: D218: # check input md5sum

tool: D6: ?%s


tool: D3: %02X 

tool: D74: :%x


tool: D123: # check output md5sum

tool: D192: # write new file

tool: D24: >script_%s


tool: D49: can't calculate md5

tool: D62: file content is same

assistant: ```c
int main(int argc, char *argv[]) {
  static char buf[4096];
  static char data1[(1024 * 1024 * 32)];
  static char data2[(1024 * 1024 * 32)];
  static char md5str1[33];
  static char md5str2[33];
  time_t timestamp;
  int len1, len2;
  int i, cnt;
  if (argc != 3)
    fail("usage: %s [old_file] [new_file]", argv[0]);
  len1 = read_file(data1, argv[1]);
  len2 = read_file(data2, argv[2]);
  if (md5(data1, len1, md5str1) < 0 || md5(data2, len2, md5str2) < 0)
    fail("can't calculate md5");
  if (len1 != len2)
    fail("file length mismatch");
  if (memcmp(data1, data2, len1) == 0)
    fail("file content is same");
  timestamp = time(NULL);
  strftime(buf, 4096, "%Y/%m/%d %H:%M:%S", localtime(&timestamp));
  printf("# patch script: %s -> %s\n", argv[1], argv[2]);
  printf("# generated at %s \n", buf);
  printf("\n");
  printf("# read old file\n");
  printf("<%s\n", argv[1]);
  printf("\n");
  printf("# check input md5sum\n");
  printf("?%s\n", md5str1);
  printf("\n");
  for (i = 0; i < len1; i++)
    if (data1[i] != data2[i]) {
      printf(":%x\n", i);
      cnt = 0;
      while (i < len1 && data1[i] != data2[i]) {
        printf("%02X ", (int)data2[i] & 0xff);
        cnt++;
        if (cnt == 16) {
          printf("\n");
          cnt = 0;
        }
        i++;
      }
      printf("\n");
      if (cnt)
        printf("\n");
    }
  printf("# check output md5sum\n");
  printf("?%s\n", md5str2);
  printf("\n");
  printf("# write new file\n");
  printf(">script_%s\n", argv[2]);
  return 0;
}
```