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

```asm
<get_coretype>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    $0x0,%eax
  call   <have_cpuid@plt>
  test   %eax,%eax
  jne    L790
  mov    $0x1,%eax
  jmp    L456
L790:
  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    L382
  cmpl   $0xf,-0x14(%rbp)
  je     L772
  cmpl   $0xf,-0x14(%rbp)
  jg     L382
  cmpl   $0x6,-0x14(%rbp)
  je     L809
  cmpl   $0x6,-0x14(%rbp)
  jg     L382
  cmpl   $0x4,-0x14(%rbp)
  je     L70
  cmpl   $0x5,-0x14(%rbp)
  je     L628
  jmp    L382
L70:
  mov    $0x1,%eax
  jmp    L456
L628:
  mov    $0x2,%eax
  jmp    L456
L809:
  cmpl   $0x4,-0x8(%rbp)
  ja     L216
  mov    -0x8(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  lea    D74(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D74(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  cmpl   $0xf,-0xc(%rbp)
  ja     L61
  mov    -0xc(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  lea    D73(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D73(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x3,%eax
  jmp    L456
  mov    $0x4,%eax
  jmp    L456
  mov    $0x5,%eax
  jmp    L456
  mov    $0x8,%eax
  jmp    L456
  mov    $0xe,%eax
  jmp    L456
  mov    -0xc(%rbp),%eax
  sub    $0x6,%eax
  cmp    $0x9,%eax
  ja     L473
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D36(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D36(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0xe,%eax
  jmp    L456
  mov    $0xf,%eax
  jmp    L456
  mov    $0x11,%eax
  jmp    L456
  mov    $0x12,%eax
  jmp    L456
  mov    $0x10,%eax
  jmp    L456
  mov    -0xc(%rbp),%eax
  sub    $0x5,%eax
  cmp    $0xa,%eax
  ja     L425
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D72(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D72(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x11,%eax
  jmp    L456
  mov    $0x0,%eax
  call   <support_avx@plt>
  test   %eax,%eax
  je     L592
  mov    $0x14,%eax
  jmp    L456
L592:
  mov    $0x11,%eax
  jmp    L456
  mov    $0x11,%eax
  jmp    L456
  mov    $0x0,%eax
  call   <support_avx@plt>
  test   %eax,%eax
  je     L418
  mov    $0x14,%eax
  jmp    L456
L418:
  mov    $0x11,%eax
  jmp    L456
  mov    $0x11,%eax
  jmp    L456
  cmpl   $0xa,-0xc(%rbp)
  je     L59
  cmpl   $0xc,-0xc(%rbp)
  je     L414
  jmp    L89
L59:
  mov    $0x0,%eax
  call   <support_avx@plt>
  test   %eax,%eax
  je     L249
  mov    $0x14,%eax
  jmp    L456
L249:
  mov    $0x11,%eax
  jmp    L456
L414:
  mov    $0x0,%eax
  call   <support_avx@plt>
  test   %eax,%eax
  je     L780
  mov    $0x14,%eax
  jmp    L456
L780:
  mov    $0x11,%eax
  jmp    L456
  cmpl   $0x5,-0xc(%rbp)
  jne    L250
  mov    $0x0,%eax
  call   <support_avx@plt>
  test   %eax,%eax
  je     L781
  mov    $0x14,%eax
  jmp    L456
L781:
  mov    $0x11,%eax
  jmp    L456
L61:
  nop
  jmp    L216
L473:
  nop
  jmp    L216
L425:
  nop
  jmp    L216
L250:
  nop
L89:
  jmp    L216
L772:
  cmpl   $0x2,-0xc(%rbp)
  jg     L681
  mov    $0x6,%eax
  jmp    L456
L681:
  mov    $0x7,%eax
  jmp    L456
L216:
  nop
L382:
  cmpl   $0x3,-0x4(%rbp)
  jne    L85
  cmpl   $0x5,-0x14(%rbp)
  jg     L427
  mov    $0x1,%eax
  jmp    L456
L427:
  cmpl   $0xe,-0x14(%rbp)
  jg     L350
  mov    $0x9,%eax
  jmp    L456
L350:
  cmpl   $0xf,-0x14(%rbp)
  jne    L85
  cmpl   $0x0,-0x10(%rbp)
  je     L32
  cmpl   $0x2,-0x10(%rbp)
  jne    L524
L32:
  mov    $0xa,%eax
  jmp    L456
L524:
  cmpl   $0x5,-0x10(%rbp)
  jne    L154
  mov    $0x15,%eax
  jmp    L456
L154:
  cmpl   $0x6,-0x10(%rbp)
  jne    L491
  cmpl   $0x1,-0xc(%rbp)
  je     L360
  cmpl   $0x2,-0xc(%rbp)
  je     L123
  jmp    L85
L360:
  mov    $0x0,%eax
  call   <support_avx@plt>
  test   %eax,%eax
  je     L55
  mov    $0x16,%eax
  jmp    L456
L55:
  mov    $0xb,%eax
  jmp    L456
L123:
  mov    $0x0,%eax
  call   <support_avx@plt>
  test   %eax,%eax
  je     L654
  mov    $0x17,%eax
  jmp    L456
L654:
  mov    $0xb,%eax
  jmp    L456
L491:
  mov    $0xb,%eax
  jmp    L456
L85:
  cmpl   $0x6,-0x4(%rbp)
  jne    L336
  cmpl   $0x6,-0x14(%rbp)
  jne    L31
  mov    $0x13,%eax
  jmp    L456
L31:
  mov    $0xc,%eax
  jmp    L456
L336:
  mov    $0x0,%eax
L456:
  leave
  ret
```

