#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 uint8_t;
typedef int uint32_t;

/* Variables and functions */
int READ_ROUND_KEY_DOUBLE_WORD(int);
void Decrypt(uint8_t *block, uint8_t *roundKeys) {
  uint8_t i;
  uint32_t *Block = (uint32_t *)block;
  uint32_t *RoundKeys = (uint32_t *)roundKeys;
  for (i = 20; i > 0; i--) {
    Block[1] =
        (((Block[1] - READ_ROUND_KEY_DOUBLE_WORD(RoundKeys[2 * i + 1])) >>
          (Block[0] & (32 - 1))) |
         ((Block[1] - READ_ROUND_KEY_DOUBLE_WORD(RoundKeys[2 * i + 1]))
          << (32 - (Block[0] & (32 - 1))))) ^
        Block[0];
    Block[0] = (((Block[0] - READ_ROUND_KEY_DOUBLE_WORD(RoundKeys[2 * i])) >>
                 (Block[1] & (32 - 1))) |
                ((Block[0] - READ_ROUND_KEY_DOUBLE_WORD(RoundKeys[2 * i]))
                 << (32 - (Block[1] & (32 - 1))))) ^
               Block[1];
  }
  Block[1] = Block[1] - READ_ROUND_KEY_DOUBLE_WORD(RoundKeys[1]);
  Block[0] = Block[0] - READ_ROUND_KEY_DOUBLE_WORD(RoundKeys[0]);
}


