#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;
typedef int uint16_t;

/* Variables and functions */
uint64_t swap64_c(uint64_t x) {
  uint16_t a0 = x >> 48;
  uint16_t a1 = x >> 32;
  uint16_t a2 = x >> 16;
  uint16_t a3 = x;
  return ((uint64_t)(((a0 >> 8) & 0xff) | ((a0 << 8) & 0xff00))) |
         ((uint64_t)(((a1 >> 8) & 0xff) | ((a1 << 8) & 0xff00)) << 16) |
         ((uint64_t)(((a2 >> 8) & 0xff) | ((a2 << 8) & 0xff00)) << 32) |
         ((uint64_t)(((a3 >> 8) & 0xff) | ((a3 << 8) & 0xff00)) << 48);
}


x86 assembly (clang, -O0):
<swap64_c>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x30,%ecx
sar    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0xc(%rbp),%edx
shl    $0x8,%edx
and    $0xff00,%edx
or     %edx,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%edx
sar    $0x8,%edx
and    $0xff,%edx
mov    -0x10(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x14(%rbp),%edx
sar    $0x8,%edx
and    $0xff,%edx
mov    -0x14(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%edx
mov    $0x30,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

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