#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_rrotate(int, int const);
void threefish_unmix(int d, int j, const int **table, uint64_t *mixed,
                     uint64_t *unmixed) {
  unmixed[1] = threefish_rrotate(mixed[1] ^ mixed[0], table[d % 8][j]);
  unmixed[0] = mixed[0] - unmixed[1];
}


x86 assembly (clang, -O0):
<threefish_unmix>:
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    0x4(%rax),%edi
mov    -0x18(%rbp),%rax
xor    (%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_rrotate@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
sub    0x4(%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<threefish_unmix>:
push   %r14
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%rbx
mov    (%rcx),%eax
xor    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_rrotate@plt>
mov    %eax,0x4(%r14)
mov    (%rbx),%ecx
sub    %eax,%ecx
mov    %ecx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @threefish_unmix(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 1
%13 = load i32, i32* %12
%14 = load i32*, i32** %9
%15 = getelementptr inbounds i32, i32* %14, i64 0
%16 = load i32, i32* %15
%17 = xor i32 %13, %16
%18 = load i32**, i32*** %8
%19 = load i32, i32* %6
%20 = srem i32 %19, 8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32*, i32** %18, i64 %21
%23 = load i32*, i32** %22
%24 = load i32, i32* %7
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
%27 = load i32, i32* %26
%28 = call i32 @threefish_rrotate(i32 %17, i32 %27)
%29 = load i32*, i32** %10
%30 = getelementptr inbounds i32, i32* %29, i64 1
store i32 %28, i32* %30
%31 = load i32*, i32** %9
%32 = getelementptr inbounds i32, i32* %31, i64 0
%33 = load i32, i32* %32
%34 = load i32*, i32** %10
%35 = getelementptr inbounds i32, i32* %34, i64 1
%36 = load i32, i32* %35
%37 = sub nsw i32 %33, %36
%38 = load i32*, i32** %10
%39 = getelementptr inbounds i32, i32* %38, i64 0
store i32 %37, i32* %39
ret void
}

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