#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*/ debug(char *, unsigned char, unsigned char, unsigned char,
                         unsigned char, unsigned char, unsigned char,
                         unsigned char, unsigned char);
void keys56to64(unsigned char *key56, unsigned char *key64) {
  key64[0] = key56[0];
  key64[1] = ((key56[0] << 7) & 0xFF) | (key56[1] >> 1);
  key64[2] = ((key56[1] << 6) & 0xFF) | (key56[2] >> 2);
  key64[3] = ((key56[2] << 5) & 0xFF) | (key56[3] >> 3);
  key64[4] = ((key56[3] << 4) & 0xFF) | (key56[4] >> 4);
  key64[5] = ((key56[4] << 3) & 0xFF) | (key56[5] >> 5);
  key64[6] = ((key56[5] << 2) & 0xFF) | (key56[6] >> 6);
  key64[7] = (key56[6] << 1) & 0xFF;
  debug("### keys56to64:  56BitKey = [%02X%02X%02X%02X%02X%02X%02X%02X]\n",
        key56[0], key56[1], key56[2], key56[3], key56[4], key56[5], key56[6],
        key56[7]);
  debug("### keys56to64:  64BitKey = [%02X%02X%02X%02X%02X%02X%02X%02X]\n",
        key64[0], key64[1], key64[2], key64[3], key64[4], key64[5], key64[6],
        key64[7]);
}


