#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 ((ecx & (1 << 12)) != 0)
      feature |= (1 << 20);
    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     1564 <get_cputype+0x424>
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    156a <get_cputype+0x42a>
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
jmp    156a <get_cputype+0x42a>
mov    -0xc(%rbp),%eax
sar    $0xc,%eax
and    $0x3,%eax
mov    %eax,-0x4(%rbp)
jmp    156a <get_cputype+0x42a>
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
jmp    156a <get_cputype+0x42a>
mov    -0xc(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
jmp    156a <get_cputype+0x42a>
mov    -0x10(%rbp),%eax
sar    $0x18,%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
jmp    156a <get_cputype+0x42a>
mov    -0x10(%rbp),%eax
sar    $0x10,%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
jmp    156a <get_cputype+0x42a>
mov    -0x10(%rbp),%eax
sar    $0x8,%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
jmp    156a <get_cputype+0x42a>
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
jmp    156a <get_cputype+0x42a>
mov    -0x10(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
jmp    156a <get_cputype+0x42a>
mov    $0x0,%al
call   1060 <have_cpuid@plt>
cmp    $0x4,%eax
jge    125f <get_cputype+0x11f>
movl   $0x0,-0x4(%rbp)
jmp    156a <get_cputype+0x42a>
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    156a <get_cputype+0x42a>
mov    $0x0,%al
call   1060 <have_cpuid@plt>
cmp    $0x4,%eax
jge    12a8 <get_cputype+0x168>
movl   $0x0,-0x4(%rbp)
jmp    156a <get_cputype+0x42a>
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    156a <get_cputype+0x42a>
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    -0x14(%rbp),%eax
and    $0x1000,%eax
cmp    $0x0,%eax
je     1445 <get_cputype+0x305>
mov    -0x34(%rbp),%eax
or     $0x100000,%eax
mov    %eax,-0x34(%rbp)
mov    $0x0,%al
call   1030 <have_excpuid@plt>
cmp    $0x1,%eax
jl     14fc <get_cputype+0x3bc>
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     1487 <get_cputype+0x347>
mov    -0x34(%rbp),%eax
or     $0x40,%eax
mov    %eax,-0x34(%rbp)
mov    -0x14(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     14a3 <get_cputype+0x363>
mov    -0x34(%rbp),%eax
or     $0x8000,%eax
mov    %eax,-0x34(%rbp)
mov    -0x14(%rbp),%eax
and    $0x10000,%eax
cmp    $0x0,%eax
je     14bf <get_cputype+0x37f>
mov    -0x34(%rbp),%eax
or     $0x80000,%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%eax
and    $0x40000000,%eax
cmp    $0x0,%eax
je     14db <get_cputype+0x39b>
mov    -0x34(%rbp),%eax
or     $0x400,%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
je     14f7 <get_cputype+0x3b7>
mov    -0x34(%rbp),%eax
or     $0x200,%eax
mov    %eax,-0x34(%rbp)
jmp    14fc <get_cputype+0x3bc>
mov    $0x0,%al
call   1030 <have_excpuid@plt>
cmp    $0x1a,%eax
jl     155f <get_cputype+0x41f>
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     1540 <get_cputype+0x400>
mov    -0x34(%rbp),%eax
or     $0x10000,%eax
mov    %eax,-0x34(%rbp)
mov    -0xc(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     155a <get_cputype+0x41a>
mov    -0x34(%rbp),%eax
or     $0x20000,%eax
mov    %eax,-0x34(%rbp)
jmp    155f <get_cputype+0x41f>
jmp    1564 <get_cputype+0x424>
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   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0x1,%edi
call   1050 <cpuid@plt>
add    $0xffffffff,%ebx
cmp    $0xc,%ebx
ja     1189 <get_cputype+0x49>
lea    0xe8e(%rip),%rax
movslq (%rax,%rbx,4),%rcx
add    %rax,%rcx
jmp    *%rcx
mov    (%rsp),%eax
shr    $0x14,%eax
movzbl %al,%ebx
jmp    13a5 <get_cputype+0x265>
xor    %ebx,%ebx
jmp    13a5 <get_cputype+0x265>
movzwl 0x2(%rsp),%ebx
jmp    13a2 <get_cputype+0x262>
mov    (%rsp),%ebx
shr    $0xc,%ebx
and    $0x3,%ebx
jmp    13a5 <get_cputype+0x265>
mov    (%rsp),%ebx
jmp    11d0 <get_cputype+0x90>
mov    (%rsp),%ebx
shr    $0x4,%ebx
jmp    13a2 <get_cputype+0x262>
movzbl 0x7(%rsp),%ebx
jmp    13a2 <get_cputype+0x262>
movzwl 0x6(%rsp),%ebx
jmp    13a2 <get_cputype+0x262>
mov    0x4(%rsp),%ebx
shr    $0x8,%ebx
jmp    13a2 <get_cputype+0x262>
movzbl 0x4(%rsp),%ebx
jmp    13a5 <get_cputype+0x265>
mov    0xc(%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     123d <get_cputype+0xfd>
lea    0x4000(%rcx),%eax
testb  $0xf,0x6(%rsp)
cmove  %ecx,%eax
mov    %eax,%ecx
mov    0x8(%rsp),%ebx
lea    0x0(,%rbx,4),%eax
and    $0x4,%eax
mov    %ebx,%edx
shr    $0x6,%edx
and    $0x8,%edx
or     %ecx,%edx
shr    $0xf,%ebx
mov    %ebx,%ecx
and    $0x10,%ecx
or     %eax,%ecx
and    $0x20,%ebx
or     %ecx,%ebx
or     %edx,%ebx
xor    %eax,%eax
call   1040 <support_avx@plt>
lea    0x40000(%rbx),%ecx
test   %eax,%eax
cmove  %ebx,%ecx
mov    0x8(%rsp),%ebx
shl    $0x8,%ebx
and    $0x100000,%ebx
or     %ecx,%ebx
xor    %eax,%eax
call   1030 <have_excpuid@plt>
test   %eax,%eax
jle    12ee <get_cputype+0x1ae>
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0x80000001,%edi
call   1050 <cpuid@plt>
mov    0x8(%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    0xc(%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     13a5 <get_cputype+0x265>
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0x8000001a,%edi
call   1050 <cpuid@plt>
mov    (%rsp),%eax
shl    $0x10,%eax
mov    %eax,%ecx
and    $0x10000,%ecx
or     %ebx,%ecx
and    $0x20000,%eax
or     %ecx,%eax
mov    %eax,%ebx
jmp    13a5 <get_cputype+0x265>
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <have_cpuid@plt>
cmp    $0x4,%eax
jl     13a5 <get_cputype+0x265>
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0x4,%edi
call   1050 <cpuid@plt>
mov    (%rsp),%ebx
shr    $0xe,%ebx
and    $0xfff,%ebx
jmp    13a5 <get_cputype+0x265>
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <have_cpuid@plt>
cmp    $0x4,%eax
jl     13a5 <get_cputype+0x265>
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0x4,%edi
call   1050 <cpuid@plt>
mov    (%rsp),%ebx
shr    $0x1a,%ebx
jmp    13a5 <get_cputype+0x265>
mov    (%rsp),%ebx
and    $0xf,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
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 %231 [
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 %233
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 %233
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 %233
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 %233
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 %233
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 %233
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 %233
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 %233
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 %233
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 %233
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 %233
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 %233
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 %233
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 %233
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 = load i32, i32* %6
%166 = and i32 %165, 4096
%167 = icmp ne i32 %166, 0
br i1 %167, label %168, label %171
168: ; preds = %164
%169 = load i32, i32* %14
%170 = or i32 %169, 1048576
store i32 %170, i32* %14
br label %171
171: ; preds = %168, %164
%172 = call i32 (...) @have_excpuid()
%173 = icmp sge i32 %172, 1
br i1 %173, label %174, label %211
174: ; preds = %171
%175 = call i32 @cpuid(i32 -2147483647, i32* %4, i32* %5, i32* %6, i32* %7)
%176 = load i32, i32* %6
%177 = and i32 %176, 64
%178 = icmp ne i32 %177, 0
br i1 %178, label %179, label %182
179: ; preds = %174
%180 = load i32, i32* %14
%181 = or i32 %180, 64
store i32 %181, i32* %14
br label %182
182: ; preds = %179, %174
%183 = load i32, i32* %6
%184 = and i32 %183, 128
%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, 32768
store i32 %188, i32* %14
br label %189
189: ; preds = %186, %182
%190 = load i32, i32* %6
%191 = and i32 %190, 65536
%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, 524288
store i32 %195, i32* %14
br label %196
196: ; preds = %193, %189
%197 = load i32, i32* %7
%198 = and i32 %197, 1073741824
%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, 1024
store i32 %202, i32* %14
br label %203
203: ; preds = %200, %196
%204 = load i32, i32* %7
%205 = and i32 %204, -2147483648
%206 = icmp ne i32 %205, 0
br i1 %206, label %207, label %210
207: ; preds = %203
%208 = load i32, i32* %14
%209 = or i32 %208, 512
store i32 %209, i32* %14
br label %210
210: ; preds = %207, %203
br label %211
211: ; preds = %210, %171
%212 = call i32 (...) @have_excpuid()
%213 = icmp sge i32 %212, 26
br i1 %213, label %214, label %230
214: ; preds = %211
%215 = call i32 @cpuid(i32 -2147483622, i32* %4, i32* %5, i32* %6, i32* %7)
%216 = load i32, i32* %4
%217 = and i32 %216, 1
%218 = icmp ne i32 %217, 0
br i1 %218, label %219, label %222
219: ; preds = %214
%220 = load i32, i32* %14
%221 = or i32 %220, 65536
store i32 %221, i32* %14
br label %222
222: ; preds = %219, %214
%223 = load i32, i32* %4
%224 = and i32 %223, 2
%225 = icmp ne i32 %224, 0
br i1 %225, label %226, label %229
226: ; preds = %222
%227 = load i32, i32* %14
%228 = or i32 %227, 131072
store i32 %228, i32* %14
br label %229
229: ; preds = %226, %222
br label %230
230: ; preds = %229, %211
br label %231
231: ; preds = %230, %1
%232 = load i32, i32* %14
store i32 %232, i32* %2
br label %233
233: ; preds = %231, %70, %69, %61, %60, %53, %49, %45, %41, %37, %33, %29, %25, %21, %17
%234 = load i32, i32* %2
ret i32 %234
}

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 %144 [
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 %144
15: ; preds = %1
%16 = load i32, i32* %2
%17 = lshr i32 %16, 16
%18 = and i32 %17, 15
br label %144
19: ; preds = %1
%20 = load i32, i32* %2
%21 = lshr i32 %20, 12
%22 = and i32 %21, 3
br label %144
23: ; preds = %1
%24 = load i32, i32* %2
%25 = lshr i32 %24, 8
%26 = and i32 %25, 15
br label %144
27: ; preds = %1
%28 = load i32, i32* %2
%29 = lshr i32 %28, 4
%30 = and i32 %29, 15
br label %144
31: ; preds = %1
%32 = load i32, i32* %3
%33 = lshr i32 %32, 24
%34 = and i32 %33, 15
br label %144
35: ; preds = %1
%36 = load i32, i32* %3
%37 = lshr i32 %36, 16
%38 = and i32 %37, 15
br label %144
39: ; preds = %1
%40 = load i32, i32* %3
%41 = lshr i32 %40, 8
%42 = and i32 %41, 15
br label %144
43: ; preds = %1
%44 = load i32, i32* %2
%45 = and i32 %44, 15
br label %144
46: ; preds = %1
%47 = load i32, i32* %3
%48 = and i32 %47, 255
br label %144
49: ; preds = %1
%50 = call i32 (...) @have_cpuid()
%51 = icmp slt i32 %50, 4
br i1 %51, label %144, 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 %144
57: ; preds = %1
%58 = call i32 (...) @have_cpuid()
%59 = icmp slt i32 %58, 4
br i1 %59, label %144, 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 %144
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 = load i32, i32* %4
%109 = shl i32 %108, 8
%110 = and i32 %109, 1048576
%111 = or i32 %107, %110
%112 = call i32 (...) @have_excpuid()
%113 = icmp sgt i32 %112, 0
br i1 %113, label %114, label %132
114: ; preds = %90
%115 = call i32 @cpuid(i32 -2147483647, i32* %2, i32* %3, i32* %4, i32* %5)
%116 = load i32, i32* %4
%117 = and i32 %116, 64
%118 = or i32 %117, %111
%119 = shl i32 %116, 8
%120 = and i32 %119, 32768
%121 = or i32 %118, %120
%122 = shl i32 %116, 3
%123 = and i32 %122, 524288
%124 = or i32 %121, %123
%125 = load i32, i32* %5
%126 = lshr i32 %125, 20
%127 = and i32 %126, 1024
%128 = or i32 %124, %127
%129 = icmp sgt i32 %125, -1
%130 = or i32 %128, 512
%131 = select i1 %129, i32 %128, i32 %130
br label %132
132: ; preds = %114, %90
%133 = phi i32 [ %111, %90 ], [ %131, %114 ]
%134 = call i32 (...) @have_excpuid()
%135 = icmp sgt i32 %134, 25
br i1 %135, label %136, label %144
136: ; preds = %132
%137 = call i32 @cpuid(i32 -2147483622, i32* %2, i32* %3, i32* %4, i32* %5)
%138 = load i32, i32* %2
%139 = shl i32 %138, 16
%140 = and i32 %139, 65536
%141 = or i32 %140, %133
%142 = and i32 %139, 131072
%143 = or i32 %141, %142
br label %144
144: ; preds = %136, %1, %132, %57, %49, %60, %52, %46, %43, %39, %35, %31, %27, %23, %19, %15, %11
%145 = 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 ], [ %133, %132 ], [ %143, %136 ]
ret i32 %145
}