#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 */
char *_SC_ATEXIT_MAX;
int /*<<< orphan*/ printf(char *, char *, ...);
int /*<<< orphan*/ sysconf(char *);
int main(int argc, char *argv[]) {
  int i;
  printf("%ld\n", sysconf(_SC_ATEXIT_MAX));
  for (i = 1; i < argc; i++) {
    printf("%s:%ld\n", argv[i], sysconf(argv[i]));
  }
}


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)
mov    0x2ea3(%rip),%rax
mov    (%rax),%rdi
call   1040 <sysconf@plt>
movslq %eax,%rsi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ac <main+0x8c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <sysconf@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115d <main+0x3d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r15
mov    %edi,%ebp
mov    0x2eac(%rip),%rax
mov    (%rax),%rdi
call   1040 <sysconf@plt>
movslq %eax,%rsi
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0x2,%ebp
jl     1194 <main+0x74>
mov    %ebp,%r12d
mov    $0x1,%ebx
lea    0xe9f(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rbp
mov    %rbp,%rdi
call   1040 <sysconf@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1170 <main+0x50>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\0A\00"
@_SC_ATEXIT_MAX = global i8* null
@.str.1 = [8 x i8] c"%s:%ld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8*, i8** @_SC_ATEXIT_MAX
%8 = call i32 @sysconf(i8* %7)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %10)
store i32 1, i32* %6
br label %12
12: ; preds = %29, %2
%13 = load i32, i32* %6
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %32
16: ; preds = %12
%17 = load i8**, i8*** %5
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8*, i8** %17, i64 %19
%21 = load i8*, i8** %20
%22 = load i8**, i8*** %5
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %22, i64 %24
%26 = load i8*, i8** %25
%27 = call i32 @sysconf(i8* %26)
%28 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %21, i32 %27)
br label %29
29: ; preds = %16
%30 = load i32, i32* %6
%31 = add nsw i32 %30, 1
store i32 %31, i32* %6
br label %12
32: ; preds = %12
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
@_SC_ATEXIT_MAX = global i8* null
@.str.1 = [8 x i8] c"%s:%ld\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** @_SC_ATEXIT_MAX
%4 = tail call i32 @sysconf(i8* %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = icmp sgt i32 %0, 1
br i1 %8, label %9, label %19
9: ; preds = %2
%10 = zext i32 %0 to i64
br label %11
11: ; preds = %9, %11
%12 = phi i64 [ 1, %9 ], [ %17, %11 ]
%13 = getelementptr inbounds i8*, i8** %1, i64 %12
%14 = load i8*, i8** %13
%15 = tail call i32 @sysconf(i8* %14)
%16 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %14, i32 %15)
%17 = add nuw nsw i64 %12, 1
%18 = icmp eq i64 %17, %10
br i1 %18, label %19, label %11
19: ; preds = %11, %2
ret i32 0
}