#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 rotr(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] = {0xEA04BFBEB6EB797B, 0xEEDBA5216D8F4B15,
                               0x4C719ECA593EFF1F, 0x3A39493576DB0451,
                               0x5740400D13C70A03};
  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;
    for (i = 12; i >= 1; i--) {
      B -= skey[2 * i + 1];
      B = rotr(B, A & 0x1f);
      B ^= A;
      A -= skey[2 * i];
      A = rotr(A, B & 0x1f);
      A ^= B;
    }
    B -= skey[1];
    A -= skey[0];
    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 $0xea04bfbeb6eb797b,%rax
bf 04 ea
mov    %rax,-0xb0(%rbp)
movabs $0xeedba5216d8f4b15,%rax
a5 db ee
mov    %rax,-0xa8(%rbp)
movabs $0x4c719eca593eff1f,%rax
9e 71 4c
mov    %rax,-0xa0(%rbp)
movabs $0x3a39493576db0451,%rax
49 39 3a
mov    %rax,-0x98(%rbp)
movabs $0x5740400d13c70a03,%rax
40 40 57
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    1350 <main+0x210>
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)
movl   $0xc,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     12f3 <main+0x1b3>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cltq
mov    -0x80(%rbp,%rax,4),%ecx
mov    -0xf8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xf8(%rbp)
mov    -0xf8(%rbp),%edi
mov    -0xf4(%rbp),%esi
and    $0x1f,%esi
call   1060 <rotr@plt>
mov    %eax,-0xf8(%rbp)
mov    -0xf4(%rbp),%eax
xor    -0xf8(%rbp),%eax
mov    %eax,-0xf8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
cltq
mov    -0x80(%rbp,%rax,4),%ecx
mov    -0xf4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xf4(%rbp)
mov    -0xf4(%rbp),%edi
mov    -0xf8(%rbp),%esi
and    $0x1f,%esi
call   1060 <rotr@plt>
mov    %eax,-0xf4(%rbp)
mov    -0xf8(%rbp),%eax
xor    -0xf4(%rbp),%eax
mov    %eax,-0xf4(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    124c <main+0x10c>
mov    -0x7c(%rbp),%ecx
mov    -0xf8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xf8(%rbp)
mov    -0x80(%rbp),%ecx
mov    -0xf4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xf4(%rbp)
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    1200 <main+0xc0>
lea    0xd11(%rip),%rdi
lea    0xd12(%rip),%rsi
lea    0xd11(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    13b1 <main+0x271>
movslq -0x8(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rsi
ff
movslq -0x8(%rbp),%rax
mov    -0xe0(%rbp,%rax,8),%rdx
ff
lea    0xce3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1373 <main+0x233>
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 $0xea04bfbeb6eb797b,%r15
bf 04 ea
movabs $0x5740400d13c70a03,%rax
40 40 57
movaps 0xeb7(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xebb(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %rax,0x50(%rsp)
xor    %r13d,%r13d
lea    0xeb7(%rip),%rbp
mov    %r15,%r12
nopl   0x0(%rax)
mov    %r12,%rbx
shr    $0x20,%rbx
mov    $0xd,%r14d
nopl   (%rax)
sub    -0x4(%rbp,%r14,8),%r12d
mov    %ebx,%esi
and    $0x1f,%esi
mov    %r12d,%edi
call   1040 <rotr@plt>
mov    %eax,%r12d
xor    %ebx,%r12d
sub    -0x8(%rbp,%r14,8),%ebx
mov    %r12d,%esi
and    $0x1f,%esi
mov    %ebx,%edi
call   1040 <rotr@plt>
mov    %eax,%ebx
xor    %r12d,%ebx
add    $0xffffffffffffffff,%r14
cmp    $0x1,%r14
ja     1180 <main+0x60>
add    $0xe5c80805,%r12d
add    $0x64442738,%ebx
shl    $0x20,%rbx
or     %rbx,%r12
mov    %r12,(%rsp,%r13,8)
add    $0x1,%r13
cmp    $0x5,%r13
je     11e2 <main+0xc2>
mov    0x30(%rsp,%r13,8),%r12
jmp    1170 <main+0x50>
lea    0xe9f(%rip),%rdi
lea    0xea0(%rip),%rsi
lea    0xe9f(%rip),%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%rdx
lea    0xe96(%rip),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%rdx
movabs $0xeedba5216d8f4b15,%rsi
a5 db ee
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%rdx
movabs $0x4c719eca593eff1f,%rsi
9e 71 4c
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x18(%rsp),%rdx
movabs $0x3a39493576db0451,%rsi
49 39 3a
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x20(%rsp),%rdx
mov    %rbx,%rdi
movabs $0x5740400d13c70a03,%rsi
40 40 57
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 -1583930343093995141, i64* %14
%15 = getelementptr inbounds [5 x i64], [5 x i64]* %13, i32 0, i32 1
store i64 -1235212109792457963, i64* %15
%16 = getelementptr inbounds [5 x i64], [5 x i64]* %13, i32 0, i32 2
store i64 5508358411168710431, i64* %16
%17 = getelementptr inbounds [5 x i64], [5 x i64]* %13, i32 0, i32 3
store i64 4195465021848486993, i64* %17
%18 = getelementptr inbounds [5 x i64], [5 x i64]* %13, i32 0, i32 4
store i64 6287095504719776259, 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, 5
br i1 %21, label %22, label %91
22: ; preds = %19
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [5 x i64], [5 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
store i32 12, i32* %2
br label %33
33: ; preds = %66, %22
%34 = load i32, i32* %2
%35 = icmp sge i32 %34, 1
br i1 %35, label %36, label %69
36: ; preds = %33
%37 = load i32, i32* %2
%38 = mul nsw i32 2, %37
%39 = add nsw i32 %38, 1
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [26 x i32], [26 x i32]* %4, i64 0, i64 %40
%42 = load i32, i32* %41
%43 = load i32, i32* %10
%44 = sub i32 %43, %42
store i32 %44, i32* %10
%45 = load i32, i32* %10
%46 = load i32, i32* %9
%47 = and i32 %46, 31
%48 = call i32 @rotr(i32 %45, i32 %47)
store i32 %48, i32* %10
%49 = load i32, i32* %9
%50 = load i32, i32* %10
%51 = xor i32 %50, %49
store i32 %51, i32* %10
%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 = sub i32 %57, %56
store i32 %58, i32* %9
%59 = load i32, i32* %9
%60 = load i32, i32* %10
%61 = and i32 %60, 31
%62 = call i32 @rotr(i32 %59, i32 %61)
store i32 %62, i32* %9
%63 = load i32, i32* %10
%64 = load i32, i32* %9
%65 = xor i32 %64, %63
store i32 %65, i32* %9
br label %66
66: ; preds = %36
%67 = load i32, i32* %2
%68 = add nsw i32 %67, -1
store i32 %68, i32* %2
br label %33
69: ; preds = %33
%70 = getelementptr inbounds [26 x i32], [26 x i32]* %4, i64 0, i64 1
%71 = load i32, i32* %70
%72 = load i32, i32* %10
%73 = sub i32 %72, %71
store i32 %73, i32* %10
%74 = getelementptr inbounds [26 x i32], [26 x i32]* %4, i64 0, i64 0
%75 = load i32, i32* %74
%76 = load i32, i32* %9
%77 = sub i32 %76, %75
store i32 %77, i32* %9
%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 [5 x i64], [5 x i64]* %6, i64 0, i64 %86
store i64 %84, i64* %87
br label %88
88: ; preds = %69
%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, 5
br i1 %95, label %96, label %109
96: ; preds = %93
%97 = load i32, i32* %2
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds [5 x i64], [5 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 [5 x i64], [5 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 [5 x i64]
%2 = alloca [5 x i64]
%3 = bitcast [5 x i64]* %1 to i8*
%4 = bitcast [5 x i64]* %1 to <2 x i64>*
store <2 x i64> <i64 -1583930343093995141, i64 -1235212109792457963>, <2 x 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 5508358411168710431, i64 4195465021848486993>, <2 x i64>* %6
%7 = getelementptr inbounds [5 x i64], [5 x i64]* %1, i64 0, i64 4
store i64 6287095504719776259, i64* %7
%8 = bitcast [5 x i64]* %2 to i8*
br label %9
9: ; preds = %45, %0
%10 = phi i64 [ -1583930343093995141, %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
br label %15
15: ; preds = %9, %15
%16 = phi i64 [ 12, %9 ], [ %33, %15 ]
%17 = phi i32 [ %14, %9 ], [ %26, %15 ]
%18 = phi i32 [ %13, %9 ], [ %32, %15 ]
%19 = shl nuw nsw i64 %16, 1
%20 = or i64 %19, 1
%21 = getelementptr inbounds [26 x i32], [26 x i32]* @__const.main.skey, i64 0, i64 %20
%22 = load i32, i32* %21
%23 = sub i32 %17, %22
%24 = and i32 %18, 31
%25 = tail call i32 @rotr(i32 %23, i32 %24)
%26 = xor i32 %25, %18
%27 = getelementptr inbounds [26 x i32], [26 x i32]* @__const.main.skey, i64 0, i64 %19
%28 = load i32, i32* %27
%29 = sub i32 %18, %28
%30 = and i32 %26, 31
%31 = tail call i32 @rotr(i32 %29, i32 %30)
%32 = xor i32 %31, %26
%33 = add nsw i64 %16, -1
%34 = icmp ugt i64 %16, 1
br i1 %34, label %15, label %35
35: ; preds = %15
%36 = add i32 %26, -439875579
%37 = add i32 %32, 1682188088
%38 = zext i32 %37 to i64
%39 = shl nuw i64 %38, 32
%40 = zext i32 %36 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 = %35
%46 = getelementptr inbounds [5 x i64], [5 x i64]* %1, i64 0, i64 %43
%47 = load i64, i64* %46
br label %9
48: ; preds = %35
%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 -1583930343093995141, 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 -1235212109792457963, 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 5508358411168710431, 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 4195465021848486993, 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 6287095504719776259, i64 %63)
ret i32 0
}