x86 assembly (clang, -O0):
<Decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x14,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1251 <Decrypt+0x141>
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x40(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x40(%rbp),%eax
sub    %ecx,%eax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%ecx
and    $0x1f,%ecx
sar    %cl,%eax
mov    %eax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
sub    %ecx,%eax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%edx
and    $0x1f,%edx
mov    $0x20,%ecx
sub    %edx,%ecx
shl    %cl,%eax
mov    -0x38(%rbp),%ecx
or     %eax,%ecx
mov    -0x20(%rbp),%rax
xor    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
sub    %ecx,%eax
mov    -0x20(%rbp),%rcx
mov    0x4(%rcx),%ecx
and    $0x1f,%ecx
sar    %cl,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
sub    %ecx,%eax
mov    -0x20(%rbp),%rcx
mov    0x4(%rcx),%edx
and    $0x1f,%edx
mov    $0x20,%ecx
sub    %edx,%ecx
shl    %cl,%eax
mov    -0x2c(%rbp),%ecx
or     %eax,%ecx
mov    -0x20(%rbp),%rax
xor    0x4(%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <Decrypt+0x27>
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x48(%rbp)
mov    -0x28(%rbp),%rax
mov    0x4(%rax),%edi
call   1030 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    -0x48(%rbp),%ecx
sub    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%edi
call   1030 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    -0x44(%rbp),%ecx
sub    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Decrypt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
mov    0x4(%rdi),%ebp
mov    $0x15,%r12d
nopw   0x0(%rax,%rax,1)
mov    -0x4(%r14,%r12,8),%edi
call   1030 <READ_ROUND_KEY_DOUBLE_WORD@plt>
sub    %eax,%ebp
movzbl (%r15),%ecx
sar    %cl,%ebp
mov    0x4(%r15),%ebx
mov    -0x4(%r14,%r12,8),%edi
call   1030 <READ_ROUND_KEY_DOUBLE_WORD@plt>
sub    %eax,%ebx
mov    (%r15),%r13d
mov    %r13d,%ecx
and    $0x1f,%cl
neg    %cl
shl    %cl,%ebx
or     %ebp,%ebx
xor    %r13d,%ebx
mov    %ebx,0x4(%r15)
mov    -0x8(%r14,%r12,8),%edi
call   1030 <READ_ROUND_KEY_DOUBLE_WORD@plt>
sub    %eax,%r13d
movzbl 0x4(%r15),%ecx
sar    %cl,%r13d
mov    (%r15),%ebx
mov    -0x8(%r14,%r12,8),%edi
call   1030 <READ_ROUND_KEY_DOUBLE_WORD@plt>
sub    %eax,%ebx
mov    0x4(%r15),%ebp
mov    %ebp,%ecx
and    $0x1f,%cl
neg    %cl
shl    %cl,%ebx
or     %r13d,%ebx
xor    %ebp,%ebx
mov    %ebx,(%r15)
add    $0xffffffffffffffff,%r12
cmp    $0x1,%r12
ja     1130 <Decrypt+0x20>
mov    0x4(%r14),%edi
call   1030 <READ_ROUND_KEY_DOUBLE_WORD@plt>
sub    %eax,%ebp
mov    %ebp,0x4(%r15)
mov    (%r15),%ebx
mov    (%r14),%edi
call   1030 <READ_ROUND_KEY_DOUBLE_WORD@plt>
sub    %eax,%ebx
mov    %ebx,(%r15)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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*
store i32* %0, i32** %3
store i32* %1, i32** %4
%8 = load i32*, i32** %3
store i32* %8, i32** %6
%9 = load i32*, i32** %4
store i32* %9, i32** %7
store i32 20, i32* %5
br label %10
10: ; preds = %96, %2
%11 = load i32, i32* %5
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %99
13: ; preds = %10
%14 = load i32*, i32** %6
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = load i32*, i32** %7
%18 = load i32, i32* %5
%19 = mul nsw i32 2, %18
%20 = add nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %17, i64 %21
%23 = load i32, i32* %22
%24 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %23)
%25 = sub nsw i32 %16, %24
%26 = load i32*, i32** %6
%27 = getelementptr inbounds i32, i32* %26, i64 0
%28 = load i32, i32* %27
%29 = and i32 %28, 31
%30 = ashr i32 %25, %29
%31 = load i32*, i32** %6
%32 = getelementptr inbounds i32, i32* %31, i64 1
%33 = load i32, i32* %32
%34 = load i32*, i32** %7
%35 = load i32, i32* %5
%36 = mul nsw i32 2, %35
%37 = add nsw i32 %36, 1
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i32, i32* %34, i64 %38
%40 = load i32, i32* %39
%41 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %40)
%42 = sub nsw i32 %33, %41
%43 = load i32*, i32** %6
%44 = getelementptr inbounds i32, i32* %43, i64 0
%45 = load i32, i32* %44
%46 = and i32 %45, 31
%47 = sub nsw i32 32, %46
%48 = shl i32 %42, %47
%49 = or i32 %30, %48
%50 = load i32*, i32** %6
%51 = getelementptr inbounds i32, i32* %50, i64 0
%52 = load i32, i32* %51
%53 = xor i32 %49, %52
%54 = load i32*, i32** %6
%55 = getelementptr inbounds i32, i32* %54, i64 1
store i32 %53, i32* %55
%56 = load i32*, i32** %6
%57 = getelementptr inbounds i32, i32* %56, i64 0
%58 = load i32, i32* %57
%59 = load i32*, i32** %7
%60 = load i32, i32* %5
%61 = mul nsw i32 2, %60
%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 = sub nsw i32 %58, %65
%67 = load i32*, i32** %6
%68 = getelementptr inbounds i32, i32* %67, i64 1
%69 = load i32, i32* %68
%70 = and i32 %69, 31
%71 = ashr i32 %66, %70
%72 = load i32*, i32** %6
%73 = getelementptr inbounds i32, i32* %72, i64 0
%74 = load i32, i32* %73
%75 = load i32*, i32** %7
%76 = load i32, i32* %5
%77 = mul nsw i32 2, %76
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i32, i32* %75, i64 %78
%80 = load i32, i32* %79
%81 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %80)
%82 = sub nsw i32 %74, %81
%83 = load i32*, i32** %6
%84 = getelementptr inbounds i32, i32* %83, i64 1
%85 = load i32, i32* %84
%86 = and i32 %85, 31
%87 = sub nsw i32 32, %86
%88 = shl i32 %82, %87
%89 = or i32 %71, %88
%90 = load i32*, i32** %6
%91 = getelementptr inbounds i32, i32* %90, i64 1
%92 = load i32, i32* %91
%93 = xor i32 %89, %92
%94 = load i32*, i32** %6
%95 = getelementptr inbounds i32, i32* %94, i64 0
store i32 %93, i32* %95
br label %96
96: ; preds = %13
%97 = load i32, i32* %5
%98 = add nsw i32 %97, -1
store i32 %98, i32* %5
br label %10
99: ; preds = %10
%100 = load i32*, i32** %6
%101 = getelementptr inbounds i32, i32* %100, i64 1
%102 = load i32, i32* %101
%103 = load i32*, i32** %7
%104 = getelementptr inbounds i32, i32* %103, i64 1
%105 = load i32, i32* %104
%106 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %105)
%107 = sub nsw i32 %102, %106
%108 = load i32*, i32** %6
%109 = getelementptr inbounds i32, i32* %108, i64 1
store i32 %107, i32* %109
%110 = load i32*, i32** %6
%111 = getelementptr inbounds i32, i32* %110, i64 0
%112 = load i32, i32* %111
%113 = load i32*, i32** %7
%114 = getelementptr inbounds i32, i32* %113, i64 0
%115 = load i32, i32* %114
%116 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %115)
%117 = sub nsw i32 %112, %116
%118 = load i32*, i32** %6
%119 = getelementptr inbounds i32, i32* %118, i64 0
store i32 %117, i32* %119
ret void
}