assistant: ```c
int get_coretype(void) {
  int family, exfamily, model, exmodel, vendor;
  if (!have_cpuid())
    return 1;
  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 4:
      return 1;
    case 5:
      return 2;
    case 6:
      switch (exmodel) {
      case 0:
        switch (model) {
        case 0:
        case 1:
        case 2:
        case 3:
        case 4:
        case 5:
        case 6:
          return 3;
        case 7:
          return 4;
        case 8:
        case 10:
        case 11:
          return 5;
        case 9:
        case 13:
        case 14:
          return 8;
        case 15:
          return 14;
        }
        break;
      case 1:
        switch (model) {
        case 6:
          return 14;
        case 7:
          return 15;
        case 10:
        case 11:
        case 14:
        case 15:
          return 17;
        case 12:
          return 18;
        case 13:
          return 16;
        }
        break;
      case 2:
        switch (model) {
        case 5:
          return 17;
        case 10:
          if (support_avx())
            return 20;
          else
            return 17;
        case 12:
          return 17;
        case 13:
          if (support_avx())
            return 20;
          else
            return 17;
        case 14:
        case 15:
          return 17;
        }
        break;
      case 3:
        switch (model) {
        case 10:
          if (support_avx())
            return 20;
          else
            return 17;
        case 12:
          if (support_avx())
            return 20;
          else
            return 17;
        }
        break;
      case 4:
        switch (model) {
        case 5:
          if (support_avx())
            return 20;
          else
            return 17;
        }
        break;
      }
      break;
    case 15:
      if (model <= 0x2)
        return 6;
      else
        return 7;
    }
  }
  if (vendor == 3) {
    if (family <= 0x5)
      return 1;
    if (family <= 0xe)
      return 9;
    if (family == 0xf) {
      if ((exfamily == 0) || (exfamily == 2))
        return 10;
      else if (exfamily == 5)
        return 21;
      else if (exfamily == 6) {
        switch (model) {
        case 1:
          if (support_avx())
            return 22;
          else
            return 11;
        case 2:
          if (support_avx())
            return 23;
          else
            return 11;
        }
      } else
        return 11;
    }
  }
  if (vendor == 6) {
    switch (family) {
    case 0x6:
      return 19;
      break;
    }
    return 12;
  }
  return 0;
}
```