#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 F0(int);
int F1(int);
int READ_ROUND_KEY_BYTE(int const);
void DecryptRoundFunction(uint8_t *x, const uint8_t *sk) {
  uint8_t temp0 = x[0];
  x[0] = x[1];
  x[1] = (x[2] - (F1(x[0]) ^ READ_ROUND_KEY_BYTE(sk[0]))) & 0xFF;
  x[2] = x[3];
  x[3] = x[4] ^ ((F0(x[2]) + READ_ROUND_KEY_BYTE(sk[1])) & 0xFF);
  x[4] = x[5];
  x[5] = (x[6] - (F1(x[4]) ^ READ_ROUND_KEY_BYTE(sk[2]))) & 0xFF;
  x[6] = x[7];
  x[7] = temp0 ^ ((F0(x[6]) + READ_ROUND_KEY_BYTE(sk[3])) & 0xFF);
}


x86 assembly (clang, -O0):
<DecryptRoundFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%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),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <F1@plt>
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
mov    -0x34(%rbp),%ecx
mov    %eax,%edx
mov    -0x30(%rbp),%eax
xor    %edx,%eax
sub    %eax,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%edi
call   1050 <F0@plt>
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
mov    -0x2c(%rbp),%ecx
mov    %eax,%edx
mov    -0x28(%rbp),%eax
add    %edx,%eax
and    $0xff,%eax
xor    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%edi
call   1030 <F1@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
mov    -0x24(%rbp),%ecx
mov    %eax,%edx
mov    -0x20(%rbp),%eax
xor    %edx,%eax
sub    %eax,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x18(%rax)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%edi
call   1050 <F0@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
mov    -0x1c(%rbp),%ecx
mov    %eax,%edx
mov    -0x18(%rbp),%eax
add    %edx,%eax
and    $0xff,%eax
xor    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x1c(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DecryptRoundFunction>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%r15d
mov    0x4(%rdi),%edi
mov    %edi,(%rbx)
mov    0x8(%rbx),%ebp
call   1030 <F1@plt>
mov    %eax,%r12d
mov    (%r14),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
xor    %r12d,%eax
sub    %eax,%ebp
movzbl %bpl,%eax
mov    %eax,0x4(%rbx)
mov    0xc(%rbx),%edi
mov    0x10(%rbx),%r12d
mov    %edi,0x8(%rbx)
call   1050 <F0@plt>
mov    %eax,%ebp
mov    0x4(%r14),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
add    %ebp,%eax
movzbl %al,%eax
xor    %r12d,%eax
mov    %eax,0xc(%rbx)
mov    0x14(%rbx),%edi
mov    0x18(%rbx),%ebp
mov    %edi,0x10(%rbx)
call   1030 <F1@plt>
mov    %eax,%r12d
mov    0x8(%r14),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
xor    %r12d,%eax
sub    %eax,%ebp
movzbl %bpl,%eax
mov    %eax,0x14(%rbx)
mov    0x1c(%rbx),%edi
mov    %edi,0x18(%rbx)
call   1050 <F0@plt>
mov    %eax,%ebp
mov    0xc(%r14),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
add    %ebp,%eax
movzbl %al,%eax
xor    %r15d,%eax
mov    %eax,0x1c(%rbx)
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @DecryptRoundFunction(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** %3
%13 = getelementptr inbounds i32, i32* %12, i64 0
store i32 %11, i32* %13
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 2
%16 = load i32, i32* %15
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i64 0
%19 = load i32, i32* %18
%20 = call i32 @F1(i32 %19)
%21 = load i32*, i32** %4
%22 = getelementptr inbounds i32, i32* %21, i64 0
%23 = load i32, i32* %22
%24 = call i32 @READ_ROUND_KEY_BYTE(i32 %23)
%25 = xor i32 %20, %24
%26 = sub nsw i32 %16, %25
%27 = and i32 %26, 255
%28 = load i32*, i32** %3
%29 = getelementptr inbounds i32, i32* %28, i64 1
store i32 %27, i32* %29
%30 = load i32*, i32** %3
%31 = getelementptr inbounds i32, i32* %30, i64 3
%32 = load i32, i32* %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 2
%40 = load i32, i32* %39
%41 = call i32 @F0(i32 %40)
%42 = load i32*, i32** %4
%43 = getelementptr inbounds i32, i32* %42, i64 1
%44 = load i32, i32* %43
%45 = call i32 @READ_ROUND_KEY_BYTE(i32 %44)
%46 = add nsw i32 %41, %45
%47 = and i32 %46, 255
%48 = xor i32 %37, %47
%49 = load i32*, i32** %3
%50 = getelementptr inbounds i32, i32* %49, i64 3
store i32 %48, i32* %50
%51 = load i32*, i32** %3
%52 = getelementptr inbounds i32, i32* %51, i64 5
%53 = load i32, i32* %52
%54 = load i32*, i32** %3
%55 = getelementptr inbounds i32, i32* %54, i64 4
store i32 %53, i32* %55
%56 = load i32*, i32** %3
%57 = getelementptr inbounds i32, i32* %56, i64 6
%58 = load i32, i32* %57
%59 = load i32*, i32** %3
%60 = getelementptr inbounds i32, i32* %59, i64 4
%61 = load i32, i32* %60
%62 = call i32 @F1(i32 %61)
%63 = load i32*, i32** %4
%64 = getelementptr inbounds i32, i32* %63, i64 2
%65 = load i32, i32* %64
%66 = call i32 @READ_ROUND_KEY_BYTE(i32 %65)
%67 = xor i32 %62, %66
%68 = sub nsw i32 %58, %67
%69 = and i32 %68, 255
%70 = load i32*, i32** %3
%71 = getelementptr inbounds i32, i32* %70, i64 5
store i32 %69, i32* %71
%72 = load i32*, i32** %3
%73 = getelementptr inbounds i32, i32* %72, i64 7
%74 = load i32, i32* %73
%75 = load i32*, i32** %3
%76 = getelementptr inbounds i32, i32* %75, i64 6
store i32 %74, i32* %76
%77 = load i32, i32* %5
%78 = load i32*, i32** %3
%79 = getelementptr inbounds i32, i32* %78, i64 6
%80 = load i32, i32* %79
%81 = call i32 @F0(i32 %80)
%82 = load i32*, i32** %4
%83 = getelementptr inbounds i32, i32* %82, i64 3
%84 = load i32, i32* %83
%85 = call i32 @READ_ROUND_KEY_BYTE(i32 %84)
%86 = add nsw i32 %81, %85
%87 = and i32 %86, 255
%88 = xor i32 %77, %87
%89 = load i32*, i32** %3
%90 = getelementptr inbounds i32, i32* %89, i64 7
store i32 %88, i32* %90
ret void
}

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