// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/gf.c
// Function: gf_sq2mul
static inline gf gf_sq2mul(gf in, gf m)
{
	int i;

	uint64_t x;
	uint64_t t0;
	uint64_t t1;
	uint64_t t;

	const uint64_t M[] = {0x1FF0000000000000,
		              0x000FF80000000000, 
		              0x000007FC00000000, 
	                      0x00000003FE000000, 
	                      0x0000000001FE0000,
	                      0x000000000001E000};

	t0 = in;
	t1 = m;

	x = (t1 << 18) * (t0 & (1 << 6));

	t0 ^= (t0 << 21);

	x ^= (t1 * (t0 & (0x010000001)));
	x ^= (t1 * (t0 & (0x020000002))) << 3;
	x ^= (t1 * (t0 & (0x040000004))) << 6;
	x ^= (t1 * (t0 & (0x080000008))) << 9;
	x ^= (t1 * (t0 & (0x100000010))) << 12;
	x ^= (t1 * (t0 & (0x200000020))) << 15;

	for (i = 0; i < 6; i++)
	{
		t = x & M[i];
		x ^= (t >> 9) ^ (t >> 10) ^ (t >> 12) ^ (t >> 13);
	}

	return x & GFMASK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movw %si, %ax
movw %di, %cx
movw %cx, -0x2(%rbp)
movw %ax, -0x4(%rbp)
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x1070
movabsq $0x1ff0000000000000, %rax # imm = 0x1FF0000000000000
movq %rax, -0x60(%rbp)
movabsq $0xff80000000000, %rax  # imm = 0xFF80000000000
movq %rax, -0x58(%rbp)
movabsq $0x7fc00000000, %rax    # imm = 0x7FC00000000
movq %rax, -0x50(%rbp)
movabsq $0x3fe000000, %rax      # imm = 0x3FE000000
movq %rax, -0x48(%rbp)
movq $0x1fe0000, -0x40(%rbp) # imm = 0x1FE0000
movq $0x1e000, -0x38(%rbp)   # imm = 0x1E000
movzwl -0x2(%rbp), %eax
movq %rax, -0x18(%rbp)
movzwl -0x4(%rbp), %eax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
shlq $0x12, %rax
movq -0x18(%rbp), %rcx
andq $0x40, %rcx
imulq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
shlq $0x15, %rax
xorq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
andq $0x10000001, %rcx       # imm = 0x10000001
imulq %rcx, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
andq $0x20000002, %rcx       # imm = 0x20000002
imulq %rcx, %rax
shlq $0x3, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
andq $0x40000004, %rcx       # imm = 0x40000004
imulq %rcx, %rax
shlq $0x6, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
movabsq $0x80000008, %rcx       # imm = 0x80000008
andq -0x18(%rbp), %rcx
imulq %rcx, %rax
shlq $0x9, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
movabsq $0x100000010, %rcx      # imm = 0x100000010
andq -0x18(%rbp), %rcx
imulq %rcx, %rax
shlq $0xc, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
movabsq $0x200000020, %rcx      # imm = 0x200000020
andq -0x18(%rbp), %rcx
imulq %rcx, %rax
shlq $0xf, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x8(%rbp)
cmpl $0x6, -0x8(%rbp)
jge 0xb85f
movq -0x10(%rbp), %rax
movslq -0x8(%rbp), %rcx
andq -0x60(%rbp,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
shrq $0x9, %rax
movq -0x28(%rbp), %rcx
shrq $0xa, %rcx
xorq %rcx, %rax
movq -0x28(%rbp), %rcx
shrq $0xc, %rcx
xorq %rcx, %rax
movq -0x28(%rbp), %rcx
shrq $0xd, %rcx
xorq %rcx, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0xb80c
movq -0x10(%rbp), %rax
andq $0x1fff, %rax           # imm = 0x1FFF
addq $0x60, %rsp
popq %rbp
retq
nop