#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*/ STDOUT_FILENO;
int /*<<< orphan*/ _SC_PAGESIZE;
scalar_t__ isatty(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ sysconf(int /*<<< orphan*/);
int main(int argc, char **argv) {
  const char *fmt_string;
  ((void)(argc));
  ((void)(argv));
  if (isatty(STDOUT_FILENO)) {
    fmt_string = "Page size: %ld bytes.\n";
  } else {
    fmt_string = "%ld";
  }
  printf(fmt_string, sysconf(_SC_PAGESIZE));
  return 0;
}


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),%edi
call   1030 <isatty@plt>
cmp    $0x0,%rax
je     116e <main+0x3e>
lea    0xe9b(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1179 <main+0x49>
lea    0xea2(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
call   1050 <sysconf@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <isatty@plt>
test   %rax,%rax
lea    0xece(%rip),%rax
lea    0xeb0(%rip),%rbx
cmove  %rax,%rbx
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1050 <sysconf@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [23 x i8] c"Page size: %ld bytes.\0A\00"
@.str.1 = [4 x i8] c"%ld\00"
@_SC_PAGESIZE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i32, i32* @STDOUT_FILENO
%10 = call i64 @isatty(i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %6
br label %14
13: ; preds = %2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %6
br label %14
14: ; preds = %13, %12
%15 = load i8*, i8** %6
%16 = load i32, i32* @_SC_PAGESIZE
%17 = call i32 @sysconf(i32 %16)
%18 = call i32 @printf(i8* %15, i32 %17)
ret i32 0
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [23 x i8] c"Page size: %ld bytes.\0A\00"
@.str.1 = [4 x i8] c"%ld\00"
@_SC_PAGESIZE = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @STDOUT_FILENO
%4 = tail call i64 @isatty(i32 %3)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0)
%7 = load i32, i32* @_SC_PAGESIZE
%8 = tail call i32 @sysconf(i32 %7)
%9 = tail call i32 @printf(i8* %6, i32 %8)
ret i32 0
}