user: Converte this assembly snippet into its equivalent C code:

```asm
<d_name>:
  endbr64
  movslq %edi,%rax
  lea    0x7(%rdi),%esi
  lea    0x0(,%rax,8),%r8
  sub    %rax,%r8
  lea    D7(%rip),%rax
  add    %rax,%r8
  mov    %edi,%eax
  sar    $0x1f,%eax
  movb   $0x0,0x6(%r8)
  shr    $0x1d,%eax
  lea    (%rdi,%rax,1),%ecx
  and    $0x7,%ecx
  sub    %eax,%ecx
  test   %edi,%edi
  cmovns %edi,%esi
  lea    0x41(%rcx),%r11d
  mov    %ecx,%eax
  mov    %r11b,0x2(%r8)
  sar    $0x3,%esi
  cmp    $0xf,%edi
  lea    0x31(%rsi),%r10d
  mov    %esi,%edx
  setg   %r9b
  mov    %r10b,0x3(%r8)
  cmp    $0x1,%ecx
  jg     L122
  test   %r9b,%r9b
  je     L122
  cmp    $0x2f,%edi
  jg     L230
  mov    %ecx,%esi
  mov    %edx,%ecx
  xchg   %ax,%ax
L146:
  sub    $0x1,%ecx
  add    $0x1,%esi
  cmp    $0x1,%ecx
  jle    L38
  cmp    $0x5,%esi
  jle    L146
L38:
  add    $0x41,%esi
  add    $0x31,%ecx
  mov    %sil,(%r8)
  mov    %cl,0x1(%r8)
  nopl   (%rax)
L130:
  add    $0x1,%edx
  add    $0x1,%eax
  cmp    $0x5,%edx
  jg     L248
  cmp    $0x5,%eax
  jle    L130
L248:
  add    $0x41,%eax
  add    $0x31,%edx
  mov    %al,0x4(%r8)
  mov    %dl,0x5(%r8)
L199:
  mov    %r8,%rax
  ret
  nopw   0x0(%rax,%rax,1)
L122:
  cmp    $0x5,%ecx
  jle    L134
  test   %r9b,%r9b
  je     L134
  cmp    $0x2f,%edi
  jg     L230
  nopw   0x0(%rax,%rax,1)
L236:
  sub    $0x1,%esi
  sub    $0x1,%ecx
  cmp    $0x1,%esi
  jle    L255
  cmp    $0x1,%ecx
  jg     L236
L255:
  add    $0x41,%ecx
  add    $0x31,%esi
  mov    %cl,(%r8)
  mov    %sil,0x1(%r8)
  nopl   (%rax)
L291:
  add    $0x1,%edx
  sub    $0x1,%eax
  cmp    $0x5,%edx
  jg     L248
  cmp    $0x1,%eax
  jg     L291
  jmp    L248
  nopw   0x0(%rax,%rax,1)
L134:
  cmp    $0x1,%ecx
  setg   %r9b
  cmp    $0xf,%edi
  jg     L119
  test   %r9b,%r9b
  je     L119
  cmp    $0x5,%ecx
  jle    L72
L230:
  movb   $0x0,(%r8)
  mov    %r8,%rax
  ret
  cs nopw 0x0(%rax,%rax,1)
L72:
  add    $0x1,%esi
  sub    $0x1,%ecx
  cmp    $0x5,%esi
  jg     L305
  cmp    $0x1,%ecx
  jg     L72
L305:
  add    $0x41,%ecx
  add    $0x31,%esi
  cs nopw 0x0(%rax,%rax,1)
L215:
  add    $0x1,%edx
  add    $0x1,%eax
  cmp    $0x5,%edx
  jg     L100
  cmp    $0x5,%eax
  jle    L215
L100:
  add    $0x41,%eax
  add    $0x31,%edx
  mov    %cl,(%r8)
  mov    %sil,0x1(%r8)
  mov    %al,0x4(%r8)
  mov    %dl,0x5(%r8)
  jmp    L199
L119:
  cmp    $0x5,%ecx
  push   %rbp
  setle  %bpl
  cmp    $0x2f,%edi
  push   %rbx
  setg   %bl
  test   %bl,%bpl
  je     L83
  test   %r9b,%r9b
  je     L83
  cmp    $0xf,%edi
  jle    L286
  nopl   0x0(%rax,%rax,1)
L154:
  sub    $0x1,%esi
  sub    $0x1,%ecx
  cmp    $0x1,%esi
  jle    L167
  cmp    $0x1,%ecx
  jg     L154
L167:
  add    $0x41,%ecx
  add    $0x31,%esi
  mov    %cl,(%r8)
  mov    %sil,0x1(%r8)
  nopl   (%rax)
L261:
  sub    $0x1,%edx
  add    $0x1,%eax
  cmp    $0x1,%edx
  jle    L170
  cmp    $0x5,%eax
  jle    L261
L170:
  add    $0x41,%eax
  add    $0x31,%edx
  mov    %al,0x4(%r8)
  mov    %dl,0x5(%r8)
L158:
  mov    %r8,%rax
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L286:
  mov    %r11b,(%r8)
  mov    %r10b,0x1(%r8)
  jmp    L261
L83:
  movb   $0x0,(%r8)
  jmp    L158
```

assistant: ```c
char *d_name(const int x) {
  static char a[64][7];
  char *s = a[x];
  int f, r, h, v;
  f = x % 8;
  r = x / 8;
  s[2] = 'A' + f;
  s[3] = '1' + r;
  s[6] = '\0';
  if (f < 2 && r > 1 && r < 6) {
    for (h = r, v = f; h > 1 && v < 6; --h, ++v)
      ;
    s[0] = 'A' + v;
    s[1] = '1' + h;
    for (h = r, v = f; h < 6 && v < 6; ++h, ++v)
      ;
    s[4] = 'A' + v;
    s[5] = '1' + h;
  } else if (f > 5 && r > 1 && r < 6) {
    for (h = r, v = f; h > 1 && v > 1; --h, --v)
      ;
    s[0] = 'A' + v;
    s[1] = '1' + h;
    for (h = r, v = f; h < 6 && v > 1; ++h, --v)
      ;
    s[4] = 'A' + v;
    s[5] = '1' + h;
  } else if (r < 2 && f > 1 && f < 6) {
    for (h = r, v = f; h < 6 && v > 1; ++h, --v)
      ;
    s[0] = 'A' + v;
    s[1] = '1' + h;
    for (h = r, v = f; h < 6 && v < 6; ++h, ++v)
      ;
    s[4] = 'A' + v;
    s[5] = '1' + h;
  } else if (r > 5 && f > 1 && f < 6) {
    for (h = r, v = f; h > 1 && v > 1; --h, --v)
      ;
    s[0] = 'A' + v;
    s[1] = '1' + h;
    for (h = r, v = f; h > 1 && v < 6; --h, ++v)
      ;
    s[4] = 'A' + v;
    s[5] = '1' + h;
  } else {
    s[0] = '\0';
  }
  return s;
}
```