#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 int8_t;

/* Variables and functions */
int /*<<< orphan*/ DecryptFinalTransfomation(int /*<<< orphan*/ *,
                                             int /*<<< orphan*/ *);
int /*<<< orphan*/ DecryptInitialTransfomation(int /*<<< orphan*/ *,
                                               int /*<<< orphan*/ *);
int /*<<< orphan*/ DecryptRoundFunction(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/ *);
void Decrypt(uint8_t *block, uint8_t *roundKeys) {
  int8_t i;
  DecryptFinalTransfomation(block, roundKeys);
  for (i = 32 - 1; i >= 0; i--) {
    DecryptRoundFunction(block, &roundKeys[8 + (i << 2)]);
  }
  DecryptInitialTransfomation(block, roundKeys);
}


x86 assembly (clang, -O0):
<Decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <DecryptFinalTransfomation@plt>
movl   $0x1f,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     118b <Decrypt+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
shl    $0x2,%eax
add    $0x8,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
call   1040 <DecryptRoundFunction@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1154 <Decrypt+0x24>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <DecryptInitialTransfomation@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Decrypt>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <DecryptFinalTransfomation@plt>
mov    $0x210,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
lea    (%r14,%rbx,1),%rsi
mov    %r15,%rdi
call   1040 <DecryptRoundFunction@plt>
add    $0xfffffffffffffff0,%rbx
cmp    $0x10,%rbx
jne    1150 <Decrypt+0x20>
mov    %r15,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <DecryptInitialTransfomation@plt>

LLVM IR (-O0):
define void @Decrypt(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32*, i32** %4
%8 = call i32 @DecryptFinalTransfomation(i32* %6, i32* %7)
store i32 31, i32* %5
br label %9
9: ; preds = %21, %2
%10 = load i32, i32* %5
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %24
12: ; preds = %9
%13 = load i32*, i32** %3
%14 = load i32*, i32** %4
%15 = load i32, i32* %5
%16 = shl i32 %15, 2
%17 = add nsw i32 8, %16
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %14, i64 %18
%20 = call i32 @DecryptRoundFunction(i32* %13, i32* %19)
br label %21
21: ; preds = %12
%22 = load i32, i32* %5
%23 = add nsw i32 %22, -1
store i32 %23, i32* %5
br label %9
24: ; preds = %9
%25 = load i32*, i32** %3
%26 = load i32*, i32** %4
%27 = call i32 @DecryptInitialTransfomation(i32* %25, i32* %26)
ret void
}

LLVM IR (-O2):
define void @Decrypt(i32* %0, i32* %1) {
%3 = tail call i32 @DecryptFinalTransfomation(i32* %0, i32* %1)
br label %4
4: ; preds = %2, %4
%5 = phi i64 [ 31, %2 ], [ %10, %4 ]
%6 = shl i64 %5, 2
%7 = add nuw nsw i64 %6, 8
%8 = getelementptr inbounds i32, i32* %1, i64 %7
%9 = tail call i32 @DecryptRoundFunction(i32* %0, i32* %8)
%10 = add nsw i64 %5, -1
%11 = icmp eq i64 %5, 0
br i1 %11, label %12, label %4
12: ; preds = %4
%13 = tail call i32 @DecryptInitialTransfomation(i32* %0, i32* %1)
ret void
}