#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 /*<<< 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 ^ (((*right) << (8)) | ((*right) >> (32 - 8))) ^
           (((*right) >> (8)) | ((*right) << (32 - 8)));
  *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    $0x40,%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),%ecx
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rdx
mov    (%rdx),%edx
sar    $0x18,%edx
or     %edx,%eax
xor    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sar    $0x8,%eax
mov    -0x10(%rbp),%rdx
mov    (%rdx),%edx
shl    $0x18,%edx
or     %edx,%eax
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   1030 <speckey_inverse@plt>
mov    -0x18(%rbp),%rax
mov    0x14(%rax),%edi
call   1040 <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   1030 <speckey_inverse@plt>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%edi
call   1040 <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   1030 <speckey_inverse@plt>
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%edi
call   1040 <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   1030 <speckey_inverse@plt>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%edi
call   1040 <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   1030 <speckey_inverse@plt>
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edi
call   1040 <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   1030 <speckey_inverse@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1040 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_f_inverse>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r12
lea    0x4(%rdi),%r15
lea    0x4(%rsi),%r13
mov    (%rsi),%eax
mov    %eax,%ecx
shl    $0x8,%ecx
mov    %eax,%edx
sar    $0x18,%edx
or     %ecx,%edx
mov    %eax,%ecx
sar    $0x8,%ecx
mov    %eax,%esi
shl    $0x18,%esi
or     %ecx,%esi
mov    (%rdi),%ecx
xor    %eax,%ecx
xor    %edx,%ecx
xor    %esi,%ecx
mov    %ecx,(%rbx)
mov    %eax,(%rdi)
mov    %rbx,%rdi
mov    %r13,%rsi
call   1030 <speckey_inverse@plt>
mov    0x14(%r14),%edi
call   1040 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%rbx)
mov    %rbx,%rdi
mov    %r13,%rsi
call   1030 <speckey_inverse@plt>
mov    0x10(%r14),%edi
call   1040 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%rbx)
mov    %rbx,%rdi
mov    %r13,%rsi
call   1030 <speckey_inverse@plt>
mov    0xc(%r14),%edi
call   1040 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%rbx)
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <speckey_inverse@plt>
mov    0x8(%r14),%edi
call   1040 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%r12)
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <speckey_inverse@plt>
mov    0x4(%r14),%edi
call   1040 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%r12)
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <speckey_inverse@plt>
mov    (%r14),%edi
call   1040 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%r12)
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
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 = shl i32 %23, 8
%25 = load i32*, i32** %5
%26 = load i32, i32* %25
%27 = ashr i32 %26, 24
%28 = or i32 %24, %27
%29 = xor i32 %21, %28
%30 = load i32*, i32** %5
%31 = load i32, i32* %30
%32 = ashr i32 %31, 8
%33 = load i32*, i32** %5
%34 = load i32, i32* %33
%35 = shl i32 %34, 24
%36 = or i32 %32, %35
%37 = xor i32 %29, %36
%38 = load i32*, i32** %4
%39 = load i32, i32* %38
%40 = xor i32 %39, %37
store i32 %40, i32* %38
%41 = load i32*, i32** %4
%42 = load i32, i32* %41
%43 = load i32*, i32** %5
store i32 %42, i32* %43
%44 = load i32, i32* %7
%45 = load i32*, i32** %4
store i32 %44, i32* %45
%46 = load i32*, i32** %10
%47 = load i32*, i32** %11
%48 = call i32 @speckey_inverse(i32* %46, i32* %47)
%49 = load i32*, i32** %6
%50 = getelementptr inbounds i32, i32* %49, i64 5
%51 = load i32, i32* %50
%52 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %51)
%53 = load i32*, i32** %5
%54 = load i32, i32* %53
%55 = xor i32 %54, %52
store i32 %55, i32* %53
%56 = load i32*, i32** %10
%57 = load i32*, i32** %11
%58 = call i32 @speckey_inverse(i32* %56, i32* %57)
%59 = load i32*, i32** %6
%60 = getelementptr inbounds i32, i32* %59, i64 4
%61 = load i32, i32* %60
%62 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %61)
%63 = load i32*, i32** %5
%64 = load i32, i32* %63
%65 = xor i32 %64, %62
store i32 %65, i32* %63
%66 = load i32*, i32** %10
%67 = load i32*, i32** %11
%68 = call i32 @speckey_inverse(i32* %66, i32* %67)
%69 = load i32*, i32** %6
%70 = getelementptr inbounds i32, i32* %69, i64 3
%71 = load i32, i32* %70
%72 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %71)
%73 = load i32*, i32** %5
%74 = load i32, i32* %73
%75 = xor i32 %74, %72
store i32 %75, i32* %73
%76 = load i32*, i32** %8
%77 = load i32*, i32** %9
%78 = call i32 @speckey_inverse(i32* %76, i32* %77)
%79 = load i32*, i32** %6
%80 = getelementptr inbounds i32, i32* %79, i64 2
%81 = load i32, i32* %80
%82 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %81)
%83 = load i32*, i32** %4
%84 = load i32, i32* %83
%85 = xor i32 %84, %82
store i32 %85, i32* %83
%86 = load i32*, i32** %8
%87 = load i32*, i32** %9
%88 = call i32 @speckey_inverse(i32* %86, i32* %87)
%89 = load i32*, i32** %6
%90 = getelementptr inbounds i32, i32* %89, i64 1
%91 = load i32, i32* %90
%92 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %91)
%93 = load i32*, i32** %4
%94 = load i32, i32* %93
%95 = xor i32 %94, %92
store i32 %95, i32* %93
%96 = load i32*, i32** %8
%97 = load i32*, i32** %9
%98 = call i32 @speckey_inverse(i32* %96, i32* %97)
%99 = load i32*, i32** %6
%100 = getelementptr inbounds i32, i32* %99, i64 0
%101 = load i32, i32* %100
%102 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %101)
%103 = load i32*, i32** %4
%104 = load i32, i32* %103
%105 = xor i32 %104, %102
store i32 %105, i32* %103
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 = shl i32 %6, 8
%8 = ashr i32 %6, 24
%9 = or i32 %7, %8
%10 = ashr i32 %6, 8
%11 = shl i32 %6, 24
%12 = or i32 %10, %11
%13 = load i32, i32* %0
%14 = xor i32 %13, %6
%15 = xor i32 %14, %9
%16 = xor i32 %15, %12
store i32 %16, i32* %1
store i32 %6, i32* %0
%17 = tail call i32 @speckey_inverse(i32* %1, i32* %5)
%18 = getelementptr inbounds i32, i32* %2, i64 5
%19 = load i32, i32* %18
%20 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %19)
%21 = load i32, i32* %1
%22 = xor i32 %21, %20
store i32 %22, i32* %1
%23 = tail call i32 @speckey_inverse(i32* %1, i32* %5)
%24 = getelementptr inbounds i32, i32* %2, i64 4
%25 = load i32, i32* %24
%26 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %25)
%27 = load i32, i32* %1
%28 = xor i32 %27, %26
store i32 %28, i32* %1
%29 = tail call i32 @speckey_inverse(i32* %1, i32* %5)
%30 = getelementptr inbounds i32, i32* %2, i64 3
%31 = load i32, i32* %30
%32 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %31)
%33 = load i32, i32* %1
%34 = xor i32 %33, %32
store i32 %34, i32* %1
%35 = tail call i32 @speckey_inverse(i32* %0, i32* %4)
%36 = getelementptr inbounds i32, i32* %2, i64 2
%37 = load i32, i32* %36
%38 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %37)
%39 = load i32, i32* %0
%40 = xor i32 %39, %38
store i32 %40, i32* %0
%41 = tail call i32 @speckey_inverse(i32* %0, i32* %4)
%42 = getelementptr inbounds i32, i32* %2, i64 1
%43 = load i32, i32* %42
%44 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %43)
%45 = load i32, i32* %0
%46 = xor i32 %45, %44
store i32 %46, i32* %0
%47 = tail call i32 @speckey_inverse(i32* %0, i32* %4)
%48 = load i32, i32* %2
%49 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %48)
%50 = load i32, i32* %0
%51 = xor i32 %50, %49
store i32 %51, i32* %0
ret void
}