#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[5] = {0xFEDCBA9876543210, 0x0000000000000000,
                               0xFFFFFFFFFFFFFFFF, 0xFFFFFFFF00000000,
                               0x00000000FFFFFFFF};
  unsigned long long dout[5];
  unsigned long long sig = 0;
  unsigned long long res = 0;
  unsigned int A = 0;
  unsigned int B = 0;
  for (s = 0; s < 5; 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 < 5; 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    $0x28,%edx
call   1040 <memset@plt>
movabs $0xfedcba9876543210,%rax
ba dc fe
mov    %rax,-0xb0(%rbp)
movq   $0xffffffffffffffff,-0xa0(%rbp)
ff ff ff ff
movabs $0xffffffff00000000,%rax
ff ff ff
mov    %rax,-0x98(%rbp)
mov    $0xffffffff,%eax
mov    %rax,-0x90(%rbp)
movq   $0x0,-0xe8(%rbp)
movq   $0x0,-0xf0(%rbp)
movl   $0x0,-0xf4(%rbp)
movl   $0x0,-0xf8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    132c <main+0x1ec>
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     12f1 <main+0x1b1>
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    124e <main+0x10e>
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    11e4 <main+0xa4>
lea    0xd35(%rip),%rdi
lea    0xd36(%rip),%rsi
lea    0xd35(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    138d <main+0x24d>
movslq -0x8(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rsi
ff
movslq -0x8(%rbp),%rax
mov    -0xe0(%rbp,%rax,8),%rdx
ff
lea    0xd07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    134f <main+0x20f>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
movabs $0xfedcba9876543210,%r14
ba dc fe
mov    $0xffffffff,%eax
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
mov    %r14,0x30(%rsp)
movaps 0xeaf(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %rax,0x50(%rsp)
xor    %r12d,%r12d
lea    0xeab(%rip),%r13
mov    %r14,%r15
nopl   0x0(%rax,%rax,1)
mov    %r15,%rbx
shr    $0x20,%rbx
add    $0x9bbbd8c8,%ebx
add    $0x1a37f7fb,%r15d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xor    %r15d,%ebx
mov    %r15d,%esi
and    $0x1f,%esi
mov    %ebx,%edi
call   1040 <rotl@plt>
mov    %eax,%ebx
add    0x8(%r13,%rbp,8),%ebx
xor    %ebx,%r15d
mov    %ebx,%esi
and    $0x1f,%esi
mov    %r15d,%edi
call   1040 <rotl@plt>
mov    %eax,%r15d
add    0xc(%r13,%rbp,8),%r15d
add    $0x1,%rbp
cmp    $0xc,%rbp
jne    1190 <main+0x70>
shl    $0x20,%rbx
mov    %r15d,%eax
or     %rbx,%rax
mov    %rax,(%rsp,%r12,8)
add    $0x1,%r12
cmp    $0x5,%r12
je     11e8 <main+0xc8>
mov    0x30(%rsp,%r12,8),%r15
jmp    1170 <main+0x50>
lea    0xe89(%rip),%rdi
lea    0xe8a(%rip),%rsi
lea    0xe89(%rip),%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%rdx
lea    0xe80(%rip),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%rdx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%rdx
mov    %rbx,%rdi
mov    $0xffffffffffffffff,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x18(%rsp),%rdx
movabs $0xffffffff00000000,%rsi
ff ff ff
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x20(%rsp),%rdx
mov    $0xffffffff,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
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 [5 x i64]
%6 = alloca [5 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 [5 x i64]* %5 to i8*
%13 = bitcast i8* %12 to [5 x i64]*
%14 = getelementptr inbounds [5 x i64], [5 x i64]* %13, i32 0, i32 0
store i64 -81985529216486896, i64* %14
%15 = getelementptr inbounds [5 x i64], [5 x i64]* %13, i32 0, i32 2
store i64 -1, i64* %15
%16 = getelementptr inbounds [5 x i64], [5 x i64]* %13, i32 0, i32 3
store i64 -4294967296, i64* %16
%17 = getelementptr inbounds [5 x i64], [5 x i64]* %13, i32 0, i32 4
store i64 4294967295, i64* %17
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 %18
18: ; preds = %87, %0
%19 = load i32, i32* %3
%20 = icmp slt i32 %19, 5
br i1 %20, label %21, label %90
21: ; preds = %18
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [5 x i64], [5 x i64]* %5, i64 0, i64 %23
%25 = load i64, i64* %24
store i64 %25, i64* %7
%26 = load i64, i64* %7
%27 = lshr i64 %26, 32
%28 = trunc i64 %27 to i32
store i32 %28, i32* %9
%29 = load i64, i64* %7
%30 = and i64 %29, 4294967295
%31 = trunc i64 %30 to i32
store i32 %31, i32* %10
%32 = getelementptr inbounds [26 x i32], [26 x i32]* %4, i64 0, i64 0
%33 = load i32, i32* %32
%34 = load i32, i32* %9
%35 = add i32 %34, %33
store i32 %35, i32* %9
%36 = getelementptr inbounds [26 x i32], [26 x i32]* %4, i64 0, i64 1
%37 = load i32, i32* %36
%38 = load i32, i32* %10
%39 = add i32 %38, %37
store i32 %39, i32* %10
store i32 1, i32* %2
br label %40
40: ; preds = %73, %21
%41 = load i32, i32* %2
%42 = icmp sle i32 %41, 12
br i1 %42, label %43, label %76
43: ; preds = %40
%44 = load i32, i32* %10
%45 = load i32, i32* %9
%46 = xor i32 %45, %44
store i32 %46, i32* %9
%47 = load i32, i32* %9
%48 = load i32, i32* %10
%49 = and i32 %48, 31
%50 = call i32 @rotl(i32 %47, i32 %49)
store i32 %50, i32* %9
%51 = load i32, i32* %2
%52 = mul nsw i32 2, %51
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [26 x i32], [26 x i32]* %4, i64 0, i64 %53
%55 = load i32, i32* %54
%56 = load i32, i32* %9
%57 = add i32 %56, %55
store i32 %57, i32* %9
%58 = load i32, i32* %9
%59 = load i32, i32* %10
%60 = xor i32 %59, %58
store i32 %60, i32* %10
%61 = load i32, i32* %10
%62 = load i32, i32* %9
%63 = and i32 %62, 31
%64 = call i32 @rotl(i32 %61, i32 %63)
store i32 %64, i32* %10
%65 = load i32, i32* %2
%66 = mul nsw i32 2, %65
%67 = add nsw i32 %66, 1
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [26 x i32], [26 x i32]* %4, i64 0, i64 %68
%70 = load i32, i32* %69
%71 = load i32, i32* %10
%72 = add i32 %71, %70
store i32 %72, i32* %10
br label %73
73: ; preds = %43
%74 = load i32, i32* %2
%75 = add nsw i32 %74, 1
store i32 %75, i32* %2
br label %40
76: ; preds = %40
%77 = load i32, i32* %9
%78 = zext i32 %77 to i64
%79 = shl i64 %78, 32
%80 = load i32, i32* %10
%81 = zext i32 %80 to i64
%82 = or i64 %79, %81
store i64 %82, i64* %8
%83 = load i64, i64* %8
%84 = load i32, i32* %3
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [5 x i64], [5 x i64]* %6, i64 0, i64 %85
store i64 %83, i64* %86
br label %87
87: ; preds = %76
%88 = load i32, i32* %3
%89 = add nsw i32 %88, 1
store i32 %89, i32* %3
br label %18
90: ; preds = %18
%91 = 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 %92
92: ; preds = %105, %90
%93 = load i32, i32* %2
%94 = icmp slt i32 %93, 5
br i1 %94, label %95, label %108
95: ; preds = %92
%96 = load i32, i32* %2
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [5 x i64], [5 x i64]* %5, i64 0, i64 %97
%99 = load i64, i64* %98
%100 = load i32, i32* %2
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [5 x i64], [5 x i64]* %6, i64 0, i64 %101
%103 = load i64, i64* %102
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i64 %99, i64 %103)
br label %105
105: ; preds = %95
%106 = load i32, i32* %2
%107 = add nsw i32 %106, 1
store i32 %107, i32* %2
br label %92
108: ; preds = %92
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 [5 x i64]
%2 = alloca [5 x i64]
%3 = bitcast [5 x i64]* %1 to i8*
%4 = getelementptr inbounds [5 x i64], [5 x i64]* %1, i64 0, i64 0
store i64 -81985529216486896, i64* %4
%5 = getelementptr inbounds [5 x i64], [5 x i64]* %1, i64 0, i64 2
%6 = bitcast i64* %5 to <2 x i64>*
store <2 x i64> <i64 -1, i64 -4294967296>, <2 x i64>* %6
%7 = getelementptr inbounds [5 x i64], [5 x i64]* %1, i64 0, i64 4
store i64 4294967295, i64* %7
%8 = bitcast [5 x i64]* %2 to i8*
br label %9
9: ; preds = %45, %0
%10 = phi i64 [ -81985529216486896, %0 ], [ %47, %45 ]
%11 = phi i64 [ 0, %0 ], [ %43, %45 ]
%12 = lshr i64 %10, 32
%13 = trunc i64 %12 to i32
%14 = trunc i64 %10 to i32
%15 = add i32 %13, -1682188088
%16 = add i32 %14, 439875579
br label %17
17: ; preds = %9, %17
%18 = phi i64 [ 1, %9 ], [ %35, %17 ]
%19 = phi i32 [ %16, %9 ], [ %34, %17 ]
%20 = phi i32 [ %15, %9 ], [ %27, %17 ]
%21 = xor i32 %19, %20
%22 = and i32 %19, 31
%23 = tail call i32 @rotl(i32 %21, i32 %22)
%24 = shl nuw nsw i64 %18, 1
%25 = getelementptr inbounds [26 x i32], [26 x i32]* @__const.main.skey, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = add i32 %26, %23
%28 = xor i32 %27, %19
%29 = and i32 %27, 31
%30 = tail call i32 @rotl(i32 %28, i32 %29)
%31 = or i64 %24, 1
%32 = getelementptr inbounds [26 x i32], [26 x i32]* @__const.main.skey, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = add i32 %33, %30
%35 = add nuw nsw i64 %18, 1
%36 = icmp eq i64 %35, 13
br i1 %36, label %37, label %17
37: ; preds = %17
%38 = zext i32 %27 to i64
%39 = shl nuw i64 %38, 32
%40 = zext i32 %34 to i64
%41 = or i64 %39, %40
%42 = getelementptr inbounds [5 x i64], [5 x i64]* %2, i64 0, i64 %11
store i64 %41, i64* %42
%43 = add nuw nsw i64 %11, 1
%44 = icmp eq i64 %43, 5
br i1 %44, label %48, label %45
45: ; preds = %37
%46 = getelementptr inbounds [5 x i64], [5 x i64]* %1, i64 0, i64 %43
%47 = load i64, i64* %46
br label %9
48: ; preds = %37
%49 = 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))
%50 = getelementptr inbounds [5 x i64], [5 x i64]* %2, i64 0, i64 0
%51 = load i64, i64* %50
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i64 -81985529216486896, i64 %51)
%53 = getelementptr inbounds [5 x i64], [5 x i64]* %2, i64 0, i64 1
%54 = load i64, i64* %53
%55 = 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 %54)
%56 = getelementptr inbounds [5 x i64], [5 x i64]* %2, i64 0, i64 2
%57 = load i64, i64* %56
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i64 -1, i64 %57)
%59 = getelementptr inbounds [5 x i64], [5 x i64]* %2, i64 0, i64 3
%60 = load i64, i64* %59
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i64 -4294967296, i64 %60)
%62 = getelementptr inbounds [5 x i64], [5 x i64]* %2, i64 0, i64 4
%63 = load i64, i64* %62
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i64 4294967295, i64 %63)
ret i32 0
}