#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*/ _SC_ARG_MAX;
int /*<<< orphan*/ _SC_CHILD_MAX;
int /*<<< orphan*/ _SC_CLK_TCK;
int /*<<< orphan*/ _SC_HOST_NAME_MAX;
int /*<<< orphan*/ _SC_LOGIN_NAME_MAX;
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sysconf(int /*<<< orphan*/);
int main() {
  printf("maximum lenth of arguments: %ld\n", sysconf(_SC_ARG_MAX));
  printf("number of simultaneous processes per user ID: %ld\n",
         sysconf(_SC_CHILD_MAX));
  printf("maximum lenth of hostname: %ld\n", sysconf(_SC_HOST_NAME_MAX));
  printf("maximum lenth of a login-name: %ld\n", sysconf(_SC_LOGIN_NAME_MAX));
  printf("number of clock ticks per secound: %ld\n", sysconf(_SC_CLK_TCK));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %eax,%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %eax,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %eax,%esi
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e32(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %eax,%esi
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
lea    0xeca(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
lea    0xee6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
lea    0xeea(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
lea    0xef2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"maximum lenth of arguments: %ld\0A\00"
@_SC_ARG_MAX = global i32 0
@.str.1 = [51 x i8] c"number of simultaneous processes per user ID: %ld\0A\00"
@_SC_CHILD_MAX = global i32 0
@.str.2 = [32 x i8] c"maximum lenth of hostname: %ld\0A\00"
@_SC_HOST_NAME_MAX = global i32 0
@.str.3 = [36 x i8] c"maximum lenth of a login-name: %ld\0A\00"
@_SC_LOGIN_NAME_MAX = global i32 0
@.str.4 = [40 x i8] c"number of clock ticks per secound: %ld\0A\00"
@_SC_CLK_TCK = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @_SC_ARG_MAX
%3 = call i32 @sysconf(i32 %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @_SC_CHILD_MAX
%6 = call i32 @sysconf(i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @_SC_HOST_NAME_MAX
%9 = call i32 @sysconf(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @_SC_LOGIN_NAME_MAX
%12 = call i32 @sysconf(i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%14 = load i32, i32* @_SC_CLK_TCK
%15 = call i32 @sysconf(i32 %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"maximum lenth of arguments: %ld\0A\00"
@_SC_ARG_MAX = global i32 0
@.str.1 = [51 x i8] c"number of simultaneous processes per user ID: %ld\0A\00"
@_SC_CHILD_MAX = global i32 0
@.str.2 = [32 x i8] c"maximum lenth of hostname: %ld\0A\00"
@_SC_HOST_NAME_MAX = global i32 0
@.str.3 = [36 x i8] c"maximum lenth of a login-name: %ld\0A\00"
@_SC_LOGIN_NAME_MAX = global i32 0
@.str.4 = [40 x i8] c"number of clock ticks per secound: %ld\0A\00"
@_SC_CLK_TCK = global i32 0
define i32 @main() {
%1 = load i32, i32* @_SC_ARG_MAX
%2 = tail call i32 @sysconf(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @_SC_CHILD_MAX
%5 = tail call i32 @sysconf(i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @_SC_HOST_NAME_MAX
%8 = tail call i32 @sysconf(i32 %7)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @_SC_LOGIN_NAME_MAX
%11 = tail call i32 @sysconf(i32 %10)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i32 %11)
%13 = load i32, i32* @_SC_CLK_TCK
%14 = tail call i32 @sysconf(i32 %13)
%15 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i32 %14)
ret i32 0
}