// File: /workspace/github_c_makefile_star2_O1/maandree[P]libkeccak/digest.c
// Function: libkeccak_zerocopy_digest
void
libkeccak_zerocopy_digest(struct libkeccak_state *restrict state, void *restrict msg_, size_t msglen,
                          size_t bits, const char *restrict suffix, void *restrict hashsum)
{
	unsigned char *restrict msg = msg_;
	register long int rr = state->r >> 3;
	auto size_t suffix_len = suffix ? __builtin_strlen(suffix) : 0;
	register long int i;

	if (!msg) {
		msglen = 0;
		bits = 0;
	} else {
		msglen += bits >> 3;
		bits &= 7;
	}

	if (bits)
		msg[msglen] = msg[msglen] & (unsigned char)((1 << bits) - 1);
	if (__builtin_expect(!!suffix_len, 1)) {
		if (!bits)
			msg[msglen] = 0;
		while (suffix_len--) {
			msg[msglen] |= (unsigned char)((*suffix++ & 1) << bits++);
			if (bits == 8) {
				bits = 0;
				msg[++msglen] = 0;
			}
		}
	}
	if (bits)
		msglen++;

	msglen = libkeccak_pad10star1((size_t)state->r, msg, msglen, bits);
	libkeccak_absorption_phase(state, msg, msglen);

	if (hashsum) {
		libkeccak_squeezing_phase(state, rr, (state->n + 7) >> 3, state->w >> 3, hashsum);
	} else {
		for (i = (state->n - 1) / state->r; i--;)
			libkeccak_f(state);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, (%rsp)
movq %r8, %r13
movq %rcx, %rbp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
movq 0xc8(%rdi), %r15
testq %r8, %r8
je 0x1144
movq %r13, %rdi
callq 0x1050
jmp 0x1146
xorl %eax, %eax
movq %rbp, %r8
shrq $0x3, %r8
addq %r14, %r8
andq $0x7, %rbp
je 0x1162
movb $-0x1, %dl
movl %ebp, %ecx
shlb %cl, %dl
notb %dl
andb %dl, (%r12,%r8)
testq %rax, %rax
je 0x12b1
testq %rbp, %rbp
jne 0x1175
movb $0x0, (%r12,%r8)
xorl %edx, %edx
movzbl (%r13,%rdx), %edi
andl $0x1, %edi
leaq 0x1(%rbp), %rsi
movl %ebp, %ecx
shll %cl, %edi
orb %dil, (%r12,%r8)
cmpq $0x8, %rsi
jne 0x119d
movb $0x0, 0x1(%r12,%r8)
incq %r8
xorl %esi, %esi
incq %rdx
movq %rsi, %rbp
cmpq %rdx, %rax
jne 0x1177
leaq (,%r8,8), %rax
orq %rsi, %rax
xorl %edx, %edx
divq %r15
testq %rsi, %rsi
je 0x11ca
pushq $0x1
popq %rdi
movl %esi, %ecx
shll %cl, %edi
orb (%r12,%r8), %dil
jmp 0x11cd
movb $0x1, %dil
leaq -0x8(%r15), %rcx
cmpq %rdx, %rcx
seta %al
leaq -0x2(%r15), %rsi
cmpq %rsi, %rdx
seta %dl
orb %al, %dl
je 0x1225
leaq 0x1(%r8), %rsi
leaq 0x8(,%r8,8), %rax
xorl %edx, %edx
divq %r15
leaq (%rcx,%r8,8), %r14
addq $0x8, %r14
subq %rdx, %r14
shrq $0x3, %r14
movb %dil, (%r12,%r8)
leaq (%r12,%r8), %rdi
incq %rdi
movq %r14, %rdx
subq %rsi, %rdx
xorl %esi, %esi
callq 0x1070
movb $-0x80, %dil
movq %r14, %r8
jmp 0x1229
addb $-0x80, %dil
movb %dil, (%r12,%r8)
incq %r8
movq %rbx, %rdi
movq %r12, %rsi
movq %r8, %rdx
callq 0x1976
movq 0xd8(%rbx), %rdx
movq (%rsp), %r8
testq %r8, %r8
je 0x127e
sarq $0x3, %r15
addq $0x7, %rdx
sarq $0x3, %rdx
movq 0xe8(%rbx), %rcx
sarq $0x3, %rcx
movq %rbx, %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1364
decq %rdx
movq %rdx, %rax
cqto
idivq 0xc8(%rbx)
testq %rax, %rax
je 0x12a2
movq %rax, %r14
movq %rbx, %rdi
callq 0x3519
decq %r14
jne 0x1295
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbp, %rsi
jmp 0x11a8