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

```asm
<get_cputype>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0xc(%rbp)
  lea    -0x10(%rbp),%rsi
  lea    -0x14(%rbp),%rcx
  lea    -0x18(%rbp),%rdx
  lea    -0x1c(%rbp),%rax
  mov    %rsi,%r8
  mov    %rax,%rsi
  mov    $0x1,%edi
  call   <cpuid@plt>
  cmpl   $0xd,-0x24(%rbp)
  ja     L372
  mov    -0x24(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  lea    D19(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D19(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    -0x1c(%rbp),%eax
  sar    $0x14,%eax
  movzbl %al,%eax
  jmp    L43
  mov    -0x1c(%rbp),%eax
  sar    $0x10,%eax
  and    $0xf,%eax
  jmp    L43
  mov    -0x1c(%rbp),%eax
  sar    $0xc,%eax
  and    $0x3,%eax
  jmp    L43
  mov    -0x1c(%rbp),%eax
  sar    $0x8,%eax
  and    $0xf,%eax
  jmp    L43
  mov    -0x1c(%rbp),%eax
  sar    $0x4,%eax
  and    $0xf,%eax
  jmp    L43
  mov    -0x18(%rbp),%eax
  sar    $0x18,%eax
  and    $0xf,%eax
  jmp    L43
  mov    -0x18(%rbp),%eax
  sar    $0x10,%eax
  and    $0xf,%eax
  jmp    L43
  mov    -0x18(%rbp),%eax
  sar    $0x8,%eax
  and    $0xf,%eax
  jmp    L43
  mov    -0x1c(%rbp),%eax
  and    $0xf,%eax
  jmp    L43
  mov    -0x18(%rbp),%eax
  movzbl %al,%eax
  jmp    L43
  mov    $0x0,%eax
  call   <have_cpuid@plt>
  cmp    $0x3,%eax
  jg     L251
  mov    $0x0,%eax
  jmp    L43
L251:
  lea    -0x10(%rbp),%rsi
  lea    -0x14(%rbp),%rcx
  lea    -0x18(%rbp),%rdx
  lea    -0x1c(%rbp),%rax
  mov    %rsi,%r8
  mov    %rax,%rsi
  mov    $0x4,%edi
  call   <cpuid@plt>
  mov    -0x1c(%rbp),%eax
  sar    $0xe,%eax
  and    $0xfff,%eax
  jmp    L43
  mov    $0x0,%eax
  call   <have_cpuid@plt>
  cmp    $0x3,%eax
  jg     L250
  mov    $0x0,%eax
  jmp    L43
L250:
  lea    -0x10(%rbp),%rsi
  lea    -0x14(%rbp),%rcx
  lea    -0x18(%rbp),%rdx
  lea    -0x1c(%rbp),%rax
  mov    %rsi,%r8
  mov    %rax,%rsi
  mov    $0x4,%edi
  call   <cpuid@plt>
  mov    -0x1c(%rbp),%eax
  shr    $0x1a,%eax
  jmp    L43
  mov    -0x10(%rbp),%eax
  and    $0x8,%eax
  test   %eax,%eax
  je     L117
  orl    $0x1000,-0xc(%rbp)
L117:
  mov    -0x10(%rbp),%eax
  and    $0x8000,%eax
  test   %eax,%eax
  je     L77
  orl    $0x800,-0xc(%rbp)
L77:
  mov    -0x10(%rbp),%eax
  and    $0x80000,%eax
  test   %eax,%eax
  je     L47
  orl    $0x2000,-0xc(%rbp)
L47:
  mov    -0x10(%rbp),%eax
  and    $0x800000,%eax
  test   %eax,%eax
  je     L205
  orl    $0x100,-0xc(%rbp)
L205:
  mov    -0x10(%rbp),%eax
  and    $0x2000000,%eax
  test   %eax,%eax
  je     L229
  orl    $0x1,-0xc(%rbp)
L229:
  mov    -0x10(%rbp),%eax
  and    $0x4000000,%eax
  test   %eax,%eax
  je     L55
  orl    $0x2,-0xc(%rbp)
L55:
  mov    -0x10(%rbp),%eax
  and    $0x8000000,%eax
  test   %eax,%eax
  je     L23
  mov    -0x18(%rbp),%eax
  sar    $0x10,%eax
  and    $0xf,%eax
  test   %eax,%eax
  jle    L23
  orl    $0x4000,-0xc(%rbp)
L23:
  mov    -0x14(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L161
  orl    $0x4,-0xc(%rbp)
L161:
  mov    -0x14(%rbp),%eax
  and    $0x200,%eax
  test   %eax,%eax
  je     L248
  orl    $0x8,-0xc(%rbp)
L248:
  mov    -0x14(%rbp),%eax
  and    $0x80000,%eax
  test   %eax,%eax
  je     L355
  orl    $0x10,-0xc(%rbp)
L355:
  mov    -0x14(%rbp),%eax
  and    $0x100000,%eax
  test   %eax,%eax
  je     L240
  orl    $0x20,-0xc(%rbp)
L240:
  mov    -0x14(%rbp),%eax
  and    $0x10000000,%eax
  test   %eax,%eax
  je     L274
  orl    $0x40000,-0xc(%rbp)
L274:
  mov    $0x0,%eax
  call   <have_excpuid@plt>
  test   %eax,%eax
  jle    L270
  lea    -0x10(%rbp),%rsi
  lea    -0x14(%rbp),%rcx
  lea    -0x18(%rbp),%rdx
  lea    -0x1c(%rbp),%rax
  mov    %rsi,%r8
  mov    %rax,%rsi
  mov    $0x80000001,%edi
  call   <cpuid@plt>
  mov    -0x14(%rbp),%eax
  and    $0x40,%eax
  test   %eax,%eax
  je     L234
  orl    $0x40,-0xc(%rbp)
L234:
  mov    -0x14(%rbp),%eax
  and    $0x80,%eax
  test   %eax,%eax
  je     L52
  orl    $0x8000,-0xc(%rbp)
L52:
  mov    -0x10(%rbp),%eax
  and    $0x40000000,%eax
  test   %eax,%eax
  je     L215
  orl    $0x400,-0xc(%rbp)
L215:
  mov    -0x10(%rbp),%eax
  test   %eax,%eax
  jns    L270
  orl    $0x200,-0xc(%rbp)
L270:
  mov    $0x0,%eax
  call   <have_excpuid@plt>
  cmp    $0x19,%eax
  jle    L372
  lea    -0x10(%rbp),%rsi
  lea    -0x14(%rbp),%rcx
  lea    -0x18(%rbp),%rdx
  lea    -0x1c(%rbp),%rax
  mov    %rsi,%r8
  mov    %rax,%rsi
  mov    $0x8000001a,%edi
  call   <cpuid@plt>
  mov    -0x1c(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L44
  orl    $0x10000,-0xc(%rbp)
L44:
  mov    -0x1c(%rbp),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L372
  orl    $0x20000,-0xc(%rbp)
L372:
  mov    -0xc(%rbp),%eax
L43:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L80
  call   <__stack_chk_fail@plt>
L80:
  leave
  ret
```

