// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/transpose.c
// Function: transpose_64x64
void transpose_64x64(uint64_t * out, uint64_t * in)
{
	int i, j, s, d;

	uint64_t x, y;
	uint64_t masks[6][2] = {
	                        {0x5555555555555555, 0xAAAAAAAAAAAAAAAA},
	                        {0x3333333333333333, 0xCCCCCCCCCCCCCCCC},
	                        {0x0F0F0F0F0F0F0F0F, 0xF0F0F0F0F0F0F0F0},
	                        {0x00FF00FF00FF00FF, 0xFF00FF00FF00FF00},
	                        {0x0000FFFF0000FFFF, 0xFFFF0000FFFF0000},
	                        {0x00000000FFFFFFFF, 0xFFFFFFFF00000000}
	                       };

	for (i = 0; i < 64; i++)
		out[i] = in[i];

	for (d = 5; d >= 0; d--)
	{
		s = 1 << d;

		for (i = 0; i < 64; i += s*2)
		for (j = i; j < i+s; j++)
		{
			x = (out[j] & masks[d][0]) | ((out[j+s] & masks[d][0]) << s);
			y = ((out[j] & masks[d][1]) >> s) | (out[j+s] & masks[d][1]);

			out[j+0] = x;
			out[j+s] = y;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x90(%rbp), %rdi
leaq 0x1f9f(%rip), %rsi      # 0xfbb0
movl $0x60, %edx
callq 0x10a0
movl $0x0, -0x14(%rbp)
cmpl $0x40, -0x14(%rbp)
jge 0xdc4b
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xdc22
movl $0x5, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jl 0xdd98
movl -0x20(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x1c(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x40, -0x14(%rbp)
jge 0xdd88
movl -0x14(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl -0x14(%rbp), %ecx
addl -0x1c(%rbp), %ecx
cmpl %ecx, %eax
jge 0xdd76
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rdx
leaq -0x90(%rbp), %rcx
shlq $0x4, %rdx
addq %rdx, %rcx
andq (%rcx), %rax
movq -0x8(%rbp), %rcx
movl -0x18(%rbp), %edx
addl -0x1c(%rbp), %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rdx
movslq -0x20(%rbp), %rsi
leaq -0x90(%rbp), %rcx
shlq $0x4, %rsi
addq %rsi, %rcx
andq (%rcx), %rdx
movl -0x1c(%rbp), %ecx
shlq %cl, %rdx
movq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rdx
leaq -0x90(%rbp), %rcx
shlq $0x4, %rdx
addq %rdx, %rcx
andq 0x8(%rcx), %rax
movl -0x1c(%rbp), %ecx
shrq %cl, %rax
movq -0x8(%rbp), %rcx
movl -0x18(%rbp), %edx
addl -0x1c(%rbp), %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x20(%rbp), %rsi
leaq -0x90(%rbp), %rdx
shlq $0x4, %rsi
addq %rsi, %rdx
andq 0x8(%rdx), %rcx
orq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdx
movq -0x8(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x30(%rbp), %rdx
movq -0x8(%rbp), %rax
movl -0x18(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xdc80
jmp 0xdd78
movl -0x1c(%rbp), %eax
shll %eax
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0xdc70
jmp 0xdd8a
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xdc52
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)