#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 */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
unsigned int rotl(unsigned int, unsigned int);
int main() {
  int i, s;
  int skey[26] = {0x9BBBD8C8, 0x1A37F7FB, 0x46F8E8C5, 0x460C6085, 0x70F83B8A,
                  0x284B8303, 0x513E1454, 0xF621ED22, 0x3125065D, 0x11A83A5D,
                  0xD427686B, 0x713AD82D, 0x4B792F99, 0x2799A4DD, 0xA7901C49,
                  0xDEDE871A, 0x36C03196, 0xA7EFC249, 0x61A78BB8, 0x3B0A1D2B,
                  0x4DBFCA76, 0xAE162167, 0x30D76B0A, 0x43192304, 0xF6CC1431,
                  0x65046380};
  unsigned long long din[6] = {0x0000000000000000, 0x00000000000000FF,
                               0x00000000000000F0, 0x000000000000000F,
                               0x00000000000000AA, 0x0000000000000055};
  unsigned long long dout[6];
  unsigned long long sig = 0;
  unsigned long long res = 0;
  unsigned int A = 0;
  unsigned int B = 0;
  for (s = 0; s < 6; s++) {
    sig = din[s];
    A = sig >> 32;
    B = sig & 0xFFFFFFFF;
    A += skey[0];
    B += skey[1];
    for (i = 1; i <= 12; i++) {
      A ^= B;
      A = rotl(A, B & 0x1f);
      A += skey[2 * i];
      B ^= A;
      B = rotl(B, A & 0x1f);
      B += skey[2 * i + 1];
    }
    res = (long long)A << 32 | B;
    dout[s] = res;
  }
  printf("%s%22s\n", "INPUT", ": RESULT");
  for (i = 0; i < 6; i++) {
    printf("0x%016llX : 0x%016llX\n", din[i], dout[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xea3(%rip),%rsi
mov    $0x68,%edx
call   1050 <memcpy@plt>
lea    -0xb0(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1040 <memset@plt>
movq   $0xff,-0xa8(%rbp)
movq   $0xf0,-0xa0(%rbp)
movq   $0xf,-0x98(%rbp)
movq   $0xaa,-0x90(%rbp)
movq   $0x55,-0x88(%rbp)
movq   $0x0,-0xe8(%rbp)
movq   $0x0,-0xf0(%rbp)
movl   $0x0,-0xf4(%rbp)
movl   $0x0,-0xf8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jge    132a <main+0x1ea>
movslq -0xc(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rax
ff
mov    %rax,-0xe8(%rbp)
mov    -0xe8(%rbp),%rax
shr    $0x20,%rax
mov    %eax,-0xf4(%rbp)
movabs $0xffffffff,%rax
and    -0xe8(%rbp),%rax
mov    %eax,-0xf8(%rbp)
mov    -0x80(%rbp),%eax
add    -0xf4(%rbp),%eax
mov    %eax,-0xf4(%rbp)
mov    -0x7c(%rbp),%eax
add    -0xf8(%rbp),%eax
mov    %eax,-0xf8(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xc,-0x8(%rbp)
jg     12ef <main+0x1af>
mov    -0xf8(%rbp),%eax
xor    -0xf4(%rbp),%eax
mov    %eax,-0xf4(%rbp)
mov    -0xf4(%rbp),%edi
mov    -0xf8(%rbp),%esi
and    $0x1f,%esi
call   1060 <rotl@plt>
mov    %eax,-0xf4(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
cltq
mov    -0x80(%rbp,%rax,4),%eax
add    -0xf4(%rbp),%eax
mov    %eax,-0xf4(%rbp)
mov    -0xf4(%rbp),%eax
xor    -0xf8(%rbp),%eax
mov    %eax,-0xf8(%rbp)
mov    -0xf8(%rbp),%edi
mov    -0xf4(%rbp),%esi
and    $0x1f,%esi
call   1060 <rotl@plt>
mov    %eax,-0xf8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cltq
mov    -0x80(%rbp,%rax,4),%eax
add    -0xf8(%rbp),%eax
mov    %eax,-0xf8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    124c <main+0x10c>
mov    -0xf4(%rbp),%eax
shl    $0x20,%rax
mov    -0xf8(%rbp),%ecx
or     %rcx,%rax
mov    %rax,-0xf0(%rbp)
mov    -0xf0(%rbp),%rcx
movslq -0xc(%rbp),%rax
mov    %rcx,-0xe0(%rbp,%rax,8)
ff
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11e2 <main+0xa2>
lea    0xd37(%rip),%rdi
lea    0xd38(%rip),%rsi
lea    0xd37(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    138b <main+0x24b>
movslq -0x8(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rsi
ff
movslq -0x8(%rbp),%rax
mov    -0xe0(%rbp,%rax,8),%rdx
ff
lea    0xd09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    134d <main+0x20d>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x60,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec4(%rip),%xmm0
movups %xmm0,0x38(%rsp)
movaps 0xec8(%rip),%xmm0
movups %xmm0,0x48(%rsp)
movq   $0x55,0x58(%rsp)
xor    %r14d,%r14d
lea    0xec0(%rip),%r15
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rbx
shr    $0x20,%rbx
add    $0x9bbbd8c8,%ebx
add    $0x1a37f7fb,%r14d
xor    %r13d,%r13d
nopw   0x0(%rax,%rax,1)
xor    %r14d,%ebx
mov    %r14d,%esi
and    $0x1f,%esi
mov    %ebx,%edi
call   1040 <rotl@plt>
mov    %eax,%ebx
add    0x8(%r15,%r13,8),%ebx
xor    %ebx,%r14d
mov    %ebx,%esi
and    $0x1f,%esi
mov    %r14d,%edi
call   1040 <rotl@plt>
mov    %eax,%r14d
add    0xc(%r15,%r13,8),%r14d
add    $0x1,%r13
cmp    $0xc,%r13
jne    1190 <main+0x70>
shl    $0x20,%rbx
mov    %r14d,%eax
or     %rbx,%rax
mov    %rax,(%rsp,%r12,8)
add    $0x1,%r12
cmp    $0x6,%r12
je     11e8 <main+0xc8>
mov    0x30(%rsp,%r12,8),%r14
jmp    1170 <main+0x50>
lea    0xe99(%rip),%rdi
lea    0xe9a(%rip),%rsi
lea    0xe99(%rip),%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%rdx
lea    0xe90(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%rdx
mov    $0xff,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%rdx
mov    $0xf0,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x18(%rsp),%rdx
mov    $0xf,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x20(%rsp),%rdx
mov    $0xaa,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x28(%rsp),%rdx
mov    $0x55,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.skey = [26 x i32] [i32 -1682188088, i32 439875579, i32 1190717637, i32 1175216261, i32 1895316362, i32 676037379, i32 1363022932, i32 -165548766, i32 824510045, i32 296237661, i32 -735614869, i32 1899681837, i32 1266233241, i32 664380637, i32 -1483727799, i32 -555841766, i32 918565270, i32 -1477459383, i32 1638370232, i32 990518571, i32 1304414838, i32 -1374281369, i32 819424010, i32 1125720836, i32 -154397647, i32 1694786432]
@.str = [8 x i8] c"%s%22s\0A\00"
@.str.1 = [6 x i8] c"INPUT\00"
@.str.2 = [9 x i8] c": RESULT\00"
@.str.3 = [23 x i8] c"0x%016llX : 0x%016llX\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [26 x i32]
%5 = alloca [6 x i64]
%6 = alloca [6 x i64]
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
%11 = bitcast [26 x i32]* %4 to i8*
%12 = bitcast [6 x i64]* %5 to i8*
%13 = bitcast i8* %12 to [6 x i64]*
%14 = getelementptr inbounds [6 x i64], [6 x i64]* %13, i32 0, i32 1
store i64 255, i64* %14
%15 = getelementptr inbounds [6 x i64], [6 x i64]* %13, i32 0, i32 2
store i64 240, i64* %15
%16 = getelementptr inbounds [6 x i64], [6 x i64]* %13, i32 0, i32 3
store i64 15, i64* %16
%17 = getelementptr inbounds [6 x i64], [6 x i64]* %13, i32 0, i32 4
store i64 170, i64* %17
%18 = getelementptr inbounds [6 x i64], [6 x i64]* %13, i32 0, i32 5
store i64 85, i64* %18
store i64 0, i64* %7
store i64 0, i64* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %3
br label %19
19: ; preds = %88, %0
%20 = load i32, i32* %3
%21 = icmp slt i32 %20, 6
br i1 %21, label %22, label %91
22: ; preds = %19
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [6 x i64], [6 x i64]* %5, i64 0, i64 %24
%26 = load i64, i64* %25
store i64 %26, i64* %7
%27 = load i64, i64* %7
%28 = lshr i64 %27, 32
%29 = trunc i64 %28 to i32
store i32 %29, i32* %9
%30 = load i64, i64* %7
%31 = and i64 %30, 4294967295
%32 = trunc i64 %31 to i32
store i32 %32, i32* %10
%33 = getelementptr inbounds [26 x i32], [26 x i32]* %4, i64 0, i64 0
%34 = load i32, i32* %33
%35 = load i32, i32* %9
%36 = add i32 %35, %34
store i32 %36, i32* %9
%37 = getelementptr inbounds [26 x i32], [26 x i32]* %4, i64 0, i64 1
%38 = load i32, i32* %37
%39 = load i32, i32* %10
%40 = add i32 %39, %38
store i32 %40, i32* %10
store i32 1, i32* %2
br label %41
41: ; preds = %74, %22
%42 = load i32, i32* %2
%43 = icmp sle i32 %42, 12
br i1 %43, label %44, label %77
44: ; preds = %41
%45 = load i32, i32* %10
%46 = load i32, i32* %9
%47 = xor i32 %46, %45
store i32 %47, i32* %9
%48 = load i32, i32* %9
%49 = load i32, i32* %10
%50 = and i32 %49, 31
%51 = call i32 @rotl(i32 %48, i32 %50)
store i32 %51, i32* %9
%52 = load i32, i32* %2
%53 = mul nsw i32 2, %52
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [26 x i32], [26 x i32]* %4, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = load i32, i32* %9
%58 = add i32 %57, %56
store i32 %58, i32* %9
%59 = load i32, i32* %9
%60 = load i32, i32* %10
%61 = xor i32 %60, %59
store i32 %61, i32* %10
%62 = load i32, i32* %10
%63 = load i32, i32* %9
%64 = and i32 %63, 31
%65 = call i32 @rotl(i32 %62, i32 %64)
store i32 %65, i32* %10
%66 = load i32, i32* %2
%67 = mul nsw i32 2, %66
%68 = add nsw i32 %67, 1
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [26 x i32], [26 x i32]* %4, i64 0, i64 %69
%71 = load i32, i32* %70
%72 = load i32, i32* %10
%73 = add i32 %72, %71
store i32 %73, i32* %10
br label %74
74: ; preds = %44
%75 = load i32, i32* %2
%76 = add nsw i32 %75, 1
store i32 %76, i32* %2
br label %41
77: ; preds = %41
%78 = load i32, i32* %9
%79 = zext i32 %78 to i64
%80 = shl i64 %79, 32
%81 = load i32, i32* %10
%82 = zext i32 %81 to i64
%83 = or i64 %80, %82
store i64 %83, i64* %8
%84 = load i64, i64* %8
%85 = load i32, i32* %3
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [6 x i64], [6 x i64]* %6, i64 0, i64 %86
store i64 %84, i64* %87
br label %88
88: ; preds = %77
%89 = load i32, i32* %3
%90 = add nsw i32 %89, 1
store i32 %90, i32* %3
br label %19
91: ; preds = %19
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %2
br label %93
93: ; preds = %106, %91
%94 = load i32, i32* %2
%95 = icmp slt i32 %94, 6
br i1 %95, label %96, label %109
96: ; preds = %93
%97 = load i32, i32* %2
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds [6 x i64], [6 x i64]* %5, i64 0, i64 %98
%100 = load i64, i64* %99
%101 = load i32, i32* %2
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [6 x i64], [6 x i64]* %6, i64 0, i64 %102
%104 = load i64, i64* %103
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i64 %100, i64 %104)
br label %106
106: ; preds = %96
%107 = load i32, i32* %2
%108 = add nsw i32 %107, 1
store i32 %108, i32* %2
br label %93
109: ; preds = %93
ret i32 0
}

LLVM IR (-O2):
@__const.main.skey = [26 x i32] [i32 -1682188088, i32 439875579, i32 1190717637, i32 1175216261, i32 1895316362, i32 676037379, i32 1363022932, i32 -165548766, i32 824510045, i32 296237661, i32 -735614869, i32 1899681837, i32 1266233241, i32 664380637, i32 -1483727799, i32 -555841766, i32 918565270, i32 -1477459383, i32 1638370232, i32 990518571, i32 1304414838, i32 -1374281369, i32 819424010, i32 1125720836, i32 -154397647, i32 1694786432]
@.str = [8 x i8] c"%s%22s\0A\00"
@.str.1 = [6 x i8] c"INPUT\00"
@.str.2 = [9 x i8] c": RESULT\00"
@.str.3 = [23 x i8] c"0x%016llX : 0x%016llX\0A\00"
define i32 @main() {
%1 = alloca [6 x i64]
%2 = alloca [6 x i64]
%3 = bitcast [6 x i64]* %1 to i8*
%4 = getelementptr inbounds [6 x i64], [6 x i64]* %1, i64 0, i64 1
%5 = bitcast i64* %4 to <2 x i64>*
store <2 x i64> <i64 255, i64 240>, <2 x i64>* %5
%6 = getelementptr inbounds [6 x i64], [6 x i64]* %1, i64 0, i64 3
%7 = bitcast i64* %6 to <2 x i64>*
store <2 x i64> <i64 15, i64 170>, <2 x i64>* %7
%8 = getelementptr inbounds [6 x i64], [6 x i64]* %1, i64 0, i64 5
store i64 85, i64* %8
%9 = bitcast [6 x i64]* %2 to i8*
br label %10
10: ; preds = %46, %0
%11 = phi i64 [ 0, %0 ], [ %48, %46 ]
%12 = phi i64 [ 0, %0 ], [ %44, %46 ]
%13 = lshr i64 %11, 32
%14 = trunc i64 %13 to i32
%15 = trunc i64 %11 to i32
%16 = add i32 %14, -1682188088
%17 = add i32 %15, 439875579
br label %18
18: ; preds = %10, %18
%19 = phi i64 [ 1, %10 ], [ %36, %18 ]
%20 = phi i32 [ %17, %10 ], [ %35, %18 ]
%21 = phi i32 [ %16, %10 ], [ %28, %18 ]
%22 = xor i32 %20, %21
%23 = and i32 %20, 31
%24 = tail call i32 @rotl(i32 %22, i32 %23)
%25 = shl nuw nsw i64 %19, 1
%26 = getelementptr inbounds [26 x i32], [26 x i32]* @__const.main.skey, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = add i32 %27, %24
%29 = xor i32 %28, %20
%30 = and i32 %28, 31
%31 = tail call i32 @rotl(i32 %29, i32 %30)
%32 = or i64 %25, 1
%33 = getelementptr inbounds [26 x i32], [26 x i32]* @__const.main.skey, i64 0, i64 %32
%34 = load i32, i32* %33
%35 = add i32 %34, %31
%36 = add nuw nsw i64 %19, 1
%37 = icmp eq i64 %36, 13
br i1 %37, label %38, label %18
38: ; preds = %18
%39 = zext i32 %28 to i64
%40 = shl nuw i64 %39, 32
%41 = zext i32 %35 to i64
%42 = or i64 %40, %41
%43 = getelementptr inbounds [6 x i64], [6 x i64]* %2, i64 0, i64 %12
store i64 %42, i64* %43
%44 = add nuw nsw i64 %12, 1
%45 = icmp eq i64 %44, 6
br i1 %45, label %49, label %46
46: ; preds = %38
%47 = getelementptr inbounds [6 x i64], [6 x i64]* %1, i64 0, i64 %44
%48 = load i64, i64* %47
br label %10
49: ; preds = %38
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%51 = getelementptr inbounds [6 x i64], [6 x i64]* %2, i64 0, i64 0
%52 = load i64, i64* %51
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i64 0, i64 %52)
%54 = getelementptr inbounds [6 x i64], [6 x i64]* %2, i64 0, i64 1
%55 = load i64, i64* %54
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i64 255, i64 %55)
%57 = getelementptr inbounds [6 x i64], [6 x i64]* %2, i64 0, i64 2
%58 = load i64, i64* %57
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i64 240, i64 %58)
%60 = getelementptr inbounds [6 x i64], [6 x i64]* %2, i64 0, i64 3
%61 = load i64, i64* %60
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i64 15, i64 %61)
%63 = getelementptr inbounds [6 x i64], [6 x i64]* %2, i64 0, i64 4
%64 = load i64, i64* %63
%65 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i64 170, i64 %64)
%66 = getelementptr inbounds [6 x i64], [6 x i64]* %2, i64 0, i64 5
%67 = load i64, i64* %66
%68 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i64 85, i64 %67)
ret i32 0
}