void dacP98FillRGBMap(unsigned char *pBuffer) {
  unsigned long dw, dw1;
  unsigned long *pdw = (unsigned long *)(pBuffer);
  for (dw = 256, dw1 = 0; dw; dw--, dw1 += 0x01010101) {
    *pdw++ = dw1;
    *pdw++ = dw1;
    *pdw++ = dw1;
    *pdw++ = dw1;
  }
}


x86 assembly (clang, -O0):
<dacP98FillRGBMap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x100,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11a2 <dacP98FillRGBMap+0xa2>
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x20(%rbp)
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x20(%rbp)
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x20(%rbp)
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x20(%rbp)
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1010101,%rax
mov    %rax,-0x18(%rbp)
jmp    1120 <dacP98FillRGBMap+0x20>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dacP98FillRGBMap>:
xor    %eax,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rcx,(%rdi,%rax,1)
mov    %rcx,0x8(%rdi,%rax,1)
mov    %rcx,0x10(%rdi,%rax,1)
mov    %rcx,0x18(%rdi,%rax,1)
lea    0x1010101(%rcx),%rdx
mov    %rdx,0x20(%rdi,%rax,1)
mov    %rdx,0x28(%rdi,%rax,1)
mov    %rdx,0x30(%rdi,%rax,1)
mov    %rdx,0x38(%rdi,%rax,1)
lea    0x2020202(%rcx),%rdx
mov    %rdx,0x40(%rdi,%rax,1)
mov    %rdx,0x48(%rdi,%rax,1)
mov    %rdx,0x50(%rdi,%rax,1)
mov    %rdx,0x58(%rdi,%rax,1)
lea    0x3030303(%rcx),%rdx
mov    %rdx,0x60(%rdi,%rax,1)
mov    %rdx,0x68(%rdi,%rax,1)
mov    %rdx,0x70(%rdi,%rax,1)
mov    %rdx,0x78(%rdi,%rax,1)
sub    $0xffffffffffffff80,%rax
add    $0x4040404,%rcx
cmp    $0x2000,%rax
jne    1110 <dacP98FillRGBMap+0x10>
ret

LLVM IR (-O0):
define void @dacP98FillRGBMap(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64*
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %5
store i64 256, i64* %3
store i64 0, i64* %4
br label %8
8: ; preds = %24, %1
%9 = load i64, i64* %3
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %29
11: ; preds = %8
%12 = load i64, i64* %4
%13 = load i64*, i64** %5
%14 = getelementptr inbounds i64, i64* %13, i32 1
store i64* %14, i64** %5
store i64 %12, i64* %13
%15 = load i64, i64* %4
%16 = load i64*, i64** %5
%17 = getelementptr inbounds i64, i64* %16, i32 1
store i64* %17, i64** %5
store i64 %15, i64* %16
%18 = load i64, i64* %4
%19 = load i64*, i64** %5
%20 = getelementptr inbounds i64, i64* %19, i32 1
store i64* %20, i64** %5
store i64 %18, i64* %19
%21 = load i64, i64* %4
%22 = load i64*, i64** %5
%23 = getelementptr inbounds i64, i64* %22, i32 1
store i64* %23, i64** %5
store i64 %21, i64* %22
br label %24
24: ; preds = %11
%25 = load i64, i64* %3
%26 = add i64 %25, -1
store i64 %26, i64* %3
%27 = load i64, i64* %4
%28 = add i64 %27, 16843009
store i64 %28, i64* %4
br label %8
29: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @dacP98FillRGBMap(i8* nocapture writeonly %0) {
%2 = bitcast i8* %0 to i64*
br label %3
3: ; preds = %3, %1
%4 = phi i64* [ %2, %1 ], [ %25, %3 ]
%5 = phi i64 [ 0, %1 ], [ %27, %3 ]
%6 = phi i64 [ 256, %1 ], [ %26, %3 ]
%7 = getelementptr inbounds i64, i64* %4, i64 1
store i64 %5, i64* %4
%8 = getelementptr inbounds i64, i64* %4, i64 2
store i64 %5, i64* %7
%9 = getelementptr inbounds i64, i64* %4, i64 3
store i64 %5, i64* %8
%10 = getelementptr inbounds i64, i64* %4, i64 4
store i64 %5, i64* %9
%11 = add nuw nsw i64 %5, 16843009
%12 = getelementptr inbounds i64, i64* %4, i64 5
store i64 %11, i64* %10
%13 = getelementptr inbounds i64, i64* %4, i64 6
store i64 %11, i64* %12
%14 = getelementptr inbounds i64, i64* %4, i64 7
store i64 %11, i64* %13
%15 = getelementptr inbounds i64, i64* %4, i64 8
store i64 %11, i64* %14
%16 = add nuw nsw i64 %5, 33686018
%17 = getelementptr inbounds i64, i64* %4, i64 9
store i64 %16, i64* %15
%18 = getelementptr inbounds i64, i64* %4, i64 10
store i64 %16, i64* %17
%19 = getelementptr inbounds i64, i64* %4, i64 11
store i64 %16, i64* %18
%20 = getelementptr inbounds i64, i64* %4, i64 12
store i64 %16, i64* %19
%21 = add nuw nsw i64 %5, 50529027
%22 = getelementptr inbounds i64, i64* %4, i64 13
store i64 %21, i64* %20
%23 = getelementptr inbounds i64, i64* %4, i64 14
store i64 %21, i64* %22
%24 = getelementptr inbounds i64, i64* %4, i64 15
store i64 %21, i64* %23
%25 = getelementptr inbounds i64, i64* %4, i64 16
store i64 %21, i64* %24
%26 = add nsw i64 %6, -4
%27 = add nuw nsw i64 %5, 67372036
%28 = icmp eq i64 %26, 0
br i1 %28, label %29, label %3
29: ; preds = %3
ret void
}