void init_mouse_cursor8(char *mouse, char bg_color) {
  static char s_cursor[16][16] = {
      "**************..", "*ooooooooooo*...", "*oooooooooo*....",
      "*ooooooooo*.....", "*oooooooo*......", "*ooooooo*.......",
      "*ooooooo*.......", "*oooooooo*......", "*oooo**ooo*.....",
      "*ooo*..*ooo*....", "*oo*....*ooo*...", "*o*......*ooo*..",
      "**........*ooo*.", "*..........*ooo*", "............*oo*",
      ".............***",
  };
  int x, y;
  for (y = 0; y < 16; ++y) {
    for (x = 0; x < 16; ++x) {
      switch (s_cursor[y][x]) {
      case '*':
        mouse[y * 16 + x] = (0);
        break;
      case 'o':
        mouse[y * 16 + x] = (7);
        break;
      case '.':
        mouse[y * 16 + x] = bg_color;
        break;
      }
    }
  }
}


x86 assembly (clang, -O0):
<init_mouse_cursor8>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    11eb <init_mouse_cursor8+0xeb>
movl   $0x0,-0x10(%rbp)
cmpl   $0x10,-0x10(%rbp)
jge    11d8 <init_mouse_cursor8+0xd8>
movslq -0x14(%rbp),%rax
shl    $0x4,%rax
lea    0x2ef1(%rip),%rcx
add    %rax,%rcx
movslq -0x10(%rbp),%rax
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x18(%rbp)
sub    $0x2a,%eax
je     117d <init_mouse_cursor8+0x7d>
jmp    115b <init_mouse_cursor8+0x5b>
mov    -0x18(%rbp),%eax
sub    $0x2e,%eax
je     11af <init_mouse_cursor8+0xaf>
jmp    116c <init_mouse_cursor8+0x6c>
mov    -0x18(%rbp),%eax
sub    $0x6f,%eax
je     1196 <init_mouse_cursor8+0x96>
jmp    11c5 <init_mouse_cursor8+0xc5>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x4,%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    11c5 <init_mouse_cursor8+0xc5>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x4,%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x7,(%rax,%rcx,1)
jmp    11c5 <init_mouse_cursor8+0xc5>
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x4,%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    11ca <init_mouse_cursor8+0xca>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <init_mouse_cursor8+0x26>
jmp    11dd <init_mouse_cursor8+0xdd>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <init_mouse_cursor8+0x15>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_mouse_cursor8>:
add    $0x1,%rdi
lea    0xef6(%rip),%r9
xor    %r8d,%r8d
jmp    1122 <init_mouse_cursor8+0x22>
add    $0x1,%r8
add    $0x10,%r9
add    $0x10,%rdi
cmp    $0x10,%r8
je     1194 <init_mouse_cursor8+0x94>
xor    %edx,%edx
jmp    113f <init_mouse_cursor8+0x3f>
cs nopw 0x0(%rax,%rax,1)
mov    $0x7,%cl
mov    %cl,(%rdi,%rdx,1)
add    $0x2,%rdx
cmp    $0x10,%rdx
je     1110 <init_mouse_cursor8+0x10>
movsbl -0x1(%r9,%rdx,1),%eax
cmp    $0x2a,%eax
je     1170 <init_mouse_cursor8+0x70>
cmp    $0x2e,%eax
je     1160 <init_mouse_cursor8+0x60>
cmp    $0x6f,%eax
jne    1176 <init_mouse_cursor8+0x76>
mov    $0x7,%cl
jmp    1172 <init_mouse_cursor8+0x72>
nopl   0x0(%rax,%rax,1)
mov    %esi,%ecx
jmp    1172 <init_mouse_cursor8+0x72>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %ecx,%ecx
mov    %cl,-0x1(%rdi,%rdx,1)
movsbl (%r9,%rdx,1),%eax
cmp    $0x2a,%eax
je     1190 <init_mouse_cursor8+0x90>
cmp    $0x6f,%eax
je     1130 <init_mouse_cursor8+0x30>
mov    %esi,%ecx
cmp    $0x2e,%eax
je     1132 <init_mouse_cursor8+0x32>
jmp    1135 <init_mouse_cursor8+0x35>
xchg   %ax,%ax
xor    %ecx,%ecx
jmp    1132 <init_mouse_cursor8+0x32>
ret

