#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_KEY_BYTE(int);
int /*<<< orphan*/ rrr_L(int *);
int /*<<< orphan*/ rrr_sbox(int *);
void rrr_SLK(uint8_t *data, uint8_t *roundKey) {
  uint8_t i;
  rrr_sbox(data);
  for (i = 0; i < 4; i++)
    rrr_L(data + i);
  for (i = 0; i < 4; i++)
    data[i] ^= READ_ROUND_KEY_BYTE(roundKey[i]);
}


x86 assembly (clang, -O0):
<rrr_SLK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rrr_sbox@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    117c <rrr_SLK+0x4c>
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1050 <rrr_L@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1150 <rrr_SLK+0x20>
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    11bb <rrr_SLK+0x8b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
xor    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1183 <rrr_SLK+0x53>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rrr_SLK>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <rrr_sbox@plt>
mov    %rbx,%rdi
call   1050 <rrr_L@plt>
lea    0x4(%rbx),%rdi
call   1050 <rrr_L@plt>
lea    0x8(%rbx),%rdi
call   1050 <rrr_L@plt>
lea    0xc(%rbx),%rdi
call   1050 <rrr_L@plt>
mov    (%r14),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,(%rbx)
mov    0x4(%r14),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0x4(%rbx)
mov    0x8(%r14),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0x8(%rbx)
mov    0xc(%r14),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0xc(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @rrr_SLK(i32* %0, i32* nocapture %1) {
%3 = tail call i32 @rrr_sbox(i32* %0)
%4 = tail call i32 @rrr_L(i32* %0)
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = tail call i32 @rrr_L(i32* %5)
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = tail call i32 @rrr_L(i32* %7)
%9 = getelementptr inbounds i32, i32* %0, i64 3
%10 = tail call i32 @rrr_L(i32* %9)
%11 = load i32, i32* %1
%12 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %11)
%13 = load i32, i32* %0
%14 = xor i32 %13, %12
store i32 %14, i32* %0
%15 = getelementptr inbounds i32, i32* %1, i64 1
%16 = load i32, i32* %15
%17 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %16)
%18 = load i32, i32* %5
%19 = xor i32 %18, %17
store i32 %19, i32* %5
%20 = getelementptr inbounds i32, i32* %1, i64 2
%21 = load i32, i32* %20
%22 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %21)
%23 = load i32, i32* %7
%24 = xor i32 %23, %22
store i32 %24, i32* %7
%25 = getelementptr inbounds i32, i32* %1, i64 3
%26 = load i32, i32* %25
%27 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %26)
%28 = load i32, i32* %9
%29 = xor i32 %28, %27
store i32 %29, i32* %9
ret void
}