#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 scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ shuffle4(scalar_t__, scalar_t__, scalar_t__, int);
uint32_t shuffle(uint32_t i, uint32_t j, uint32_t k) {
  return shuffle4(i, j, k, 0) + shuffle4(j, k, i, 1) + shuffle4(k, i, j, 2) +
         shuffle4(i, j, k, 3) + shuffle4(j, k, i, 4) + shuffle4(k, i, j, 5) +
         shuffle4(i, j, k, 6) + shuffle4(j, k, i, 7);
}


x86 assembly (clang, -O0):
<shuffle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <shuffle4@plt>
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <shuffle4@plt>
mov    %rax,%rcx
mov    -0x50(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x2,%ecx
call   1030 <shuffle4@plt>
mov    %rax,%rcx
mov    -0x48(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x3,%ecx
call   1030 <shuffle4@plt>
mov    %rax,%rcx
mov    -0x40(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <shuffle4@plt>
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x5,%ecx
call   1030 <shuffle4@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x6,%ecx
call   1030 <shuffle4@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    $0x7,%ecx
call   1030 <shuffle4@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shuffle>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r13
mov    %rdi,%r15
xor    %ecx,%ecx
call   1030 <shuffle4@plt>
mov    %rax,%r12
mov    %r13,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    $0x1,%ecx
call   1030 <shuffle4@plt>
mov    %rax,%rbx
add    %r12,%rbx
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r13,%rdx
mov    $0x2,%ecx
call   1030 <shuffle4@plt>
mov    %rax,%r12
add    %rbx,%r12
mov    %r15,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
mov    $0x3,%ecx
call   1030 <shuffle4@plt>
mov    %rax,%rbx
add    %r12,%rbx
mov    %r13,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    $0x4,%ecx
call   1030 <shuffle4@plt>
mov    %rax,%r12
add    %rbx,%r12
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r13,%rdx
mov    $0x5,%ecx
call   1030 <shuffle4@plt>
mov    %rax,%rbx
add    %r12,%rbx
mov    %r15,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
mov    $0x6,%ecx
call   1030 <shuffle4@plt>
mov    %rax,%r12
add    %rbx,%r12
mov    %r13,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    $0x7,%ecx
call   1030 <shuffle4@plt>
add    %r12,%rax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @shuffle(i64 %0, i64 %1, i64 %2) {
%4 = tail call i64 @shuffle4(i64 %0, i64 %1, i64 %2, i32 0)
%5 = tail call i64 @shuffle4(i64 %1, i64 %2, i64 %0, i32 1)
%6 = add nsw i64 %5, %4
%7 = tail call i64 @shuffle4(i64 %2, i64 %0, i64 %1, i32 2)
%8 = add nsw i64 %6, %7
%9 = tail call i64 @shuffle4(i64 %0, i64 %1, i64 %2, i32 3)
%10 = add nsw i64 %8, %9
%11 = tail call i64 @shuffle4(i64 %1, i64 %2, i64 %0, i32 4)
%12 = add nsw i64 %10, %11
%13 = tail call i64 @shuffle4(i64 %2, i64 %0, i64 %1, i32 5)
%14 = add nsw i64 %12, %13
%15 = tail call i64 @shuffle4(i64 %0, i64 %1, i64 %2, i32 6)
%16 = add nsw i64 %14, %15
%17 = tail call i64 @shuffle4(i64 %1, i64 %2, i64 %0, i32 7)
%18 = add nsw i64 %16, %17
ret i64 %18
}