// File: /workspace/github_c_makefile_star2_O0/maandree[P]libkeccak/libkeccak_cshake_initialise.c
// Function: feed_text
static size_t
feed_text(struct libkeccak_state *restrict state, uint8_t *restrict buf, const uint8_t *restrict text, size_t bytes,
          size_t bits, const char *restrict suffix, size_t off, size_t byterate, size_t *restrict bitoffp)
{
	size_t n, bitoff;

	if (off) {
		n = bytes < byterate - off ? bytes : byterate - off;
		memcpy(&buf[off], text, n);
		off += n;
		if (off == byterate) {
			libkeccak_zerocopy_update(state, buf, byterate);
			off = 0;
		}
		text = &text[n];
		bytes -= n;
	}
	if (bytes) {
		n = bytes;
		n -= bytes %= byterate;
		libkeccak_zerocopy_update(state, text, n);
		text = &text[n];
	}
	memcpy(&buf[off], text, bytes + !!bits);
	off += bytes;
	bitoff = bits;
	if (!bitoff)
		buf[off] = 0;
	for (; *suffix; suffix++) {
		if (*suffix == '1')
			buf[off] |= (uint8_t)(1 << bitoff);
		if (++bitoff == 8) {
			if (++off == byterate) {
				libkeccak_zerocopy_update(state, buf, byterate);
				off = 0;
			}
			bitoff = 0;
			buf[off] = 0;
		}
	}

	*bitoffp = bitoff;
	return off;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
cmpq $0x0, 0x10(%rbp)
je 0xaa65
movq -0x20(%rbp), %rax
movq 0x18(%rbp), %rcx
subq 0x10(%rbp), %rcx
cmpq %rcx, %rax
jae 0xa9f2
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0xa9fe
movq 0x18(%rbp), %rax
subq 0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
addq 0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x10b0
movq -0x38(%rbp), %rax
addq 0x10(%rbp), %rax
movq %rax, 0x10(%rbp)
movq 0x10(%rbp), %rax
cmpq 0x18(%rbp), %rax
jne 0xaa4a
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq 0x18(%rbp), %rdx
callq 0x54e0
movq $0x0, 0x10(%rbp)
movq -0x18(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x38(%rbp), %rcx
movq -0x20(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xaaad
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq 0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
xorl %edx, %edx
divq %rcx
movq %rdx, -0x20(%rbp)
movq -0x38(%rbp), %rax
subq %rdx, %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x54e0
movq -0x18(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
addq 0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
cmpq $0x0, -0x28(%rbp)
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
addq %rax, %rdx
callq 0x10b0
movq -0x20(%rbp), %rax
addq 0x10(%rbp), %rax
movq %rax, 0x10(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0xaaff
movq -0x10(%rbp), %rax
movq 0x10(%rbp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0xab01
movq -0x30(%rbp), %rax
cmpb $0x0, (%rax)
je 0xab9f
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x31, %eax
jne 0xab3b
movq -0x40(%rbp), %rax
movl %eax, %ecx
movl $0x1, %eax
shll %cl, %eax
movzbl %al, %esi
movq -0x10(%rbp), %rax
movq 0x10(%rbp), %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
cmpq $0x8, %rax
jne 0xab8c
movq 0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rbp)
cmpq 0x18(%rbp), %rax
jne 0xab78
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq 0x18(%rbp), %rdx
callq 0x54e0
movq $0x0, 0x10(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rbp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0xab8e
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0xab01
movq -0x40(%rbp), %rcx
movq 0x20(%rbp), %rax
movq %rcx, (%rax)
movq 0x10(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)