#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 uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int READ_ROUND_KEY_DOUBLE_WORD(int);
int rot32l8(int);
int rot32r8(int);
int /*<<< orphan*/ speckey(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void round_f(uint32_t *left, uint32_t *right, uint32_t *roundKeys) {
  uint32_t temp;
  uint16_t *b0_l = (uint16_t *)left;
  uint16_t *b0_r = (uint16_t *)left + 1;
  uint16_t *b1_l = (uint16_t *)right;
  uint16_t *b1_r = (uint16_t *)right + 1;
  *left ^= READ_ROUND_KEY_DOUBLE_WORD(roundKeys[0]);
  speckey(b0_l, b0_r);
  *left ^= READ_ROUND_KEY_DOUBLE_WORD(roundKeys[1]);
  speckey(b0_l, b0_r);
  *left ^= READ_ROUND_KEY_DOUBLE_WORD(roundKeys[2]);
  speckey(b0_l, b0_r);
  *right ^= READ_ROUND_KEY_DOUBLE_WORD(roundKeys[3]);
  speckey(b1_l, b1_r);
  *right ^= READ_ROUND_KEY_DOUBLE_WORD(roundKeys[4]);
  speckey(b1_l, b1_r);
  *right ^= READ_ROUND_KEY_DOUBLE_WORD(roundKeys[5]);
  speckey(b1_l, b1_r);
  temp = *left;
  *right ^= *left ^ rot32l8(*left) ^ rot32r8(*left);
  *left = *right;
  *right = temp;
}


x86 assembly (clang, -O0):
<round_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1040 <speckey@plt>
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1040 <speckey@plt>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1040 <speckey@plt>
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1040 <speckey@plt>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1040 <speckey@plt>
mov    -0x18(%rbp),%rax
mov    0x14(%rax),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1040 <speckey@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x48(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1050 <rot32l8@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x44(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <rot32r8@plt>
mov    -0x44(%rbp),%ecx
xor    %eax,%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_f>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x4(%rdi),%r13
lea    0x4(%rsi),%r15
mov    (%rdx),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%rbx)
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <speckey@plt>
mov    0x4(%r12),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%rbx)
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <speckey@plt>
mov    0x8(%r12),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%rbx)
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <speckey@plt>
mov    0xc(%r12),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%r14)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <speckey@plt>
mov    0x10(%r12),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%r14)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <speckey@plt>
mov    0x14(%r12),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%r14)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <speckey@plt>
mov    (%rbx),%r15d
mov    %r15d,%edi
call   1050 <rot32l8@plt>
mov    %eax,%ebp
xor    %r15d,%ebp
mov    (%rbx),%edi
call   1030 <rot32r8@plt>
xor    %ebp,%eax
xor    (%r14),%eax
mov    %eax,(%rbx)
mov    %r15d,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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