#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 uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int READ_ROUND_KEY_DOUBLE_WORD(int);
int rot32l8(int);
int rot32r8(int);
int /*<<< orphan*/ speckey_inverse(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void round_f_inverse(uint32_t *left, uint32_t *right, uint32_t *roundKeys) {
  uint32_t temp;
  uint16_t *b0_l = (uint16_t *)left;
  uint16_t *b0_r = (uint16_t *)left + 1;
  uint16_t *b1_l = (uint16_t *)right;
  uint16_t *b1_r = (uint16_t *)right + 1;
  temp = *right;
  *left ^= *right ^ rot32l8(*right) ^ rot32r8(*right);
  *right = *left;
  *left = temp;
  speckey_inverse(b1_l, b1_r);
  *right ^= READ_ROUND_KEY_DOUBLE_WORD(roundKeys[5]);
  speckey_inverse(b1_l, b1_r);
  *right ^= READ_ROUND_KEY_DOUBLE_WORD(roundKeys[4]);
  speckey_inverse(b1_l, b1_r);
  *right ^= READ_ROUND_KEY_DOUBLE_WORD(roundKeys[3]);
  speckey_inverse(b0_l, b0_r);
  *left ^= READ_ROUND_KEY_DOUBLE_WORD(roundKeys[2]);
  speckey_inverse(b0_l, b0_r);
  *left ^= READ_ROUND_KEY_DOUBLE_WORD(roundKeys[1]);
  speckey_inverse(b0_l, b0_r);
  *left ^= READ_ROUND_KEY_DOUBLE_WORD(roundKeys[0]);
}


x86 assembly (clang, -O0):
<round_f_inverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1050 <rot32l8@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x44(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <rot32r8@plt>
mov    -0x44(%rbp),%ecx
xor    %eax,%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1040 <speckey_inverse@plt>
mov    -0x18(%rbp),%rax
mov    0x14(%rax),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1040 <speckey_inverse@plt>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1040 <speckey_inverse@plt>
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1040 <speckey_inverse@plt>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1040 <speckey_inverse@plt>
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1040 <speckey_inverse@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_f_inverse>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r12
lea    0x4(%rdi),%rax
mov    %rax,(%rsp)
lea    0x4(%rsi),%r13
mov    (%rsi),%ebp
mov    %ebp,%edi
call   1050 <rot32l8@plt>
mov    %eax,%r15d
xor    %ebp,%r15d
mov    (%rbx),%edi
call   1030 <rot32r8@plt>
xor    %r15d,%eax
xor    (%r12),%eax
mov    %eax,(%rbx)
mov    %ebp,(%r12)
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <speckey_inverse@plt>
mov    0x14(%r14),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%rbx)
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <speckey_inverse@plt>
mov    0x10(%r14),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%rbx)
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <speckey_inverse@plt>
mov    0xc(%r14),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%rbx)
mov    %r12,%rdi
mov    (%rsp),%rbx
mov    %rbx,%rsi
call   1040 <speckey_inverse@plt>
mov    0x8(%r14),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%r12)
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <speckey_inverse@plt>
mov    0x4(%r14),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%r12)
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <speckey_inverse@plt>
mov    (%r14),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%r12)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @round_f_inverse(i32* %0, i32* %1, i32* nocapture %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = getelementptr inbounds i32, i32* %1, i64 1
%6 = load i32, i32* %1
%7 = tail call i32 @rot32l8(i32 %6)
%8 = xor i32 %7, %6
%9 = load i32, i32* %1
%10 = tail call i32 @rot32r8(i32 %9)
%11 = xor i32 %8, %10
%12 = load i32, i32* %0
%13 = xor i32 %11, %12
store i32 %13, i32* %1
store i32 %6, i32* %0
%14 = tail call i32 @speckey_inverse(i32* %1, i32* %5)
%15 = getelementptr inbounds i32, i32* %2, i64 5
%16 = load i32, i32* %15
%17 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %16)
%18 = load i32, i32* %1
%19 = xor i32 %18, %17
store i32 %19, i32* %1
%20 = tail call i32 @speckey_inverse(i32* %1, i32* %5)
%21 = getelementptr inbounds i32, i32* %2, i64 4
%22 = load i32, i32* %21
%23 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %22)
%24 = load i32, i32* %1
%25 = xor i32 %24, %23
store i32 %25, i32* %1
%26 = tail call i32 @speckey_inverse(i32* %1, i32* %5)
%27 = getelementptr inbounds i32, i32* %2, i64 3
%28 = load i32, i32* %27
%29 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %28)
%30 = load i32, i32* %1
%31 = xor i32 %30, %29
store i32 %31, i32* %1
%32 = tail call i32 @speckey_inverse(i32* %0, i32* %4)
%33 = getelementptr inbounds i32, i32* %2, i64 2
%34 = load i32, i32* %33
%35 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %34)
%36 = load i32, i32* %0
%37 = xor i32 %36, %35
store i32 %37, i32* %0
%38 = tail call i32 @speckey_inverse(i32* %0, i32* %4)
%39 = getelementptr inbounds i32, i32* %2, i64 1
%40 = load i32, i32* %39
%41 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %40)
%42 = load i32, i32* %0
%43 = xor i32 %42, %41
store i32 %43, i32* %0
%44 = tail call i32 @speckey_inverse(i32* %0, i32* %4)
%45 = load i32, i32* %2
%46 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %45)
%47 = load i32, i32* %0
%48 = xor i32 %47, %46
store i32 %48, i32* %0
ret void
}