#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 get_cputype(int);
char *get_cpunamechar(void) {
  if (get_cputype(4) == 0x07)
    return "ITANIUM";
  if (get_cputype(4) == 0x1f)
    return "ITANIUM2";
  if (get_cputype(4) == 0x20)
    return "ITANIUM2";
  return "UNKNOWN";
}


x86 assembly (clang, -O0):
<get_cpunamechar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <get_cputype@plt>
cmp    $0x7,%eax
jne    113b <get_cpunamechar+0x2b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    118c <get_cpunamechar+0x7c>
mov    $0x4,%edi
call   1030 <get_cputype@plt>
cmp    $0x1f,%eax
jne    115e <get_cpunamechar+0x4e>
lea    0xeb3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    118c <get_cpunamechar+0x7c>
mov    $0x4,%edi
call   1030 <get_cputype@plt>
cmp    $0x20,%eax
jne    1181 <get_cpunamechar+0x71>
lea    0xe90(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    118c <get_cpunamechar+0x7c>
lea    0xe89(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cpunamechar>:
push   %rax
mov    $0x4,%edi
call   1030 <get_cputype@plt>
cmp    $0x7,%eax
jne    1129 <get_cpunamechar+0x19>
lea    0xed9(%rip),%rax
pop    %rcx
ret
mov    $0x4,%edi
call   1030 <get_cputype@plt>
cmp    $0x1f,%eax
jne    1141 <get_cpunamechar+0x31>
lea    0xec9(%rip),%rax
pop    %rcx
ret
mov    $0x4,%edi
call   1030 <get_cputype@plt>
cmp    $0x20,%eax
lea    0xeb3(%rip),%rcx
lea    0xeb5(%rip),%rax
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"ITANIUM\00"
@.str.1 = [9 x i8] c"ITANIUM2\00"
@.str.2 = [8 x i8] c"UNKNOWN\00"
define i8* @get_cpunamechar() {
%1 = alloca i8*
%2 = call i32 @get_cputype(i32 4)
%3 = icmp eq i32 %2, 7
br i1 %3, label %4, label %5
4: ; preds = %0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %1
br label %14
5: ; preds = %0
%6 = call i32 @get_cputype(i32 4)
%7 = icmp eq i32 %6, 31
br i1 %7, label %8, label %9
8: ; preds = %5
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %14
9: ; preds = %5
%10 = call i32 @get_cputype(i32 4)
%11 = icmp eq i32 %10, 32
br i1 %11, label %12, label %13
12: ; preds = %9
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %14
13: ; preds = %9
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %1
br label %14
14: ; preds = %13, %12, %8, %4
%15 = load i8*, i8** %1
ret i8* %15
}

LLVM IR (-O2):
@.str = [8 x i8] c"ITANIUM\00"
@.str.1 = [9 x i8] c"ITANIUM2\00"
@.str.2 = [8 x i8] c"UNKNOWN\00"
define i8* @get_cpunamechar() {
%1 = tail call i32 @get_cputype(i32 4)
%2 = icmp eq i32 %1, 7
br i1 %2, label %10, label %3
3: ; preds = %0
%4 = tail call i32 @get_cputype(i32 4)
%5 = icmp eq i32 %4, 31
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @get_cputype(i32 4)
%8 = icmp eq i32 %7, 32
%9 = select i1 %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
br label %10
10: ; preds = %6, %3, %0
%11 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %0 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %3 ], [ %9, %6 ]
ret i8* %11
}