// File: /workspace/github_c_makefile_star2_O1/maandree[P]libkeccak/libkeccak_cshake_initialise.c
// Function: libkeccak_cshake_initialise
void
libkeccak_cshake_initialise(struct libkeccak_state *restrict state,
                            const void *n_text, size_t n_len, size_t n_bits, const char *n_suffix,
                            const void *s_text, size_t s_len, size_t s_bits, const char *s_suffix)
{
	size_t off = 0, bitoff, byterate = (size_t)state->r >> 3;

	if (!n_suffix)
		n_suffix = "";
	if (!s_suffix)
		s_suffix = "";

	if (!n_len && !s_len && !n_bits && !s_bits && !*n_suffix && !*s_suffix)
		return;

	n_len += n_bits >> 3;
	s_len += s_bits >> 3;
	n_bits &= 7;
	s_bits &= 7;

	off = encode_left(state, state->M, byterate, byterate, off);
	off = encode_left(state, state->M, byterate, (n_len << 3) + n_bits + strlen(n_suffix), off);
	off = feed_text(state, state->M, n_text, n_len, n_bits, n_suffix, off, byterate, &bitoff);

	if (!bitoff) {
		off = encode_left(state, state->M, byterate, (s_len << 3) + s_bits + strlen(s_suffix), off);
		off = feed_text(state, state->M, s_text, s_len, s_bits, s_suffix, off, byterate, &bitoff);
	} else {
		off = encode_left_shifted(state, state->M, byterate, (s_len << 3) + s_bits + strlen(s_suffix), off, bitoff);
		off = feed_text_shifted(state, state->M, s_text, s_len, s_bits, s_suffix, off, byterate, &bitoff);
	}

	if (bitoff)
		off++;
	if (off) {
		memset(&state->M[off], 0, byterate - off);
		libkeccak_zerocopy_update(state, state->M, byterate);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, 0x30(%rsp)
movq %rsi, %r9
movq %rdi, %rbx
movq 0x88(%rsp), %rsi
movq 0x80(%rsp), %rax
movq 0x90(%rsp), %r15
testq %r8, %r8
leaq 0x27a1(%rip), %rdi      # 0xab0c
cmoveq %rdi, %r8
movq 0xc8(%rbx), %r14
testq %r15, %r15
cmoveq %rdi, %r15
movq %rcx, %rdi
orq %rdx, %rdi
orq %rax, %rdi
orq %rsi, %rdi
jne 0x839b
cmpb $0x0, (%r8)
jne 0x839b
cmpb $0x0, (%r15)
je 0x86f7
shrq $0x3, %r14
movq %rcx, %r12
movq %rcx, %rdi
shrq $0x3, %r12
addq %rdx, %r12
movq %rsi, %rcx
shrq $0x3, %rcx
addq %rax, %rcx
movq %rcx, 0x18(%rsp)
andl $0x7, %edi
movq %rdi, 0x10(%rsp)
andl $0x7, %esi
movq %rsi, 0x28(%rsp)
movq 0x118(%rbx), %rsi
movq %rbx, %rdi
movq %r14, %rdx
movq %r14, %rcx
movq %r8, %rbp
xorl %r8d, %r8d
movq %r9, 0x8(%rsp)
callq 0x8706
movq %rax, 0x20(%rsp)
movq 0x118(%rbx), %rax
movq %rax, 0x40(%rsp)
movq 0x10(%rsp), %rax
leaq (%rax,%r12,8), %r13
movq %rbp, %rdi
callq 0x1070
addq %rax, %r13
movq %rbx, %rdi
movq 0x40(%rsp), %rsi
movq %r14, %rdx
movq %r13, %rcx
movq 0x20(%rsp), %r8
callq 0x8706
movq 0x118(%rbx), %rsi
subq $0x8, %rsp
leaq 0x40(%rsp), %r13
movq %rbx, %rdi
movq 0x10(%rsp), %rdx
movq %r12, %rcx
movq 0x18(%rsp), %r8
movq %rbp, %r9
pushq %r13
pushq %r14
pushq %rax
callq 0x87a4
addq $0x20, %rsp
movq %rax, 0x20(%rsp)
movq (%r13), %rbp
movq %rbx, 0x8(%rsp)
movq 0x118(%rbx), %rbx
movq 0x18(%rsp), %rcx
movq 0x28(%rsp), %rax
leaq (%rax,%rcx,8), %r13
movq %r15, %rdi
callq 0x1070
movq %rax, %r12
addq %r13, %r12
testq %rbp, %rbp
je 0x84c5
movq 0x20(%rsp), %r8
movq %rbx, 0x10(%rsp)
xorl %ebx, %ebx
testq %r12, %r12
je 0x8518
movq %r12, %rcx
movq %r12, %rax
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
incq %rbx
shrq $0x8, %rax
cmpq $0xff, %rcx
movq %rax, %rcx
ja 0x84b0
jmp 0x8522
movq %rbx, %rsi
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
movq %r12, %rcx
movq 0x20(%rsp), %r8
callq 0x8706
movq 0x118(%rbx), %rsi
subq $0x8, %rsp
movq %rbx, %rdi
movq 0x38(%rsp), %rdx
movq 0x20(%rsp), %rcx
movq 0x30(%rsp), %r8
movq %r15, %r9
leaq 0x40(%rsp), %r10
pushq %r10
pushq %r14
pushq %rax
callq 0x87a4
addq $0x20, %rsp
jmp 0x86b2
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
cmpq $0x1, %rbx
adcq $0x0, %rbx
movq %rbx, %rdx
movl %ebp, %ecx
shlq %cl, %rdx
movq %r8, %rax
incq %rax
orb %dl, (%rsi,%r8)
cmpq %r14, %rax
jne 0x8555
movq 0x10(%rsp), %rsi
movq %r14, %rdx
callq 0x4c3c
movq 0x10(%rsp), %rsi
xorl %eax, %eax
movb %bh, (%rsi,%rax)
leaq -0x8(,%rbx,8), %r13
movq %r12, %rdx
movl %r13d, %ecx
shrq %cl, %rdx
movzbl %dl, %ebx
movl %ebp, %ecx
shlq %cl, %rbx
orb %bl, (%rsi,%rax)
incq %rax
cmpq %r14, %rax
jne 0x8595
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %r14, %rdx
callq 0x4c3c
movq 0x10(%rsp), %rsi
xorl %eax, %eax
movb %bh, (%rsi,%rax)
addq $-0x8, %r13
cmpq $-0x8, %r13
jne 0x8560
movq 0x8(%rsp), %rcx
movq 0x118(%rcx), %rsi
movq 0x18(%rsp), %rdx
testq %rdx, %rdx
movq %rsi, %r13
je 0x85fc
xorl %r12d, %r12d
movq 0x30(%rsp), %rcx
movzbl (%rcx,%r12), %ebx
movl %ebp, %ecx
shll %cl, %ebx
orb %bl, (%rsi,%rax)
incq %rax
cmpq %r14, %rax
jne 0x85f1
movq 0x8(%rsp), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x4c3c
movq %r13, %rsi
movq 0x18(%rsp), %rdx
xorl %eax, %eax
movb %bh, (%rsi,%rax)
incq %r12
cmpq %r12, %rdx
jne 0x85be
movq 0x28(%rsp), %rdx
testq %rdx, %rdx
je 0x8657
movq 0x30(%rsp), %rcx
movq 0x18(%rsp), %rsi
movzbl (%rcx,%rsi), %edi
movq %r13, %rsi
movl %ebp, %ecx
shll %cl, %edi
orb %dil, (%r13,%rax)
addq %rdx, %rbp
cmpq $0x8, %rbp
movq 0x8(%rsp), %rbx
jb 0x865c
movl %edi, %r12d
incq %rax
cmpq %r14, %rax
jne 0x864c
movq %rbx, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x4c3c
movq %r13, %rsi
xorl %eax, %eax
andl $0x7, %ebp
movl %r12d, %ecx
movb %ch, (%rsi,%rax)
jmp 0x865c
movq 0x8(%rsp), %rbx
testq %rbp, %rbp
jne 0x86a0
movb $0x0, (%rsi,%rax)
jmp 0x86a0
movl $0x1, %edx
movl %ebp, %ecx
shll %cl, %edx
orb %dl, (%rsi,%rax)
incq %rbp
cmpq $0x8, %rbp
jne 0x869d
incq %rax
cmpq %r14, %rax
jne 0x8697
movq %rbx, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x4c3c
movq %r13, %rsi
xorl %eax, %eax
movb $0x0, (%rsi,%rax)
xorl %ebp, %ebp
incq %r15
movzbl (%r15), %ecx
cmpl $0x31, %ecx
je 0x8667
testl %ecx, %ecx
jne 0x8673
movq %rbp, 0x38(%rsp)
xorl %edi, %edi
cmpq $0x0, 0x38(%rsp)
setne %dil
addq %rax, %rdi
je 0x86f7
movq %r14, %rdx
subq %rdi, %rdx
addq 0x118(%rbx), %rdi
xorl %esi, %esi
callq 0x1090
movq 0x118(%rbx), %rsi
movq %rbx, %rdi
movq %r14, %rdx
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4c3c
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq