// File: /workspace/github_c_makefile_star2_O3/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 %r8, %rbx
movq %rcx, %r12
movq %rsi, %r10
movq 0x88(%rsp), %rsi
movq 0x80(%rsp), %rax
movq 0x90(%rsp), %r8
testq %rbx, %rbx
leaq 0x20ee(%rip), %rcx      # 0xab0c
cmoveq %rcx, %rbx
movq 0xc8(%rdi), %r14
testq %r8, %r8
cmoveq %rcx, %r8
movq %r12, %rcx
orq %rdx, %rcx
orq %rax, %rcx
orq %rsi, %rcx
jne 0x8a4d
cmpb $0x0, (%rbx)
jne 0x8a4d
cmpb $0x0, (%r8)
je 0x8dbf
shrq $0x3, %r14
movq %rdi, 0x8(%rsp)
movq %r8, 0x20(%rsp)
movq %r12, %r13
shrq $0x3, %r13
addq %rdx, %r13
movq %rsi, %r15
shrq $0x3, %r15
addq %rax, %r15
andl $0x7, %r12d
andl $0x7, %esi
movq %rsi, 0x28(%rsp)
movq 0x8(%rsp), %rax
movq 0x118(%rax), %rsi
movq 0x8(%rsp), %rdi
movq %r14, %rdx
movq %r14, %rcx
xorl %r8d, %r8d
movq %r10, 0x10(%rsp)
callq 0x8dce
movq %rax, 0x18(%rsp)
movq 0x8(%rsp), %rax
movq 0x118(%rax), %rax
movq %rax, 0x40(%rsp)
leaq (%r12,%r13,8), %rbp
movq %rbx, %rdi
callq 0x1070
addq %rax, %rbp
movq 0x8(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq %r14, %rdx
movq %rbp, %rcx
movq 0x18(%rsp), %r8
callq 0x8dce
movq 0x8(%rsp), %rcx
movq 0x118(%rcx), %rsi
subq $0x8, %rsp
leaq 0x40(%rsp), %rbp
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rdx
movq %r13, %rcx
movq 0x10(%rsp), %r13
movq %r12, %r8
movq %rbx, %r9
pushq %rbp
pushq %r14
pushq %rax
callq 0x8e6c
addq $0x20, %rsp
movq %rax, 0x18(%rsp)
movq (%rbp), %rbp
movq 0x118(%r13), %rbx
movq %r15, 0x10(%rsp)
movq 0x28(%rsp), %rax
leaq (%rax,%r15,8), %r12
movq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x1070
movq %rax, %r8
addq %r12, %r8
testq %rbp, %rbp
je 0x8cd5
movq 0x18(%rsp), %rsi
xorl %r13d, %r13d
testq %r8, %r8
je 0x8b78
movq %r8, %rcx
movq %r8, %rax
incq %r13
shrq $0x8, %rax
cmpq $0xff, %rcx
movq %rax, %rcx
ja 0x8b65
cmpq $0x1, %r13
adcq $0x0, %r13
movq %r13, %rdx
movl %ebp, %ecx
shlq %cl, %rdx
movq %rsi, %rax
incq %rax
orb %dl, (%rbx,%rsi)
cmpq %r14, %rax
jne 0x8bae
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r8, %r12
callq 0x497c
movq %r12, %r8
xorl %eax, %eax
movl %r13d, %edx
shrl $0x8, %edx
movb %dl, (%rbx,%rax)
leaq -0x8(,%r13,8), %r13
movq %r8, %rsi
movl %r13d, %ecx
shrq %cl, %rsi
movzbl %sil, %r12d
movl %ebp, %ecx
shlq %cl, %r12
movl %r12d, %ecx
orb %dl, %cl
movb %cl, (%rbx,%rax)
incq %rax
cmpq %r14, %rax
jne 0x8bff
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r14, %r15
movq %r8, %r14
callq 0x497c
movq %r14, %r8
movq %r15, %r14
xorl %eax, %eax
shrl $0x8, %r12d
movb %r12b, (%rbx,%rax)
addq $-0x8, %r13
movl %r12d, %edx
cmpq $-0x8, %r13
jne 0x8bbf
movq 0x8(%rsp), %rcx
movq 0x118(%rcx), %rbx
movq 0x10(%rsp), %rsi
testq %rsi, %rsi
je 0x8c79
movb (%rbx,%rax), %dl
xorl %r12d, %r12d
movq 0x30(%rsp), %rcx
movzbl (%rcx,%r12), %r13d
movl %ebp, %ecx
shll %cl, %r13d
movl %r13d, %ecx
orb %dl, %cl
movb %cl, (%rbx,%rax)
incq %rax
cmpq %r14, %rax
jne 0x8c66
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x497c
movq 0x10(%rsp), %rsi
xorl %eax, %eax
shrl $0x8, %r13d
movb %r13b, (%rbx,%rax)
incq %r12
movl %r13d, %edx
cmpq %r12, %rsi
jne 0x8c30
movq 0x28(%rsp), %rdx
testq %rdx, %rdx
je 0x8d25
movq 0x30(%rsp), %rcx
movzbl (%rcx,%rsi), %esi
movl %ebp, %ecx
shll %cl, %esi
orb %sil, (%rbx,%rax)
addq %rdx, %rbp
cmpq $0x8, %rbp
movq 0x8(%rsp), %r13
movq 0x20(%rsp), %r15
jb 0x8d2f
movl %esi, %r12d
incq %rax
cmpq %r14, %rax
jne 0x8cca
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x497c
xorl %eax, %eax
andl $0x7, %ebp
movl %r12d, %ecx
movb %ch, (%rbx,%rax)
jmp 0x8d2f
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r8, %rcx
movq 0x18(%rsp), %r8
callq 0x8dce
movq 0x118(%r13), %rsi
subq $0x8, %rsp
movq %r13, %rdi
movq 0x38(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq 0x30(%rsp), %r8
movq %r15, %r9
leaq 0x40(%rsp), %r10
pushq %r10
pushq %r14
pushq %rax
callq 0x8e6c
addq $0x20, %rsp
movq 0x38(%rsp), %rbp
jmp 0x8d7d
movq 0x8(%rsp), %r13
movq 0x20(%rsp), %r15
testq %rbp, %rbp
jne 0x8d70
movb $0x0, (%rbx,%rax)
jmp 0x8d70
movl $0x1, %edx
movl %ebp, %ecx
shll %cl, %edx
orb %dl, (%rbx,%rax)
incq %rbp
cmpq $0x8, %rbp
jne 0x8d6d
incq %rax
cmpq %r14, %rax
jne 0x8d67
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x497c
xorl %eax, %eax
movb $0x0, (%rbx,%rax)
xorl %ebp, %ebp
incq %r15
movzbl (%r15), %ecx
cmpl $0x31, %ecx
je 0x8d3a
testl %ecx, %ecx
jne 0x8d46
xorl %edi, %edi
testq %rbp, %rbp
setne %dil
addq %rax, %rdi
je 0x8dbf
movq %r14, %rdx
subq %rdi, %rdx
addq 0x118(%r13), %rdi
xorl %esi, %esi
callq 0x1090
movq 0x118(%r13), %rsi
movq %r13, %rdi
movq %r14, %rdx
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x497c
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq