#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 /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
void keyToContext(uint8_t key[0x10], uint8_t largekey[0x40]) {
  memset(largekey, 0, 0x40);
  memcpy(largekey, key, 8);
  memcpy(largekey + 0x8, key, 8);
  memcpy(largekey + 0x10, key + 0x8, 8);
  memcpy(largekey + 0x18, key + 0x8, 8);
}


x86 assembly (clang, -O0):
<keyToContext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rdi
add    $0x20,%rdi
mov    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rdi
add    $0x40,%rdi
mov    -0x8(%rbp),%rsi
add    $0x20,%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rdi
add    $0x60,%rdi
mov    -0x8(%rbp),%rsi
add    $0x20,%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyToContext>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
lea    0x20(%rbx),%rdi
mov    %r14,%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
lea    0x40(%rbx),%rdi
add    $0x20,%r14
mov    %r14,%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
add    $0x60,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define void @keyToContext(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = call i32 @memset(i32* %5, i32 0, i32 64)
%7 = load i32*, i32** %4
%8 = load i32*, i32** %3
%9 = call i32 @memcpy(i32* %7, i32* %8, i32 8)
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 8
%12 = load i32*, i32** %3
%13 = call i32 @memcpy(i32* %11, i32* %12, i32 8)
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 16
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 8
%18 = call i32 @memcpy(i32* %15, i32* %17, i32 8)
%19 = load i32*, i32** %4
%20 = getelementptr inbounds i32, i32* %19, i64 24
%21 = load i32*, i32** %3
%22 = getelementptr inbounds i32, i32* %21, i64 8
%23 = call i32 @memcpy(i32* %20, i32* %22, i32 8)
ret void
}

LLVM IR (-O2):
define void @keyToContext(i32* %0, i32* %1) {
%3 = tail call i32 @memset(i32* %1, i32 0, i32 64)
%4 = tail call i32 @memcpy(i32* %1, i32* %0, i32 8)
%5 = getelementptr inbounds i32, i32* %1, i64 8
%6 = tail call i32 @memcpy(i32* %5, i32* %0, i32 8)
%7 = getelementptr inbounds i32, i32* %1, i64 16
%8 = getelementptr inbounds i32, i32* %0, i64 8
%9 = tail call i32 @memcpy(i32* %7, i32* %8, i32 8)
%10 = getelementptr inbounds i32, i32* %1, i64 24
%11 = tail call i32 @memcpy(i32* %10, i32* %8, i32 8)
ret void
}