void make_title8(unsigned char *buf, int width, char *title, char act) {
  static char s_close_btn[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, tc, tbc;
  if (0 != act) {
    tc = (7);
    tbc = (12);
  } else {
    tc = (8);
    tbc = (15);
  }
  fill_box8(buf, width, tbc, 3, 3, width - 4, 20);
  draw_font8_asc(buf, width, 24, 4, tc, title);
  for (y = 0; y < 14; ++y) {
    for (x = 0; x < 16; ++x) {
      c = s_close_btn[y][x];
      switch (c) {
      case '@':
        c = (0);
        break;
      case '$':
        c = (15);
        break;
      case 'Q':
        c = (8);
        break;
      default:
        c = (7);
        break;
      }
      buf[(5 + y) * width + (width - 21 + x)] = c;
    }
  }
}


x86 assembly (clang, -O0):
<make_title8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1153 <make_title8+0x33>
movb   $0x7,-0x26(%rbp)
movb   $0xc,-0x27(%rbp)
jmp    115b <make_title8+0x3b>
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   1040 <fill_box8@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   1030 <draw_font8_asc@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0xe,-0x24(%rbp)
jge    127d <make_title8+0x15d>
movl   $0x0,-0x20(%rbp)
cmpl   $0x10,-0x20(%rbp)
jge    126a <make_title8+0x14a>
movslq -0x24(%rbp),%rax
shl    $0x4,%rax
lea    0x2e69(%rip),%rcx
add    %rax,%rcx
movslq -0x20(%rbp),%rax
mov    (%rax,%rcx,1),%al
mov    %al,-0x25(%rbp)
movsbl -0x25(%rbp),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x24,%eax
je     1224 <make_title8+0x104>
jmp    11f9 <make_title8+0xd9>
mov    -0x2c(%rbp),%eax
sub    $0x40,%eax
je     121b <make_title8+0xfb>
jmp    120a <make_title8+0xea>
mov    -0x2c(%rbp),%eax
sub    $0x51,%eax
je     122d <make_title8+0x10d>
jmp    1236 <make_title8+0x116>
movb   $0x0,-0x25(%rbp)
jmp    123a <make_title8+0x11a>
movb   $0xf,-0x25(%rbp)
jmp    123a <make_title8+0x11a>
movb   $0x8,-0x25(%rbp)
jmp    123a <make_title8+0x11a>
movb   $0x7,-0x25(%rbp)
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    11be <make_title8+0x9e>
jmp    126f <make_title8+0x14f>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11ad <make_title8+0x8d>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_title8>:
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   1040 <fill_box8@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
mov    $0x18,%edx
mov    $0x4,%ecx
mov    %r12d,%r8d
mov    %r15,%r9
xor    %eax,%eax
call   1030 <draw_font8_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_title8+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_title8+0x147>
xor    %edi,%edi
jmp    11e5 <make_title8+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_title8+0x90>
movsbl -0x1(%rsi,%rdi,1),%ecx
cmp    $0x51,%ecx
je     1210 <make_title8+0xf0>
cmp    $0x40,%ecx
je     1200 <make_title8+0xe0>
cmp    $0x24,%ecx
jne    1220 <make_title8+0x100>
mov    $0xf,%cl
jmp    1222 <make_title8+0x102>
nopl   (%rax)
xor    %ecx,%ecx
jmp    1222 <make_title8+0x102>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x8,%cl
jmp    1222 <make_title8+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)
movsbl (%rsi,%rdi,1),%ecx
cmp    $0x24,%ecx
je     1250 <make_title8+0x130>
cmp    $0x40,%ecx
je     11d0 <make_title8+0xb0>
cmp    $0x51,%ecx
jne    1260 <make_title8+0x140>
mov    $0x8,%cl
jmp    11d2 <make_title8+0xb2>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xf,%cl
jmp    11d2 <make_title8+0xb2>
nopw   0x0(%rax,%rax,1)
mov    $0x7,%cl
jmp    11d2 <make_title8+0xb2>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@make_title8.s_close_btn = 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_title8(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 0, %15
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 (...)* @fill_box8 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 (...)* @draw_font8_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 = %72, %19
%34 = load i32, i32* %10
%35 = icmp slt i32 %34, 14
br i1 %35, label %36, label %75
36: ; preds = %33
store i32 0, i32* %9
br label %37
37: ; preds = %68, %36
%38 = load i32, i32* %9
%39 = icmp slt i32 %38, 16
br i1 %39, label %40, label %71
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_title8.s_close_btn, 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
switch i32 %49, label %53 [
i32 64, label %50
i32 36, label %51
i32 81, label %52
]
50: ; preds = %40
store i8 0, i8* %11
br label %54
51: ; preds = %40
store i8 15, i8* %11
br label %54
52: ; preds = %40
store i8 8, i8* %11
br label %54
53: ; preds = %40
store i8 7, i8* %11
br label %54
54: ; preds = %53, %52, %51, %50
%55 = load i8, i8* %11
%56 = load i8*, i8** %5
%57 = load i32, i32* %10
%58 = add nsw i32 5, %57
%59 = load i32, i32* %6
%60 = mul nsw i32 %58, %59
%61 = load i32, i32* %6
%62 = sub nsw i32 %61, 21
%63 = load i32, i32* %9
%64 = add nsw i32 %62, %63
%65 = add nsw i32 %60, %64
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i8, i8* %56, i64 %66
store i8 %55, i8* %67
br label %68
68: ; preds = %54
%69 = load i32, i32* %9
%70 = add nsw i32 %69, 1
store i32 %70, i32* %9
br label %37
71: ; preds = %37
br label %72
72: ; preds = %71
%73 = load i32, i32* %10
%74 = add nsw i32 %73, 1
store i32 %74, i32* %10
br label %33
75: ; preds = %33
ret void
}

