#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*/ cpu_info(char *, unsigned int *, unsigned int *);
scalar_t__ strcmp(char *, char *);
int cpu_has_slowpshufb(void) {
  char vendor[13];
  unsigned family;
  unsigned model;
  cpu_info(vendor, &family, &model);
  if (strcmp(vendor, "GenuineIntel") == 0) {
    if (family == 6 && model == 28)
      return 1;
  }
  if (strcmp(vendor, "AuthenticAMD") == 0) {
    if (family == 21)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cpu_has_slowpshufb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x11(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <cpu_info@plt>
lea    -0x11(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1178 <cpu_has_slowpshufb+0x58>
cmpl   $0x6,-0x18(%rbp)
jne    1173 <cpu_has_slowpshufb+0x53>
cmpl   $0x1c,-0x1c(%rbp)
jne    1173 <cpu_has_slowpshufb+0x53>
movl   $0x1,-0x4(%rbp)
jmp    11b4 <cpu_has_slowpshufb+0x94>
jmp    1178 <cpu_has_slowpshufb+0x58>
lea    -0x11(%rbp),%rdi
lea    0xe8a(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11ad <cpu_has_slowpshufb+0x8d>
cmpl   $0x15,-0x18(%rbp)
jne    11a8 <cpu_has_slowpshufb+0x88>
movl   $0x1,-0x4(%rbp)
jmp    11b4 <cpu_has_slowpshufb+0x94>
jmp    11ad <cpu_has_slowpshufb+0x8d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_has_slowpshufb>:
push   %rbx
sub    $0x20,%rsp
lea    0x13(%rsp),%rbx
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
call   1040 <cpu_info@plt>
lea    0xebd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     117a <cpu_has_slowpshufb+0x5a>
lea    0xeb6(%rip),%rsi
lea    0x13(%rsp),%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
sete   %al
cmpl   $0x15,0x8(%rsp)
sete   %cl
and    %al,%cl
movzbl %cl,%eax
add    $0x20,%rsp
pop    %rbx
ret
cmpl   $0x6,0x8(%rsp)
jne    1150 <cpu_has_slowpshufb+0x30>
mov    $0x1,%eax
cmpl   $0x1c,0xc(%rsp)
je     1174 <cpu_has_slowpshufb+0x54>
jmp    1150 <cpu_has_slowpshufb+0x30>

LLVM IR (-O0):
@.str = [13 x i8] c"GenuineIntel\00"
@.str.1 = [13 x i8] c"AuthenticAMD\00"
define i32 @cpu_has_slowpshufb() {
%1 = alloca i32
%2 = alloca [13 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%6 = call i32 @cpu_info(i8* %5, i32* %3, i32* %4)
%7 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%8 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %0
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 6
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 28
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 1, i32* %1
br label %28
17: ; preds = %13, %10
br label %18
18: ; preds = %17, %0
%19 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%20 = call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %18
%23 = load i32, i32* %3
%24 = icmp eq i32 %23, 21
br i1 %24, label %25, label %26
25: ; preds = %22
store i32 1, i32* %1
br label %28
26: ; preds = %22
br label %27
27: ; preds = %26, %18
store i32 0, i32* %1
br label %28
28: ; preds = %27, %25, %16
%29 = load i32, i32* %1
ret i32 %29
}

LLVM IR (-O2):
@.str = [13 x i8] c"GenuineIntel\00"
@.str.1 = [13 x i8] c"AuthenticAMD\00"
define i32 @cpu_has_slowpshufb() {
%1 = alloca [13 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @cpu_info(i8* %4, i32* %2, i32* %3)
%8 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %0
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 6
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 28
%15 = select i1 %12, i1 %14, i1 false
br i1 %15, label %23, label %16
16: ; preds = %10, %0
%17 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 21
%21 = select i1 %18, i1 %20, i1 false
%22 = zext i1 %21 to i32
br label %23
23: ; preds = %16, %10
%24 = phi i32 [ 1, %10 ], [ %22, %16 ]
ret i32 %24
}