int copybbl() {
  volatile long *src = (long *)(64 * 1024 * 1024 + 0x400);
  volatile long *dst = (long *)(0 + 0x100);
  int i;
  for (i = 0; i < (64 * 1024) / sizeof(*dst); i++)
    *dst++ = *src++;
}


x86 assembly (clang, -O0):
<copybbl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4000400,%eax
mov    %rax,-0x10(%rbp)
mov    $0x100,%eax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    $0x2000,%rax
jae    115f <copybbl+0x5f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x18(%rbp)
mov    %rcx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111d <copybbl+0x1d>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copybbl>:
mov    $0x100,%eax
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
mov    0x4000300(%rax,%rcx,8),%rdx
04
mov    %rdx,(%rax,%rcx,8)
mov    0x4000308(%rax,%rcx,8),%rdx
04
mov    %rdx,0x8(%rax,%rcx,8)
mov    0x4000310(%rax,%rcx,8),%rdx
04
mov    %rdx,0x10(%rax,%rcx,8)
mov    0x4000318(%rax,%rcx,8),%rdx
04
mov    %rdx,0x18(%rax,%rcx,8)
mov    0x4000320(%rax,%rcx,8),%rdx
04
mov    %rdx,0x20(%rax,%rcx,8)
mov    0x4000328(%rax,%rcx,8),%rdx
04
mov    %rdx,0x28(%rax,%rcx,8)
mov    0x4000330(%rax,%rcx,8),%rdx
04
mov    %rdx,0x30(%rax,%rcx,8)
mov    0x4000338(%rax,%rcx,8),%rdx
04
mov    %rdx,0x38(%rax,%rcx,8)
add    $0x8,%rcx
cmp    $0x2000,%ecx
jne    1110 <copybbl+0x10>
ret

LLVM IR (-O0):
define i32 @copybbl() {
%1 = alloca i32
%2 = alloca i64*
%3 = alloca i64*
%4 = alloca i32
store i64* inttoptr (i64 67109888 to i64*), i64** %2
store i64* inttoptr (i64 256 to i64*), i64** %3
store i32 0, i32* %4
br label %5
5: ; preds = %15, %0
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = icmp ult i64 %7, 8192
br i1 %8, label %9, label %18
9: ; preds = %5
%10 = load i64*, i64** %2
%11 = getelementptr inbounds i64, i64* %10, i32 1
store i64* %11, i64** %2
%12 = load volatile i64, i64* %10
%13 = load i64*, i64** %3
%14 = getelementptr inbounds i64, i64* %13, i32 1
store i64* %14, i64** %3
store volatile i64 %12, i64* %13
br label %15
15: ; preds = %9
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %5
18: ; preds = %5
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
define i32 @copybbl() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %29, %1 ]
%3 = phi i64* [ inttoptr (i64 256 to i64*), %0 ], [ %28, %1 ]
%4 = phi i64* [ inttoptr (i64 67109888 to i64*), %0 ], [ %26, %1 ]
%5 = getelementptr inbounds i64, i64* %4, i64 1
%6 = load volatile i64, i64* %4
%7 = getelementptr inbounds i64, i64* %3, i64 1
store volatile i64 %6, i64* %3
%8 = getelementptr inbounds i64, i64* %4, i64 2
%9 = load volatile i64, i64* %5
%10 = getelementptr inbounds i64, i64* %3, i64 2
store volatile i64 %9, i64* %7
%11 = getelementptr inbounds i64, i64* %4, i64 3
%12 = load volatile i64, i64* %8
%13 = getelementptr inbounds i64, i64* %3, i64 3
store volatile i64 %12, i64* %10
%14 = getelementptr inbounds i64, i64* %4, i64 4
%15 = load volatile i64, i64* %11
%16 = getelementptr inbounds i64, i64* %3, i64 4
store volatile i64 %15, i64* %13
%17 = getelementptr inbounds i64, i64* %4, i64 5
%18 = load volatile i64, i64* %14
%19 = getelementptr inbounds i64, i64* %3, i64 5
store volatile i64 %18, i64* %16
%20 = getelementptr inbounds i64, i64* %4, i64 6
%21 = load volatile i64, i64* %17
%22 = getelementptr inbounds i64, i64* %3, i64 6
store volatile i64 %21, i64* %19
%23 = getelementptr inbounds i64, i64* %4, i64 7
%24 = load volatile i64, i64* %20
%25 = getelementptr inbounds i64, i64* %3, i64 7
store volatile i64 %24, i64* %22
%26 = getelementptr inbounds i64, i64* %4, i64 8
%27 = load volatile i64, i64* %23
%28 = getelementptr inbounds i64, i64* %3, i64 8
store volatile i64 %27, i64* %25
%29 = add nuw nsw i32 %2, 8
%30 = icmp eq i32 %29, 8192
br i1 %30, label %31, label %1
31: ; preds = %1
ret i32 undef
}