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

```asm
<Z80_Index_GetOpcodeCountForInstruction>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <Z80_RD_MEM@plt>
  mov    %al,-0x8(%rbp)
  addl   $0x1,-0x14(%rbp)
  movzbl -0x8(%rbp),%eax
  cmp    $0xfd,%eax
  je     L185
  cmp    $0xfd,%eax
  jg     L372
  cmp    $0xed,%eax
  je     L185
  cmp    $0xed,%eax
  jg     L372
  cmp    $0xcb,%eax
  je     L51
  cmp    $0xdd,%eax
  jne    L372
L185:
  mov    $0x1,%eax
  jmp    L648
L51:
  mov    $0x4,%eax
  jmp    L648
L372:
  movzbl -0x8(%rbp),%eax
  and    $0xc0,%eax
  cmp    $0xc0,%eax
  je     L607
  cmp    $0xc0,%eax
  jg     L462
  cmp    $0x80,%eax
  je     L133
  cmp    $0x80,%eax
  jg     L462
  test   %eax,%eax
  je     L432
  cmp    $0x40,%eax
  je     L128
  jmp    L462
L432:
  movzbl -0x8(%rbp),%eax
  and    $0x7,%eax
  cmp    $0x6,%eax
  ja     L571
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D14(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D14(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  movzbl -0x8(%rbp),%eax
  and    $0x8,%eax
  test   %eax,%eax
  je     L223
  mov    $0x2,%eax
  jmp    L648
L223:
  movzbl -0x8(%rbp),%eax
  shr    $0x4,%al
  movzbl %al,%eax
  and    $0x3,%eax
  mov    %eax,%edi
  call   <Diss_Index_IsRegIndex@plt>
  test   %eax,%eax
  je     L142
  mov    $0x4,%eax
  jmp    L648
  movzbl -0x8(%rbp),%eax
  shr    $0x4,%al
  movzbl %al,%eax
  and    $0x3,%eax
  cmp    $0x2,%eax
  jne    L373
  mov    $0x4,%eax
  jmp    L648
L373:
  nop
  jmp    L131
  movzbl -0x8(%rbp),%eax
  shr    $0x4,%al
  movzbl %al,%eax
  and    $0x3,%eax
  mov    %eax,%edi
  call   <Diss_Index_IsRegIndex@plt>
  test   %eax,%eax
  je     L572
  mov    $0x2,%eax
  jmp    L648
  movzbl -0x8(%rbp),%eax
  shr    $0x3,%al
  and    $0x7,%eax
  mov    %al,-0x1(%rbp)
  movzbl -0x1(%rbp),%eax
  mov    %eax,%edi
  call   <Diss_Index_IsReg8Bit@plt>
  test   %eax,%eax
  je     L208
  movzbl -0x1(%rbp),%eax
  mov    %eax,%edi
  call   <Diss_Index_Get8BitRegCount@plt>
  movzbl %al,%eax
  add    $0x1,%eax
  jmp    L648
  movzbl -0x8(%rbp),%eax
  shr    $0x3,%al
  and    $0x7,%eax
  mov    %al,-0x2(%rbp)
  movzbl -0x2(%rbp),%eax
  mov    %eax,%edi
  call   <Diss_Index_IsReg8Bit@plt>
  test   %eax,%eax
  je     L269
  movzbl -0x2(%rbp),%eax
  mov    %eax,%edi
  call   <Diss_Index_Get8BitRegCount@plt>
  movzbl %al,%eax
  add    $0x2,%eax
  jmp    L648
L571:
  nop
  jmp    L462
L142:
  nop
  jmp    L462
L572:
  nop
  jmp    L462
L208:
  nop
  jmp    L462
L269:
  nop
L131:
  jmp    L462
L128:
  cmpb   $0x76,-0x8(%rbp)
  je     L11
  movzbl -0x8(%rbp),%eax
  shr    $0x3,%al
  and    $0x7,%eax
  mov    %al,-0x6(%rbp)
  movzbl -0x8(%rbp),%eax
  and    $0x7,%eax
  mov    %al,-0x5(%rbp)
  movzbl -0x6(%rbp),%eax
  mov    %eax,%edi
  call   <Diss_Index_IsReg8Bit@plt>
  test   %eax,%eax
  jne    L74
  movzbl -0x5(%rbp),%eax
  mov    %eax,%edi
  call   <Diss_Index_IsReg8Bit@plt>
  test   %eax,%eax
  je     L11
L74:
  movzbl -0x6(%rbp),%eax
  mov    %eax,%edi
  call   <Diss_Index_Get8BitRegCount@plt>
  mov    %al,-0x4(%rbp)
  movzbl -0x5(%rbp),%eax
  mov    %eax,%edi
  call   <Diss_Index_Get8BitRegCount@plt>
  mov    %al,-0x3(%rbp)
  movzbl -0x4(%rbp),%eax
  cmp    -0x3(%rbp),%al
  jae    L300
  movzbl -0x3(%rbp),%eax
  add    $0x1,%eax
  jmp    L648
L300:
  movzbl -0x4(%rbp),%eax
  add    $0x1,%eax
  jmp    L648
L133:
  movzbl -0x8(%rbp),%eax
  and    $0x7,%eax
  mov    %al,-0x7(%rbp)
  movzbl -0x7(%rbp),%eax
  mov    %eax,%edi
  call   <Diss_Index_IsReg8Bit@plt>
  test   %eax,%eax
  je     L524
  movzbl -0x7(%rbp),%eax
  mov    %eax,%edi
  call   <Diss_Index_Get8BitRegCount@plt>
  movzbl %al,%eax
  add    $0x1,%eax
  jmp    L648
L607:
  movzbl -0x8(%rbp),%eax
  and    $0x7,%eax
  cmp    $0x5,%eax
  je     L411
  cmp    $0x5,%eax
  jg     L347
  cmp    $0x1,%eax
  je     L364
  cmp    $0x3,%eax
  je     L272
  jmp    L347
L364:
  movzbl -0x8(%rbp),%eax
  and    $0x8,%eax
  test   %eax,%eax
  jne    L87
  movzbl -0x8(%rbp),%eax
  shr    $0x4,%al
  movzbl %al,%eax
  and    $0x3,%eax
  mov    %eax,%edi
  call   <Diss_Index_IsRegIndex@plt>
  test   %eax,%eax
  je     L108
  mov    $0x2,%eax
  jmp    L648
L87:
  cmpb   $0xf9,-0x8(%rbp)
  je     L17
  cmpb   $0xe9,-0x8(%rbp)
  jne    L108
L17:
  mov    $0x2,%eax
  jmp    L648
L272:
  movzbl -0x8(%rbp),%eax
  and    $0x30,%eax
  cmp    $0x10,%eax
  je     L96
  cmpb   $0xc3,-0x8(%rbp)
  je     L96
  cmpb   $0xe3,-0x8(%rbp)
  jne    L96
  mov    $0x2,%eax
  jmp    L648
L411:
  movzbl -0x8(%rbp),%eax
  and    $0x8,%eax
  test   %eax,%eax
  jne    L450
  movzbl -0x8(%rbp),%eax
  shr    $0x4,%al
  movzbl %al,%eax
  and    $0x3,%eax
  mov    %eax,%edi
  call   <Diss_Index_IsRegIndex@plt>
  test   %eax,%eax
  je     L450
  mov    $0x2,%eax
  jmp    L648
L347:
  nop
  jmp    L462
L108:
  nop
  jmp    L462
L96:
  nop
  jmp    L462
L450:
  nop
  jmp    L462
L11:
  nop
  jmp    L462
L524:
  nop
L462:
  nop
  mov    $0x1,%eax
L648:
  leave
  ret
```

