#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t Bits_bitReverse64(uint64_t toReverse) {
  toReverse = ((toReverse >> 1) & 0x5555555555555555ull) |
              ((toReverse & 0x5555555555555555ull) << 1);
  toReverse = ((toReverse >> 2) & 0x3333333333333333ull) |
              ((toReverse & 0x3333333333333333ull) << 2);
  toReverse = ((toReverse >> 4) & 0x0F0F0F0F0F0F0F0Full) |
              ((toReverse & 0x0F0F0F0F0F0F0F0Full) << 4);
  toReverse = ((toReverse >> 8) & 0x00FF00FF00FF00FFull) |
              ((toReverse & 0x00FF00FF00FF00FFull) << 8);
  toReverse = ((toReverse >> 16) & 0x0000FFFF0000FFFFull) |
              ((toReverse & 0x0000FFFF0000FFFFull) << 16);
  toReverse = ((toReverse >> 32) & 0x00000000FFFFFFFFull) |
              ((toReverse & 0x00000000FFFFFFFFull) << 32);
  return toReverse;
}


x86 assembly (clang, -O0):
<Bits_bitReverse64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
cltq
movabs $0x5555555555555555,%rcx
55 55 55
and    %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0x5555555555555555,%rdx
55 55 55
and    %rdx,%rcx
shl    $0x1,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
cltq
movabs $0x3333333333333333,%rcx
33 33 33
and    %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0x3333333333333333,%rdx
33 33 33
and    %rdx,%rcx
shl    $0x2,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
cltq
movabs $0xf0f0f0f0f0f0f0f,%rcx
0f 0f 0f
and    %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0xf0f0f0f0f0f0f0f,%rdx
0f 0f 0f
and    %rdx,%rcx
shl    $0x4,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
cltq
movabs $0xff00ff00ff00ff,%rcx
and    %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0xff00ff00ff00ff,%rdx
and    %rdx,%rcx
shl    $0x8,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
cltq
movabs $0xffff0000ffff,%rcx
and    %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0xffff0000ffff,%rdx
and    %rdx,%rcx
shl    $0x10,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
cltq
movabs $0xffffffff,%rcx
and    %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0xffffffff,%rdx
and    %rdx,%rcx
shl    $0x20,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bits_bitReverse64>:
ret

LLVM IR (-O0):
define i32 @Bits_bitReverse64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 1
%5 = sext i32 %4 to i64
%6 = and i64 %5, 6148914691236517205
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = and i64 %8, 6148914691236517205
%10 = shl i64 %9, 1
%11 = or i64 %6, %10
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 2
%15 = sext i32 %14 to i64
%16 = and i64 %15, 3689348814741910323
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = and i64 %18, 3689348814741910323
%20 = shl i64 %19, 2
%21 = or i64 %16, %20
%22 = trunc i64 %21 to i32
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = ashr i32 %23, 4
%25 = sext i32 %24 to i64
%26 = and i64 %25, 1085102592571150095
%27 = load i32, i32* %2
%28 = sext i32 %27 to i64
%29 = and i64 %28, 1085102592571150095
%30 = shl i64 %29, 4
%31 = or i64 %26, %30
%32 = trunc i64 %31 to i32
store i32 %32, i32* %2
%33 = load i32, i32* %2
%34 = ashr i32 %33, 8
%35 = sext i32 %34 to i64
%36 = and i64 %35, 71777214294589695
%37 = load i32, i32* %2
%38 = sext i32 %37 to i64
%39 = and i64 %38, 71777214294589695
%40 = shl i64 %39, 8
%41 = or i64 %36, %40
%42 = trunc i64 %41 to i32
store i32 %42, i32* %2
%43 = load i32, i32* %2
%44 = ashr i32 %43, 16
%45 = sext i32 %44 to i64
%46 = and i64 %45, 281470681808895
%47 = load i32, i32* %2
%48 = sext i32 %47 to i64
%49 = and i64 %48, 281470681808895
%50 = shl i64 %49, 16
%51 = or i64 %46, %50
%52 = trunc i64 %51 to i32
store i32 %52, i32* %2
%53 = load i32, i32* %2
%54 = ashr i32 %53, 32
%55 = sext i32 %54 to i64
%56 = and i64 %55, 4294967295
%57 = load i32, i32* %2
%58 = sext i32 %57 to i64
%59 = and i64 %58, 4294967295
%60 = shl i64 %59, 32
%61 = or i64 %56, %60
%62 = trunc i64 %61 to i32
store i32 %62, i32* %2
%63 = load i32, i32* %2
ret i32 %63
}

LLVM IR (-O2):
define i32 @Bits_bitReverse64(i32 %0) {
ret i32 poison
}