void botline(int d, char *p) {
  switch (d) {
  case 0:
  case 2:
  case 6:
  case 8:
    *p++ = '|';
    break;
  default:
    *p++ = ' ';
  }
  switch (d) {
  case 0:
  case 2:
  case 3:
  case 5:
  case 6:
  case 8:
    *p++ = '_';
    break;
  default:
    *p++ = ' ';
  }
  switch (d) {
  case 0:
  case 1:
  case 3:
  case 4:
  case 5:
  case 6:
  case 7:
  case 8:
  case 9:
    *p++ = '|';
    break;
  default:
    *p++ = ' ';
  }
}


x86 assembly (clang, -O0):
<botline>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
test   %eax,%eax
je     1151 <botline+0x51>
jmp    111e <botline+0x1e>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
je     1151 <botline+0x51>
jmp    112f <botline+0x2f>
mov    -0x14(%rbp),%eax
sub    $0x6,%eax
je     1151 <botline+0x51>
jmp    1140 <botline+0x40>
mov    -0x14(%rbp),%eax
sub    $0x8,%eax
jne    1168 <botline+0x68>
jmp    1151 <botline+0x51>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x7c,(%rax)
jmp    117a <botline+0x7a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x20,(%rax)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
test   %eax,%eax
je     11c6 <botline+0xc6>
jmp    118d <botline+0x8d>
mov    -0x18(%rbp),%eax
add    $0xfffffffe,%eax
sub    $0x2,%eax
jb     11c6 <botline+0xc6>
jmp    11a1 <botline+0xa1>
mov    -0x18(%rbp),%eax
add    $0xfffffffb,%eax
sub    $0x2,%eax
jb     11c6 <botline+0xc6>
jmp    11b5 <botline+0xb5>
mov    -0x18(%rbp),%eax
sub    $0x8,%eax
jne    11dd <botline+0xdd>
jmp    11c6 <botline+0xc6>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x5f,(%rax)
jmp    11ef <botline+0xef>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x20,(%rax)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x2,%eax
jb     1217 <botline+0x117>
jmp    1203 <botline+0x103>
mov    -0x1c(%rbp),%eax
add    $0xfffffffd,%eax
sub    $0x6,%eax
ja     122e <botline+0x12e>
jmp    1217 <botline+0x117>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x7c,(%rax)
jmp    1240 <botline+0x140>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x20,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<botline>:
mov    $0x20,%cl
movslq %edi,%rax
mov    $0x20,%dl
cmp    $0x8,%edi
ja     1116 <botline+0x16>
lea    0xeed(%rip),%rdx
mov    (%rax,%rdx,1),%dl
mov    %dl,(%rsi)
cmp    $0x8,%edi
ja     1127 <botline+0x27>
lea    0xee5(%rip),%rcx
mov    (%rax,%rcx,1),%cl
mov    %cl,0x1(%rsi)
mov    $0x20,%cl
cmp    $0x9,%edi
ja     113b <botline+0x3b>
lea    0xeda(%rip),%rcx
mov    (%rax,%rcx,1),%cl
mov    %cl,0x2(%rsi)
ret

LLVM IR (-O0):
define void @botline(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
switch i32 %5, label %9 [
i32 0, label %6
i32 2, label %6
i32 6, label %6
i32 8, label %6
]
6: ; preds = %2, %2, %2, %2
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %4
store i8 124, i8* %7
br label %12
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %4
store i8 32, i8* %10
br label %12
12: ; preds = %9, %6
%13 = load i32, i32* %3
switch i32 %13, label %17 [
i32 0, label %14
i32 2, label %14
i32 3, label %14
i32 5, label %14
i32 6, label %14
i32 8, label %14
]
14: ; preds = %12, %12, %12, %12, %12, %12
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %4
store i8 95, i8* %15
br label %20
17: ; preds = %12
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %4
store i8 32, i8* %18
br label %20
20: ; preds = %17, %14
%21 = load i32, i32* %3
switch i32 %21, label %25 [
i32 0, label %22
i32 1, label %22
i32 3, label %22
i32 4, label %22
i32 5, label %22
i32 6, label %22
i32 7, label %22
i32 8, label %22
i32 9, label %22
]
22: ; preds = %20, %20, %20, %20, %20, %20, %20, %20, %20
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
store i8 124, i8* %23
br label %28
25: ; preds = %20
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %4
store i8 32, i8* %26
br label %28
28: ; preds = %25, %22
ret void
}

LLVM IR (-O2):
@switch.table.botline = [9 x i8] c"| | | |"
@switch.table.botline.1 = [9 x i8] c"_ __ __ _"
@switch.table.botline.2 = [10 x i8] c"|| |||||||"
define void @botline(i32 %0, i8* nocapture writeonly %1) {
%3 = icmp ult i32 %0, 9
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds [9 x i8], [9 x i8]* @switch.table.botline, i64 0, i64 %5
%7 = load i8, i8* %6
br label %8
8: ; preds = %2, %4
%9 = phi i8 [ %7, %4 ], [ 32, %2 ]
%10 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %9, i8* %1
%11 = icmp ult i32 %0, 9
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = sext i32 %0 to i64
%14 = getelementptr inbounds [9 x i8], [9 x i8]* @switch.table.botline.1, i64 0, i64 %13
%15 = load i8, i8* %14
br label %16
16: ; preds = %8, %12
%17 = phi i8 [ %15, %12 ], [ 32, %8 ]
store i8 %17, i8* %10
%18 = icmp ult i32 %0, 10
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = sext i32 %0 to i64
%21 = getelementptr inbounds [10 x i8], [10 x i8]* @switch.table.botline.2, i64 0, i64 %20
%22 = load i8, i8* %21
br label %23
23: ; preds = %16, %19
%24 = phi i8 [ %22, %19 ], [ 32, %16 ]
%25 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %24, i8* %25
ret void
}