#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;
        }
        break;
      case 4:
        switch (model) {
        case 5:
        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;
        }
      } 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    15c3 <get_coretype+0x483>
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    146f <get_coretype+0x32f>
mov    -0x8(%rbp),%eax
add    $0xfffffffc,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0xb,%eax
ja     146a <get_coretype+0x32a>
mov    -0x20(%rbp),%rax
lea    0xe34(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
movl   $0x2,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
mov    -0x14(%rbp),%eax
mov    %rax,-0x28(%rbp)
sub    $0x4,%rax
ja     1443 <get_coretype+0x303>
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    0xe82(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x3,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
movl   $0x4,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
movl   $0x5,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
movl   $0x8,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
movl   $0xe,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
jmp    1443 <get_coretype+0x303>
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    0xdf0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xe,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
movl   $0xf,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
movl   $0x11,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
movl   $0x12,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
movl   $0x10,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
jmp    1443 <get_coretype+0x303>
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    0xd5a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x11,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     1333 <get_coretype+0x1f3>
movl   $0x14,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
movl   $0x11,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
movl   $0x11,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     1367 <get_coretype+0x227>
movl   $0x14,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
movl   $0x11,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
movl   $0x11,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
jmp    1443 <get_coretype+0x303>
mov    -0x10(%rbp),%eax
add    $0xfffffff6,%eax
mov    %eax,%ecx
mov    %rcx,-0x48(%rbp)
sub    $0x5,%eax
ja     13fd <get_coretype+0x2bd>
mov    -0x48(%rbp),%rax
lea    0xca0(%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    15c3 <get_coretype+0x483>
movl   $0x11,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     13f1 <get_coretype+0x2b1>
movl   $0x18,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
movl   $0x11,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
jmp    1443 <get_coretype+0x303>
mov    -0x10(%rbp),%eax
add    $0xfffffffb,%eax
sub    $0x1,%eax
ja     143e <get_coretype+0x2fe>
jmp    1416 <get_coretype+0x2d6>
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     1432 <get_coretype+0x2f2>
movl   $0x18,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
movl   $0x11,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
jmp    1443 <get_coretype+0x303>
jmp    146a <get_coretype+0x32a>
cmpl   $0x2,-0x10(%rbp)
jg     145e <get_coretype+0x31e>
movl   $0x6,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
movl   $0x7,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
jmp    146f <get_coretype+0x32f>
cmpl   $0x3,-0x18(%rbp)
jne    1589 <get_coretype+0x449>
cmpl   $0x5,-0x8(%rbp)
jg     148f <get_coretype+0x34f>
movl   $0x1,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
cmpl   $0xe,-0x8(%rbp)
jg     14a5 <get_coretype+0x365>
movl   $0x9,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
cmpl   $0xf,-0x8(%rbp)
jne    1584 <get_coretype+0x444>
cmpl   $0x0,-0xc(%rbp)
je     14c3 <get_coretype+0x383>
cmpl   $0x2,-0xc(%rbp)
jne    14cf <get_coretype+0x38f>
movl   $0xa,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
cmpl   $0x5,-0xc(%rbp)
jne    14e5 <get_coretype+0x3a5>
movl   $0x15,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
cmpl   $0x6,-0xc(%rbp)
jne    1569 <get_coretype+0x429>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4c(%rbp)
sub    $0x1,%eax
je     1514 <get_coretype+0x3d4>
jmp    1503 <get_coretype+0x3c3>
mov    -0x4c(%rbp),%eax
sub    $0x2,%eax
je     153c <get_coretype+0x3fc>
jmp    1564 <get_coretype+0x424>
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     1530 <get_coretype+0x3f0>
movl   $0x16,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
movl   $0xb,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
mov    $0x0,%al
call   1050 <support_avx@plt>
cmp    $0x0,%eax
je     1558 <get_coretype+0x418>
movl   $0x17,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
movl   $0xb,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
jmp    1575 <get_coretype+0x435>
movl   $0xb,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
jmp    157a <get_coretype+0x43a>
jmp    157f <get_coretype+0x43f>
jmp    1584 <get_coretype+0x444>
jmp    1589 <get_coretype+0x449>
cmpl   $0x6,-0x18(%rbp)
jne    15bc <get_coretype+0x47c>
mov    -0x8(%rbp),%eax
sub    $0x6,%eax
jne    15b0 <get_coretype+0x470>
jmp    15a4 <get_coretype+0x464>
movl   $0x13,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
movl   $0xc,-0x4(%rbp)
jmp    15c3 <get_coretype+0x483>
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    133e <get_coretype+0x1fe>
add    $0xfffffffc,%ebx
cmp    $0xb,%ebx
ja     133e <get_coretype+0x1fe>
mov    $0x1,%eax
lea    0xe4a(%rip),%rcx
movslq (%rcx,%rbx,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x2,%eax
jmp    1340 <get_coretype+0x200>
mov    $0x1,%eax
jmp    1340 <get_coretype+0x200>
cmp    $0x6,%ebx
mov    $0x13,%ecx
mov    $0xc,%eax
cmove  %ecx,%eax
jmp    1340 <get_coretype+0x200>
mov    $0x1,%eax
cmp    $0x6,%ebx
jl     1340 <get_coretype+0x200>
mov    $0x9,%eax
cmp    $0xf,%ebx
jb     1340 <get_coretype+0x200>
jne    133e <get_coretype+0x1fe>
test   $0xfffffffd,%r15d
je     12a1 <get_coretype+0x161>
cmp    $0x5,%r15d
je     134b <get_coretype+0x20b>
cmp    $0x6,%r15d
jne    1352 <get_coretype+0x212>
cmp    $0x2,%r14d
je     1359 <get_coretype+0x219>
mov    $0x0,%eax
cmp    $0x1,%r14d
jne    1340 <get_coretype+0x200>
xor    %eax,%eax
call   1050 <support_avx@plt>
test   %eax,%eax
mov    $0xb,%ecx
mov    $0x16,%eax
cmove  %ecx,%eax
jmp    1340 <get_coretype+0x200>
cmp    $0x4,%ebp
ja     133e <get_coretype+0x1fe>
mov    %ebp,%eax
lea    0xdbf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmp    $0x10,%r14d
jae    133e <get_coretype+0x1fe>
movslq %r14d,%rax
lea    0xdce(%rip),%rcx
jmp    12c3 <get_coretype+0x183>
xor    %eax,%eax
cmp    $0x3,%r14d
setl   %al
xor    $0x7,%eax
jmp    1340 <get_coretype+0x200>
mov    $0xa,%eax
jmp    1340 <get_coretype+0x200>
add    $0xfffffffa,%r14d
cmp    $0xa,%r14d
jae    133e <get_coretype+0x1fe>
movslq %r14d,%rax
lea    0xdd9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
jmp    1340 <get_coretype+0x200>
cmp    $0xf,%r14d
ja     133e <get_coretype+0x1fe>
mov    $0x11,%eax
mov    $0xd020,%ecx
bt     %r14d,%ecx
jb     1340 <get_coretype+0x200>
cmp    $0xa,%r14d
je     1306 <get_coretype+0x1c6>
cmp    $0xd,%r14d
je     1306 <get_coretype+0x1c6>
jmp    133e <get_coretype+0x1fe>
add    $0xfffffff6,%r14d
cmp    $0x5,%r14d
ja     133e <get_coretype+0x1fe>
lea    0xd47(%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    1340 <get_coretype+0x200>
add    $0xfffffffb,%r14d
cmp    $0x1,%r14d
ja     133e <get_coretype+0x1fe>
xor    %eax,%eax
call   1050 <support_avx@plt>
test   %eax,%eax
mov    $0x11,%ecx
mov    $0x18,%eax
cmove  %ecx,%eax
jmp    1340 <get_coretype+0x200>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x15,%eax
jmp    1340 <get_coretype+0x200>
mov    $0xb,%eax
jmp    1340 <get_coretype+0x200>
xor    %eax,%eax
call   1050 <support_avx@plt>
test   %eax,%eax
mov    $0xb,%ecx
mov    $0x17,%eax
cmove  %ecx,%eax
jmp    1340 <get_coretype+0x200>

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