#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 /*<<< 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 ^ (((*left) << (8)) | ((*left) >> (32 - 8))) ^
            (((*left) >> (8)) | ((*left) << (32 - 8)));
  *left = *right;
  *right = temp;
}


x86 assembly (clang, -O0):
<round_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%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   1040 <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   1030 <speckey@plt>
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edi
call   1040 <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   1030 <speckey@plt>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%edi
call   1040 <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   1030 <speckey@plt>
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%edi
call   1040 <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   1030 <speckey@plt>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%edi
call   1040 <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   1030 <speckey@plt>
mov    -0x18(%rbp),%rax
mov    0x14(%rax),%edi
call   1040 <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   1030 <speckey@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rdx
mov    (%rdx),%edx
sar    $0x18,%edx
or     %edx,%eax
xor    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sar    $0x8,%eax
mov    -0x8(%rbp),%rdx
mov    (%rdx),%edx
shl    $0x18,%edx
or     %edx,%eax
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    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_f>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x4(%rdi),%r13
lea    0x4(%rsi),%r15
mov    (%rdx),%edi
call   1040 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%rbx)
mov    %rbx,%rdi
mov    %r13,%rsi
call   1030 <speckey@plt>
mov    0x4(%r12),%edi
call   1040 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%rbx)
mov    %rbx,%rdi
mov    %r13,%rsi
call   1030 <speckey@plt>
mov    0x8(%r12),%edi
call   1040 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%rbx)
mov    %rbx,%rdi
mov    %r13,%rsi
call   1030 <speckey@plt>
mov    0xc(%r12),%edi
call   1040 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%r14)
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <speckey@plt>
mov    0x10(%r12),%edi
call   1040 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%r14)
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <speckey@plt>
mov    0x14(%r12),%edi
call   1040 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%r14)
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <speckey@plt>
mov    (%rbx),%eax
mov    %eax,%ecx
shl    $0x8,%ecx
mov    %eax,%edx
sar    $0x18,%edx
or     %ecx,%edx
mov    %eax,%ecx
sar    $0x8,%ecx
mov    %eax,%esi
shl    $0x18,%esi
or     %ecx,%esi
mov    (%r14),%ecx
xor    %eax,%ecx
xor    %edx,%ecx
xor    %esi,%ecx
mov    %ecx,(%rbx)
mov    %eax,(%r14)
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
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 = shl i32 %83, 8
%85 = load i32*, i32** %4
%86 = load i32, i32* %85
%87 = ashr i32 %86, 24
%88 = or i32 %84, %87
%89 = xor i32 %81, %88
%90 = load i32*, i32** %4
%91 = load i32, i32* %90
%92 = ashr i32 %91, 8
%93 = load i32*, i32** %4
%94 = load i32, i32* %93
%95 = shl i32 %94, 24
%96 = or i32 %92, %95
%97 = xor i32 %89, %96
%98 = load i32*, i32** %5
%99 = load i32, i32* %98
%100 = xor i32 %99, %97
store i32 %100, i32* %98
%101 = load i32*, i32** %5
%102 = load i32, i32* %101
%103 = load i32*, i32** %4
store i32 %102, i32* %103
%104 = load i32, i32* %7
%105 = load i32*, i32** %5
store i32 %104, i32* %105
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 = shl i32 %41, 8
%43 = ashr i32 %41, 24
%44 = or i32 %42, %43
%45 = ashr i32 %41, 8
%46 = shl i32 %41, 24
%47 = or i32 %45, %46
%48 = load i32, i32* %1
%49 = xor i32 %48, %41
%50 = xor i32 %49, %44
%51 = xor i32 %50, %47
store i32 %51, i32* %0
store i32 %41, i32* %1
ret void
}