void PrintHelloWorld() {
  unsigned short *DisplayMemoryPtr = (unsigned short *)0xB8000;
  int i = 0;
  DisplayMemoryPtr[i++] = (0x0200 | 'H');
  DisplayMemoryPtr[i++] = (0x0200 | 'e');
  DisplayMemoryPtr[i++] = (0x0200 | 'l');
  DisplayMemoryPtr[i++] = (0x0200 | 'l');
  DisplayMemoryPtr[i++] = (0x0200 | 'o');
  DisplayMemoryPtr[i++] = (0x0200 | ',');
  DisplayMemoryPtr[i++] = (0x0200 | ' ');
  DisplayMemoryPtr[i++] = (0x0200 | 'w');
  DisplayMemoryPtr[i++] = (0x0200 | 'o');
  DisplayMemoryPtr[i++] = (0x0200 | 'r');
  DisplayMemoryPtr[i++] = (0x0200 | 'l');
  DisplayMemoryPtr[i++] = (0x0200 | 'd');
  DisplayMemoryPtr[i++] = (0x0200 | '!');
}


x86 assembly (clang, -O0):
<PrintHelloWorld>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb8000,%eax
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movw   $0x248,(%rax,%rcx,2)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movw   $0x265,(%rax,%rcx,2)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movw   $0x26c,(%rax,%rcx,2)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movw   $0x26c,(%rax,%rcx,2)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movw   $0x26f,(%rax,%rcx,2)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movw   $0x22c,(%rax,%rcx,2)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movw   $0x220,(%rax,%rcx,2)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movw   $0x277,(%rax,%rcx,2)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movw   $0x26f,(%rax,%rcx,2)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movw   $0x272,(%rax,%rcx,2)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movw   $0x26c,(%rax,%rcx,2)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movw   $0x264,(%rax,%rcx,2)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movw   $0x221,(%rax,%rcx,2)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintHelloWorld>:
movw   $0x248,0xb8000
movw   $0x265,0xb8002
movw   $0x26c,0xb8004
movw   $0x26c,0xb8006
movw   $0x26f,0xb8008
movw   $0x22c,0xb800a
movw   $0x220,0xb800c
movw   $0x277,0xb800e
movw   $0x26f,0xb8010
movw   $0x272,0xb8012
movw   $0x26c,0xb8014
movw   $0x264,0xb8016
movw   $0x221,0xb8018
ret

LLVM IR (-O0):
define void @PrintHelloWorld() {
%1 = alloca i16*
%2 = alloca i32
store i16* inttoptr (i64 753664 to i16*), i16** %1
store i32 0, i32* %2
%3 = load i16*, i16** %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds i16, i16* %3, i64 %6
store i16 584, i16* %7
%8 = load i16*, i16** %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
%11 = sext i32 %9 to i64
%12 = getelementptr inbounds i16, i16* %8, i64 %11
store i16 613, i16* %12
%13 = load i16*, i16** %1
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
%16 = sext i32 %14 to i64
%17 = getelementptr inbounds i16, i16* %13, i64 %16
store i16 620, i16* %17
%18 = load i16*, i16** %1
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
%21 = sext i32 %19 to i64
%22 = getelementptr inbounds i16, i16* %18, i64 %21
store i16 620, i16* %22
%23 = load i16*, i16** %1
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
%26 = sext i32 %24 to i64
%27 = getelementptr inbounds i16, i16* %23, i64 %26
store i16 623, i16* %27
%28 = load i16*, i16** %1
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %2
%31 = sext i32 %29 to i64
%32 = getelementptr inbounds i16, i16* %28, i64 %31
store i16 556, i16* %32
%33 = load i16*, i16** %1
%34 = load i32, i32* %2
%35 = add nsw i32 %34, 1
store i32 %35, i32* %2
%36 = sext i32 %34 to i64
%37 = getelementptr inbounds i16, i16* %33, i64 %36
store i16 544, i16* %37
%38 = load i16*, i16** %1
%39 = load i32, i32* %2
%40 = add nsw i32 %39, 1
store i32 %40, i32* %2
%41 = sext i32 %39 to i64
%42 = getelementptr inbounds i16, i16* %38, i64 %41
store i16 631, i16* %42
%43 = load i16*, i16** %1
%44 = load i32, i32* %2
%45 = add nsw i32 %44, 1
store i32 %45, i32* %2
%46 = sext i32 %44 to i64
%47 = getelementptr inbounds i16, i16* %43, i64 %46
store i16 623, i16* %47
%48 = load i16*, i16** %1
%49 = load i32, i32* %2
%50 = add nsw i32 %49, 1
store i32 %50, i32* %2
%51 = sext i32 %49 to i64
%52 = getelementptr inbounds i16, i16* %48, i64 %51
store i16 626, i16* %52
%53 = load i16*, i16** %1
%54 = load i32, i32* %2
%55 = add nsw i32 %54, 1
store i32 %55, i32* %2
%56 = sext i32 %54 to i64
%57 = getelementptr inbounds i16, i16* %53, i64 %56
store i16 620, i16* %57
%58 = load i16*, i16** %1
%59 = load i32, i32* %2
%60 = add nsw i32 %59, 1
store i32 %60, i32* %2
%61 = sext i32 %59 to i64
%62 = getelementptr inbounds i16, i16* %58, i64 %61
store i16 612, i16* %62
%63 = load i16*, i16** %1
%64 = load i32, i32* %2
%65 = add nsw i32 %64, 1
store i32 %65, i32* %2
%66 = sext i32 %64 to i64
%67 = getelementptr inbounds i16, i16* %63, i64 %66
store i16 545, i16* %67
ret void
}

LLVM IR (-O2):
define void @PrintHelloWorld() {
store i16 584, i16* inttoptr (i64 753664 to i16*)
store i16 613, i16* inttoptr (i64 753666 to i16*)
store i16 620, i16* inttoptr (i64 753668 to i16*)
store i16 620, i16* inttoptr (i64 753670 to i16*)
store i16 623, i16* inttoptr (i64 753672 to i16*)
store i16 556, i16* inttoptr (i64 753674 to i16*)
store i16 544, i16* inttoptr (i64 753676 to i16*)
store i16 631, i16* inttoptr (i64 753678 to i16*)
store i16 623, i16* inttoptr (i64 753680 to i16*)
store i16 626, i16* inttoptr (i64 753682 to i16*)
store i16 620, i16* inttoptr (i64 753684 to i16*)
store i16 612, i16* inttoptr (i64 753686 to i16*)
store i16 545, i16* inttoptr (i64 753688 to i16*)
ret void
}