LLVM IR (-O2):
@make_title8.s_close_btn = 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_title8(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 (...)* @fill_box8 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 (...)* @draw_font8_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, %47
%13 = phi i64 [ 0, %4 ], [ %48, %47 ]
%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 = %39, %12
%19 = phi i64 [ 0, %12 ], [ %45, %39 ]
%20 = getelementptr inbounds [14 x [16 x i8]], [14 x [16 x i8]]* @make_title8.s_close_btn, i64 0, i64 %13, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
switch i32 %22, label %25 [
i32 64, label %26
i32 36, label %23
i32 81, label %24
]
23: ; preds = %18
br label %26
24: ; preds = %18
br label %26
25: ; preds = %18
br label %26
26: ; preds = %18, %25, %24, %23
%27 = phi i8 [ 7, %25 ], [ 8, %24 ], [ 15, %23 ], [ 0, %18 ]
%28 = trunc i64 %19 to i32
%29 = add i32 %17, %28
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %0, i64 %30
store i8 %27, i8* %31
%32 = or i64 %19, 1
%33 = getelementptr inbounds [14 x [16 x i8]], [14 x [16 x i8]]* @make_title8.s_close_btn, i64 0, i64 %13, i64 %32
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
switch i32 %35, label %38 [
i32 64, label %39
i32 36, label %37
i32 81, label %36
]
36: ; preds = %26
br label %39
37: ; preds = %26
br label %39
38: ; preds = %26
br label %39
39: ; preds = %38, %37, %36, %26
%40 = phi i8 [ 7, %38 ], [ 8, %36 ], [ 15, %37 ], [ 0, %26 ]
%41 = trunc i64 %32 to i32
%42 = add i32 %17, %41
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8, i8* %0, i64 %43
store i8 %40, i8* %44
%45 = add nuw nsw i64 %19, 2
%46 = icmp eq i64 %45, 16
br i1 %46, label %47, label %18
47: ; preds = %39
%48 = add nuw nsw i64 %13, 1
%49 = icmp eq i64 %48, 14
br i1 %49, label %50, label %12
50: ; preds = %47
ret void
}