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


x86 assembly (clang, -O0):
<raid_cpu_has_slowextendedreg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x11(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1030 <raid_cpu_info@plt>
lea    -0x11(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    117e <raid_cpu_has_slowextendedreg+0x4e>
cmpl   $0x15,-0x18(%rbp)
jne    1179 <raid_cpu_has_slowextendedreg+0x49>
movl   $0x1,-0x4(%rbp)
jmp    11c5 <raid_cpu_has_slowextendedreg+0x95>
jmp    117e <raid_cpu_has_slowextendedreg+0x4e>
lea    -0x11(%rbp),%rdi
lea    0xe84(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11be <raid_cpu_has_slowextendedreg+0x8e>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1050 <raid_cpu_is_atom@plt>
cmp    $0x0,%rax
je     11b9 <raid_cpu_has_slowextendedreg+0x89>
movl   $0x1,-0x4(%rbp)
jmp    11c5 <raid_cpu_has_slowextendedreg+0x95>
jmp    11be <raid_cpu_has_slowextendedreg+0x8e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raid_cpu_has_slowextendedreg>:
push   %rbx
sub    $0x20,%rsp
lea    0x13(%rsp),%rbx
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
call   1030 <raid_cpu_info@plt>
lea    0xead(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    116c <raid_cpu_has_slowextendedreg+0x3c>
cmpl   $0x15,0x8(%rsp)
je     1196 <raid_cpu_has_slowextendedreg+0x66>
lea    0xe9a(%rip),%rsi
lea    0x13(%rsp),%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1194 <raid_cpu_has_slowextendedreg+0x64>
mov    0x8(%rsp),%edi
mov    0xc(%rsp),%esi
call   1050 <raid_cpu_is_atom@plt>
test   %rax,%rax
jne    1196 <raid_cpu_has_slowextendedreg+0x66>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"AuthenticAMD\00"
@.str.1 = [13 x i8] c"GenuineIntel\00"
define i32 @raid_cpu_has_slowextendedreg() {
%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 @raid_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 %15
10: ; preds = %0
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 21
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 1, i32* %1
br label %27
14: ; preds = %10
br label %15
15: ; preds = %14, %0
%16 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %26
19: ; preds = %15
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = call i64 @raid_cpu_is_atom(i32 %20, i32 %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %19
store i32 1, i32* %1
br label %27
25: ; preds = %19
br label %26
26: ; preds = %25, %15
store i32 0, i32* %1
br label %27
27: ; preds = %26, %24, %13
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
@.str = [13 x i8] c"AuthenticAMD\00"
@.str.1 = [13 x i8] c"GenuineIntel\00"
define i32 @raid_cpu_has_slowextendedreg() {
%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 @raid_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
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 21
%12 = select i1 %9, i1 %11, i1 false
br i1 %12, label %22, label %13
13: ; preds = %0
%14 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = call i64 @raid_cpu_is_atom(i32 %17, i32 %18)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %16, %13
br label %22
22: ; preds = %16, %0, %21
%23 = phi i32 [ 0, %21 ], [ 1, %0 ], [ 1, %16 ]
ret i32 %23
}