#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 /*<<< orphan*/ uint64_t;

/* Variables and functions */
void swap_uint64(uint64_t *x) {
  char n;
  n = ((char *)x)[0];
  ((char *)x)[0] = ((char *)x)[7];
  ((char *)x)[7] = n;
  n = ((char *)x)[1];
  ((char *)x)[1] = ((char *)x)[6];
  ((char *)x)[6] = n;
  n = ((char *)x)[2];
  ((char *)x)[2] = ((char *)x)[5];
  ((char *)x)[5] = n;
  n = ((char *)x)[3];
  ((char *)x)[3] = ((char *)x)[4];
  ((char *)x)[4] = n;
}


x86 assembly (clang, -O0):
<swap_uint64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x7(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x7(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x6(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x6(%rax)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x5(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x5(%rax)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_uint64>:
mov    (%rdi),%al
mov    0x7(%rdi),%cl
mov    %cl,(%rdi)
mov    %al,0x7(%rdi)
movzwl 0x1(%rdi),%eax
rol    $0x8,%ax
movzwl 0x5(%rdi),%ecx
rol    $0x8,%cx
mov    %cx,0x1(%rdi)
mov    %ax,0x5(%rdi)
rolw   $0x8,0x3(%rdi)
ret

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

LLVM IR (-O2):
define void @swap_uint64(i32* nocapture %0) {
%2 = bitcast i32* %0 to i8*
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %2, i64 7
%5 = load i8, i8* %4
store i8 %5, i8* %2
store i8 %3, i8* %4
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %2, i64 6
%9 = load i8, i8* %8
store i8 %9, i8* %6
store i8 %7, i8* %8
%10 = getelementptr inbounds i8, i8* %2, i64 2
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %2, i64 5
%13 = load i8, i8* %12
store i8 %13, i8* %10
store i8 %11, i8* %12
%14 = getelementptr inbounds i8, i8* %2, i64 3
%15 = load i8, i8* %14
%16 = getelementptr inbounds i32, i32* %0, i64 1
%17 = bitcast i32* %16 to i8*
%18 = load i8, i8* %17
store i8 %18, i8* %14
store i8 %15, i8* %17
ret void
}