#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 const);
int rot32l1(int);
int rot32l8(int);
void Encrypt(uint8_t *block, uint8_t *roundKeys) {
  uint32_t *block32 = (uint32_t *)block;
  const uint32_t *rk = (uint32_t *)roundKeys;
  uint32_t y = block32[0];
  uint32_t x = block32[1];
  uint8_t i;
  uint32_t tmp;
  for (i = 0; i < 44; i++) {
    tmp = x;
    x = y ^ (rot32l1(x) & rot32l8(x)) ^ (rot32l1(rot32l1(x))) ^
        READ_ROUND_KEY_DOUBLE_WORD(rk[i]);
    y = tmp;
  }
  block32[0] = y;
  block32[1] = x;
}


x86 assembly (clang, -O0):
<Encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x2c,-0x2c(%rbp)
jge    11e9 <Encrypt+0xb9>
mov    -0x28(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%edi
call   1030 <rot32l1@plt>
mov    %eax,-0x40(%rbp)
mov    -0x28(%rbp),%edi
call   1040 <rot32l8@plt>
mov    -0x40(%rbp),%ecx
mov    %eax,%edx
mov    -0x3c(%rbp),%eax
and    %edx,%ecx
xor    %ecx,%eax
mov    %eax,-0x38(%rbp)
mov    -0x28(%rbp),%edi
call   1030 <rot32l1@plt>
mov    %eax,%edi
call   1030 <rot32l1@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1050 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    116a <Encrypt+0x3a>
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Encrypt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    (%rdi),%ebp
mov    %rdi,(%rsp)
mov    0x4(%rdi),%eax
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
mov    %eax,%r13d
mov    %eax,%edi
call   1030 <rot32l1@plt>
mov    %eax,%r12d
mov    %r13d,%edi
call   1040 <rot32l8@plt>
mov    %eax,%ebx
and    %r12d,%ebx
xor    %ebp,%ebx
mov    %r13d,%edi
call   1030 <rot32l1@plt>
mov    %eax,%edi
call   1030 <rot32l1@plt>
mov    %eax,%ebp
xor    %ebx,%ebp
mov    (%r15,%r14,4),%edi
call   1050 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %ebp,%eax
add    $0x1,%r14
mov    %r13d,%ebp
cmp    $0x2c,%r14
jne    1150 <Encrypt+0x20>
mov    (%rsp),%rcx
mov    %r13d,(%rcx)
mov    %eax,0x4(%rcx)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
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
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%11 = load i32*, i32** %3
store i32* %11, i32** %5
%12 = load i32*, i32** %4
store i32* %12, i32** %6
%13 = load i32*, i32** %5
%14 = getelementptr inbounds i32, i32* %13, i64 0
%15 = load i32, i32* %14
store i32 %15, i32* %7
%16 = load i32*, i32** %5
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = load i32, i32* %17
store i32 %18, i32* %8
store i32 0, i32* %9
br label %19
19: ; preds = %43, %2
%20 = load i32, i32* %9
%21 = icmp slt i32 %20, 44
br i1 %21, label %22, label %46
22: ; preds = %19
%23 = load i32, i32* %8
store i32 %23, i32* %10
%24 = load i32, i32* %7
%25 = load i32, i32* %8
%26 = call i32 @rot32l1(i32 %25)
%27 = load i32, i32* %8
%28 = call i32 @rot32l8(i32 %27)
%29 = and i32 %26, %28
%30 = xor i32 %24, %29
%31 = load i32, i32* %8
%32 = call i32 @rot32l1(i32 %31)
%33 = call i32 @rot32l1(i32 %32)
%34 = xor i32 %30, %33
%35 = load i32*, i32** %6
%36 = load i32, i32* %9
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i32, i32* %35, i64 %37
%39 = load i32, i32* %38
%40 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %39)
%41 = xor i32 %34, %40
store i32 %41, i32* %8
%42 = load i32, i32* %10
store i32 %42, i32* %7
br label %43
43: ; preds = %22
%44 = load i32, i32* %9
%45 = add nsw i32 %44, 1
store i32 %45, i32* %9
br label %19
46: ; preds = %19
%47 = load i32, i32* %7
%48 = load i32*, i32** %5
%49 = getelementptr inbounds i32, i32* %48, i64 0
store i32 %47, i32* %49
%50 = load i32, i32* %8
%51 = load i32*, i32** %5
%52 = getelementptr inbounds i32, i32* %51, i64 1
store i32 %50, i32* %52
ret void
}

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