#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 permute_8(void *data) {
  uint64_t t;
  t = (((uint64_t *)data)[(0)]);
  (((uint64_t *)data)[(0)]) = (((uint64_t *)data)[(2)]);
  (((uint64_t *)data)[(2)]) = (((uint64_t *)data)[(4)]);
  (((uint64_t *)data)[(4)]) = (((uint64_t *)data)[(6)]);
  (((uint64_t *)data)[(6)]) = t;
  t = (((uint64_t *)data)[(3)]);
  (((uint64_t *)data)[(3)]) = (((uint64_t *)data)[(7)]);
  (((uint64_t *)data)[(7)]) = t;
}


x86 assembly (clang, -O0):
<permute_8>:
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    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x18(%rax)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<permute_8>:
mov    (%rdi),%eax
mov    0x8(%rdi),%ecx
mov    %ecx,(%rdi)
mov    0x10(%rdi),%ecx
mov    %ecx,0x8(%rdi)
mov    0x18(%rdi),%ecx
mov    %ecx,0x10(%rdi)
mov    %eax,0x18(%rdi)
mov    0xc(%rdi),%eax
mov    0x1c(%rdi),%ecx
mov    %ecx,0xc(%rdi)
mov    %eax,0x1c(%rdi)
ret

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

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