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

```asm
<is_same_file>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r13
  mov    %rsi,%r12
  mov    $0x18,%edi
  call   <malloc@plt>
  mov    %rax,%rbx
  mov    $0x18,%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <stat@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <stat@plt>
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L50
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <lstat@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <lstat@plt>
  mov    D3(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%r14d
  and    (%rbx),%r14d
  jne    L30
  and    0x0(%rbp),%eax
  mov    %eax,%r15d
  jne    L179
  mov    0x8(%rbp),%rax
  cmp    %rax,0x8(%rbx)
  jne    L96
  mov    0x10(%rbp),%rax
  cmp    %rax,0x10(%rbx)
  je     L112
L96:
  mov    %rbx,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r15d,%r14d
  jmp    L172
L50:
  mov    %rbx,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    $0xffffffff,%r14d
  jmp    L172
L112:
  mov    %rbx,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    $0xffffffff,%r14d
  jmp    L172
L30:
  and    0x0(%rbp),%eax
  mov    %eax,%r14d
  jne    L116
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <stat@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <stat@plt>
  mov    0x8(%rbp),%rax
  cmp    %rax,0x8(%rbx)
  jne    L62
  mov    0x10(%rbp),%rax
  cmp    %rax,0x10(%rbx)
  je     L198
L62:
  mov    %rbx,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  jmp    L172
L116:
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <stat@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <stat@plt>
  mov    0x8(%rbp),%rax
  cmp    %rax,0x8(%rbx)
  jne    L129
  mov    0x10(%rbp),%rax
  cmp    %rax,0x10(%rbx)
  je     L69
L129:
  mov    %rbx,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    $0x0,%r14d
  jmp    L172
L69:
  mov    %rbx,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    $0xffffffff,%r14d
  jmp    L172
L198:
  mov    %rbx,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    $0xffffffff,%r14d
  jmp    L172
L179:
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <stat@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <stat@plt>
  mov    0x8(%rbp),%rax
  cmp    %rax,0x8(%rbx)
  jne    L133
  mov    0x10(%rbp),%rax
  cmp    %rax,0x10(%rbx)
  je     L91
L133:
  mov    %rbx,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
L172:
  mov    %r14d,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L91:
  mov    %rbx,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    $0xffffffff,%r14d
  jmp    L172
```

assistant: ```c
int is_same_file(char *file1, char *file2) {
  struct stat *buf1;
  struct stat *buf2;
  buf1 = (struct stat *)malloc(sizeof(struct stat));
  buf2 = (struct stat *)malloc(sizeof(struct stat));
  stat(file1, buf1);
  stat(file2, buf2);
  if (strcmp(file1, file2) == 0) {
    free(buf1);
    free(buf2);
    return -1;
  } else {
    lstat(file1, buf1);
    lstat(file2, buf2);
    if (!(buf1->st_mode & S_IFLNK) && !(buf2->st_mode & S_IFLNK)) {
      if ((buf1->st_dev == buf2->st_dev) && (buf1->st_ino == buf2->st_ino)) {
        free(buf1);
        free(buf2);
        return -1;
      } else {
        free(buf1);
        free(buf2);
        return 0;
      }
    } else if ((buf1->st_mode & S_IFLNK) && (buf2->st_mode & S_IFLNK)) {
      stat(file1, buf1);
      stat(file2, buf2);
      if ((buf1->st_dev == buf2->st_dev) && (buf1->st_ino == buf2->st_ino)) {
        free(buf1);
        free(buf2);
        return -1;
      } else {
        free(buf1);
        free(buf2);
        return 0;
      }
    } else if ((buf1->st_mode & S_IFLNK) && !(buf2->st_mode & S_IFLNK)) {
      stat(file1, buf1);
      stat(file2, buf2);
      if ((buf1->st_dev == buf2->st_dev) && (buf1->st_ino == buf2->st_ino)) {
        free(buf1);
        free(buf2);
        return -1;
      } else {
        free(buf1);
        free(buf2);
        return 0;
      }
    } else {
      stat(file1, buf1);
      stat(file2, buf2);
      if ((buf1->st_dev == buf2->st_dev) && (buf1->st_ino == buf2->st_ino)) {
        free(buf1);
        free(buf2);
        return -1;
      } else {
        free(buf1);
        free(buf2);
        return 0;
      }
    }
  }
}
```