void GenerateDNAOccCountTable(unsigned int *dnaDecodeTable) {
  unsigned int i, j, c, t;
  for (i = 0; i < 65536; i++) {
    dnaDecodeTable[i] = 0;
    c = i;
    for (j = 0; j < 8; j++) {
      t = c & 0x00000003;
      dnaDecodeTable[i] += 1 << (t * 8);
      c >>= 2;
    }
  }
}


x86 assembly (clang, -O0):
<GenerateDNAOccCountTable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10000,-0xc(%rbp)
jae    118e <GenerateDNAOccCountTable+0x8e>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jae    117b <GenerateDNAOccCountTable+0x7b>
mov    -0x14(%rbp),%eax
and    $0x3,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
shl    $0x3,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
shr    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1137 <GenerateDNAOccCountTable+0x37>
jmp    1180 <GenerateDNAOccCountTable+0x80>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <GenerateDNAOccCountTable+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenerateDNAOccCountTable>:
push   %rbp
push   %r14
push   %rbx
xor    %r9d,%r9d
xor    %r10d,%r10d
xor    %esi,%esi
nopl   0x0(%rax)
mov    %r10d,%ecx
and    $0x18,%cl
mov    $0x1,%r8d
shl    %cl,%r8d
mov    %r9d,%ecx
and    $0x18,%cl
mov    $0x1,%r11d
shl    %cl,%r11d
mov    %esi,%ecx
shr    %cl
and    $0x18,%cl
mov    $0x1,%r14d
shl    %cl,%r14d
mov    %esi,%ecx
shr    $0x3,%cl
and    $0x18,%cl
mov    $0x1,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    $0x5,%ecx
and    $0x18,%cl
mov    $0x1,%ebx
shl    %cl,%ebx
mov    %esi,%ecx
shr    $0x7,%ecx
and    $0x18,%cl
mov    $0x1,%ebp
shl    %cl,%ebp
add    %r8d,%r11d
add    %r11d,%r14d
mov    %esi,%ecx
shr    $0x9,%ecx
and    $0x18,%cl
mov    $0x1,%edx
shl    %cl,%edx
add    %r14d,%eax
add    %eax,%ebx
mov    %esi,%ecx
shr    $0xb,%ecx
and    $0x18,%cl
mov    $0x1,%eax
shl    %cl,%eax
add    %ebx,%ebp
add    %ebp,%edx
add    %edx,%eax
mov    %eax,(%rdi,%rsi,4)
add    $0x1,%rsi
add    $0x8,%r10d
add    $0x2,%r9d
cmp    $0x10000,%rsi
jne    1110 <GenerateDNAOccCountTable+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @GenerateDNAOccCountTable(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %7
7: ; preds = %37, %1
%8 = load i32, i32* %3
%9 = icmp ult i32 %8, 65536
br i1 %9, label %10, label %40
10: ; preds = %7
%11 = load i32*, i32** %2
%12 = load i32, i32* %3
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 0, i32* %14
%15 = load i32, i32* %3
store i32 %15, i32* %5
store i32 0, i32* %4
br label %16
16: ; preds = %33, %10
%17 = load i32, i32* %4
%18 = icmp ult i32 %17, 8
br i1 %18, label %19, label %36
19: ; preds = %16
%20 = load i32, i32* %5
%21 = and i32 %20, 3
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = mul i32 %22, 8
%24 = shl i32 1, %23
%25 = load i32*, i32** %2
%26 = load i32, i32* %3
%27 = zext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %25, i64 %27
%29 = load i32, i32* %28
%30 = add i32 %29, %24
store i32 %30, i32* %28
%31 = load i32, i32* %5
%32 = lshr i32 %31, 2
store i32 %32, i32* %5
br label %33
33: ; preds = %19
%34 = load i32, i32* %4
%35 = add i32 %34, 1
store i32 %35, i32* %4
br label %16
36: ; preds = %16
br label %37
37: ; preds = %36
%38 = load i32, i32* %3
%39 = add i32 %38, 1
store i32 %39, i32* %3
br label %7
40: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @GenerateDNAOccCountTable(i32* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %38, %2 ]
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = trunc i64 %3 to i32
%6 = shl i32 %5, 3
%7 = and i32 %6, 24
%8 = shl nuw nsw i32 1, %7
%9 = trunc i64 %3 to i32
%10 = shl i32 %9, 1
%11 = and i32 %10, 24
%12 = shl nuw nsw i32 1, %11
%13 = add nuw nsw i32 %8, %12
%14 = lshr i32 %9, 1
%15 = and i32 %14, 24
%16 = shl nuw nsw i32 1, %15
%17 = add nuw nsw i32 %13, %16
%18 = lshr i32 %9, 3
%19 = and i32 %18, 24
%20 = shl nuw nsw i32 1, %19
%21 = add nuw nsw i32 %17, %20
%22 = lshr i32 %9, 5
%23 = and i32 %22, 24
%24 = shl nuw nsw i32 1, %23
%25 = add nuw nsw i32 %21, %24
%26 = lshr i32 %9, 7
%27 = and i32 %26, 24
%28 = shl nuw nsw i32 1, %27
%29 = add nuw nsw i32 %25, %28
%30 = lshr i32 %9, 9
%31 = and i32 %30, 24
%32 = shl nuw nsw i32 1, %31
%33 = add nuw nsw i32 %29, %32
%34 = lshr i32 %9, 11
%35 = and i32 %34, 24
%36 = shl nuw nsw i32 1, %35
%37 = add nuw nsw i32 %33, %36
store i32 %37, i32* %4
%38 = add nuw nsw i64 %3, 1
%39 = icmp eq i64 %38, 65536
br i1 %39, label %40, label %2
40: ; preds = %2
ret void
}