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

/* Variables and functions */
void swap_endian_8byte(int8_t *e) {
  int8_t a;
  a = e[0];
  e[0] = e[7];
  e[7] = a;
  ;
  a = e[1];
  e[1] = e[6];
  e[6] = a;
  ;
  a = e[2];
  e[2] = e[5];
  e[5] = a;
  ;
  a = e[3];
  e[3] = e[4];
  e[4] = a;
  ;
}


x86 assembly (clang, -O0):
<swap_endian_8byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x1c(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x18(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_endian_8byte>:
movdqu (%rdi),%xmm0
movdqu 0x10(%rdi),%xmm1
pshufd $0x1b,%xmm1,%xmm1
movdqu %xmm1,(%rdi)
pshufd $0x1b,%xmm0,%xmm0
movdqu %xmm0,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @swap_endian_8byte(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = bitcast i32* %2 to <4 x i32>*
%4 = load <4 x i32>, <4 x i32>* %3
%5 = bitcast i32* %0 to <4 x i32>*
%6 = load <4 x i32>, <4 x i32>* %5
%7 = shufflevector <4 x i32> %4, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%8 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %7, <4 x i32>* %8
%9 = shufflevector <4 x i32> %6, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%10 = bitcast i32* %2 to <4 x i32>*
store <4 x i32> %9, <4 x i32>* %10
ret void
}