#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*/ native_cpuid(unsigned int *, unsigned int *, unsigned int *,
                                unsigned int *);
const char *guessprocessor() {
  unsigned eax = 1, ebx = 0, ecx = 0, edx = 0;
  native_cpuid(&eax, &ebx, &ecx, &edx);
  const char *codename;
  switch (eax >> 4) {
  case 0x506E:
    codename = "Skylake";
    break;
  case 0x406C:
    codename = "CherryTrail";
    break;
  case 0x306D:
    codename = "Broadwell";
    break;
  case 0x306C:
    codename = "Haswell";
    break;
  case 0x306A:
    codename = "IvyBridge";
    break;
  case 0x206A:
  case 0x206D:
    codename = "SandyBridge";
    break;
  case 0x2065:
  case 0x206C:
  case 0x206F:
    codename = "Westmere";
    break;
  case 0x106E:
  case 0x106A:
  case 0x206E:
    codename = "Nehalem";
    break;
  case 0x1067:
  case 0x106D:
    codename = "Penryn";
    break;
  case 0x006F:
  case 0x1066:
    codename = "Merom";
    break;
  case 0x0066:
    codename = "Presler";
    break;
  case 0x0063:
  case 0x0064:
    codename = "Prescott";
    break;
  case 0x006D:
    codename = "Dothan";
    break;
  case 0x0366:
    codename = "Cedarview";
    break;
  case 0x0266:
    codename = "Lincroft";
    break;
  case 0x016C:
    codename = "Pineview";
    break;
  default:
    codename = "UNKNOWN";
    break;
  }
  return codename;
}


