#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 size_t uint8_t;
typedef int uint32_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];
  uint8_t i = 26;
  while (i > 0) {
    y = rot32r3(x ^ y);
    x = rot32l8((x ^ READ_ROUND_KEY_DOUBLE_WORD(rk[--i])) - y);
    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)
jbe    11fb <Decrypt+0xcb>
mov    -0x28(%rbp),%edi
xor    -0x24(%rbp),%edi
call   1030 <rot32r3@plt>
mov    %eax,-0x24(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %rcx,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x30(%rbp)
mov    -0x4(%rax,%rcx,4),%edi
call   1050 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    -0x38(%rbp),%edi
xor    %eax,%edi
sub    -0x24(%rbp),%edi
call   1040 <rot32l8@plt>
mov    %eax,-0x28(%rbp)
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    %rcx,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x30(%rbp)
mov    -0x4(%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)
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   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    (%rdi),%ebp
mov    0x4(%rdi),%ebx
mov    $0x18,%r12d
nopl   0x0(%rax)
xor    %ebx,%ebp
mov    %ebp,%edi
call   1030 <rot32r3@plt>
mov    %eax,%ebp
mov    0x4(%r15,%r12,4),%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
xor    %eax,%ebp
mov    %ebp,%edi
call   1030 <rot32r3@plt>
mov    %eax,%ebp
mov    (%r15,%r12,4),%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    $0xfffffffffffffffe,%r12
cmp    $0xfffffffffffffffe,%r12
jne    1150 <Decrypt+0x20>
mov    %ebp,(%r14)
mov    %ebx,0x4(%r14)
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @Decrypt(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%10 = load i64*, i64** %3
%11 = bitcast i64* %10 to i32*
store i32* %11, i32** %5
%12 = load i64*, i64** %4
%13 = bitcast i64* %12 to i32*
store i32* %13, i32** %6
%14 = load i32*, i32** %5
%15 = getelementptr inbounds i32, i32* %14, i64 0
%16 = load i32, i32* %15
store i32 %16, i32* %7
%17 = load i32*, i32** %5
%18 = getelementptr inbounds i32, i32* %17, i64 1
%19 = load i32, i32* %18
store i32 %19, i32* %8
store i64 26, i64* %9
br label %20
20: ; preds = %23, %2
%21 = load i64, i64* %9
%22 = icmp ugt i64 %21, 0
br i1 %22, label %23, label %54
23: ; preds = %20
%24 = load i32, i32* %8
%25 = load i32, i32* %7
%26 = xor i32 %24, %25
%27 = call i32 @rot32r3(i32 %26)
store i32 %27, i32* %7
%28 = load i32, i32* %8
%29 = load i32*, i32** %6
%30 = load i64, i64* %9
%31 = add i64 %30, -1
store i64 %31, i64* %9
%32 = getelementptr inbounds i32, i32* %29, i64 %31
%33 = load i32, i32* %32
%34 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %33)
%35 = xor i32 %28, %34
%36 = load i32, i32* %7
%37 = sub nsw i32 %35, %36
%38 = call i32 @rot32l8(i32 %37)
store i32 %38, i32* %8
%39 = load i32, i32* %8
%40 = load i32, i32* %7
%41 = xor i32 %39, %40
%42 = call i32 @rot32r3(i32 %41)
store i32 %42, i32* %7
%43 = load i32, i32* %8
%44 = load i32*, i32** %6
%45 = load i64, i64* %9
%46 = add i64 %45, -1
store i64 %46, i64* %9
%47 = getelementptr inbounds i32, i32* %44, i64 %46
%48 = load i32, i32* %47
%49 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %48)
%50 = xor i32 %43, %49
%51 = load i32, i32* %7
%52 = sub nsw i32 %50, %51
%53 = call i32 @rot32l8(i32 %52)
store i32 %53, i32* %8
br label %20
54: ; preds = %20
%55 = load i32, i32* %7
%56 = load i32*, i32** %5
%57 = getelementptr inbounds i32, i32* %56, i64 0
store i32 %55, i32* %57
%58 = load i32, i32* %8
%59 = load i32*, i32** %5
%60 = getelementptr inbounds i32, i32* %59, i64 1
store i32 %58, i32* %60
ret void
}

LLVM IR (-O2):
define void @Decrypt(i64* nocapture %0, i64* nocapture %1) {
%3 = bitcast i64* %0 to i32*
%4 = bitcast i64* %1 to i32*
%5 = load i32, i32* %3
%6 = getelementptr inbounds i32, i32* %3, i64 1
%7 = load i32, i32* %6
br label %8
8: ; preds = %2, %8
%9 = phi i64 [ 26, %2 ], [ %23, %8 ]
%10 = phi i32 [ %7, %2 ], [ %29, %8 ]
%11 = phi i32 [ %5, %2 ], [ %22, %8 ]
%12 = xor i32 %10, %11
%13 = tail call i32 @rot32r3(i32 %12)
%14 = add nsw i64 %9, -1
%15 = getelementptr inbounds i32, i32* %4, i64 %14
%16 = load i32, i32* %15
%17 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %16)
%18 = xor i32 %17, %10
%19 = sub nsw i32 %18, %13
%20 = tail call i32 @rot32l8(i32 %19)
%21 = xor i32 %20, %13
%22 = tail call i32 @rot32r3(i32 %21)
%23 = add nsw i64 %9, -2
%24 = getelementptr inbounds i32, i32* %4, i64 %23
%25 = load i32, i32* %24
%26 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %25)
%27 = xor i32 %26, %20
%28 = sub nsw i32 %27, %22
%29 = tail call i32 @rot32l8(i32 %28)
%30 = icmp eq i64 %23, 0
br i1 %30, label %31, label %8
31: ; preds = %8
store i32 %22, i32* %3
store i32 %29, i32* %6
ret void
}