#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 MAP_ANONYMOUS;
int MAP_PRIVATE;
int /*<<< orphan*/ PROT_READ;
int /*<<< orphan*/ __NR_brk;
int /*<<< orphan*/ __NR_exit;
int /*<<< orphan*/ __NR_mmap;
int /*<<< orphan*/ __NR_pause;
int /*<<< orphan*/ stackstress(int);
int /*<<< orphan*/ syscall0(int /*<<< orphan*/);
int syscall1(int /*<<< orphan*/, int);
int /*<<< orphan*/ syscall6(int /*<<< orphan*/, int /*<<< orphan*/, int,
                            int /*<<< orphan*/, int, int, int /*<<< orphan*/);
void _start(void) {
  int b = syscall1(__NR_brk, 0);
  syscall1(__NR_brk, b + 10);
  stackstress(16 * 1024 * 1024);
  syscall6(__NR_mmap, 0, 4096, PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
  syscall0(__NR_pause);
  syscall1(__NR_exit, 0);
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1060 <syscall1@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
add    $0xa,%esi
call   1060 <syscall1@plt>
mov    $0x1000000,%edi
call   1050 <stackstress@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
mov    0x2e6f(%rip),%rax
mov    (%rax),%ecx
mov    0x2e2e(%rip),%rax
mov    (%rax),%r8d
mov    0x2e34(%rip),%rax
or     (%rax),%r8d
xor    %esi,%esi
mov    $0x1000,%edx
mov    $0xffffffff,%r9d
movl   $0x0,(%rsp)
call   1040 <syscall6@plt>
mov    0x2df1(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall0@plt>
mov    0x2e0b(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1060 <syscall1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_start>:
push   %rbx
sub    $0x10,%rsp
mov    0x2e6c(%rip),%rbx
mov    (%rbx),%edi
xor    %esi,%esi
call   1060 <syscall1@plt>
mov    (%rbx),%edi
lea    0xa(%rax),%esi
call   1060 <syscall1@plt>
mov    $0x1000000,%edi
call   1050 <stackstress@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
mov    0x2e7f(%rip),%rax
mov    (%rax),%ecx
mov    0x2e3e(%rip),%rax
mov    0x2e47(%rip),%rdx
mov    (%rdx),%r8d
or     (%rax),%r8d
movl   $0x0,(%rsp)
xor    %esi,%esi
mov    $0x1000,%edx
mov    $0xffffffff,%r9d
call   1040 <syscall6@plt>
mov    0x2e01(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall0@plt>
mov    0x2e1b(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
add    $0x10,%rsp
pop    %rbx
jmp    1060 <syscall1@plt>

LLVM IR (-O0):
@__NR_brk = global i32 0
@__NR_mmap = global i32 0
@PROT_READ = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_ANONYMOUS = global i32 0
@__NR_pause = global i32 0
@__NR_exit = global i32 0
define void @_start() {
%1 = alloca i32
%2 = load i32, i32* @__NR_brk
%3 = call i32 @syscall1(i32 %2, i32 0)
store i32 %3, i32* %1
%4 = load i32, i32* @__NR_brk
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 10
%7 = call i32 @syscall1(i32 %4, i32 %6)
%8 = call i32 @stackstress(i32 16777216)
%9 = load i32, i32* @__NR_mmap
%10 = load i32, i32* @PROT_READ
%11 = load i32, i32* @MAP_PRIVATE
%12 = load i32, i32* @MAP_ANONYMOUS
%13 = or i32 %11, %12
%14 = call i32 @syscall6(i32 %9, i32 0, i32 4096, i32 %10, i32 %13, i32 -1, i32 0)
%15 = load i32, i32* @__NR_pause
%16 = call i32 @syscall0(i32 %15)
%17 = load i32, i32* @__NR_exit
%18 = call i32 @syscall1(i32 %17, i32 0)
ret void
}

LLVM IR (-O2):
@__NR_brk = global i32 0
@__NR_mmap = global i32 0
@PROT_READ = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_ANONYMOUS = global i32 0
@__NR_pause = global i32 0
@__NR_exit = global i32 0
define void @_start() {
%1 = load i32, i32* @__NR_brk
%2 = tail call i32 @syscall1(i32 %1, i32 0)
%3 = load i32, i32* @__NR_brk
%4 = add nsw i32 %2, 10
%5 = tail call i32 @syscall1(i32 %3, i32 %4)
%6 = tail call i32 @stackstress(i32 16777216)
%7 = load i32, i32* @__NR_mmap
%8 = load i32, i32* @PROT_READ
%9 = load i32, i32* @MAP_PRIVATE
%10 = load i32, i32* @MAP_ANONYMOUS
%11 = or i32 %10, %9
%12 = tail call i32 @syscall6(i32 %7, i32 0, i32 4096, i32 %8, i32 %11, i32 -1, i32 0)
%13 = load i32, i32* @__NR_pause
%14 = tail call i32 @syscall0(i32 %13)
%15 = load i32, i32* @__NR_exit
%16 = tail call i32 @syscall1(i32 %15, i32 0)
ret void
}