#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 long get_hwcap();
unsigned long get_hwcap2();
char *get_uname_machine();
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  unsigned long val = 0;
  const char *uname_m;
  val = get_hwcap();
  printf("hwcap:%016lx\n", val);
  val = get_hwcap2();
  printf("hwcap2:%016lx\n", val);
  uname_m = get_uname_machine();
  if (uname_m)
    printf("machine:%s\n", uname_m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <get_hwcap@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <get_hwcap2@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <get_uname_machine@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     11c0 <main+0x80>
mov    -0x20(%rbp),%rsi
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <get_hwcap@plt>
lea    0xeb1(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <get_hwcap2@plt>
lea    0xea7(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <get_uname_machine@plt>
test   %rax,%rax
je     118e <main+0x4e>
lea    0xe99(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"hwcap:%016lx\0A\00"
@.str.1 = [15 x i8] c"hwcap2:%016lx\0A\00"
@.str.2 = [12 x i8] c"machine:%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %6
%8 = call i64 (...) @get_hwcap()
store i64 %8, i64* %6
%9 = load i64, i64* %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = call i64 (...) @get_hwcap2()
store i64 %11, i64* %6
%12 = load i64, i64* %6
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i64 %12)
%14 = call i8* (...) @get_uname_machine()
store i8* %14, i8** %7
%15 = load i8*, i8** %7
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = load i8*, i8** %7
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %17, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"hwcap:%016lx\0A\00"
@.str.1 = [15 x i8] c"hwcap2:%016lx\0A\00"
@.str.2 = [12 x i8] c"machine:%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @get_hwcap()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %3)
%5 = tail call i64 (...) @get_hwcap2()
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i64 %5)
%7 = tail call i8* (...) @get_uname_machine()
%8 = icmp eq i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %7)
br label %11
11: ; preds = %9, %2
ret i32 0
}