#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 uint8_t;
typedef int uint64_t;

/* Variables and functions */
int galois_x4_1(int);
int /*<<< orphan*/ gmix_column(int *);
uint64_t mixNibbles(uint64_t state) {
  uint64_t temp_state[8];
  temp_state[0] = (state >> 56) & 0xFF;
  temp_state[1] = (state >> 48) & 0xFF;
  temp_state[2] = (state >> 40) & 0xFF;
  temp_state[3] = (state >> 32) & 0xFF;
  temp_state[4] = (state >> 24) & 0xFF;
  temp_state[5] = (state >> 16) & 0xFF;
  temp_state[6] = (state >> 8) & 0xFF;
  temp_state[7] = (state >> 0) & 0xFF;
  gmix_column(temp_state);
  gmix_column((temp_state + 4));
  return ((temp_state[0] << 56) | (temp_state[1] << 48) |
          (temp_state[2] << 40) | (temp_state[3] << 32) |
          (temp_state[4] << 24) | (temp_state[5] << 16) | (temp_state[6] << 8) |
          (temp_state[7] << 0));
  uint8_t c01_1 = galois_x4_1((uint8_t)(state >> 56) & 0xFF);
  uint8_t c01_2 = c01_1 << 1;
  uint8_t c01_3 = c01_1 ^ c01_2;
  uint8_t c23_1 = galois_x4_1((uint8_t)(state >> 48) & 0xFF);
  uint8_t c23_2 = c23_1 << 1;
  uint8_t c23_3 = c23_1 ^ c23_2;
  uint8_t c45_1 = galois_x4_1((uint8_t)(state >> 40) & 0xFF);
  uint8_t c45_2 = c45_1 << 1;
  uint8_t c45_3 = c45_1 ^ c45_2;
  uint8_t c67_1 = galois_x4_1((uint8_t)(state >> 32) & 0xFF);
  uint8_t c67_2 = c67_1 << 1;
  uint8_t c67_3 = c67_1 ^ c67_2;
  uint8_t c89_1 = galois_x4_1((uint8_t)(state >> 24) & 0xFF);
  uint8_t c89_2 = c89_1 << 1;
  uint8_t c89_3 = c89_1 ^ c89_2;
  uint8_t cAB_1 = galois_x4_1((uint8_t)(state >> 16) & 0xFF);
  uint8_t cAB_2 = cAB_1 << 1;
  uint8_t cAB_3 = cAB_1 ^ cAB_2;
  uint8_t cCD_1 = galois_x4_1((uint8_t)(state >> 8) & 0xFF);
  uint8_t cCD_2 = cCD_1 << 1;
  uint8_t cCD_3 = cCD_1 ^ cCD_2;
  uint8_t cEF_1 = galois_x4_1((uint8_t)state & 0xFF);
  uint8_t cEF_2 = cEF_1 << 1;
  uint8_t cEF_3 = cEF_1 ^ cEF_2;
  uint8_t s01 = galois_x4_1((uint8_t)c01_2 ^ c23_3 ^ c45_1 ^ c67_1);
  uint8_t s23 = galois_x4_1((uint8_t)c01_1 ^ c23_2 ^ c45_3 ^ c67_1);
  uint8_t s45 = galois_x4_1((uint8_t)c01_1 ^ c23_1 ^ c45_2 ^ c67_3);
  uint8_t s67 = galois_x4_1((uint8_t)c01_3 ^ c23_1 ^ c45_1 ^ c67_2);
  uint8_t s89 = galois_x4_1((uint8_t)c89_2 ^ cAB_3 ^ cCD_1 ^ cEF_1);
  uint8_t sAB = galois_x4_1((uint8_t)c89_1 ^ cAB_2 ^ cCD_3 ^ cEF_1);
  uint8_t sCD = galois_x4_1((uint8_t)c89_1 ^ cAB_1 ^ cCD_2 ^ cEF_3);
  uint8_t sEF = galois_x4_1((uint8_t)c89_3 ^ cAB_1 ^ cCD_1 ^ cEF_2);
  return (((uint64_t)s01) << 56) ^ (((uint64_t)s23) << 48) ^
         (((uint64_t)s45) << 40) ^ (((uint64_t)s67) << 32) ^
         (((uint64_t)s89) << 24) ^ (((uint64_t)sAB) << 16) ^
         (((uint64_t)sCD) << 8) ^ (uint64_t)sEF;
}