assistant: ```c
int Z80_Index_GetOpcodeCountForInstruction(int DisAddr) {
  unsigned char Opcode;
  Opcode = Z80_RD_MEM(DisAddr);
  DisAddr++;
  switch (Opcode) {
  case 0x0dd:
  case 0x0fd:
  case 0x0ed:
    return 1;
  case 0x0cb:
    return 4;
  default: {
    switch (Opcode & 0x0c0) {
    case 0x000: {
      switch (Opcode & 0x07) {
      case 1: {
        if ((Opcode & 0x08) != 0) {
          return 2;
        } else {
          if (Diss_Index_IsRegIndex((Opcode >> 4) & 0x03)) {
            return 4;
          }
        }
      } break;
      case 2: {
        switch ((Opcode >> 4) & 0x03) {
        case 2:
          return 4;
        default:
          break;
        }
      } break;
      case 3: {
        if (Diss_Index_IsRegIndex((Opcode >> 4) & 0x03))
          return 2;
      } break;
      case 4:
      case 5: {
        unsigned char OpcodeIndex;
        OpcodeIndex = ((Opcode >> 3) & 0x07);
        if (Diss_Index_IsReg8Bit(OpcodeIndex))
          return Diss_Index_Get8BitRegCount(OpcodeIndex) + 1;
      } break;
      case 6: {
        unsigned char OpcodeIndex;
        OpcodeIndex = (Opcode >> 3) & 0x07;
        if (Diss_Index_IsReg8Bit(OpcodeIndex))
          return Diss_Index_Get8BitRegCount(OpcodeIndex) + 2;
      } break;
      default:
        break;
      }
    } break;
    case 0x040: {
      if (Opcode != 0x076) {
        unsigned char Reg1, Reg2;
        Reg1 = (Opcode >> 3) & 0x07;
        Reg2 = Opcode & 0x07;
        if (Diss_Index_IsReg8Bit(Reg1) || Diss_Index_IsReg8Bit(Reg2)) {
          unsigned char Length1, Length2;
          Length1 = Diss_Index_Get8BitRegCount(Reg1);
          Length2 = Diss_Index_Get8BitRegCount(Reg2);
          if (Length1 < Length2) {
            return Length2 + 1;
          }
          return Length1 + 1;
        }
      }
    } break;
    case 0x080: {
      unsigned char OpcodeIndex;
      OpcodeIndex = (Opcode & 0x07);
      if (Diss_Index_IsReg8Bit(OpcodeIndex))
        return Diss_Index_Get8BitRegCount(OpcodeIndex) + 1;
    } break;
    case 0x0c0: {
      switch (Opcode & 0x07) {
      case 1: {
        if ((Opcode & (1 << 3)) == 0) {
          if (Diss_Index_IsRegIndex((Opcode >> 4) & 0x03))
            return 2;
        } else {
          if ((Opcode == 0x0f9) || (Opcode == 0x0e9))
            return 2;
        }
      } break;
      case 3: {
        if ((Opcode & (3 << 4)) == (1 << 4)) {
        } else if (Opcode == 0x0c3) {
        } else {
          if (Opcode == 0x0e3)
            return 2;
        }
      } break;
      case 5: {
        if ((Opcode & (1 << 3)) == 0) {
          if (Diss_Index_IsRegIndex((Opcode >> 4) & 0x03))
            return 2;
        }
      } break;
      default:
        break;
      }
    } break;
    }
  } break;
  }
  return 1;
}
```