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

```asm
<ArchFindMember>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %rcx,-0x70(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    D35(%rip),%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x40(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r10
  mov    $0x0,%r11d
  movslq %eax,%rdx
  mov    %rdx,%r8
  mov    $0x0,%r9d
  cltq
  mov    $0x10,%edx
  sub    $0x1,%rdx
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L162:
  cmp    %rdx,%rsp
  je     L43
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L162
L43:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L16
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L16:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x70(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x30(%rbp)
  cmpq   $0x0,-0x30(%rbp)
  jne    L132
  mov    $0x0,%eax
  jmp    L82
L132:
  mov    D35(%rip),%rax
  mov    (%rax),%esi
  mov    -0x30(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <fread@plt>
  cmp    $0x1,%eax
  jne    L166
  mov    D35(%rip),%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  mov    D10(%rip),%rax
  mov    (%rax),%rcx
  mov    -0x38(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L28
L166:
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
  jmp    L82
L28:
  mov    -0x60(%rbp),%rax
  mov    $0x2f,%esi
  mov    %rax,%rdi
  call   <strrchr@plt>
  mov    %rax,-0x28(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  je     L183
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x60(%rbp)
L183:
  mov    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x48(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  cmpq   $0x8,-0x20(%rbp)
  jbe    L61
  movq   $0x8,-0x48(%rbp)
  jmp    L61
L101:
  mov    D25(%rip),%rax
  mov    (%rax),%rcx
  mov    -0x68(%rbp),%rax
  mov    (%rax),%rax
  mov    $0x8,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L24
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
  jmp    L82
L24:
  mov    -0x68(%rbp),%rax
  mov    0x8(%rax),%rcx
  mov    -0x48(%rbp),%rdx
  mov    -0x60(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L156
  cmpq   $0x8,-0x48(%rbp)
  je     L6
  mov    -0x68(%rbp),%rax
  mov    0x8(%rax),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  jne    L10
L6:
  mov    D22(%rip),%rax
  mov    (%rax),%edx
  mov    -0x30(%rbp),%rax
  mov    $0xffffffe8,%esi
  mov    %rax,%rdi
  call   <fseek@plt>
  mov    -0x30(%rbp),%rax
  jmp    L82
L156:
  nop
  jmp    L49
L10:
  nop
L49:
  mov    -0x68(%rbp),%rax
  mov    0x10(%rax),%rax
  add    $0x7,%rax
  movb   $0x0,(%rax)
  mov    -0x68(%rbp),%rax
  mov    0x10(%rax),%rax
  mov    $0xa,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <strtol@plt>
  mov    %eax,-0x4c(%rbp)
  mov    D22(%rip),%rax
  mov    (%rax),%edx
  mov    -0x4c(%rbp),%eax
  add    $0x1,%eax
  and    $0xfffffffe,%eax
  mov    %eax,%ecx
  mov    -0x30(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <fseek@plt>
L61:
  mov    -0x30(%rbp),%rdx
  mov    -0x68(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    $0x18,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  cmp    $0x1,%eax
  je     L101
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
L82:
  mov    %rbx,%rsp
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L69
  call   <__stack_chk_fail@plt>
L69:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
FILE *ArchFindMember(char *archive, char *member, struct ar_hdr *arhPtr, const char *mode) {
  FILE *arch;
  int size;
  char *cp;
  char magic[SARMAG];
  size_t len, tlen;
  arch = fopen(archive, mode);
  if (arch == NULL) {
    return NULL;
  }
  if ((fread(magic, SARMAG, 1, arch) != 1) || (strncmp(magic, ARMAG, SARMAG) != 0)) {
    fclose(arch);
    return NULL;
  }
  cp = strrchr(member, '/');
  if (cp != NULL) {
    member = cp + 1;
  }
  len = tlen = strlen(member);
  if (len > sizeof(arhPtr->ar_name)) {
    tlen = sizeof(arhPtr->ar_name);
  }
  while (fread((char *)arhPtr, sizeof(struct ar_hdr), 1, arch) == 1) {
    if (strncmp(arhPtr->ar_fmag, ARFMAG, sizeof(arhPtr->ar_fmag)) != 0) {
      fclose(arch);
      return NULL;
    } else if (strncmp(member, arhPtr->ar_name, tlen) == 0) {
      if (tlen != sizeof(arhPtr->ar_name) && arhPtr->ar_name[tlen] != ' ') {
        goto skip;
      } else {
        fseek(arch, -sizeof(struct ar_hdr), SEEK_CUR);
        return (arch);
      }
    } else {
    skip:
      arhPtr->ar_size[sizeof(arhPtr->ar_size) - 1] = '\0';
      size = (int)strtol(arhPtr->ar_size, NULL, 10);
      fseek(arch, (size + 1) & ~1, SEEK_CUR);
    }
  }
  fclose(arch);
  return NULL;
}
```