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

```asm
<checkForVirus>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    D1(%rip),%rax
  mov    (%rax),%edx
  mov    D4(%rip),%rax
  mov    (%rax),%eax
  mov    -0x28(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <syscall@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0xffffffff,-0xc(%rbp)
  jne    L121
  mov    $0xffffffff,%eax
  jmp    L213
L121:
  lea    -0x14(%rbp),%rdx
  mov    -0xc(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <fstat@plt>
  cmp    $0xffffffff,%eax
  jne    L71
  mov    D33(%rip),%rax
  mov    (%rax),%eax
  mov    -0xc(%rbp),%edx
  mov    %edx,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <syscall@plt>
  mov    $0xffffffff,%eax
  jmp    L213
L71:
  movl   $0x0,-0x10(%rbp)
  movb   $0x0,-0x15(%rbp)
  jmp    L51
L84:
  cmpl   $0x0,-0x10(%rbp)
  jne    L173
  movzbl -0x15(%rbp),%eax
  movsbl %al,%eax
  movzbl %al,%eax
  cmp    $0xde,%eax
  jne    L173
  movl   $0x1,-0x10(%rbp)
  jmp    L51
L173:
  cmpl   $0x1,-0x10(%rbp)
  jne    L52
  movzbl -0x15(%rbp),%eax
  movsbl %al,%eax
  movzbl %al,%eax
  cmp    $0xad,%eax
  jne    L16
  movl   $0x2,-0x10(%rbp)
  jmp    L51
L16:
  movl   $0x0,-0x10(%rbp)
  jmp    L51
L52:
  cmpl   $0x2,-0x10(%rbp)
  jne    L109
  movzbl -0x15(%rbp),%eax
  movsbl %al,%eax
  movzbl %al,%eax
  cmp    $0xbe,%eax
  jne    L64
  movl   $0x3,-0x10(%rbp)
  jmp    L51
L64:
  movl   $0x0,-0x10(%rbp)
  jmp    L51
L109:
  cmpl   $0x3,-0x10(%rbp)
  jne    L51
  movzbl -0x15(%rbp),%eax
  movsbl %al,%eax
  movzbl %al,%eax
  cmp    $0xef,%eax
  jne    L101
  movl   $0x4,-0x10(%rbp)
  jmp    L184
L101:
  movl   $0x0,-0x10(%rbp)
L51:
  lea    -0x15(%rbp),%rcx
  mov    -0xc(%rbp),%eax
  mov    $0x1,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <read@plt>
  cmp    $0x1,%eax
  je     L84
L184:
  mov    D33(%rip),%rax
  mov    (%rax),%eax
  mov    -0xc(%rbp),%edx
  mov    %edx,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <syscall@plt>
  cmpl   $0x4,-0x10(%rbp)
  je     L125
  mov    $0x0,%eax
  jmp    L213
L125:
  mov    $0x1,%eax
L213:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L123
  call   <__stack_chk_fail@plt>
L123:
  leave
  ret
```

assistant: ```c
int checkForVirus(char *argv) {
  int fd;
  if ((fd = syscall(__NR_open, argv, O_RDONLY)) == -1) {
    return -1;
  }
  struct stat fstatInfo;
  if (fstat(fd, &fstatInfo) == -1) {
    syscall(__NR_close, fd);
    return -1;
  }
  int offsetState = 0;
  char offBuf = 0x00;
  while (read(fd, &offBuf, 1) == 1) {
    if (offsetState == 0 && (offBuf & 255) == 0xDE) {
      offsetState = 1;
    } else if (offsetState == 1) {
      if ((offBuf & 255) == 0xAD) {
        offsetState = 2;
      } else {
        offsetState = 0;
      }
    } else if (offsetState == 2) {
      if ((offBuf & 255) == 0xBE) {
        offsetState = 3;
      } else {
        offsetState = 0;
      }
    } else if (offsetState == 3) {
      if ((offBuf & 255) == 0xEF) {
        offsetState = 4;
        break;
      } else {
        offsetState = 0;
      }
    }
  }
  syscall(__NR_close, fd);
  if (offsetState != 4) {
    return 0;
  }
  return 1;
}
```