#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 READ_ROUND_KEY_BYTE(int);
int /*<<< orphan*/ round_function(int *, int *, int);
void Encrypt(uint8_t *block, uint8_t *roundKeys) {
  uint8_t i, j;
  for (i = 0; i < 8; i++)
    block[i] ^= READ_ROUND_KEY_BYTE(roundKeys[i]);
  for (i = 0; i < 19; i++)
    round_function(block, roundKeys + 8 * (i + 1), 0);
  round_function(block, roundKeys + 160, 2);
  for (i = 0; i < 8; i++)
    block[i] ^= READ_ROUND_KEY_BYTE(roundKeys[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   $0x8,-0x14(%rbp)
jge    116f <Encrypt+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%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    1137 <Encrypt+0x17>
movl   $0x0,-0x14(%rbp)
cmpl   $0x13,-0x14(%rbp)
jge    11af <Encrypt+0x8f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
add    $0x1,%eax
shl    $0x3,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
xor    %edx,%edx
call   1040 <round_function@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1176 <Encrypt+0x56>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x280,%rsi
mov    $0x2,%edx
call   1040 <round_function@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1207 <Encrypt+0xe7>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%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    11cf <Encrypt+0xaf>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Encrypt>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,(%r14)
mov    0x4(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0x4(%r14)
mov    0x8(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0x8(%r14)
mov    0xc(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0xc(%r14)
mov    0x10(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0x10(%r14)
mov    0x14(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0x14(%r14)
mov    0x18(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0x18(%r14)
mov    0x1c(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0x1c(%r14)
lea    0x20(%rbx),%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   1040 <round_function@plt>
lea    0x40(%rbx),%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   1040 <round_function@plt>
lea    0x60(%rbx),%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   1040 <round_function@plt>
lea    0x80(%rbx),%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   1040 <round_function@plt>
lea    0xa0(%rbx),%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   1040 <round_function@plt>
lea    0xc0(%rbx),%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   1040 <round_function@plt>
lea    0xe0(%rbx),%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   1040 <round_function@plt>
lea    0x100(%rbx),%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   1040 <round_function@plt>
lea    0x120(%rbx),%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   1040 <round_function@plt>
lea    0x140(%rbx),%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   1040 <round_function@plt>
lea    0x160(%rbx),%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   1040 <round_function@plt>
lea    0x180(%rbx),%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   1040 <round_function@plt>
lea    0x1a0(%rbx),%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   1040 <round_function@plt>
lea    0x1c0(%rbx),%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   1040 <round_function@plt>
lea    0x1e0(%rbx),%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   1040 <round_function@plt>
lea    0x200(%rbx),%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   1040 <round_function@plt>
lea    0x220(%rbx),%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   1040 <round_function@plt>
lea    0x240(%rbx),%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   1040 <round_function@plt>
lea    0x260(%rbx),%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   1040 <round_function@plt>
lea    0x280(%rbx),%rsi
mov    %r14,%rdi
mov    $0x2,%edx
call   1040 <round_function@plt>
mov    (%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,(%r14)
mov    0x4(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0x4(%r14)
mov    0x8(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0x8(%r14)
mov    0xc(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0xc(%r14)
mov    0x10(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0x10(%r14)
mov    0x14(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0x14(%r14)
mov    0x18(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0x18(%r14)
mov    0x1c(%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
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %7
7: ; preds = %23, %2
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 8
br i1 %9, label %10, label %26
10: ; preds = %7
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @READ_ROUND_KEY_BYTE(i32 %15)
%17 = load i32*, i32** %3
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
%22 = xor i32 %21, %16
store i32 %22, i32* %20
br label %23
23: ; preds = %10
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %7
26: ; preds = %7
store i32 0, i32* %5
br label %27
27: ; preds = %39, %26
%28 = load i32, i32* %5
%29 = icmp slt i32 %28, 19
br i1 %29, label %30, label %42
30: ; preds = %27
%31 = load i32*, i32** %3
%32 = load i32*, i32** %4
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 1
%35 = mul nsw i32 8, %34
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i32, i32* %32, i64 %36
%38 = call i32 @round_function(i32* %31, i32* %37, i32 0)
br label %39
39: ; preds = %30
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 1
store i32 %41, i32* %5
br label %27
42: ; preds = %27
%43 = load i32*, i32** %3
%44 = load i32*, i32** %4
%45 = getelementptr inbounds i32, i32* %44, i64 160
%46 = call i32 @round_function(i32* %43, i32* %45, i32 2)
store i32 0, i32* %5
br label %47
47: ; preds = %63, %42
%48 = load i32, i32* %5
%49 = icmp slt i32 %48, 8
br i1 %49, label %50, label %66
50: ; preds = %47
%51 = load i32*, i32** %4
%52 = load i32, i32* %5
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i32, i32* %51, i64 %53
%55 = load i32, i32* %54
%56 = call i32 @READ_ROUND_KEY_BYTE(i32 %55)
%57 = load i32*, i32** %3
%58 = load i32, i32* %5
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i32, i32* %57, i64 %59
%61 = load i32, i32* %60
%62 = xor i32 %61, %56
store i32 %62, i32* %60
br label %63
63: ; preds = %50
%64 = load i32, i32* %5
%65 = add nsw i32 %64, 1
store i32 %65, i32* %5
br label %47
66: ; preds = %47
ret void
}

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