#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:
          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;
}


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    15bc <get_coretype+0x47c>
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    1468 <get_coretype+0x328>
mov    -0x8(%rbp),%eax
add    $0xfffffffc,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0xb,%eax
ja     1463 <get_coretype+0x323>
mov    -0x20(%rbp),%rax
lea    0xe34(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
movl   $0x2,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
mov    -0x14(%rbp),%eax
mov    %rax,-0x28(%rbp)
sub    $0x4,%rax
ja     143c <get_coretype+0x2fc>
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    0xe6a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x3,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
movl   $0x4,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
movl   $0x5,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
movl   $0x8,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
movl   $0xe,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
jmp    143c <get_coretype+0x2fc>
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    0xdd8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xe,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
movl   $0xf,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
movl   $0x11,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
movl   $0x12,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
movl   $0x10,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
jmp    143c <get_coretype+0x2fc>
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    0xd42(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x11,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     1333 <get_coretype+0x1f3>
movl   $0x14,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
movl   $0x11,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
movl   $0x11,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     1367 <get_coretype+0x227>
movl   $0x14,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
movl   $0x11,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
movl   $0x11,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
jmp    143c <get_coretype+0x2fc>
mov    -0x10(%rbp),%eax
mov    %eax,-0x44(%rbp)
sub    $0xa,%eax
je     13a9 <get_coretype+0x269>
jmp    1398 <get_coretype+0x258>
mov    -0x44(%rbp),%eax
sub    $0xc,%eax
je     13d1 <get_coretype+0x291>
jmp    13f9 <get_coretype+0x2b9>
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     13c5 <get_coretype+0x285>
movl   $0x14,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
movl   $0x11,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     13ed <get_coretype+0x2ad>
movl   $0x14,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
movl   $0x11,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
jmp    143c <get_coretype+0x2fc>
mov    -0x10(%rbp),%eax
sub    $0x5,%eax
jne    1437 <get_coretype+0x2f7>
jmp    140f <get_coretype+0x2cf>
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     142b <get_coretype+0x2eb>
movl   $0x14,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
movl   $0x11,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
jmp    143c <get_coretype+0x2fc>
jmp    1463 <get_coretype+0x323>
cmpl   $0x2,-0x10(%rbp)
jg     1457 <get_coretype+0x317>
movl   $0x6,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
movl   $0x7,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
jmp    1468 <get_coretype+0x328>
cmpl   $0x3,-0x18(%rbp)
jne    1582 <get_coretype+0x442>
cmpl   $0x5,-0x8(%rbp)
jg     1488 <get_coretype+0x348>
movl   $0x1,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
cmpl   $0xe,-0x8(%rbp)
jg     149e <get_coretype+0x35e>
movl   $0x9,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
cmpl   $0xf,-0x8(%rbp)
jne    157d <get_coretype+0x43d>
cmpl   $0x0,-0xc(%rbp)
je     14bc <get_coretype+0x37c>
cmpl   $0x2,-0xc(%rbp)
jne    14c8 <get_coretype+0x388>
movl   $0xa,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
cmpl   $0x5,-0xc(%rbp)
jne    14de <get_coretype+0x39e>
movl   $0x15,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
cmpl   $0x6,-0xc(%rbp)
jne    1562 <get_coretype+0x422>
mov    -0x10(%rbp),%eax
mov    %eax,-0x48(%rbp)
sub    $0x1,%eax
je     150d <get_coretype+0x3cd>
jmp    14fc <get_coretype+0x3bc>
mov    -0x48(%rbp),%eax
sub    $0x2,%eax
je     1535 <get_coretype+0x3f5>
jmp    155d <get_coretype+0x41d>
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     1529 <get_coretype+0x3e9>
movl   $0x16,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
movl   $0xb,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     1551 <get_coretype+0x411>
movl   $0x17,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
movl   $0xb,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
jmp    156e <get_coretype+0x42e>
movl   $0xb,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
jmp    1573 <get_coretype+0x433>
jmp    1578 <get_coretype+0x438>
jmp    157d <get_coretype+0x43d>
jmp    1582 <get_coretype+0x442>
cmpl   $0x6,-0x18(%rbp)
jne    15b5 <get_coretype+0x475>
mov    -0x8(%rbp),%eax
sub    $0x6,%eax
jne    15a9 <get_coretype+0x469>
jmp    159d <get_coretype+0x45d>
movl   $0x13,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
movl   $0xc,-0x4(%rbp)
jmp    15bc <get_coretype+0x47c>
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    130a <get_coretype+0x1ca>
add    $0xfffffffc,%ebx
cmp    $0xb,%ebx
ja     130a <get_coretype+0x1ca>
mov    $0x1,%eax
lea    0xe4a(%rip),%rcx
movslq (%rcx,%rbx,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x2,%eax
jmp    130c <get_coretype+0x1cc>
mov    $0x1,%eax
jmp    130c <get_coretype+0x1cc>
cmp    $0x6,%ebx
mov    $0x13,%ecx
mov    $0xc,%eax
cmove  %ecx,%eax
jmp    130c <get_coretype+0x1cc>
mov    $0x1,%eax
cmp    $0x6,%ebx
jl     130c <get_coretype+0x1cc>
mov    $0x9,%eax
cmp    $0xf,%ebx
jb     130c <get_coretype+0x1cc>
jne    130a <get_coretype+0x1ca>
test   $0xfffffffd,%r15d
je     129e <get_coretype+0x15e>
cmp    $0x5,%r15d
je     1317 <get_coretype+0x1d7>
cmp    $0x6,%r15d
jne    131e <get_coretype+0x1de>
cmp    $0x2,%r14d
je     1325 <get_coretype+0x1e5>
mov    $0x0,%eax
cmp    $0x1,%r14d
jne    130c <get_coretype+0x1cc>
xor    %eax,%eax
call   1050 <support_avx@plt>
test   %eax,%eax
mov    $0xb,%ecx
mov    $0x16,%eax
cmove  %ecx,%eax
jmp    130c <get_coretype+0x1cc>
cmp    $0x4,%ebp
ja     130a <get_coretype+0x1ca>
mov    %ebp,%eax
lea    0xdbf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmp    $0x10,%r14d
jae    130a <get_coretype+0x1ca>
movslq %r14d,%rax
lea    0xdb6(%rip),%rcx
jmp    12b9 <get_coretype+0x179>
xor    %eax,%eax
cmp    $0x3,%r14d
setl   %al
xor    $0x7,%eax
jmp    130c <get_coretype+0x1cc>
mov    $0xa,%eax
jmp    130c <get_coretype+0x1cc>
add    $0xfffffffa,%r14d
cmp    $0xa,%r14d
jae    130a <get_coretype+0x1ca>
movslq %r14d,%rax
lea    0xdcb(%rip),%rcx
mov    (%rcx,%rax,4),%eax
jmp    130c <get_coretype+0x1cc>
cmp    $0xf,%r14d
ja     130a <get_coretype+0x1ca>
mov    $0x11,%eax
mov    $0xd020,%ecx
bt     %r14d,%ecx
jb     130c <get_coretype+0x1cc>
cmp    $0xa,%r14d
je     12ee <get_coretype+0x1ae>
cmp    $0xd,%r14d
je     12ee <get_coretype+0x1ae>
jmp    130a <get_coretype+0x1ca>
cmp    $0xc,%r14d
je     12ee <get_coretype+0x1ae>
cmp    $0xa,%r14d
jne    130a <get_coretype+0x1ca>
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    130c <get_coretype+0x1cc>
cmp    $0x5,%r14d
je     12ee <get_coretype+0x1ae>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x15,%eax
jmp    130c <get_coretype+0x1cc>
mov    $0xb,%eax
jmp    130c <get_coretype+0x1cc>
xor    %eax,%eax
call   1050 <support_avx@plt>
test   %eax,%eax
mov    $0xb,%ecx
mov    $0x17,%eax
cmove  %ecx,%eax
jmp    130c <get_coretype+0x1cc>

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 %138
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 %84
18: ; preds = %10
%19 = load i32, i32* %2
switch i32 %19, label %83 [
i32 4, label %20
i32 5, label %21
i32 6, label %22
i32 15, label %78
]
20: ; preds = %18
store i32 1, i32* %1
br label %138
21: ; preds = %18
store i32 2, i32* %1
br label %138
22: ; preds = %18
%23 = load i32, i32* %5
switch i32 %23, label %77 [
i32 0, label %24
i32 1, label %32
i32 2, label %40
i32 3, label %56
i32 4, label %69
]
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 %138
27: ; preds = %24
store i32 4, i32* %1
br label %138
28: ; preds = %24, %24, %24
store i32 5, i32* %1
br label %138
29: ; preds = %24, %24, %24
store i32 8, i32* %1
br label %138
30: ; preds = %24
store i32 14, i32* %1
br label %138
31: ; preds = %24
br label %77
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 %138
35: ; preds = %32
store i32 15, i32* %1
br label %138
36: ; preds = %32, %32, %32, %32
store i32 17, i32* %1
br label %138
37: ; preds = %32
store i32 18, i32* %1
br label %138
38: ; preds = %32
store i32 16, i32* %1
br label %138
39: ; preds = %32
br label %77
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 %138
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 %138
47: ; preds = %43
store i32 17, i32* %1
br label %138
48: ; preds = %40
store i32 17, i32* %1
br label %138
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 %138
53: ; preds = %49
store i32 17, i32* %1
br label %138
54: ; preds = %40, %40
store i32 17, i32* %1
br label %138
55: ; preds = %40
br label %77
56: ; preds = %22
%57 = load i32, i32* %4
switch i32 %57, label %68 [
i32 10, label %58
i32 12, label %63
]
58: ; preds = %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 %138
62: ; preds = %58
store i32 17, i32* %1
br label %138
63: ; preds = %56
%64 = call i32 (...) @support_avx()
%65 = icmp ne i32 %64, 0
br i1 %65, label %66, label %67
66: ; preds = %63
store i32 20, i32* %1
br label %138
67: ; preds = %63
store i32 17, i32* %1
br label %138
68: ; preds = %56
br label %77
69: ; preds = %22
%70 = load i32, i32* %4
switch i32 %70, label %76 [
i32 5, label %71
]
71: ; preds = %69
%72 = call i32 (...) @support_avx()
%73 = icmp ne i32 %72, 0
br i1 %73, label %74, label %75
74: ; preds = %71
store i32 20, i32* %1
br label %138
75: ; preds = %71
store i32 17, i32* %1
br label %138
76: ; preds = %69
br label %77
77: ; preds = %22, %76, %68, %55, %39, %31
br label %83
78: ; preds = %18
%79 = load i32, i32* %4
%80 = icmp sle i32 %79, 2
br i1 %80, label %81, label %82
81: ; preds = %78
store i32 6, i32* %1
br label %138
82: ; preds = %78
store i32 7, i32* %1
br label %138
83: ; preds = %18, %77
br label %84
84: ; preds = %83, %10
%85 = load i32, i32* %6
%86 = icmp eq i32 %85, 3
br i1 %86, label %87, label %130
87: ; preds = %84
%88 = load i32, i32* %2
%89 = icmp sle i32 %88, 5
br i1 %89, label %90, label %91
90: ; preds = %87
store i32 1, i32* %1
br label %138
91: ; preds = %87
%92 = load i32, i32* %2
%93 = icmp sle i32 %92, 14
br i1 %93, label %94, label %95
94: ; preds = %91
store i32 9, i32* %1
br label %138
95: ; preds = %91
%96 = load i32, i32* %2
%97 = icmp eq i32 %96, 15
br i1 %97, label %98, label %129
98: ; preds = %95
%99 = load i32, i32* %3
%100 = icmp eq i32 %99, 0
br i1 %100, label %104, label %101
101: ; preds = %98
%102 = load i32, i32* %3
%103 = icmp eq i32 %102, 2
br i1 %103, label %104, label %105
104: ; preds = %101, %98
store i32 10, i32* %1
br label %138
105: ; preds = %101
%106 = load i32, i32* %3
%107 = icmp eq i32 %106, 5
br i1 %107, label %108, label %109
108: ; preds = %105
store i32 21, i32* %1
br label %138
109: ; preds = %105
%110 = load i32, i32* %3
%111 = icmp eq i32 %110, 6
br i1 %111, label %112, label %125
112: ; preds = %109
%113 = load i32, i32* %4
switch i32 %113, label %124 [
i32 1, label %114
i32 2, label %119
]
114: ; preds = %112
%115 = call i32 (...) @support_avx()
%116 = icmp ne i32 %115, 0
br i1 %116, label %117, label %118
117: ; preds = %114
store i32 22, i32* %1
br label %138
118: ; preds = %114
store i32 11, i32* %1
br label %138
119: ; preds = %112
%120 = call i32 (...) @support_avx()
%121 = icmp ne i32 %120, 0
br i1 %121, label %122, label %123
122: ; preds = %119
store i32 23, i32* %1
br label %138
123: ; preds = %119
store i32 11, i32* %1
br label %138
124: ; preds = %112
br label %126
125: ; preds = %109
store i32 11, i32* %1
br label %138
126: ; preds = %124
br label %127
127: ; preds = %126
br label %128
128: ; preds = %127
br label %129
129: ; preds = %128, %95
br label %130
130: ; preds = %129, %84
%131 = load i32, i32* %6
%132 = icmp eq i32 %131, 6
br i1 %132, label %133, label %137
133: ; preds = %130
%134 = load i32, i32* %2
switch i32 %134, label %136 [
i32 6, label %135
]
135: ; preds = %133
store i32 19, i32* %1
br label %138
136: ; preds = %133
store i32 12, i32* %1
br label %138
137: ; preds = %130
store i32 0, i32* %1
br label %138
138: ; preds = %137, %136, %135, %125, %123, %122, %118, %117, %108, %104, %94, %90, %82, %81, %75, %74, %67, %66, %62, %61, %54, %53, %52, %48, %47, %46, %42, %38, %37, %36, %35, %34, %30, %29, %28, %27, %26, %21, %20, %9
%139 = load i32, i32* %1
ret i32 %139
}

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 %76, 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 %76 [
i32 1, label %9
i32 3, label %45
i32 6, label %65
]
9: ; preds = %3
switch i32 %4, label %44 [
i32 4, label %76
i32 5, label %10
i32 6, label %11
i32 15, label %41
]
10: ; preds = %9
br label %76
11: ; preds = %9
switch i32 %7, label %44 [
i32 0, label %12
i32 1, label %14
i32 2, label %17
i32 3, label %26
i32 4, label %35
]
12: ; preds = %11
%13 = icmp ult i32 %6, 16
br i1 %13, label %68, label %44
14: ; preds = %11
%15 = add i32 %6, -6
%16 = icmp ult i32 %15, 10
br i1 %16, label %72, label %44
17: ; preds = %11
switch i32 %6, label %44 [
i32 5, label %76
i32 10, label %18
i32 12, label %76
i32 13, label %22
i32 14, label %76
i32 15, label %76
]
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 %76
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 %76
26: ; preds = %11
switch i32 %6, label %44 [
i32 10, label %27
i32 12, label %31
]
27: ; preds = %26
%28 = tail call i32 (...) @support_avx()
%29 = icmp eq i32 %28, 0
%30 = select i1 %29, i32 17, i32 20
br label %76
31: ; preds = %26
%32 = tail call i32 (...) @support_avx()
%33 = icmp eq i32 %32, 0
%34 = select i1 %33, i32 17, i32 20
br label %76
35: ; preds = %11
%36 = icmp eq i32 %6, 5
br i1 %36, label %37, label %44
37: ; preds = %35
%38 = tail call i32 (...) @support_avx()
%39 = icmp eq i32 %38, 0
%40 = select i1 %39, i32 17, i32 20
br label %76
41: ; preds = %9
%42 = icmp slt i32 %6, 3
%43 = select i1 %42, i32 6, i32 7
br label %76
44: ; preds = %14, %12, %9, %35, %26, %17, %11
br label %76
45: ; preds = %3
%46 = icmp slt i32 %4, 6
br i1 %46, label %76, label %47
47: ; preds = %45
%48 = icmp ult i32 %4, 15
br i1 %48, label %76, label %49
49: ; preds = %47
%50 = icmp eq i32 %4, 15
br i1 %50, label %51, label %76
51: ; preds = %49
%52 = and i32 %5, -3
%53 = icmp eq i32 %52, 0
br i1 %53, label %76, label %54
54: ; preds = %51
switch i32 %5, label %64 [
i32 5, label %76
i32 6, label %55
]
55: ; preds = %54
switch i32 %6, label %76 [
i32 1, label %56
i32 2, label %60
]
56: ; preds = %55
%57 = tail call i32 (...) @support_avx()
%58 = icmp eq i32 %57, 0
%59 = select i1 %58, i32 11, i32 22
br label %76
60: ; preds = %55
%61 = tail call i32 (...) @support_avx()
%62 = icmp eq i32 %61, 0
%63 = select i1 %62, i32 11, i32 23
br label %76
64: ; preds = %54
br label %76
65: ; preds = %3
%66 = icmp eq i32 %4, 6
%67 = select i1 %66, i32 19, i32 12
br label %76
68: ; preds = %12
%69 = sext i32 %6 to i64
%70 = getelementptr inbounds [16 x i32], [16 x i32]* @switch.table.get_coretype, i64 0, i64 %69
%71 = load i32, i32* %70
br label %76
72: ; preds = %14
%73 = sext i32 %15 to i64
%74 = getelementptr inbounds [10 x i32], [10 x i32]* @switch.table.get_coretype.1, i64 0, i64 %73
%75 = load i32, i32* %74
br label %76
76: ; preds = %72, %68, %55, %49, %44, %3, %65, %60, %56, %54, %51, %47, %45, %41, %37, %31, %27, %17, %17, %22, %17, %18, %17, %9, %0, %64, %10
%77 = phi i32 [ 11, %64 ], [ 2, %10 ], [ 1, %0 ], [ 1, %9 ], [ 17, %17 ], [ %21, %18 ], [ 17, %17 ], [ %25, %22 ], [ 17, %17 ], [ 17, %17 ], [ %30, %27 ], [ %34, %31 ], [ %40, %37 ], [ %43, %41 ], [ 1, %45 ], [ 9, %47 ], [ 10, %51 ], [ 21, %54 ], [ %59, %56 ], [ %63, %60 ], [ %67, %65 ], [ 0, %3 ], [ 0, %44 ], [ 0, %49 ], [ 0, %55 ], [ %71, %68 ], [ %75, %72 ]
ret i32 %77
}