#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 uint32_t;
typedef size_t int8_t;

/* Variables and functions */
int READ_ROUND_KEY_DOUBLE_WORD(int const);
int rot32l8(int);
int rot32r3(int);
void Decrypt(uint8_t *block, uint8_t *roundKeys) {
  uint32_t *block32 = (uint32_t *)block;
  const uint32_t *rk = (uint32_t *)roundKeys;
  uint32_t y = block32[0];
  uint32_t x = block32[1];
  int8_t i;
  for (i = 27 - 1; i >= 0; --i) {
    y = rot32r3(x ^ y);
    x = rot32l8((x ^ READ_ROUND_KEY_DOUBLE_WORD(rk[i])) - y);
  }
  block32[0] = y;
  block32[1] = x;
}


x86 assembly (clang, -O0):
<Decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x28(%rbp)
movq   $0x1a,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jb     11bb <Decrypt+0x8b>
mov    -0x28(%rbp),%edi
xor    -0x24(%rbp),%edi
call   1030 <rot32r3@plt>
mov    %eax,-0x24(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1050 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    -0x34(%rbp),%edi
xor    %eax,%edi
sub    -0x24(%rbp),%edi
call   1040 <rot32l8@plt>
mov    %eax,-0x28(%rbp)
mov    -0x30(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x30(%rbp)
jmp    116b <Decrypt+0x3b>
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Decrypt>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    (%rdi),%ebp
mov    0x4(%rdi),%ebx
add    $0x68,%r14
xor    %ebx,%ebp
mov    %ebp,%edi
call   1030 <rot32r3@plt>
mov    %eax,%ebp
mov    (%r14),%edi
call   1050 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,%ebx
sub    %ebp,%ebx
mov    %ebx,%edi
call   1040 <rot32l8@plt>
mov    %eax,%ebx
add    $0xfffffffffffffffc,%r14
jmp    1140 <Decrypt+0x10>

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
%9 = alloca i64
store i32* %0, i32** %3
store i32* %1, i32** %4
%10 = load i32*, i32** %3
store i32* %10, i32** %5
%11 = load i32*, i32** %4
store i32* %11, i32** %6
%12 = load i32*, i32** %5
%13 = getelementptr inbounds i32, i32* %12, i64 0
%14 = load i32, i32* %13
store i32 %14, i32* %7
%15 = load i32*, i32** %5
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32, i32* %16
store i32 %17, i32* %8
store i64 26, i64* %9
br label %18
18: ; preds = %36, %2
%19 = load i64, i64* %9
%20 = icmp uge i64 %19, 0
br i1 %20, label %21, label %39
21: ; preds = %18
%22 = load i32, i32* %8
%23 = load i32, i32* %7
%24 = xor i32 %22, %23
%25 = call i32 @rot32r3(i32 %24)
store i32 %25, i32* %7
%26 = load i32, i32* %8
%27 = load i32*, i32** %6
%28 = load i64, i64* %9
%29 = getelementptr inbounds i32, i32* %27, i64 %28
%30 = load i32, i32* %29
%31 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %30)
%32 = xor i32 %26, %31
%33 = load i32, i32* %7
%34 = sub nsw i32 %32, %33
%35 = call i32 @rot32l8(i32 %34)
store i32 %35, i32* %8
br label %36
36: ; preds = %21
%37 = load i64, i64* %9
%38 = add i64 %37, -1
store i64 %38, i64* %9
br label %18
39: ; preds = %18
%40 = load i32, i32* %7
%41 = load i32*, i32** %5
%42 = getelementptr inbounds i32, i32* %41, i64 0
store i32 %40, i32* %42
%43 = load i32, i32* %8
%44 = load i32*, i32** %5
%45 = getelementptr inbounds i32, i32* %44, i64 1
store i32 %43, i32* %45
ret void
}

LLVM IR (-O2):
define void @Decrypt(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
br label %6
6: ; preds = %6, %2
%7 = phi i32 [ %3, %2 ], [ %11, %6 ]
%8 = phi i32 [ %5, %2 ], [ %17, %6 ]
%9 = phi i64 [ 26, %2 ], [ %18, %6 ]
%10 = xor i32 %8, %7
%11 = tail call i32 @rot32r3(i32 %10)
%12 = getelementptr inbounds i32, i32* %1, i64 %9
%13 = load i32, i32* %12
%14 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %13)
%15 = xor i32 %14, %8
%16 = sub nsw i32 %15, %11
%17 = tail call i32 @rot32l8(i32 %16)
%18 = add i64 %9, -1
br label %6
}