#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int get_cputype(int);
int get_vendor();
int /*<<< orphan*/ have_cpuid();
int /*<<< orphan*/ support_avx();
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:
        case 14:
          if (support_avx())
            return 20;
          else
            return 17;
        case 12:
        case 15:
          if (support_avx())
            return 24;
          else
            return 17;
        case 13:
          if (support_avx())
            return 24;
          else
            return 17;
        }
        break;
      case 4:
        switch (model) {
        case 5:
        case 6:
          if (support_avx())
            return 24;
          else
            return 17;
        case 7:
        case 15:
          if (support_avx())
            return 24;
          else
            return 17;
        }
        break;
      case 5:
        switch (model) {
        case 6:
          if (support_avx())
            return 24;
          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;
        case 0:
          if (support_avx())
            return 25;
          else
            return 11;
        }
      } else
        return 11;
    }
  }
  if (vendor == 6) {
    switch (family) {
    case 0x6:
      return 19;
      break;
    }
    return 12;
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_coretype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    $0x0,%al
call   1060 <have_cpuid@plt>
cmp    $0x0,%eax
jne    1164 <get_coretype+0x24>
movl   $0x1,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
mov    $0x4,%edi
call   1030 <get_cputype@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <get_cputype@plt>
mov    %eax,-0xc(%rbp)
mov    $0x5,%edi
call   1030 <get_cputype@plt>
mov    %eax,-0x10(%rbp)
mov    $0x2,%edi
call   1030 <get_cputype@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <get_vendor@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jne    1522 <get_coretype+0x3e2>
mov    -0x8(%rbp),%eax
add    $0xfffffffc,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0xb,%eax
ja     151d <get_coretype+0x3dd>
mov    -0x20(%rbp),%rax
lea    0xe34(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0x2,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
mov    -0x14(%rbp),%eax
mov    %rax,-0x28(%rbp)
sub    $0x5,%rax
ja     14f6 <get_coretype+0x3b6>
mov    -0x28(%rbp),%rax
lea    0xe27(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%eax
mov    %rax,-0x30(%rbp)
sub    $0xf,%rax
ja     1273 <get_coretype+0x133>
mov    -0x30(%rbp),%rax
lea    0xe86(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x3,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0x4,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0x5,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0x8,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0xe,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
jmp    14f6 <get_coretype+0x3b6>
mov    -0x10(%rbp),%eax
add    $0xfffffffa,%eax
mov    %eax,%ecx
mov    %rcx,-0x38(%rbp)
sub    $0x9,%eax
ja     12dd <get_coretype+0x19d>
mov    -0x38(%rbp),%rax
lea    0xdf4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xe,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0xf,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0x11,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0x12,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0x10,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
jmp    14f6 <get_coretype+0x3b6>
mov    -0x10(%rbp),%eax
add    $0xfffffffb,%eax
mov    %eax,%ecx
mov    %rcx,-0x40(%rbp)
sub    $0xa,%eax
ja     137f <get_coretype+0x23f>
mov    -0x40(%rbp),%rax
lea    0xd5e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x11,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     1333 <get_coretype+0x1f3>
movl   $0x14,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0x11,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0x11,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     1367 <get_coretype+0x227>
movl   $0x14,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0x11,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0x11,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
jmp    14f6 <get_coretype+0x3b6>
mov    -0x10(%rbp),%eax
add    $0xfffffff6,%eax
mov    %eax,%ecx
mov    %rcx,-0x48(%rbp)
sub    $0x5,%eax
ja     1425 <get_coretype+0x2e5>
mov    -0x48(%rbp),%rax
lea    0xca4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     13c9 <get_coretype+0x289>
movl   $0x14,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0x11,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     13f1 <get_coretype+0x2b1>
movl   $0x18,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0x11,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     1419 <get_coretype+0x2d9>
movl   $0x18,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0x11,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
jmp    14f6 <get_coretype+0x3b6>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4c(%rbp)
add    $0xfffffffb,%eax
sub    $0x2,%eax
jb     1463 <get_coretype+0x323>
jmp    1441 <get_coretype+0x301>
mov    -0x4c(%rbp),%eax
sub    $0x7,%eax
je     148b <get_coretype+0x34b>
jmp    1452 <get_coretype+0x312>
mov    -0x4c(%rbp),%eax
sub    $0xf,%eax
je     148b <get_coretype+0x34b>
jmp    14b3 <get_coretype+0x373>
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     147f <get_coretype+0x33f>
movl   $0x18,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0x11,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     14a7 <get_coretype+0x367>
movl   $0x18,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0x11,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
jmp    14f6 <get_coretype+0x3b6>
mov    -0x10(%rbp),%eax
sub    $0x6,%eax
jne    14f1 <get_coretype+0x3b1>
jmp    14c9 <get_coretype+0x389>
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     14e5 <get_coretype+0x3a5>
movl   $0x18,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0x11,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
jmp    14f6 <get_coretype+0x3b6>
jmp    151d <get_coretype+0x3dd>
cmpl   $0x2,-0x10(%rbp)
jg     1511 <get_coretype+0x3d1>
movl   $0x6,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0x7,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
jmp    1522 <get_coretype+0x3e2>
cmpl   $0x3,-0x18(%rbp)
jne    1674 <get_coretype+0x534>
cmpl   $0x5,-0x8(%rbp)
jg     1542 <get_coretype+0x402>
movl   $0x1,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
cmpl   $0xe,-0x8(%rbp)
jg     1558 <get_coretype+0x418>
movl   $0x9,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
cmpl   $0xf,-0x8(%rbp)
jne    166f <get_coretype+0x52f>
cmpl   $0x0,-0xc(%rbp)
je     1576 <get_coretype+0x436>
cmpl   $0x2,-0xc(%rbp)
jne    1582 <get_coretype+0x442>
movl   $0xa,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
cmpl   $0x5,-0xc(%rbp)
jne    1598 <get_coretype+0x458>
movl   $0x15,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
cmpl   $0x6,-0xc(%rbp)
jne    1654 <get_coretype+0x514>
mov    -0x10(%rbp),%eax
mov    %eax,-0x50(%rbp)
test   %eax,%eax
je     1627 <get_coretype+0x4e7>
jmp    15b5 <get_coretype+0x475>
mov    -0x50(%rbp),%eax
sub    $0x1,%eax
je     15d7 <get_coretype+0x497>
jmp    15c6 <get_coretype+0x486>
mov    -0x50(%rbp),%eax
sub    $0x2,%eax
je     15ff <get_coretype+0x4bf>
jmp    164f <get_coretype+0x50f>
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     15f3 <get_coretype+0x4b3>
movl   $0x16,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0xb,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     161b <get_coretype+0x4db>
movl   $0x17,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0xb,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     1643 <get_coretype+0x503>
movl   $0x19,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0xb,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
jmp    1660 <get_coretype+0x520>
movl   $0xb,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
jmp    1665 <get_coretype+0x525>
jmp    166a <get_coretype+0x52a>
jmp    166f <get_coretype+0x52f>
jmp    1674 <get_coretype+0x534>
cmpl   $0x6,-0x18(%rbp)
jne    16a7 <get_coretype+0x567>
mov    -0x8(%rbp),%eax
sub    $0x6,%eax
jne    169b <get_coretype+0x55b>
jmp    168f <get_coretype+0x54f>
movl   $0x13,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0xc,-0x4(%rbp)
jmp    16ae <get_coretype+0x56e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_coretype>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <have_cpuid@plt>
test   %eax,%eax
je     11c9 <get_coretype+0x89>
mov    $0x4,%edi
call   1030 <get_cputype@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <get_cputype@plt>
mov    %eax,%r15d
mov    $0x5,%edi
call   1030 <get_cputype@plt>
mov    %eax,%r14d
mov    $0x2,%edi
call   1030 <get_cputype@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <get_vendor@plt>
cmp    $0x6,%eax
je     11d3 <get_coretype+0x93>
cmp    $0x3,%eax
je     11e8 <get_coretype+0xa8>
cmp    $0x1,%eax
jne    135f <get_coretype+0x21f>
add    $0xfffffffc,%ebx
cmp    $0xb,%ebx
ja     135f <get_coretype+0x21f>
mov    $0x1,%eax
lea    0xe4a(%rip),%rcx
movslq (%rcx,%rbx,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x2,%eax
jmp    1361 <get_coretype+0x221>
mov    $0x1,%eax
jmp    1361 <get_coretype+0x221>
cmp    $0x6,%ebx
mov    $0x13,%ecx
mov    $0xc,%eax
cmove  %ecx,%eax
jmp    1361 <get_coretype+0x221>
mov    $0x1,%eax
cmp    $0x6,%ebx
jl     1361 <get_coretype+0x221>
mov    $0x9,%eax
cmp    $0xf,%ebx
jb     1361 <get_coretype+0x221>
jne    135f <get_coretype+0x21f>
test   $0xfffffffd,%r15d
je     12aa <get_coretype+0x16a>
cmp    $0x5,%r15d
je     136c <get_coretype+0x22c>
cmp    $0x6,%r15d
jne    1373 <get_coretype+0x233>
test   %r14d,%r14d
je     137a <get_coretype+0x23a>
cmp    $0x2,%r14d
je     1392 <get_coretype+0x252>
mov    $0x0,%eax
cmp    $0x1,%r14d
jne    1361 <get_coretype+0x221>
xor    %eax,%eax
call   1050 <support_avx@plt>
test   %eax,%eax
mov    $0xb,%ecx
mov    $0x16,%eax
cmove  %ecx,%eax
jmp    1361 <get_coretype+0x221>
cmp    $0x5,%ebp
ja     135f <get_coretype+0x21f>
mov    %ebp,%eax
lea    0xdb6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmp    $0x10,%r14d
jae    135f <get_coretype+0x21f>
movslq %r14d,%rax
lea    0xdc9(%rip),%rcx
jmp    12cc <get_coretype+0x18c>
xor    %eax,%eax
cmp    $0x3,%r14d
setl   %al
xor    $0x7,%eax
jmp    1361 <get_coretype+0x221>
mov    $0xa,%eax
jmp    1361 <get_coretype+0x221>
add    $0xfffffffa,%r14d
cmp    $0xa,%r14d
jae    135f <get_coretype+0x21f>
movslq %r14d,%rax
lea    0xdd4(%rip),%rcx
mov    (%rcx,%rax,4),%eax
jmp    1361 <get_coretype+0x221>
cmp    $0xf,%r14d
ja     135f <get_coretype+0x21f>
mov    $0x11,%eax
mov    $0xd020,%ecx
bt     %r14d,%ecx
jb     1361 <get_coretype+0x221>
cmp    $0xa,%r14d
je     1316 <get_coretype+0x1d6>
cmp    $0xd,%r14d
je     1316 <get_coretype+0x1d6>
jmp    135f <get_coretype+0x21f>
add    $0xfffffff6,%r14d
cmp    $0x5,%r14d
ja     135f <get_coretype+0x21f>
lea    0xd3b(%rip),%rax
movslq (%rax,%r14,4),%rcx
add    %rax,%rcx
jmp    *%rcx
xor    %eax,%eax
call   1050 <support_avx@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
lea    (%rcx,%rcx,2),%eax
add    $0x11,%eax
jmp    1361 <get_coretype+0x221>
lea    -0x5(%r14),%eax
cmp    $0x2,%eax
jb     1341 <get_coretype+0x201>
cmp    $0x7,%r14d
je     1341 <get_coretype+0x201>
cmp    $0xf,%r14d
jne    135f <get_coretype+0x21f>
xor    %eax,%eax
call   1050 <support_avx@plt>
test   %eax,%eax
mov    $0x11,%ecx
mov    $0x18,%eax
cmove  %ecx,%eax
jmp    1361 <get_coretype+0x221>
cmp    $0x6,%r14d
je     1341 <get_coretype+0x201>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x15,%eax
jmp    1361 <get_coretype+0x221>
mov    $0xb,%eax
jmp    1361 <get_coretype+0x221>
xor    %eax,%eax
call   1050 <support_avx@plt>
test   %eax,%eax
mov    $0xb,%ecx
mov    $0x19,%eax
cmove  %ecx,%eax
jmp    1361 <get_coretype+0x221>
xor    %eax,%eax
call   1050 <support_avx@plt>
test   %eax,%eax
mov    $0xb,%ecx
mov    $0x17,%eax
cmove  %ecx,%eax
jmp    1361 <get_coretype+0x221>

LLVM IR (-O0):
define i32 @get_coretype() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = call i32 (...) @have_cpuid()
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %0
store i32 1, i32* %1
br label %161
10: ; preds = %0
%11 = call i32 @get_cputype(i32 4)
store i32 %11, i32* %2
%12 = call i32 @get_cputype(i32 1)
store i32 %12, i32* %3
%13 = call i32 @get_cputype(i32 5)
store i32 %13, i32* %4
%14 = call i32 @get_cputype(i32 2)
store i32 %14, i32* %5
%15 = call i32 (...) @get_vendor()
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %102
18: ; preds = %10
%19 = load i32, i32* %2
switch i32 %19, label %101 [
i32 4, label %20
i32 5, label %21
i32 6, label %22
i32 15, label %96
]
20: ; preds = %18
store i32 1, i32* %1
br label %161
21: ; preds = %18
store i32 2, i32* %1
br label %161
22: ; preds = %18
%23 = load i32, i32* %5
switch i32 %23, label %95 [
i32 0, label %24
i32 1, label %32
i32 2, label %40
i32 3, label %56
i32 4, label %74
i32 5, label %87
]
24: ; preds = %22
%25 = load i32, i32* %4
switch i32 %25, label %31 [
i32 0, label %26
i32 1, label %26
i32 2, label %26
i32 3, label %26
i32 4, label %26
i32 5, label %26
i32 6, label %26
i32 7, label %27
i32 8, label %28
i32 10, label %28
i32 11, label %28
i32 9, label %29
i32 13, label %29
i32 14, label %29
i32 15, label %30
]
26: ; preds = %24, %24, %24, %24, %24, %24, %24
store i32 3, i32* %1
br label %161
27: ; preds = %24
store i32 4, i32* %1
br label %161
28: ; preds = %24, %24, %24
store i32 5, i32* %1
br label %161
29: ; preds = %24, %24, %24
store i32 8, i32* %1
br label %161
30: ; preds = %24
store i32 14, i32* %1
br label %161
31: ; preds = %24
br label %95
32: ; preds = %22
%33 = load i32, i32* %4
switch i32 %33, label %39 [
i32 6, label %34
i32 7, label %35
i32 10, label %36
i32 11, label %36
i32 14, label %36
i32 15, label %36
i32 12, label %37
i32 13, label %38
]
34: ; preds = %32
store i32 14, i32* %1
br label %161
35: ; preds = %32
store i32 15, i32* %1
br label %161
36: ; preds = %32, %32, %32, %32
store i32 17, i32* %1
br label %161
37: ; preds = %32
store i32 18, i32* %1
br label %161
38: ; preds = %32
store i32 16, i32* %1
br label %161
39: ; preds = %32
br label %95
40: ; preds = %22
%41 = load i32, i32* %4
switch i32 %41, label %55 [
i32 5, label %42
i32 10, label %43
i32 12, label %48
i32 13, label %49
i32 14, label %54
i32 15, label %54
]
42: ; preds = %40
store i32 17, i32* %1
br label %161
43: ; preds = %40
%44 = call i32 (...) @support_avx()
%45 = icmp ne i32 %44, 0
br i1 %45, label %46, label %47
46: ; preds = %43
store i32 20, i32* %1
br label %161
47: ; preds = %43
store i32 17, i32* %1
br label %161
48: ; preds = %40
store i32 17, i32* %1
br label %161
49: ; preds = %40
%50 = call i32 (...) @support_avx()
%51 = icmp ne i32 %50, 0
br i1 %51, label %52, label %53
52: ; preds = %49
store i32 20, i32* %1
br label %161
53: ; preds = %49
store i32 17, i32* %1
br label %161
54: ; preds = %40, %40
store i32 17, i32* %1
br label %161
55: ; preds = %40
br label %95
56: ; preds = %22
%57 = load i32, i32* %4
switch i32 %57, label %73 [
i32 10, label %58
i32 14, label %58
i32 12, label %63
i32 15, label %63
i32 13, label %68
]
58: ; preds = %56, %56
%59 = call i32 (...) @support_avx()
%60 = icmp ne i32 %59, 0
br i1 %60, label %61, label %62
61: ; preds = %58
store i32 20, i32* %1
br label %161
62: ; preds = %58
store i32 17, i32* %1
br label %161
63: ; preds = %56, %56
%64 = call i32 (...) @support_avx()
%65 = icmp ne i32 %64, 0
br i1 %65, label %66, label %67
66: ; preds = %63
store i32 24, i32* %1
br label %161
67: ; preds = %63
store i32 17, i32* %1
br label %161
68: ; preds = %56
%69 = call i32 (...) @support_avx()
%70 = icmp ne i32 %69, 0
br i1 %70, label %71, label %72
71: ; preds = %68
store i32 24, i32* %1
br label %161
72: ; preds = %68
store i32 17, i32* %1
br label %161
73: ; preds = %56
br label %95
74: ; preds = %22
%75 = load i32, i32* %4
switch i32 %75, label %86 [
i32 5, label %76
i32 6, label %76
i32 7, label %81
i32 15, label %81
]
76: ; preds = %74, %74
%77 = call i32 (...) @support_avx()
%78 = icmp ne i32 %77, 0
br i1 %78, label %79, label %80
79: ; preds = %76
store i32 24, i32* %1
br label %161
80: ; preds = %76
store i32 17, i32* %1
br label %161
81: ; preds = %74, %74
%82 = call i32 (...) @support_avx()
%83 = icmp ne i32 %82, 0
br i1 %83, label %84, label %85
84: ; preds = %81
store i32 24, i32* %1
br label %161
85: ; preds = %81
store i32 17, i32* %1
br label %161
86: ; preds = %74
br label %95
87: ; preds = %22
%88 = load i32, i32* %4
switch i32 %88, label %94 [
i32 6, label %89
]
89: ; preds = %87
%90 = call i32 (...) @support_avx()
%91 = icmp ne i32 %90, 0
br i1 %91, label %92, label %93
92: ; preds = %89
store i32 24, i32* %1
br label %161
93: ; preds = %89
store i32 17, i32* %1
br label %161
94: ; preds = %87
br label %95
95: ; preds = %22, %94, %86, %73, %55, %39, %31
br label %101
96: ; preds = %18
%97 = load i32, i32* %4
%98 = icmp sle i32 %97, 2
br i1 %98, label %99, label %100
99: ; preds = %96
store i32 6, i32* %1
br label %161
100: ; preds = %96
store i32 7, i32* %1
br label %161
101: ; preds = %18, %95
br label %102
102: ; preds = %101, %10
%103 = load i32, i32* %6
%104 = icmp eq i32 %103, 3
br i1 %104, label %105, label %153
105: ; preds = %102
%106 = load i32, i32* %2
%107 = icmp sle i32 %106, 5
br i1 %107, label %108, label %109
108: ; preds = %105
store i32 1, i32* %1
br label %161
109: ; preds = %105
%110 = load i32, i32* %2
%111 = icmp sle i32 %110, 14
br i1 %111, label %112, label %113
112: ; preds = %109
store i32 9, i32* %1
br label %161
113: ; preds = %109
%114 = load i32, i32* %2
%115 = icmp eq i32 %114, 15
br i1 %115, label %116, label %152
116: ; preds = %113
%117 = load i32, i32* %3
%118 = icmp eq i32 %117, 0
br i1 %118, label %122, label %119
119: ; preds = %116
%120 = load i32, i32* %3
%121 = icmp eq i32 %120, 2
br i1 %121, label %122, label %123
122: ; preds = %119, %116
store i32 10, i32* %1
br label %161
123: ; preds = %119
%124 = load i32, i32* %3
%125 = icmp eq i32 %124, 5
br i1 %125, label %126, label %127
126: ; preds = %123
store i32 21, i32* %1
br label %161
127: ; preds = %123
%128 = load i32, i32* %3
%129 = icmp eq i32 %128, 6
br i1 %129, label %130, label %148
130: ; preds = %127
%131 = load i32, i32* %4
switch i32 %131, label %147 [
i32 1, label %132
i32 2, label %137
i32 0, label %142
]
132: ; preds = %130
%133 = call i32 (...) @support_avx()
%134 = icmp ne i32 %133, 0
br i1 %134, label %135, label %136
135: ; preds = %132
store i32 22, i32* %1
br label %161
136: ; preds = %132
store i32 11, i32* %1
br label %161
137: ; preds = %130
%138 = call i32 (...) @support_avx()
%139 = icmp ne i32 %138, 0
br i1 %139, label %140, label %141
140: ; preds = %137
store i32 23, i32* %1
br label %161
141: ; preds = %137
store i32 11, i32* %1
br label %161
142: ; preds = %130
%143 = call i32 (...) @support_avx()
%144 = icmp ne i32 %143, 0
br i1 %144, label %145, label %146
145: ; preds = %142
store i32 25, i32* %1
br label %161
146: ; preds = %142
store i32 11, i32* %1
br label %161
147: ; preds = %130
br label %149
148: ; preds = %127
store i32 11, i32* %1
br label %161
149: ; preds = %147
br label %150
150: ; preds = %149
br label %151
151: ; preds = %150
br label %152
152: ; preds = %151, %113
br label %153
153: ; preds = %152, %102
%154 = load i32, i32* %6
%155 = icmp eq i32 %154, 6
br i1 %155, label %156, label %160
156: ; preds = %153
%157 = load i32, i32* %2
switch i32 %157, label %159 [
i32 6, label %158
]
158: ; preds = %156
store i32 19, i32* %1
br label %161
159: ; preds = %156
store i32 12, i32* %1
br label %161
160: ; preds = %153
store i32 0, i32* %1
br label %161
161: ; preds = %160, %159, %158, %148, %146, %145, %141, %140, %136, %135, %126, %122, %112, %108, %100, %99, %93, %92, %85, %84, %80, %79, %72, %71, %67, %66, %62, %61, %54, %53, %52, %48, %47, %46, %42, %38, %37, %36, %35, %34, %30, %29, %28, %27, %26, %21, %20, %9
%162 = load i32, i32* %1
ret i32 %162
}

LLVM IR (-O2):
@switch.table.get_coretype = [16 x i32] [i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 4, i32 5, i32 8, i32 5, i32 5, i32 0, i32 8, i32 8, i32 14]
@switch.table.get_coretype.1 = [10 x i32] [i32 14, i32 15, i32 0, i32 0, i32 17, i32 17, i32 18, i32 16, i32 17, i32 17]
define i32 @get_coretype() {
%1 = tail call i32 (...) @have_cpuid()
%2 = icmp eq i32 %1, 0
br i1 %2, label %93, label %3
3: ; preds = %0
%4 = tail call i32 @get_cputype(i32 4)
%5 = tail call i32 @get_cputype(i32 1)
%6 = tail call i32 @get_cputype(i32 5)
%7 = tail call i32 @get_cputype(i32 2)
%8 = tail call i32 (...) @get_vendor()
switch i32 %8, label %93 [
i32 1, label %9
i32 3, label %58
i32 6, label %82
]
9: ; preds = %3
switch i32 %4, label %57 [
i32 4, label %93
i32 5, label %10
i32 6, label %11
i32 15, label %54
]
10: ; preds = %9
br label %93
11: ; preds = %9
switch i32 %7, label %57 [
i32 0, label %12
i32 1, label %14
i32 2, label %17
i32 3, label %26
i32 4, label %39
i32 5, label %48
]
12: ; preds = %11
%13 = icmp ult i32 %6, 16
br i1 %13, label %85, label %57
14: ; preds = %11
%15 = add i32 %6, -6
%16 = icmp ult i32 %15, 10
br i1 %16, label %89, label %57
17: ; preds = %11
switch i32 %6, label %57 [
i32 5, label %93
i32 10, label %18
i32 12, label %93
i32 13, label %22
i32 14, label %93
i32 15, label %93
]
18: ; preds = %17
%19 = tail call i32 (...) @support_avx()
%20 = icmp eq i32 %19, 0
%21 = select i1 %20, i32 17, i32 20
br label %93
22: ; preds = %17
%23 = tail call i32 (...) @support_avx()
%24 = icmp eq i32 %23, 0
%25 = select i1 %24, i32 17, i32 20
br label %93
26: ; preds = %11
switch i32 %6, label %57 [
i32 10, label %27
i32 14, label %27
i32 12, label %31
i32 15, label %31
i32 13, label %35
]
27: ; preds = %26, %26
%28 = tail call i32 (...) @support_avx()
%29 = icmp eq i32 %28, 0
%30 = select i1 %29, i32 17, i32 20
br label %93
31: ; preds = %26, %26
%32 = tail call i32 (...) @support_avx()
%33 = icmp eq i32 %32, 0
%34 = select i1 %33, i32 17, i32 24
br label %93
35: ; preds = %26
%36 = tail call i32 (...) @support_avx()
%37 = icmp eq i32 %36, 0
%38 = select i1 %37, i32 17, i32 24
br label %93
39: ; preds = %11
switch i32 %6, label %57 [
i32 5, label %40
i32 6, label %40
i32 7, label %44
i32 15, label %44
]
40: ; preds = %39, %39
%41 = tail call i32 (...) @support_avx()
%42 = icmp eq i32 %41, 0
%43 = select i1 %42, i32 17, i32 24
br label %93
44: ; preds = %39, %39
%45 = tail call i32 (...) @support_avx()
%46 = icmp eq i32 %45, 0
%47 = select i1 %46, i32 17, i32 24
br label %93
48: ; preds = %11
%49 = icmp eq i32 %6, 6
br i1 %49, label %50, label %57
50: ; preds = %48
%51 = tail call i32 (...) @support_avx()
%52 = icmp eq i32 %51, 0
%53 = select i1 %52, i32 17, i32 24
br label %93
54: ; preds = %9
%55 = icmp slt i32 %6, 3
%56 = select i1 %55, i32 6, i32 7
br label %93
57: ; preds = %14, %12, %9, %48, %39, %26, %17, %11
br label %93
58: ; preds = %3
%59 = icmp slt i32 %4, 6
br i1 %59, label %93, label %60
60: ; preds = %58
%61 = icmp ult i32 %4, 15
br i1 %61, label %93, label %62
62: ; preds = %60
%63 = icmp eq i32 %4, 15
br i1 %63, label %64, label %93
64: ; preds = %62
%65 = and i32 %5, -3
%66 = icmp eq i32 %65, 0
br i1 %66, label %93, label %67
67: ; preds = %64
switch i32 %5, label %81 [
i32 5, label %93
i32 6, label %68
]
68: ; preds = %67
switch i32 %6, label %93 [
i32 1, label %69
i32 2, label %73
i32 0, label %77
]
69: ; preds = %68
%70 = tail call i32 (...) @support_avx()
%71 = icmp eq i32 %70, 0
%72 = select i1 %71, i32 11, i32 22
br label %93
73: ; preds = %68
%74 = tail call i32 (...) @support_avx()
%75 = icmp eq i32 %74, 0
%76 = select i1 %75, i32 11, i32 23
br label %93
77: ; preds = %68
%78 = tail call i32 (...) @support_avx()
%79 = icmp eq i32 %78, 0
%80 = select i1 %79, i32 11, i32 25
br label %93
81: ; preds = %67
br label %93
82: ; preds = %3
%83 = icmp eq i32 %4, 6
%84 = select i1 %83, i32 19, i32 12
br label %93
85: ; preds = %12
%86 = sext i32 %6 to i64
%87 = getelementptr inbounds [16 x i32], [16 x i32]* @switch.table.get_coretype, i64 0, i64 %86
%88 = load i32, i32* %87
br label %93
89: ; preds = %14
%90 = sext i32 %15 to i64
%91 = getelementptr inbounds [10 x i32], [10 x i32]* @switch.table.get_coretype.1, i64 0, i64 %90
%92 = load i32, i32* %91
br label %93
93: ; preds = %89, %85, %68, %62, %57, %3, %82, %77, %73, %69, %67, %64, %60, %58, %54, %50, %44, %40, %35, %31, %27, %17, %17, %22, %17, %18, %17, %9, %0, %81, %10
%94 = phi i32 [ 11, %81 ], [ 2, %10 ], [ 1, %0 ], [ 1, %9 ], [ 17, %17 ], [ %21, %18 ], [ 17, %17 ], [ %25, %22 ], [ 17, %17 ], [ 17, %17 ], [ %30, %27 ], [ %34, %31 ], [ %38, %35 ], [ %43, %40 ], [ %47, %44 ], [ %53, %50 ], [ %56, %54 ], [ 1, %58 ], [ 9, %60 ], [ 10, %64 ], [ 21, %67 ], [ %72, %69 ], [ %76, %73 ], [ %80, %77 ], [ %84, %82 ], [ 0, %3 ], [ 0, %57 ], [ 0, %62 ], [ 0, %68 ], [ %88, %85 ], [ %92, %89 ]
ret i32 %94
}