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    L1027
  mov    $0xb,%eax
  jmp    L957
L1027:
  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    L424
  mov    -0x14(%rbp),%eax
  sub    $0x4,%eax
  cmp    $0xb,%eax
  ja     L235
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D67(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D67(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0xc,%eax
  jmp    L957
  mov    $0xd,%eax
  jmp    L957
  cmpl   $0x2,-0x8(%rbp)
  je     L580
  cmpl   $0x2,-0x8(%rbp)
  jg     L186
  cmpl   $0x0,-0x8(%rbp)
  je     L374
  cmpl   $0x1,-0x8(%rbp)
  je     L173
  jmp    L186
L374:
  cmpl   $0x6,-0xc(%rbp)
  jg     L199
  cmpl   $0x0,-0xc(%rbp)
  jg     L627
  jmp    L852
L479:
  mov    -0xc(%rbp),%eax
  sub    $0x7,%eax
  cmp    $0x8,%eax
  ja     L852
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D34(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D34(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
L627:
  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    L157
  jmp    L852
L199:
  cmpl   $0xf,-0xc(%rbp)
  jg     L852
  cmpl   $0x7,-0xc(%rbp)
  jge    L479
  jmp    L852
L157:
  mov    $0xe,%eax
  jmp    L957
  mov    $0xf,%eax
  jmp    L957
  mov    $0x10,%eax
  jmp    L957
  mov    $0x12,%eax
  jmp    L957
L173:
  mov    -0xc(%rbp),%eax
  sub    $0x6,%eax
  cmp    $0x9,%eax
  ja     L981
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D70(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D70(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x12,%eax
  jmp    L957
  mov    $0x13,%eax
  jmp    L957
  mov    $0x15,%eax
  jmp    L957
  mov    $0x16,%eax
  jmp    L957
  mov    $0x14,%eax
  jmp    L957
L580:
  mov    -0xc(%rbp),%eax
  sub    $0x5,%eax
  cmp    $0xa,%eax
  ja     L41
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D27(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D27(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x15,%eax
  jmp    L957
  mov    $0x15,%eax
  jmp    L957
  mov    $0x15,%eax
  jmp    L957
  mov    $0x15,%eax
  jmp    L957
  mov    $0x15,%eax
  jmp    L957
L852:
  nop
  jmp    L186
L981:
  nop
  jmp    L186
L41:
  nop
  jmp    L186
  mov    $0x17,%eax
  jmp    L957
  cmpl   $0x0,-0x10(%rbp)
  je     L895
  cmpl   $0x1,-0x10(%rbp)
  je     L905
  jmp    L235
L895:
  mov    $0x11,%eax
  jmp    L957
L905:
  mov    $0x17,%eax
  jmp    L957
L186:
  nop
L235:
  mov    $0x1,%eax
  jmp    L957
L424:
  cmpl   $0x3,-0x4(%rbp)
  jne    L338
  cmpl   $0xf,-0x14(%rbp)
  je     L566
  cmpl   $0xf,-0x14(%rbp)
  jg     L1001
  cmpl   $0x6,-0x14(%rbp)
  je     L187
  cmpl   $0x6,-0x14(%rbp)
  jg     L1001
  cmpl   $0x4,-0x14(%rbp)
  je     L801
  cmpl   $0x5,-0x14(%rbp)
  je     L423
  jmp    L1001
L801:
  mov    $0x19,%eax
  jmp    L957
L423:
  mov    $0x1a,%eax
  jmp    L957
L187:
  mov    $0x1b,%eax
  jmp    L957
L566:
  cmpl   $0xa,-0x10(%rbp)
  je     L229
  cmpl   $0xa,-0x10(%rbp)
  jg     L313
  cmpl   $0x2,-0x10(%rbp)
  je     L769
  cmpl   $0x2,-0x10(%rbp)
  jg     L313
  cmpl   $0x0,-0x10(%rbp)
  je     L769
  cmpl   $0x1,-0x10(%rbp)
  je     L229
  jmp    L313
L769:
  mov    $0x1d,%eax
  jmp    L957
L229:
  mov    $0x1e,%eax
  jmp    L957
L313:
  nop
L1001:
  mov    $0x3,%eax
  jmp    L957
L338:
  cmpl   $0x4,-0x4(%rbp)
  jne    L40
  cmpl   $0x6,-0x14(%rbp)
  je     L898
  cmpl   $0x6,-0x14(%rbp)
  jg     L397
  cmpl   $0x4,-0x14(%rbp)
  je     L21
  cmpl   $0x5,-0x14(%rbp)
  je     L928
  jmp    L397
L21:
  mov    $0x21,%eax
  jmp    L957
L928:
  mov    $0x22,%eax
  jmp    L957
L898:
  mov    $0x23,%eax
  jmp    L957
L397:
  mov    $0x4,%eax
  jmp    L957
L40:
  cmpl   $0x5,-0x4(%rbp)
  jne    L689
  cmpl   $0x5,-0x14(%rbp)
  jne    L968
  mov    $0x24,%eax
  jmp    L957
L968:
  mov    $0x5,%eax
  jmp    L957
L689:
  cmpl   $0x6,-0x4(%rbp)
  jne    L935
  cmpl   $0x5,-0x14(%rbp)
  je     L531
  cmpl   $0x6,-0x14(%rbp)
  je     L662
  jmp    L472
L531:
  mov    $0x25,%eax
  jmp    L957
L662:
  mov    $0x2b,%eax
  jmp    L957
L472:
  mov    $0x2a,%eax
  jmp    L957
L935:
  cmpl   $0x7,-0x4(%rbp)
  jne    L626
  cmpl   $0x5,-0x14(%rbp)
  jne    L227
  mov    $0x26,%eax
  jmp    L957
L227:
  mov    $0x7,%eax
  jmp    L957
L626:
  cmpl   $0x8,-0x4(%rbp)
  jne    L712
  cmpl   $0x5,-0x14(%rbp)
  jne    L103
  mov    $0x27,%eax
  jmp    L957
L103:
  mov    $0x8,%eax
  jmp    L957
L712:
  cmpl   $0x9,-0x4(%rbp)
  jne    L669
  cmpl   $0x5,-0x14(%rbp)
  jne    L266
  mov    $0x28,%eax
  jmp    L957
L266:
  mov    $0x9,%eax
  jmp    L957
L669:
  cmpl   $0xa,-0x4(%rbp)
  jne    L760
  cmpl   $0x5,-0x14(%rbp)
  jne    L202
  mov    $0x29,%eax
  jmp    L957
L202:
  mov    $0xa,%eax
  jmp    L957
L760:
  mov    $0x0,%eax
L957:
  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:
          return 21;
        case 12:
          return 21;
        case 13:
          return 21;
        case 15:
          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;
      }
      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;
}
```