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

/* Variables and functions */
int /*<<< orphan*/ READ_ROUND_KEY_DOUBLE_WORD(int /*<<< orphan*/);
int /*<<< orphan*/ round_f_inverse(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                   int /*<<< orphan*/ *);
void Decrypt(uint8_t *block, uint8_t *roundKeys) {
  int8_t i;
  uint32_t *left = (uint32_t *)block;
  uint32_t *right = (uint32_t *)block + 1;
  uint32_t *RoundKeys = (uint32_t *)roundKeys;
  *left ^= READ_ROUND_KEY_DOUBLE_WORD(RoundKeys[6 * 8]);
  *right ^= READ_ROUND_KEY_DOUBLE_WORD(RoundKeys[6 * 8 + 1]);
  for (i = 8 - 1; i >= 0; i--) {
    round_f_inverse(left, right, &RoundKeys[6 * i]);
  }
}


x86 assembly (clang, -O0):
<Decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    0xc0(%rax),%edi
call   1040 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x30(%rbp),%rax
mov    0xc4(%rax),%edi
call   1040 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
movl   $0x7,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     11bb <Decrypt+0x9b>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
imul   $0x6,-0x14(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdx
call   1030 <round_f_inverse@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1185 <Decrypt+0x65>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Decrypt>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x4(%rdi),%r15
mov    0xc0(%rsi),%edi
call   1040 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%rbx)
mov    0xc4(%r14),%edi
call   1040 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,0x4(%rbx)
lea    0xa8(%r14),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <round_f_inverse@plt>
lea    0x90(%r14),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <round_f_inverse@plt>
lea    0x78(%r14),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <round_f_inverse@plt>
lea    0x60(%r14),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <round_f_inverse@plt>
lea    0x48(%r14),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <round_f_inverse@plt>
lea    0x30(%r14),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <round_f_inverse@plt>
lea    0x18(%r14),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <round_f_inverse@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <round_f_inverse@plt>

LLVM IR (-O0):
define void @Decrypt(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%9 = load i32*, i32** %3
store i32* %9, i32** %6
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32* %11, i32** %7
%12 = load i32*, i32** %4
store i32* %12, i32** %8
%13 = load i32*, i32** %8
%14 = getelementptr inbounds i32, i32* %13, i64 48
%15 = load i32, i32* %14
%16 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %15)
%17 = load i32*, i32** %6
%18 = load i32, i32* %17
%19 = xor i32 %18, %16
store i32 %19, i32* %17
%20 = load i32*, i32** %8
%21 = getelementptr inbounds i32, i32* %20, i64 49
%22 = load i32, i32* %21
%23 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %22)
%24 = load i32*, i32** %7
%25 = load i32, i32* %24
%26 = xor i32 %25, %23
store i32 %26, i32* %24
store i32 7, i32* %5
br label %27
27: ; preds = %39, %2
%28 = load i32, i32* %5
%29 = icmp sge i32 %28, 0
br i1 %29, label %30, label %42
30: ; preds = %27
%31 = load i32*, i32** %6
%32 = load i32*, i32** %7
%33 = load i32*, i32** %8
%34 = load i32, i32* %5
%35 = mul nsw i32 6, %34
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i32, i32* %33, i64 %36
%38 = call i32 @round_f_inverse(i32* %31, i32* %32, i32* %37)
br label %39
39: ; preds = %30
%40 = load i32, i32* %5
%41 = add nsw i32 %40, -1
store i32 %41, i32* %5
br label %27
42: ; preds = %27
ret void
}

LLVM IR (-O2):
define void @Decrypt(i32* %0, i32* %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = getelementptr inbounds i32, i32* %1, i64 48
%5 = load i32, i32* %4
%6 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %5)
%7 = load i32, i32* %0
%8 = xor i32 %7, %6
store i32 %8, i32* %0
%9 = getelementptr inbounds i32, i32* %1, i64 49
%10 = load i32, i32* %9
%11 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %10)
%12 = load i32, i32* %3
%13 = xor i32 %12, %11
store i32 %13, i32* %3
%14 = getelementptr inbounds i32, i32* %1, i64 42
%15 = tail call i32 @round_f_inverse(i32* %0, i32* %3, i32* %14)
%16 = getelementptr inbounds i32, i32* %1, i64 36
%17 = tail call i32 @round_f_inverse(i32* %0, i32* %3, i32* %16)
%18 = getelementptr inbounds i32, i32* %1, i64 30
%19 = tail call i32 @round_f_inverse(i32* %0, i32* %3, i32* %18)
%20 = getelementptr inbounds i32, i32* %1, i64 24
%21 = tail call i32 @round_f_inverse(i32* %0, i32* %3, i32* %20)
%22 = getelementptr inbounds i32, i32* %1, i64 18
%23 = tail call i32 @round_f_inverse(i32* %0, i32* %3, i32* %22)
%24 = getelementptr inbounds i32, i32* %1, i64 12
%25 = tail call i32 @round_f_inverse(i32* %0, i32* %3, i32* %24)
%26 = getelementptr inbounds i32, i32* %1, i64 6
%27 = tail call i32 @round_f_inverse(i32* %0, i32* %3, i32* %26)
%28 = tail call i32 @round_f_inverse(i32* %0, i32* %3, i32* %1)
ret void
}