assistant: ```c
int get_cputype(int gettype) {
  int eax, ebx, ecx, edx;
  int extend_family, family;
  int extend_model, model;
  int type, stepping;
  int feature = 0;
  cpuid(1, &eax, &ebx, &ecx, &edx);
  switch (gettype) {
  case 1:
    return ((((eax) >> (20)) & (0xff)));
  case 2:
    return ((((eax) >> (16)) & (0x0f)));
  case 3:
    return ((((eax) >> (12)) & (0x03)));
  case 4:
    return ((((eax) >> (8)) & (0x0f)));
  case 5:
    return ((((eax) >> (4)) & (0x0f)));
  case 6:
    return ((((ebx) >> (24)) & (0x0f)));
  case 7:
    return ((((ebx) >> (16)) & (0x0f)));
  case 8:
    return ((((ebx) >> (8)) & (0x0f)));
  case 9:
    return ((((eax) >> (0)) & (0x0f)));
  case 10:
    return ((((ebx) >> (0)) & (0xff)));
  case 12:
    if (have_cpuid() < 4)
      return 0;
    cpuid(4, &eax, &ebx, &ecx, &edx);
    return ((((eax) >> (14)) & (0xfff)));
  case 13:
    if (have_cpuid() < 4)
      return 0;
    cpuid(4, &eax, &ebx, &ecx, &edx);
    return ((((eax) >> (26)) & (0x3f)));
  case 11:
    if ((edx & (1 << 3)) != 0)
      feature |= (1 << 12);
    if ((edx & (1 << 15)) != 0)
      feature |= (1 << 11);
    if ((edx & (1 << 19)) != 0)
      feature |= (1 << 13);
    if ((edx & (1 << 23)) != 0)
      feature |= (1 << 8);
    if ((edx & (1 << 25)) != 0)
      feature |= (1 << 0);
    if ((edx & (1 << 26)) != 0)
      feature |= (1 << 1);
    if ((edx & (1 << 27)) != 0) {
      if (((((ebx) >> (16)) & (0x0f))) > 0)
        feature |= (1 << 14);
    }
    if ((ecx & (1 << 0)) != 0)
      feature |= (1 << 2);
    if ((ecx & (1 << 9)) != 0)
      feature |= (1 << 3);
    if ((ecx & (1 << 19)) != 0)
      feature |= (1 << 4);
    if ((ecx & (1 << 20)) != 0)
      feature |= (1 << 5);
    if ((ecx & (1 << 28)) != 0)
      feature |= (1 << 18);
    if (have_excpuid() >= 0x01) {
      cpuid(0x80000001, &eax, &ebx, &ecx, &edx);
      if ((ecx & (1 << 6)) != 0)
        feature |= (1 << 6);
      if ((ecx & (1 << 7)) != 0)
        feature |= (1 << 15);
      if ((edx & (1 << 30)) != 0)
        feature |= (1 << 10);
      if ((edx & (1 << 31)) != 0)
        feature |= (1 << 9);
    }
    if (have_excpuid() >= 0x1a) {
      cpuid(0x8000001a, &eax, &ebx, &ecx, &edx);
      if ((eax & (1 << 0)) != 0)
        feature |= (1 << 16);
      if ((eax & (1 << 1)) != 0)
        feature |= (1 << 17);
    }
  }
  return feature;
}
```