#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 */
struct fb_var_screeninfo {
  int xres;
  int yres;
  int bits_per_pixel;
  int xoffset;
  int yoffset;
  int line_length;
};
struct fb_fix_screeninfo {
  int xres;
  int yres;
  int bits_per_pixel;
  int xoffset;
  int yoffset;
  int line_length;
};

/* Variables and functions */
int /*<<< orphan*/ FBIOGET_FSCREENINFO;
int /*<<< orphan*/ FBIOGET_VSCREENINFO;
int /*<<< orphan*/ MAP_SHARED;
int /*<<< orphan*/ O_RDWR;
int PROT_READ;
int PROT_WRITE;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
scalar_t__ ioctl(int, int /*<<< orphan*/, struct fb_var_screeninfo *);
scalar_t__ mmap(int /*<<< orphan*/, long, int, int /*<<< orphan*/, int,
                int /*<<< orphan*/);
int /*<<< orphan*/ munmap(char *, long);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int fbfd = 0;
  struct fb_var_screeninfo vinfo;
  struct fb_fix_screeninfo finfo;
  long int screensize = 0;
  char *fbp = 0;
  int x = 0, y = 0;
  long int location = 0;
  int count;
  fbfd = open("/dev/fb0", O_RDWR);
  if (!fbfd) {
    printf("Error: cannot open framebuffer device.\n");
    exit(1);
  }
  printf("The framebuffer device was opened successfully.\n");
  if (ioctl(fbfd, FBIOGET_FSCREENINFO, &finfo)) {
    printf("Error reading fixed information.\n");
    exit(2);
  }
  if (ioctl(fbfd, FBIOGET_VSCREENINFO, &vinfo)) {
    printf("Error reading variable information.\n");
    exit(3);
  }
  screensize = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel / 8;
  printf("\nScreen size is %d", screensize);
  printf("\nVinfo.bpp = %d", vinfo.bits_per_pixel);
  fbp =
      (char *)mmap(0, screensize, PROT_READ | PROT_WRITE, MAP_SHARED, fbfd, 0);
  if ((int)fbp == -1) {
    printf("Error: failed to map framebuffer device to memory.\n");
    exit(4);
  }
  printf("The framebuffer device was mapped to memory successfully.\n");
  x = 100;
  y = 100;
  location = (x + vinfo.xoffset) * (vinfo.bits_per_pixel / 8) +
             (y + vinfo.yoffset) * finfo.line_length;
  for (count = 1; count < 100; count++) {
    *(fbp + location) = 255;
    *(fbp + location + count) = 0;
    *(fbp + location + count + 1) = 0;
    *(fbp + location + count + 2) = 0;
  }
  munmap(fbp, screensize);
  close(fbfd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
mov    0x2e25(%rip),%rax
mov    (%rax),%esi
lea    0xe44(%rip),%rdi
call   1080 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    11e6 <main+0x76>
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
mov    0x2dca(%rip),%rax
mov    (%rax),%esi
lea    -0x38(%rbp),%rdx
call   1050 <ioctl@plt>
cmp    $0x0,%rax
je     122b <main+0xbb>
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x2,%edi
call   1090 <exit@plt>
mov    -0x8(%rbp),%edi
mov    0x2d83(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1050 <ioctl@plt>
cmp    $0x0,%rax
je     1262 <main+0xf2>
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x3,%edi
call   1090 <exit@plt>
mov    -0x20(%rbp),%eax
imul   -0x1c(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cltq
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rsi
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x40(%rbp),%rsi
mov    0x2d4f(%rip),%rax
mov    (%rax),%edx
mov    0x2d0e(%rip),%rax
or     (%rax),%edx
mov    0x2d2d(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%r8d
xor    %r9d,%r9d
mov    %r9d,%edi
call   1030 <mmap@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
cmp    $0xffffffff,%eax
jne    12f5 <main+0x185>
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x4,%edi
call   1090 <exit@plt>
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x64,-0x4c(%rbp)
movl   $0x64,-0x50(%rbp)
mov    -0x4c(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x60(%rbp),%eax
imul   %ecx,%eax
mov    -0x50(%rbp),%ecx
add    -0x10(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    %ecx,%eax
cltq
mov    %rax,-0x58(%rbp)
movl   $0x1,-0x5c(%rbp)
cmpl   $0x64,-0x5c(%rbp)
jge    139c <main+0x22c>
mov    -0x48(%rbp),%rax
mov    -0x58(%rbp),%rcx
movb   $0xff,(%rax,%rcx,1)
mov    -0x48(%rbp),%rax
add    -0x58(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x48(%rbp),%rax
add    -0x58(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movb   $0x0,0x1(%rax,%rcx,1)
mov    -0x48(%rbp),%rax
add    -0x58(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movb   $0x0,0x2(%rax,%rcx,1)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1346 <main+0x1d6>
mov    -0x48(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1070 <munmap@plt>
mov    -0x8(%rbp),%edi
call   1060 <close@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    0x2e49(%rip),%rax
mov    (%rax),%esi
lea    0xe68(%rip),%rdi
call   1090 <open@plt>
test   %eax,%eax
je     1306 <main+0x186>
mov    %eax,%ebp
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e0e(%rip),%rax
mov    (%rax),%esi
lea    0x18(%rsp),%rdx
mov    %ebp,%edi
call   1060 <ioctl@plt>
test   %rax,%rax
jne    131c <main+0x19c>
mov    0x2de0(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    %ebp,%edi
call   1060 <ioctl@plt>
test   %rax,%rax
jne    1332 <main+0x1b2>
mov    0x4(%rsp),%eax
imul   (%rsp),%eax
imul   0x8(%rsp),%eax
lea    0x7(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x3,%ecx
movslq %ecx,%r14
lea    0xdfa(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%esi
lea    0xdf8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2dc6(%rip),%rax
mov    0x2d87(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2da4(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    %r14,%rsi
mov    %ebp,%r8d
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,%rbx
cmp    $0xffffffff,%ebx
je     1348 <main+0x1c8>
lea    0xe1a(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%eax
mov    0xc(%rsp),%ecx
add    $0x64,%ecx
lea    0x7(%rax),%edx
test   %eax,%eax
cmovns %eax,%edx
sar    $0x3,%edx
imul   %ecx,%edx
mov    0x10(%rsp),%eax
add    $0x64,%eax
imul   0x2c(%rsp),%eax
add    %edx,%eax
cltq
mov    %rbx,%rcx
add    %rax,%rcx
mov    $0x5,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0xff,(%rbx,%rax,1)
movw   $0x0,-0x4(%rcx,%rdx,1)
movb   $0x0,-0x2(%rcx,%rdx,1)
movb   $0xff,(%rbx,%rax,1)
movw   $0x0,-0x3(%rcx,%rdx,1)
movb   $0x0,-0x1(%rcx,%rdx,1)
movb   $0xff,(%rbx,%rax,1)
movw   $0x0,-0x2(%rcx,%rdx,1)
movb   $0x0,(%rcx,%rdx,1)
add    $0x3,%rdx
cmp    $0x68,%rdx
jne    12b0 <main+0x130>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1080 <munmap@plt>
mov    %ebp,%edi
call   1070 <close@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xd1f(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
lea    0xdf1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   10a0 <exit@plt>
lea    0xdb7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3,%edi
call   10a0 <exit@plt>
lea    0xd6e(%rip),%rdi
call   1030 <puts@plt>
mov    $0x4,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
%struct.fb_var_screeninfo = type { i32, i32, i32, i32, i32, i32 }
%struct.fb_fix_screeninfo = type { i32, i32, i32, i32, i32, i32 }
@.str = [9 x i8] c"/dev/fb0\00"
@O_RDWR = global i32 0
@.str.1 = [40 x i8] c"Error: cannot open framebuffer device.\0A\00"
@.str.2 = [49 x i8] c"The framebuffer device was opened successfully.\0A\00"
@FBIOGET_FSCREENINFO = global i32 0
@.str.3 = [34 x i8] c"Error reading fixed information.\0A\00"
@FBIOGET_VSCREENINFO = global i32 0
@.str.4 = [37 x i8] c"Error reading variable information.\0A\00"
@.str.5 = [19 x i8] c"\0AScreen size is %d\00"
@.str.6 = [16 x i8] c"\0AVinfo.bpp = %d\00"
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@.str.7 = [52 x i8] c"Error: failed to map framebuffer device to memory.\0A\00"
@.str.8 = [59 x i8] c"The framebuffer device was mapped to memory successfully.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.fb_var_screeninfo
%4 = alloca %struct.fb_fix_screeninfo
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i64
%10 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i64 0, i64* %5
store i8* null, i8** %6
store i32 0, i32* %7
store i32 0, i32* %8
store i64 0, i64* %9
%11 = load i32, i32* @O_RDWR
%12 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %11)
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = icmp ne i32 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%20 = load i32, i32* %2
%21 = load i32, i32* @FBIOGET_FSCREENINFO
%22 = bitcast %struct.fb_fix_screeninfo* %4 to %struct.fb_var_screeninfo*
%23 = call i64 @ioctl(i32 %20, i32 %21, %struct.fb_var_screeninfo* %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %18
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%27 = call i32 @exit(i32 2)
unreachable
28: ; preds = %18
%29 = load i32, i32* %2
%30 = load i32, i32* @FBIOGET_VSCREENINFO
%31 = call i64 @ioctl(i32 %29, i32 %30, %struct.fb_var_screeninfo* %3)
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %28
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%35 = call i32 @exit(i32 3)
unreachable
36: ; preds = %28
%37 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %3, i32 0, i32 0
%38 = load i32, i32* %37
%39 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %3, i32 0, i32 1
%40 = load i32, i32* %39
%41 = mul nsw i32 %38, %40
%42 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %3, i32 0, i32 2
%43 = load i32, i32* %42
%44 = mul nsw i32 %41, %43
%45 = sdiv i32 %44, 8
%46 = sext i32 %45 to i64
store i64 %46, i64* %5
%47 = load i64, i64* %5
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i64 %47)
%49 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %3, i32 0, i32 2
%50 = load i32, i32* %49
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32 %50)
%52 = load i64, i64* %5
%53 = load i32, i32* @PROT_READ
%54 = load i32, i32* @PROT_WRITE
%55 = or i32 %53, %54
%56 = load i32, i32* @MAP_SHARED
%57 = load i32, i32* %2
%58 = call i64 @mmap(i32 0, i64 %52, i32 %55, i32 %56, i32 %57, i32 0)
%59 = inttoptr i64 %58 to i8*
store i8* %59, i8** %6
%60 = load i8*, i8** %6
%61 = ptrtoint i8* %60 to i32
%62 = icmp eq i32 %61, -1
br i1 %62, label %63, label %66
63: ; preds = %36
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0))
%65 = call i32 @exit(i32 4)
unreachable
66: ; preds = %36
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.8, i64 0, i64 0))
store i32 100, i32* %7
store i32 100, i32* %8
%68 = load i32, i32* %7
%69 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %3, i32 0, i32 3
%70 = load i32, i32* %69
%71 = add nsw i32 %68, %70
%72 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %3, i32 0, i32 2
%73 = load i32, i32* %72
%74 = sdiv i32 %73, 8
%75 = mul nsw i32 %71, %74
%76 = load i32, i32* %8
%77 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %3, i32 0, i32 4
%78 = load i32, i32* %77
%79 = add nsw i32 %76, %78
%80 = getelementptr inbounds %struct.fb_fix_screeninfo, %struct.fb_fix_screeninfo* %4, i32 0, i32 5
%81 = load i32, i32* %80
%82 = mul nsw i32 %79, %81
%83 = add nsw i32 %75, %82
%84 = sext i32 %83 to i64
store i64 %84, i64* %9
store i32 1, i32* %10
br label %85
85: ; preds = %112, %66
%86 = load i32, i32* %10
%87 = icmp slt i32 %86, 100
br i1 %87, label %88, label %115
88: ; preds = %85
%89 = load i8*, i8** %6
%90 = load i64, i64* %9
%91 = getelementptr inbounds i8, i8* %89, i64 %90
store i8 -1, i8* %91
%92 = load i8*, i8** %6
%93 = load i64, i64* %9
%94 = getelementptr inbounds i8, i8* %92, i64 %93
%95 = load i32, i32* %10
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i8, i8* %94, i64 %96
store i8 0, i8* %97
%98 = load i8*, i8** %6
%99 = load i64, i64* %9
%100 = getelementptr inbounds i8, i8* %98, i64 %99
%101 = load i32, i32* %10
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds i8, i8* %100, i64 %102
%104 = getelementptr inbounds i8, i8* %103, i64 1
store i8 0, i8* %104
%105 = load i8*, i8** %6
%106 = load i64, i64* %9
%107 = getelementptr inbounds i8, i8* %105, i64 %106
%108 = load i32, i32* %10
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i8, i8* %107, i64 %109
%111 = getelementptr inbounds i8, i8* %110, i64 2
store i8 0, i8* %111
br label %112
112: ; preds = %88
%113 = load i32, i32* %10
%114 = add nsw i32 %113, 1
store i32 %114, i32* %10
br label %85
115: ; preds = %85
%116 = load i8*, i8** %6
%117 = load i64, i64* %5
%118 = call i32 @munmap(i8* %116, i64 %117)
%119 = load i32, i32* %2
%120 = call i32 @close(i32 %119)
ret i32 0
}

LLVM IR (-O2):
%struct.fb_var_screeninfo = type { i32, i32, i32, i32, i32, i32 }
%struct.fb_fix_screeninfo = type { i32, i32, i32, i32, i32, i32 }
@.str = [9 x i8] c"/dev/fb0\00"
@O_RDWR = global i32 0
@FBIOGET_FSCREENINFO = global i32 0
@FBIOGET_VSCREENINFO = global i32 0
@.str.5 = [19 x i8] c"\0AScreen size is %d\00"
@.str.6 = [16 x i8] c"\0AVinfo.bpp = %d\00"
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@str = [39 x i8] c"Error: cannot open framebuffer device.\00"
@str.9 = [48 x i8] c"The framebuffer device was opened successfully.\00"
@str.10 = [58 x i8] c"The framebuffer device was mapped to memory successfully.\00"
@str.11 = [51 x i8] c"Error: failed to map framebuffer device to memory.\00"
@str.12 = [36 x i8] c"Error reading variable information.\00"
@str.13 = [33 x i8] c"Error reading fixed information.\00"
define i32 @main() {
%1 = alloca %struct.fb_var_screeninfo
%2 = alloca %struct.fb_fix_screeninfo
%3 = bitcast %struct.fb_var_screeninfo* %1 to i8*
%4 = bitcast %struct.fb_fix_screeninfo* %2 to i8*
%5 = load i32, i32* @O_RDWR
%6 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %0
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.9, i64 0, i64 0))
%13 = load i32, i32* @FBIOGET_FSCREENINFO
%14 = bitcast %struct.fb_fix_screeninfo* %2 to %struct.fb_var_screeninfo*
%15 = call i64 @ioctl(i32 %6, i32 %13, %struct.fb_var_screeninfo* %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %11
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.13, i64 0, i64 0))
%19 = call i32 @exit(i32 2)
unreachable
20: ; preds = %11
%21 = load i32, i32* @FBIOGET_VSCREENINFO
%22 = call i64 @ioctl(i32 %6, i32 %21, %struct.fb_var_screeninfo* %1)
%23 = icmp eq i64 %22, 0
br i1 %23, label %27, label %24
24: ; preds = %20
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.12, i64 0, i64 0))
%26 = call i32 @exit(i32 3)
unreachable
27: ; preds = %20
%28 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %1, i64 0, i32 0
%29 = load i32, i32* %28
%30 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %1, i64 0, i32 1
%31 = load i32, i32* %30
%32 = mul nsw i32 %31, %29
%33 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %1, i64 0, i32 2
%34 = load i32, i32* %33
%35 = mul nsw i32 %32, %34
%36 = sdiv i32 %35, 8
%37 = sext i32 %36 to i64
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i64 %37)
%39 = load i32, i32* %33
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32 %39)
%41 = load i32, i32* @PROT_READ
%42 = load i32, i32* @PROT_WRITE
%43 = or i32 %42, %41
%44 = load i32, i32* @MAP_SHARED
%45 = call i64 @mmap(i32 0, i64 %37, i32 %43, i32 %44, i32 %6, i32 0)
%46 = inttoptr i64 %45 to i8*
%47 = trunc i64 %45 to i32
%48 = icmp eq i32 %47, -1
br i1 %48, label %49, label %52
49: ; preds = %27
%50 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.11, i64 0, i64 0))
%51 = call i32 @exit(i32 4)
unreachable
52: ; preds = %27
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.10, i64 0, i64 0))
%54 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %1, i64 0, i32 3
%55 = load i32, i32* %54
%56 = add nsw i32 %55, 100
%57 = load i32, i32* %33
%58 = sdiv i32 %57, 8
%59 = mul nsw i32 %58, %56
%60 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %1, i64 0, i32 4
%61 = load i32, i32* %60
%62 = add nsw i32 %61, 100
%63 = getelementptr inbounds %struct.fb_fix_screeninfo, %struct.fb_fix_screeninfo* %2, i64 0, i32 5
%64 = load i32, i32* %63
%65 = mul nsw i32 %62, %64
%66 = add nsw i32 %65, %59
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i8, i8* %46, i64 %67
br label %69
69: ; preds = %69, %52
%70 = phi i64 [ 1, %52 ], [ %82, %69 ]
store i8 -1, i8* %68
%71 = getelementptr inbounds i8, i8* %68, i64 %70
store i8 0, i8* %71
%72 = getelementptr inbounds i8, i8* %71, i64 1
store i8 0, i8* %72
%73 = getelementptr inbounds i8, i8* %71, i64 2
store i8 0, i8* %73
%74 = add nuw nsw i64 %70, 1
store i8 -1, i8* %68
%75 = getelementptr inbounds i8, i8* %68, i64 %74
store i8 0, i8* %75
%76 = getelementptr inbounds i8, i8* %75, i64 1
store i8 0, i8* %76
%77 = getelementptr inbounds i8, i8* %75, i64 2
store i8 0, i8* %77
%78 = add nuw nsw i64 %70, 2
store i8 -1, i8* %68
%79 = getelementptr inbounds i8, i8* %68, i64 %78
store i8 0, i8* %79
%80 = getelementptr inbounds i8, i8* %79, i64 1
store i8 0, i8* %80
%81 = getelementptr inbounds i8, i8* %79, i64 2
store i8 0, i8* %81
%82 = add nuw nsw i64 %70, 3
%83 = icmp eq i64 %82, 100
br i1 %83, label %84, label %69
84: ; preds = %69
%85 = call i32 @munmap(i8* %46, i64 %37)
%86 = call i32 @close(i32 %6)
ret i32 0
}