#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 *GrOffScreen8BPPColorTranslate(void *, unsigned int);
void GrOffScreen8BPPPixelDrawMultiple(void *pvDisplayData, int lX, int lY,
                                      int lX0, int lCount, int lBPP,
                                      const unsigned char *pucData,
                                      const unsigned char *pucPalette) {
  unsigned char *pucPtr;
  unsigned int ulByte;
  ;
  ;
  ;
  pucPtr = (unsigned char *)pvDisplayData;
  pucPtr += (*(unsigned short *)(pucPtr + 1) * lY) + lX + 6 + (256 * 3);
  switch (lBPP) {
  case 1: {
    while (lCount) {
      ulByte = *pucData++;
      for (; (lX0 < 8) && lCount; lX0++, lCount--) {
        *pucPtr++ = (((unsigned int *)pucPalette)[(ulByte >> (7 - lX0)) & 1]);
      }
      lX0 = 0;
    }
    break;
  }
  case 4: {
    switch (lX0 & 1) {
    case 0:
      while (lCount) {
        ulByte = (*pucData >> 4) * 3;
        ulByte = (*(unsigned int *)(pucPalette + ulByte) & 0x00ffffff);
        *pucPtr++ = GrOffScreen8BPPColorTranslate(pvDisplayData, ulByte);
        lCount--;
        if (lCount) {
        case 1:
          ulByte = (*pucData++ & 15) * 3;
          ulByte = (*(unsigned int *)(pucPalette + ulByte) & 0x00ffffff);
          *pucPtr++ = GrOffScreen8BPPColorTranslate(pvDisplayData, ulByte);
          lCount--;
        }
      }
    }
    break;
  }
  case 8: {
    while (lCount--) {
      ulByte = *pucData++ * 3;
      ulByte = *(unsigned int *)(pucPalette + ulByte) & 0x00ffffff;
      *pucPtr++ = GrOffScreen8BPPColorTranslate(pvDisplayData, ulByte);
    }
    break;
  }
  }
}


