void kernel_assert_clear() {
  char *fb = (char *)0xB8000;
  register int i;
  for (i = 0; i < 80 * 25; ++i) {
    fb[i << 1] = 0x00;
    fb[(i << 1) + 1] = 0x07;
  }
}


x86 assembly (clang, -O0):
<kernel_assert_clear>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb8000,%eax
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x7d0,-0xc(%rbp)
jge    1154 <kernel_assert_clear+0x54>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x7,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <kernel_assert_clear+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_assert_clear>:
mov    $0xb8030,%eax
xor    %ecx,%ecx
movaps 0xef2(%rip),%xmm0
xchg   %ax,%ax
movaps %xmm0,-0x30(%rax,%rcx,2)
movaps %xmm0,-0x20(%rax,%rcx,2)
cmp    $0x7c0,%rcx
je     1132 <kernel_assert_clear+0x32>
movaps %xmm0,-0x10(%rax,%rcx,2)
movaps %xmm0,(%rax,%rcx,2)
add    $0x20,%rcx
jmp    1110 <kernel_assert_clear+0x10>
ret

LLVM IR (-O0):
define void @kernel_assert_clear() {
%1 = alloca i8*
%2 = alloca i32
store i8* inttoptr (i64 753664 to i8*), i8** %1
store i32 0, i32* %2
br label %3
3: ; preds = %18, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 2000
br i1 %5, label %6, label %21
6: ; preds = %3
%7 = load i8*, i8** %1
%8 = load i32, i32* %2
%9 = shl i32 %8, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %7, i64 %10
store i8 0, i8* %11
%12 = load i8*, i8** %1
%13 = load i32, i32* %2
%14 = shl i32 %13, 1
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %12, i64 %16
store i8 7, i8* %17
br label %18
18: ; preds = %6
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %3
21: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @kernel_assert_clear() {
br label %1
1: ; preds = %13, %0
%2 = phi i64 [ 0, %0 ], [ %22, %13 ]
%3 = shl nuw nsw i64 %2, 1
%4 = shl nuw i64 %2, 1
%5 = or i64 %3, 1
%6 = or i64 %4, 17
%7 = getelementptr inbounds i8, i8* inttoptr (i64 753663 to i8*), i64 %5
%8 = bitcast i8* %7 to <16 x i8>*
%9 = getelementptr inbounds i8, i8* inttoptr (i64 753663 to i8*), i64 %6
%10 = bitcast i8* %9 to <16 x i8>*
store <16 x i8> <i8 0, i8 7, i8 0, i8 7, i8 0, i8 7, i8 0, i8 7, i8 0, i8 7, i8 0, i8 7, i8 0, i8 7, i8 0, i8 7>, <16 x i8>* %8
store <16 x i8> <i8 0, i8 7, i8 0, i8 7, i8 0, i8 7, i8 0, i8 7, i8 0, i8 7, i8 0, i8 7, i8 0, i8 7, i8 0, i8 7>, <16 x i8>* %10
%11 = or i64 %2, 16
%12 = icmp eq i64 %11, 2000
br i1 %12, label %23, label %13
13: ; preds = %1
%14 = shl nuw nsw i64 %11, 1
%15 = shl nuw i64 %11, 1
%16 = or i64 %14, 1
%17 = or i64 %15, 17
%18 = getelementptr inbounds i8, i8* inttoptr (i64 753663 to i8*), i64 %16
%19 = bitcast i8* %18 to <16 x i8>*
%20 = getelementptr inbounds i8, i8* inttoptr (i64 753663 to i8*), i64 %17
%21 = bitcast i8* %20 to <16 x i8>*
store <16 x i8> <i8 0, i8 7, i8 0, i8 7, i8 0, i8 7, i8 0, i8 7, i8 0, i8 7, i8 0, i8 7, i8 0, i8 7, i8 0, i8 7>, <16 x i8>* %19
store <16 x i8> <i8 0, i8 7, i8 0, i8 7, i8 0, i8 7, i8 0, i8 7, i8 0, i8 7, i8 0, i8 7, i8 0, i8 7, i8 0, i8 7>, <16 x i8>* %21
%22 = add nuw nsw i64 %2, 32
br label %1
23: ; preds = %1
ret void
}