#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 */
int UINT64_C(int);
__attribute__((always_)) uint64_t __attribute__((const))
OF_BSWAP64_CONST(uint64_t i) {
  return (i & UINT64_C(0xFF00000000000000)) >> 56 |
         (i & UINT64_C(0x00FF000000000000)) >> 40 |
         (i & UINT64_C(0x0000FF0000000000)) >> 24 |
         (i & UINT64_C(0x000000FF00000000)) >> 8 |
         (i & UINT64_C(0x00000000FF000000)) << 8 |
         (i & UINT64_C(0x0000000000FF0000)) << 24 |
         (i & UINT64_C(0x000000000000FF00)) << 40 |
         (i & UINT64_C(0x00000000000000FF)) << 56;
}


x86 assembly (clang, -O0):
<OF_BSWAP64_CONST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x40(%rbp)
xor    %edi,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%ecx
mov    -0x40(%rbp),%eax
and    %ecx,%eax
mov    $0x38,%ecx
sar    %cl,%eax
mov    %eax,-0x38(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x3c(%rbp)
xor    %edi,%edi
call   1030 <UINT64_C@plt>
mov    -0x3c(%rbp),%edx
mov    %eax,%ecx
mov    -0x38(%rbp),%eax
and    %ecx,%edx
mov    $0x28,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x30(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x34(%rbp)
xor    %edi,%edi
call   1030 <UINT64_C@plt>
mov    -0x34(%rbp),%ecx
mov    %eax,%edx
mov    -0x30(%rbp),%eax
and    %edx,%ecx
sar    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x2c(%rbp)
xor    %edi,%edi
call   1030 <UINT64_C@plt>
mov    -0x2c(%rbp),%ecx
mov    %eax,%edx
mov    -0x28(%rbp),%eax
and    %edx,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    $0xff000000,%edi
call   1030 <UINT64_C@plt>
mov    -0x24(%rbp),%ecx
mov    %eax,%edx
mov    -0x20(%rbp),%eax
and    %edx,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    $0xff0000,%edi
call   1030 <UINT64_C@plt>
mov    -0x1c(%rbp),%ecx
mov    %eax,%edx
mov    -0x18(%rbp),%eax
and    %edx,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0xff00,%edi
call   1030 <UINT64_C@plt>
mov    -0x14(%rbp),%edx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
and    %ecx,%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xff,%edi
call   1030 <UINT64_C@plt>
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
and    %ecx,%edx
mov    $0x38,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OF_BSWAP64_CONST>:
push   %rax
xor    %edi,%edi
call   1030 <UINT64_C@plt>
xor    %edi,%edi
call   1030 <UINT64_C@plt>
xor    %edi,%edi
call   1030 <UINT64_C@plt>
xor    %edi,%edi
call   1030 <UINT64_C@plt>
mov    $0xff000000,%edi
call   1030 <UINT64_C@plt>
mov    $0xff0000,%edi
call   1030 <UINT64_C@plt>
mov    $0xff00,%edi
call   1030 <UINT64_C@plt>
mov    $0xff,%edi
pop    %rax
jmp    1030 <UINT64_C@plt>

LLVM IR (-O0):
define i32 @OF_BSWAP64_CONST(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @UINT64_C(i32 0)
%5 = and i32 %3, %4
%6 = ashr i32 %5, 56
%7 = load i32, i32* %2
%8 = call i32 @UINT64_C(i32 0)
%9 = and i32 %7, %8
%10 = ashr i32 %9, 40
%11 = or i32 %6, %10
%12 = load i32, i32* %2
%13 = call i32 @UINT64_C(i32 0)
%14 = and i32 %12, %13
%15 = ashr i32 %14, 24
%16 = or i32 %11, %15
%17 = load i32, i32* %2
%18 = call i32 @UINT64_C(i32 0)
%19 = and i32 %17, %18
%20 = ashr i32 %19, 8
%21 = or i32 %16, %20
%22 = load i32, i32* %2
%23 = call i32 @UINT64_C(i32 -16777216)
%24 = and i32 %22, %23
%25 = shl i32 %24, 8
%26 = or i32 %21, %25
%27 = load i32, i32* %2
%28 = call i32 @UINT64_C(i32 16711680)
%29 = and i32 %27, %28
%30 = shl i32 %29, 24
%31 = or i32 %26, %30
%32 = load i32, i32* %2
%33 = call i32 @UINT64_C(i32 65280)
%34 = and i32 %32, %33
%35 = shl i32 %34, 40
%36 = or i32 %31, %35
%37 = load i32, i32* %2
%38 = call i32 @UINT64_C(i32 255)
%39 = and i32 %37, %38
%40 = shl i32 %39, 56
%41 = or i32 %36, %40
ret i32 %41
}

LLVM IR (-O2):
define i32 @OF_BSWAP64_CONST(i32 %0) {
%2 = tail call i32 @UINT64_C(i32 0)
%3 = tail call i32 @UINT64_C(i32 0)
%4 = tail call i32 @UINT64_C(i32 0)
%5 = tail call i32 @UINT64_C(i32 0)
%6 = tail call i32 @UINT64_C(i32 -16777216)
%7 = tail call i32 @UINT64_C(i32 16711680)
%8 = tail call i32 @UINT64_C(i32 65280)
%9 = tail call i32 @UINT64_C(i32 255)
ret i32 poison
}