#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 */
int /*<<< orphan*/ getSixBitByte(int, int);
int /*<<< orphan*/ pushbackSixBitByte(int *, int /*<<< orphan*/, int);
uint64_t swapZvalues(uint64_t c) {
  uint64_t newz = 0;
  pushbackSixBitByte(&newz, getSixBitByte(c, 0), 7);
  pushbackSixBitByte(&newz, getSixBitByte(c, 1), 6);
  pushbackSixBitByte(&newz, getSixBitByte(c, 2), 5);
  pushbackSixBitByte(&newz, getSixBitByte(c, 3), 4);
  pushbackSixBitByte(&newz, getSixBitByte(c, 4), 3);
  pushbackSixBitByte(&newz, getSixBitByte(c, 5), 2);
  pushbackSixBitByte(&newz, getSixBitByte(c, 6), 1);
  pushbackSixBitByte(&newz, getSixBitByte(c, 7), 0);
  newz |= (c & 0xFFFF000000000000);
  return newz;
}


x86 assembly (clang, -O0):
<swapZvalues>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <getSixBitByte@plt>
mov    %eax,%esi
lea    -0x8(%rbp),%rdi
mov    $0x7,%edx
call   1030 <pushbackSixBitByte@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1040 <getSixBitByte@plt>
mov    %eax,%esi
lea    -0x8(%rbp),%rdi
mov    $0x6,%edx
call   1030 <pushbackSixBitByte@plt>
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1040 <getSixBitByte@plt>
mov    %eax,%esi
lea    -0x8(%rbp),%rdi
mov    $0x5,%edx
call   1030 <pushbackSixBitByte@plt>
mov    -0x4(%rbp),%edi
mov    $0x3,%esi
call   1040 <getSixBitByte@plt>
mov    %eax,%esi
lea    -0x8(%rbp),%rdi
mov    $0x4,%edx
call   1030 <pushbackSixBitByte@plt>
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
call   1040 <getSixBitByte@plt>
mov    %eax,%esi
lea    -0x8(%rbp),%rdi
mov    $0x3,%edx
call   1030 <pushbackSixBitByte@plt>
mov    -0x4(%rbp),%edi
mov    $0x5,%esi
call   1040 <getSixBitByte@plt>
mov    %eax,%esi
lea    -0x8(%rbp),%rdi
mov    $0x2,%edx
call   1030 <pushbackSixBitByte@plt>
mov    -0x4(%rbp),%edi
mov    $0x6,%esi
call   1040 <getSixBitByte@plt>
mov    %eax,%esi
lea    -0x8(%rbp),%rdi
mov    $0x1,%edx
call   1030 <pushbackSixBitByte@plt>
mov    -0x4(%rbp),%edi
mov    $0x7,%esi
call   1040 <getSixBitByte@plt>
mov    %eax,%esi
lea    -0x8(%rbp),%rdi
xor    %edx,%edx
call   1030 <pushbackSixBitByte@plt>
movslq -0x4(%rbp),%rcx
movabs $0xffff000000000000,%rax
and    %rax,%rcx
movslq -0x8(%rbp),%rax
or     %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapZvalues>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
movl   $0x0,0x4(%rsp)
xor    %esi,%esi
call   1040 <getSixBitByte@plt>
lea    0x4(%rsp),%r14
mov    %r14,%rdi
mov    %eax,%esi
mov    $0x7,%edx
call   1030 <pushbackSixBitByte@plt>
mov    %ebx,%edi
mov    $0x1,%esi
call   1040 <getSixBitByte@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    $0x6,%edx
call   1030 <pushbackSixBitByte@plt>
mov    %ebx,%edi
mov    $0x2,%esi
call   1040 <getSixBitByte@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    $0x5,%edx
call   1030 <pushbackSixBitByte@plt>
mov    %ebx,%edi
mov    $0x3,%esi
call   1040 <getSixBitByte@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    $0x4,%edx
call   1030 <pushbackSixBitByte@plt>
mov    %ebx,%edi
mov    $0x4,%esi
call   1040 <getSixBitByte@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    $0x3,%edx
call   1030 <pushbackSixBitByte@plt>
mov    %ebx,%edi
mov    $0x5,%esi
call   1040 <getSixBitByte@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    $0x2,%edx
call   1030 <pushbackSixBitByte@plt>
mov    %ebx,%edi
mov    $0x6,%esi
call   1040 <getSixBitByte@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <pushbackSixBitByte@plt>
mov    %ebx,%edi
mov    $0x7,%esi
call   1040 <getSixBitByte@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1030 <pushbackSixBitByte@plt>
mov    0x4(%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @swapZvalues(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @getSixBitByte(i32 %4, i32 0)
%6 = call i32 @pushbackSixBitByte(i32* %3, i32 %5, i32 7)
%7 = load i32, i32* %2
%8 = call i32 @getSixBitByte(i32 %7, i32 1)
%9 = call i32 @pushbackSixBitByte(i32* %3, i32 %8, i32 6)
%10 = load i32, i32* %2
%11 = call i32 @getSixBitByte(i32 %10, i32 2)
%12 = call i32 @pushbackSixBitByte(i32* %3, i32 %11, i32 5)
%13 = load i32, i32* %2
%14 = call i32 @getSixBitByte(i32 %13, i32 3)
%15 = call i32 @pushbackSixBitByte(i32* %3, i32 %14, i32 4)
%16 = load i32, i32* %2
%17 = call i32 @getSixBitByte(i32 %16, i32 4)
%18 = call i32 @pushbackSixBitByte(i32* %3, i32 %17, i32 3)
%19 = load i32, i32* %2
%20 = call i32 @getSixBitByte(i32 %19, i32 5)
%21 = call i32 @pushbackSixBitByte(i32* %3, i32 %20, i32 2)
%22 = load i32, i32* %2
%23 = call i32 @getSixBitByte(i32 %22, i32 6)
%24 = call i32 @pushbackSixBitByte(i32* %3, i32 %23, i32 1)
%25 = load i32, i32* %2
%26 = call i32 @getSixBitByte(i32 %25, i32 7)
%27 = call i32 @pushbackSixBitByte(i32* %3, i32 %26, i32 0)
%28 = load i32, i32* %2
%29 = sext i32 %28 to i64
%30 = and i64 %29, -281474976710656
%31 = load i32, i32* %3
%32 = sext i32 %31 to i64
%33 = or i64 %32, %30
%34 = trunc i64 %33 to i32
store i32 %34, i32* %3
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @swapZvalues(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = tail call i32 @getSixBitByte(i32 %0, i32 0)
%5 = call i32 @pushbackSixBitByte(i32* %2, i32 %4, i32 7)
%6 = call i32 @getSixBitByte(i32 %0, i32 1)
%7 = call i32 @pushbackSixBitByte(i32* %2, i32 %6, i32 6)
%8 = call i32 @getSixBitByte(i32 %0, i32 2)
%9 = call i32 @pushbackSixBitByte(i32* %2, i32 %8, i32 5)
%10 = call i32 @getSixBitByte(i32 %0, i32 3)
%11 = call i32 @pushbackSixBitByte(i32* %2, i32 %10, i32 4)
%12 = call i32 @getSixBitByte(i32 %0, i32 4)
%13 = call i32 @pushbackSixBitByte(i32* %2, i32 %12, i32 3)
%14 = call i32 @getSixBitByte(i32 %0, i32 5)
%15 = call i32 @pushbackSixBitByte(i32* %2, i32 %14, i32 2)
%16 = call i32 @getSixBitByte(i32 %0, i32 6)
%17 = call i32 @pushbackSixBitByte(i32* %2, i32 %16, i32 1)
%18 = call i32 @getSixBitByte(i32 %0, i32 7)
%19 = call i32 @pushbackSixBitByte(i32* %2, i32 %18, i32 0)
%20 = load i32, i32* %2
ret i32 %20
}