user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x3,-0x24(%rbp)
  je     L61
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D44(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fail@plt>
L61:
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D272(%rip),%rax
  mov    %rax,%rdi
  call   <read_file@plt>
  mov    %eax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D226(%rip),%rax
  mov    %rax,%rdi
  call   <read_file@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0x10(%rbp),%eax
  lea    D274(%rip),%rdx
  mov    %eax,%esi
  lea    D272(%rip),%rax
  mov    %rax,%rdi
  call   <md5@plt>
  test   %rax,%rax
  js     L49
  mov    -0xc(%rbp),%eax
  lea    D278(%rip),%rdx
  mov    %eax,%esi
  lea    D226(%rip),%rax
  mov    %rax,%rdi
  call   <md5@plt>
  test   %rax,%rax
  jns    L98
L49:
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fail@plt>
L98:
  mov    -0x10(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  je     L120
  lea    D247(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fail@plt>
L120:
  mov    -0x10(%rbp),%eax
  mov    %eax,%edx
  lea    D226(%rip),%rax
  mov    %rax,%rsi
  lea    D272(%rip),%rax
  mov    %rax,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  jne    L19
  lea    D264(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fail@plt>
L19:
  mov    $0x0,%edi
  call   <time@plt>
  mov    %eax,-0x1c(%rbp)
  lea    -0x1c(%rbp),%rax
  mov    %rax,%rdi
  call   <localtime@plt>
  mov    %eax,%ecx
  lea    D139(%rip),%rax
  mov    %rax,%rdx
  mov    $0x1000,%esi
  lea    D32(%rip),%rax
  mov    %rax,%rdi
  call   <strftime@plt>
  mov    -0x30(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D171(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D32(%rip),%rax
  mov    %rax,%rsi
  lea    D70(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D201(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D69(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D190(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D274(%rip),%rax
  mov    %rax,%rsi
  lea    D136(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  movl   $0x0,-0x18(%rbp)
  jmp    L138
L94:
  mov    -0x18(%rbp),%eax
  cltq
  lea    D272(%rip),%rdx
  movzbl (%rax,%rdx,1),%edx
  mov    -0x18(%rbp),%eax
  cltq
  lea    D226(%rip),%rcx
  movzbl (%rax,%rcx,1),%eax
  cmp    %al,%dl
  je     L74
  mov    -0x18(%rbp),%eax
  mov    %eax,%esi
  lea    D86(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x14(%rbp)
  jmp    L116
L130:
  mov    -0x18(%rbp),%eax
  cltq
  lea    D226(%rip),%rdx
  movzbl (%rax,%rdx,1),%eax
  movsbl %al,%eax
  movzbl %al,%eax
  mov    %eax,%esi
  lea    D240(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x14(%rbp)
  cmpl   $0x10,-0x14(%rbp)
  jne    L9
  mov    $0xa,%edi
  call   <putchar@plt>
  movl   $0x0,-0x14(%rbp)
L9:
  addl   $0x1,-0x18(%rbp)
L116:
  mov    -0x18(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jge    L34
  mov    -0x18(%rbp),%eax
  cltq
  lea    D272(%rip),%rdx
  movzbl (%rax,%rdx,1),%edx
  mov    -0x18(%rbp),%eax
  cltq
  lea    D226(%rip),%rcx
  movzbl (%rax,%rcx,1),%eax
  cmp    %al,%dl
  jne    L130
L34:
  mov    $0xa,%edi
  call   <putchar@plt>
  cmpl   $0x0,-0x14(%rbp)
  je     L74
  mov    $0xa,%edi
  call   <putchar@plt>
L74:
  addl   $0x1,-0x18(%rbp)
L138:
  mov    -0x18(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jl     L94
  lea    D225(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D278(%rip),%rax
  mov    %rax,%rsi
  lea    D136(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D165(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x30(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D83(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L40
  call   <__stack_chk_fail@plt>
L40:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D44
type: string
name: parse_data
arguments: data_tag: D9
type: string
name: parse_data
arguments: data_tag: D247
type: string
name: parse_data
arguments: data_tag: D264
type: string
name: parse_data
arguments: data_tag: D139
type: string
name: parse_data
arguments: data_tag: D171
type: string
name: parse_data
arguments: data_tag: D70
type: string
name: parse_data
arguments: data_tag: D201
type: string
name: parse_data
arguments: data_tag: D69
type: string
name: parse_data
arguments: data_tag: D190
type: string
name: parse_data
arguments: data_tag: D136
type: string
name: parse_data
arguments: data_tag: D86
type: string
name: parse_data
arguments: data_tag: D240
type: string
name: parse_data
arguments: data_tag: D225
type: string
name: parse_data
arguments: data_tag: D165
type: string
name: parse_data
arguments: data_tag: D83
type: string

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

tool: D9: can't calculate md5

tool: D247: file length mismatch

tool: D264: file content is same

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

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


tool: D70: # generated at %s 


tool: D201: # read old file

tool: D69: <%s


tool: D190: # check input md5sum

tool: D136: ?%s


tool: D86: :%x


tool: D240: %02X 

tool: D225: # check output md5sum

tool: D165: # write new file

tool: D83: >script_%s


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;
}
```