// File: /workspace/github_c_makefile_star2_O0/maandree[P]libkeccak/libkeccak_cshake_initialise.c
// Function: feed_text_shifted
static size_t
feed_text_shifted(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 i, bitoff = *bitoffp;
	uint16_t v;

	for (i = 0; i < bytes; i++) {
		v = (uint16_t)((uint16_t)text[i] << bitoff);
		buf[off] |= (uint8_t)v;
		if (++off == byterate) {
			libkeccak_zerocopy_update(state, buf, byterate);
			off = 0;
		}
		buf[off] = (uint8_t)(v >> 8);
	}
	if (bits) {
		v = (uint16_t)((uint16_t)text[bytes] << bitoff);
		buf[off] |= (uint8_t)v;
		bitoff += bits;
		if (bitoff >= 8) {
			if (++off == byterate) {
				libkeccak_zerocopy_update(state, buf, byterate);
				off = 0;
			}
			bitoff &= 7;
			buf[off] = (uint8_t)(v >> 8);
		}
	}
	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)
movq 0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0xae1e
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movzwl %ax, %eax
movq -0x40(%rbp), %rcx
shll %cl, %eax
movw %ax, -0x42(%rbp)
movw -0x42(%rbp), %ax
movzbl %al, %esi
movq -0x10(%rbp), %rax
movq 0x10(%rbp), %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movq 0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rbp)
cmpq 0x18(%rbp), %rax
jne 0xadf9
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq 0x18(%rbp), %rdx
callq 0x54e0
movq $0x0, 0x10(%rbp)
movzwl -0x42(%rbp), %eax
sarl $0x8, %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movq 0x10(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xad8f
cmpq $0x0, -0x28(%rbp)
je 0xaeba
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movzwl %ax, %eax
movq -0x40(%rbp), %rcx
shll %cl, %eax
movw %ax, -0x42(%rbp)
movw -0x42(%rbp), %ax
movzbl %al, %esi
movq -0x10(%rbp), %rax
movq 0x10(%rbp), %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movq -0x28(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x8, -0x40(%rbp)
jb 0xaeb8
movq 0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rbp)
cmpq 0x18(%rbp), %rax
jne 0xae98
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq 0x18(%rbp), %rdx
callq 0x54e0
movq $0x0, 0x10(%rbp)
movq -0x40(%rbp), %rax
andq $0x7, %rax
movq %rax, -0x40(%rbp)
movzwl -0x42(%rbp), %eax
sarl $0x8, %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movq 0x10(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0xaeba
cmpq $0x0, -0x40(%rbp)
jne 0xaecd
movq -0x10(%rbp), %rax
movq 0x10(%rbp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0xaecf
movq -0x30(%rbp), %rax
cmpb $0x0, (%rax)
je 0xaf6d
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x31, %eax
jne 0xaf09
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 0xaf5a
movq 0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rbp)
cmpq 0x18(%rbp), %rax
jne 0xaf46
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 0xaf5c
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0xaecf
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)
nopl (%rax)