// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
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 -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0xc8(%rax), %rax
sarq $0x3, %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x2c01
movq -0x28(%rbp), %rdi
callq 0x1050
movq %rax, -0x58(%rbp)
jmp 0x2c09
xorl %eax, %eax
movq %rax, -0x58(%rbp)
jmp 0x2c09
movq -0x58(%rbp), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x2c2a
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
jmp 0x2c46
movq -0x20(%rbp), %rax
shrq $0x3, %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
andq $0x7, %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x2c7b
movq -0x38(%rbp), %rax
movq -0x18(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movq -0x20(%rbp), %rcx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
movzbl %cl, %ecx
andl %ecx, %eax
movb %al, %dl
movq -0x38(%rbp), %rax
movq -0x18(%rbp), %rcx
movb %dl, (%rax,%rcx)
cmpq $0x0, -0x48(%rbp)
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x2d27
cmpq $0x0, -0x20(%rbp)
jne 0x2cab
movq -0x38(%rbp), %rax
movq -0x18(%rbp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x2cad
movq -0x48(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x48(%rbp)
cmpq $0x0, %rax
je 0x2d25
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movsbl (%rax), %eax
andl $0x1, %eax
movq -0x20(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
shll %cl, %eax
movzbl %al, %esi
movq -0x38(%rbp), %rax
movq -0x18(%rbp), %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
cmpq $0x8, -0x20(%rbp)
jne 0x2d23
movq $0x0, -0x20(%rbp)
movq -0x38(%rbp), %rax
movq -0x18(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x18(%rbp)
movb $0x0, 0x1(%rax,%rcx)
jmp 0x2cad
jmp 0x2d27
cmpq $0x0, -0x20(%rbp)
je 0x2d3a
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0xc8(%rax), %rdi
movq -0x38(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x2df0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x15a0
cmpq $0x0, -0x30(%rbp)
je 0x2da7
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0xd8(%rax), %rdx
addq $0x7, %rdx
sarq $0x3, %rdx
movq -0x8(%rbp), %rax
movq 0xe8(%rax), %rcx
sarq $0x3, %rcx
movq -0x30(%rbp), %r8
callq 0x2f60
jmp 0x2de9
movq -0x8(%rbp), %rax
movq 0xd8(%rax), %rax
subq $0x1, %rax
movq -0x8(%rbp), %rcx
cqto
idivq 0xc8(%rcx)
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x50(%rbp)
cmpq $0x0, %rax
je 0x2de7
movq -0x8(%rbp), %rdi
callq 0x34d0
jmp 0x2dc7
jmp 0x2de9
addq $0x60, %rsp
popq %rbp
retq
nop