#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 /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ READ_ROUND_KEY_DOUBLE_WORD(int /*<<< orphan*/);
int /*<<< orphan*/ round_f(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                           int /*<<< orphan*/ *);
void Encrypt(uint8_t *block, uint8_t *roundKeys) {
  uint8_t i;
  uint32_t *left = (uint32_t *)block;
  uint32_t *right = (uint32_t *)block + 1;
  uint32_t *RoundKeys = (uint32_t *)roundKeys;
  for (i = 0; i < 8; i++) {
    round_f(left, right, &RoundKeys[6 * i]);
  }
  *left ^= READ_ROUND_KEY_DOUBLE_WORD(RoundKeys[6 * 8]);
  *right ^= READ_ROUND_KEY_DOUBLE_WORD(RoundKeys[6 * 8 + 1]);
}


x86 assembly (clang, -O0):
<Encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1189 <Encrypt+0x69>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
imul   $0x6,-0x14(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdx
call   1030 <round_f@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1153 <Encrypt+0x33>
mov    -0x30(%rbp),%rax
mov    0xc0(%rax),%edi
call   1040 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x30(%rbp),%rax
mov    0xc4(%rax),%edi
call   1040 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Encrypt>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x4(%rdi),%r15
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <round_f@plt>
lea    0x18(%r14),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <round_f@plt>
lea    0x30(%r14),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <round_f@plt>
lea    0x48(%r14),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <round_f@plt>
lea    0x60(%r14),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <round_f@plt>
lea    0x78(%r14),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <round_f@plt>
lea    0x90(%r14),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <round_f@plt>
lea    0xa8(%r14),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <round_f@plt>
mov    0xc0(%r14),%edi
call   1040 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%rbx)
mov    0xc4(%r14),%edi
call   1040 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,0x4(%rbx)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @Encrypt(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%9 = load i32*, i32** %3
store i32* %9, i32** %6
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32* %11, i32** %7
%12 = load i32*, i32** %4
store i32* %12, i32** %8
store i32 0, i32* %5
br label %13
13: ; preds = %25, %2
%14 = load i32, i32* %5
%15 = icmp slt i32 %14, 8
br i1 %15, label %16, label %28
16: ; preds = %13
%17 = load i32*, i32** %6
%18 = load i32*, i32** %7
%19 = load i32*, i32** %8
%20 = load i32, i32* %5
%21 = mul nsw i32 6, %20
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %19, i64 %22
%24 = call i32 @round_f(i32* %17, i32* %18, i32* %23)
br label %25
25: ; preds = %16
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %13
28: ; preds = %13
%29 = load i32*, i32** %8
%30 = getelementptr inbounds i32, i32* %29, i64 48
%31 = load i32, i32* %30
%32 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %31)
%33 = load i32*, i32** %6
%34 = load i32, i32* %33
%35 = xor i32 %34, %32
store i32 %35, i32* %33
%36 = load i32*, i32** %8
%37 = getelementptr inbounds i32, i32* %36, i64 49
%38 = load i32, i32* %37
%39 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %38)
%40 = load i32*, i32** %7
%41 = load i32, i32* %40
%42 = xor i32 %41, %39
store i32 %42, i32* %40
ret void
}

LLVM IR (-O2):
define void @Encrypt(i32* %0, i32* %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = tail call i32 @round_f(i32* %0, i32* %3, i32* %1)
%5 = getelementptr inbounds i32, i32* %1, i64 6
%6 = tail call i32 @round_f(i32* %0, i32* %3, i32* %5)
%7 = getelementptr inbounds i32, i32* %1, i64 12
%8 = tail call i32 @round_f(i32* %0, i32* %3, i32* %7)
%9 = getelementptr inbounds i32, i32* %1, i64 18
%10 = tail call i32 @round_f(i32* %0, i32* %3, i32* %9)
%11 = getelementptr inbounds i32, i32* %1, i64 24
%12 = tail call i32 @round_f(i32* %0, i32* %3, i32* %11)
%13 = getelementptr inbounds i32, i32* %1, i64 30
%14 = tail call i32 @round_f(i32* %0, i32* %3, i32* %13)
%15 = getelementptr inbounds i32, i32* %1, i64 36
%16 = tail call i32 @round_f(i32* %0, i32* %3, i32* %15)
%17 = getelementptr inbounds i32, i32* %1, i64 42
%18 = tail call i32 @round_f(i32* %0, i32* %3, i32* %17)
%19 = getelementptr inbounds i32, i32* %1, i64 48
%20 = load i32, i32* %19
%21 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %20)
%22 = load i32, i32* %0
%23 = xor i32 %22, %21
store i32 %23, i32* %0
%24 = getelementptr inbounds i32, i32* %1, i64 49
%25 = load i32, i32* %24
%26 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %25)
%27 = load i32, i32* %3
%28 = xor i32 %27, %26
store i32 %28, i32* %3
ret void
}