x86 assembly (clang, -O0):
<GrOffScreen8BPPPixelDrawMultiple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
movzwl 0x1(%rcx),%eax
mov    -0x10(%rbp),%edx
imul   %edx,%eax
mov    -0xc(%rbp),%edx
add    %edx,%eax
cltq
lea    0x306(%rax,%rcx,1),%rax
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x30(%rbp)
sub    $0x1,%eax
je     1194 <GrOffScreen8BPPPixelDrawMultiple+0x84>
jmp    1172 <GrOffScreen8BPPPixelDrawMultiple+0x62>
mov    -0x30(%rbp),%eax
sub    $0x4,%eax
je     1237 <GrOffScreen8BPPPixelDrawMultiple+0x127>
jmp    1183 <GrOffScreen8BPPPixelDrawMultiple+0x73>
mov    -0x30(%rbp),%eax
sub    $0x8,%eax
je     1328 <GrOffScreen8BPPPixelDrawMultiple+0x218>
jmp    1394 <GrOffScreen8BPPPixelDrawMultiple+0x284>
jmp    1199 <GrOffScreen8BPPPixelDrawMultiple+0x89>
cmpl   $0x0,-0x18(%rbp)
je     1232 <GrOffScreen8BPPPixelDrawMultiple+0x122>
mov    0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,0x10(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x2c(%rbp)
xor    %eax,%eax
cmpl   $0x8,-0x14(%rbp)
mov    %al,-0x31(%rbp)
jge    11d1 <GrOffScreen8BPPPixelDrawMultiple+0xc1>
cmpl   $0x0,-0x18(%rbp)
setne  %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
test   $0x1,%al
jne    11e1 <GrOffScreen8BPPPixelDrawMultiple+0xd1>
jmp    1226 <GrOffScreen8BPPPixelDrawMultiple+0x116>
mov    0x18(%rbp),%rax
mov    -0x2c(%rbp),%edx
mov    $0x7,%ecx
sub    -0x14(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
and    $0x1,%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,4),%eax
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    11b8 <GrOffScreen8BPPPixelDrawMultiple+0xa8>
movl   $0x0,-0x14(%rbp)
jmp    1199 <GrOffScreen8BPPPixelDrawMultiple+0x89>
jmp    1394 <GrOffScreen8BPPPixelDrawMultiple+0x284>
mov    -0x14(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x38(%rbp)
je     125c <GrOffScreen8BPPPixelDrawMultiple+0x14c>
jmp    124b <GrOffScreen8BPPPixelDrawMultiple+0x13b>
mov    -0x38(%rbp),%eax
sub    $0x1,%eax
je     12c4 <GrOffScreen8BPPPixelDrawMultiple+0x1b4>
jmp    1323 <GrOffScreen8BPPPixelDrawMultiple+0x213>
jmp    1261 <GrOffScreen8BPPPixelDrawMultiple+0x151>
cmpl   $0x0,-0x18(%rbp)
je     131e <GrOffScreen8BPPPixelDrawMultiple+0x20e>
mov    0x10(%rbp),%rax
movzbl (%rax),%eax
sar    $0x4,%eax
imul   $0x3,%eax,%eax
mov    %eax,-0x2c(%rbp)
mov    0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    (%rax,%rcx,1),%eax
and    $0xffffff,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   1030 <GrOffScreen8BPPColorTranslate@plt>
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1319 <GrOffScreen8BPPPixelDrawMultiple+0x209>
jmp    12c4 <GrOffScreen8BPPPixelDrawMultiple+0x1b4>
mov    0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,0x10(%rbp)
movzbl (%rax),%eax
and    $0xf,%eax
imul   $0x3,%eax,%eax
mov    %eax,-0x2c(%rbp)
mov    0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    (%rax,%rcx,1),%eax
and    $0xffffff,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   1030 <GrOffScreen8BPPColorTranslate@plt>
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1261 <GrOffScreen8BPPPixelDrawMultiple+0x151>
jmp    1323 <GrOffScreen8BPPPixelDrawMultiple+0x213>
jmp    1394 <GrOffScreen8BPPPixelDrawMultiple+0x284>
jmp    132d <GrOffScreen8BPPPixelDrawMultiple+0x21d>
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0x0,%eax
je     138f <GrOffScreen8BPPPixelDrawMultiple+0x27f>
mov    0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,0x10(%rbp)
movzbl (%rax),%eax
imul   $0x3,%eax,%eax
mov    %eax,-0x2c(%rbp)
mov    0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    (%rax,%rcx,1),%eax
and    $0xffffff,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   1030 <GrOffScreen8BPPColorTranslate@plt>
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %cl,(%rax)
jmp    132d <GrOffScreen8BPPPixelDrawMultiple+0x21d>
jmp    1394 <GrOffScreen8BPPPixelDrawMultiple+0x284>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GrOffScreen8BPPPixelDrawMultiple>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8d,%ebx
mov    0x48(%rsp),%r15
mov    0x40(%rsp),%r12
movzwl 0x1(%rdi),%eax
imul   %edx,%eax
add    %esi,%eax
add    $0x306,%eax
movslq %eax,%r13
add    %rdi,%r13
cmp    $0x1,%r9d
je     118b <GrOffScreen8BPPPixelDrawMultiple+0x7b>
mov    %rdi,%r14
cmp    $0x4,%r9d
je     11f1 <GrOffScreen8BPPPixelDrawMultiple+0xe1>
cmp    $0x8,%r9d
jne    118f <GrOffScreen8BPPPixelDrawMultiple+0x7f>
test   %ebx,%ebx
je     118f <GrOffScreen8BPPPixelDrawMultiple+0x7f>
mov    %ebx,%ebx
xor    %ebp,%ebp
nopl   (%rax)
movzbl (%r12,%rbp,1),%eax
lea    (%rax,%rax,2),%rax
mov    (%r15,%rax,1),%esi
mov    $0xffffff,%eax
and    %eax,%esi
mov    %r14,%rdi
call   1030 <GrOffScreen8BPPColorTranslate@plt>
mov    %al,0x0(%r13,%rbp,1)
add    $0x1,%rbp
cmp    %ebp,%ebx
jne    1160 <GrOffScreen8BPPPixelDrawMultiple+0x50>
jmp    118f <GrOffScreen8BPPPixelDrawMultiple+0x7f>
test   %ebx,%ebx
jne    11aa <GrOffScreen8BPPPixelDrawMultiple+0x9a>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xchg   %ax,%ax
mov    %ebx,%esi
xor    %ecx,%ecx
mov    %esi,%ebx
test   %esi,%esi
je     118f <GrOffScreen8BPPPixelDrawMultiple+0x7f>
movzbl (%r12),%edx
add    $0x1,%r12
cmp    $0x7,%ecx
jg     11a0 <GrOffScreen8BPPPixelDrawMultiple+0x90>
mov    $0x7,%eax
sub    %ecx,%eax
nop
mov    %ecx,%edi
mov    %rdx,%rsi
mov    %eax,%ecx
shr    %cl,%rsi
and    $0x1,%esi
movzbl (%r15,%rsi,4),%ecx
mov    %cl,0x0(%r13)
add    $0x1,%r13
lea    0x1(%rdi),%ecx
lea    -0x1(%rbx),%esi
add    $0xffffffff,%eax
cmp    $0x6,%edi
jg     11a2 <GrOffScreen8BPPPixelDrawMultiple+0x92>
cmp    $0x1,%ebx
mov    %esi,%ebx
jne    11c0 <GrOffScreen8BPPPixelDrawMultiple+0xb0>
jmp    11a2 <GrOffScreen8BPPPixelDrawMultiple+0x92>
test   $0x1,%cl
jne    1238 <GrOffScreen8BPPPixelDrawMultiple+0x128>
mov    %ebx,%ebp
nopl   0x0(%rax,%rax,1)
test   %ebp,%ebp
je     118f <GrOffScreen8BPPPixelDrawMultiple+0x7f>
movzbl (%r12),%eax
shr    $0x4,%rax
lea    (%rax,%rax,2),%rax
mov    (%r15,%rax,1),%esi
mov    $0xffffff,%eax
and    %eax,%esi
mov    %r14,%rdi
call   1030 <GrOffScreen8BPPColorTranslate@plt>
mov    %al,0x0(%r13)
add    $0x1,%r13
mov    %ebp,%ebx
mov    $0x0,%ebp
add    $0xffffffff,%ebx
je     1200 <GrOffScreen8BPPPixelDrawMultiple+0xf0>
movzbl (%r12),%eax
add    $0x1,%r12
and    $0xf,%eax
lea    (%rax,%rax,2),%rax
mov    $0xffffff,%esi
and    (%r15,%rax,1),%esi
mov    %r14,%rdi
call   1030 <GrOffScreen8BPPColorTranslate@plt>
mov    %al,0x0(%r13)
add    $0x1,%r13
add    $0xffffffff,%ebx
jmp    11f6 <GrOffScreen8BPPPixelDrawMultiple+0xe6>

LLVM IR (-O0):
define void @GrOffScreen8BPPPixelDrawMultiple(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6, i8* %7) {
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i32
store i8* %0, i8** %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i8* %6, i8** %15
store i8* %7, i8** %16
%19 = load i8*, i8** %9
store i8* %19, i8** %17
%20 = load i8*, i8** %17
%21 = getelementptr inbounds i8, i8* %20, i64 1
%22 = bitcast i8* %21 to i16*
%23 = load i16, i16* %22
%24 = zext i16 %23 to i32
%25 = load i32, i32* %11
%26 = mul nsw i32 %24, %25
%27 = load i32, i32* %10
%28 = add nsw i32 %26, %27
%29 = add nsw i32 %28, 6
%30 = add nsw i32 %29, 768
%31 = load i8*, i8** %17
%32 = sext i32 %30 to i64
%33 = getelementptr inbounds i8, i8* %31, i64 %32
store i8* %33, i8** %17
%34 = load i32, i32* %14
switch i32 %34, label %154 [
i32 1, label %35
i32 4, label %73
i32 8, label %129
]
35: ; preds = %8
br label %36
36: ; preds = %71, %35
%37 = load i32, i32* %13
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %72
39: ; preds = %36
%40 = load i8*, i8** %15
%41 = getelementptr inbounds i8, i8* %40, i32 1
store i8* %41, i8** %15
%42 = load i8, i8* %40
%43 = zext i8 %42 to i32
store i32 %43, i32* %18
br label %44
44: ; preds = %66, %39
%45 = load i32, i32* %12
%46 = icmp slt i32 %45, 8
br i1 %46, label %47, label %50
47: ; preds = %44
%48 = load i32, i32* %13
%49 = icmp ne i32 %48, 0
br label %50
50: ; preds = %47, %44
%51 = phi i1 [ false, %44 ], [ %49, %47 ]
br i1 %51, label %52, label %71
52: ; preds = %50
%53 = load i8*, i8** %16
%54 = bitcast i8* %53 to i32*
%55 = load i32, i32* %18
%56 = load i32, i32* %12
%57 = sub nsw i32 7, %56
%58 = lshr i32 %55, %57
%59 = and i32 %58, 1
%60 = zext i32 %59 to i64
%61 = getelementptr inbounds i32, i32* %54, i64 %60
%62 = load i32, i32* %61
%63 = trunc i32 %62 to i8
%64 = load i8*, i8** %17
%65 = getelementptr inbounds i8, i8* %64, i32 1
store i8* %65, i8** %17
store i8 %63, i8* %64
br label %66
66: ; preds = %52
%67 = load i32, i32* %12
%68 = add nsw i32 %67, 1
store i32 %68, i32* %12
%69 = load i32, i32* %13
%70 = add nsw i32 %69, -1
store i32 %70, i32* %13
br label %44
71: ; preds = %50
store i32 0, i32* %12
br label %36
72: ; preds = %36
br label %154
73: ; preds = %8
%74 = load i32, i32* %12
%75 = and i32 %74, 1
switch i32 %75, label %128 [
i32 0, label %76
i32 1, label %104
]
76: ; preds = %73
br label %77
77: ; preds = %126, %76
%78 = load i32, i32* %13
%79 = icmp ne i32 %78, 0
br i1 %79, label %80, label %127
80: ; preds = %77
%81 = load i8*, i8** %15
%82 = load i8, i8* %81
%83 = zext i8 %82 to i32
%84 = ashr i32 %83, 4
%85 = mul nsw i32 %84, 3
store i32 %85, i32* %18
%86 = load i8*, i8** %16
%87 = load i32, i32* %18
%88 = zext i32 %87 to i64
%89 = getelementptr inbounds i8, i8* %86, i64 %88
%90 = bitcast i8* %89 to i32*
%91 = load i32, i32* %90
%92 = and i32 %91, 16777215
store i32 %92, i32* %18
%93 = load i8*, i8** %9
%94 = load i32, i32* %18
%95 = call i8* @GrOffScreen8BPPColorTranslate(i8* %93, i32 %94)
%96 = ptrtoint i8* %95 to i8
%97 = load i8*, i8** %17
%98 = getelementptr inbounds i8, i8* %97, i32 1
store i8* %98, i8** %17
store i8 %96, i8* %97
%99 = load i32, i32* %13
%100 = add nsw i32 %99, -1
store i32 %100, i32* %13
%101 = load i32, i32* %13
%102 = icmp ne i32 %101, 0
br i1 %102, label %103, label %126
103: ; preds = %80
br label %104
104: ; preds = %73, %103
%105 = load i8*, i8** %15
%106 = getelementptr inbounds i8, i8* %105, i32 1
store i8* %106, i8** %15
%107 = load i8, i8* %105
%108 = zext i8 %107 to i32
%109 = and i32 %108, 15
%110 = mul nsw i32 %109, 3
store i32 %110, i32* %18
%111 = load i8*, i8** %16
%112 = load i32, i32* %18
%113 = zext i32 %112 to i64
%114 = getelementptr inbounds i8, i8* %111, i64 %113
%115 = bitcast i8* %114 to i32*
%116 = load i32, i32* %115
%117 = and i32 %116, 16777215
store i32 %117, i32* %18
%118 = load i8*, i8** %9
%119 = load i32, i32* %18
%120 = call i8* @GrOffScreen8BPPColorTranslate(i8* %118, i32 %119)
%121 = ptrtoint i8* %120 to i8
%122 = load i8*, i8** %17
%123 = getelementptr inbounds i8, i8* %122, i32 1
store i8* %123, i8** %17
store i8 %121, i8* %122
%124 = load i32, i32* %13
%125 = add nsw i32 %124, -1
store i32 %125, i32* %13
br label %126
126: ; preds = %104, %80
br label %77
127: ; preds = %77
br label %128
128: ; preds = %127, %73
br label %154
129: ; preds = %8
br label %130
130: ; preds = %134, %129
%131 = load i32, i32* %13
%132 = add nsw i32 %131, -1
store i32 %132, i32* %13
%133 = icmp ne i32 %131, 0
br i1 %133, label %134, label %153
134: ; preds = %130
%135 = load i8*, i8** %15
%136 = getelementptr inbounds i8, i8* %135, i32 1
store i8* %136, i8** %15
%137 = load i8, i8* %135
%138 = zext i8 %137 to i32
%139 = mul nsw i32 %138, 3
store i32 %139, i32* %18
%140 = load i8*, i8** %16
%141 = load i32, i32* %18
%142 = zext i32 %141 to i64
%143 = getelementptr inbounds i8, i8* %140, i64 %142
%144 = bitcast i8* %143 to i32*
%145 = load i32, i32* %144
%146 = and i32 %145, 16777215
store i32 %146, i32* %18
%147 = load i8*, i8** %9
%148 = load i32, i32* %18
%149 = call i8* @GrOffScreen8BPPColorTranslate(i8* %147, i32 %148)
%150 = ptrtoint i8* %149 to i8
%151 = load i8*, i8** %17
%152 = getelementptr inbounds i8, i8* %151, i32 1
store i8* %152, i8** %17
store i8 %150, i8* %151
br label %130
153: ; preds = %130
br label %154
154: ; preds = %8, %153, %128, %72
ret void
}

LLVM IR (-O2):
define void @GrOffScreen8BPPPixelDrawMultiple(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* nocapture %6, i8* nocapture %7) {
%9 = getelementptr inbounds i8, i8* %0, i64 1
%10 = bitcast i8* %9 to i16*
%11 = load i16, i16* %10
%12 = zext i16 %11 to i32
%13 = mul nsw i32 %12, %2
%14 = add i32 %1, 774
%15 = add i32 %14, %13
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %0, i64 %16
switch i32 %5, label %116 [
i32 1, label %20
i32 4, label %54
i32 8, label %18
]
18: ; preds = %8
%19 = icmp eq i32 %4, 0
br i1 %19, label %116, label %98
20: ; preds = %8
%21 = icmp eq i32 %4, 0
br i1 %21, label %116, label %22
22: ; preds = %20
%23 = bitcast i8* %7 to i32*
br label %28
24: ; preds = %37, %28
%25 = phi i32 [ %32, %28 ], [ %50, %37 ]
%26 = phi i8* [ %29, %28 ], [ %48, %37 ]
%27 = icmp eq i32 %25, 0
br i1 %27, label %116, label %28
28: ; preds = %22, %24
%29 = phi i8* [ %17, %22 ], [ %26, %24 ]
%30 = phi i32 [ %3, %22 ], [ 0, %24 ]
%31 = phi i8* [ %6, %22 ], [ %33, %24 ]
%32 = phi i32 [ %4, %22 ], [ %25, %24 ]
%33 = getelementptr inbounds i8, i8* %31, i64 1
%34 = load i8, i8* %31
%35 = zext i8 %34 to i32
%36 = icmp slt i32 %30, 8
br i1 %36, label %37, label %24
37: ; preds = %28, %37
%38 = phi i8* [ %48, %37 ], [ %29, %28 ]
%39 = phi i32 [ %49, %37 ], [ %30, %28 ]
%40 = phi i32 [ %50, %37 ], [ %32, %28 ]
%41 = sub nsw i32 7, %39
%42 = lshr i32 %35, %41
%43 = and i32 %42, 1
%44 = zext i32 %43 to i64
%45 = getelementptr inbounds i32, i32* %23, i64 %44
%46 = load i32, i32* %45
%47 = trunc i32 %46 to i8
%48 = getelementptr inbounds i8, i8* %38, i64 1
store i8 %47, i8* %38
%49 = add nsw i32 %39, 1
%50 = add nsw i32 %40, -1
%51 = icmp slt i32 %39, 7
%52 = icmp ne i32 %50, 0
%53 = select i1 %51, i1 %52, i1 false
br i1 %53, label %37, label %24
54: ; preds = %8
%55 = and i32 %3, 1
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %80
57: ; preds = %54, %80
%58 = phi i32 [ %97, %80 ], [ %4, %54 ]
%59 = phi i8* [ %84, %80 ], [ %6, %54 ]
%60 = phi i8* [ %96, %80 ], [ %17, %54 ]
br label %61
61: ; preds = %57, %65
%62 = phi i32 [ 0, %65 ], [ %58, %57 ]
%63 = phi i8* [ %77, %65 ], [ %60, %57 ]
%64 = icmp eq i32 %62, 0
br i1 %64, label %116, label %65
65: ; preds = %61
%66 = load i8, i8* %59
%67 = lshr i8 %66, 4
%68 = mul nuw nsw i8 %67, 3
%69 = zext i8 %68 to i64
%70 = getelementptr inbounds i8, i8* %7, i64 %69
%71 = bitcast i8* %70 to i32*
%72 = load i32, i32* %71
%73 = and i32 %72, 16777215
%74 = tail call i8* @GrOffScreen8BPPColorTranslate(i8* %0, i32 %73)
%75 = ptrtoint i8* %74 to i64
%76 = trunc i64 %75 to i8
%77 = getelementptr inbounds i8, i8* %63, i64 1
store i8 %76, i8* %63
%78 = add nsw i32 %62, -1
%79 = icmp eq i32 %78, 0
br i1 %79, label %61, label %80
80: ; preds = %65, %54
%81 = phi i32 [ %4, %54 ], [ %78, %65 ]
%82 = phi i8* [ %6, %54 ], [ %59, %65 ]
%83 = phi i8* [ %17, %54 ], [ %77, %65 ]
%84 = getelementptr inbounds i8, i8* %82, i64 1
%85 = load i8, i8* %82
%86 = and i8 %85, 15
%87 = mul nuw nsw i8 %86, 3
%88 = zext i8 %87 to i64
%89 = getelementptr inbounds i8, i8* %7, i64 %88
%90 = bitcast i8* %89 to i32*
%91 = load i32, i32* %90
%92 = and i32 %91, 16777215
%93 = tail call i8* @GrOffScreen8BPPColorTranslate(i8* %0, i32 %92)
%94 = ptrtoint i8* %93 to i64
%95 = trunc i64 %94 to i8
%96 = getelementptr inbounds i8, i8* %83, i64 1
store i8 %95, i8* %83
%97 = add nsw i32 %81, -1
br label %57
98: ; preds = %18, %98
%99 = phi i8* [ %114, %98 ], [ %17, %18 ]
%100 = phi i8* [ %103, %98 ], [ %6, %18 ]
%101 = phi i32 [ %102, %98 ], [ %4, %18 ]
%102 = add nsw i32 %101, -1
%103 = getelementptr inbounds i8, i8* %100, i64 1
%104 = load i8, i8* %100
%105 = zext i8 %104 to i64
%106 = mul nuw nsw i64 %105, 3
%107 = getelementptr inbounds i8, i8* %7, i64 %106
%108 = bitcast i8* %107 to i32*
%109 = load i32, i32* %108
%110 = and i32 %109, 16777215
%111 = tail call i8* @GrOffScreen8BPPColorTranslate(i8* %0, i32 %110)
%112 = ptrtoint i8* %111 to i64
%113 = trunc i64 %112 to i8
%114 = getelementptr inbounds i8, i8* %99, i64 1
store i8 %113, i8* %99
%115 = icmp eq i32 %102, 0
br i1 %115, label %116, label %98
116: ; preds = %98, %61, %24, %18, %20, %8
ret void
}