#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_CONSTANT_BYTE(int const);
int READ_ROUND_KEY_BYTE(int);
void AddRoundRoundKeyAndRoundConstant(uint8_t *block, uint8_t *roundKey,
                                      const uint8_t *roundConstant) {
  uint8_t i;
  for (i = 0; i < 8; i++) {
    block[i] = block[i] ^ READ_ROUND_CONSTANT_BYTE(roundConstant[i]);
    block[i] = block[i] ^ READ_ROUND_KEY_BYTE(roundKey[i]);
  }
}


x86 assembly (clang, -O0):
<AddRoundRoundKeyAndRoundConstant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jge    11af <AddRoundRoundKeyAndRoundConstant+0x8f>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1040 <READ_ROUND_CONSTANT_BYTE@plt>
mov    -0x24(%rbp),%edx
xor    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
mov    -0x20(%rbp),%edx
xor    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113b <AddRoundRoundKeyAndRoundConstant+0x1b>
add    $0x30,%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   1040 <READ_ROUND_CONSTANT_BYTE@plt>
mov    %eax,%ebp
xor    %r12d,%ebp
mov    %ebp,(%rbx)
mov    (%r14),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
mov    %eax,(%rbx)
mov    0x4(%rbx),%r12d
mov    0x4(%r15),%edi
call   1040 <READ_ROUND_CONSTANT_BYTE@plt>
mov    %eax,%ebp
xor    %r12d,%ebp
mov    %ebp,0x4(%rbx)
mov    0x4(%r14),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
mov    %eax,0x4(%rbx)
mov    0x8(%rbx),%r12d
mov    0x8(%r15),%edi
call   1040 <READ_ROUND_CONSTANT_BYTE@plt>
mov    %eax,%ebp
xor    %r12d,%ebp
mov    %ebp,0x8(%rbx)
mov    0x8(%r14),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
mov    %eax,0x8(%rbx)
mov    0xc(%rbx),%r12d
mov    0xc(%r15),%edi
call   1040 <READ_ROUND_CONSTANT_BYTE@plt>
mov    %eax,%ebp
xor    %r12d,%ebp
mov    %ebp,0xc(%rbx)
mov    0xc(%r14),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
mov    %eax,0xc(%rbx)
mov    0x10(%rbx),%r12d
mov    0x10(%r15),%edi
call   1040 <READ_ROUND_CONSTANT_BYTE@plt>
mov    %eax,%ebp
xor    %r12d,%ebp
mov    %ebp,0x10(%rbx)
mov    0x10(%r14),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
mov    %eax,0x10(%rbx)
mov    0x14(%rbx),%r12d
mov    0x14(%r15),%edi
call   1040 <READ_ROUND_CONSTANT_BYTE@plt>
mov    %eax,%ebp
xor    %r12d,%ebp
mov    %ebp,0x14(%rbx)
mov    0x14(%r14),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
mov    %eax,0x14(%rbx)
mov    0x18(%rbx),%r12d
mov    0x18(%r15),%edi
call   1040 <READ_ROUND_CONSTANT_BYTE@plt>
mov    %eax,%ebp
xor    %r12d,%ebp
mov    %ebp,0x18(%rbx)
mov    0x18(%r14),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
mov    %eax,0x18(%rbx)
mov    0x1c(%rbx),%r12d
mov    0x1c(%r15),%edi
call   1040 <READ_ROUND_CONSTANT_BYTE@plt>
mov    %eax,%ebp
xor    %r12d,%ebp
mov    %ebp,0x1c(%rbx)
mov    0x1c(%r14),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
mov    %eax,0x1c(%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
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
store i32 0, i32* %7
br label %8
8: ; preds = %44, %3
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 8
br i1 %10, label %11, label %47
11: ; preds = %8
%12 = load i32*, i32** %4
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = load i32*, i32** %6
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
%22 = call i32 @READ_ROUND_CONSTANT_BYTE(i32 %21)
%23 = xor i32 %16, %22
%24 = load i32*, i32** %4
%25 = load i32, i32* %7
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %24, i64 %26
store i32 %23, i32* %27
%28 = load i32*, i32** %4
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
%32 = load i32, i32* %31
%33 = load i32*, i32** %5
%34 = load i32, i32* %7
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i32, i32* %33, i64 %35
%37 = load i32, i32* %36
%38 = call i32 @READ_ROUND_KEY_BYTE(i32 %37)
%39 = xor i32 %32, %38
%40 = load i32*, i32** %4
%41 = load i32, i32* %7
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i32, i32* %40, i64 %42
store i32 %39, i32* %43
br label %44
44: ; preds = %11
%45 = load i32, i32* %7
%46 = add nsw i32 %45, 1
store i32 %46, i32* %7
br label %8
47: ; preds = %8
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_BYTE(i32 %5)
%7 = xor i32 %6, %4
store i32 %7, i32* %0
%8 = load i32, i32* %1
%9 = tail call i32 @READ_ROUND_KEY_BYTE(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_BYTE(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_BYTE(i32 %18)
%20 = xor i32 %19, %16
store i32 %20, i32* %11
%21 = getelementptr inbounds i32, i32* %0, i64 2
%22 = load i32, i32* %21
%23 = getelementptr inbounds i32, i32* %2, i64 2
%24 = load i32, i32* %23
%25 = tail call i32 @READ_ROUND_CONSTANT_BYTE(i32 %24)
%26 = xor i32 %25, %22
store i32 %26, i32* %21
%27 = getelementptr inbounds i32, i32* %1, i64 2
%28 = load i32, i32* %27
%29 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %28)
%30 = xor i32 %29, %26
store i32 %30, i32* %21
%31 = getelementptr inbounds i32, i32* %0, i64 3
%32 = load i32, i32* %31
%33 = getelementptr inbounds i32, i32* %2, i64 3
%34 = load i32, i32* %33
%35 = tail call i32 @READ_ROUND_CONSTANT_BYTE(i32 %34)
%36 = xor i32 %35, %32
store i32 %36, i32* %31
%37 = getelementptr inbounds i32, i32* %1, i64 3
%38 = load i32, i32* %37
%39 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %38)
%40 = xor i32 %39, %36
store i32 %40, i32* %31
%41 = getelementptr inbounds i32, i32* %0, i64 4
%42 = load i32, i32* %41
%43 = getelementptr inbounds i32, i32* %2, i64 4
%44 = load i32, i32* %43
%45 = tail call i32 @READ_ROUND_CONSTANT_BYTE(i32 %44)
%46 = xor i32 %45, %42
store i32 %46, i32* %41
%47 = getelementptr inbounds i32, i32* %1, i64 4
%48 = load i32, i32* %47
%49 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %48)
%50 = xor i32 %49, %46
store i32 %50, i32* %41
%51 = getelementptr inbounds i32, i32* %0, i64 5
%52 = load i32, i32* %51
%53 = getelementptr inbounds i32, i32* %2, i64 5
%54 = load i32, i32* %53
%55 = tail call i32 @READ_ROUND_CONSTANT_BYTE(i32 %54)
%56 = xor i32 %55, %52
store i32 %56, i32* %51
%57 = getelementptr inbounds i32, i32* %1, i64 5
%58 = load i32, i32* %57
%59 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %58)
%60 = xor i32 %59, %56
store i32 %60, i32* %51
%61 = getelementptr inbounds i32, i32* %0, i64 6
%62 = load i32, i32* %61
%63 = getelementptr inbounds i32, i32* %2, i64 6
%64 = load i32, i32* %63
%65 = tail call i32 @READ_ROUND_CONSTANT_BYTE(i32 %64)
%66 = xor i32 %65, %62
store i32 %66, i32* %61
%67 = getelementptr inbounds i32, i32* %1, i64 6
%68 = load i32, i32* %67
%69 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %68)
%70 = xor i32 %69, %66
store i32 %70, i32* %61
%71 = getelementptr inbounds i32, i32* %0, i64 7
%72 = load i32, i32* %71
%73 = getelementptr inbounds i32, i32* %2, i64 7
%74 = load i32, i32* %73
%75 = tail call i32 @READ_ROUND_CONSTANT_BYTE(i32 %74)
%76 = xor i32 %75, %72
store i32 %76, i32* %71
%77 = getelementptr inbounds i32, i32* %1, i64 7
%78 = load i32, i32* %77
%79 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %78)
%80 = xor i32 %79, %76
store i32 %80, i32* %71
ret void
}