#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*/ cpuinfo_get_cpu_name(char *);
int /*<<< orphan*/ cpuinfo_get_vendor(char *);
scalar_t__ cpuinfo_has_3dnow();
int /*<<< orphan*/ cpuinfo_has_cpuid();
scalar_t__ cpuinfo_has_e3dnow();
scalar_t__ cpuinfo_has_mmx();
scalar_t__ cpuinfo_has_sse();
scalar_t__ cpuinfo_has_sse2();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  const char *answer;
  char vendor[13];
  char cpu_name[49];
  if (!cpuinfo_has_cpuid()) {
    fprintf(stderr, "Cpu does not support CPUID, aborting.\n");
    return 0;
  }
  cpuinfo_get_vendor(vendor);
  cpuinfo_get_cpu_name(cpu_name);
  printf("Cpu vendor:\t\t%s\n", vendor);
  printf("Cpu name:\t\t%s\n", cpu_name);
  if (cpuinfo_has_mmx())
    answer = "yes";
  else
    answer = "no";
  printf("MMX support:\t\t%s\n", answer);
  if (cpuinfo_has_sse())
    answer = "yes";
  else
    answer = "no";
  printf("SSE support:\t\t%s\n", answer);
  if (cpuinfo_has_sse2())
    answer = "yes";
  else
    answer = "no";
  printf("SSE2 support:\t\t%s\n", answer);
  if (cpuinfo_has_3dnow())
    answer = "yes";
  else
    answer = "no";
  printf("3dnow support:\t\t%s\n", answer);
  if (cpuinfo_has_e3dnow())
    answer = "yes";
  else
    answer = "no";
  printf("e3dnow support:\t\t%s\n", answer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <cpuinfo_has_cpuid@plt>
cmp    $0x0,%eax
jne    11e7 <main+0x47>
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
lea    0xe2a(%rip),%rsi
call   1080 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    134c <main+0x1ac>
lea    -0x25(%rbp),%rdi
call   10c0 <cpuinfo_get_vendor@plt>
lea    -0x60(%rbp),%rdi
call   1090 <cpuinfo_get_cpu_name@plt>
lea    -0x25(%rbp),%rsi
lea    0xe23(%rip),%rdi
call   1060 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xe24(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   10b0 <cpuinfo_has_mmx@plt>
cmp    $0x0,%rax
je     123a <main+0x9a>
lea    0xe16(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1245 <main+0xa5>
lea    0xe0a(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xdfe(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1050 <cpuinfo_has_sse@plt>
cmp    $0x0,%rax
je     1276 <main+0xd6>
lea    0xdda(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1281 <main+0xe1>
lea    0xdce(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xdd4(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1030 <cpuinfo_has_sse2@plt>
cmp    $0x0,%rax
je     12b2 <main+0x112>
lea    0xd9e(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    12bd <main+0x11d>
lea    0xd92(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xdaa(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   10a0 <cpuinfo_has_3dnow@plt>
cmp    $0x0,%rax
je     12ee <main+0x14e>
lea    0xd62(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    12f9 <main+0x159>
lea    0xd56(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xd82(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1040 <cpuinfo_has_e3dnow@plt>
cmp    $0x0,%rax
je     132a <main+0x18a>
lea    0xd26(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1335 <main+0x195>
lea    0xd1a(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xd45(%rip),%rdi
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
xor    %eax,%eax
call   1070 <cpuinfo_has_cpuid@plt>
test   %eax,%eax
je     128f <main+0xef>
lea    0x3(%rsp),%rbx
mov    %rbx,%rdi
call   10c0 <cpuinfo_get_vendor@plt>
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1090 <cpuinfo_get_cpu_name@plt>
lea    0xe50(%rip),%rdi
mov    %rbx,%rsi
call   1060 <printf@plt>
lea    0xe52(%rip),%rdi
mov    %r14,%rsi
call   1060 <printf@plt>
xor    %eax,%eax
call   10b0 <cpuinfo_has_mmx@plt>
test   %rax,%rax
lea    0xe4c(%rip),%r14
lea    0xe41(%rip),%rbx
mov    %rbx,%rsi
cmove  %r14,%rsi
lea    0xe3a(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   1050 <cpuinfo_has_sse@plt>
test   %rax,%rax
mov    %rbx,%rsi
cmove  %r14,%rsi
lea    0xe2f(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   1030 <cpuinfo_has_sse2@plt>
test   %rax,%rax
mov    %rbx,%rsi
cmove  %r14,%rsi
lea    0xe24(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   10a0 <cpuinfo_has_3dnow@plt>
test   %rax,%rax
mov    %rbx,%rsi
cmove  %r14,%rsi
lea    0xe1b(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   1040 <cpuinfo_has_e3dnow@plt>
test   %rax,%rax
cmove  %r14,%rbx
lea    0xe00(%rip),%rdi
mov    %rbx,%rsi
call   1060 <printf@plt>
jmp    12a4 <main+0x104>
mov    0x2d4a(%rip),%rax
mov    (%rax),%edi
lea    0xd61(%rip),%rsi
call   1080 <fprintf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Cpu does not support CPUID, aborting.\0A\00"
@.str.1 = [17 x i8] c"Cpu vendor:\09\09%s\0A\00"
@.str.2 = [15 x i8] c"Cpu name:\09\09%s\0A\00"
@.str.3 = [4 x i8] c"yes\00"
@.str.4 = [3 x i8] c"no\00"
@.str.5 = [18 x i8] c"MMX support:\09\09%s\0A\00"
@.str.6 = [18 x i8] c"SSE support:\09\09%s\0A\00"
@.str.7 = [19 x i8] c"SSE2 support:\09\09%s\0A\00"
@.str.8 = [20 x i8] c"3dnow support:\09\09%s\0A\00"
@.str.9 = [21 x i8] c"e3dnow support:\09\09%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca [13 x i8]
%8 = alloca [49 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (...) @cpuinfo_has_cpuid()
%10 = icmp ne i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %58
14: ; preds = %2
%15 = getelementptr inbounds [13 x i8], [13 x i8]* %7, i64 0, i64 0
%16 = call i32 @cpuinfo_get_vendor(i8* %15)
%17 = getelementptr inbounds [49 x i8], [49 x i8]* %8, i64 0, i64 0
%18 = call i32 @cpuinfo_get_cpu_name(i8* %17)
%19 = getelementptr inbounds [13 x i8], [13 x i8]* %7, i64 0, i64 0
%20 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%21 = getelementptr inbounds [49 x i8], [49 x i8]* %8, i64 0, i64 0
%22 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %21)
%23 = call i64 (...) @cpuinfo_has_mmx()
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %14
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %6
br label %27
26: ; preds = %14
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8** %6
br label %27
27: ; preds = %26, %25
%28 = load i8*, i8** %6
%29 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %28)
%30 = call i64 (...) @cpuinfo_has_sse()
%31 = icmp ne i64 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %27
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %6
br label %34
33: ; preds = %27
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8** %6
br label %34
34: ; preds = %33, %32
%35 = load i8*, i8** %6
%36 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i8* %35)
%37 = call i64 (...) @cpuinfo_has_sse2()
%38 = icmp ne i64 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %34
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %6
br label %41
40: ; preds = %34
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8** %6
br label %41
41: ; preds = %40, %39
%42 = load i8*, i8** %6
%43 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i8* %42)
%44 = call i64 (...) @cpuinfo_has_3dnow()
%45 = icmp ne i64 %44, 0
br i1 %45, label %46, label %47
46: ; preds = %41
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %6
br label %48
47: ; preds = %41
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8** %6
br label %48
48: ; preds = %47, %46
%49 = load i8*, i8** %6
%50 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i8* %49)
%51 = call i64 (...) @cpuinfo_has_e3dnow()
%52 = icmp ne i64 %51, 0
br i1 %52, label %53, label %54
53: ; preds = %48
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %6
br label %55
54: ; preds = %48
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8** %6
br label %55
55: ; preds = %54, %53
%56 = load i8*, i8** %6
%57 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i8* %56)
store i32 0, i32* %3
br label %58
58: ; preds = %55, %11
%59 = load i32, i32* %3
ret i32 %59
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Cpu does not support CPUID, aborting.\0A\00"
@.str.1 = [17 x i8] c"Cpu vendor:\09\09%s\0A\00"
@.str.2 = [15 x i8] c"Cpu name:\09\09%s\0A\00"
@.str.3 = [4 x i8] c"yes\00"
@.str.4 = [3 x i8] c"no\00"
@.str.5 = [18 x i8] c"MMX support:\09\09%s\0A\00"
@.str.6 = [18 x i8] c"SSE support:\09\09%s\0A\00"
@.str.7 = [19 x i8] c"SSE2 support:\09\09%s\0A\00"
@.str.8 = [20 x i8] c"3dnow support:\09\09%s\0A\00"
@.str.9 = [21 x i8] c"e3dnow support:\09\09%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [13 x i8]
%4 = alloca [49 x i8]
%5 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [49 x i8], [49 x i8]* %4, i64 0, i64 0
%7 = tail call i32 (...) @cpuinfo_has_cpuid()
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %37
12: ; preds = %2
%13 = call i32 @cpuinfo_get_vendor(i8* %5)
%14 = call i32 @cpuinfo_get_cpu_name(i8* %6)
%15 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%16 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%17 = call i64 (...) @cpuinfo_has_mmx()
%18 = icmp eq i64 %17, 0
%19 = select i1 %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%20 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %19)
%21 = call i64 (...) @cpuinfo_has_sse()
%22 = icmp eq i64 %21, 0
%23 = select i1 %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%24 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i8* %23)
%25 = call i64 (...) @cpuinfo_has_sse2()
%26 = icmp eq i64 %25, 0
%27 = select i1 %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%28 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i8* %27)
%29 = call i64 (...) @cpuinfo_has_3dnow()
%30 = icmp eq i64 %29, 0
%31 = select i1 %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%32 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i8* %31)
%33 = call i64 (...) @cpuinfo_has_e3dnow()
%34 = icmp eq i64 %33, 0
%35 = select i1 %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%36 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i8* %35)
br label %37
37: ; preds = %12, %9
ret i32 0
}