LLVM IR (-O0):
@init_mouse_cursor8.s_cursor = internal global [16 x [16 x i8]] [[16 x i8] c"**************..", [16 x i8] c"*ooooooooooo*...", [16 x i8] c"*oooooooooo*....", [16 x i8] c"*ooooooooo*.....", [16 x i8] c"*oooooooo*......", [16 x i8] c"*ooooooo*.......", [16 x i8] c"*ooooooo*.......", [16 x i8] c"*oooooooo*......", [16 x i8] c"*oooo**ooo*.....", [16 x i8] c"*ooo*..*ooo*....", [16 x i8] c"*oo*....*ooo*...", [16 x i8] c"*o*......*ooo*..", [16 x i8] c"**........*ooo*.", [16 x i8] c"*..........*ooo*", [16 x i8] c"............*oo*", [16 x i8] c".............***"]
define void @init_mouse_cursor8(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
store i32 0, i32* %6
br label %7
7: ; preds = %53, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 16
br i1 %9, label %10, label %56
10: ; preds = %7
store i32 0, i32* %5
br label %11
11: ; preds = %49, %10
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, 16
br i1 %13, label %14, label %52
14: ; preds = %11
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [16 x [16 x i8]], [16 x [16 x i8]]* @init_mouse_cursor8.s_cursor, i64 0, i64 %16
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [16 x i8], [16 x i8]* %17, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
switch i32 %22, label %48 [
i32 42, label %23
i32 111, label %31
i32 46, label %39
]
23: ; preds = %14
%24 = load i8*, i8** %3
%25 = load i32, i32* %6
%26 = mul nsw i32 %25, 16
%27 = load i32, i32* %5
%28 = add nsw i32 %26, %27
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %24, i64 %29
store i8 0, i8* %30
br label %48
31: ; preds = %14
%32 = load i8*, i8** %3
%33 = load i32, i32* %6
%34 = mul nsw i32 %33, 16
%35 = load i32, i32* %5
%36 = add nsw i32 %34, %35
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8, i8* %32, i64 %37
store i8 7, i8* %38
br label %48
39: ; preds = %14
%40 = load i8, i8* %4
%41 = load i8*, i8** %3
%42 = load i32, i32* %6
%43 = mul nsw i32 %42, 16
%44 = load i32, i32* %5
%45 = add nsw i32 %43, %44
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8, i8* %41, i64 %46
store i8 %40, i8* %47
br label %48
48: ; preds = %14, %39, %31, %23
br label %49
49: ; preds = %48
%50 = load i32, i32* %5
%51 = add nsw i32 %50, 1
store i32 %51, i32* %5
br label %11
52: ; preds = %11
br label %53
53: ; preds = %52
%54 = load i32, i32* %6
%55 = add nsw i32 %54, 1
store i32 %55, i32* %6
br label %7
56: ; preds = %7
ret void
}

LLVM IR (-O2):
@init_mouse_cursor8.s_cursor = internal unnamed_addr constant [16 x [16 x i8]] [[16 x i8] c"**************..", [16 x i8] c"*ooooooooooo*...", [16 x i8] c"*oooooooooo*....", [16 x i8] c"*ooooooooo*.....", [16 x i8] c"*oooooooo*......", [16 x i8] c"*ooooooo*.......", [16 x i8] c"*ooooooo*.......", [16 x i8] c"*oooooooo*......", [16 x i8] c"*oooo**ooo*.....", [16 x i8] c"*ooo*..*ooo*....", [16 x i8] c"*oo*....*ooo*...", [16 x i8] c"*o*......*ooo*..", [16 x i8] c"**........*ooo*.", [16 x i8] c"*..........*ooo*", [16 x i8] c"............*oo*", [16 x i8] c".............***"]
define void @init_mouse_cursor8(i8* nocapture writeonly %0, i8 signext %1) {
br label %3
3: ; preds = %2, %31
%4 = phi i64 [ 0, %2 ], [ %32, %31 ]
%5 = shl nsw i64 %4, 4
br label %6
6: ; preds = %28, %3
%7 = phi i64 [ 0, %3 ], [ %29, %28 ]
%8 = getelementptr inbounds [16 x [16 x i8]], [16 x [16 x i8]]* @init_mouse_cursor8.s_cursor, i64 0, i64 %4, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
switch i32 %10, label %17 [
i32 42, label %13
i32 111, label %11
i32 46, label %12
]
11: ; preds = %6
br label %13
12: ; preds = %6
br label %13
13: ; preds = %6, %12, %11
%14 = phi i8 [ 7, %11 ], [ %1, %12 ], [ 0, %6 ]
%15 = add nuw nsw i64 %7, %5
%16 = getelementptr inbounds i8, i8* %0, i64 %15
store i8 %14, i8* %16
br label %17
17: ; preds = %13, %6
%18 = or i64 %7, 1
%19 = getelementptr inbounds [16 x [16 x i8]], [16 x [16 x i8]]* @init_mouse_cursor8.s_cursor, i64 0, i64 %4, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
switch i32 %21, label %28 [
i32 42, label %24
i32 111, label %23
i32 46, label %22
]
22: ; preds = %17
br label %24
23: ; preds = %17
br label %24
24: ; preds = %23, %22, %17
%25 = phi i8 [ 7, %23 ], [ %1, %22 ], [ 0, %17 ]
%26 = add nuw nsw i64 %18, %5
%27 = getelementptr inbounds i8, i8* %0, i64 %26
store i8 %25, i8* %27
br label %28
28: ; preds = %24, %17
%29 = add nuw nsw i64 %7, 2
%30 = icmp eq i64 %29, 16
br i1 %30, label %31, label %6
31: ; preds = %28
%32 = add nuw nsw i64 %4, 1
%33 = icmp eq i64 %32, 16
br i1 %33, label %34, label %3
34: ; preds = %31
ret void
}