x86 assembly (clang, -O0):
<guessprocessor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1030 <native_cpuid@plt>
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
mov    %eax,-0x1c(%rbp)
add    $0xffffff9d,%eax
sub    $0x2,%eax
jb     13af <guessprocessor+0x29f>
jmp    1163 <guessprocessor+0x53>
mov    -0x1c(%rbp),%eax
sub    $0x66,%eax
je     139f <guessprocessor+0x28f>
jmp    1174 <guessprocessor+0x64>
mov    -0x1c(%rbp),%eax
sub    $0x6d,%eax
je     13bf <guessprocessor+0x2af>
jmp    1185 <guessprocessor+0x75>
mov    -0x1c(%rbp),%eax
sub    $0x6f,%eax
je     138f <guessprocessor+0x27f>
jmp    1196 <guessprocessor+0x86>
mov    -0x1c(%rbp),%eax
sub    $0x16c,%eax
je     13ef <guessprocessor+0x2df>
jmp    11a9 <guessprocessor+0x99>
mov    -0x1c(%rbp),%eax
sub    $0x266,%eax
je     13df <guessprocessor+0x2cf>
jmp    11bc <guessprocessor+0xac>
mov    -0x1c(%rbp),%eax
sub    $0x366,%eax
je     13cf <guessprocessor+0x2bf>
jmp    11cf <guessprocessor+0xbf>
mov    -0x1c(%rbp),%eax
sub    $0x1066,%eax
je     138f <guessprocessor+0x27f>
jmp    11e2 <guessprocessor+0xd2>
mov    -0x1c(%rbp),%eax
sub    $0x1067,%eax
je     137f <guessprocessor+0x26f>
jmp    11f5 <guessprocessor+0xe5>
mov    -0x1c(%rbp),%eax
sub    $0x106a,%eax
je     136f <guessprocessor+0x25f>
jmp    1208 <guessprocessor+0xf8>
mov    -0x1c(%rbp),%eax
sub    $0x106d,%eax
je     137f <guessprocessor+0x26f>
jmp    121b <guessprocessor+0x10b>
mov    -0x1c(%rbp),%eax
sub    $0x106e,%eax
je     136f <guessprocessor+0x25f>
jmp    122e <guessprocessor+0x11e>
mov    -0x1c(%rbp),%eax
sub    $0x2065,%eax
je     135f <guessprocessor+0x24f>
jmp    1241 <guessprocessor+0x131>
mov    -0x1c(%rbp),%eax
sub    $0x206a,%eax
je     134f <guessprocessor+0x23f>
jmp    1254 <guessprocessor+0x144>
mov    -0x1c(%rbp),%eax
sub    $0x206c,%eax
je     135f <guessprocessor+0x24f>
jmp    1267 <guessprocessor+0x157>
mov    -0x1c(%rbp),%eax
sub    $0x206d,%eax
je     134f <guessprocessor+0x23f>
jmp    127a <guessprocessor+0x16a>
mov    -0x1c(%rbp),%eax
sub    $0x206e,%eax
je     136f <guessprocessor+0x25f>
jmp    128d <guessprocessor+0x17d>
mov    -0x1c(%rbp),%eax
sub    $0x206f,%eax
je     135f <guessprocessor+0x24f>
jmp    12a0 <guessprocessor+0x190>
mov    -0x1c(%rbp),%eax
sub    $0x306a,%eax
je     133f <guessprocessor+0x22f>
jmp    12b3 <guessprocessor+0x1a3>
mov    -0x1c(%rbp),%eax
sub    $0x306c,%eax
je     132f <guessprocessor+0x21f>
jmp    12c6 <guessprocessor+0x1b6>
mov    -0x1c(%rbp),%eax
sub    $0x306d,%eax
je     131f <guessprocessor+0x20f>
jmp    12d9 <guessprocessor+0x1c9>
mov    -0x1c(%rbp),%eax
sub    $0x406c,%eax
je     130f <guessprocessor+0x1ff>
jmp    12ec <guessprocessor+0x1dc>
mov    -0x1c(%rbp),%eax
sub    $0x506e,%eax
jne    13ff <guessprocessor+0x2ef>
jmp    12ff <guessprocessor+0x1ef>
lea    0xcfa(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    140a <guessprocessor+0x2fa>
lea    0xcf2(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    140a <guessprocessor+0x2fa>
lea    0xcee(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    140a <guessprocessor+0x2fa>
lea    0xce8(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    140a <guessprocessor+0x2fa>
lea    0xce0(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    140a <guessprocessor+0x2fa>
lea    0xcda(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    140a <guessprocessor+0x2fa>
lea    0xcd6(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    140a <guessprocessor+0x2fa>
lea    0xccf(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    140a <guessprocessor+0x2fa>
lea    0xcc7(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    140a <guessprocessor+0x2fa>
lea    0xcbe(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    140a <guessprocessor+0x2fa>
lea    0xcb4(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    140a <guessprocessor+0x2fa>
lea    0xcac(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    140a <guessprocessor+0x2fa>
lea    0xca5(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    140a <guessprocessor+0x2fa>
lea    0xc9c(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    140a <guessprocessor+0x2fa>
lea    0xc96(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    140a <guessprocessor+0x2fa>
lea    0xc8f(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    140a <guessprocessor+0x2fa>
lea    0xc88(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<guessprocessor>:
sub    $0x18,%rsp
movl   $0x1,0x8(%rsp)
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0x8(%rsp),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1030 <native_cpuid@plt>
mov    0x8(%rsp),%eax
shr    $0x4,%eax
cmp    $0x2064,%eax
jg     118d <guessprocessor+0x7d>
cmp    $0x265,%eax
jle    11c6 <guessprocessor+0xb6>
lea    -0x1066(%rax),%ecx
cmp    $0x8,%ecx
ja     122e <guessprocessor+0x11e>
lea    0xebc(%rip),%rax
movslq (%rax,%rcx,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0xf1d(%rip),%rax
add    $0x18,%rsp
ret
cmp    $0x3069,%eax
jg     11ee <guessprocessor+0xde>
add    $0xffffdf9b,%eax
cmp    $0xa,%eax
ja     12ae <guessprocessor+0x19e>
mov    $0x481,%ecx
bt     %eax,%ecx
jb     1222 <guessprocessor+0x112>
mov    $0x120,%ecx
bt     %eax,%ecx
jae    1272 <guessprocessor+0x162>
lea    0xec7(%rip),%rax
add    $0x18,%rsp
ret
lea    -0x63(%rax),%ecx
cmp    $0xc,%ecx
ja     1283 <guessprocessor+0x173>
lea    0xe27(%rip),%rax
movslq (%rax,%rcx,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0xed1(%rip),%rax
add    $0x18,%rsp
ret
cmp    $0x306c,%eax
jle    1258 <guessprocessor+0x148>
cmp    $0x306d,%eax
je     12ba <guessprocessor+0x1aa>
cmp    $0x506e,%eax
je     12c6 <guessprocessor+0x1b6>
cmp    $0x406c,%eax
jne    12ae <guessprocessor+0x19e>
lea    0xe43(%rip),%rax
add    $0x18,%rsp
ret
lea    0xe6b(%rip),%rax
add    $0x18,%rsp
ret
cmp    $0x266,%eax
je     12d2 <guessprocessor+0x1c2>
cmp    $0x366,%eax
jne    12ae <guessprocessor+0x19e>
lea    0xe83(%rip),%rax
add    $0x18,%rsp
ret
lea    0xe59(%rip),%rax
add    $0x18,%rsp
ret
cmp    $0x306a,%eax
je     12de <guessprocessor+0x1ce>
cmp    $0x306c,%eax
jne    12ae <guessprocessor+0x19e>
lea    0xe09(%rip),%rax
add    $0x18,%rsp
ret
cmp    $0x9,%eax
jne    12ae <guessprocessor+0x19e>
lea    0xe1f(%rip),%rax
add    $0x18,%rsp
ret
cmp    $0x16c,%eax
jne    12ae <guessprocessor+0x19e>
lea    0xe4c(%rip),%rax
add    $0x18,%rsp
ret
lea    0xe15(%rip),%rax
add    $0x18,%rsp
ret
lea    0xe1a(%rip),%rax
add    $0x18,%rsp
ret
lea    0xe31(%rip),%rax
add    $0x18,%rsp
ret
lea    0xdab(%rip),%rax
add    $0x18,%rsp
ret
lea    0xd8b(%rip),%rax
add    $0x18,%rsp
ret
lea    0xdfb(%rip),%rax
add    $0x18,%rsp
ret
lea    0xd99(%rip),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Skylake\00"
@.str.1 = [12 x i8] c"CherryTrail\00"
@.str.2 = [10 x i8] c"Broadwell\00"
@.str.3 = [8 x i8] c"Haswell\00"
@.str.4 = [10 x i8] c"IvyBridge\00"
@.str.5 = [12 x i8] c"SandyBridge\00"
@.str.6 = [9 x i8] c"Westmere\00"
@.str.7 = [8 x i8] c"Nehalem\00"
@.str.8 = [7 x i8] c"Penryn\00"
@.str.9 = [6 x i8] c"Merom\00"
@.str.10 = [8 x i8] c"Presler\00"
@.str.11 = [9 x i8] c"Prescott\00"
@.str.12 = [7 x i8] c"Dothan\00"
@.str.13 = [10 x i8] c"Cedarview\00"
@.str.14 = [9 x i8] c"Lincroft\00"
@.str.15 = [9 x i8] c"Pineview\00"
@.str.16 = [8 x i8] c"UNKNOWN\00"
define i8* @guessprocessor() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 1, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
%6 = call i32 @native_cpuid(i32* %1, i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %1
%8 = lshr i32 %7, 4
switch i32 %8, label %25 [
i32 20590, label %9
i32 16492, label %10
i32 12397, label %11
i32 12396, label %12
i32 12394, label %13
i32 8298, label %14
i32 8301, label %14
i32 8293, label %15
i32 8300, label %15
i32 8303, label %15
i32 4206, label %16
i32 4202, label %16
i32 8302, label %16
i32 4199, label %17
i32 4205, label %17
i32 111, label %18
i32 4198, label %18
i32 102, label %19
i32 99, label %20
i32 100, label %20
i32 109, label %21
i32 870, label %22
i32 614, label %23
i32 364, label %24
]
9: ; preds = %0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %5
br label %26
10: ; preds = %0
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8** %5
br label %26
11: ; preds = %0
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %5
br label %26
12: ; preds = %0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %5
br label %26
13: ; preds = %0
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8** %5
br label %26
14: ; preds = %0, %0
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8** %5
br label %26
15: ; preds = %0, %0, %0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8** %5
br label %26
16: ; preds = %0, %0, %0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8** %5
br label %26
17: ; preds = %0, %0
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8** %5
br label %26
18: ; preds = %0, %0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8** %5
br label %26
19: ; preds = %0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i8** %5
br label %26
20: ; preds = %0, %0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8** %5
br label %26
21: ; preds = %0
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8** %5
br label %26
22: ; preds = %0
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), i8** %5
br label %26
23: ; preds = %0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i8** %5
br label %26
24: ; preds = %0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i8** %5
br label %26
25: ; preds = %0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), i8** %5
br label %26
26: ; preds = %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9
%27 = load i8*, i8** %5
ret i8* %27
}

LLVM IR (-O2):
@.str = [8 x i8] c"Skylake\00"
@.str.1 = [12 x i8] c"CherryTrail\00"
@.str.2 = [10 x i8] c"Broadwell\00"
@.str.3 = [8 x i8] c"Haswell\00"
@.str.4 = [10 x i8] c"IvyBridge\00"
@.str.5 = [12 x i8] c"SandyBridge\00"
@.str.6 = [9 x i8] c"Westmere\00"
@.str.7 = [8 x i8] c"Nehalem\00"
@.str.8 = [7 x i8] c"Penryn\00"
@.str.9 = [6 x i8] c"Merom\00"
@.str.10 = [8 x i8] c"Presler\00"
@.str.11 = [9 x i8] c"Prescott\00"
@.str.12 = [7 x i8] c"Dothan\00"
@.str.13 = [10 x i8] c"Cedarview\00"
@.str.14 = [9 x i8] c"Lincroft\00"
@.str.15 = [9 x i8] c"Pineview\00"
@.str.16 = [8 x i8] c"UNKNOWN\00"
define i8* @guessprocessor() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%6 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%7 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%8 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%9 = call i32 @native_cpuid(i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %1
%11 = lshr i32 %10, 4
switch i32 %11, label %27 [
i32 20590, label %28
i32 16492, label %12
i32 12397, label %13
i32 12396, label %14
i32 12394, label %15
i32 8298, label %16
i32 8301, label %16
i32 8293, label %17
i32 8300, label %17
i32 8303, label %17
i32 4206, label %18
i32 4202, label %18
i32 8302, label %18
i32 4199, label %19
i32 4205, label %19
i32 111, label %20
i32 4198, label %20
i32 102, label %21
i32 99, label %22
i32 100, label %22
i32 109, label %23
i32 870, label %24
i32 614, label %25
i32 364, label %26
]
12: ; preds = %0
br label %28
13: ; preds = %0
br label %28
14: ; preds = %0
br label %28
15: ; preds = %0
br label %28
16: ; preds = %0, %0
br label %28
17: ; preds = %0, %0, %0
br label %28
18: ; preds = %0, %0, %0
br label %28
19: ; preds = %0, %0
br label %28
20: ; preds = %0, %0
br label %28
21: ; preds = %0
br label %28
22: ; preds = %0, %0
br label %28
23: ; preds = %0
br label %28
24: ; preds = %0
br label %28
25: ; preds = %0
br label %28
26: ; preds = %0
br label %28
27: ; preds = %0
br label %28
28: ; preds = %0, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12
%29 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), %27 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), %26 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), %25 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), %24 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), %23 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), %22 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), %21 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), %20 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), %19 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), %18 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), %17 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), %16 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), %15 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %14 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %13 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), %12 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %0 ]
ret i8* %29
}