x86 assembly (clang, -O0):
<keys56to64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x7,%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
sar    $0x1,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x6,%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
sar    $0x2,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x5,%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
sar    $0x3,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x4,%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x4(%rcx),%ecx
sar    $0x4,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x4(%rax)
mov    -0x8(%rbp),%rax
movzbl 0x4(%rax),%eax
shl    $0x3,%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x5(%rcx),%ecx
sar    $0x5,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x5(%rax)
mov    -0x8(%rbp),%rax
movzbl 0x5(%rax),%eax
shl    $0x2,%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x6(%rcx),%ecx
sar    $0x6,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x6(%rax)
mov    -0x8(%rbp),%rax
movzbl 0x6(%rax),%eax
shl    $0x1,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x7(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%sil
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%dl
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%r8b
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%r9b
mov    -0x8(%rbp),%rax
mov    0x5(%rax),%r11b
mov    -0x8(%rbp),%rax
mov    0x6(%rax),%r10b
mov    -0x8(%rbp),%rax
lea    0xd98(%rip),%rdi
movzbl %sil,%esi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl %r8b,%r8d
movzbl %r9b,%r9d
movzbl %r11b,%r11d
mov    %r11d,(%rsp)
movzbl %r10b,%r10d
mov    %r10d,0x8(%rsp)
movzbl 0x7(%rax),%eax
mov    %eax,0x10(%rsp)
call   1030 <debug@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%sil
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%dl
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%r8b
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%r9b
mov    -0x10(%rbp),%rax
mov    0x5(%rax),%r11b
mov    -0x10(%rbp),%rax
mov    0x6(%rax),%r10b
mov    -0x10(%rbp),%rax
lea    0xd68(%rip),%rdi
movzbl %sil,%esi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl %r8b,%r8d
movzbl %r9b,%r9d
movzbl %r11b,%r11d
mov    %r11d,(%rsp)
movzbl %r10b,%r10d
mov    %r10d,0x8(%rsp)
movzbl 0x7(%rax),%eax
mov    %eax,0x10(%rsp)
call   1030 <debug@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keys56to64>:
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%al
mov    %al,(%rsi)
mov    (%rdi),%al
mov    0x1(%rdi),%cl
shr    %cl
shl    $0x7,%al
or     %cl,%al
mov    %al,0x1(%rsi)
mov    0x1(%rdi),%al
mov    0x2(%rdi),%cl
shr    $0x2,%cl
shl    $0x6,%al
or     %cl,%al
mov    %al,0x2(%rsi)
mov    0x2(%rdi),%al
mov    0x3(%rdi),%cl
shr    $0x3,%cl
shl    $0x5,%al
or     %cl,%al
mov    %al,0x3(%rsi)
mov    0x3(%rdi),%al
mov    0x4(%rdi),%cl
shr    $0x4,%cl
shl    $0x4,%al
or     %cl,%al
mov    %al,0x4(%rsi)
mov    0x4(%rdi),%al
mov    0x5(%rdi),%cl
shr    $0x5,%cl
shl    $0x3,%al
or     %cl,%al
mov    %al,0x5(%rsi)
mov    0x5(%rdi),%al
mov    0x6(%rdi),%cl
shr    $0x6,%cl
shl    $0x2,%al
or     %cl,%al
mov    %al,0x6(%rsi)
mov    0x6(%rdi),%al
add    %al,%al
mov    %al,0x7(%rsi)
movzbl (%rdi),%esi
movzbl 0x1(%rdi),%edx
movzbl 0x2(%rdi),%ecx
movzbl 0x3(%rdi),%r8d
movzbl 0x4(%rdi),%r9d
movzbl 0x5(%rdi),%r10d
movzbl 0x6(%rdi),%r11d
movzbl 0x7(%rdi),%eax
sub    $0x8,%rsp
lea    0xe4e(%rip),%rdi
push   %rax
push   %r11
push   %r10
call   1030 <debug@plt>
add    $0x20,%rsp
movzbl (%rbx),%esi
movzbl 0x1(%rbx),%edx
movzbl 0x2(%rbx),%ecx
movzbl 0x3(%rbx),%r8d
movzbl 0x4(%rbx),%r9d
movzbl 0x5(%rbx),%r10d
movzbl 0x6(%rbx),%eax
movzbl 0x7(%rbx),%ebx
sub    $0x8,%rsp
lea    0xe53(%rip),%rdi
push   %rbx
push   %rax
push   %r10
call   1030 <debug@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [64 x i8] c"### keys56to64: 56BitKey = [%02X%02X%02X%02X%02X%02X%02X%02X]\0A\00"
@.str.1 = [64 x i8] c"### keys56to64: 64BitKey = [%02X%02X%02X%02X%02X%02X%02X%02X]\0A\00"
define void @keys56to64(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 7
%15 = and i32 %14, 255
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = ashr i32 %19, 1
%21 = or i32 %15, %20
%22 = trunc i32 %21 to i8
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 1
store i8 %22, i8* %24
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i64 1
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = shl i32 %28, 6
%30 = and i32 %29, 255
%31 = load i8*, i8** %3
%32 = getelementptr inbounds i8, i8* %31, i64 2
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = ashr i32 %34, 2
%36 = or i32 %30, %35
%37 = trunc i32 %36 to i8
%38 = load i8*, i8** %4
%39 = getelementptr inbounds i8, i8* %38, i64 2
store i8 %37, i8* %39
%40 = load i8*, i8** %3
%41 = getelementptr inbounds i8, i8* %40, i64 2
%42 = load i8, i8* %41
%43 = zext i8 %42 to i32
%44 = shl i32 %43, 5
%45 = and i32 %44, 255
%46 = load i8*, i8** %3
%47 = getelementptr inbounds i8, i8* %46, i64 3
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = ashr i32 %49, 3
%51 = or i32 %45, %50
%52 = trunc i32 %51 to i8
%53 = load i8*, i8** %4
%54 = getelementptr inbounds i8, i8* %53, i64 3
store i8 %52, i8* %54
%55 = load i8*, i8** %3
%56 = getelementptr inbounds i8, i8* %55, i64 3
%57 = load i8, i8* %56
%58 = zext i8 %57 to i32
%59 = shl i32 %58, 4
%60 = and i32 %59, 255
%61 = load i8*, i8** %3
%62 = getelementptr inbounds i8, i8* %61, i64 4
%63 = load i8, i8* %62
%64 = zext i8 %63 to i32
%65 = ashr i32 %64, 4
%66 = or i32 %60, %65
%67 = trunc i32 %66 to i8
%68 = load i8*, i8** %4
%69 = getelementptr inbounds i8, i8* %68, i64 4
store i8 %67, i8* %69
%70 = load i8*, i8** %3
%71 = getelementptr inbounds i8, i8* %70, i64 4
%72 = load i8, i8* %71
%73 = zext i8 %72 to i32
%74 = shl i32 %73, 3
%75 = and i32 %74, 255
%76 = load i8*, i8** %3
%77 = getelementptr inbounds i8, i8* %76, i64 5
%78 = load i8, i8* %77
%79 = zext i8 %78 to i32
%80 = ashr i32 %79, 5
%81 = or i32 %75, %80
%82 = trunc i32 %81 to i8
%83 = load i8*, i8** %4
%84 = getelementptr inbounds i8, i8* %83, i64 5
store i8 %82, i8* %84
%85 = load i8*, i8** %3
%86 = getelementptr inbounds i8, i8* %85, i64 5
%87 = load i8, i8* %86
%88 = zext i8 %87 to i32
%89 = shl i32 %88, 2
%90 = and i32 %89, 255
%91 = load i8*, i8** %3
%92 = getelementptr inbounds i8, i8* %91, i64 6
%93 = load i8, i8* %92
%94 = zext i8 %93 to i32
%95 = ashr i32 %94, 6
%96 = or i32 %90, %95
%97 = trunc i32 %96 to i8
%98 = load i8*, i8** %4
%99 = getelementptr inbounds i8, i8* %98, i64 6
store i8 %97, i8* %99
%100 = load i8*, i8** %3
%101 = getelementptr inbounds i8, i8* %100, i64 6
%102 = load i8, i8* %101
%103 = zext i8 %102 to i32
%104 = shl i32 %103, 1
%105 = and i32 %104, 255
%106 = trunc i32 %105 to i8
%107 = load i8*, i8** %4
%108 = getelementptr inbounds i8, i8* %107, i64 7
store i8 %106, i8* %108
%109 = load i8*, i8** %3
%110 = getelementptr inbounds i8, i8* %109, i64 0
%111 = load i8, i8* %110
%112 = load i8*, i8** %3
%113 = getelementptr inbounds i8, i8* %112, i64 1
%114 = load i8, i8* %113
%115 = load i8*, i8** %3
%116 = getelementptr inbounds i8, i8* %115, i64 2
%117 = load i8, i8* %116
%118 = load i8*, i8** %3
%119 = getelementptr inbounds i8, i8* %118, i64 3
%120 = load i8, i8* %119
%121 = load i8*, i8** %3
%122 = getelementptr inbounds i8, i8* %121, i64 4
%123 = load i8, i8* %122
%124 = load i8*, i8** %3
%125 = getelementptr inbounds i8, i8* %124, i64 5
%126 = load i8, i8* %125
%127 = load i8*, i8** %3
%128 = getelementptr inbounds i8, i8* %127, i64 6
%129 = load i8, i8* %128
%130 = load i8*, i8** %3
%131 = getelementptr inbounds i8, i8* %130, i64 7
%132 = load i8, i8* %131
%133 = call i32 @debug(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8 zeroext %111, i8 zeroext %114, i8 zeroext %117, i8 zeroext %120, i8 zeroext %123, i8 zeroext %126, i8 zeroext %129, i8 zeroext %132)
%134 = load i8*, i8** %4
%135 = getelementptr inbounds i8, i8* %134, i64 0
%136 = load i8, i8* %135
%137 = load i8*, i8** %4
%138 = getelementptr inbounds i8, i8* %137, i64 1
%139 = load i8, i8* %138
%140 = load i8*, i8** %4
%141 = getelementptr inbounds i8, i8* %140, i64 2
%142 = load i8, i8* %141
%143 = load i8*, i8** %4
%144 = getelementptr inbounds i8, i8* %143, i64 3
%145 = load i8, i8* %144
%146 = load i8*, i8** %4
%147 = getelementptr inbounds i8, i8* %146, i64 4
%148 = load i8, i8* %147
%149 = load i8*, i8** %4
%150 = getelementptr inbounds i8, i8* %149, i64 5
%151 = load i8, i8* %150
%152 = load i8*, i8** %4
%153 = getelementptr inbounds i8, i8* %152, i64 6
%154 = load i8, i8* %153
%155 = load i8*, i8** %4
%156 = getelementptr inbounds i8, i8* %155, i64 7
%157 = load i8, i8* %156
%158 = call i32 @debug(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %136, i8 zeroext %139, i8 zeroext %142, i8 zeroext %145, i8 zeroext %148, i8 zeroext %151, i8 zeroext %154, i8 zeroext %157)
ret void
}

LLVM IR (-O2):
@.str = [64 x i8] c"### keys56to64: 56BitKey = [%02X%02X%02X%02X%02X%02X%02X%02X]\0A\00"
@.str.1 = [64 x i8] c"### keys56to64: 64BitKey = [%02X%02X%02X%02X%02X%02X%02X%02X]\0A\00"
define void @keys56to64(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
store i8 %3, i8* %1
%4 = load i8, i8* %0
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = tail call i8 @llvm.fshl.i8(i8 %4, i8 %6, i8 7)
%8 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %7, i8* %8
%9 = load i8, i8* %5
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = tail call i8 @llvm.fshl.i8(i8 %9, i8 %11, i8 6)
%13 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %12, i8* %13
%14 = load i8, i8* %10
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = tail call i8 @llvm.fshl.i8(i8 %14, i8 %16, i8 5)
%18 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %17, i8* %18
%19 = load i8, i8* %15
%20 = getelementptr inbounds i8, i8* %0, i64 4
%21 = load i8, i8* %20
%22 = tail call i8 @llvm.fshl.i8(i8 %19, i8 %21, i8 4)
%23 = getelementptr inbounds i8, i8* %1, i64 4
store i8 %22, i8* %23
%24 = load i8, i8* %20
%25 = getelementptr inbounds i8, i8* %0, i64 5
%26 = load i8, i8* %25
%27 = tail call i8 @llvm.fshl.i8(i8 %24, i8 %26, i8 3)
%28 = getelementptr inbounds i8, i8* %1, i64 5
store i8 %27, i8* %28
%29 = load i8, i8* %25
%30 = getelementptr inbounds i8, i8* %0, i64 6
%31 = load i8, i8* %30
%32 = tail call i8 @llvm.fshl.i8(i8 %29, i8 %31, i8 2)
%33 = getelementptr inbounds i8, i8* %1, i64 6
store i8 %32, i8* %33
%34 = load i8, i8* %30
%35 = shl i8 %34, 1
%36 = getelementptr inbounds i8, i8* %1, i64 7
store i8 %35, i8* %36
%37 = load i8, i8* %0
%38 = load i8, i8* %5
%39 = load i8, i8* %10
%40 = load i8, i8* %15
%41 = load i8, i8* %20
%42 = load i8, i8* %25
%43 = load i8, i8* %30
%44 = getelementptr inbounds i8, i8* %0, i64 7
%45 = load i8, i8* %44
%46 = tail call i32 @debug(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8 zeroext %37, i8 zeroext %38, i8 zeroext %39, i8 zeroext %40, i8 zeroext %41, i8 zeroext %42, i8 zeroext %43, i8 zeroext %45)
%47 = load i8, i8* %1
%48 = load i8, i8* %8
%49 = load i8, i8* %13
%50 = load i8, i8* %18
%51 = load i8, i8* %23
%52 = load i8, i8* %28
%53 = load i8, i8* %33
%54 = load i8, i8* %36
%55 = tail call i32 @debug(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %47, i8 zeroext %48, i8 zeroext %49, i8 zeroext %50, i8 zeroext %51, i8 zeroext %52, i8 zeroext %53, i8 zeroext %54)
ret void
}