#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 uint64_t;

/* Variables and functions */
void encrypt_speck_128x128(uint64_t *plain_text, uint64_t *cipher_text,
                           uint64_t *key) {
  int i;
  cipher_text[0] = plain_text[0];
  cipher_text[1] = plain_text[1];
  for (i = 0; i < 32; i++) {
    cipher_text[0] =
        ((((cipher_text[0]) >> (8)) | ((cipher_text[0]) << (64 - (8)))) +
         cipher_text[1]) ^
        key[i];
    cipher_text[1] =
        ((((cipher_text[1]) << (3)) | ((cipher_text[1]) >> (64 - (3)))) ^
         cipher_text[0]);
  }
}


x86 assembly (clang, -O0):
<encrypt_speck_128x128>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x20,-0x1c(%rbp)
jge    11ac <encrypt_speck_128x128+0xac>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sar    $0x8,%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    $0x38,%ecx
shl    %cl,%eax
mov    -0x24(%rbp),%ecx
or     %eax,%ecx
mov    -0x10(%rbp),%rax
add    0x4(%rax),%ecx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rdx
xor    (%rax,%rdx,4),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x3,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    $0x3d,%ecx
sar    %cl,%eax
mov    -0x20(%rbp),%ecx
or     %eax,%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1131 <encrypt_speck_128x128+0x31>
pop    %rbp
ret

x86 assembly (clang, -O2):
<encrypt_speck_128x128>:
mov    (%rdi),%eax
mov    %eax,(%rsi)
mov    0x4(%rdi),%eax
mov    %eax,0x4(%rsi)
ret

LLVM IR (-O0):
define void @encrypt_speck_128x128(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = load i32*, i32** %5
%12 = getelementptr inbounds i32, i32* %11, i64 0
store i32 %10, i32* %12
%13 = load i32*, i32** %4
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
%16 = load i32*, i32** %5
%17 = getelementptr inbounds i32, i32* %16, i64 1
store i32 %15, i32* %17
store i32 0, i32* %7
br label %18
18: ; preds = %58, %3
%19 = load i32, i32* %7
%20 = icmp slt i32 %19, 32
br i1 %20, label %21, label %61
21: ; preds = %18
%22 = load i32*, i32** %5
%23 = getelementptr inbounds i32, i32* %22, i64 0
%24 = load i32, i32* %23
%25 = ashr i32 %24, 8
%26 = load i32*, i32** %5
%27 = getelementptr inbounds i32, i32* %26, i64 0
%28 = load i32, i32* %27
%29 = shl i32 %28, 56
%30 = or i32 %25, %29
%31 = load i32*, i32** %5
%32 = getelementptr inbounds i32, i32* %31, i64 1
%33 = load i32, i32* %32
%34 = add nsw i32 %30, %33
%35 = load i32*, i32** %6
%36 = load i32, i32* %7
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i32, i32* %35, i64 %37
%39 = load i32, i32* %38
%40 = xor i32 %34, %39
%41 = load i32*, i32** %5
%42 = getelementptr inbounds i32, i32* %41, i64 0
store i32 %40, i32* %42
%43 = load i32*, i32** %5
%44 = getelementptr inbounds i32, i32* %43, i64 1
%45 = load i32, i32* %44
%46 = shl i32 %45, 3
%47 = load i32*, i32** %5
%48 = getelementptr inbounds i32, i32* %47, i64 1
%49 = load i32, i32* %48
%50 = ashr i32 %49, 61
%51 = or i32 %46, %50
%52 = load i32*, i32** %5
%53 = getelementptr inbounds i32, i32* %52, i64 0
%54 = load i32, i32* %53
%55 = xor i32 %51, %54
%56 = load i32*, i32** %5
%57 = getelementptr inbounds i32, i32* %56, i64 1
store i32 %55, i32* %57
br label %58
58: ; preds = %21
%59 = load i32, i32* %7
%60 = add nsw i32 %59, 1
store i32 %60, i32* %7
br label %18
61: ; preds = %18
ret void
}

LLVM IR (-O2):
define void @encrypt_speck_128x128(i32* nocapture %0, i32* nocapture writeonly %1, i32* nocapture readnone %2) {
%4 = load i32, i32* %0
store i32 %4, i32* %1
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %6, i32* %7
ret void
}