#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 const);
void EncryptFinalTransfomation(uint8_t *x, const uint8_t *wk) {
  uint8_t temp = x[0];
  x[0] = (x[1] + READ_ROUND_KEY_BYTE(wk[4])) & 0xFF;
  x[1] = x[2];
  x[2] = x[3] ^ READ_ROUND_KEY_BYTE(wk[5]);
  x[3] = x[4];
  x[4] = (x[5] + READ_ROUND_KEY_BYTE(wk[6])) & 0xFF;
  x[5] = x[6];
  x[6] = x[7] ^ READ_ROUND_KEY_BYTE(wk[7]);
  x[7] = temp;
}


x86 assembly (clang, -O0):
<EncryptFinalTransfomation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
mov    -0x24(%rbp),%ecx
add    %eax,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
mov    -0x20(%rbp),%ecx
xor    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
mov    -0x1c(%rbp),%ecx
add    %eax,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1c(%rax),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
mov    -0x18(%rbp),%ecx
xor    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x18(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x1c(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EncryptFinalTransfomation>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%r15d
mov    0x4(%rdi),%ebp
mov    0x10(%rsi),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
add    %ebp,%eax
movzbl %al,%eax
mov    %eax,(%rbx)
mov    0x8(%rbx),%eax
mov    0xc(%rbx),%ebp
mov    %eax,0x4(%rbx)
mov    0x14(%r14),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
mov    %eax,0x8(%rbx)
mov    0x10(%rbx),%eax
mov    0x14(%rbx),%ebp
mov    %eax,0xc(%rbx)
mov    0x18(%r14),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
add    %ebp,%eax
movzbl %al,%eax
mov    %eax,0x10(%rbx)
mov    0x18(%rbx),%eax
mov    0x1c(%rbx),%ebp
mov    %eax,0x14(%rbx)
mov    0x1c(%r14),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
mov    %eax,0x18(%rbx)
mov    %r15d,0x1c(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @EncryptFinalTransfomation(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 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
store i32 %8, i32* %5
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 4
%14 = load i32, i32* %13
%15 = call i32 @READ_ROUND_KEY_BYTE(i32 %14)
%16 = add nsw i32 %11, %15
%17 = and i32 %16, 255
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 0
store i32 %17, i32* %19
%20 = load i32*, i32** %3
%21 = getelementptr inbounds i32, i32* %20, i64 2
%22 = load i32, i32* %21
%23 = load i32*, i32** %3
%24 = getelementptr inbounds i32, i32* %23, i64 1
store i32 %22, i32* %24
%25 = load i32*, i32** %3
%26 = getelementptr inbounds i32, i32* %25, i64 3
%27 = load i32, i32* %26
%28 = load i32*, i32** %4
%29 = getelementptr inbounds i32, i32* %28, i64 5
%30 = load i32, i32* %29
%31 = call i32 @READ_ROUND_KEY_BYTE(i32 %30)
%32 = xor i32 %27, %31
%33 = load i32*, i32** %3
%34 = getelementptr inbounds i32, i32* %33, i64 2
store i32 %32, i32* %34
%35 = load i32*, i32** %3
%36 = getelementptr inbounds i32, i32* %35, i64 4
%37 = load i32, i32* %36
%38 = load i32*, i32** %3
%39 = getelementptr inbounds i32, i32* %38, i64 3
store i32 %37, i32* %39
%40 = load i32*, i32** %3
%41 = getelementptr inbounds i32, i32* %40, i64 5
%42 = load i32, i32* %41
%43 = load i32*, i32** %4
%44 = getelementptr inbounds i32, i32* %43, i64 6
%45 = load i32, i32* %44
%46 = call i32 @READ_ROUND_KEY_BYTE(i32 %45)
%47 = add nsw i32 %42, %46
%48 = and i32 %47, 255
%49 = load i32*, i32** %3
%50 = getelementptr inbounds i32, i32* %49, i64 4
store i32 %48, i32* %50
%51 = load i32*, i32** %3
%52 = getelementptr inbounds i32, i32* %51, i64 6
%53 = load i32, i32* %52
%54 = load i32*, i32** %3
%55 = getelementptr inbounds i32, i32* %54, i64 5
store i32 %53, i32* %55
%56 = load i32*, i32** %3
%57 = getelementptr inbounds i32, i32* %56, i64 7
%58 = load i32, i32* %57
%59 = load i32*, i32** %4
%60 = getelementptr inbounds i32, i32* %59, i64 7
%61 = load i32, i32* %60
%62 = call i32 @READ_ROUND_KEY_BYTE(i32 %61)
%63 = xor i32 %58, %62
%64 = load i32*, i32** %3
%65 = getelementptr inbounds i32, i32* %64, i64 6
store i32 %63, i32* %65
%66 = load i32, i32* %5
%67 = load i32*, i32** %3
%68 = getelementptr inbounds i32, i32* %67, i64 7
store i32 %66, i32* %68
ret void
}

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