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

/* Variables and functions */
int threefish_lrotate(int, int const);
void threefish_mix(int d, int j, const int **table, uint64_t *unmixed,
                   uint64_t *mixed) {
  mixed[0] = unmixed[0] + unmixed[1];
  mixed[1] = threefish_lrotate(unmixed[1], table[d % 8][j]) ^ mixed[0];
}


x86 assembly (clang, -O0):
<threefish_mix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
add    0x4(%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edi
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x28(%rbp),%rax
movslq %edx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <threefish_lrotate@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
xor    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x4(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<threefish_mix>:
push   %rbx
mov    %r8,%rbx
mov    0x4(%rcx),%eax
add    (%rcx),%eax
mov    %eax,(%r8)
mov    0x4(%rcx),%eax
lea    0x7(%rdi),%ecx
test   %edi,%edi
cmovns %edi,%ecx
and    $0xfffffff8,%ecx
sub    %ecx,%edi
movslq %edi,%rcx
mov    (%rdx,%rcx,8),%rcx
movslq %esi,%rdx
mov    (%rcx,%rdx,4),%esi
mov    %eax,%edi
call   1030 <threefish_lrotate@plt>
xor    (%rbx),%eax
mov    %eax,0x4(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @threefish_mix(i32 %0, i32 %1, i32** %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32**
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32** %2, i32*** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %9
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = load i32*, i32** %9
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = add nsw i32 %13, %16
%18 = load i32*, i32** %10
%19 = getelementptr inbounds i32, i32* %18, i64 0
store i32 %17, i32* %19
%20 = load i32*, i32** %9
%21 = getelementptr inbounds i32, i32* %20, i64 1
%22 = load i32, i32* %21
%23 = load i32**, i32*** %8
%24 = load i32, i32* %6
%25 = srem i32 %24, 8
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32*, i32** %23, i64 %26
%28 = load i32*, i32** %27
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
%32 = load i32, i32* %31
%33 = call i32 @threefish_lrotate(i32 %22, i32 %32)
%34 = load i32*, i32** %10
%35 = getelementptr inbounds i32, i32* %34, i64 0
%36 = load i32, i32* %35
%37 = xor i32 %33, %36
%38 = load i32*, i32** %10
%39 = getelementptr inbounds i32, i32* %38, i64 1
store i32 %37, i32* %39
ret void
}

LLVM IR (-O2):
define void @threefish_mix(i32 %0, i32 %1, i32** nocapture %2, i32* nocapture %3, i32* nocapture %4) {
%6 = load i32, i32* %3
%7 = getelementptr inbounds i32, i32* %3, i64 1
%8 = load i32, i32* %7
%9 = add nsw i32 %8, %6
store i32 %9, i32* %4
%10 = load i32, i32* %7
%11 = srem i32 %0, 8
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32*, i32** %2, i64 %12
%14 = load i32*, i32** %13
%15 = sext i32 %1 to i64
%16 = getelementptr inbounds i32, i32* %14, i64 %15
%17 = load i32, i32* %16
%18 = tail call i32 @threefish_lrotate(i32 %10, i32 %17)
%19 = load i32, i32* %4
%20 = xor i32 %19, %18
%21 = getelementptr inbounds i32, i32* %4, i64 1
store i32 %20, i32* %21
ret void
}