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


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

x86 assembly (clang, -O2):
<DecryptInitialTransfomation>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%ebp
mov    (%rsi),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
sub    %eax,%ebp
movzbl %bpl,%eax
mov    %eax,(%rbx)
mov    0x8(%rbx),%ebp
mov    0x4(%r14),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
mov    %eax,0x8(%rbx)
mov    0x10(%rbx),%ebp
mov    0x8(%r14),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
sub    %eax,%ebp
movzbl %bpl,%eax
mov    %eax,0x10(%rbx)
mov    0x18(%rbx),%ebp
mov    0xc(%r14),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
mov    %eax,0x18(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @DecryptInitialTransfomation(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = call i32 @READ_ROUND_KEY_BYTE(i32 %10)
%12 = sub nsw i32 %7, %11
%13 = and i32 %12, 255
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 0
store i32 %13, i32* %15
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 2
%18 = load i32, i32* %17
%19 = load i32*, i32** %4
%20 = getelementptr inbounds i32, i32* %19, i64 1
%21 = load i32, i32* %20
%22 = call i32 @READ_ROUND_KEY_BYTE(i32 %21)
%23 = xor i32 %18, %22
%24 = load i32*, i32** %3
%25 = getelementptr inbounds i32, i32* %24, i64 2
store i32 %23, i32* %25
%26 = load i32*, i32** %3
%27 = getelementptr inbounds i32, i32* %26, i64 4
%28 = load i32, i32* %27
%29 = load i32*, i32** %4
%30 = getelementptr inbounds i32, i32* %29, i64 2
%31 = load i32, i32* %30
%32 = call i32 @READ_ROUND_KEY_BYTE(i32 %31)
%33 = sub nsw i32 %28, %32
%34 = and i32 %33, 255
%35 = load i32*, i32** %3
%36 = getelementptr inbounds i32, i32* %35, i64 4
store i32 %34, i32* %36
%37 = load i32*, i32** %3
%38 = getelementptr inbounds i32, i32* %37, i64 6
%39 = load i32, i32* %38
%40 = load i32*, i32** %4
%41 = getelementptr inbounds i32, i32* %40, i64 3
%42 = load i32, i32* %41
%43 = call i32 @READ_ROUND_KEY_BYTE(i32 %42)
%44 = xor i32 %39, %43
%45 = load i32*, i32** %3
%46 = getelementptr inbounds i32, i32* %45, i64 6
store i32 %44, i32* %46
ret void
}

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