void make_wtitle8(unsigned char *buf, int xsize, char *title, char act) {
  static char closebtn[14][16] = {
      "OOOOOOOOOOOOOOO@", "OQQQQQQQQQQQQQ$@", "OQQQQQQQQQQQQQ$@",
      "OQQQ@@QQQQ@@QQ$@", "OQQQQ@@QQ@@QQQ$@", "OQQQQQ@@@@QQQQ$@",
      "OQQQQQQ@@QQQQQ$@", "OQQQQQ@@@@QQQQ$@", "OQQQQ@@QQ@@QQQ$@",
      "OQQQ@@QQQQ@@QQ$@", "OQQQQQQQQQQQQQ$@", "OQQQQQQQQQQQQQ$@",
      "O$$$$$$$$$$$$$$@", "@@@@@@@@@@@@@@@@",
  };
  int x, y;
  char c;
  char tc, tbc;
  if (act != 0) {
    tc = 7;
    tbc = 12;
  } else {
    tc = 8;
    tbc = 15;
  }
  boxfill8(buf, xsize, tbc, 3, 3, xsize - 4, 20);
  putfonts8_asc(buf, xsize, 24, 4, tc, title);
  for (y = 0; y < 14; y++) {
    for (x = 0; x < 16; x++) {
      c = closebtn[y][x];
      if (c == '@') {
        c = 0;
      } else if (c == '$') {
        c = 15;
      } else if (c == 'Q') {
        c = 8;
      } else {
        c = 7;
      }
      buf[(5 + y) * xsize + (xsize - 21 + x)] = c;
    }
  }
  return;
}


