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     L161
  mov    (%rsi),%rsi
  lea    D205(%rip),%rdi
  xor    %eax,%eax
  call   <fail@plt>
L161:
  mov    0x10(%rsp),%rbx
  lea    D180(%rip),%rbp
  lea    D172(%rip),%r12
  mov    %rbp,%rdi
  lea    D129(%rip),%r13
  mov    0x8(%rbx),%rsi
  call   <read_file@plt>
  mov    0x10(%rbx),%rsi
  mov    %r12,%rdi
  mov    %eax,%r14d
  mov    %eax,0xc(%rsp)
  call   <read_file@plt>
  mov    %r13,%rdx
  mov    %r14d,%esi
  mov    %rbp,%rdi
  mov    %eax,%r15d
  call   <md5@plt>
  test   %rax,%rax
  lea    D14(%rip),%rax
  mov    %rax,0x18(%rsp)
  js     L113
  mov    %rax,%rdx
  mov    %r15d,%esi
  mov    %r12,%rdi
  call   <md5@plt>
  test   %rax,%rax
  js     L113
L76:
  cmp    %r15d,0xc(%rsp)
  je     L198
  lea    D120(%rip),%rdi
  xor    %eax,%eax
  call   <fail@plt>
L198:
  mov    0xc(%rsp),%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  je     L30
L159:
  xor    %edi,%edi
  lea    D162(%rip),%r15
  call   <time@plt>
  lea    0x24(%rsp),%rdi
  mov    %eax,0x24(%rsp)
  call   <localtime@plt>
  lea    D208(%rip),%rdx
  mov    $0x1000,%esi
  mov    %r15,%rdi
  mov    %eax,%ecx
  call   <strftime@plt>
  mov    0x10(%rsp),%rbx
  lea    D11(%rip),%rdi
  xor    %eax,%eax
  mov    0x10(%rbx),%rdx
  mov    0x8(%rbx),%rsi
  call   <printf@plt>
  mov    %r15,%rsi
  lea    D49(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D185(%rip),%rdi
  call   <puts@plt>
  mov    0x8(%rbx),%rsi
  lea    D29(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D192(%rip),%rdi
  call   <puts@plt>
  mov    %r13,%rsi
  lea    D12(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jle    L63
  xor    %r15d,%r15d
  lea    D119(%rip),%r13
  jmp    L166
  nop
L148:
  add    $0x1,%r15d
  cmp    %r15d,0xc(%rsp)
  jle    L63
L166:
  movslq %r15d,%rbx
  movzbl (%r12,%rbx,1),%eax
  cmp    %al,0x0(%rbp,%rbx,1)
  je     L148
  mov    %r15d,%esi
  lea    D84(%rip),%rdi
  xor    %eax,%eax
  xor    %r14d,%r14d
  call   <printf@plt>
  nopl   0x0(%rax)
L43:
  movzbl (%r12,%rbx,1),%esi
  mov    %ebx,%r15d
  cmp    %sil,0x0(%rbp,%rbx,1)
  je     L25
L59:
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x1,%r14d
  call   <printf@plt>
  cmp    $0x10,%r14d
  je     L197
  add    $0x1,%r15d
  add    $0x1,%rbx
  cmp    %ebx,0xc(%rsp)
  jg     L43
  mov    $0xa,%edi
  call   <putchar@plt>
L124:
  mov    $0xa,%edi
  add    $0x1,%r15d
  call   <putchar@plt>
  cmp    %r15d,0xc(%rsp)
  jg     L166
  nopl   0x0(%rax)
L63:
  lea    D154(%rip),%rdi
  call   <puts@plt>
  mov    0x18(%rsp),%rsi
  lea    D12(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D186(%rip),%rdi
  call   <puts@plt>
  mov    0x10(%rsp),%rax
  lea    D70(%rip),%rdi
  mov    0x10(%rax),%rsi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L191
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L113:
  lea    D99(%rip),%rdi
  xor    %eax,%eax
  call   <fail@plt>
  jmp    L76
  nopl   0x0(%rax)
L197:
  mov    $0xa,%edi
  add    $0x1,%r15d
  add    $0x1,%rbx
  call   <putchar@plt>
  cmp    %ebx,0xc(%rsp)
  jle    L124
  movzbl (%r12,%rbx,1),%esi
  xor    %r14d,%r14d
  mov    %ebx,%r15d
  cmp    %sil,0x0(%rbp,%rbx,1)
  jne    L59
  nopw   0x0(%rax,%rax,1)
L25:
  mov    $0xa,%edi
  call   <putchar@plt>
  test   %r14d,%r14d
  je     L148
  jmp    L124
L30:
  lea    D37(%rip),%rdi
  call   <fail@plt>
  jmp    L159
L191:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D205
type_infered: string
name: read_data
arguments: data_label: D120
type_infered: string
name: read_data
arguments: data_label: D208
type_infered: string
name: read_data
arguments: data_label: D11
type_infered: string
name: read_data
arguments: data_label: D49
type_infered: string
name: read_data
arguments: data_label: D185
type_infered: string
name: read_data
arguments: data_label: D29
type_infered: string
name: read_data
arguments: data_label: D192
type_infered: string
name: read_data
arguments: data_label: D12
type_infered: string
name: read_data
arguments: data_label: D119
type_infered: string
name: read_data
arguments: data_label: D84
type_infered: string
name: read_data
arguments: data_label: D154
type_infered: string
name: read_data
arguments: data_label: D186
type_infered: string
name: read_data
arguments: data_label: D70
type_infered: string
name: read_data
arguments: data_label: D99
type_infered: string
name: read_data
arguments: data_label: D37
type_infered: string

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

tool: D120: file length mismatch

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

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


tool: D49: # generated at %s 


tool: D185: # read old file

tool: D29: <%s


tool: D192: # check input md5sum

tool: D12: ?%s


tool: D119: %02X 

tool: D84: :%x


tool: D154: # check output md5sum

tool: D186: # write new file

tool: D70: >script_%s


tool: D99: can't calculate md5

tool: D37: 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;
}
```