#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);
void Whitening(uint8_t *block, uint8_t *roundKey) {
  uint8_t i;
  uint32_t *Block = (uint32_t *)block;
  uint32_t *RoundKey = (uint32_t *)roundKey;
  for (i = 0; i < 2; i++) {
    Block[i] = Block[i] ^ READ_ROUND_KEY_DOUBLE_WORD(RoundKey[i]);
  }
}


x86 assembly (clang, -O0):
<Whitening>:
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    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    117d <Whitening+0x6d>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    -0x2c(%rbp),%edx
xor    %eax,%edx
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <Whitening+0x27>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Whitening>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%ebp
mov    (%rsi),%edi
call   1030 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %ebp,%eax
mov    %eax,(%rbx)
mov    0x4(%rbx),%ebp
mov    0x4(%r14),%edi
call   1030 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %ebp,%eax
mov    %eax,0x4(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @Whitening(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %4)
%6 = xor i32 %5, %3
store i32 %6, i32* %0
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %1, i64 1
%10 = load i32, i32* %9
%11 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %10)
%12 = xor i32 %11, %8
store i32 %12, i32* %7
ret void
}