#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 /*<<< orphan*/ cpuid(int, int *, int *, int *, int *);
int have_cpuid();
int have_excpuid();
int /*<<< orphan*/ support_avx();
int get_cputype(int gettype) {
  int eax, ebx, ecx, edx;
  int extend_family, family;
  int extend_model, model;
  int type, stepping;
  int feature = 0;
  cpuid(1, &eax, &ebx, &ecx, &edx);
  switch (gettype) {
  case 1:
    return ((((eax) >> (20)) & (0xff)));
  case 2:
    return ((((eax) >> (16)) & (0x0f)));
  case 3:
    return ((((eax) >> (12)) & (0x03)));
  case 4:
    return ((((eax) >> (8)) & (0x0f)));
  case 5:
    return ((((eax) >> (4)) & (0x0f)));
  case 6:
    return ((((ebx) >> (24)) & (0x0f)));
  case 7:
    return ((((ebx) >> (16)) & (0x0f)));
  case 8:
    return ((((ebx) >> (8)) & (0x0f)));
  case 9:
    return ((((eax) >> (0)) & (0x0f)));
  case 10:
    return ((((ebx) >> (0)) & (0xff)));
  case 12:
    if (have_cpuid() < 4)
      return 0;
    cpuid(4, &eax, &ebx, &ecx, &edx);
    return ((((eax) >> (14)) & (0xfff)));
  case 13:
    if (have_cpuid() < 4)
      return 0;
    cpuid(4, &eax, &ebx, &ecx, &edx);
    return ((((eax) >> (26)) & (0x3f)));
  case 11:
    if ((edx & (1 << 3)) != 0)
      feature |= (1 << 12);
    if ((edx & (1 << 15)) != 0)
      feature |= (1 << 11);
    if ((edx & (1 << 19)) != 0)
      feature |= (1 << 13);
    if ((edx & (1 << 23)) != 0)
      feature |= (1 << 8);
    if ((edx & (1 << 25)) != 0)
      feature |= (1 << 0);
    if ((edx & (1 << 26)) != 0)
      feature |= (1 << 1);
    if ((edx & (1 << 27)) != 0) {
      if (((((ebx) >> (16)) & (0x0f))) > 0)
        feature |= (1 << 14);
    }
    if ((ecx & (1 << 0)) != 0)
      feature |= (1 << 2);
    if ((ecx & (1 << 9)) != 0)
      feature |= (1 << 3);
    if ((ecx & (1 << 19)) != 0)
      feature |= (1 << 4);
    if ((ecx & (1 << 20)) != 0)
      feature |= (1 << 5);
    if (support_avx())
      feature |= (1 << 18);
    if (have_excpuid() >= 0x01) {
      cpuid(0x80000001, &eax, &ebx, &ecx, &edx);
      if ((ecx & (1 << 6)) != 0)
        feature |= (1 << 6);
      if ((ecx & (1 << 7)) != 0)
        feature |= (1 << 15);
      if ((ecx & (1 << 16)) != 0)
        feature |= (1 << 19);
      if ((edx & (1 << 30)) != 0)
        feature |= (1 << 10);
      if ((edx & (1 << 31)) != 0)
        feature |= (1 << 9);
    }
    if (have_excpuid() >= 0x1a) {
      cpuid(0x8000001a, &eax, &ebx, &ecx, &edx);
      if ((eax & (1 << 0)) != 0)
        feature |= (1 << 16);
      if ((eax & (1 << 1)) != 0)
        feature |= (1 << 17);
    }
  }
  return feature;
}


