// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/benes.c
// Function: support_gen
void support_gen(gf * s, const unsigned char *c)
{
	gf a;
	int i, j;
	unsigned char L[ GFBITS ][ (1 << GFBITS)/8 ];

	for (i = 0; i < GFBITS; i++)
		for (j = 0; j < (1 << GFBITS)/8; j++)
			L[i][j] = 0;

	for (i = 0; i < (1 << GFBITS); i++)
	{
		a = bitrev((gf) i);

		for (j = 0; j < GFBITS; j++)
			L[j][ i/8 ] |= ((a >> j) & 1) << (i%8);
	}
			
	for (j = 0; j < GFBITS; j++)
		apply_benes(L[j], c, 0);

	for (i = 0; i < SYS_N; i++)
	{
		a = bitrev((gf) i);
	
		s[i] = 0;
		for (j = GFBITS-1; j >= 0; j--)
		{
			s[i] <<= 1;
			s[i] |= (L[j][i/8] >> (i%8)) & 1;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3430, %rsp           # imm = 0x3430
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0xd, -0x18(%rbp)
jge 0x1c82
movl $0x0, -0x1c(%rbp)
cmpl $0x400, -0x1c(%rbp)     # imm = 0x400
jge 0x1c75
movslq -0x18(%rbp), %rcx
leaq -0x3420(%rbp), %rax
shlq $0xa, %rcx
addq %rcx, %rax
movslq -0x1c(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1c47
jmp 0x1c77
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1c3a
movl $0x0, -0x18(%rbp)
cmpl $0x2000, -0x18(%rbp)    # imm = 0x2000
jge 0x1d21
movl -0x18(%rbp), %eax
movzwl %ax, %edi
callq 0xdf60
movw %ax, -0x12(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0xd, -0x1c(%rbp)
jge 0x1d11
movzwl -0x12(%rbp), %esi
movl -0x1c(%rbp), %ecx
sarl %cl, %esi
andl $0x1, %esi
movl -0x18(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %edx, %ecx
shll %cl, %esi
movslq -0x1c(%rbp), %rcx
leaq -0x3420(%rbp), %rax
shlq $0xa, %rcx
addq %rcx, %rax
movq %rax, -0x3428(%rbp)
movl -0x18(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x3428(%rbp), %rax
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1cac
jmp 0x1d13
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1c89
movl $0x0, -0x1c(%rbp)
cmpl $0xd, -0x1c(%rbp)
jge 0x1d56
movslq -0x1c(%rbp), %rax
leaq -0x3420(%rbp), %rdi
shlq $0xa, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
xorl %edx, %edx
callq 0x15c0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1d28
movl $0x0, -0x18(%rbp)
cmpl $0x2000, -0x18(%rbp)    # imm = 0x2000
jge 0x1e19
movl -0x18(%rbp), %eax
movzwl %ax, %edi
callq 0xdf60
movw %ax, -0x12(%rbp)
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movw $0x0, (%rax,%rcx,2)
movl $0xc, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jl 0x1e09
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movzwl (%rax,%rcx,2), %edx
shll %edx
movw %dx, (%rax,%rcx,2)
movslq -0x1c(%rbp), %rcx
leaq -0x3420(%rbp), %rax
shlq $0xa, %rcx
addq %rcx, %rax
movq %rax, -0x3430(%rbp)
movl -0x18(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x3430(%rbp), %rax
movslq %ecx, %rcx
movzbl (%rax,%rcx), %esi
movl -0x18(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %edx, %ecx
sarl %cl, %esi
andl $0x1, %esi
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movzwl (%rax,%rcx,2), %edx
orl %esi, %edx
movw %dx, (%rax,%rcx,2)
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1d8e
jmp 0x1e0b
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1d5d
addq $0x3430, %rsp           # imm = 0x3430
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)