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


x86 assembly (clang, -O0):
<AddRoundRoundKeyAndRoundConstant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2,-0x1c(%rbp)
jge    11c7 <AddRoundRoundKeyAndRoundConstant+0xa7>
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x40(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <READ_ROUND_CONSTANT_DOUBLE_WORD@plt>
mov    -0x40(%rbp),%edx
xor    %eax,%edx
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1040 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    -0x3c(%rbp),%edx
xor    %eax,%edx
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1153 <AddRoundRoundKeyAndRoundConstant+0x33>
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @AddRoundRoundKeyAndRoundConstant(i32* %0, i32* %1, i32* %2) {
%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** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%11 = load i32*, i32** %4
store i32* %11, i32** %8
%12 = load i32*, i32** %5
store i32* %12, i32** %9
%13 = load i32*, i32** %6
store i32* %13, i32** %10
store i32 0, i32* %7
br label %14
14: ; preds = %50, %3
%15 = load i32, i32* %7
%16 = icmp slt i32 %15, 2
br i1 %16, label %17, label %53
17: ; preds = %14
%18 = load i32*, i32** %8
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
%23 = load i32*, i32** %10
%24 = load i32, i32* %7
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
%27 = load i32, i32* %26
%28 = call i32 @READ_ROUND_CONSTANT_DOUBLE_WORD(i32 %27)
%29 = xor i32 %22, %28
%30 = load i32*, i32** %8
%31 = load i32, i32* %7
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %30, i64 %32
store i32 %29, i32* %33
%34 = load i32*, i32** %8
%35 = load i32, i32* %7
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i32, i32* %34, i64 %36
%38 = load i32, i32* %37
%39 = load i32*, i32** %9
%40 = load i32, i32* %7
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32, i32* %39, i64 %41
%43 = load i32, i32* %42
%44 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %43)
%45 = xor i32 %38, %44
%46 = load i32*, i32** %8
%47 = load i32, i32* %7
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i32, i32* %46, i64 %48
store i32 %45, i32* %49
br label %50
50: ; preds = %17
%51 = load i32, i32* %7
%52 = add nsw i32 %51, 1
store i32 %52, i32* %7
br label %14
53: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @AddRoundRoundKeyAndRoundConstant(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %2
%6 = tail call i32 @READ_ROUND_CONSTANT_DOUBLE_WORD(i32 %5)
%7 = xor i32 %6, %4
store i32 %7, i32* %0
%8 = load i32, i32* %1
%9 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %8)
%10 = xor i32 %9, %7
store i32 %10, i32* %0
%11 = getelementptr inbounds i32, i32* %0, i64 1
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %2, i64 1
%14 = load i32, i32* %13
%15 = tail call i32 @READ_ROUND_CONSTANT_DOUBLE_WORD(i32 %14)
%16 = xor i32 %15, %12
store i32 %16, i32* %11
%17 = getelementptr inbounds i32, i32* %1, i64 1
%18 = load i32, i32* %17
%19 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %18)
%20 = xor i32 %19, %16
store i32 %20, i32* %11
ret void
}