x86 assembly (clang, -O0):
<get_cputype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x34(%rbp)
mov    $0x1,%edi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1050 <cpuid@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x40(%rbp)
sub    $0xc,%eax
ja     1548 <get_cputype+0x408>
mov    -0x40(%rbp),%rax
lea    0xe74(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0xc(%rbp),%eax
sar    $0x14,%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
jmp    154e <get_cputype+0x40e>
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
jmp    154e <get_cputype+0x40e>
mov    -0xc(%rbp),%eax
sar    $0xc,%eax
and    $0x3,%eax
mov    %eax,-0x4(%rbp)
jmp    154e <get_cputype+0x40e>
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
jmp    154e <get_cputype+0x40e>
mov    -0xc(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
jmp    154e <get_cputype+0x40e>
mov    -0x10(%rbp),%eax
sar    $0x18,%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
jmp    154e <get_cputype+0x40e>
mov    -0x10(%rbp),%eax
sar    $0x10,%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
jmp    154e <get_cputype+0x40e>
mov    -0x10(%rbp),%eax
sar    $0x8,%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
jmp    154e <get_cputype+0x40e>
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
jmp    154e <get_cputype+0x40e>
mov    -0x10(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
jmp    154e <get_cputype+0x40e>
mov    $0x0,%al
call   1060 <have_cpuid@plt>
cmp    $0x4,%eax
jge    125f <get_cputype+0x11f>
movl   $0x0,-0x4(%rbp)
jmp    154e <get_cputype+0x40e>
mov    $0x4,%edi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1050 <cpuid@plt>
mov    -0xc(%rbp),%eax
sar    $0xe,%eax
and    $0xfff,%eax
mov    %eax,-0x4(%rbp)
jmp    154e <get_cputype+0x40e>
mov    $0x0,%al
call   1060 <have_cpuid@plt>
cmp    $0x4,%eax
jge    12a8 <get_cputype+0x168>
movl   $0x0,-0x4(%rbp)
jmp    154e <get_cputype+0x40e>
mov    $0x4,%edi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1050 <cpuid@plt>
mov    -0xc(%rbp),%eax
sar    $0x1a,%eax
and    $0x3f,%eax
mov    %eax,-0x4(%rbp)
jmp    154e <get_cputype+0x40e>
mov    -0x18(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     12ed <get_cputype+0x1ad>
mov    -0x34(%rbp),%eax
or     $0x1000,%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
je     1309 <get_cputype+0x1c9>
mov    -0x34(%rbp),%eax
or     $0x800,%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%eax
and    $0x80000,%eax
cmp    $0x0,%eax
je     1325 <get_cputype+0x1e5>
mov    -0x34(%rbp),%eax
or     $0x2000,%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%eax
and    $0x800000,%eax
cmp    $0x0,%eax
je     1341 <get_cputype+0x201>
mov    -0x34(%rbp),%eax
or     $0x100,%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%eax
and    $0x2000000,%eax
cmp    $0x0,%eax
je     135b <get_cputype+0x21b>
mov    -0x34(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%eax
and    $0x4000000,%eax
cmp    $0x0,%eax
je     1375 <get_cputype+0x235>
mov    -0x34(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%eax
and    $0x8000000,%eax
cmp    $0x0,%eax
je     13a8 <get_cputype+0x268>
mov    -0x10(%rbp),%eax
sar    $0x10,%eax
and    $0xf,%eax
cmp    $0x0,%eax
jle    13a3 <get_cputype+0x263>
mov    -0x34(%rbp),%eax
or     $0x4000,%eax
mov    %eax,-0x34(%rbp)
jmp    13a8 <get_cputype+0x268>
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     13c0 <get_cputype+0x280>
mov    -0x34(%rbp),%eax
or     $0x4,%eax
mov    %eax,-0x34(%rbp)
mov    -0x14(%rbp),%eax
and    $0x200,%eax
cmp    $0x0,%eax
je     13da <get_cputype+0x29a>
mov    -0x34(%rbp),%eax
or     $0x8,%eax
mov    %eax,-0x34(%rbp)
mov    -0x14(%rbp),%eax
and    $0x80000,%eax
cmp    $0x0,%eax
je     13f4 <get_cputype+0x2b4>
mov    -0x34(%rbp),%eax
or     $0x10,%eax
mov    %eax,-0x34(%rbp)
mov    -0x14(%rbp),%eax
and    $0x100000,%eax
cmp    $0x0,%eax
je     140e <get_cputype+0x2ce>
mov    -0x34(%rbp),%eax
or     $0x20,%eax
mov    %eax,-0x34(%rbp)
mov    $0x0,%al
call   1040 <support_avx@plt>
cmp    $0x0,%eax
je     1429 <get_cputype+0x2e9>
mov    -0x34(%rbp),%eax
or     $0x40000,%eax
mov    %eax,-0x34(%rbp)
mov    $0x0,%al
call   1030 <have_excpuid@plt>
cmp    $0x1,%eax
jl     14e0 <get_cputype+0x3a0>
mov    $0x80000001,%edi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1050 <cpuid@plt>
mov    -0x14(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     146b <get_cputype+0x32b>
mov    -0x34(%rbp),%eax
or     $0x40,%eax
mov    %eax,-0x34(%rbp)
mov    -0x14(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1487 <get_cputype+0x347>
mov    -0x34(%rbp),%eax
or     $0x8000,%eax
mov    %eax,-0x34(%rbp)
mov    -0x14(%rbp),%eax
and    $0x10000,%eax
cmp    $0x0,%eax
je     14a3 <get_cputype+0x363>
mov    -0x34(%rbp),%eax
or     $0x80000,%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%eax
and    $0x40000000,%eax
cmp    $0x0,%eax
je     14bf <get_cputype+0x37f>
mov    -0x34(%rbp),%eax
or     $0x400,%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
je     14db <get_cputype+0x39b>
mov    -0x34(%rbp),%eax
or     $0x200,%eax
mov    %eax,-0x34(%rbp)
jmp    14e0 <get_cputype+0x3a0>
mov    $0x0,%al
call   1030 <have_excpuid@plt>
cmp    $0x1a,%eax
jl     1543 <get_cputype+0x403>
mov    $0x8000001a,%edi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1050 <cpuid@plt>
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1524 <get_cputype+0x3e4>
mov    -0x34(%rbp),%eax
or     $0x10000,%eax
mov    %eax,-0x34(%rbp)
mov    -0xc(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     153e <get_cputype+0x3fe>
mov    -0x34(%rbp),%eax
or     $0x20000,%eax
mov    %eax,-0x34(%rbp)
jmp    1543 <get_cputype+0x403>
jmp    1548 <get_cputype+0x408>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cputype>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x14(%rsp),%rcx
lea    0x10(%rsp),%r8
mov    $0x1,%edi
call   1050 <cpuid@plt>
add    $0xffffffff,%ebx
cmp    $0xc,%ebx
ja     118e <get_cputype+0x4e>
lea    0xe8a(%rip),%rax
movslq (%rax,%rbx,4),%rcx
add    %rax,%rcx
jmp    *%rcx
mov    0x8(%rsp),%eax
shr    $0x14,%eax
movzbl %al,%ebx
jmp    13b4 <get_cputype+0x274>
xor    %ebx,%ebx
jmp    13b4 <get_cputype+0x274>
movzwl 0xa(%rsp),%ebx
jmp    13b1 <get_cputype+0x271>
mov    0x8(%rsp),%ebx
shr    $0xc,%ebx
and    $0x3,%ebx
jmp    13b4 <get_cputype+0x274>
mov    0x8(%rsp),%ebx
jmp    11d8 <get_cputype+0x98>
mov    0x8(%rsp),%ebx
shr    $0x4,%ebx
jmp    13b1 <get_cputype+0x271>
movzbl 0xf(%rsp),%ebx
jmp    13b1 <get_cputype+0x271>
movzwl 0xe(%rsp),%ebx
jmp    13b1 <get_cputype+0x271>
mov    0xc(%rsp),%ebx
shr    $0x8,%ebx
jmp    13b1 <get_cputype+0x271>
movzbl 0xc(%rsp),%ebx
jmp    13b4 <get_cputype+0x274>
mov    0x10(%rsp),%eax
mov    %eax,%ecx
and    $0x8,%ecx
shl    $0x9,%ecx
mov    %eax,%edx
shr    $0x4,%edx
and    $0x800,%edx
or     %ecx,%edx
mov    %eax,%ecx
shr    $0x6,%ecx
and    $0x2000,%ecx
or     %edx,%ecx
mov    %eax,%edx
shr    $0xf,%edx
and    $0x100,%edx
or     %ecx,%edx
mov    %eax,%ecx
shr    $0x19,%ecx
mov    %ecx,%esi
and    $0x1,%esi
or     %edx,%esi
and    $0x2,%ecx
or     %esi,%ecx
test   $0x8000000,%eax
je     1245 <get_cputype+0x105>
lea    0x4000(%rcx),%eax
testb  $0xf,0xe(%rsp)
cmove  %ecx,%eax
mov    %eax,%ecx
mov    0x14(%rsp),%r14d
lea    0x0(,%r14,4),%eax
and    $0x4,%eax
mov    %r14d,%edx
shr    $0x6,%edx
and    $0x8,%edx
or     %ecx,%edx
shr    $0xf,%r14d
mov    %r14d,%ecx
and    $0x10,%ecx
or     %eax,%ecx
and    $0x20,%r14d
or     %ecx,%r14d
or     %edx,%r14d
xor    %eax,%eax
call   1040 <support_avx@plt>
lea    0x40000(%r14),%ebx
test   %eax,%eax
cmove  %r14d,%ebx
xor    %eax,%eax
call   1030 <have_excpuid@plt>
test   %eax,%eax
jle    12f3 <get_cputype+0x1b3>
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x14(%rsp),%rcx
lea    0x10(%rsp),%r8
mov    $0x80000001,%edi
call   1050 <cpuid@plt>
mov    0x14(%rsp),%eax
mov    %eax,%ecx
and    $0x40,%ecx
or     %ebx,%ecx
mov    %eax,%edx
shl    $0x8,%edx
and    $0x8000,%edx
shl    $0x3,%eax
and    $0x80000,%eax
or     %edx,%eax
mov    0x10(%rsp),%edx
mov    %edx,%esi
shr    $0x14,%esi
and    $0x400,%esi
or     %eax,%esi
or     %ecx,%esi
mov    %esi,%ebx
or     $0x200,%ebx
test   %edx,%edx
cmovns %esi,%ebx
xor    %eax,%eax
call   1030 <have_excpuid@plt>
cmp    $0x1a,%eax
jl     13b4 <get_cputype+0x274>
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x14(%rsp),%rcx
lea    0x10(%rsp),%r8
mov    $0x8000001a,%edi
call   1050 <cpuid@plt>
mov    0x8(%rsp),%eax
shl    $0x10,%eax
mov    %eax,%ecx
and    $0x10000,%ecx
or     %ebx,%ecx
and    $0x20000,%eax
or     %ecx,%eax
mov    %eax,%ebx
jmp    13b4 <get_cputype+0x274>
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <have_cpuid@plt>
cmp    $0x4,%eax
jl     13b4 <get_cputype+0x274>
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x14(%rsp),%rcx
lea    0x10(%rsp),%r8
mov    $0x4,%edi
call   1050 <cpuid@plt>
mov    0x8(%rsp),%ebx
shr    $0xe,%ebx
and    $0xfff,%ebx
jmp    13b4 <get_cputype+0x274>
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <have_cpuid@plt>
cmp    $0x4,%eax
jl     13b4 <get_cputype+0x274>
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x14(%rsp),%rcx
lea    0x10(%rsp),%r8
mov    $0x4,%edi
call   1050 <cpuid@plt>
mov    0x8(%rsp),%ebx
shr    $0x1a,%ebx
jmp    13b4 <get_cputype+0x274>
mov    0x8(%rsp),%ebx
and    $0xf,%ebx
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @get_cputype(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %14
%15 = call i32 @cpuid(i32 1, i32* %4, i32* %5, i32* %6, i32* %7)
%16 = load i32, i32* %3
switch i32 %16, label %224 [
i32 1, label %17
i32 2, label %21
i32 3, label %25
i32 4, label %29
i32 5, label %33
i32 6, label %37
i32 7, label %41
i32 8, label %45
i32 9, label %49
i32 10, label %53
i32 12, label %57
i32 13, label %66
i32 11, label %75
]
17: ; preds = %1
%18 = load i32, i32* %4
%19 = ashr i32 %18, 20
%20 = and i32 %19, 255
store i32 %20, i32* %2
br label %226
21: ; preds = %1
%22 = load i32, i32* %4
%23 = ashr i32 %22, 16
%24 = and i32 %23, 15
store i32 %24, i32* %2
br label %226
25: ; preds = %1
%26 = load i32, i32* %4
%27 = ashr i32 %26, 12
%28 = and i32 %27, 3
store i32 %28, i32* %2
br label %226
29: ; preds = %1
%30 = load i32, i32* %4
%31 = ashr i32 %30, 8
%32 = and i32 %31, 15
store i32 %32, i32* %2
br label %226
33: ; preds = %1
%34 = load i32, i32* %4
%35 = ashr i32 %34, 4
%36 = and i32 %35, 15
store i32 %36, i32* %2
br label %226
37: ; preds = %1
%38 = load i32, i32* %5
%39 = ashr i32 %38, 24
%40 = and i32 %39, 15
store i32 %40, i32* %2
br label %226
41: ; preds = %1
%42 = load i32, i32* %5
%43 = ashr i32 %42, 16
%44 = and i32 %43, 15
store i32 %44, i32* %2
br label %226
45: ; preds = %1
%46 = load i32, i32* %5
%47 = ashr i32 %46, 8
%48 = and i32 %47, 15
store i32 %48, i32* %2
br label %226
49: ; preds = %1
%50 = load i32, i32* %4
%51 = ashr i32 %50, 0
%52 = and i32 %51, 15
store i32 %52, i32* %2
br label %226
53: ; preds = %1
%54 = load i32, i32* %5
%55 = ashr i32 %54, 0
%56 = and i32 %55, 255
store i32 %56, i32* %2
br label %226
57: ; preds = %1
%58 = call i32 (...) @have_cpuid()
%59 = icmp slt i32 %58, 4
br i1 %59, label %60, label %61
60: ; preds = %57
store i32 0, i32* %2
br label %226
61: ; preds = %57
%62 = call i32 @cpuid(i32 4, i32* %4, i32* %5, i32* %6, i32* %7)
%63 = load i32, i32* %4
%64 = ashr i32 %63, 14
%65 = and i32 %64, 4095
store i32 %65, i32* %2
br label %226
66: ; preds = %1
%67 = call i32 (...) @have_cpuid()
%68 = icmp slt i32 %67, 4
br i1 %68, label %69, label %70
69: ; preds = %66
store i32 0, i32* %2
br label %226
70: ; preds = %66
%71 = call i32 @cpuid(i32 4, i32* %4, i32* %5, i32* %6, i32* %7)
%72 = load i32, i32* %4
%73 = ashr i32 %72, 26
%74 = and i32 %73, 63
store i32 %74, i32* %2
br label %226
75: ; preds = %1
%76 = load i32, i32* %7
%77 = and i32 %76, 8
%78 = icmp ne i32 %77, 0
br i1 %78, label %79, label %82
79: ; preds = %75
%80 = load i32, i32* %14
%81 = or i32 %80, 4096
store i32 %81, i32* %14
br label %82
82: ; preds = %79, %75
%83 = load i32, i32* %7
%84 = and i32 %83, 32768
%85 = icmp ne i32 %84, 0
br i1 %85, label %86, label %89
86: ; preds = %82
%87 = load i32, i32* %14
%88 = or i32 %87, 2048
store i32 %88, i32* %14
br label %89
89: ; preds = %86, %82
%90 = load i32, i32* %7
%91 = and i32 %90, 524288
%92 = icmp ne i32 %91, 0
br i1 %92, label %93, label %96
93: ; preds = %89
%94 = load i32, i32* %14
%95 = or i32 %94, 8192
store i32 %95, i32* %14
br label %96
96: ; preds = %93, %89
%97 = load i32, i32* %7
%98 = and i32 %97, 8388608
%99 = icmp ne i32 %98, 0
br i1 %99, label %100, label %103
100: ; preds = %96
%101 = load i32, i32* %14
%102 = or i32 %101, 256
store i32 %102, i32* %14
br label %103
103: ; preds = %100, %96
%104 = load i32, i32* %7
%105 = and i32 %104, 33554432
%106 = icmp ne i32 %105, 0
br i1 %106, label %107, label %110
107: ; preds = %103
%108 = load i32, i32* %14
%109 = or i32 %108, 1
store i32 %109, i32* %14
br label %110
110: ; preds = %107, %103
%111 = load i32, i32* %7
%112 = and i32 %111, 67108864
%113 = icmp ne i32 %112, 0
br i1 %113, label %114, label %117
114: ; preds = %110
%115 = load i32, i32* %14
%116 = or i32 %115, 2
store i32 %116, i32* %14
br label %117
117: ; preds = %114, %110
%118 = load i32, i32* %7
%119 = and i32 %118, 134217728
%120 = icmp ne i32 %119, 0
br i1 %120, label %121, label %130
121: ; preds = %117
%122 = load i32, i32* %5
%123 = ashr i32 %122, 16
%124 = and i32 %123, 15
%125 = icmp sgt i32 %124, 0
br i1 %125, label %126, label %129
126: ; preds = %121
%127 = load i32, i32* %14
%128 = or i32 %127, 16384
store i32 %128, i32* %14
br label %129
129: ; preds = %126, %121
br label %130
130: ; preds = %129, %117
%131 = load i32, i32* %6
%132 = and i32 %131, 1
%133 = icmp ne i32 %132, 0
br i1 %133, label %134, label %137
134: ; preds = %130
%135 = load i32, i32* %14
%136 = or i32 %135, 4
store i32 %136, i32* %14
br label %137
137: ; preds = %134, %130
%138 = load i32, i32* %6
%139 = and i32 %138, 512
%140 = icmp ne i32 %139, 0
br i1 %140, label %141, label %144
141: ; preds = %137
%142 = load i32, i32* %14
%143 = or i32 %142, 8
store i32 %143, i32* %14
br label %144
144: ; preds = %141, %137
%145 = load i32, i32* %6
%146 = and i32 %145, 524288
%147 = icmp ne i32 %146, 0
br i1 %147, label %148, label %151
148: ; preds = %144
%149 = load i32, i32* %14
%150 = or i32 %149, 16
store i32 %150, i32* %14
br label %151
151: ; preds = %148, %144
%152 = load i32, i32* %6
%153 = and i32 %152, 1048576
%154 = icmp ne i32 %153, 0
br i1 %154, label %155, label %158
155: ; preds = %151
%156 = load i32, i32* %14
%157 = or i32 %156, 32
store i32 %157, i32* %14
br label %158
158: ; preds = %155, %151
%159 = call i32 (...) @support_avx()
%160 = icmp ne i32 %159, 0
br i1 %160, label %161, label %164
161: ; preds = %158
%162 = load i32, i32* %14
%163 = or i32 %162, 262144
store i32 %163, i32* %14
br label %164
164: ; preds = %161, %158
%165 = call i32 (...) @have_excpuid()
%166 = icmp sge i32 %165, 1
br i1 %166, label %167, label %204
167: ; preds = %164
%168 = call i32 @cpuid(i32 -2147483647, i32* %4, i32* %5, i32* %6, i32* %7)
%169 = load i32, i32* %6
%170 = and i32 %169, 64
%171 = icmp ne i32 %170, 0
br i1 %171, label %172, label %175
172: ; preds = %167
%173 = load i32, i32* %14
%174 = or i32 %173, 64
store i32 %174, i32* %14
br label %175
175: ; preds = %172, %167
%176 = load i32, i32* %6
%177 = and i32 %176, 128
%178 = icmp ne i32 %177, 0
br i1 %178, label %179, label %182
179: ; preds = %175
%180 = load i32, i32* %14
%181 = or i32 %180, 32768
store i32 %181, i32* %14
br label %182
182: ; preds = %179, %175
%183 = load i32, i32* %6
%184 = and i32 %183, 65536
%185 = icmp ne i32 %184, 0
br i1 %185, label %186, label %189
186: ; preds = %182
%187 = load i32, i32* %14
%188 = or i32 %187, 524288
store i32 %188, i32* %14
br label %189
189: ; preds = %186, %182
%190 = load i32, i32* %7
%191 = and i32 %190, 1073741824
%192 = icmp ne i32 %191, 0
br i1 %192, label %193, label %196
193: ; preds = %189
%194 = load i32, i32* %14
%195 = or i32 %194, 1024
store i32 %195, i32* %14
br label %196
196: ; preds = %193, %189
%197 = load i32, i32* %7
%198 = and i32 %197, -2147483648
%199 = icmp ne i32 %198, 0
br i1 %199, label %200, label %203
200: ; preds = %196
%201 = load i32, i32* %14
%202 = or i32 %201, 512
store i32 %202, i32* %14
br label %203
203: ; preds = %200, %196
br label %204
204: ; preds = %203, %164
%205 = call i32 (...) @have_excpuid()
%206 = icmp sge i32 %205, 26
br i1 %206, label %207, label %223
207: ; preds = %204
%208 = call i32 @cpuid(i32 -2147483622, i32* %4, i32* %5, i32* %6, i32* %7)
%209 = load i32, i32* %4
%210 = and i32 %209, 1
%211 = icmp ne i32 %210, 0
br i1 %211, label %212, label %215
212: ; preds = %207
%213 = load i32, i32* %14
%214 = or i32 %213, 65536
store i32 %214, i32* %14
br label %215
215: ; preds = %212, %207
%216 = load i32, i32* %4
%217 = and i32 %216, 2
%218 = icmp ne i32 %217, 0
br i1 %218, label %219, label %222
219: ; preds = %215
%220 = load i32, i32* %14
%221 = or i32 %220, 131072
store i32 %221, i32* %14
br label %222
222: ; preds = %219, %215
br label %223
223: ; preds = %222, %204
br label %224
224: ; preds = %223, %1
%225 = load i32, i32* %14
store i32 %225, i32* %2
br label %226
226: ; preds = %224, %70, %69, %61, %60, %53, %49, %45, %41, %37, %33, %29, %25, %21, %17
%227 = load i32, i32* %2
ret i32 %227
}

LLVM IR (-O2):
define i32 @get_cputype(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = call i32 @cpuid(i32 1, i32* %2, i32* %3, i32* %4, i32* %5)
switch i32 %0, label %140 [
i32 1, label %11
i32 2, label %15
i32 3, label %19
i32 4, label %23
i32 5, label %27
i32 6, label %31
i32 7, label %35
i32 8, label %39
i32 9, label %43
i32 10, label %46
i32 12, label %49
i32 13, label %57
i32 11, label %64
]
11: ; preds = %1
%12 = load i32, i32* %2
%13 = lshr i32 %12, 20
%14 = and i32 %13, 255
br label %140
15: ; preds = %1
%16 = load i32, i32* %2
%17 = lshr i32 %16, 16
%18 = and i32 %17, 15
br label %140
19: ; preds = %1
%20 = load i32, i32* %2
%21 = lshr i32 %20, 12
%22 = and i32 %21, 3
br label %140
23: ; preds = %1
%24 = load i32, i32* %2
%25 = lshr i32 %24, 8
%26 = and i32 %25, 15
br label %140
27: ; preds = %1
%28 = load i32, i32* %2
%29 = lshr i32 %28, 4
%30 = and i32 %29, 15
br label %140
31: ; preds = %1
%32 = load i32, i32* %3
%33 = lshr i32 %32, 24
%34 = and i32 %33, 15
br label %140
35: ; preds = %1
%36 = load i32, i32* %3
%37 = lshr i32 %36, 16
%38 = and i32 %37, 15
br label %140
39: ; preds = %1
%40 = load i32, i32* %3
%41 = lshr i32 %40, 8
%42 = and i32 %41, 15
br label %140
43: ; preds = %1
%44 = load i32, i32* %2
%45 = and i32 %44, 15
br label %140
46: ; preds = %1
%47 = load i32, i32* %3
%48 = and i32 %47, 255
br label %140
49: ; preds = %1
%50 = call i32 (...) @have_cpuid()
%51 = icmp slt i32 %50, 4
br i1 %51, label %140, label %52
52: ; preds = %49
%53 = call i32 @cpuid(i32 4, i32* %2, i32* %3, i32* %4, i32* %5)
%54 = load i32, i32* %2
%55 = lshr i32 %54, 14
%56 = and i32 %55, 4095
br label %140
57: ; preds = %1
%58 = call i32 (...) @have_cpuid()
%59 = icmp slt i32 %58, 4
br i1 %59, label %140, label %60
60: ; preds = %57
%61 = call i32 @cpuid(i32 4, i32* %2, i32* %3, i32* %4, i32* %5)
%62 = load i32, i32* %2
%63 = lshr i32 %62, 26
br label %140
64: ; preds = %1
%65 = load i32, i32* %5
%66 = shl i32 %65, 9
%67 = and i32 %66, 4096
%68 = lshr i32 %65, 4
%69 = and i32 %68, 2048
%70 = or i32 %69, %67
%71 = lshr i32 %65, 6
%72 = and i32 %71, 8192
%73 = or i32 %70, %72
%74 = lshr i32 %65, 15
%75 = and i32 %74, 256
%76 = or i32 %73, %75
%77 = lshr i32 %65, 25
%78 = and i32 %77, 1
%79 = or i32 %76, %78
%80 = and i32 %77, 2
%81 = or i32 %79, %80
%82 = and i32 %65, 134217728
%83 = icmp eq i32 %82, 0
br i1 %83, label %90, label %84
84: ; preds = %64
%85 = load i32, i32* %3
%86 = and i32 %85, 983040
%87 = icmp eq i32 %86, 0
%88 = or i32 %81, 16384
%89 = select i1 %87, i32 %81, i32 %88
br label %90
90: ; preds = %84, %64
%91 = phi i32 [ %81, %64 ], [ %89, %84 ]
%92 = load i32, i32* %4
%93 = shl i32 %92, 2
%94 = and i32 %93, 4
%95 = or i32 %94, %91
%96 = lshr i32 %92, 6
%97 = and i32 %96, 8
%98 = or i32 %95, %97
%99 = lshr i32 %92, 15
%100 = and i32 %99, 16
%101 = or i32 %98, %100
%102 = and i32 %99, 32
%103 = or i32 %101, %102
%104 = call i32 (...) @support_avx()
%105 = icmp eq i32 %104, 0
%106 = or i32 %103, 262144
%107 = select i1 %105, i32 %103, i32 %106
%108 = call i32 (...) @have_excpuid()
%109 = icmp sgt i32 %108, 0
br i1 %109, label %110, label %128
110: ; preds = %90
%111 = call i32 @cpuid(i32 -2147483647, i32* %2, i32* %3, i32* %4, i32* %5)
%112 = load i32, i32* %4
%113 = and i32 %112, 64
%114 = or i32 %113, %107
%115 = shl i32 %112, 8
%116 = and i32 %115, 32768
%117 = or i32 %114, %116
%118 = shl i32 %112, 3
%119 = and i32 %118, 524288
%120 = or i32 %117, %119
%121 = load i32, i32* %5
%122 = lshr i32 %121, 20
%123 = and i32 %122, 1024
%124 = or i32 %120, %123
%125 = icmp sgt i32 %121, -1
%126 = or i32 %124, 512
%127 = select i1 %125, i32 %124, i32 %126
br label %128
128: ; preds = %110, %90
%129 = phi i32 [ %107, %90 ], [ %127, %110 ]
%130 = call i32 (...) @have_excpuid()
%131 = icmp sgt i32 %130, 25
br i1 %131, label %132, label %140
132: ; preds = %128
%133 = call i32 @cpuid(i32 -2147483622, i32* %2, i32* %3, i32* %4, i32* %5)
%134 = load i32, i32* %2
%135 = shl i32 %134, 16
%136 = and i32 %135, 65536
%137 = or i32 %136, %129
%138 = and i32 %135, 131072
%139 = or i32 %137, %138
br label %140
140: ; preds = %132, %1, %128, %57, %49, %60, %52, %46, %43, %39, %35, %31, %27, %23, %19, %15, %11
%141 = phi i32 [ %63, %60 ], [ %56, %52 ], [ %48, %46 ], [ %45, %43 ], [ %42, %39 ], [ %38, %35 ], [ %34, %31 ], [ %30, %27 ], [ %26, %23 ], [ %22, %19 ], [ %18, %15 ], [ %14, %11 ], [ 0, %49 ], [ 0, %57 ], [ 0, %1 ], [ %129, %128 ], [ %139, %132 ]
ret i32 %141
}