#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;
};

/* Variables and functions */
int /*<<< orphan*/ FBIOGET_VSCREENINFO;
int /*<<< orphan*/ MAP_SHARED;
int /*<<< orphan*/ O_RDWR;
int PROT_READ;
int PROT_WRITE;
int /*<<< orphan*/ buf24_to16(unsigned char *, short, short);
int /*<<< orphan*/ close(int);
unsigned char *decode_jpeg(char *, short *, short *);
int /*<<< orphan*/ fb_hline(unsigned short *, int, int, int, int, int);
int /*<<< orphan*/ fb_pixel(unsigned short *, int, int, int, int);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, struct fb_var_screeninfo *);
unsigned short *mmap(int /*<<< orphan*/, int, int, int /*<<< orphan*/, int,
                     int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int fd;
  unsigned short *fbmem;
  int w, h, bpp;
  struct fb_var_screeninfo fb_var;
  unsigned char *buf;
  short image_w, image_h;
  fd = open("/dev/fb0", O_RDWR);
  if (fd < 0) {
    printf("open /dev/fb0 error!\n");
    return -1;
  }
  ioctl(fd, FBIOGET_VSCREENINFO, &fb_var);
  w = fb_var.xres;
  h = fb_var.yres;
  bpp = fb_var.bits_per_pixel;
  fbmem = mmap(0, w * h * bpp / 8, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
  if (fbmem < 0) {
    printf("mmap fb error!\n");
    return 0;
  }
  fb_pixel(fbmem, w, 100, 200, 0xF800);
  fb_hline(fbmem, w, 10, 100, 200, 0x07E0);
  buf = decode_jpeg("test.jpg", &image_w, &image_h);
  buf24_to16(buf, image_w, image_h);
  printf("#define IMAGEW %d\n#define IMAGEH %d\n\n", image_w, image_h);
  printf("unsigned char image[]={\n");
  {
    int i, j;
    for (j = 0; j < image_h; j++) {
      for (i = 0; i < image_w * 2; i += 2) {
        printf("0x%02x ,", buf[i + j * image_w * 2]);
        printf("0x%02x ,", buf[i + j * image_w * 2 + 1]);
        if (i % 16 == 14)
          printf("\n");
      }
    }
  }
  printf("\n};\n");
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e32(%rip),%rax
mov    (%rax),%esi
lea    0xe51(%rip),%rdi
call   10b0 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    11db <main+0x4b>
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13e5 <main+0x255>
mov    -0x8(%rbp),%edi
mov    0x2ddb(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1070 <ioctl@plt>
mov    -0x28(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
imul   -0x1c(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    0x2dda(%rip),%rax
mov    (%rax),%edx
mov    0x2da1(%rip),%rax
or     (%rax),%edx
mov    0x2db8(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%r8d
xor    %r9d,%r9d
mov    %r9d,%edi
call   1050 <mmap@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jae    126a <main+0xda>
lea    0xdc8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    13e5 <main+0x255>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x64,%edx
mov    $0xc8,%ecx
mov    $0xf800,%r8d
call   1040 <fb_pixel@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0xa,%edx
mov    $0x64,%ecx
mov    $0xc8,%r8d
mov    $0x7e0,%r9d
call   10a0 <fb_hline@plt>
lea    0xd80(%rip),%rdi
lea    -0x32(%rbp),%rsi
lea    -0x34(%rbp),%rdx
call   1030 <decode_jpeg@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x32(%rbp),%ax
movswl %ax,%esi
movswl -0x34(%rbp),%edx
call   1090 <buf24_to16@plt>
movswl -0x32(%rbp),%esi
movswl -0x34(%rbp),%edx
lea    0xd55(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd6d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
movswl -0x34(%rbp),%ecx
cmp    %ecx,%eax
jge    13c8 <main+0x238>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
movswl -0x32(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    13b5 <main+0x225>
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%ecx
mov    -0x3c(%rbp),%edx
movswl -0x32(%rbp),%esi
imul   %esi,%edx
shl    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xd2c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%ecx
mov    -0x3c(%rbp),%edx
movswl -0x32(%rbp),%esi
imul   %esi,%edx
shl    $0x1,%edx
add    %edx,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xcfe(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x38(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0xe,%edx
jne    13a2 <main+0x212>
lea    0xcc1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    13a7 <main+0x217>
mov    -0x38(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x38(%rbp)
jmp    1315 <main+0x185>
jmp    13ba <main+0x22a>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    12ff <main+0x16f>
lea    0xcb1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x8(%rbp),%edi
call   1080 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    0x2e13(%rip),%rax
mov    (%rax),%esi
lea    0xe32(%rip),%rdi
call   10d0 <open@plt>
test   %eax,%eax
js     1398 <main+0x1e8>
mov    %eax,%r15d
mov    0x2ddb(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
mov    %r15d,%edi
call   1090 <ioctl@plt>
mov    0x8(%rsp),%ebx
mov    0xc(%rsp),%eax
imul   %ebx,%eax
imul   0x10(%rsp),%eax
lea    0x7(%rax),%esi
test   %eax,%eax
cmovns %eax,%esi
sar    $0x3,%esi
mov    0x2de2(%rip),%rax
mov    0x2dab(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2dc0(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    %r15d,%r8d
xor    %r9d,%r9d
call   1070 <mmap@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %ebx,%esi
mov    $0x64,%edx
mov    $0xc8,%ecx
mov    $0xf800,%r8d
call   1060 <fb_pixel@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
mov    $0xa,%edx
mov    $0x64,%ecx
mov    $0xc8,%r8d
mov    $0x7e0,%r9d
call   10c0 <fb_hline@plt>
lea    0xd8e(%rip),%rdi
lea    0x4(%rsp),%rsi
lea    0x6(%rsp),%rdx
call   1040 <decode_jpeg@plt>
mov    %rax,%rbp
movswl 0x4(%rsp),%esi
movswl 0x6(%rsp),%edx
mov    %rax,%rdi
call   10b0 <buf24_to16@plt>
movswl 0x4(%rsp),%esi
movswl 0x6(%rsp),%edx
lea    0xd62(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xd83(%rip),%rdi
call   1050 <puts@plt>
movzwl 0x6(%rsp),%ecx
test   %cx,%cx
jle    1380 <main+0x1d0>
movzwl 0x4(%rsp),%eax
lea    0xd5b(%rip),%r12
xor    %ebx,%ebx
xor    %r13d,%r13d
jmp    1304 <main+0x154>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzwl 0x6(%rsp),%ecx
add    $0x1,%r13d
movswl %cx,%edx
add    $0x2,%ebx
cmp    %edx,%r13d
jge    1380 <main+0x1d0>
test   %ax,%ax
jle    12f5 <main+0x145>
movzwl %ax,%ecx
xor    %r14d,%r14d
jmp    1334 <main+0x184>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzwl 0x4(%rsp),%eax
movswl %ax,%ecx
lea    (%rcx,%rcx,1),%edx
add    $0x2,%r14
cmp    %edx,%r14d
jge    12f0 <main+0x140>
imul   %ebx,%ecx
movslq %ecx,%rax
add    %rbp,%rax
movzbl (%r14,%rax,1),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
movswl 0x4(%rsp),%eax
imul   %ebx,%eax
add    %r14d,%eax
add    $0x1,%eax
cltq
movzbl 0x0(%rbp,%rax,1),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r14d,%eax
not    %eax
test   $0xe,%al
jne    1320 <main+0x170>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1320 <main+0x170>
lea    0xcd2(%rip),%rdi
call   1050 <puts@plt>
mov    %r15d,%edi
call   10a0 <close@plt>
xor    %eax,%eax
jmp    13a9 <main+0x1f9>
lea    0xcbe(%rip),%rdi
call   1050 <puts@plt>
mov    $0xffffffff,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.fb_var_screeninfo = type { i32, i32, i32 }
@.str = [9 x i8] c"/dev/fb0\00"
@O_RDWR = global i32 0
@.str.1 = [22 x i8] c"open /dev/fb0 error!\0A\00"
@FBIOGET_VSCREENINFO = global i32 0
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@.str.2 = [16 x i8] c"mmap fb error!\0A\00"
@.str.3 = [9 x i8] c"test.jpg\00"
@.str.4 = [38 x i8] c"#define IMAGEW %d\0A#define IMAGEH %d\0A\0A\00"
@.str.5 = [25 x i8] c"unsigned char image[]={\0A\00"
@.str.6 = [9 x i8] c"0x%02x ,\00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [5 x i8] c"\0A};\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i16*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.fb_var_screeninfo
%8 = alloca i8*
%9 = alloca i16
%10 = alloca i16
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %1
%13 = load i32, i32* @O_RDWR
%14 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %13)
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %1
br label %120
19: ; preds = %0
%20 = load i32, i32* %2
%21 = load i32, i32* @FBIOGET_VSCREENINFO
%22 = call i32 @ioctl(i32 %20, i32 %21, %struct.fb_var_screeninfo* %7)
%23 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %7, i32 0, i32 0
%24 = load i32, i32* %23
store i32 %24, i32* %4
%25 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %7, i32 0, i32 1
%26 = load i32, i32* %25
store i32 %26, i32* %5
%27 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %7, i32 0, i32 2
%28 = load i32, i32* %27
store i32 %28, i32* %6
%29 = load i32, i32* %4
%30 = load i32, i32* %5
%31 = mul nsw i32 %29, %30
%32 = load i32, i32* %6
%33 = mul nsw i32 %31, %32
%34 = sdiv i32 %33, 8
%35 = load i32, i32* @PROT_READ
%36 = load i32, i32* @PROT_WRITE
%37 = or i32 %35, %36
%38 = load i32, i32* @MAP_SHARED
%39 = load i32, i32* %2
%40 = call i16* @mmap(i32 0, i32 %34, i32 %37, i32 %38, i32 %39, i32 0)
store i16* %40, i16** %3
%41 = load i16*, i16** %3
%42 = icmp ult i16* %41, null
br i1 %42, label %43, label %45
43: ; preds = %19
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
br label %120
45: ; preds = %19
%46 = load i16*, i16** %3
%47 = load i32, i32* %4
%48 = call i32 @fb_pixel(i16* %46, i32 %47, i32 100, i32 200, i32 63488)
%49 = load i16*, i16** %3
%50 = load i32, i32* %4
%51 = call i32 @fb_hline(i16* %49, i32 %50, i32 10, i32 100, i32 200, i32 2016)
%52 = call i8* @decode_jpeg(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i16* %9, i16* %10)
store i8* %52, i8** %8
%53 = load i8*, i8** %8
%54 = load i16, i16* %9
%55 = load i16, i16* %10
%56 = call i32 @buf24_to16(i8* %53, i16 signext %54, i16 signext %55)
%57 = load i16, i16* %9
%58 = sext i16 %57 to i32
%59 = load i16, i16* %10
%60 = sext i16 %59 to i32
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i32 %58, i32 %60)
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %12
br label %63
63: ; preds = %113, %45
%64 = load i32, i32* %12
%65 = load i16, i16* %10
%66 = sext i16 %65 to i32
%67 = icmp slt i32 %64, %66
br i1 %67, label %68, label %116
68: ; preds = %63
store i32 0, i32* %11
br label %69
69: ; preds = %109, %68
%70 = load i32, i32* %11
%71 = load i16, i16* %9
%72 = sext i16 %71 to i32
%73 = mul nsw i32 %72, 2
%74 = icmp slt i32 %70, %73
br i1 %74, label %75, label %112
75: ; preds = %69
%76 = load i8*, i8** %8
%77 = load i32, i32* %11
%78 = load i32, i32* %12
%79 = load i16, i16* %9
%80 = sext i16 %79 to i32
%81 = mul nsw i32 %78, %80
%82 = mul nsw i32 %81, 2
%83 = add nsw i32 %77, %82
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8, i8* %76, i64 %84
%86 = load i8, i8* %85
%87 = zext i8 %86 to i32
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 %87)
%89 = load i8*, i8** %8
%90 = load i32, i32* %11
%91 = load i32, i32* %12
%92 = load i16, i16* %9
%93 = sext i16 %92 to i32
%94 = mul nsw i32 %91, %93
%95 = mul nsw i32 %94, 2
%96 = add nsw i32 %90, %95
%97 = add nsw i32 %96, 1
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds i8, i8* %89, i64 %98
%100 = load i8, i8* %99
%101 = zext i8 %100 to i32
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 %101)
%103 = load i32, i32* %11
%104 = srem i32 %103, 16
%105 = icmp eq i32 %104, 14
br i1 %105, label %106, label %108
106: ; preds = %75
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %108
108: ; preds = %106, %75
br label %109
109: ; preds = %108
%110 = load i32, i32* %11
%111 = add nsw i32 %110, 2
store i32 %111, i32* %11
br label %69
112: ; preds = %69
br label %113
113: ; preds = %112
%114 = load i32, i32* %12
%115 = add nsw i32 %114, 1
store i32 %115, i32* %12
br label %63
116: ; preds = %63
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%118 = load i32, i32* %2
%119 = call i32 @close(i32 %118)
store i32 0, i32* %1
br label %120
120: ; preds = %116, %43, %17
%121 = load i32, i32* %1
ret i32 %121
}

LLVM IR (-O2):
%struct.fb_var_screeninfo = type { i32, i32, i32 }
@.str = [9 x i8] c"/dev/fb0\00"
@O_RDWR = global i32 0
@FBIOGET_VSCREENINFO = global i32 0
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@.str.3 = [9 x i8] c"test.jpg\00"
@.str.4 = [38 x i8] c"#define IMAGEW %d\0A#define IMAGEH %d\0A\0A\00"
@.str.6 = [9 x i8] c"0x%02x ,\00"
@str = [24 x i8] c"unsigned char image[]={\00"
@str.9 = [4 x i8] c"\0A};\00"
@str.10 = [21 x i8] c"open /dev/fb0 error!\00"
define i32 @main() {
%1 = alloca %struct.fb_var_screeninfo
%2 = alloca i16
%3 = alloca i16
%4 = bitcast %struct.fb_var_screeninfo* %1 to i8*
%5 = bitcast i16* %2 to i8*
%6 = bitcast i16* %3 to i8*
%7 = load i32, i32* @O_RDWR
%8 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.10, i64 0, i64 0))
br label %94
12: ; preds = %0
%13 = load i32, i32* @FBIOGET_VSCREENINFO
%14 = call i32 @ioctl(i32 %8, i32 %13, %struct.fb_var_screeninfo* %1)
%15 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %1, i64 0, i32 0
%16 = load i32, i32* %15
%17 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %1, i64 0, i32 1
%18 = load i32, i32* %17
%19 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %1, i64 0, i32 2
%20 = load i32, i32* %19
%21 = mul nsw i32 %18, %16
%22 = mul nsw i32 %21, %20
%23 = sdiv i32 %22, 8
%24 = load i32, i32* @PROT_READ
%25 = load i32, i32* @PROT_WRITE
%26 = or i32 %25, %24
%27 = load i32, i32* @MAP_SHARED
%28 = call i16* @mmap(i32 0, i32 %23, i32 %26, i32 %27, i32 %8, i32 0)
%29 = call i32 @fb_pixel(i16* %28, i32 %16, i32 100, i32 200, i32 63488)
%30 = call i32 @fb_hline(i16* %28, i32 %16, i32 10, i32 100, i32 200, i32 2016)
%31 = call i8* @decode_jpeg(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i16* %2, i16* %3)
%32 = load i16, i16* %2
%33 = load i16, i16* %3
%34 = call i32 @buf24_to16(i8* %31, i16 signext %32, i16 signext %33)
%35 = load i16, i16* %2
%36 = sext i16 %35 to i32
%37 = load i16, i16* %3
%38 = sext i16 %37 to i32
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i32 %36, i32 %38)
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%41 = load i16, i16* %3
%42 = icmp sgt i16 %41, 0
br i1 %42, label %43, label %91
43: ; preds = %12
%44 = load i16, i16* %2
br label %45
45: ; preds = %43, %85
%46 = phi i16 [ %86, %85 ], [ %41, %43 ]
%47 = phi i16 [ %87, %85 ], [ %44, %43 ]
%48 = phi i32 [ %88, %85 ], [ 0, %43 ]
%49 = icmp sgt i16 %47, 0
br i1 %49, label %50, label %85
50: ; preds = %45
%51 = zext i16 %47 to i32
%52 = shl nuw i32 %48, 1
br label %53
53: ; preds = %50, %77
%54 = phi i32 [ %51, %50 ], [ %80, %77 ]
%55 = phi i32 [ 0, %50 ], [ %78, %77 ]
%56 = mul i32 %52, %54
%57 = add nsw i32 %56, %55
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i8, i8* %31, i64 %58
%60 = load i8, i8* %59
%61 = zext i8 %60 to i32
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 %61)
%63 = load i16, i16* %2
%64 = sext i16 %63 to i32
%65 = mul i32 %52, %64
%66 = add nsw i32 %65, %55
%67 = or i32 %66, 1
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i8, i8* %31, i64 %68
%70 = load i8, i8* %69
%71 = zext i8 %70 to i32
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 %71)
%73 = and i32 %55, 14
%74 = icmp eq i32 %73, 14
br i1 %74, label %75, label %77
75: ; preds = %53
%76 = call i32 @putchar(i32 10)
br label %77
77: ; preds = %53, %75
%78 = add nuw nsw i32 %55, 2
%79 = load i16, i16* %2
%80 = sext i16 %79 to i32
%81 = shl nsw i32 %80, 1
%82 = icmp slt i32 %78, %81
br i1 %82, label %53, label %83
83: ; preds = %77
%84 = load i16, i16* %3
br label %85
85: ; preds = %83, %45
%86 = phi i16 [ %84, %83 ], [ %46, %45 ]
%87 = phi i16 [ %79, %83 ], [ %47, %45 ]
%88 = add nuw nsw i32 %48, 1
%89 = sext i16 %86 to i32
%90 = icmp slt i32 %88, %89
br i1 %90, label %45, label %91
91: ; preds = %85, %12
%92 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.9, i64 0, i64 0))
%93 = call i32 @close(i32 %8)
br label %94
94: ; preds = %91, %10
%95 = phi i32 [ -1, %10 ], [ 0, %91 ]
ret i32 %95
}