// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/aes128poetv1aes4/ref/gf_mul.h
// Function: gf_mul
void gf_mul(unsigned char *a, const unsigned char *x,
	    const unsigned char *y)
{
  int i;
  int j;
  unsigned int xlen = 16;
  unsigned char abits[128];
  unsigned char ybits[128];
  unsigned char prodbits[256];
  memcpy(a,x,xlen);
  for (i = 0;i < 128;++i) abits[i] = (a[i / 8] >> (7 - (i % 8))) & 1;
  for (i = 0;i < 128;++i) ybits[i] = (y[i / 8] >> (7 - (i % 8))) & 1;
  for (i = 0;i < 256;++i) prodbits[i] = 0;
  for (i = 0;i < 128;++i)
    for (j = 0;j < 128;++j)
      prodbits[i + j] ^= abits[i] & ybits[j];
  for (i = 127;i >= 0;--i) {
    prodbits[i] ^= prodbits[i + 128];
    prodbits[i + 1] ^= prodbits[i + 128];
    prodbits[i + 2] ^= prodbits[i + 128];
    prodbits[i + 7] ^= prodbits[i + 128];
    prodbits[i + 128] ^= prodbits[i + 128];
  }
  for (i = 0;i < 16;++i) a[i] = 0;
  for (i = 0;i < 128;++i) a[i / 8] |= (prodbits[i] << (7 - (i % 8)));
}

// Assembly:
subq $0x258, %rsp            # imm = 0x258
movq %rdi, 0x250(%rsp)
movq %rsi, 0x248(%rsp)
movq %rdx, 0x240(%rsp)
movl $0x10, 0x234(%rsp)
movq 0x250(%rsp), %rdi
movq 0x248(%rsp), %rsi
movl 0x234(%rsp), %eax
movl %eax, %edx
callq 0x1120
movl $0x0, 0x23c(%rsp)
cmpl $0x80, 0x23c(%rsp)
jge 0x61a1
movq 0x250(%rsp), %rax
movq %rax, 0x20(%rsp)
movl 0x23c(%rsp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq 0x20(%rsp), %rax
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, 0x2c(%rsp)
movl 0x23c(%rsp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl 0x2c(%rsp), %eax
movl $0x7, %ecx
subl %edx, %ecx
sarl %cl, %eax
andl $0x1, %eax
movb %al, %cl
movslq 0x23c(%rsp), %rax
movb %cl, 0x1b0(%rsp,%rax)
movl 0x23c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x23c(%rsp)
jmp 0x6123
movl $0x0, 0x23c(%rsp)
cmpl $0x80, 0x23c(%rsp)
jge 0x622a
movq 0x240(%rsp), %rax
movq %rax, 0x10(%rsp)
movl 0x23c(%rsp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq 0x10(%rsp), %rax
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, 0x1c(%rsp)
movl 0x23c(%rsp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl 0x1c(%rsp), %eax
movl $0x7, %ecx
subl %edx, %ecx
sarl %cl, %eax
andl $0x1, %eax
movb %al, %cl
movslq 0x23c(%rsp), %rax
movb %cl, 0x130(%rsp,%rax)
movl 0x23c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x23c(%rsp)
jmp 0x61ac
movl $0x0, 0x23c(%rsp)
cmpl $0x100, 0x23c(%rsp) # imm = 0x100
jge 0x6262
movslq 0x23c(%rsp), %rax
movb $0x0, 0x30(%rsp,%rax)
movl 0x23c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x23c(%rsp)
jmp 0x6235
movl $0x0, 0x23c(%rsp)
cmpl $0x80, 0x23c(%rsp)
jge 0x62fe
movl $0x0, 0x238(%rsp)
cmpl $0x80, 0x238(%rsp)
jge 0x62e6
movslq 0x23c(%rsp), %rax
movzbl 0x1b0(%rsp,%rax), %edx
movslq 0x238(%rsp), %rax
movzbl 0x130(%rsp,%rax), %eax
andl %eax, %edx
movl 0x23c(%rsp), %eax
addl 0x238(%rsp), %eax
cltq
movzbl 0x30(%rsp,%rax), %ecx
xorl %edx, %ecx
movb %cl, 0x30(%rsp,%rax)
movl 0x238(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x238(%rsp)
jmp 0x6289
jmp 0x62e8
movl 0x23c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x23c(%rsp)
jmp 0x626d
movl $0x7f, 0x23c(%rsp)
cmpl $0x0, 0x23c(%rsp)
jl 0x63fd
movl 0x23c(%rsp), %eax
addl $0x80, %eax
cltq
movzbl 0x30(%rsp,%rax), %edx
movslq 0x23c(%rsp), %rax
movzbl 0x30(%rsp,%rax), %ecx
xorl %edx, %ecx
movb %cl, 0x30(%rsp,%rax)
movl 0x23c(%rsp), %eax
addl $0x80, %eax
cltq
movzbl 0x30(%rsp,%rax), %edx
movl 0x23c(%rsp), %eax
addl $0x1, %eax
cltq
movzbl 0x30(%rsp,%rax), %ecx
xorl %edx, %ecx
movb %cl, 0x30(%rsp,%rax)
movl 0x23c(%rsp), %eax
addl $0x80, %eax
cltq
movzbl 0x30(%rsp,%rax), %edx
movl 0x23c(%rsp), %eax
addl $0x2, %eax
cltq
movzbl 0x30(%rsp,%rax), %ecx
xorl %edx, %ecx
movb %cl, 0x30(%rsp,%rax)
movl 0x23c(%rsp), %eax
addl $0x80, %eax
cltq
movzbl 0x30(%rsp,%rax), %edx
movl 0x23c(%rsp), %eax
addl $0x7, %eax
cltq
movzbl 0x30(%rsp,%rax), %ecx
xorl %edx, %ecx
movb %cl, 0x30(%rsp,%rax)
movl 0x23c(%rsp), %eax
addl $0x80, %eax
cltq
movzbl 0x30(%rsp,%rax), %edx
movl 0x23c(%rsp), %eax
addl $0x80, %eax
cltq
movzbl 0x30(%rsp,%rax), %ecx
xorl %edx, %ecx
movb %cl, 0x30(%rsp,%rax)
movl 0x23c(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x23c(%rsp)
jmp 0x6309
movl $0x0, 0x23c(%rsp)
cmpl $0x10, 0x23c(%rsp)
jge 0x6439
movq 0x250(%rsp), %rax
movslq 0x23c(%rsp), %rcx
movb $0x0, (%rax,%rcx)
movl 0x23c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x23c(%rsp)
jmp 0x6408
movl $0x0, 0x23c(%rsp)
cmpl $0x80, 0x23c(%rsp)
jge 0x64b8
movslq 0x23c(%rsp), %rax
movzbl 0x30(%rsp,%rax), %esi
movl 0x23c(%rsp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl $0x7, %ecx
subl %edx, %ecx
shll %cl, %esi
movq 0x250(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x23c(%rsp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq 0x8(%rsp), %rax
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movl 0x23c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x23c(%rsp)
jmp 0x6444
addq $0x258, %rsp            # imm = 0x258
retq