#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;
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) {
  uint8_t i;
  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;
  for (i = 0; i < 3; i++) {
    *left ^= READ_ROUND_KEY_DOUBLE_WORD(roundKeys[i]);
    speckey(b0_l, b0_r);
  }
  for (i = 0; i < 3; i++) {
    *right ^= READ_ROUND_KEY_DOUBLE_WORD(roundKeys[i + 3]);
    speckey(b1_l, b1_r);
  }
  *right ^= *left ^ rot32l8(*left) ^ rot32r8(*left);
  for (i = 0; i < 3; i++) {
    *right ^= READ_ROUND_KEY_DOUBLE_WORD(roundKeys[i + 6]);
    speckey(b1_l, b1_r);
  }
  for (i = 0; i < 3; i++) {
    *left ^= READ_ROUND_KEY_DOUBLE_WORD(roundKeys[i + 9]);
    speckey(b0_l, b0_r);
  }
  *left ^= *right ^ rot32l8(*right) ^ rot32r8(*right);
}


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)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    11c2 <round_f+0x82>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%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    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1183 <round_f+0x43>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    120d <round_f+0xcd>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%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    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11c9 <round_f+0x89>
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)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    128e <round_f+0x14e>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x6,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%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    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    124a <round_f+0x10a>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    12d9 <round_f+0x199>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x9,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%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    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1295 <round_f+0x155>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x50(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1050 <rot32l8@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <rot32r8@plt>
mov    -0x4c(%rbp),%ecx
xor    %eax,%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
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,%r13
mov    %rdi,%r14
lea    0x4(%rdi),%rbx
mov    %rbx,(%rsp)
mov    (%rdx),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%r14)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <speckey@plt>
mov    0x4(%r12),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%r14)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <speckey@plt>
mov    0x8(%r12),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%r14)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <speckey@plt>
lea    0x4(%r13),%rbx
mov    0xc(%r12),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,0x0(%r13)
mov    %r13,%rdi
mov    %rbx,%rsi
call   1040 <speckey@plt>
mov    0x10(%r12),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,0x0(%r13)
mov    %r13,%rdi
mov    %rbx,%rsi
call   1040 <speckey@plt>
mov    0x14(%r12),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,0x0(%r13)
mov    %r13,%rdi
mov    %rbx,%rsi
call   1040 <speckey@plt>
mov    (%r14),%ebp
mov    %ebp,%edi
call   1050 <rot32l8@plt>
mov    %eax,%r15d
xor    %ebp,%r15d
mov    (%r14),%edi
call   1030 <rot32r8@plt>
xor    %r15d,%eax
xor    %eax,0x0(%r13)
mov    0x18(%r12),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,0x0(%r13)
mov    %r13,%rdi
mov    %rbx,%rsi
call   1040 <speckey@plt>
mov    0x1c(%r12),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,0x0(%r13)
mov    %r13,%rdi
mov    %rbx,%rsi
call   1040 <speckey@plt>
mov    0x20(%r12),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,0x0(%r13)
mov    %r13,%rdi
mov    %rbx,%rsi
call   1040 <speckey@plt>
mov    0x24(%r12),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%r14)
mov    %r14,%rdi
mov    (%rsp),%rbx
mov    %rbx,%rsi
call   1040 <speckey@plt>
mov    0x28(%r12),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%r14)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <speckey@plt>
mov    0x2c(%r12),%edi
call   1060 <READ_ROUND_KEY_DOUBLE_WORD@plt>
xor    %eax,(%r14)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <speckey@plt>
mov    0x0(%r13),%ebp
mov    %ebp,%edi
call   1050 <rot32l8@plt>
mov    %eax,%ebx
xor    %ebp,%ebx
mov    0x0(%r13),%edi
call   1030 <rot32r8@plt>
xor    %ebx,%eax
xor    %eax,(%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
store i32 0, i32* %7
br label %18
18: ; preds = %34, %3
%19 = load i32, i32* %7
%20 = icmp slt i32 %19, 3
br i1 %20, label %21, label %37
21: ; preds = %18
%22 = load i32*, i32** %6
%23 = load i32, i32* %7
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %22, i64 %24
%26 = load i32, i32* %25
%27 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %26)
%28 = load i32*, i32** %4
%29 = load i32, i32* %28
%30 = xor i32 %29, %27
store i32 %30, i32* %28
%31 = load i32*, i32** %8
%32 = load i32*, i32** %9
%33 = call i32 @speckey(i32* %31, i32* %32)
br label %34
34: ; preds = %21
%35 = load i32, i32* %7
%36 = add nsw i32 %35, 1
store i32 %36, i32* %7
br label %18
37: ; preds = %18
store i32 0, i32* %7
br label %38
38: ; preds = %55, %37
%39 = load i32, i32* %7
%40 = icmp slt i32 %39, 3
br i1 %40, label %41, label %58
41: ; preds = %38
%42 = load i32*, i32** %6
%43 = load i32, i32* %7
%44 = add nsw i32 %43, 3
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i32, i32* %42, i64 %45
%47 = load i32, i32* %46
%48 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %47)
%49 = load i32*, i32** %5
%50 = load i32, i32* %49
%51 = xor i32 %50, %48
store i32 %51, i32* %49
%52 = load i32*, i32** %10
%53 = load i32*, i32** %11
%54 = call i32 @speckey(i32* %52, i32* %53)
br label %55
55: ; preds = %41
%56 = load i32, i32* %7
%57 = add nsw i32 %56, 1
store i32 %57, i32* %7
br label %38
58: ; preds = %38
%59 = load i32*, i32** %4
%60 = load i32, i32* %59
%61 = load i32*, i32** %4
%62 = load i32, i32* %61
%63 = call i32 @rot32l8(i32 %62)
%64 = xor i32 %60, %63
%65 = load i32*, i32** %4
%66 = load i32, i32* %65
%67 = call i32 @rot32r8(i32 %66)
%68 = xor i32 %64, %67
%69 = load i32*, i32** %5
%70 = load i32, i32* %69
%71 = xor i32 %70, %68
store i32 %71, i32* %69
store i32 0, i32* %7
br label %72
72: ; preds = %89, %58
%73 = load i32, i32* %7
%74 = icmp slt i32 %73, 3
br i1 %74, label %75, label %92
75: ; preds = %72
%76 = load i32*, i32** %6
%77 = load i32, i32* %7
%78 = add nsw i32 %77, 6
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds i32, i32* %76, i64 %79
%81 = load i32, i32* %80
%82 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %81)
%83 = load i32*, i32** %5
%84 = load i32, i32* %83
%85 = xor i32 %84, %82
store i32 %85, i32* %83
%86 = load i32*, i32** %10
%87 = load i32*, i32** %11
%88 = call i32 @speckey(i32* %86, i32* %87)
br label %89
89: ; preds = %75
%90 = load i32, i32* %7
%91 = add nsw i32 %90, 1
store i32 %91, i32* %7
br label %72
92: ; preds = %72
store i32 0, i32* %7
br label %93
93: ; preds = %110, %92
%94 = load i32, i32* %7
%95 = icmp slt i32 %94, 3
br i1 %95, label %96, label %113
96: ; preds = %93
%97 = load i32*, i32** %6
%98 = load i32, i32* %7
%99 = add nsw i32 %98, 9
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds i32, i32* %97, i64 %100
%102 = load i32, i32* %101
%103 = call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %102)
%104 = load i32*, i32** %4
%105 = load i32, i32* %104
%106 = xor i32 %105, %103
store i32 %106, i32* %104
%107 = load i32*, i32** %8
%108 = load i32*, i32** %9
%109 = call i32 @speckey(i32* %107, i32* %108)
br label %110
110: ; preds = %96
%111 = load i32, i32* %7
%112 = add nsw i32 %111, 1
store i32 %112, i32* %7
br label %93
113: ; preds = %93
%114 = load i32*, i32** %5
%115 = load i32, i32* %114
%116 = load i32*, i32** %5
%117 = load i32, i32* %116
%118 = call i32 @rot32l8(i32 %117)
%119 = xor i32 %115, %118
%120 = load i32*, i32** %5
%121 = load i32, i32* %120
%122 = call i32 @rot32r8(i32 %121)
%123 = xor i32 %119, %122
%124 = load i32*, i32** %4
%125 = load i32, i32* %124
%126 = xor i32 %125, %123
store i32 %126, i32* %124
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 = load i32, i32* %2
%6 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %5)
%7 = load i32, i32* %0
%8 = xor i32 %7, %6
store i32 %8, i32* %0
%9 = tail call i32 @speckey(i32* %0, i32* %4)
%10 = getelementptr inbounds i32, i32* %2, i64 1
%11 = load i32, i32* %10
%12 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %11)
%13 = load i32, i32* %0
%14 = xor i32 %13, %12
store i32 %14, i32* %0
%15 = tail call i32 @speckey(i32* %0, i32* %4)
%16 = getelementptr inbounds i32, i32* %2, i64 2
%17 = load i32, i32* %16
%18 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %17)
%19 = load i32, i32* %0
%20 = xor i32 %19, %18
store i32 %20, i32* %0
%21 = tail call i32 @speckey(i32* %0, i32* %4)
%22 = getelementptr inbounds i32, i32* %1, i64 1
%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* %22)
%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* %22)
%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* %22)
%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* %1
%49 = getelementptr inbounds i32, i32* %2, i64 6
%50 = load i32, i32* %49
%51 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %50)
%52 = load i32, i32* %1
%53 = xor i32 %52, %51
store i32 %53, i32* %1
%54 = tail call i32 @speckey(i32* %1, i32* %22)
%55 = getelementptr inbounds i32, i32* %2, i64 7
%56 = load i32, i32* %55
%57 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %56)
%58 = load i32, i32* %1
%59 = xor i32 %58, %57
store i32 %59, i32* %1
%60 = tail call i32 @speckey(i32* %1, i32* %22)
%61 = getelementptr inbounds i32, i32* %2, i64 8
%62 = load i32, i32* %61
%63 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %62)
%64 = load i32, i32* %1
%65 = xor i32 %64, %63
store i32 %65, i32* %1
%66 = tail call i32 @speckey(i32* %1, i32* %22)
%67 = getelementptr inbounds i32, i32* %2, i64 9
%68 = load i32, i32* %67
%69 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %68)
%70 = load i32, i32* %0
%71 = xor i32 %70, %69
store i32 %71, i32* %0
%72 = tail call i32 @speckey(i32* %0, i32* %4)
%73 = getelementptr inbounds i32, i32* %2, i64 10
%74 = load i32, i32* %73
%75 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %74)
%76 = load i32, i32* %0
%77 = xor i32 %76, %75
store i32 %77, i32* %0
%78 = tail call i32 @speckey(i32* %0, i32* %4)
%79 = getelementptr inbounds i32, i32* %2, i64 11
%80 = load i32, i32* %79
%81 = tail call i32 @READ_ROUND_KEY_DOUBLE_WORD(i32 %80)
%82 = load i32, i32* %0
%83 = xor i32 %82, %81
store i32 %83, i32* %0
%84 = tail call i32 @speckey(i32* %0, i32* %4)
%85 = load i32, i32* %1
%86 = tail call i32 @rot32l8(i32 %85)
%87 = xor i32 %86, %85
%88 = load i32, i32* %1
%89 = tail call i32 @rot32r8(i32 %88)
%90 = xor i32 %87, %89
%91 = load i32, i32* %0
%92 = xor i32 %90, %91
store i32 %92, i32* %0
ret void
}