#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 */
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int MAP_FIXED;
int MAP_SHARED;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ O_RDWR;
int PROT_EXEC;
int PROT_READ;
int PROT_WRITE;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ *malloc(int);
int /*<<< orphan*/ memcpy(void *, int /*<<< orphan*/ *, int);
void *mmap(int /*<<< orphan*/ *, int, int, int, int, int);
int open(char *, int /*<<< orphan*/);
int read(int, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int main(int argc, char **argv) {
  int mem_fd, file_fd, rd;
  void *memptr;
  u_char *tmpptr = malloc((64 * 1024));
  if (argc != 2)
    do {
      fprintf(stderr, "putrom: %s\n", "usage: putrom VBIOSFILE\n");
      exit(1);
    } while (0);
  if ((mem_fd = open("/dev/mem", O_RDWR)) == -1)
    do {
      fprintf(stderr, "putrom: %s\n", "opening /dev/mem");
      exit(1);
    } while (0);
  if ((file_fd = open(argv[1], O_RDONLY)) == -1)
    do {
      fprintf(stderr, "putrom: error %s while %s\n", strerror(errno),
              "opening VBIOSFILE");
      exit(1);
    } while (0);
  if ((memptr = mmap(NULL, (64 * 1024), PROT_READ | PROT_WRITE | PROT_EXEC,
                     MAP_SHARED | MAP_FIXED, mem_fd, (0xc0000))) == (void *)-1)
    do {
      fprintf(stderr, "putrom: error %s while %s\n", strerror(errno),
              "mmaping");
      exit(1);
    } while (0);
  {
    int i;
    volatile u_char j, *jp = &j;
    for (i = 0; i < (64 * 1024) / 4096; i++)
      *jp = *((volatile u_char *)memptr + i * 4096);
  };
  if ((rd = read(file_fd, tmpptr, (64 * 1024))) == -1)
    do {
      fprintf(stderr, "putrom: error %s while %s\n", strerror(errno),
              "reading VBIOSFILE");
      exit(1);
    } while (0);
  else
    fprintf(stderr, "read %d bytes\n", rd);
  memcpy(memptr, tmpptr, (64 * 1024));
  fprintf(stderr, "done");
  close(mem_fd);
  close(file_fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x10000,%edi
call   1080 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11eb <main+0x5b>
jmp    11c3 <main+0x33>
mov    0x2dee(%rip),%rax
mov    (%rax),%edi
lea    0xe2d(%rip),%rsi
lea    0xe32(%rip),%rdx
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    0x2de6(%rip),%rax
mov    (%rax),%esi
lea    0xe32(%rip),%rdi
call   1090 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    1239 <main+0xa9>
jmp    1211 <main+0x81>
mov    0x2da0(%rip),%rax
mov    (%rax),%edi
lea    0xddf(%rip),%rsi
lea    0xdfd(%rip),%rdx
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2d88(%rip),%rax
mov    (%rax),%esi
call   1090 <open@plt>
mov    %eax,-0x18(%rbp)
cmp    $0xffffffff,%eax
jne    129f <main+0x10f>
jmp    1260 <main+0xd0>
mov    0x2d51(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    0x2d3d(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x44(%rbp),%edi
mov    %rax,%rdx
lea    0xdaf(%rip),%rsi
lea    0xdc3(%rip),%rcx
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    0x2d52(%rip),%rax
mov    (%rax),%edx
mov    0x2cf9(%rip),%rax
or     (%rax),%edx
mov    0x2d10(%rip),%rax
or     (%rax),%edx
mov    0x2d27(%rip),%rax
mov    (%rax),%ecx
mov    0x2cd6(%rip),%rax
or     (%rax),%ecx
mov    -0x14(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
mov    $0x10000,%esi
mov    $0xc0000,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x28(%rbp)
mov    $0xffffffffffffffff,%rcx
cmp    %rcx,%rax
jne    133c <main+0x1ac>
jmp    12fd <main+0x16d>
mov    0x2cb4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x48(%rbp)
mov    0x2ca0(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x48(%rbp),%edi
mov    %rax,%rdx
lea    0xd12(%rip),%rsi
lea    0xd38(%rip),%rcx
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
lea    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x10,-0x34(%rbp)
jge    1379 <main+0x1e9>
mov    -0x28(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0xc,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x40(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    134b <main+0x1bb>
mov    -0x18(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    $0x10000,%edx
call   1050 <read@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
jne    13da <main+0x24a>
jmp    139b <main+0x20b>
mov    0x2c16(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    0x2c02(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x4c(%rbp),%edi
mov    %rax,%rdx
lea    0xc74(%rip),%rsi
lea    0xca2(%rip),%rcx
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    0x2bd7(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%edx
lea    0xc90(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    $0x10000,%edx
call   1070 <memcpy@plt>
mov    0x2bab(%rip),%rax
mov    (%rax),%edi
lea    0xc76(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
mov    -0x18(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x10000,%edi
call   1080 <malloc@plt>
cmp    $0x2,%ebp
jne    1359 <main+0x1c9>
mov    %rax,%r14
mov    0x2e1b(%rip),%rax
mov    (%rax),%esi
lea    0xe67(%rip),%rdi
call   1090 <open@plt>
cmp    $0xffffffff,%eax
je     1372 <main+0x1e2>
mov    %eax,%r15d
mov    0x8(%rbx),%rdi
mov    0x2dee(%rip),%rax
mov    (%rax),%esi
call   1090 <open@plt>
cmp    $0xffffffff,%eax
je     139a <main+0x20a>
mov    %eax,%r12d
mov    0x2dfc(%rip),%rax
mov    0x2da5(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2dba(%rip),%rax
or     (%rax),%edx
mov    0x2dd1(%rip),%rax
mov    0x2d82(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
xor    %edi,%edi
mov    $0x10000,%esi
mov    %r15d,%r8d
mov    $0xc0000,%r9d
call   1030 <mmap@plt>
cmp    $0xffffffffffffffff,%rax
je     13c1 <main+0x231>
mov    %rax,%rbx
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    0x4000(%rbx),%eax
mov    %eax,0x4(%rsp)
mov    0x8000(%rbx),%eax
mov    %eax,0x4(%rsp)
mov    0xc000(%rbx),%eax
mov    %eax,0x4(%rsp)
mov    0x10000(%rbx),%eax
mov    %eax,0x4(%rsp)
mov    0x14000(%rbx),%eax
mov    %eax,0x4(%rsp)
mov    0x18000(%rbx),%eax
mov    %eax,0x4(%rsp)
mov    0x1c000(%rbx),%eax
mov    %eax,0x4(%rsp)
mov    0x20000(%rbx),%eax
mov    %eax,0x4(%rsp)
mov    0x24000(%rbx),%eax
mov    %eax,0x4(%rsp)
mov    0x28000(%rbx),%eax
mov    %eax,0x4(%rsp)
mov    0x2c000(%rbx),%eax
mov    %eax,0x4(%rsp)
mov    0x30000(%rbx),%eax
mov    %eax,0x4(%rsp)
mov    0x34000(%rbx),%eax
mov    %eax,0x4(%rsp)
mov    0x38000(%rbx),%eax
mov    %eax,0x4(%rsp)
mov    0x3c000(%rbx),%eax
mov    %eax,0x4(%rsp)
mov    %r12d,%edi
mov    %r14,%rsi
mov    $0x10000,%edx
call   1050 <read@plt>
mov    0x2cc1(%rip),%r13
mov    0x0(%r13),%ebp
cmp    $0xffffffff,%eax
je     13ea <main+0x25a>
lea    0xd72(%rip),%rsi
mov    %ebp,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x10000,%edx
call   1070 <memcpy@plt>
mov    0x0(%r13),%edi
lea    0xd5b(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r15d,%edi
call   1040 <close@plt>
mov    %r12d,%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c58(%rip),%rax
mov    (%rax),%edi
lea    0xc97(%rip),%rsi
lea    0xc9c(%rip),%rdx
jmp    1389 <main+0x1f9>
mov    0x2c3f(%rip),%rax
mov    (%rax),%edi
lea    0xc7e(%rip),%rsi
lea    0xc9c(%rip),%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    0x2c17(%rip),%rax
mov    (%rax),%ebx
mov    0x2c06(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
lea    0xc7e(%rip),%rsi
lea    0xc92(%rip),%rcx
jmp    13e6 <main+0x256>
mov    0x2bf0(%rip),%rax
mov    (%rax),%ebx
mov    0x2bdf(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
lea    0xc57(%rip),%rsi
lea    0xc7d(%rip),%rcx
mov    %ebx,%edi
jmp    1408 <main+0x278>
mov    0x2bbf(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
lea    0xc37(%rip),%rsi
lea    0xc65(%rip),%rcx
mov    %ebp,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"putrom: %s\0A\00"
@.str.1 = [25 x i8] c"usage: putrom VBIOSFILE\0A\00"
@.str.2 = [9 x i8] c"/dev/mem\00"
@O_RDWR = global i32 0
@.str.3 = [17 x i8] c"opening /dev/mem\00"
@O_RDONLY = global i32 0
@.str.4 = [27 x i8] c"putrom: error %s while %s\0A\00"
@errno = global i32 0
@.str.5 = [18 x i8] c"opening VBIOSFILE\00"
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@PROT_EXEC = global i32 0
@MAP_SHARED = global i32 0
@MAP_FIXED = global i32 0
@.str.6 = [8 x i8] c"mmaping\00"
@.str.7 = [18 x i8] c"reading VBIOSFILE\00"
@.str.8 = [15 x i8] c"read %d bytes\0A\00"
@.str.9 = [5 x i8] c"done\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = call i32* @malloc(i32 65536)
store i32* %14, i32** %10
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 2
br i1 %16, label %17, label %23
17: ; preds = %2
br label %18
18: ; preds = %17
%19 = load i32, i32* @stderr
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%21 = call i32 @exit(i32 1)
unreachable
22: ; No predecessors!
br label %23
23: ; preds = %22, %2
%24 = load i32, i32* @O_RDWR
%25 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %24)
store i32 %25, i32* %6
%26 = icmp eq i32 %25, -1
br i1 %26, label %27, label %33
27: ; preds = %23
br label %28
28: ; preds = %27
%29 = load i32, i32* @stderr
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%31 = call i32 @exit(i32 1)
unreachable
32: ; No predecessors!
br label %33
33: ; preds = %32, %23
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 1
%36 = load i8*, i8** %35
%37 = load i32, i32* @O_RDONLY
%38 = call i32 @open(i8* %36, i32 %37)
store i32 %38, i32* %7
%39 = icmp eq i32 %38, -1
br i1 %39, label %40, label %48
40: ; preds = %33
br label %41
41: ; preds = %40
%42 = load i32, i32* @stderr
%43 = load i32, i32* @errno
%44 = call i8* @strerror(i32 %43)
%45 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i8* %44, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%46 = call i32 @exit(i32 1)
unreachable
47: ; No predecessors!
br label %48
48: ; preds = %47, %33
%49 = load i32, i32* @PROT_READ
%50 = load i32, i32* @PROT_WRITE
%51 = or i32 %49, %50
%52 = load i32, i32* @PROT_EXEC
%53 = or i32 %51, %52
%54 = load i32, i32* @MAP_SHARED
%55 = load i32, i32* @MAP_FIXED
%56 = or i32 %54, %55
%57 = load i32, i32* %6
%58 = call i8* @mmap(i32* null, i32 65536, i32 %53, i32 %56, i32 %57, i32 786432)
store i8* %58, i8** %9
%59 = icmp eq i8* %58, inttoptr (i64 -1 to i8*)
br i1 %59, label %60, label %68
60: ; preds = %48
br label %61
61: ; preds = %60
%62 = load i32, i32* @stderr
%63 = load i32, i32* @errno
%64 = call i8* @strerror(i32 %63)
%65 = call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i8* %64, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%66 = call i32 @exit(i32 1)
unreachable
67: ; No predecessors!
br label %68
68: ; preds = %67, %48
store i32* %12, i32** %13
store i32 0, i32* %11
br label %69
69: ; preds = %81, %68
%70 = load i32, i32* %11
%71 = icmp slt i32 %70, 16
br i1 %71, label %72, label %84
72: ; preds = %69
%73 = load i8*, i8** %9
%74 = bitcast i8* %73 to i32*
%75 = load i32, i32* %11
%76 = mul nsw i32 %75, 4096
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i32, i32* %74, i64 %77
%79 = load volatile i32, i32* %78
%80 = load i32*, i32** %13
store volatile i32 %79, i32* %80
br label %81
81: ; preds = %72
%82 = load i32, i32* %11
%83 = add nsw i32 %82, 1
store i32 %83, i32* %11
br label %69
84: ; preds = %69
%85 = load i32, i32* %7
%86 = load i32*, i32** %10
%87 = call i32 @read(i32 %85, i32* %86, i32 65536)
store i32 %87, i32* %8
%88 = icmp eq i32 %87, -1
br i1 %88, label %89, label %97
89: ; preds = %84
br label %90
90: ; preds = %89
%91 = load i32, i32* @stderr
%92 = load i32, i32* @errno
%93 = call i8* @strerror(i32 %92)
%94 = call i32 (i32, i8*, ...) @fprintf(i32 %91, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i8* %93, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0))
%95 = call i32 @exit(i32 1)
unreachable
96: ; No predecessors!
br label %101
97: ; preds = %84
%98 = load i32, i32* @stderr
%99 = load i32, i32* %8
%100 = call i32 (i32, i8*, ...) @fprintf(i32 %98, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i32 %99)
br label %101
101: ; preds = %97, %96
%102 = load i8*, i8** %9
%103 = load i32*, i32** %10
%104 = call i32 @memcpy(i8* %102, i32* %103, i32 65536)
%105 = load i32, i32* @stderr
%106 = call i32 (i32, i8*, ...) @fprintf(i32 %105, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%107 = load i32, i32* %6
%108 = call i32 @close(i32 %107)
%109 = load i32, i32* %7
%110 = call i32 @close(i32 %109)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"putrom: %s\0A\00"
@.str.1 = [25 x i8] c"usage: putrom VBIOSFILE\0A\00"
@.str.2 = [9 x i8] c"/dev/mem\00"
@O_RDWR = global i32 0
@.str.3 = [17 x i8] c"opening /dev/mem\00"
@O_RDONLY = global i32 0
@.str.4 = [27 x i8] c"putrom: error %s while %s\0A\00"
@errno = global i32 0
@.str.5 = [18 x i8] c"opening VBIOSFILE\00"
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@PROT_EXEC = global i32 0
@MAP_SHARED = global i32 0
@MAP_FIXED = global i32 0
@.str.6 = [8 x i8] c"mmaping\00"
@.str.7 = [18 x i8] c"reading VBIOSFILE\00"
@.str.8 = [15 x i8] c"read %d bytes\0A\00"
@.str.9 = [5 x i8] c"done\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = tail call i32* @malloc(i32 65536)
%5 = icmp eq i32 %0, 2
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2
%11 = load i32, i32* @O_RDWR
%12 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i32, i32* @stderr
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%17 = tail call i32 @exit(i32 1)
unreachable
18: ; preds = %10
%19 = getelementptr inbounds i8*, i8** %1, i64 1
%20 = load i8*, i8** %19
%21 = load i32, i32* @O_RDONLY
%22 = tail call i32 @open(i8* %20, i32 %21)
%23 = icmp eq i32 %22, -1
br i1 %23, label %24, label %30
24: ; preds = %18
%25 = load i32, i32* @stderr
%26 = load i32, i32* @errno
%27 = tail call i8* @strerror(i32 %26)
%28 = tail call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i8* %27, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%29 = tail call i32 @exit(i32 1)
unreachable
30: ; preds = %18
%31 = load i32, i32* @PROT_READ
%32 = load i32, i32* @PROT_WRITE
%33 = or i32 %32, %31
%34 = load i32, i32* @PROT_EXEC
%35 = or i32 %33, %34
%36 = load i32, i32* @MAP_SHARED
%37 = load i32, i32* @MAP_FIXED
%38 = or i32 %37, %36
%39 = tail call i8* @mmap(i32* null, i32 65536, i32 %35, i32 %38, i32 %12, i32 786432)
%40 = icmp eq i8* %39, inttoptr (i64 -1 to i8*)
br i1 %40, label %41, label %47
41: ; preds = %30
%42 = load i32, i32* @stderr
%43 = load i32, i32* @errno
%44 = tail call i8* @strerror(i32 %43)
%45 = tail call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i8* %44, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%46 = tail call i32 @exit(i32 1)
unreachable
47: ; preds = %30
%48 = bitcast i32* %3 to i8*
%49 = bitcast i8* %39 to i32*
%50 = load volatile i32, i32* %49
store volatile i32 %50, i32* %3
%51 = getelementptr inbounds i8, i8* %39, i64 16384
%52 = bitcast i8* %51 to i32*
%53 = load volatile i32, i32* %52
store volatile i32 %53, i32* %3
%54 = getelementptr inbounds i8, i8* %39, i64 32768
%55 = bitcast i8* %54 to i32*
%56 = load volatile i32, i32* %55
store volatile i32 %56, i32* %3
%57 = getelementptr inbounds i8, i8* %39, i64 49152
%58 = bitcast i8* %57 to i32*
%59 = load volatile i32, i32* %58
store volatile i32 %59, i32* %3
%60 = getelementptr inbounds i8, i8* %39, i64 65536
%61 = bitcast i8* %60 to i32*
%62 = load volatile i32, i32* %61
store volatile i32 %62, i32* %3
%63 = getelementptr inbounds i8, i8* %39, i64 81920
%64 = bitcast i8* %63 to i32*
%65 = load volatile i32, i32* %64
store volatile i32 %65, i32* %3
%66 = getelementptr inbounds i8, i8* %39, i64 98304
%67 = bitcast i8* %66 to i32*
%68 = load volatile i32, i32* %67
store volatile i32 %68, i32* %3
%69 = getelementptr inbounds i8, i8* %39, i64 114688
%70 = bitcast i8* %69 to i32*
%71 = load volatile i32, i32* %70
store volatile i32 %71, i32* %3
%72 = getelementptr inbounds i8, i8* %39, i64 131072
%73 = bitcast i8* %72 to i32*
%74 = load volatile i32, i32* %73
store volatile i32 %74, i32* %3
%75 = getelementptr inbounds i8, i8* %39, i64 147456
%76 = bitcast i8* %75 to i32*
%77 = load volatile i32, i32* %76
store volatile i32 %77, i32* %3
%78 = getelementptr inbounds i8, i8* %39, i64 163840
%79 = bitcast i8* %78 to i32*
%80 = load volatile i32, i32* %79
store volatile i32 %80, i32* %3
%81 = getelementptr inbounds i8, i8* %39, i64 180224
%82 = bitcast i8* %81 to i32*
%83 = load volatile i32, i32* %82
store volatile i32 %83, i32* %3
%84 = getelementptr inbounds i8, i8* %39, i64 196608
%85 = bitcast i8* %84 to i32*
%86 = load volatile i32, i32* %85
store volatile i32 %86, i32* %3
%87 = getelementptr inbounds i8, i8* %39, i64 212992
%88 = bitcast i8* %87 to i32*
%89 = load volatile i32, i32* %88
store volatile i32 %89, i32* %3
%90 = getelementptr inbounds i8, i8* %39, i64 229376
%91 = bitcast i8* %90 to i32*
%92 = load volatile i32, i32* %91
store volatile i32 %92, i32* %3
%93 = getelementptr inbounds i8, i8* %39, i64 245760
%94 = bitcast i8* %93 to i32*
%95 = load volatile i32, i32* %94
store volatile i32 %95, i32* %3
%96 = tail call i32 @read(i32 %22, i32* %4, i32 65536)
%97 = icmp eq i32 %96, -1
%98 = load i32, i32* @stderr
br i1 %97, label %99, label %104
99: ; preds = %47
%100 = load i32, i32* @errno
%101 = tail call i8* @strerror(i32 %100)
%102 = tail call i32 (i32, i8*, ...) @fprintf(i32 %98, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i8* %101, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0))
%103 = tail call i32 @exit(i32 1)
unreachable
104: ; preds = %47
%105 = tail call i32 (i32, i8*, ...) @fprintf(i32 %98, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i32 %96)
%106 = tail call i32 @memcpy(i8* %39, i32* %4, i32 65536)
%107 = load i32, i32* @stderr
%108 = tail call i32 (i32, i8*, ...) @fprintf(i32 %107, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%109 = tail call i32 @close(i32 %12)
%110 = tail call i32 @close(i32 %22)
ret i32 0
}