#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 */
void *mmap_perith(scalar_t__, int, int *);
int /*<<< orphan*/ munmap_perith(void volatile *, int, int *);
int /*<<< orphan*/ print_pllc(void volatile *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int fd;
  volatile void *sys_mod =
      mmap_perith(((0x01C40000) + 0), (0x01C4FFFF - 0x01C40000), &fd);
  printf("--------------------\nPLLC1:\n");
  print_pllc(sys_mod + 0x800);
  printf("--------------------\nPLLC2:\n");
  print_pllc(sys_mod + 0xC00);
  munmap_perith(sys_mod, (0x01C4FFFF - 0x01C40000), &fd);
  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    $0x1c40000,%edi
mov    $0xffff,%esi
lea    -0x14(%rbp),%rdx
call   1050 <mmap_perith@plt>
mov    %rax,-0x20(%rbp)
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
add    $0x800,%rdi
call   1040 <print_pllc@plt>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
add    $0xc00,%rdi
call   1040 <print_pllc@plt>
mov    -0x20(%rbp),%rdi
mov    $0xffff,%esi
lea    -0x14(%rbp),%rdx
call   1060 <munmap_perith@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0x4(%rsp),%r14
mov    $0x1c40000,%edi
mov    $0xffff,%esi
mov    %r14,%rdx
call   1050 <mmap_perith@plt>
mov    %rax,%rbx
lea    0xe9b(%rip),%rdi
call   1030 <puts@plt>
lea    0x800(%rbx),%rdi
call   1040 <print_pllc@plt>
lea    0xe9f(%rip),%rdi
call   1030 <puts@plt>
lea    0xc00(%rbx),%rdi
call   1040 <print_pllc@plt>
mov    %rbx,%rdi
mov    $0xffff,%esi
mov    %r14,%rdx
call   1060 <munmap_perith@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [29 x i8] c"--------------------\0APLLC1:\0A\00"
@.str.1 = [29 x i8] c"--------------------\0APLLC2:\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i8* @mmap_perith(i64 29622272, i32 65535, i32* %6)
store i8* %8, i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%10 = load i8*, i8** %7
%11 = getelementptr i8, i8* %10, i64 2048
%12 = call i32 @print_pllc(i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%14 = load i8*, i8** %7
%15 = getelementptr i8, i8* %14, i64 3072
%16 = call i32 @print_pllc(i8* %15)
%17 = load i8*, i8** %7
%18 = call i32 @munmap_perith(i8* %17, i32 65535, i32* %6)
ret i32 0
}

LLVM IR (-O2):
@str = [28 x i8] c"--------------------\0APLLC1:\00"
@str.2 = [28 x i8] c"--------------------\0APLLC2:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i8* @mmap_perith(i64 29622272, i32 65535, i32* %3)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%7 = getelementptr i8, i8* %5, i64 2048
%8 = call i32 @print_pllc(i8* %7)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.2, i64 0, i64 0))
%10 = getelementptr i8, i8* %5, i64 3072
%11 = call i32 @print_pllc(i8* %10)
%12 = call i32 @munmap_perith(i8* %5, i32 65535, i32* %3)
ret i32 0
}