unsigned char mod_getclock(const unsigned int datacells) {
  unsigned char clock;
  clock = ((datacells & 0x8000) >> 8);
  clock |= ((datacells & 0x2000) >> 7);
  clock |= ((datacells & 0x0800) >> 6);
  clock |= ((datacells & 0x0200) >> 5);
  clock |= ((datacells & 0x0080) >> 4);
  clock |= ((datacells & 0x0020) >> 3);
  clock |= ((datacells & 0x0008) >> 2);
  clock |= ((datacells & 0x0002) >> 1);
  return clock;
}


x86 assembly (clang, -O0):
<mod_getclock>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8000,%eax
shr    $0x8,%eax
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x2000,%ecx
shr    $0x7,%ecx
movzbl -0x5(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x800,%ecx
shr    $0x6,%ecx
movzbl -0x5(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x200,%ecx
shr    $0x5,%ecx
movzbl -0x5(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x80,%ecx
shr    $0x4,%ecx
movzbl -0x5(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x20,%ecx
shr    $0x3,%ecx
movzbl -0x5(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x8,%ecx
shr    $0x2,%ecx
movzbl -0x5(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x2,%ecx
shr    $0x1,%ecx
movzbl -0x5(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod_getclock>:
mov    %edi,%eax
shr    $0x8,%eax
and    $0x80,%eax
mov    %edi,%ecx
shr    $0x7,%ecx
and    $0x40,%ecx
or     %eax,%ecx
mov    %edi,%eax
shr    $0x6,%eax
and    $0x20,%eax
or     %ecx,%eax
mov    %edi,%ecx
shr    $0x5,%ecx
and    $0x10,%ecx
or     %eax,%ecx
mov    %edi,%eax
shr    $0x4,%eax
and    $0x8,%eax
or     %ecx,%eax
mov    %edi,%ecx
shr    $0x3,%ecx
and    $0x4,%ecx
or     %eax,%ecx
mov    %edi,%eax
shr    $0x2,%eax
and    $0x2,%eax
or     %ecx,%eax
shr    %edi
and    $0x1,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @mod_getclock(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 32768
%6 = lshr i32 %5, 8
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i32, i32* %2
%9 = and i32 %8, 8192
%10 = lshr i32 %9, 7
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = or i32 %12, %10
%14 = trunc i32 %13 to i8
store i8 %14, i8* %3
%15 = load i32, i32* %2
%16 = and i32 %15, 2048
%17 = lshr i32 %16, 6
%18 = load i8, i8* %3
%19 = zext i8 %18 to i32
%20 = or i32 %19, %17
%21 = trunc i32 %20 to i8
store i8 %21, i8* %3
%22 = load i32, i32* %2
%23 = and i32 %22, 512
%24 = lshr i32 %23, 5
%25 = load i8, i8* %3
%26 = zext i8 %25 to i32
%27 = or i32 %26, %24
%28 = trunc i32 %27 to i8
store i8 %28, i8* %3
%29 = load i32, i32* %2
%30 = and i32 %29, 128
%31 = lshr i32 %30, 4
%32 = load i8, i8* %3
%33 = zext i8 %32 to i32
%34 = or i32 %33, %31
%35 = trunc i32 %34 to i8
store i8 %35, i8* %3
%36 = load i32, i32* %2
%37 = and i32 %36, 32
%38 = lshr i32 %37, 3
%39 = load i8, i8* %3
%40 = zext i8 %39 to i32
%41 = or i32 %40, %38
%42 = trunc i32 %41 to i8
store i8 %42, i8* %3
%43 = load i32, i32* %2
%44 = and i32 %43, 8
%45 = lshr i32 %44, 2
%46 = load i8, i8* %3
%47 = zext i8 %46 to i32
%48 = or i32 %47, %45
%49 = trunc i32 %48 to i8
store i8 %49, i8* %3
%50 = load i32, i32* %2
%51 = and i32 %50, 2
%52 = lshr i32 %51, 1
%53 = load i8, i8* %3
%54 = zext i8 %53 to i32
%55 = or i32 %54, %52
%56 = trunc i32 %55 to i8
store i8 %56, i8* %3
%57 = load i8, i8* %3
ret i8 %57
}

LLVM IR (-O2):
define zeroext i8 @mod_getclock(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 128
%4 = lshr i32 %0, 7
%5 = and i32 %4, 64
%6 = or i32 %3, %5
%7 = lshr i32 %0, 6
%8 = and i32 %7, 32
%9 = or i32 %6, %8
%10 = lshr i32 %0, 5
%11 = and i32 %10, 16
%12 = or i32 %9, %11
%13 = lshr i32 %0, 4
%14 = and i32 %13, 8
%15 = or i32 %12, %14
%16 = lshr i32 %0, 3
%17 = and i32 %16, 4
%18 = or i32 %15, %17
%19 = lshr i32 %0, 2
%20 = and i32 %19, 2
%21 = lshr i32 %0, 1
%22 = and i32 %21, 1
%23 = or i32 %18, %20
%24 = or i32 %23, %22
%25 = trunc i32 %24 to i8
ret i8 %25
}