#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 uint8_t;
typedef int uint32_t;
typedef int uint16_t;
typedef int int32_t;

/* Variables and functions */
void *GrOffScreen8BPPColorTranslate(void *, int);
void GrOffScreen8BPPPixelDrawMultiple(void *pvDisplayData, int32_t i32X,
                                      int32_t i32Y, int32_t i32X0,
                                      int32_t i32Count, int32_t i32BPP,
                                      const uint8_t *pui8Data,
                                      const uint8_t *pui8Palette) {
  uint8_t *pui8Ptr;
  uint32_t ui32Byte;
  ;
  ;
  ;
  pui8Ptr = (uint8_t *)pvDisplayData;
  pui8Ptr += (*(uint16_t *)(pui8Ptr + 1) * i32Y) + i32X + 6 + (256 * 3);
  switch (i32BPP & 0xFF) {
  case 1: {
    while (i32Count) {
      ui32Byte = *pui8Data++;
      for (; (i32X0 < 8) && i32Count; i32X0++, i32Count--) {
        *pui8Ptr++ = (((uint32_t *)pui8Palette)[(ui32Byte >> (7 - i32X0)) & 1]);
      }
      i32X0 = 0;
    }
    break;
  }
  case 4: {
    switch (i32X0 & 1) {
    case 0:
      while (i32Count) {
        ui32Byte = (*pui8Data >> 4) * 3;
        ui32Byte = (*(uint32_t *)(pui8Palette + ui32Byte) & 0x00ffffff);
        *pui8Ptr++ = GrOffScreen8BPPColorTranslate(pvDisplayData, ui32Byte);
        i32Count--;
        if (i32Count) {
        case 1:
          ui32Byte = (*pui8Data++ & 15) * 3;
          ui32Byte = (*(uint32_t *)(pui8Palette + ui32Byte) & 0x00ffffff);
          *pui8Ptr++ = GrOffScreen8BPPColorTranslate(pvDisplayData, ui32Byte);
          i32Count--;
        }
      }
    }
    break;
  }
  case 8: {
    while (i32Count--) {
      ui32Byte = *pui8Data++ * 3;
      ui32Byte = *(uint32_t *)(pui8Palette + ui32Byte) & 0x00ffffff;
      *pui8Ptr++ = GrOffScreen8BPPColorTranslate(pvDisplayData, ui32Byte);
    }
    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),%rax
mov    0x4(%rax),%ecx
mov    -0x10(%rbp),%edx
imul   %edx,%ecx
mov    -0xc(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
lea    0xc18(%rax,%rcx,4),%rax
mov    %rax,-0x28(%rbp)
movzbl -0x1c(%rbp),%eax
mov    %eax,-0x30(%rbp)
sub    $0x1,%eax
je     1195 <GrOffScreen8BPPPixelDrawMultiple+0x85>
jmp    1173 <GrOffScreen8BPPPixelDrawMultiple+0x63>
mov    -0x30(%rbp),%eax
sub    $0x4,%eax
je     1236 <GrOffScreen8BPPPixelDrawMultiple+0x126>
jmp    1184 <GrOffScreen8BPPPixelDrawMultiple+0x74>
mov    -0x30(%rbp),%eax
sub    $0x8,%eax
je     1327 <GrOffScreen8BPPPixelDrawMultiple+0x217>
jmp    1391 <GrOffScreen8BPPPixelDrawMultiple+0x281>
jmp    119a <GrOffScreen8BPPPixelDrawMultiple+0x8a>
cmpl   $0x0,-0x18(%rbp)
je     1231 <GrOffScreen8BPPPixelDrawMultiple+0x121>
mov    0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,0x10(%rbp)
mov    (%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    1225 <GrOffScreen8BPPPixelDrawMultiple+0x115>
mov    0x18(%rbp),%rax
mov    -0x2c(%rbp),%edx
mov    $0x7,%ecx
sub    -0x14(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
and    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x28(%rbp)
mov    %ecx,(%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    119a <GrOffScreen8BPPPixelDrawMultiple+0x8a>
jmp    1391 <GrOffScreen8BPPPixelDrawMultiple+0x281>
mov    -0x14(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x38(%rbp)
je     125b <GrOffScreen8BPPPixelDrawMultiple+0x14b>
jmp    124a <GrOffScreen8BPPPixelDrawMultiple+0x13a>
mov    -0x38(%rbp),%eax
sub    $0x1,%eax
je     12c3 <GrOffScreen8BPPPixelDrawMultiple+0x1b3>
jmp    1322 <GrOffScreen8BPPPixelDrawMultiple+0x212>
jmp    1260 <GrOffScreen8BPPPixelDrawMultiple+0x150>
cmpl   $0x0,-0x18(%rbp)
je     131d <GrOffScreen8BPPPixelDrawMultiple+0x20d>
mov    0x10(%rbp),%rax
mov    (%rax),%eax
sar    $0x4,%eax
imul   $0x3,%eax,%eax
mov    %eax,-0x2c(%rbp)
mov    0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
and    $0xffffff,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   1030 <GrOffScreen8BPPColorTranslate@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x28(%rbp)
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1318 <GrOffScreen8BPPPixelDrawMultiple+0x208>
jmp    12c3 <GrOffScreen8BPPPixelDrawMultiple+0x1b3>
mov    0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,0x10(%rbp)
mov    (%rax),%eax
and    $0xf,%eax
imul   $0x3,%eax,%eax
mov    %eax,-0x2c(%rbp)
mov    0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
and    $0xffffff,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   1030 <GrOffScreen8BPPColorTranslate@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x28(%rbp)
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1260 <GrOffScreen8BPPPixelDrawMultiple+0x150>
jmp    1322 <GrOffScreen8BPPPixelDrawMultiple+0x212>
jmp    1391 <GrOffScreen8BPPPixelDrawMultiple+0x281>
jmp    132c <GrOffScreen8BPPPixelDrawMultiple+0x21c>
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0x0,%eax
je     138c <GrOffScreen8BPPPixelDrawMultiple+0x27c>
mov    0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,0x10(%rbp)
imul   $0x3,(%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
and    $0xffffff,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   1030 <GrOffScreen8BPPColorTranslate@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x28(%rbp)
mov    %ecx,(%rax)
jmp    132c <GrOffScreen8BPPPixelDrawMultiple+0x21c>
jmp    1391 <GrOffScreen8BPPPixelDrawMultiple+0x281>
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,%r13d
mov    0x48(%rsp),%r15
mov    0x40(%rsp),%r12
imul   0x4(%rdi),%edx
lea    (%rsi,%rdx,1),%eax
add    $0x306,%eax
cltq
lea    (%rdi,%rax,4),%rbx
cmp    $0x1,%r9b
je     1196 <GrOffScreen8BPPPixelDrawMultiple+0x86>
cmp    $0x4,%r9b
mov    %rdi,(%rsp)
je     1201 <GrOffScreen8BPPPixelDrawMultiple+0xf1>
cmp    $0x8,%r9b
jne    119b <GrOffScreen8BPPPixelDrawMultiple+0x8b>
test   %r13d,%r13d
je     119b <GrOffScreen8BPPPixelDrawMultiple+0x8b>
lea    (%rdi,%rax,4),%r14
mov    %r13d,%ebp
xor    %ebx,%ebx
mov    $0xffffff,%r13d
nopl   0x0(%rax,%rax,1)
movslq (%r12,%rbx,4),%rax
lea    (%rax,%rax,2),%rax
mov    (%r15,%rax,4),%esi
and    %r13d,%esi
mov    (%rsp),%rdi
call   1030 <GrOffScreen8BPPColorTranslate@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %ebx,%ebp
jne    1170 <GrOffScreen8BPPPixelDrawMultiple+0x60>
jmp    119b <GrOffScreen8BPPPixelDrawMultiple+0x8b>
test   %r13d,%r13d
jne    11bc <GrOffScreen8BPPPixelDrawMultiple+0xac>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
nopw   0x0(%rax,%rax,1)
mov    %r13d,%esi
xor    %ecx,%ecx
mov    %esi,%r13d
test   %esi,%esi
je     119b <GrOffScreen8BPPPixelDrawMultiple+0x8b>
mov    (%r12),%edx
add    $0x4,%r12
cmp    $0x7,%ecx
jg     11b0 <GrOffScreen8BPPPixelDrawMultiple+0xa0>
mov    $0x7,%eax
sub    %ecx,%eax
mov    %ecx,%edi
mov    %rdx,%rsi
mov    %eax,%ecx
shr    %cl,%rsi
and    $0x1,%esi
mov    (%r15,%rsi,4),%ecx
mov    %ecx,(%rbx)
add    $0x4,%rbx
lea    0x1(%rdi),%ecx
lea    -0x1(%r13),%esi
add    $0xffffffff,%eax
cmp    $0x6,%edi
jg     11b3 <GrOffScreen8BPPPixelDrawMultiple+0xa3>
cmp    $0x1,%r13d
mov    %esi,%r13d
jne    11d0 <GrOffScreen8BPPPixelDrawMultiple+0xc0>
jmp    11b3 <GrOffScreen8BPPPixelDrawMultiple+0xa3>
test   $0x1,%cl
jne    1244 <GrOffScreen8BPPPixelDrawMultiple+0x134>
mov    $0xffffff,%r14d
mov    %r13d,%ebp
nop
test   %ebp,%ebp
je     119b <GrOffScreen8BPPPixelDrawMultiple+0x8b>
mov    (%r12),%eax
sar    $0x4,%eax
lea    (%rax,%rax,2),%eax
cltq
mov    (%r15,%rax,4),%esi
and    %r14d,%esi
mov    (%rsp),%rdi
call   1030 <GrOffScreen8BPPColorTranslate@plt>
mov    %eax,(%rbx)
add    $0x4,%rbx
mov    %ebp,%r13d
mov    $0x0,%ebp
add    $0xffffffff,%r13d
je     1210 <GrOffScreen8BPPPixelDrawMultiple+0x100>
mov    (%r12),%eax
add    $0x4,%r12
and    $0xf,%eax
lea    (%rax,%rax,2),%rax
mov    $0xffffff,%esi
and    (%r15,%rax,4),%esi
mov    (%rsp),%rdi
call   1030 <GrOffScreen8BPPColorTranslate@plt>
mov    %eax,(%rbx)
add    $0x4,%rbx
add    $0xffffffff,%r13d
jmp    1206 <GrOffScreen8BPPPixelDrawMultiple+0xf6>

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

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