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

/* Variables and functions */
int READ_ROUND_KEY_BYTE(int);
int /*<<< orphan*/ round_function(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void Encrypt(uint8_t *block, uint8_t *roundKeys) {
  uint8_t i;
  for (i = 0; i < 25; i++)
    round_function((uint16_t *)block, (uint16_t *)(roundKeys + 8 * i));
  for (i = 0; i < 8; i++)
    block[i] ^= READ_ROUND_KEY_BYTE(roundKeys[8 * 25 + i]);
}


x86 assembly (clang, -O0):
<Encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x19,-0x14(%rbp)
jge    116b <Encrypt+0x4b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
shl    $0x3,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
call   1040 <round_function@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <Encrypt+0x17>
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    11b2 <Encrypt+0x92>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0xc8,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
xor    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1172 <Encrypt+0x52>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Encrypt>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <round_function@plt>
lea    0x20(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
lea    0x40(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
lea    0x60(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
lea    0x80(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
lea    0xa0(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
lea    0xc0(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
lea    0xe0(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
lea    0x100(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
lea    0x120(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
lea    0x140(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
lea    0x160(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
lea    0x180(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
lea    0x1a0(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
lea    0x1c0(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
lea    0x1e0(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
lea    0x200(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
lea    0x220(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
lea    0x240(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
lea    0x260(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
lea    0x280(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
lea    0x2a0(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
lea    0x2c0(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
lea    0x2e0(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
lea    0x300(%rbx),%rsi
mov    %r14,%rdi
call   1040 <round_function@plt>
mov    0x320(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,(%r14)
mov    0x324(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0x4(%r14)
mov    0x328(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0x8(%r14)
mov    0x32c(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0xc(%r14)
mov    0x330(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0x10(%r14)
mov    0x334(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0x14(%r14)
mov    0x338(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0x18(%r14)
mov    0x33c(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0x1c(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 25
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load i32*, i32** %3
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = mul nsw i32 8, %12
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %11, i64 %14
%16 = call i32 @round_function(i32* %10, i32* %15)
br label %17
17: ; preds = %9
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
store i32 0, i32* %5
br label %21
21: ; preds = %38, %20
%22 = load i32, i32* %5
%23 = icmp slt i32 %22, 8
br i1 %23, label %24, label %41
24: ; preds = %21
%25 = load i32*, i32** %4
%26 = load i32, i32* %5
%27 = add nsw i32 200, %26
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %25, i64 %28
%30 = load i32, i32* %29
%31 = call i32 @READ_ROUND_KEY_BYTE(i32 %30)
%32 = load i32*, i32** %3
%33 = load i32, i32* %5
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i32, i32* %32, i64 %34
%36 = load i32, i32* %35
%37 = xor i32 %36, %31
store i32 %37, i32* %35
br label %38
38: ; preds = %24
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
store i32 %40, i32* %5
br label %21
41: ; preds = %21
ret void
}

LLVM IR (-O2):
define void @Encrypt(i32* %0, i32* %1) {
%3 = tail call i32 @round_function(i32* %0, i32* %1)
%4 = getelementptr inbounds i32, i32* %1, i64 8
%5 = tail call i32 @round_function(i32* %0, i32* %4)
%6 = getelementptr inbounds i32, i32* %1, i64 16
%7 = tail call i32 @round_function(i32* %0, i32* %6)
%8 = getelementptr inbounds i32, i32* %1, i64 24
%9 = tail call i32 @round_function(i32* %0, i32* %8)
%10 = getelementptr inbounds i32, i32* %1, i64 32
%11 = tail call i32 @round_function(i32* %0, i32* %10)
%12 = getelementptr inbounds i32, i32* %1, i64 40
%13 = tail call i32 @round_function(i32* %0, i32* %12)
%14 = getelementptr inbounds i32, i32* %1, i64 48
%15 = tail call i32 @round_function(i32* %0, i32* %14)
%16 = getelementptr inbounds i32, i32* %1, i64 56
%17 = tail call i32 @round_function(i32* %0, i32* %16)
%18 = getelementptr inbounds i32, i32* %1, i64 64
%19 = tail call i32 @round_function(i32* %0, i32* %18)
%20 = getelementptr inbounds i32, i32* %1, i64 72
%21 = tail call i32 @round_function(i32* %0, i32* %20)
%22 = getelementptr inbounds i32, i32* %1, i64 80
%23 = tail call i32 @round_function(i32* %0, i32* %22)
%24 = getelementptr inbounds i32, i32* %1, i64 88
%25 = tail call i32 @round_function(i32* %0, i32* %24)
%26 = getelementptr inbounds i32, i32* %1, i64 96
%27 = tail call i32 @round_function(i32* %0, i32* %26)
%28 = getelementptr inbounds i32, i32* %1, i64 104
%29 = tail call i32 @round_function(i32* %0, i32* %28)
%30 = getelementptr inbounds i32, i32* %1, i64 112
%31 = tail call i32 @round_function(i32* %0, i32* %30)
%32 = getelementptr inbounds i32, i32* %1, i64 120
%33 = tail call i32 @round_function(i32* %0, i32* %32)
%34 = getelementptr inbounds i32, i32* %1, i64 128
%35 = tail call i32 @round_function(i32* %0, i32* %34)
%36 = getelementptr inbounds i32, i32* %1, i64 136
%37 = tail call i32 @round_function(i32* %0, i32* %36)
%38 = getelementptr inbounds i32, i32* %1, i64 144
%39 = tail call i32 @round_function(i32* %0, i32* %38)
%40 = getelementptr inbounds i32, i32* %1, i64 152
%41 = tail call i32 @round_function(i32* %0, i32* %40)
%42 = getelementptr inbounds i32, i32* %1, i64 160
%43 = tail call i32 @round_function(i32* %0, i32* %42)
%44 = getelementptr inbounds i32, i32* %1, i64 168
%45 = tail call i32 @round_function(i32* %0, i32* %44)
%46 = getelementptr inbounds i32, i32* %1, i64 176
%47 = tail call i32 @round_function(i32* %0, i32* %46)
%48 = getelementptr inbounds i32, i32* %1, i64 184
%49 = tail call i32 @round_function(i32* %0, i32* %48)
%50 = getelementptr inbounds i32, i32* %1, i64 192
%51 = tail call i32 @round_function(i32* %0, i32* %50)
%52 = getelementptr inbounds i32, i32* %1, i64 200
%53 = load i32, i32* %52
%54 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %53)
%55 = load i32, i32* %0
%56 = xor i32 %55, %54
store i32 %56, i32* %0
%57 = getelementptr inbounds i32, i32* %1, i64 201
%58 = load i32, i32* %57
%59 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %58)
%60 = getelementptr inbounds i32, i32* %0, i64 1
%61 = load i32, i32* %60
%62 = xor i32 %61, %59
store i32 %62, i32* %60
%63 = getelementptr inbounds i32, i32* %1, i64 202
%64 = load i32, i32* %63
%65 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %64)
%66 = getelementptr inbounds i32, i32* %0, i64 2
%67 = load i32, i32* %66
%68 = xor i32 %67, %65
store i32 %68, i32* %66
%69 = getelementptr inbounds i32, i32* %1, i64 203
%70 = load i32, i32* %69
%71 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %70)
%72 = getelementptr inbounds i32, i32* %0, i64 3
%73 = load i32, i32* %72
%74 = xor i32 %73, %71
store i32 %74, i32* %72
%75 = getelementptr inbounds i32, i32* %1, i64 204
%76 = load i32, i32* %75
%77 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %76)
%78 = getelementptr inbounds i32, i32* %0, i64 4
%79 = load i32, i32* %78
%80 = xor i32 %79, %77
store i32 %80, i32* %78
%81 = getelementptr inbounds i32, i32* %1, i64 205
%82 = load i32, i32* %81
%83 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %82)
%84 = getelementptr inbounds i32, i32* %0, i64 5
%85 = load i32, i32* %84
%86 = xor i32 %85, %83
store i32 %86, i32* %84
%87 = getelementptr inbounds i32, i32* %1, i64 206
%88 = load i32, i32* %87
%89 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %88)
%90 = getelementptr inbounds i32, i32* %0, i64 6
%91 = load i32, i32* %90
%92 = xor i32 %91, %89
store i32 %92, i32* %90
%93 = getelementptr inbounds i32, i32* %1, i64 207
%94 = load i32, i32* %93
%95 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %94)
%96 = getelementptr inbounds i32, i32* %0, i64 7
%97 = load i32, i32* %96
%98 = xor i32 %97, %95
store i32 %98, i32* %96
ret void
}