#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 EXIT_SUCCESS;
int get_nprocs();
int get_nprocs_conf();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("the number of processor configured by kernel : %d\n", get_nprocs());
  printf("the number of processor currently avaliable  : %d\n",
         get_nprocs_conf());
  printf("the number of processor which may be offline : %d\n",
         get_nprocs() - get_nprocs_conf());
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <get_nprocs@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <get_nprocs_conf@plt>
mov    %eax,%esi
lea    0xecf(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <get_nprocs@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <get_nprocs_conf@plt>
mov    -0x8(%rbp),%esi
sub    %eax,%esi
lea    0xee0(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <get_nprocs@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <get_nprocs_conf@plt>
lea    0xedf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <get_nprocs@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <get_nprocs_conf@plt>
sub    %eax,%ebx
lea    0xef2(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [51 x i8] c"the number of processor configured by kernel : %d\0A\00"
@.str.1 = [51 x i8] c"the number of processor currently avaliable : %d\0A\00"
@.str.2 = [51 x i8] c"the number of processor which may be offline : %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @get_nprocs()
%3 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @get_nprocs_conf()
%5 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @get_nprocs()
%7 = call i32 (...) @get_nprocs_conf()
%8 = sub nsw i32 %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}

LLVM IR (-O2):
@.str = [51 x i8] c"the number of processor configured by kernel : %d\0A\00"
@.str.1 = [51 x i8] c"the number of processor currently avaliable : %d\0A\00"
@.str.2 = [51 x i8] c"the number of processor which may be offline : %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @get_nprocs()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @get_nprocs_conf()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @get_nprocs()
%6 = tail call i32 (...) @get_nprocs_conf()
%7 = sub nsw i32 %5, %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}