#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*/ abort();
int numa_available();
int numa_num_configured_nodes();
int numa_preferred();
int /*<<< orphan*/ printf(char *, char *, int);
int main(void) {
  {
    int rc = numa_available();
    printf("%s returned %d\n", "numa_available", rc);
    if (rc == -1)
      abort();
  }
  {
    int num = numa_num_configured_nodes();
    printf("%s returned %d\n", "numa_num_configured_nodes", num);
    int pref = numa_preferred();
    printf("%s returned %d\n", "numa_preferred", pref);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <numa_available@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edx
lea    0xe8d(%rip),%rdi
lea    0xe96(%rip),%rsi
call   1040 <printf@plt>
cmpl   $0xffffffff,-0x8(%rbp)
jne    1190 <main+0x40>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1050 <numa_num_configured_nodes@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
lea    0xe5c(%rip),%rdi
lea    0xe74(%rip),%rsi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <numa_preferred@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edx
lea    0xe3c(%rip),%rdi
lea    0xe6e(%rip),%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1070 <numa_available@plt>
mov    %eax,%ebx
lea    0xe9f(%rip),%rdi
lea    0xea8(%rip),%rsi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
cmp    $0xffffffff,%ebx
je     11af <main+0x5f>
call   1050 <numa_num_configured_nodes@plt>
lea    0xe7e(%rip),%rbx
lea    0xe96(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <numa_preferred@plt>
lea    0xe98(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%s returned %d\0A\00"
@.str.1 = [15 x i8] c"numa_available\00"
@.str.2 = [26 x i8] c"numa_num_configured_nodes\00"
@.str.3 = [15 x i8] c"numa_preferred\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @numa_available()
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %0
%13 = call i32 (...) @numa_num_configured_nodes()
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = call i32 (...) @numa_preferred()
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"%s returned %d\0A\00"
@.str.1 = [15 x i8] c"numa_available\00"
@.str.2 = [26 x i8] c"numa_num_configured_nodes\00"
@.str.3 = [15 x i8] c"numa_preferred\00"
define i32 @main() {
%1 = tail call i32 (...) @numa_available()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %1, -1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = tail call i32 (...) @numa_num_configured_nodes()
%8 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = tail call i32 (...) @numa_preferred()
%10 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %9)
ret i32 0
}