#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 /*<<< orphan*/ memcpy(void *, void *, int);
void RunEncryptionKeySchedule(uint8_t *key, uint8_t *roundKeys) {
  uint8_t i;
  memcpy((void *)roundKeys, (void *)key, 16);
  for (i = 16; i < 148 - 16; i += 16)
    memcpy((void *)(roundKeys + i), (void *)key, 16);
  memcpy((void *)(roundKeys + 148 - 4), (void *)key, 4);
}


x86 assembly (clang, -O0):
<RunEncryptionKeySchedule>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
movl   $0x10,-0x14(%rbp)
cmpl   $0x84,-0x14(%rbp)
jge    1171 <RunEncryptionKeySchedule+0x61>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
mov    -0x14(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <RunEncryptionKeySchedule+0x29>
mov    -0x10(%rbp),%rdi
add    $0x250,%rdi
add    $0xfffffffffffffff0,%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RunEncryptionKeySchedule>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %r14,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
lea    0x40(%rbx),%rdi
mov    %r14,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
lea    0x80(%rbx),%rdi
mov    %r14,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
lea    0xc0(%rbx),%rdi
mov    %r14,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
lea    0x100(%rbx),%rdi
mov    %r14,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
lea    0x140(%rbx),%rdi
mov    %r14,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
lea    0x180(%rbx),%rdi
mov    %r14,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
lea    0x1c0(%rbx),%rdi
mov    %r14,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
lea    0x200(%rbx),%rdi
mov    %r14,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
add    $0x240,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @RunEncryptionKeySchedule(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** %4
%7 = bitcast i32* %6 to i8*
%8 = load i32*, i32** %3
%9 = bitcast i32* %8 to i8*
%10 = call i32 @memcpy(i8* %7, i8* %9, i32 16)
store i32 16, i32* %5
br label %11
11: ; preds = %23, %2
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, 132
br i1 %13, label %14, label %26
14: ; preds = %11
%15 = load i32*, i32** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = bitcast i32* %18 to i8*
%20 = load i32*, i32** %3
%21 = bitcast i32* %20 to i8*
%22 = call i32 @memcpy(i8* %19, i8* %21, i32 16)
br label %23
23: ; preds = %14
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 16
store i32 %25, i32* %5
br label %11
26: ; preds = %11
%27 = load i32*, i32** %4
%28 = getelementptr inbounds i32, i32* %27, i64 148
%29 = getelementptr inbounds i32, i32* %28, i64 -4
%30 = bitcast i32* %29 to i8*
%31 = load i32*, i32** %3
%32 = bitcast i32* %31 to i8*
%33 = call i32 @memcpy(i8* %30, i8* %32, i32 4)
ret void
}

LLVM IR (-O2):
define void @RunEncryptionKeySchedule(i32* %0, i32* %1) {
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %0 to i8*
%5 = tail call i32 @memcpy(i8* %3, i8* %4, i32 16)
%6 = getelementptr inbounds i32, i32* %1, i64 16
%7 = bitcast i32* %6 to i8*
%8 = tail call i32 @memcpy(i8* %7, i8* %4, i32 16)
%9 = getelementptr inbounds i32, i32* %1, i64 32
%10 = bitcast i32* %9 to i8*
%11 = tail call i32 @memcpy(i8* %10, i8* %4, i32 16)
%12 = getelementptr inbounds i32, i32* %1, i64 48
%13 = bitcast i32* %12 to i8*
%14 = tail call i32 @memcpy(i8* %13, i8* %4, i32 16)
%15 = getelementptr inbounds i32, i32* %1, i64 64
%16 = bitcast i32* %15 to i8*
%17 = tail call i32 @memcpy(i8* %16, i8* %4, i32 16)
%18 = getelementptr inbounds i32, i32* %1, i64 80
%19 = bitcast i32* %18 to i8*
%20 = tail call i32 @memcpy(i8* %19, i8* %4, i32 16)
%21 = getelementptr inbounds i32, i32* %1, i64 96
%22 = bitcast i32* %21 to i8*
%23 = tail call i32 @memcpy(i8* %22, i8* %4, i32 16)
%24 = getelementptr inbounds i32, i32* %1, i64 112
%25 = bitcast i32* %24 to i8*
%26 = tail call i32 @memcpy(i8* %25, i8* %4, i32 16)
%27 = getelementptr inbounds i32, i32* %1, i64 128
%28 = bitcast i32* %27 to i8*
%29 = tail call i32 @memcpy(i8* %28, i8* %4, i32 16)
%30 = getelementptr inbounds i32, i32* %1, i64 144
%31 = bitcast i32* %30 to i8*
%32 = tail call i32 @memcpy(i8* %31, i8* %4, i32 4)
ret void
}