#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;
typedef int int8_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) {
  int8_t i;
  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;
  *left ^= *right ^ rot32l8(*right) ^ rot32r8(*right);
  for (i = 2; i >= 0; i--) {
    speckey_inverse(b0_l, b0_r);
    *left ^= READ_ROUND_KEY_DOUBLE_WORD(roundKeys[i + 9]);
  }
  for (i = 2; i >= 0; i--) {
    speckey_inverse(b1_l, b1_r);
    *right ^= READ_ROUND_KEY_DOUBLE_WORD(roundKeys[i + 6]);
  }
  *right ^= *left ^ rot32l8(*left) ^ rot32r8(*left);
  for (i = 2; i >= 0; i--) {
    speckey_inverse(b1_l, b1_r);
    *right ^= READ_ROUND_KEY_DOUBLE_WORD(roundKeys[i + 3]);
  }
  for (i = 2; i >= 0; i--) {
    speckey_inverse(b0_l, b0_r);
    *left ^= READ_ROUND_KEY_DOUBLE_WORD(roundKeys[i]);
  }
}


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,-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)
movl   $0x2,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     11fd <round_f_inverse+0xbd>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1040 <speckey_inverse@plt>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x9,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    11b9 <round_f_inverse+0x79>
movl   $0x2,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     1248 <round_f_inverse+0x108>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1040 <speckey_inverse@plt>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x6,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1204 <round_f_inverse+0xc4>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x50(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1050 <rot32l8@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <rot32r8@plt>
mov    -0x4c(%rbp),%ecx
xor    %eax,%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
movl   $0x2,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     12c9 <round_f_inverse+0x189>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1040 <speckey_inverse@plt>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1285 <round_f_inverse+0x145>
movl   $0x2,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     130f <round_f_inverse+0x1cf>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1040 <speckey_inverse@plt>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    12d0 <round_f_inverse+0x190>
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),%r15
mov    (%rsi),%r13d
mov    %r13d,%edi
call   1050 <rot32l8@plt>
mov    %eax,%ebp
xor    %r13d,%ebp
mov    (%rbx),%edi
call   1030 <rot32r8@plt>
xor    %ebp,%eax
xor    %eax,(%r12)
mov    %r12,%rdi
mov    %r15,%rsi
call   1040 <speckey_inverse@plt>
mov    0x2c(%r14),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%r12)
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r15,(%rsp)
call   1040 <speckey_inverse@plt>
mov    0x28(%r14),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%r12)
mov    %r12,%rdi
mov    %r15,%rsi
call   1040 <speckey_inverse@plt>
mov    0x24(%r14),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%r12)
lea    0x4(%rbx),%r13
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <speckey_inverse@plt>
mov    0x20(%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    0x1c(%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    0x18(%r14),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%rbx)
mov    (%r12),%ebp
mov    %ebp,%edi
call   1050 <rot32l8@plt>
mov    %eax,%r15d
xor    %ebp,%r15d
mov    (%r12),%edi
call   1030 <rot32r8@plt>
xor    %r15d,%eax
xor    %eax,(%rbx)
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
%20 = load i32*, i32** %5
%21 = load i32, i32* %20
%22 = call i32 @rot32l8(i32 %21)
%23 = xor i32 %19, %22
%24 = load i32*, i32** %5
%25 = load i32, i32* %24
%26 = call i32 @rot32r8(i32 %25)
%27 = xor i32 %23, %26
%28 = load i32*, i32** %4
%29 = load i32, i32* %28
%30 = xor i32 %29, %27
store i32 %30, i32* %28
store i32 2, i32* %7
br label %31
31: ; preds = %48, %3
%32 = load i32, i32* %7
%33 = icmp sge i32 %32, 0
br i1 %33, label %34, label %51
34: ; preds = %31
%35 = load i32*, i32** %8
%36 = load i32*, i32** %9
%37 = call i32 @speckey_inverse(i32* %35, i32* %36)
%38 = load i32*, i32** %6
%39 = load i32, i32* %7
%40 = add nsw i32 %39, 9
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32, i32* %38, i64 %41
%43 = load i32, i32* %42
%44 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %43)
%45 = load i32*, i32** %4
%46 = load i32, i32* %45
%47 = xor i32 %46, %44
store i32 %47, i32* %45
br label %48
48: ; preds = %34
%49 = load i32, i32* %7
%50 = add nsw i32 %49, -1
store i32 %50, i32* %7
br label %31
51: ; preds = %31
store i32 2, i32* %7
br label %52
52: ; preds = %69, %51
%53 = load i32, i32* %7
%54 = icmp sge i32 %53, 0
br i1 %54, label %55, label %72
55: ; preds = %52
%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 = load i32, i32* %7
%61 = add nsw i32 %60, 6
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i32, i32* %59, i64 %62
%64 = load i32, i32* %63
%65 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %64)
%66 = load i32*, i32** %5
%67 = load i32, i32* %66
%68 = xor i32 %67, %65
store i32 %68, i32* %66
br label %69
69: ; preds = %55
%70 = load i32, i32* %7
%71 = add nsw i32 %70, -1
store i32 %71, i32* %7
br label %52
72: ; preds = %52
%73 = load i32*, i32** %4
%74 = load i32, i32* %73
%75 = load i32*, i32** %4
%76 = load i32, i32* %75
%77 = call i32 @rot32l8(i32 %76)
%78 = xor i32 %74, %77
%79 = load i32*, i32** %4
%80 = load i32, i32* %79
%81 = call i32 @rot32r8(i32 %80)
%82 = xor i32 %78, %81
%83 = load i32*, i32** %5
%84 = load i32, i32* %83
%85 = xor i32 %84, %82
store i32 %85, i32* %83
store i32 2, i32* %7
br label %86
86: ; preds = %103, %72
%87 = load i32, i32* %7
%88 = icmp sge i32 %87, 0
br i1 %88, label %89, label %106
89: ; preds = %86
%90 = load i32*, i32** %10
%91 = load i32*, i32** %11
%92 = call i32 @speckey_inverse(i32* %90, i32* %91)
%93 = load i32*, i32** %6
%94 = load i32, i32* %7
%95 = add nsw i32 %94, 3
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i32, i32* %93, i64 %96
%98 = load i32, i32* %97
%99 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %98)
%100 = load i32*, i32** %5
%101 = load i32, i32* %100
%102 = xor i32 %101, %99
store i32 %102, i32* %100
br label %103
103: ; preds = %89
%104 = load i32, i32* %7
%105 = add nsw i32 %104, -1
store i32 %105, i32* %7
br label %86
106: ; preds = %86
store i32 2, i32* %7
br label %107
107: ; preds = %123, %106
%108 = load i32, i32* %7
%109 = icmp sge i32 %108, 0
br i1 %109, label %110, label %126
110: ; preds = %107
%111 = load i32*, i32** %8
%112 = load i32*, i32** %9
%113 = call i32 @speckey_inverse(i32* %111, i32* %112)
%114 = load i32*, i32** %6
%115 = load i32, i32* %7
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds i32, i32* %114, i64 %116
%118 = load i32, i32* %117
%119 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %118)
%120 = load i32*, i32** %4
%121 = load i32, i32* %120
%122 = xor i32 %121, %119
store i32 %122, i32* %120
br label %123
123: ; preds = %110
%124 = load i32, i32* %7
%125 = add nsw i32 %124, -1
store i32 %125, i32* %7
br label %107
126: ; preds = %107
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 = load i32, i32* %1
%6 = tail call i32 @rot32l8(i32 %5)
%7 = xor i32 %6, %5
%8 = load i32, i32* %1
%9 = tail call i32 @rot32r8(i32 %8)
%10 = xor i32 %7, %9
%11 = load i32, i32* %0
%12 = xor i32 %10, %11
store i32 %12, i32* %0
%13 = tail call i32 @speckey_inverse(i32* %0, i32* %4)
%14 = getelementptr inbounds i32, i32* %2, i64 11
%15 = load i32, i32* %14
%16 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %15)
%17 = load i32, i32* %0
%18 = xor i32 %17, %16
store i32 %18, i32* %0
%19 = tail call i32 @speckey_inverse(i32* %0, i32* %4)
%20 = getelementptr inbounds i32, i32* %2, i64 10
%21 = load i32, i32* %20
%22 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %21)
%23 = load i32, i32* %0
%24 = xor i32 %23, %22
store i32 %24, i32* %0
%25 = tail call i32 @speckey_inverse(i32* %0, i32* %4)
%26 = getelementptr inbounds i32, i32* %2, i64 9
%27 = load i32, i32* %26
%28 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %27)
%29 = load i32, i32* %0
%30 = xor i32 %29, %28
store i32 %30, i32* %0
%31 = getelementptr inbounds i32, i32* %1, i64 1
%32 = tail call i32 @speckey_inverse(i32* %1, i32* %31)
%33 = getelementptr inbounds i32, i32* %2, i64 8
%34 = load i32, i32* %33
%35 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %34)
%36 = load i32, i32* %1
%37 = xor i32 %36, %35
store i32 %37, i32* %1
%38 = tail call i32 @speckey_inverse(i32* %1, i32* %31)
%39 = getelementptr inbounds i32, i32* %2, i64 7
%40 = load i32, i32* %39
%41 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %40)
%42 = load i32, i32* %1
%43 = xor i32 %42, %41
store i32 %43, i32* %1
%44 = tail call i32 @speckey_inverse(i32* %1, i32* %31)
%45 = getelementptr inbounds i32, i32* %2, i64 6
%46 = load i32, i32* %45
%47 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %46)
%48 = load i32, i32* %1
%49 = xor i32 %48, %47
store i32 %49, i32* %1
%50 = load i32, i32* %0
%51 = tail call i32 @rot32l8(i32 %50)
%52 = xor i32 %51, %50
%53 = load i32, i32* %0
%54 = tail call i32 @rot32r8(i32 %53)
%55 = xor i32 %52, %54
%56 = load i32, i32* %1
%57 = xor i32 %55, %56
store i32 %57, i32* %1
%58 = tail call i32 @speckey_inverse(i32* %1, i32* %31)
%59 = getelementptr inbounds i32, i32* %2, i64 5
%60 = load i32, i32* %59
%61 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %60)
%62 = load i32, i32* %1
%63 = xor i32 %62, %61
store i32 %63, i32* %1
%64 = tail call i32 @speckey_inverse(i32* %1, i32* %31)
%65 = getelementptr inbounds i32, i32* %2, i64 4
%66 = load i32, i32* %65
%67 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %66)
%68 = load i32, i32* %1
%69 = xor i32 %68, %67
store i32 %69, i32* %1
%70 = tail call i32 @speckey_inverse(i32* %1, i32* %31)
%71 = getelementptr inbounds i32, i32* %2, i64 3
%72 = load i32, i32* %71
%73 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %72)
%74 = load i32, i32* %1
%75 = xor i32 %74, %73
store i32 %75, i32* %1
%76 = tail call i32 @speckey_inverse(i32* %0, i32* %4)
%77 = getelementptr inbounds i32, i32* %2, i64 2
%78 = load i32, i32* %77
%79 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %78)
%80 = load i32, i32* %0
%81 = xor i32 %80, %79
store i32 %81, i32* %0
%82 = tail call i32 @speckey_inverse(i32* %0, i32* %4)
%83 = getelementptr inbounds i32, i32* %2, i64 1
%84 = load i32, i32* %83
%85 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %84)
%86 = load i32, i32* %0
%87 = xor i32 %86, %85
store i32 %87, i32* %0
%88 = tail call i32 @speckey_inverse(i32* %0, i32* %4)
%89 = load i32, i32* %2
%90 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %89)
%91 = load i32, i32* %0
%92 = xor i32 %91, %90
store i32 %92, i32* %0
ret void
}