#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 */
int /*<<< orphan*/ pfan_draw_point(unsigned char, unsigned char,
                                   unsigned short *);
void pfan_draw_image(unsigned char *raster, unsigned short display[156]) {
  for (unsigned char i = 0; i < 156; ++i) {
    for (unsigned char j = 0; j < 11; ++j) {
      if (raster[j * 156 + i] == 1) {
        pfan_draw_point(i, j, display);
      }
    }
  }
}


x86 assembly (clang, -O0):
<pfan_draw_image>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
cmp    $0x9c,%eax
jge    11a1 <pfan_draw_image+0x91>
movb   $0x0,-0x12(%rbp)
movzbl -0x12(%rbp),%eax
cmp    $0xb,%eax
jge    118f <pfan_draw_image+0x7f>
mov    -0x8(%rbp),%rax
movzbl -0x12(%rbp),%ecx
imul   $0x9c,%ecx,%ecx
movzbl -0x11(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x1,%eax
jne    117d <pfan_draw_image+0x6d>
mov    -0x11(%rbp),%cl
mov    -0x12(%rbp),%al
mov    -0x10(%rbp),%rdx
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <pfan_draw_point@plt>
jmp    1182 <pfan_draw_image+0x72>
mov    -0x12(%rbp),%al
add    $0x1,%al
mov    %al,-0x12(%rbp)
jmp    1137 <pfan_draw_image+0x27>
jmp    1194 <pfan_draw_image+0x84>
mov    -0x11(%rbp),%al
add    $0x1,%al
mov    %al,-0x11(%rbp)
jmp    1124 <pfan_draw_image+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pfan_draw_image>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
jmp    1131 <pfan_draw_image+0x21>
nop
add    $0x1,%rbx
cmp    $0x9c,%rbx
je     1328 <pfan_draw_image+0x218>
cmpb   $0x1,(%r15,%rbx,1)
je     11e0 <pfan_draw_image+0xd0>
cmpb   $0x1,0x9c(%r15,%rbx,1)
je     11fc <pfan_draw_image+0xec>
cmpb   $0x1,0x138(%r15,%rbx,1)
je     121b <pfan_draw_image+0x10b>
cmpb   $0x1,0x1d4(%r15,%rbx,1)
je     123a <pfan_draw_image+0x12a>
cmpb   $0x1,0x270(%r15,%rbx,1)
je     1259 <pfan_draw_image+0x149>
cmpb   $0x1,0x30c(%r15,%rbx,1)
je     1278 <pfan_draw_image+0x168>
cmpb   $0x1,0x3a8(%r15,%rbx,1)
je     1297 <pfan_draw_image+0x187>
cmpb   $0x1,0x444(%r15,%rbx,1)
je     12b6 <pfan_draw_image+0x1a6>
cmpb   $0x1,0x4e0(%r15,%rbx,1)
je     12d5 <pfan_draw_image+0x1c5>
cmpb   $0x1,0x57c(%r15,%rbx,1)
je     12f4 <pfan_draw_image+0x1e4>
cmpb   $0x1,0x618(%r15,%rbx,1)
jne    1120 <pfan_draw_image+0x10>
jmp    1313 <pfan_draw_image+0x203>
nopw   0x0(%rax,%rax,1)
movzbl %bl,%edi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <pfan_draw_point@plt>
cmpb   $0x1,0x9c(%r15,%rbx,1)
jne    114b <pfan_draw_image+0x3b>
movzbl %bl,%edi
mov    $0x1,%esi
mov    %r14,%rdx
call   1030 <pfan_draw_point@plt>
cmpb   $0x1,0x138(%r15,%rbx,1)
jne    115a <pfan_draw_image+0x4a>
movzbl %bl,%edi
mov    $0x2,%esi
mov    %r14,%rdx
call   1030 <pfan_draw_point@plt>
cmpb   $0x1,0x1d4(%r15,%rbx,1)
jne    1169 <pfan_draw_image+0x59>
movzbl %bl,%edi
mov    $0x3,%esi
mov    %r14,%rdx
call   1030 <pfan_draw_point@plt>
cmpb   $0x1,0x270(%r15,%rbx,1)
jne    1178 <pfan_draw_image+0x68>
movzbl %bl,%edi
mov    $0x4,%esi
mov    %r14,%rdx
call   1030 <pfan_draw_point@plt>
cmpb   $0x1,0x30c(%r15,%rbx,1)
jne    1187 <pfan_draw_image+0x77>
movzbl %bl,%edi
mov    $0x5,%esi
mov    %r14,%rdx
call   1030 <pfan_draw_point@plt>
cmpb   $0x1,0x3a8(%r15,%rbx,1)
jne    1196 <pfan_draw_image+0x86>
movzbl %bl,%edi
mov    $0x6,%esi
mov    %r14,%rdx
call   1030 <pfan_draw_point@plt>
cmpb   $0x1,0x444(%r15,%rbx,1)
jne    11a5 <pfan_draw_image+0x95>
movzbl %bl,%edi
mov    $0x7,%esi
mov    %r14,%rdx
call   1030 <pfan_draw_point@plt>
cmpb   $0x1,0x4e0(%r15,%rbx,1)
jne    11b4 <pfan_draw_image+0xa4>
movzbl %bl,%edi
mov    $0x8,%esi
mov    %r14,%rdx
call   1030 <pfan_draw_point@plt>
cmpb   $0x1,0x57c(%r15,%rbx,1)
jne    11c3 <pfan_draw_image+0xb3>
movzbl %bl,%edi
mov    $0x9,%esi
mov    %r14,%rdx
call   1030 <pfan_draw_point@plt>
cmpb   $0x1,0x618(%r15,%rbx,1)
jne    1120 <pfan_draw_image+0x10>
movzbl %bl,%edi
mov    $0xa,%esi
mov    %r14,%rdx
call   1030 <pfan_draw_point@plt>
jmp    1120 <pfan_draw_image+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @pfan_draw_image(i8* %0, i16* %1) {
%3 = alloca i8*
%4 = alloca i16*
%5 = alloca i8
%6 = alloca i8
store i8* %0, i8** %3
store i16* %1, i16** %4
store i8 0, i8* %5
br label %7
7: ; preds = %39, %2
%8 = load i8, i8* %5
%9 = zext i8 %8 to i32
%10 = icmp slt i32 %9, 156
br i1 %10, label %11, label %42
11: ; preds = %7
store i8 0, i8* %6
br label %12
12: ; preds = %35, %11
%13 = load i8, i8* %6
%14 = zext i8 %13 to i32
%15 = icmp slt i32 %14, 11
br i1 %15, label %16, label %38
16: ; preds = %12
%17 = load i8*, i8** %3
%18 = load i8, i8* %6
%19 = zext i8 %18 to i32
%20 = mul nsw i32 %19, 156
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = add nsw i32 %20, %22
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %17, i64 %24
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = icmp eq i32 %27, 1
br i1 %28, label %29, label %34
29: ; preds = %16
%30 = load i8, i8* %5
%31 = load i8, i8* %6
%32 = load i16*, i16** %4
%33 = call i32 @pfan_draw_point(i8 zeroext %30, i8 zeroext %31, i16* %32)
br label %34
34: ; preds = %29, %16
br label %35
35: ; preds = %34
%36 = load i8, i8* %6
%37 = add i8 %36, 1
store i8 %37, i8* %6
br label %12
38: ; preds = %12
br label %39
39: ; preds = %38
%40 = load i8, i8* %5
%41 = add i8 %40, 1
store i8 %41, i8* %5
br label %7
42: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @pfan_draw_image(i8* nocapture %0, i16* %1) {
br label %3
3: ; preds = %2, %92
%4 = phi i64 [ 0, %2 ], [ %93, %92 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 1
br i1 %7, label %9, label %12
8: ; preds = %92
ret void
9: ; preds = %3
%10 = trunc i64 %4 to i8
%11 = tail call i32 @pfan_draw_point(i8 zeroext %10, i8 zeroext 0, i16* %1)
br label %12
12: ; preds = %3, %9
%13 = add nuw nsw i64 %4, 156
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 1
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = trunc i64 %4 to i8
%19 = tail call i32 @pfan_draw_point(i8 zeroext %18, i8 zeroext 1, i16* %1)
br label %20
20: ; preds = %17, %12
%21 = add nuw nsw i64 %4, 312
%22 = getelementptr inbounds i8, i8* %0, i64 %21
%23 = load i8, i8* %22
%24 = icmp eq i8 %23, 1
br i1 %24, label %25, label %28
25: ; preds = %20
%26 = trunc i64 %4 to i8
%27 = tail call i32 @pfan_draw_point(i8 zeroext %26, i8 zeroext 2, i16* %1)
br label %28
28: ; preds = %25, %20
%29 = add nuw nsw i64 %4, 468
%30 = getelementptr inbounds i8, i8* %0, i64 %29
%31 = load i8, i8* %30
%32 = icmp eq i8 %31, 1
br i1 %32, label %33, label %36
33: ; preds = %28
%34 = trunc i64 %4 to i8
%35 = tail call i32 @pfan_draw_point(i8 zeroext %34, i8 zeroext 3, i16* %1)
br label %36
36: ; preds = %33, %28
%37 = add nuw nsw i64 %4, 624
%38 = getelementptr inbounds i8, i8* %0, i64 %37
%39 = load i8, i8* %38
%40 = icmp eq i8 %39, 1
br i1 %40, label %41, label %44
41: ; preds = %36
%42 = trunc i64 %4 to i8
%43 = tail call i32 @pfan_draw_point(i8 zeroext %42, i8 zeroext 4, i16* %1)
br label %44
44: ; preds = %41, %36
%45 = add nuw nsw i64 %4, 780
%46 = getelementptr inbounds i8, i8* %0, i64 %45
%47 = load i8, i8* %46
%48 = icmp eq i8 %47, 1
br i1 %48, label %49, label %52
49: ; preds = %44
%50 = trunc i64 %4 to i8
%51 = tail call i32 @pfan_draw_point(i8 zeroext %50, i8 zeroext 5, i16* %1)
br label %52
52: ; preds = %49, %44
%53 = add nuw nsw i64 %4, 936
%54 = getelementptr inbounds i8, i8* %0, i64 %53
%55 = load i8, i8* %54
%56 = icmp eq i8 %55, 1
br i1 %56, label %57, label %60
57: ; preds = %52
%58 = trunc i64 %4 to i8
%59 = tail call i32 @pfan_draw_point(i8 zeroext %58, i8 zeroext 6, i16* %1)
br label %60
60: ; preds = %57, %52
%61 = add nuw nsw i64 %4, 1092
%62 = getelementptr inbounds i8, i8* %0, i64 %61
%63 = load i8, i8* %62
%64 = icmp eq i8 %63, 1
br i1 %64, label %65, label %68
65: ; preds = %60
%66 = trunc i64 %4 to i8
%67 = tail call i32 @pfan_draw_point(i8 zeroext %66, i8 zeroext 7, i16* %1)
br label %68
68: ; preds = %65, %60
%69 = add nuw nsw i64 %4, 1248
%70 = getelementptr inbounds i8, i8* %0, i64 %69
%71 = load i8, i8* %70
%72 = icmp eq i8 %71, 1
br i1 %72, label %73, label %76
73: ; preds = %68
%74 = trunc i64 %4 to i8
%75 = tail call i32 @pfan_draw_point(i8 zeroext %74, i8 zeroext 8, i16* %1)
br label %76
76: ; preds = %73, %68
%77 = add nuw nsw i64 %4, 1404
%78 = getelementptr inbounds i8, i8* %0, i64 %77
%79 = load i8, i8* %78
%80 = icmp eq i8 %79, 1
br i1 %80, label %81, label %84
81: ; preds = %76
%82 = trunc i64 %4 to i8
%83 = tail call i32 @pfan_draw_point(i8 zeroext %82, i8 zeroext 9, i16* %1)
br label %84
84: ; preds = %81, %76
%85 = add nuw nsw i64 %4, 1560
%86 = getelementptr inbounds i8, i8* %0, i64 %85
%87 = load i8, i8* %86
%88 = icmp eq i8 %87, 1
br i1 %88, label %89, label %92
89: ; preds = %84
%90 = trunc i64 %4 to i8
%91 = tail call i32 @pfan_draw_point(i8 zeroext %90, i8 zeroext 10, i16* %1)
br label %92
92: ; preds = %89, %84
%93 = add nuw nsw i64 %4, 1
%94 = icmp eq i64 %93, 156
br i1 %94, label %8, label %3
}