// File: /workspace/github_c_makefile_star2_O2/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 %rcx, %rbp
movq %rsi, %r10
movq %rdi, %r12
movq 0x88(%rsp), %rdi
movq 0x80(%rsp), %rax
movq 0x90(%rsp), %r15
testq %r8, %r8
leaq 0x2747(%rip), %rsi      # 0x9b0c
cmoveq %rsi, %r8
movq 0xc8(%r12), %rcx
testq %r15, %r15
cmoveq %rsi, %r15
movq %rbp, %rsi
orq %rdx, %rsi
orq %rax, %rsi
orq %rdi, %rsi
jne 0x73f6
cmpb $0x0, (%r8)
jne 0x73f6
cmpb $0x0, (%r15)
je 0x75dd
movq %r9, 0x30(%rsp)
shrq $0x3, %rcx
movq %rcx, 0x10(%rsp)
movq %rbp, %r13
shrq $0x3, %r13
addq %rdx, %r13
movq %rdi, %r14
shrq $0x3, %r14
addq %rax, %r14
andl $0x7, %ebp
movq %rbp, 0x8(%rsp)
andl $0x7, %edi
movq %rdi, 0x38(%rsp)
movq 0x118(%r12), %rsi
movq %r12, %rdi
movq %rcx, %rdx
movq %r8, %rbp
xorl %r8d, %r8d
movq %r10, 0x18(%rsp)
callq 0x7768
movq %rax, 0x20(%rsp)
movq 0x118(%r12), %rax
movq %rax, 0x28(%rsp)
movq 0x8(%rsp), %rax
leaq (%rax,%r13,8), %rbx
movq %rbp, %rdi
callq 0x1070
addq %rax, %rbx
movq %r12, %rdi
movq 0x28(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rcx
movq 0x20(%rsp), %r8
callq 0x7768
movq 0x118(%r12), %rsi
subq $0x8, %rsp
leaq 0x48(%rsp), %rbx
movq %r12, %rdi
movq 0x20(%rsp), %rdx
movq %r13, %rcx
movq 0x10(%rsp), %r8
movq %rbp, %r9
pushq %rbx
pushq 0x20(%rsp)
pushq %rax
callq 0x7803
addq $0x20, %rsp
movq %rax, 0x20(%rsp)
movq (%rbx), %rbp
movq 0x118(%r12), %rbx
movq %r12, %r13
movq %r14, 0x18(%rsp)
movq 0x38(%rsp), %rax
leaq (%rax,%r14,8), %r12
movq %rax, %r14
movq %r15, %rdi
callq 0x1070
movq %rax, %r10
addq %r12, %r10
testq %rbp, %rbp
je 0x7545
movq %r13, 0x8(%rsp)
xorl %r14d, %r14d
movq %r10, %rax
movq 0x10(%rsp), %r9
movq 0x20(%rsp), %rdx
testq %rax, %rax
je 0x7513
incq %r14
shrq $0x8, %rax
jmp 0x7505
cmpq $0x1, %r14
movq %r14, %r12
adcq $0x0, %r12
movq %r12, %rax
movl %ebp, %ecx
shlq %cl, %rax
orb %al, (%rbx,%rdx)
movq %rdx, %rax
incq %rax
xorl %r13d, %r13d
cmpq %r9, %rax
movq %r10, 0x28(%rsp)
je 0x75ec
jmp 0x7608
movq %r13, %rdi
movq %rbx, %rsi
movq 0x10(%rsp), %rbx
movq %rbx, %rdx
movq %r10, %rcx
movq 0x20(%rsp), %r8
callq 0x7768
movq 0x118(%r13), %rsi
subq $0x8, %rsp
movq %r13, %rdi
movq 0x38(%rsp), %rdx
movq 0x20(%rsp), %rcx
movq %r14, %r8
movq %r15, %r9
leaq 0x48(%rsp), %r10
pushq %r10
pushq %rbx
pushq %rax
callq 0x7803
addq $0x20, %rsp
movq 0x40(%rsp), %rbp
movq %rbx, %r9
xorl %edi, %edi
testq %rbp, %rbp
setne %dil
addq %rax, %rdi
je 0x75dd
movq %r9, %rdx
subq %rdi, %rdx
addq 0x118(%r13), %rdi
xorl %esi, %esi
movq %r9, %rbx
callq 0x1090
movq 0x118(%r13), %rsi
movq %r13, %rdi
movq %rbx, %rdx
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4864
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r9, %rdx
callq 0x4864
movq 0x28(%rsp), %r10
movq 0x10(%rsp), %r9
xorl %eax, %eax
cmpq $0x1, %r14
movq %r14, %rsi
adcq $0x0, %rsi
movq %r13, %rdx
notq %rdx
addq %rsi, %rdx
shlq $0x3, %rdx
movq %r12, %rdi
shrq $0x8, %rdi
movb %dil, (%rbx,%rax)
cmpq %r13, %rsi
je 0x765c
movq %r10, %r8
movl %edx, %ecx
shrq %cl, %r8
movzbl %r8b, %r12d
movl %ebp, %ecx
shlq %cl, %r12
incq %r13
orl %r12d, %edi
movb %dil, (%rbx,%rax)
incq %rax
addq $-0x8, %rdx
movq %r12, %rdi
cmpq %rax, %r9
jne 0x7623
jmp 0x75ec
movq 0x8(%rsp), %rcx
movq 0x118(%rcx), %rdi
xorl %r14d, %r14d
movq 0x30(%rsp), %r13
movq 0x18(%rsp), %rsi
movq %rdi, %r12
cmpq %r14, %rsi
je 0x76b9
movzbl (%r13,%r14), %ebx
movl %ebp, %ecx
shll %cl, %ebx
orb %bl, (%rdi,%rax)
incq %rax
cmpq %r9, %rax
jne 0x76b1
movq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %r9, %rdx
callq 0x4864
movq %r12, %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %r9
xorl %eax, %eax
movb %bh, (%rdi,%rax)
incq %r14
jmp 0x7678
movq 0x38(%rsp), %rdx
testq %rdx, %rdx
je 0x7706
movzbl (%r13,%rsi), %ebx
movl %ebp, %ecx
shll %cl, %ebx
orb %bl, (%rdi,%rax)
addq %rdx, %rbp
cmpq $0x8, %rbp
jb 0x7706
incq %rax
cmpq %r9, %rax
movq 0x8(%rsp), %r13
jne 0x76fe
movq %r13, %rdi
movq %r12, %rsi
movq %r9, %rdx
callq 0x4864
movq %r12, %rdi
movq 0x10(%rsp), %r9
xorl %eax, %eax
andl $0x7, %ebp
movb %bh, (%rdi,%rax)
jmp 0x770b
movq 0x8(%rsp), %r13
testq %rbp, %rbp
jne 0x7714
movb $0x0, (%rdi,%rax)
pushq $0x1
popq %r14
movzbl (%r15), %ecx
cmpl $0x31, %ecx
je 0x772a
testl %ecx, %ecx
jne 0x7734
jmp 0x7598
movl %r14d, %edx
movl %ebp, %ecx
shll %cl, %edx
orb %dl, (%rdi,%rax)
incq %rbp
cmpq $0x8, %rbp
jne 0x7763
incq %rax
cmpq %r9, %rax
jne 0x775d
movq %r13, %rdi
movq %r12, %rsi
movq %r9, %rdx
callq 0x4864
movq %r12, %rdi
movq 0x10(%rsp), %r9
xorl %eax, %eax
movb $0x0, (%rdi,%rax)
xorl %ebp, %ebp
incq %r15
jmp 0x7718