#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 */
unsigned char WCPU_detectcpu();
const char *WCPU_cpudetectmesg() {
  const char *cpus;
  unsigned char cput;
  cput = WCPU_detectcpu();
  switch (cput) {
  case 0:
    cpus = "8086/8088 or 80186/80188";
    break;
  case 1:
    cpus = "80286";
    break;
  case 2:
    cpus = "80386 or newer";
    break;
  default:
    cpus = "internal error";
    break;
  }
  return cpus;
}


x86 assembly (clang, -O0):
<WCPU_cpudetectmesg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <WCPU_detectcpu@plt>
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     1158 <WCPU_cpudetectmesg+0x48>
jmp    1136 <WCPU_cpudetectmesg+0x26>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     1168 <WCPU_cpudetectmesg+0x58>
jmp    1147 <WCPU_cpudetectmesg+0x37>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1178 <WCPU_cpudetectmesg+0x68>
jmp    1188 <WCPU_cpudetectmesg+0x78>
lea    0xea1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1193 <WCPU_cpudetectmesg+0x83>
lea    0xeaa(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1193 <WCPU_cpudetectmesg+0x83>
lea    0xea0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1193 <WCPU_cpudetectmesg+0x83>
lea    0xe9f(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WCPU_cpudetectmesg>:
push   %rax
xor    %eax,%eax
call   1030 <WCPU_detectcpu@plt>
cmp    $0x2,%al
ja     1130 <WCPU_cpudetectmesg+0x20>
movsbq %al,%rax
lea    0xf19(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
pop    %rcx
ret
lea    0xef7(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"8086/8088 or 80186/80188\00"
@.str.1 = [6 x i8] c"80286\00"
@.str.2 = [15 x i8] c"80386 or newer\00"
@.str.3 = [15 x i8] c"internal error\00"
define i8* @WCPU_cpudetectmesg() {
%1 = alloca i8*
%2 = alloca i8
%3 = call zeroext i8 (...) @WCPU_detectcpu()
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
switch i32 %5, label %9 [
i32 0, label %6
i32 1, label %7
i32 2, label %8
]
6: ; preds = %0
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8** %1
br label %10
7: ; preds = %0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %10
8: ; preds = %0
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8** %1
br label %10
9: ; preds = %0
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8** %1
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [25 x i8] c"8086/8088 or 80186/80188\00"
@.str.1 = [6 x i8] c"80286\00"
@.str.2 = [15 x i8] c"80386 or newer\00"
@.str.3 = [15 x i8] c"internal error\00"
@reltable.WCPU_cpudetectmesg = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([25 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.WCPU_cpudetectmesg to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.WCPU_cpudetectmesg to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.WCPU_cpudetectmesg to i64)) to i32)]
define i8* @WCPU_cpudetectmesg() {
%1 = tail call zeroext i8 (...) @WCPU_detectcpu()
%2 = icmp ult i8 %1, 3
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = sext i8 %1 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.WCPU_cpudetectmesg to i8*), i64 %5)
br label %7
7: ; preds = %0, %3
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), %0 ]
ret i8* %8
}