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

```asm
<get_cpuname>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    $0x0,%eax
  call   <have_cpuid@plt>
  test   %eax,%eax
  jne    L887
  mov    $0xb,%eax
  jmp    L954
L887:
  mov    $0x4,%edi
  call   <get_cputype@plt>
  mov    %eax,-0x14(%rbp)
  mov    $0x1,%edi
  call   <get_cputype@plt>
  mov    %eax,-0x10(%rbp)
  mov    $0x5,%edi
  call   <get_cputype@plt>
  mov    %eax,-0xc(%rbp)
  mov    $0x2,%edi
  call   <get_cputype@plt>
  mov    %eax,-0x8(%rbp)
  mov    $0x0,%eax
  call   <get_vendor@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x1,-0x4(%rbp)
  jne    L615
  mov    -0x14(%rbp),%eax
  sub    $0x4,%eax
  cmp    $0xb,%eax
  ja     L391
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D9(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D9(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0xc,%eax
  jmp    L954
  mov    $0xd,%eax
  jmp    L954
  cmpl   $0x4,-0x8(%rbp)
  ja     L525
  mov    -0x8(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  lea    D39(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D39(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  cmpl   $0x6,-0xc(%rbp)
  jg     L816
  cmpl   $0x0,-0xc(%rbp)
  jg     L497
  jmp    L67
L11:
  mov    -0xc(%rbp),%eax
  sub    $0x7,%eax
  cmp    $0x8,%eax
  ja     L67
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D33(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D33(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
L497:
  mov    -0xc(%rbp),%eax
  mov    $0x6a,%edx
  mov    %eax,%ecx
  shr    %cl,%rdx
  mov    %rdx,%rax
  and    $0x1,%eax
  test   %rax,%rax
  setne  %al
  test   %al,%al
  jne    L1075
  jmp    L67
L816:
  cmpl   $0xf,-0xc(%rbp)
  jg     L67
  cmpl   $0x7,-0xc(%rbp)
  jge    L11
  jmp    L67
L1075:
  mov    $0xe,%eax
  jmp    L954
  mov    $0xf,%eax
  jmp    L954
  mov    $0x10,%eax
  jmp    L954
  mov    $0x12,%eax
  jmp    L954
  mov    -0xc(%rbp),%eax
  sub    $0x6,%eax
  cmp    $0x9,%eax
  ja     L134
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D10(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D10(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x12,%eax
  jmp    L954
  mov    $0x13,%eax
  jmp    L954
  mov    $0x15,%eax
  jmp    L954
  mov    $0x16,%eax
  jmp    L954
  mov    $0x14,%eax
  jmp    L954
  mov    -0xc(%rbp),%eax
  sub    $0x5,%eax
  cmp    $0xa,%eax
  ja     L1026
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D109(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D109(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x15,%eax
  jmp    L954
  mov    $0x0,%eax
  call   <support_avx@plt>
  test   %eax,%eax
  je     L688
  mov    $0x2c,%eax
  jmp    L954
L688:
  mov    $0x15,%eax
  jmp    L954
  mov    $0x15,%eax
  jmp    L954
  mov    $0x0,%eax
  call   <support_avx@plt>
  test   %eax,%eax
  je     L903
  mov    $0x2c,%eax
  jmp    L954
L903:
  mov    $0x15,%eax
  jmp    L954
  mov    $0x15,%eax
  jmp    L954
  cmpl   $0xf,-0xc(%rbp)
  je     L116
  cmpl   $0xf,-0xc(%rbp)
  jg     L1086
  cmpl   $0xe,-0xc(%rbp)
  je     L759
  cmpl   $0xe,-0xc(%rbp)
  jg     L1086
  cmpl   $0xa,-0xc(%rbp)
  je     L759
  cmpl   $0xc,-0xc(%rbp)
  je     L116
  jmp    L1086
L759:
  mov    $0x0,%eax
  call   <support_avx@plt>
  test   %eax,%eax
  je     L452
  mov    $0x2c,%eax
  jmp    L954
L452:
  mov    $0x15,%eax
  jmp    L954
L116:
  mov    $0x0,%eax
  call   <support_avx@plt>
  test   %eax,%eax
  je     L865
  mov    $0x30,%eax
  jmp    L954
L865:
  mov    $0x15,%eax
  jmp    L954
  mov    -0xc(%rbp),%eax
  sub    $0x5,%eax
  cmp    $0x1,%eax
  ja     L506
  mov    $0x0,%eax
  call   <support_avx@plt>
  test   %eax,%eax
  je     L479
  mov    $0x30,%eax
  jmp    L954
L479:
  mov    $0x15,%eax
  jmp    L954
L67:
  nop
  jmp    L525
L134:
  nop
  jmp    L525
L1026:
  nop
  jmp    L525
L1086:
  nop
  jmp    L525
L506:
  nop
  jmp    L525
  mov    $0x17,%eax
  jmp    L954
  cmpl   $0x0,-0x10(%rbp)
  je     L1147
  cmpl   $0x1,-0x10(%rbp)
  je     L6
  jmp    L391
L1147:
  mov    $0x11,%eax
  jmp    L954
L6:
  mov    $0x17,%eax
  jmp    L954
L525:
  nop
L391:
  mov    $0x1,%eax
  jmp    L954
L615:
  cmpl   $0x3,-0x4(%rbp)
  jne    L968
  cmpl   $0xf,-0x14(%rbp)
  je     L989
  cmpl   $0xf,-0x14(%rbp)
  jg     L73
  cmpl   $0x6,-0x14(%rbp)
  je     L1070
  cmpl   $0x6,-0x14(%rbp)
  jg     L73
  cmpl   $0x4,-0x14(%rbp)
  je     L1092
  cmpl   $0x5,-0x14(%rbp)
  je     L714
  jmp    L73
L1092:
  mov    $0x19,%eax
  jmp    L954
L714:
  mov    $0x1a,%eax
  jmp    L954
L1070:
  mov    $0x1b,%eax
  jmp    L954
L989:
  cmpl   $0xa,-0x10(%rbp)
  ja     L253
  mov    -0x10(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  lea    D112(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D112(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x1d,%eax
  jmp    L954
  mov    $0x1e,%eax
  jmp    L954
  cmpl   $0x1,-0xc(%rbp)
  je     L132
  cmpl   $0x2,-0xc(%rbp)
  je     L905
  jmp    L253
L132:
  mov    $0x0,%eax
  call   <support_avx@plt>
  test   %eax,%eax
  je     L311
  mov    $0x2e,%eax
  jmp    L954
L311:
  mov    $0x1e,%eax
  jmp    L954
L905:
  mov    $0x0,%eax
  call   <support_avx@plt>
  test   %eax,%eax
  je     L500
  mov    $0x2f,%eax
  jmp    L954
L500:
  mov    $0x1e,%eax
  jmp    L954
  mov    $0x2d,%eax
  jmp    L954
L253:
  nop
L73:
  mov    $0x3,%eax
  jmp    L954
L968:
  cmpl   $0x4,-0x4(%rbp)
  jne    L810
  cmpl   $0x6,-0x14(%rbp)
  je     L208
  cmpl   $0x6,-0x14(%rbp)
  jg     L993
  cmpl   $0x4,-0x14(%rbp)
  je     L999
  cmpl   $0x5,-0x14(%rbp)
  je     L691
  jmp    L993
L999:
  mov    $0x21,%eax
  jmp    L954
L691:
  mov    $0x22,%eax
  jmp    L954
L208:
  mov    $0x23,%eax
  jmp    L954
L993:
  mov    $0x4,%eax
  jmp    L954
L810:
  cmpl   $0x5,-0x4(%rbp)
  jne    L339
  cmpl   $0x5,-0x14(%rbp)
  jne    L751
  mov    $0x24,%eax
  jmp    L954
L751:
  mov    $0x5,%eax
  jmp    L954
L339:
  cmpl   $0x6,-0x4(%rbp)
  jne    L1149
  cmpl   $0x5,-0x14(%rbp)
  je     L395
  cmpl   $0x6,-0x14(%rbp)
  je     L733
  jmp    L729
L395:
  mov    $0x25,%eax
  jmp    L954
L733:
  mov    $0x2b,%eax
  jmp    L954
L729:
  mov    $0x2a,%eax
  jmp    L954
L1149:
  cmpl   $0x7,-0x4(%rbp)
  jne    L902
  cmpl   $0x5,-0x14(%rbp)
  jne    L676
  mov    $0x26,%eax
  jmp    L954
L676:
  mov    $0x7,%eax
  jmp    L954
L902:
  cmpl   $0x8,-0x4(%rbp)
  jne    L1156
  cmpl   $0x5,-0x14(%rbp)
  jne    L814
  mov    $0x27,%eax
  jmp    L954
L814:
  mov    $0x8,%eax
  jmp    L954
L1156:
  cmpl   $0x9,-0x4(%rbp)
  jne    L305
  cmpl   $0x5,-0x14(%rbp)
  jne    L861
  mov    $0x28,%eax
  jmp    L954
L861:
  mov    $0x9,%eax
  jmp    L954
L305:
  cmpl   $0xa,-0x4(%rbp)
  jne    L446
  cmpl   $0x5,-0x14(%rbp)
  jne    L374
  mov    $0x29,%eax
  jmp    L954
L374:
  mov    $0xa,%eax
  jmp    L954
L446:
  mov    $0x0,%eax
L954:
  leave
  ret
```

