void k_main() {
  char *video = (char *)0xB8000;
  char *hi = "Welcome to KadOS!!!";
  int i = 0;
  for (; i < 80 * 25; i++) {
    *video++ = ' ';
    *video++ = 0x16;
  }
  video = (char *)0xB8000;
  video[0] = hi[0];
  video[2] = hi[1];
  video[4] = hi[2];
  video[6] = hi[3];
  video[8] = hi[4];
  video[10] = hi[5];
  video[12] = hi[6];
  video[14] = hi[7];
  video[16] = hi[8];
  video[18] = hi[9];
  video[20] = hi[10];
  video[22] = hi[11];
  video[24] = hi[12];
  video[26] = hi[13];
  video[28] = hi[14];
  video[30] = hi[15];
  video[32] = hi[16];
  video[34] = hi[17];
  video[36] = hi[18];
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<k_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb8000,%eax
mov    %rax,-0x8(%rbp)
lea    0xeec(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x7d0,-0x14(%rbp)
jge    115e <k_main+0x5e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x20,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x16,(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111f <k_main+0x1f>
mov    $0xb8000,%eax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x4(%rax)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x6(%rax)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x8(%rax)
mov    -0x10(%rbp),%rax
mov    0x5(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0xa(%rax)
mov    -0x10(%rbp),%rax
mov    0x6(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0xc(%rax)
mov    -0x10(%rbp),%rax
mov    0x7(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0xe(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x10(%rax)
mov    -0x10(%rbp),%rax
mov    0x9(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x12(%rax)
mov    -0x10(%rbp),%rax
mov    0xa(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x14(%rax)
mov    -0x10(%rbp),%rax
mov    0xb(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x16(%rax)
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x18(%rax)
mov    -0x10(%rbp),%rax
mov    0xd(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1a(%rax)
mov    -0x10(%rbp),%rax
mov    0xe(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1c(%rax)
mov    -0x10(%rbp),%rax
mov    0xf(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1e(%rax)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x20(%rax)
mov    -0x10(%rbp),%rax
mov    0x11(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x22(%rax)
mov    -0x10(%rbp),%rax
mov    0x12(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x24(%rax)
jmp    126f <k_main+0x16f>

x86 assembly (clang, -O2):
<k_main>:
mov    $0x38,%eax
mov    $0xb8000,%ecx
movaps 0xeef(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movaps %xmm0,-0x70(%rcx,%rax,2)
movaps %xmm0,-0x60(%rcx,%rax,2)
cmp    $0x7f8,%rax
je     1155 <k_main+0x55>
movaps %xmm0,-0x50(%rcx,%rax,2)
movaps %xmm0,-0x40(%rcx,%rax,2)
movaps %xmm0,-0x30(%rcx,%rax,2)
movaps %xmm0,-0x20(%rcx,%rax,2)
movaps %xmm0,-0x10(%rcx,%rax,2)
movaps %xmm0,(%rcx,%rax,2)
add    $0x40,%rax
jmp    1120 <k_main+0x20>
movb   $0x57,0xb8000
57
movb   $0x65,0xb8002
65
movb   $0x6c,0xb8004
6c
movb   $0x63,0xb8006
63
movb   $0x6f,0xb8008
6f
movb   $0x6d,0xb800a
6d
movb   $0x65,0xb800c
65
movb   $0x20,0xb800e
20
movb   $0x74,0xb8010
74
movb   $0x6f,0xb8012
6f
movb   $0x20,0xb8014
20
movb   $0x4b,0xb8016
4b
movb   $0x61,0xb8018
61
movb   $0x64,0xb801a
64
movb   $0x4f,0xb801c
4f
movb   $0x53,0xb801e
53
movb   $0x21,0xb8020
21
movb   $0x21,0xb8022
21
movb   $0x21,0xb8024
21
nopl   (%rax)
jmp    11f0 <k_main+0xf0>

LLVM IR (-O0):
@.str = [20 x i8] c"Welcome to KadOS!!!\00"
define void @k_main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i32
store i8* inttoptr (i64 753664 to i8*), i8** %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 2000
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i8*, i8** %1
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %1
store i8 32, i8* %8
%10 = load i8*, i8** %1
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %1
store i8 22, i8* %10
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
store i8* inttoptr (i64 753664 to i8*), i8** %1
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = load i8*, i8** %1
%20 = getelementptr inbounds i8, i8* %19, i64 0
store i8 %18, i8* %20
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 1
%23 = load i8, i8* %22
%24 = load i8*, i8** %1
%25 = getelementptr inbounds i8, i8* %24, i64 2
store i8 %23, i8* %25
%26 = load i8*, i8** %2
%27 = getelementptr inbounds i8, i8* %26, i64 2
%28 = load i8, i8* %27
%29 = load i8*, i8** %1
%30 = getelementptr inbounds i8, i8* %29, i64 4
store i8 %28, i8* %30
%31 = load i8*, i8** %2
%32 = getelementptr inbounds i8, i8* %31, i64 3
%33 = load i8, i8* %32
%34 = load i8*, i8** %1
%35 = getelementptr inbounds i8, i8* %34, i64 6
store i8 %33, i8* %35
%36 = load i8*, i8** %2
%37 = getelementptr inbounds i8, i8* %36, i64 4
%38 = load i8, i8* %37
%39 = load i8*, i8** %1
%40 = getelementptr inbounds i8, i8* %39, i64 8
store i8 %38, i8* %40
%41 = load i8*, i8** %2
%42 = getelementptr inbounds i8, i8* %41, i64 5
%43 = load i8, i8* %42
%44 = load i8*, i8** %1
%45 = getelementptr inbounds i8, i8* %44, i64 10
store i8 %43, i8* %45
%46 = load i8*, i8** %2
%47 = getelementptr inbounds i8, i8* %46, i64 6
%48 = load i8, i8* %47
%49 = load i8*, i8** %1
%50 = getelementptr inbounds i8, i8* %49, i64 12
store i8 %48, i8* %50
%51 = load i8*, i8** %2
%52 = getelementptr inbounds i8, i8* %51, i64 7
%53 = load i8, i8* %52
%54 = load i8*, i8** %1
%55 = getelementptr inbounds i8, i8* %54, i64 14
store i8 %53, i8* %55
%56 = load i8*, i8** %2
%57 = getelementptr inbounds i8, i8* %56, i64 8
%58 = load i8, i8* %57
%59 = load i8*, i8** %1
%60 = getelementptr inbounds i8, i8* %59, i64 16
store i8 %58, i8* %60
%61 = load i8*, i8** %2
%62 = getelementptr inbounds i8, i8* %61, i64 9
%63 = load i8, i8* %62
%64 = load i8*, i8** %1
%65 = getelementptr inbounds i8, i8* %64, i64 18
store i8 %63, i8* %65
%66 = load i8*, i8** %2
%67 = getelementptr inbounds i8, i8* %66, i64 10
%68 = load i8, i8* %67
%69 = load i8*, i8** %1
%70 = getelementptr inbounds i8, i8* %69, i64 20
store i8 %68, i8* %70
%71 = load i8*, i8** %2
%72 = getelementptr inbounds i8, i8* %71, i64 11
%73 = load i8, i8* %72
%74 = load i8*, i8** %1
%75 = getelementptr inbounds i8, i8* %74, i64 22
store i8 %73, i8* %75
%76 = load i8*, i8** %2
%77 = getelementptr inbounds i8, i8* %76, i64 12
%78 = load i8, i8* %77
%79 = load i8*, i8** %1
%80 = getelementptr inbounds i8, i8* %79, i64 24
store i8 %78, i8* %80
%81 = load i8*, i8** %2
%82 = getelementptr inbounds i8, i8* %81, i64 13
%83 = load i8, i8* %82
%84 = load i8*, i8** %1
%85 = getelementptr inbounds i8, i8* %84, i64 26
store i8 %83, i8* %85
%86 = load i8*, i8** %2
%87 = getelementptr inbounds i8, i8* %86, i64 14
%88 = load i8, i8* %87
%89 = load i8*, i8** %1
%90 = getelementptr inbounds i8, i8* %89, i64 28
store i8 %88, i8* %90
%91 = load i8*, i8** %2
%92 = getelementptr inbounds i8, i8* %91, i64 15
%93 = load i8, i8* %92
%94 = load i8*, i8** %1
%95 = getelementptr inbounds i8, i8* %94, i64 30
store i8 %93, i8* %95
%96 = load i8*, i8** %2
%97 = getelementptr inbounds i8, i8* %96, i64 16
%98 = load i8, i8* %97
%99 = load i8*, i8** %1
%100 = getelementptr inbounds i8, i8* %99, i64 32
store i8 %98, i8* %100
%101 = load i8*, i8** %2
%102 = getelementptr inbounds i8, i8* %101, i64 17
%103 = load i8, i8* %102
%104 = load i8*, i8** %1
%105 = getelementptr inbounds i8, i8* %104, i64 34
store i8 %103, i8* %105
%106 = load i8*, i8** %2
%107 = getelementptr inbounds i8, i8* %106, i64 18
%108 = load i8, i8* %107
%109 = load i8*, i8** %1
%110 = getelementptr inbounds i8, i8* %109, i64 36
store i8 %108, i8* %110
br label %111
111: ; preds = %111, %15
br label %111
}

LLVM IR (-O2):
define void @k_main() {
br label %1
1: ; preds = %12, %0
%2 = phi i64 [ 0, %0 ], [ %36, %12 ]
%3 = shl nuw i64 %2, 1
%4 = shl nuw i64 %2, 1
%5 = or i64 %4, 16
%6 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %3
%7 = bitcast i8* %6 to <16 x i8>*
%8 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %5
%9 = bitcast i8* %8 to <16 x i8>*
store <16 x i8> <i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22>, <16 x i8>* %7
store <16 x i8> <i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22>, <16 x i8>* %9
%10 = or i64 %2, 16
%11 = icmp eq i64 %10, 2000
br i1 %11, label %37, label %12
12: ; preds = %1
%13 = shl nuw i64 %10, 1
%14 = shl nuw i64 %10, 1
%15 = or i64 %14, 16
%16 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %13
%17 = bitcast i8* %16 to <16 x i8>*
%18 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %15
%19 = bitcast i8* %18 to <16 x i8>*
store <16 x i8> <i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22>, <16 x i8>* %17
store <16 x i8> <i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22>, <16 x i8>* %19
%20 = or i64 %2, 32
%21 = shl nuw i64 %20, 1
%22 = shl nuw i64 %20, 1
%23 = or i64 %22, 16
%24 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %21
%25 = bitcast i8* %24 to <16 x i8>*
%26 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %23
%27 = bitcast i8* %26 to <16 x i8>*
store <16 x i8> <i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22>, <16 x i8>* %25
store <16 x i8> <i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22>, <16 x i8>* %27
%28 = or i64 %2, 48
%29 = shl nuw i64 %28, 1
%30 = shl nuw i64 %28, 1
%31 = or i64 %30, 16
%32 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %29
%33 = bitcast i8* %32 to <16 x i8>*
%34 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %31
%35 = bitcast i8* %34 to <16 x i8>*
store <16 x i8> <i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22>, <16 x i8>* %33
store <16 x i8> <i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22, i8 32, i8 22>, <16 x i8>* %35
%36 = add nuw nsw i64 %2, 64
br label %1
37: ; preds = %1
store i8 87, i8* inttoptr (i64 753664 to i8*)
store i8 101, i8* inttoptr (i64 753666 to i8*)
store i8 108, i8* inttoptr (i64 753668 to i8*)
store i8 99, i8* inttoptr (i64 753670 to i8*)
store i8 111, i8* inttoptr (i64 753672 to i8*)
store i8 109, i8* inttoptr (i64 753674 to i8*)
store i8 101, i8* inttoptr (i64 753676 to i8*)
store i8 32, i8* inttoptr (i64 753678 to i8*)
store i8 116, i8* inttoptr (i64 753680 to i8*)
store i8 111, i8* inttoptr (i64 753682 to i8*)
store i8 32, i8* inttoptr (i64 753684 to i8*)
store i8 75, i8* inttoptr (i64 753686 to i8*)
store i8 97, i8* inttoptr (i64 753688 to i8*)
store i8 100, i8* inttoptr (i64 753690 to i8*)
store i8 79, i8* inttoptr (i64 753692 to i8*)
store i8 83, i8* inttoptr (i64 753694 to i8*)
store i8 33, i8* inttoptr (i64 753696 to i8*)
store i8 33, i8* inttoptr (i64 753698 to i8*)
store i8 33, i8* inttoptr (i64 753700 to i8*)
br label %38
38: ; preds = %38, %37
br label %38
}