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

/* Variables and functions */
int READ_ROUND_KEY_DOUBLE_WORD(int);
int rol(int, int);
int ror(int, int);
void Encrypt(uint8_t *block, uint8_t *roundKeys) {
  uint32_t *rk = (uint32_t *)roundKeys;
  uint32_t *rightPtr = (uint32_t *)block;
  uint32_t *leftPtr = rightPtr + 1;
  uint8_t i;
  for (i = 0; i < 26; ++i) {
    *leftPtr =
        (ror(*leftPtr, 8) + *rightPtr) ^ READ_ROUND_KEY_DOUBLE_WORD(rk[i]);
    *rightPtr = rol(*rightPtr, 3) ^ *leftPtr;
  }
}


x86 assembly (clang, -O0):
<Encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x1a,-0x2c(%rbp)
jge    11cd <Encrypt+0x9d>
mov    -0x28(%rbp),%rax
mov    (%rax),%edi
mov    $0x8,%esi
call   1040 <ror@plt>
mov    -0x20(%rbp),%rcx
add    (%rcx),%eax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1050 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    -0x30(%rbp),%ecx
xor    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
mov    $0x3,%esi
call   1030 <rol@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
xor    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1163 <Encrypt+0x33>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Encrypt>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
mov    0x4(%rdi),%edi
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x8,%esi
call   1040 <ror@plt>
mov    %eax,%ebp
add    (%r15),%ebp
mov    (%r14,%rbx,4),%edi
call   1050 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %ebp,%eax
mov    %eax,0x4(%r15)
mov    (%r15),%edi
mov    $0x3,%esi
call   1030 <rol@plt>
mov    0x4(%r15),%edi
xor    %edi,%eax
mov    %eax,(%r15)
add    $0x1,%rbx
cmp    $0x1a,%rbx
jne    1150 <Encrypt+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
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** %4
store i32* %9, i32** %5
%10 = load i32*, i32** %3
store i32* %10, i32** %6
%11 = load i32*, i32** %6
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32* %12, i32** %7
store i32 0, i32* %8
br label %13
13: ; preds = %38, %2
%14 = load i32, i32* %8
%15 = icmp slt i32 %14, 26
br i1 %15, label %16, label %41
16: ; preds = %13
%17 = load i32*, i32** %7
%18 = load i32, i32* %17
%19 = call i32 @ror(i32 %18, i32 8)
%20 = load i32*, i32** %6
%21 = load i32, i32* %20
%22 = add nsw i32 %19, %21
%23 = load i32*, i32** %5
%24 = load i32, i32* %8
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
%27 = load i32, i32* %26
%28 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %27)
%29 = xor i32 %22, %28
%30 = load i32*, i32** %7
store i32 %29, i32* %30
%31 = load i32*, i32** %6
%32 = load i32, i32* %31
%33 = call i32 @rol(i32 %32, i32 3)
%34 = load i32*, i32** %7
%35 = load i32, i32* %34
%36 = xor i32 %33, %35
%37 = load i32*, i32** %6
store i32 %36, i32* %37
br label %38
38: ; preds = %16
%39 = load i32, i32* %8
%40 = add nsw i32 %39, 1
store i32 %40, i32* %8
br label %13
41: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @Encrypt(i32* nocapture %0, i32* nocapture %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
br label %5
5: ; preds = %2, %5
%6 = phi i32 [ %4, %2 ], [ %17, %5 ]
%7 = phi i64 [ 0, %2 ], [ %19, %5 ]
%8 = tail call i32 @ror(i32 %6, i32 8)
%9 = load i32, i32* %0
%10 = add nsw i32 %9, %8
%11 = getelementptr inbounds i32, i32* %1, i64 %7
%12 = load i32, i32* %11
%13 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %12)
%14 = xor i32 %13, %10
store i32 %14, i32* %3
%15 = load i32, i32* %0
%16 = tail call i32 @rol(i32 %15, i32 3)
%17 = load i32, i32* %3
%18 = xor i32 %17, %16
store i32 %18, i32* %0
%19 = add nuw nsw i64 %7, 1
%20 = icmp eq i64 %19, 26
br i1 %20, label %21, label %5
21: ; preds = %5
ret void
}