#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 */
unsigned long mfspr(int);
int /*<<< orphan*/ mtspr(int, int);
int main() {
  unsigned long int r;
  int i;
  r = mfspr(((0 << (11)) + 17));
  mtspr(((0 << (11)) + 17), r | 0x00010000);
  mtspr(((5 << (11)) + 1), 0xdeadbeef);
  mtspr(((5 << (11)) + 2), 0xcafebabe);
  for (i = 0; i < 16; i++) {
    unsigned char *block0 = (unsigned char *)(0x100000 + i);
    unsigned char *block1 = (unsigned char *)(0x110000 + i);
    unsigned char *block2 = (unsigned char *)(0x120000 + i);
    *block0 = 16 + i;
    *block1 = 32 + i;
    *block2 = 48 + i;
  }
  unsigned char *mem1top = (unsigned char *)(0x001ffff8);
  unsigned char *mem2bot = (unsigned char *)(0xffe00000);
  unsigned char *mem2top = (unsigned char *)(0xfffffff8);
  mem1top[0] = 0xde;
  mem1top[1] = 0xad;
  mem1top[2] = 0xbe;
  mem1top[3] = 0xef;
  mem1top[4] = 0xca;
  mem1top[5] = 0xfe;
  mem1top[6] = 0xba;
  mem1top[7] = 0xbe;
  mem2bot[0] = 0xde;
  mem2bot[1] = 0xad;
  mem2bot[2] = 0xbe;
  mem2bot[3] = 0xef;
  mem2bot[4] = 0xca;
  mem2bot[5] = 0xfe;
  mem2bot[6] = 0xba;
  mem2bot[7] = 0xbe;
  mem2top[0] = 0xde;
  mem2top[1] = 0xad;
  mem2top[2] = 0xbe;
  mem2top[3] = 0xef;
  mem2top[4] = 0xca;
  mem2top[5] = 0xfe;
  mem2top[6] = 0xba;
  mem2top[7] = 0xbe;
  while (1) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x11,%edi
call   1030 <mfspr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
or     $0x10000,%rax
mov    %eax,%esi
mov    $0x11,%edi
call   1040 <mtspr@plt>
mov    $0x2801,%edi
mov    $0xdeadbeef,%esi
call   1040 <mtspr@plt>
mov    $0x2802,%edi
mov    $0xcafebabe,%esi
call   1040 <mtspr@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    11e4 <main+0xc4>
mov    -0x14(%rbp),%eax
add    $0x100000,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x110000,%eax
cltq
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
add    $0x120000,%eax
cltq
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%eax
add    $0x10,%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%eax
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x30(%rbp),%rax
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1178 <main+0x58>
mov    $0x1ffff8,%eax
mov    %rax,-0x38(%rbp)
mov    $0xffe00000,%eax
mov    %rax,-0x40(%rbp)
mov    $0xfffffff8,%eax
mov    %rax,-0x48(%rbp)
mov    -0x38(%rbp),%rax
movb   $0xde,(%rax)
mov    -0x38(%rbp),%rax
movb   $0xad,0x1(%rax)
mov    -0x38(%rbp),%rax
movb   $0xbe,0x2(%rax)
mov    -0x38(%rbp),%rax
movb   $0xef,0x3(%rax)
mov    -0x38(%rbp),%rax
movb   $0xca,0x4(%rax)
mov    -0x38(%rbp),%rax
movb   $0xfe,0x5(%rax)
mov    -0x38(%rbp),%rax
movb   $0xba,0x6(%rax)
mov    -0x38(%rbp),%rax
movb   $0xbe,0x7(%rax)
mov    -0x40(%rbp),%rax
movb   $0xde,(%rax)
mov    -0x40(%rbp),%rax
movb   $0xad,0x1(%rax)
mov    -0x40(%rbp),%rax
movb   $0xbe,0x2(%rax)
mov    -0x40(%rbp),%rax
movb   $0xef,0x3(%rax)
mov    -0x40(%rbp),%rax
movb   $0xca,0x4(%rax)
mov    -0x40(%rbp),%rax
movb   $0xfe,0x5(%rax)
mov    -0x40(%rbp),%rax
movb   $0xba,0x6(%rax)
mov    -0x40(%rbp),%rax
movb   $0xbe,0x7(%rax)
mov    -0x48(%rbp),%rax
movb   $0xde,(%rax)
mov    -0x48(%rbp),%rax
movb   $0xad,0x1(%rax)
mov    -0x48(%rbp),%rax
movb   $0xbe,0x2(%rax)
mov    -0x48(%rbp),%rax
movb   $0xef,0x3(%rax)
mov    -0x48(%rbp),%rax
movb   $0xca,0x4(%rax)
mov    -0x48(%rbp),%rax
movb   $0xfe,0x5(%rax)
mov    -0x48(%rbp),%rax
movb   $0xba,0x6(%rax)
mov    -0x48(%rbp),%rax
movb   $0xbe,0x7(%rax)
jmp    12bc <main+0x19c>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x11,%edi
call   1030 <mfspr@plt>
or     $0x10000,%eax
mov    $0x11,%edi
mov    %eax,%esi
call   1040 <mtspr@plt>
mov    $0x2801,%edi
mov    $0xdeadbeef,%esi
call   1040 <mtspr@plt>
mov    $0x2802,%edi
mov    $0xcafebabe,%esi
call   1040 <mtspr@plt>
mov    $0x120001,%eax
nop
lea    0xf(%rax),%ecx
mov    %cl,-0x20001(%rax)
lea    0x1f(%rax),%ecx
mov    %cl,-0x10001(%rax)
lea    0x2f(%rax),%ecx
mov    %cl,-0x1(%rax)
lea    0x10(%rax),%ecx
mov    %cl,-0x20000(%rax)
lea    0x20(%rax),%ecx
mov    %cl,-0x10000(%rax)
lea    0x30(%rax),%ecx
mov    %cl,(%rax)
add    $0x2,%rax
cmp    $0x120011,%rax
jne    1160 <main+0x40>
movb   $0xde,0x1ffff8
de
movb   $0xad,0x1ffff9
ad
movb   $0xbe,0x1ffffa
be
movb   $0xef,0x1ffffb
ef
movb   $0xca,0x1ffffc
ca
movb   $0xfe,0x1ffffd
fe
movb   $0xba,0x1ffffe
ba
movb   $0xbe,0x1fffff
be
movabs $0xbebafecaefbeadde,%rax
fe ba be
mov    $0xffe00000,%ecx
mov    %rax,(%rcx)
mov    %rax,0x1ffff8(%rcx)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1200 <main+0xe0>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i32 0, i32* %1
%10 = call i64 @mfspr(i32 17)
store i64 %10, i64* %2
%11 = load i64, i64* %2
%12 = or i64 %11, 65536
%13 = trunc i64 %12 to i32
%14 = call i32 @mtspr(i32 17, i32 %13)
%15 = call i32 @mtspr(i32 10241, i32 -559038737)
%16 = call i32 @mtspr(i32 10242, i32 -889275714)
store i32 0, i32* %3
br label %17
17: ; preds = %45, %0
%18 = load i32, i32* %3
%19 = icmp slt i32 %18, 16
br i1 %19, label %20, label %48
20: ; preds = %17
%21 = load i32, i32* %3
%22 = add nsw i32 1048576, %21
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to i8*
store i8* %24, i8** %4
%25 = load i32, i32* %3
%26 = add nsw i32 1114112, %25
%27 = sext i32 %26 to i64
%28 = inttoptr i64 %27 to i8*
store i8* %28, i8** %5
%29 = load i32, i32* %3
%30 = add nsw i32 1179648, %29
%31 = sext i32 %30 to i64
%32 = inttoptr i64 %31 to i8*
store i8* %32, i8** %6
%33 = load i32, i32* %3
%34 = add nsw i32 16, %33
%35 = trunc i32 %34 to i8
%36 = load i8*, i8** %4
store i8 %35, i8* %36
%37 = load i32, i32* %3
%38 = add nsw i32 32, %37
%39 = trunc i32 %38 to i8
%40 = load i8*, i8** %5
store i8 %39, i8* %40
%41 = load i32, i32* %3
%42 = add nsw i32 48, %41
%43 = trunc i32 %42 to i8
%44 = load i8*, i8** %6
store i8 %43, i8* %44
br label %45
45: ; preds = %20
%46 = load i32, i32* %3
%47 = add nsw i32 %46, 1
store i32 %47, i32* %3
br label %17
48: ; preds = %17
store i8* inttoptr (i64 2097144 to i8*), i8** %7
store i8* inttoptr (i64 4292870144 to i8*), i8** %8
store i8* inttoptr (i64 4294967288 to i8*), i8** %9
%49 = load i8*, i8** %7
%50 = getelementptr inbounds i8, i8* %49, i64 0
store i8 -34, i8* %50
%51 = load i8*, i8** %7
%52 = getelementptr inbounds i8, i8* %51, i64 1
store i8 -83, i8* %52
%53 = load i8*, i8** %7
%54 = getelementptr inbounds i8, i8* %53, i64 2
store i8 -66, i8* %54
%55 = load i8*, i8** %7
%56 = getelementptr inbounds i8, i8* %55, i64 3
store i8 -17, i8* %56
%57 = load i8*, i8** %7
%58 = getelementptr inbounds i8, i8* %57, i64 4
store i8 -54, i8* %58
%59 = load i8*, i8** %7
%60 = getelementptr inbounds i8, i8* %59, i64 5
store i8 -2, i8* %60
%61 = load i8*, i8** %7
%62 = getelementptr inbounds i8, i8* %61, i64 6
store i8 -70, i8* %62
%63 = load i8*, i8** %7
%64 = getelementptr inbounds i8, i8* %63, i64 7
store i8 -66, i8* %64
%65 = load i8*, i8** %8
%66 = getelementptr inbounds i8, i8* %65, i64 0
store i8 -34, i8* %66
%67 = load i8*, i8** %8
%68 = getelementptr inbounds i8, i8* %67, i64 1
store i8 -83, i8* %68
%69 = load i8*, i8** %8
%70 = getelementptr inbounds i8, i8* %69, i64 2
store i8 -66, i8* %70
%71 = load i8*, i8** %8
%72 = getelementptr inbounds i8, i8* %71, i64 3
store i8 -17, i8* %72
%73 = load i8*, i8** %8
%74 = getelementptr inbounds i8, i8* %73, i64 4
store i8 -54, i8* %74
%75 = load i8*, i8** %8
%76 = getelementptr inbounds i8, i8* %75, i64 5
store i8 -2, i8* %76
%77 = load i8*, i8** %8
%78 = getelementptr inbounds i8, i8* %77, i64 6
store i8 -70, i8* %78
%79 = load i8*, i8** %8
%80 = getelementptr inbounds i8, i8* %79, i64 7
store i8 -66, i8* %80
%81 = load i8*, i8** %9
%82 = getelementptr inbounds i8, i8* %81, i64 0
store i8 -34, i8* %82
%83 = load i8*, i8** %9
%84 = getelementptr inbounds i8, i8* %83, i64 1
store i8 -83, i8* %84
%85 = load i8*, i8** %9
%86 = getelementptr inbounds i8, i8* %85, i64 2
store i8 -66, i8* %86
%87 = load i8*, i8** %9
%88 = getelementptr inbounds i8, i8* %87, i64 3
store i8 -17, i8* %88
%89 = load i8*, i8** %9
%90 = getelementptr inbounds i8, i8* %89, i64 4
store i8 -54, i8* %90
%91 = load i8*, i8** %9
%92 = getelementptr inbounds i8, i8* %91, i64 5
store i8 -2, i8* %92
%93 = load i8*, i8** %9
%94 = getelementptr inbounds i8, i8* %93, i64 6
store i8 -70, i8* %94
%95 = load i8*, i8** %9
%96 = getelementptr inbounds i8, i8* %95, i64 7
store i8 -66, i8* %96
br label %97
97: ; preds = %48, %97
br label %97
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @mfspr(i32 17)
%2 = trunc i64 %1 to i32
%3 = or i32 %2, 65536
%4 = tail call i32 @mtspr(i32 17, i32 %3)
%5 = tail call i32 @mtspr(i32 10241, i32 -559038737)
%6 = tail call i32 @mtspr(i32 10242, i32 -889275714)
br label %7
7: ; preds = %7, %0
%8 = phi i64 [ 0, %0 ], [ %29, %7 ]
%9 = add nuw nsw i64 %8, 1048576
%10 = inttoptr i64 %9 to i8*
%11 = add nuw nsw i64 %8, 1114112
%12 = inttoptr i64 %11 to i8*
%13 = add nuw nsw i64 %8, 1179648
%14 = inttoptr i64 %13 to i8*
%15 = trunc i64 %8 to i8
%16 = add nuw nsw i8 %15, 16
store i8 %16, i8* %10
%17 = add nuw nsw i8 %15, 32
store i8 %17, i8* %12
%18 = add nuw nsw i8 %15, 48
store i8 %18, i8* %14
%19 = add nuw nsw i64 %8, 1048577
%20 = inttoptr i64 %19 to i8*
%21 = add nuw nsw i64 %8, 1114113
%22 = inttoptr i64 %21 to i8*
%23 = add nuw nsw i64 %8, 1179649
%24 = inttoptr i64 %23 to i8*
%25 = trunc i64 %8 to i8
%26 = add i8 %25, 17
store i8 %26, i8* %20
%27 = add i8 %25, 33
store i8 %27, i8* %22
%28 = add i8 %25, 49
store i8 %28, i8* %24
%29 = add nuw nsw i64 %8, 2
%30 = icmp eq i64 %29, 16
br i1 %30, label %31, label %7
31: ; preds = %7
store i8 -34, i8* inttoptr (i64 2097144 to i8*)
store i8 -83, i8* inttoptr (i64 2097145 to i8*)
store i8 -66, i8* inttoptr (i64 2097146 to i8*)
store i8 -17, i8* inttoptr (i64 2097147 to i8*)
store i8 -54, i8* inttoptr (i64 2097148 to i8*)
store i8 -2, i8* inttoptr (i64 2097149 to i8*)
store i8 -70, i8* inttoptr (i64 2097150 to i8*)
store i8 -66, i8* inttoptr (i64 2097151 to i8*)
store i8 -34, i8* inttoptr (i64 4292870144 to i8*)
store i8 -83, i8* inttoptr (i64 4292870145 to i8*)
store i8 -66, i8* inttoptr (i64 4292870146 to i8*)
store i8 -17, i8* inttoptr (i64 4292870147 to i8*)
store i8 -54, i8* inttoptr (i64 4292870148 to i8*)
store i8 -2, i8* inttoptr (i64 4292870149 to i8*)
store i8 -70, i8* inttoptr (i64 4292870150 to i8*)
store i8 -66, i8* inttoptr (i64 4292870151 to i8*)
store i8 -34, i8* inttoptr (i64 4294967288 to i8*)
store i8 -83, i8* inttoptr (i64 4294967289 to i8*)
store i8 -66, i8* inttoptr (i64 4294967290 to i8*)
store i8 -17, i8* inttoptr (i64 4294967291 to i8*)
store i8 -54, i8* inttoptr (i64 4294967292 to i8*)
store i8 -2, i8* inttoptr (i64 4294967293 to i8*)
store i8 -70, i8* inttoptr (i64 4294967294 to i8*)
store i8 -66, i8* inttoptr (i64 4294967295 to i8*)
br label %32
32: ; preds = %32, %31
br label %32
}