#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 */
void WhiteningKeyGeneration(const uint8_t *mk, uint8_t *wk) {
  uint8_t i;
  for (i = 0; i < 4; i++) {
    wk[i] = mk[i + 12];
  }
  for (i = 4; i < 8; i++) {
    wk[i] = mk[i - 4];
  }
}


x86 assembly (clang, -O0):
<WhiteningKeyGeneration>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1146 <WhiteningKeyGeneration+0x46>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0xc,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <WhiteningKeyGeneration+0x13>
movl   $0x4,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1180 <WhiteningKeyGeneration+0x80>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x4,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114d <WhiteningKeyGeneration+0x4d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WhiteningKeyGeneration>:
mov    0x30(%rdi),%eax
mov    %eax,(%rsi)
mov    0x34(%rdi),%eax
mov    %eax,0x4(%rsi)
mov    0x38(%rdi),%eax
mov    %eax,0x8(%rsi)
mov    0x3c(%rdi),%eax
mov    %eax,0xc(%rsi)
mov    (%rdi),%eax
mov    %eax,0x10(%rsi)
mov    0x4(%rdi),%eax
mov    %eax,0x14(%rsi)
mov    0x8(%rdi),%eax
mov    %eax,0x18(%rsi)
mov    0xc(%rdi),%eax
mov    %eax,0x1c(%rsi)
ret

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

LLVM IR (-O2):
define void @WhiteningKeyGeneration(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 12
%4 = load i32, i32* %3
store i32 %4, i32* %1
%5 = getelementptr inbounds i32, i32* %0, i64 13
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %6, i32* %7
%8 = getelementptr inbounds i32, i32* %0, i64 14
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %9, i32* %10
%11 = getelementptr inbounds i32, i32* %0, i64 15
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %1, i64 3
store i32 %12, i32* %13
%14 = load i32, i32* %0
%15 = getelementptr inbounds i32, i32* %1, i64 4
store i32 %14, i32* %15
%16 = getelementptr inbounds i32, i32* %0, i64 1
%17 = load i32, i32* %16
%18 = getelementptr inbounds i32, i32* %1, i64 5
store i32 %17, i32* %18
%19 = getelementptr inbounds i32, i32* %0, i64 2
%20 = load i32, i32* %19
%21 = getelementptr inbounds i32, i32* %1, i64 6
store i32 %20, i32* %21
%22 = getelementptr inbounds i32, i32* %0, i64 3
%23 = load i32, i32* %22
%24 = getelementptr inbounds i32, i32* %1, i64 7
store i32 %23, i32* %24
ret void
}