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


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

x86 assembly (clang, -O2):
<EncryptRoundFunction>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x18(%rdi),%r15d
mov    0x1c(%rdi),%r12d
mov    %r15d,0x1c(%rdi)
mov    0x10(%rdi),%edi
mov    0x14(%rbx),%r13d
call   1030 <F1@plt>
mov    %eax,%ebp
mov    0x8(%r14),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
add    %r13d,%eax
movzbl %al,%eax
mov    %eax,0x18(%rbx)
mov    0x10(%rbx),%eax
mov    %eax,0x14(%rbx)
mov    0x8(%rbx),%edi
mov    0xc(%rbx),%r13d
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    %r13d,%eax
mov    %eax,0x10(%rbx)
mov    0x8(%rbx),%eax
mov    %eax,0xc(%rbx)
mov    (%rbx),%edi
mov    0x4(%rbx),%r13d
call   1030 <F1@plt>
mov    %eax,%ebp
mov    (%r14),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
add    %r13d,%eax
movzbl %al,%eax
mov    %eax,0x8(%rbx)
mov    (%rbx),%eax
mov    %eax,0x4(%rbx)
mov    %r15d,%edi
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    %r12d,%eax
mov    %eax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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