LLVM IR (-O2):
define void @Decrypt(i32* nocapture %0, i32* nocapture %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
br label %5
5: ; preds = %2, %5
%6 = phi i32 [ %4, %2 ], [ %38, %5 ]
%7 = phi i64 [ 20, %2 ], [ %44, %5 ]
%8 = shl nuw nsw i64 %7, 1
%9 = or i64 %8, 1
%10 = getelementptr inbounds i32, i32* %1, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %11)
%13 = sub nsw i32 %6, %12
%14 = load i32, i32* %0
%15 = and i32 %14, 31
%16 = ashr i32 %13, %15
%17 = load i32, i32* %3
%18 = load i32, i32* %10
%19 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %18)
%20 = sub nsw i32 %17, %19
%21 = load i32, i32* %0
%22 = and i32 %21, 31
%23 = sub nuw nsw i32 32, %22
%24 = shl i32 %20, %23
%25 = or i32 %24, %16
%26 = xor i32 %25, %21
store i32 %26, i32* %3
%27 = getelementptr inbounds i32, i32* %1, i64 %8
%28 = load i32, i32* %27
%29 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %28)
%30 = sub nsw i32 %21, %29
%31 = load i32, i32* %3
%32 = and i32 %31, 31
%33 = ashr i32 %30, %32
%34 = load i32, i32* %0
%35 = load i32, i32* %27
%36 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %35)
%37 = sub nsw i32 %34, %36
%38 = load i32, i32* %3
%39 = and i32 %38, 31
%40 = sub nuw nsw i32 32, %39
%41 = shl i32 %37, %40
%42 = or i32 %41, %33
%43 = xor i32 %42, %38
store i32 %43, i32* %0
%44 = add nsw i64 %7, -1
%45 = icmp ugt i64 %7, 1
br i1 %45, label %5, label %46
46: ; preds = %5
%47 = getelementptr inbounds i32, i32* %1, i64 1
%48 = load i32, i32* %47
%49 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %48)
%50 = sub nsw i32 %38, %49
store i32 %50, i32* %3
%51 = load i32, i32* %0
%52 = load i32, i32* %1
%53 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %52)
%54 = sub nsw i32 %51, %53
store i32 %54, i32* %0
ret void
}