#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 getpagesize();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char *comments[] = {
      "This file is auto-generated. Please do not edit.",
      "This value is the result of the getpagesize() call.",
      "We need this trickery to get a compile-time value for the page size.",
      NULL};
  char **p = comments;
  while (*p != NULL) {
    printf("/* %s */\n", *p);
    p++;
  }
  printf("\n");
  printf("#define CURRENT_PAGE_SIZE (%d)\n", getpagesize());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2cca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2cc7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2cc4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cc1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmpq   $0x0,(%rax)
je     1197 <main+0x77>
mov    -0x38(%rbp),%rax
mov    (%rax),%rsi
lea    0xf2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x38(%rbp)
jmp    1163 <main+0x43>
lea    0xf34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getpagesize@plt>
mov    %eax,%esi
lea    0xeff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
movaps 0x2cd2(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x2cb6(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x8(%rsp),%rbx
lea    0xea6(%rip),%rsi
lea    0xf49(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1170 <main+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getpagesize@plt>
lea    0xf16(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [49 x i8] c"This file is auto-generated. Please do not edit.\00"
@.str.1 = [52 x i8] c"This value is the result of the getpagesize() call.\00"
@.str.2 = [69 x i8] c"We need this trickery to get a compile-time value for the page size.\00"
@__const.main.comments = [4 x i8*] [i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i32 0, i32 0), i8* null]
@.str.3 = [10 x i8] c"/* %s */\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [32 x i8] c"#define CURRENT_PAGE_SIZE (%d)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8*]
%3 = alloca i8**
store i32 0, i32* %1
%4 = bitcast [4 x i8*]* %2 to i8*
%5 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 0
store i8** %5, i8*** %3
br label %6
6: ; preds = %10, %0
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i8**, i8*** %3
%12 = load i8*, i8** %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %12)
%14 = load i8**, i8*** %3
%15 = getelementptr inbounds i8*, i8** %14, i32 1
store i8** %15, i8*** %3
br label %6
16: ; preds = %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%18 = call i32 (...) @getpagesize()
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [49 x i8] c"This file is auto-generated. Please do not edit.\00"
@.str.1 = [52 x i8] c"This value is the result of the getpagesize() call.\00"
@.str.2 = [69 x i8] c"We need this trickery to get a compile-time value for the page size.\00"
@__const.main.comments = [4 x i8*] [i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i32 0, i32 0), i8* null]
@.str.3 = [10 x i8] c"/* %s */\0A\00"
@.str.5 = [32 x i8] c"#define CURRENT_PAGE_SIZE (%d)\0A\00"
define i32 @main() {
%1 = alloca [4 x i8*]
%2 = bitcast [4 x i8*]* %1 to i8*
%3 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
br label %4
4: ; preds = %0, %4
%5 = phi i8* [ %9, %4 ], [ getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), %0 ]
%6 = phi i8** [ %8, %4 ], [ %3, %0 ]
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %5)
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4
%12 = tail call i32 @putchar(i32 10)
%13 = tail call i32 (...) @getpagesize()
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i32 %13)
ret i32 0
}