assistant: ```c
int get_cpuname(void) {
  int family, exfamily, model, vendor, exmodel;
  if (!have_cpuid())
    return 11;
  family = get_cputype(4);
  exfamily = get_cputype(1);
  model = get_cputype(5);
  exmodel = get_cputype(2);
  vendor = get_vendor();
  if (vendor == 1) {
    switch (family) {
    case 0x4:
      return 12;
    case 0x5:
      return 13;
    case 0x6:
      switch (exmodel) {
      case 0:
        switch (model) {
        case 1:
        case 3:
        case 5:
        case 6:
          return 14;
        case 7:
        case 8:
        case 10:
        case 11:
          return 15;
        case 9:
        case 13:
        case 14:
          return 16;
        case 15:
          return 18;
        }
        break;
      case 1:
        switch (model) {
        case 6:
          return 18;
        case 7:
          return 19;
        case 10:
        case 11:
        case 14:
        case 15:
          return 21;
        case 12:
          return 22;
        case 13:
          return 20;
        }
        break;
      case 2:
        switch (model) {
        case 5:
          return 21;
        case 10:
          if (support_avx())
            return 44;
          else
            return 21;
        case 12:
          return 21;
        case 13:
          if (support_avx())
            return 44;
          else
            return 21;
        case 14:
        case 15:
          return 21;
        }
        break;
      case 3:
        switch (model) {
        case 10:
        case 14:
          if (support_avx())
            return 44;
          else
            return 21;
        case 12:
        case 15:
          if (support_avx())
            return 48;
          else
            return 21;
        }
        break;
      case 4:
        switch (model) {
        case 5:
        case 6:
          if (support_avx())
            return 48;
          else
            return 21;
        }
        break;
      }
      break;
    case 0x7:
      return 23;
    case 0xf:
      switch (exfamily) {
      case 0:
        return 17;
      case 1:
        return 23;
      }
      break;
    }
    return 1;
  }
  if (vendor == 3) {
    switch (family) {
    case 0x4:
      return 25;
    case 0x5:
      return 26;
    case 0x6:
      return 27;
    case 0xf:
      switch (exfamily) {
      case 0:
      case 2:
        return 29;
      case 1:
      case 10:
        return 30;
      case 6:
        switch (model) {
        case 1:
          if (support_avx())
            return 46;
          else
            return 30;
        case 2:
          if (support_avx())
            return 47;
          else
            return 30;
        }
        break;
      case 5:
        return 45;
      }
      break;
    }
    return 3;
  }
  if (vendor == 4) {
    switch (family) {
    case 0x4:
      return 33;
    case 0x5:
      return 34;
    case 0x6:
      return 35;
    }
    return 4;
  }
  if (vendor == 5) {
    switch (family) {
    case 0x5:
      return 36;
    }
    return 5;
  }
  if (vendor == 6) {
    switch (family) {
    case 0x5:
      return 37;
      break;
    case 0x6:
      return 43;
      break;
    }
    return 42;
  }
  if (vendor == 7) {
    switch (family) {
    case 0x5:
      return 38;
    }
    return 7;
  }
  if (vendor == 8) {
    switch (family) {
    case 0x5:
      return 39;
    }
    return 8;
  }
  if (vendor == 9) {
    switch (family) {
    case 0x5:
      return 40;
    }
    return 9;
  }
  if (vendor == 10) {
    switch (family) {
    case 0x5:
      return 41;
    }
    return 10;
  }
  return 0;
}
```