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

/* Variables and functions */
int /*<<< orphan*/ EncryptFinalTransfomation(int *, int *);
int /*<<< orphan*/ EncryptInitialTransfomation(int *, int *);
int /*<<< orphan*/ EncryptRoundFunction(int *, int *);
void Encrypt(uint8_t *block, uint8_t *roundKeys) {
  uint8_t i;
  EncryptInitialTransfomation(block, roundKeys);
  for (i = 0; i < 32; i++) {
    EncryptRoundFunction(block, &roundKeys[8 + (i << 2)]);
  }
  EncryptFinalTransfomation(block, roundKeys);
}


x86 assembly (clang, -O0):
<Encrypt>:
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   1040 <EncryptInitialTransfomation@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x20,-0x14(%rbp)
jge    118b <Encrypt+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   1030 <EncryptRoundFunction@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1154 <Encrypt+0x24>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <EncryptFinalTransfomation@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Encrypt(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 @EncryptInitialTransfomation(i32* %6, i32* %7)
store i32 0, i32* %5
br label %9
9: ; preds = %21, %2
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 32
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 @EncryptRoundFunction(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 @EncryptFinalTransfomation(i32* %25, i32* %26)
ret void
}

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