x86 assembly (clang, -O0):
<mixNibbles>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x38,%ecx
sar    %cl,%eax
and    $0xff,%eax
mov    %eax,-0x30(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x30,%ecx
sar    %cl,%eax
and    $0xff,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x28,%ecx
sar    %cl,%eax
and    $0xff,%eax
mov    %eax,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
and    $0xff,%eax
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %eax,-0x14(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <gmix_column@plt>
lea    -0x30(%rbp),%rdi
add    $0x10,%rdi
call   1030 <gmix_column@plt>
mov    -0x30(%rbp),%eax
mov    $0x38,%ecx
shl    %cl,%eax
mov    -0x2c(%rbp),%edx
mov    $0x30,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x28(%rbp),%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x24(%rbp),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x20(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x1c(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x18(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x14(%rbp),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixNibbles>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%eax
mov    %edi,%ecx
movzbl %ah,%edx
movzbl %al,%esi
shr    $0x18,%eax
mov    %eax,0x10(%rsp)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %eax,0x14(%rsp)
lea    0x10(%rsp),%rbx
mov    %edx,0x18(%rsp)
mov    %esi,0x1c(%rsp)
mov    %rsp,%rdi
call   1030 <gmix_column@plt>
mov    %rbx,%rdi
call   1030 <gmix_column@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mixNibbles(i32 %0) {
%2 = alloca i32
%3 = alloca [8 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32
%32 = alloca i32
%33 = alloca i32
%34 = alloca i32
%35 = alloca i32
store i32 %0, i32* %2
%36 = load i32, i32* %2
%37 = ashr i32 %36, 56
%38 = and i32 %37, 255
%39 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
store i32 %38, i32* %39
%40 = load i32, i32* %2
%41 = ashr i32 %40, 48
%42 = and i32 %41, 255
%43 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 1
store i32 %42, i32* %43
%44 = load i32, i32* %2
%45 = ashr i32 %44, 40
%46 = and i32 %45, 255
%47 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 2
store i32 %46, i32* %47
%48 = load i32, i32* %2
%49 = ashr i32 %48, 32
%50 = and i32 %49, 255
%51 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 3
store i32 %50, i32* %51
%52 = load i32, i32* %2
%53 = ashr i32 %52, 24
%54 = and i32 %53, 255
%55 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 4
store i32 %54, i32* %55
%56 = load i32, i32* %2
%57 = ashr i32 %56, 16
%58 = and i32 %57, 255
%59 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 5
store i32 %58, i32* %59
%60 = load i32, i32* %2
%61 = ashr i32 %60, 8
%62 = and i32 %61, 255
%63 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 6
store i32 %62, i32* %63
%64 = load i32, i32* %2
%65 = ashr i32 %64, 0
%66 = and i32 %65, 255
%67 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 7
store i32 %66, i32* %67
%68 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%69 = call i32 @gmix_column(i32* %68)
%70 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%71 = getelementptr inbounds i32, i32* %70, i64 4
%72 = call i32 @gmix_column(i32* %71)
%73 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%74 = load i32, i32* %73
%75 = shl i32 %74, 56
%76 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 1
%77 = load i32, i32* %76
%78 = shl i32 %77, 48
%79 = or i32 %75, %78
%80 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 2
%81 = load i32, i32* %80
%82 = shl i32 %81, 40
%83 = or i32 %79, %82
%84 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 3
%85 = load i32, i32* %84
%86 = shl i32 %85, 32
%87 = or i32 %83, %86
%88 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 4
%89 = load i32, i32* %88
%90 = shl i32 %89, 24
%91 = or i32 %87, %90
%92 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 5
%93 = load i32, i32* %92
%94 = shl i32 %93, 16
%95 = or i32 %91, %94
%96 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 6
%97 = load i32, i32* %96
%98 = shl i32 %97, 8
%99 = or i32 %95, %98
%100 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 7
%101 = load i32, i32* %100
%102 = shl i32 %101, 0
%103 = or i32 %99, %102
ret i32 %103
}

LLVM IR (-O2):
define i32 @mixNibbles(i32 %0) {
%2 = alloca [8 x i32]
%3 = bitcast [8 x i32]* %2 to i8*
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%5 = lshr i32 %0, 24
%6 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 4
store i32 %5, i32* %6
%7 = lshr i32 %0, 16
%8 = and i32 %7, 255
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 5
store i32 %8, i32* %9
%10 = lshr i32 %0, 8
%11 = and i32 %10, 255
%12 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 6
store i32 %11, i32* %12
%13 = and i32 %0, 255
%14 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 7
store i32 %13, i32* %14
%15 = call i32 @gmix_column(i32* %4)
%16 = call i32 @gmix_column(i32* %6)
ret i32 poison
}