x86 assembly (clang, -O0):
<make_wtitle8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x0,%eax
je     1152 <make_wtitle8+0x32>
movb   $0x7,-0x26(%rbp)
movb   $0xc,-0x27(%rbp)
jmp    115a <make_wtitle8+0x3a>
movb   $0x8,-0x26(%rbp)
movb   $0xf,-0x27(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movsbl -0x27(%rbp),%edx
mov    -0xc(%rbp),%r9d
sub    $0x4,%r9d
mov    $0x3,%r8d
mov    %r8d,%ecx
movl   $0x14,(%rsp)
mov    $0x0,%al
call   1030 <boxfill8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movsbl -0x26(%rbp),%r8d
mov    -0x18(%rbp),%r9
mov    $0x18,%edx
mov    $0x4,%ecx
mov    $0x0,%al
call   1040 <putfonts8_asc@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0xe,-0x24(%rbp)
jge    1276 <make_wtitle8+0x156>
movl   $0x0,-0x20(%rbp)
cmpl   $0x10,-0x20(%rbp)
jge    1263 <make_wtitle8+0x143>
movslq -0x24(%rbp),%rcx
lea    0x2e6e(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x25(%rbp)
movsbl -0x25(%rbp),%eax
cmp    $0x40,%eax
jne    11f9 <make_wtitle8+0xd9>
movb   $0x0,-0x25(%rbp)
jmp    1233 <make_wtitle8+0x113>
movsbl -0x25(%rbp),%eax
cmp    $0x24,%eax
jne    120f <make_wtitle8+0xef>
movb   $0xf,-0x25(%rbp)
jmp    122e <make_wtitle8+0x10e>
movsbl -0x25(%rbp),%eax
cmp    $0x51,%eax
jne    1225 <make_wtitle8+0x105>
movb   $0x8,-0x25(%rbp)
jmp    1229 <make_wtitle8+0x109>
movb   $0x7,-0x25(%rbp)
jmp    122e <make_wtitle8+0x10e>
jmp    1233 <make_wtitle8+0x113>
mov    -0x25(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x5,%ecx
imul   -0xc(%rbp),%ecx
mov    -0xc(%rbp),%esi
sub    $0x15,%esi
add    -0x20(%rbp),%esi
add    %esi,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11bd <make_wtitle8+0x9d>
jmp    1268 <make_wtitle8+0x148>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11ac <make_wtitle8+0x8c>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_wtitle8>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %esi,%r14d
mov    %rdi,%rbx
xor    %eax,%eax
test   %cl,%cl
sete   %al
lea    (%rax,%rax,2),%edx
mov    %eax,%r12d
add    $0x7,%r12d
or     $0xc,%edx
lea    -0x4(%r14),%r9d
movl   $0x14,(%rsp)
xor    %r13d,%r13d
mov    $0x3,%ecx
mov    $0x3,%r8d
xor    %eax,%eax
call   1030 <boxfill8@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
mov    $0x18,%edx
mov    $0x4,%ecx
mov    %r12d,%r8d
mov    %r15,%r9
xor    %eax,%eax
call   1040 <putfonts8_asc@plt>
lea    (%r14,%r14,1),%ecx
lea    (%rcx,%rcx,2),%eax
add    $0xffffffec,%eax
mov    %r14d,%r8d
lea    (%rcx,%rcx,2),%edx
add    $0xffffffea,%edx
or     $0x1,%rdx
lea    0xe5e(%rip),%rsi
jmp    11c8 <make_wtitle8+0xa8>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%r13
add    $0x10,%rsi
add    %r8,%rax
add    %r8,%rdx
cmp    $0xe,%r13
je     1267 <make_wtitle8+0x147>
xor    %edi,%edi
jmp    11e5 <make_wtitle8+0xc5>
nopl   0x0(%rax)
xor    %ecx,%ecx
lea    (%rax,%rdi,1),%ebp
movslq %ebp,%rbp
mov    %cl,(%rbx,%rbp,1)
add    $0x2,%rdi
cmp    $0x10,%rdi
je     11b0 <make_wtitle8+0x90>
movzbl -0x1(%rsi,%rdi,1),%ecx
cmp    $0x51,%cl
je     1210 <make_wtitle8+0xf0>
cmp    $0x40,%cl
je     1200 <make_wtitle8+0xe0>
cmp    $0x24,%cl
jne    1220 <make_wtitle8+0x100>
mov    $0xf,%cl
jmp    1222 <make_wtitle8+0x102>
nopl   (%rax)
xor    %ecx,%ecx
jmp    1222 <make_wtitle8+0x102>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x8,%cl
jmp    1222 <make_wtitle8+0x102>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x7,%cl
lea    (%rdx,%rdi,1),%ebp
movslq %ebp,%rbp
mov    %cl,(%rbx,%rbp,1)
movzbl (%rsi,%rdi,1),%ecx
cmp    $0x24,%cl
je     1250 <make_wtitle8+0x130>
cmp    $0x40,%cl
je     11d0 <make_wtitle8+0xb0>
cmp    $0x51,%cl
jne    1260 <make_wtitle8+0x140>
mov    $0x8,%cl
jmp    11d2 <make_wtitle8+0xb2>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xf,%cl
jmp    11d2 <make_wtitle8+0xb2>
nopw   0x0(%rax,%rax,1)
mov    $0x7,%cl
jmp    11d2 <make_wtitle8+0xb2>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@make_wtitle8.closebtn = internal global [14 x [16 x i8]] [[16 x i8] c"OOOOOOOOOOOOOOO@", [16 x i8] c"OQQQQQQQQQQQQQ$@", [16 x i8] c"OQQQQQQQQQQQQQ$@", [16 x i8] c"OQQQ@@QQQQ@@QQ$@", [16 x i8] c"OQQQQ@@QQ@@QQQ$@", [16 x i8] c"OQQQQQ@@@@QQQQ$@", [16 x i8] c"OQQQQQQ@@QQQQQ$@", [16 x i8] c"OQQQQQ@@@@QQQQ$@", [16 x i8] c"OQQQQ@@QQ@@QQQ$@", [16 x i8] c"OQQQ@@QQQQ@@QQ$@", [16 x i8] c"OQQQQQQQQQQQQQ$@", [16 x i8] c"OQQQQQQQQQQQQQ$@", [16 x i8] c"O$$$$$$$$$$$$$$@", [16 x i8] c"@@@@@@@@@@@@@@@@"]
define void @make_wtitle8(i8* %0, i32 %1, i8* %2, i8 signext %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8
%12 = alloca i8
%13 = alloca i8
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8 %3, i8* %8
%14 = load i8, i8* %8
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %4
store i8 7, i8* %12
store i8 12, i8* %13
br label %19
18: ; preds = %4
store i8 8, i8* %12
store i8 15, i8* %13
br label %19
19: ; preds = %18, %17
%20 = load i8*, i8** %5
%21 = load i32, i32* %6
%22 = load i8, i8* %13
%23 = sext i8 %22 to i32
%24 = load i32, i32* %6
%25 = sub nsw i32 %24, 4
%26 = call i32 (i8*, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @boxfill8 to i32 (i8*, i32, i32, i32, i32, i32, i32, ...)*)(i8* %20, i32 %21, i32 %23, i32 3, i32 3, i32 %25, i32 20)
%27 = load i8*, i8** %5
%28 = load i32, i32* %6
%29 = load i8, i8* %12
%30 = sext i8 %29 to i32
%31 = load i8*, i8** %7
%32 = call i32 (i8*, i32, i32, i32, i32, i8*, ...) bitcast (i32 (...)* @putfonts8_asc to i32 (i8*, i32, i32, i32, i32, i8*, ...)*)(i8* %27, i32 %28, i32 24, i32 4, i32 %30, i8* %31)
store i32 0, i32* %10
br label %33
33: ; preds = %83, %19
%34 = load i32, i32* %10
%35 = icmp slt i32 %34, 14
br i1 %35, label %36, label %86
36: ; preds = %33
store i32 0, i32* %9
br label %37
37: ; preds = %79, %36
%38 = load i32, i32* %9
%39 = icmp slt i32 %38, 16
br i1 %39, label %40, label %82
40: ; preds = %37
%41 = load i32, i32* %10
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [14 x [16 x i8]], [14 x [16 x i8]]* @make_wtitle8.closebtn, i64 0, i64 %42
%44 = load i32, i32* %9
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [16 x i8], [16 x i8]* %43, i64 0, i64 %45
%47 = load i8, i8* %46
store i8 %47, i8* %11
%48 = load i8, i8* %11
%49 = sext i8 %48 to i32
%50 = icmp eq i32 %49, 64
br i1 %50, label %51, label %52
51: ; preds = %40
store i8 0, i8* %11
br label %65
52: ; preds = %40
%53 = load i8, i8* %11
%54 = sext i8 %53 to i32
%55 = icmp eq i32 %54, 36
br i1 %55, label %56, label %57
56: ; preds = %52
store i8 15, i8* %11
br label %64
57: ; preds = %52
%58 = load i8, i8* %11
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %59, 81
br i1 %60, label %61, label %62
61: ; preds = %57
store i8 8, i8* %11
br label %63
62: ; preds = %57
store i8 7, i8* %11
br label %63
63: ; preds = %62, %61
br label %64
64: ; preds = %63, %56
br label %65
65: ; preds = %64, %51
%66 = load i8, i8* %11
%67 = load i8*, i8** %5
%68 = load i32, i32* %10
%69 = add nsw i32 5, %68
%70 = load i32, i32* %6
%71 = mul nsw i32 %69, %70
%72 = load i32, i32* %6
%73 = sub nsw i32 %72, 21
%74 = load i32, i32* %9
%75 = add nsw i32 %73, %74
%76 = add nsw i32 %71, %75
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i8, i8* %67, i64 %77
store i8 %66, i8* %78
br label %79
79: ; preds = %65
%80 = load i32, i32* %9
%81 = add nsw i32 %80, 1
store i32 %81, i32* %9
br label %37
82: ; preds = %37
br label %83
83: ; preds = %82
%84 = load i32, i32* %10
%85 = add nsw i32 %84, 1
store i32 %85, i32* %10
br label %33
86: ; preds = %33
ret void
}

LLVM IR (-O2):
@make_wtitle8.closebtn = internal unnamed_addr constant [14 x [16 x i8]] [[16 x i8] c"OOOOOOOOOOOOOOO@", [16 x i8] c"OQQQQQQQQQQQQQ$@", [16 x i8] c"OQQQQQQQQQQQQQ$@", [16 x i8] c"OQQQ@@QQQQ@@QQ$@", [16 x i8] c"OQQQQ@@QQ@@QQQ$@", [16 x i8] c"OQQQQQ@@@@QQQQ$@", [16 x i8] c"OQQQQQQ@@QQQQQ$@", [16 x i8] c"OQQQQQ@@@@QQQQ$@", [16 x i8] c"OQQQQ@@QQ@@QQQ$@", [16 x i8] c"OQQQ@@QQQQ@@QQ$@", [16 x i8] c"OQQQQQQQQQQQQQ$@", [16 x i8] c"OQQQQQQQQQQQQQ$@", [16 x i8] c"O$$$$$$$$$$$$$$@", [16 x i8] c"@@@@@@@@@@@@@@@@"]
define void @make_wtitle8(i8* %0, i32 %1, i8* %2, i8 signext %3) {
%5 = icmp eq i8 %3, 0
%6 = select i1 %5, i32 8, i32 7
%7 = select i1 %5, i32 15, i32 12
%8 = add nsw i32 %1, -4
%9 = tail call i32 (i8*, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @boxfill8 to i32 (i8*, i32, i32, i32, i32, i32, i32, ...)*)(i8* %0, i32 %1, i32 %7, i32 3, i32 3, i32 %8, i32 20)
%10 = tail call i32 (i8*, i32, i32, i32, i32, i8*, ...) bitcast (i32 (...)* @putfonts8_asc to i32 (i8*, i32, i32, i32, i32, i8*, ...)*)(i8* %0, i32 %1, i32 24, i32 4, i32 %6, i8* %2)
%11 = add nsw i32 %1, -21
br label %12
12: ; preds = %4, %45
%13 = phi i64 [ 0, %4 ], [ %46, %45 ]
%14 = trunc i64 %13 to i32
%15 = add i32 %14, 5
%16 = mul nsw i32 %15, %1
%17 = add i32 %11, %16
br label %18
18: ; preds = %37, %12
%19 = phi i64 [ 0, %12 ], [ %43, %37 ]
%20 = getelementptr inbounds [14 x [16 x i8]], [14 x [16 x i8]]* @make_wtitle8.closebtn, i64 0, i64 %13, i64 %19
%21 = load i8, i8* %20
switch i8 %21, label %24 [
i8 64, label %25
i8 36, label %22
i8 81, label %23
]
22: ; preds = %18
br label %25
23: ; preds = %18
br label %25
24: ; preds = %18
br label %25
25: ; preds = %18, %22, %24, %23
%26 = phi i8 [ 15, %22 ], [ 8, %23 ], [ 7, %24 ], [ 0, %18 ]
%27 = trunc i64 %19 to i32
%28 = add i32 %17, %27
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %0, i64 %29
store i8 %26, i8* %30
%31 = or i64 %19, 1
%32 = getelementptr inbounds [14 x [16 x i8]], [14 x [16 x i8]]* @make_wtitle8.closebtn, i64 0, i64 %13, i64 %31
%33 = load i8, i8* %32
switch i8 %33, label %36 [
i8 64, label %37
i8 36, label %35
i8 81, label %34
]
34: ; preds = %25
br label %37
35: ; preds = %25
br label %37
36: ; preds = %25
br label %37
37: ; preds = %36, %35, %34, %25
%38 = phi i8 [ 15, %35 ], [ 8, %34 ], [ 7, %36 ], [ 0, %25 ]
%39 = trunc i64 %31 to i32
%40 = add i32 %17, %39
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8, i8* %0, i64 %41
store i8 %38, i8* %42
%43 = add nuw nsw i64 %19, 2
%44 = icmp eq i64 %43, 16
br i1 %44, label %45, label %18
45: ; preds = %37
%46 = add nuw nsw i64 %13, 1
%47 = icmp eq i64 %46, 14
br i1 %47, label %48, label %12
48: ; preds = %45
ret void
}