// File: /workspace/github_c_makefile_star2_O0/ww9210[P]xnuca_final_ssp/sha3.c
// Function: rhash_sha3_update
void rhash_sha3_update(sha3_ctx *ctx, const unsigned char *msg, size_t size)
{
	size_t index = (size_t)ctx->rest;
	size_t block_size = (size_t)ctx->block_size;

	if (ctx->rest & SHA3_FINALIZED) return; /* too late for additional input */
	ctx->rest = (unsigned)((ctx->rest + size) % block_size);

	/* fill partial block */
	if (index) {
		size_t left = block_size - index;
		memcpy((char*)ctx->message + index, msg, (size < left ? size : left));
		if (size < left) return;

		/* process partial block */
		rhash_sha3_process_block(ctx->hash, ctx->message, block_size);
		msg  += left;
		size -= left;
	}
	while (size >= block_size) {
		uint64_t* aligned_message_block;
		if (IS_ALIGNED_64(msg)) {
			/* the most common case is processing of an already aligned message
			without copying it */
			aligned_message_block = (uint64_t*)msg;
		} else {
			memcpy(ctx->message, msg, block_size);
			aligned_message_block = ctx->message;
		}

		rhash_sha3_process_block(ctx->hash, aligned_message_block, block_size);
		msg  += block_size;
		size -= block_size;
	}
	if (size) {
		memcpy(ctx->message, msg, size); /* save leftovers */
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x188(%rax), %eax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl 0x18c(%rax), %eax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movl 0x188(%rax), %eax
andl $0x80000000, %eax       # imm = 0x80000000
cmpl $0x0, %eax
je 0x2ba9
jmp 0x2d07
movq -0x8(%rbp), %rax
movl 0x188(%rax), %eax
addq -0x18(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x28(%rbp)
movl %edx, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x188(%rax)
cmpq $0x0, -0x20(%rbp)
je 0x2c6b
movq -0x28(%rbp), %rax
subq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
addq $0xc8, %rax
addq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x2c10
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0x2c18
movq -0x30(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rsi
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rdx
callq 0x1160
movq -0x18(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x2c38
jmp 0x2d07
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0xc8, %rsi
movq -0x28(%rbp), %rdx
callq 0x2d10
movq -0x30(%rbp), %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x30(%rbp), %rcx
movq -0x18(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x18(%rbp)
jmp 0x2c6d
movq -0x18(%rbp), %rax
cmpq -0x28(%rbp), %rax
jb 0x2ce8
movq -0x10(%rbp), %rcx
subq $0x0, %rcx
andq $0x7, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x2c94
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x2cba
movq -0x8(%rbp), %rdi
addq $0xc8, %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x1160
movq -0x8(%rbp), %rax
addq $0xc8, %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x2d10
movq -0x28(%rbp), %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x18(%rbp)
jmp 0x2c6d
cmpq $0x0, -0x18(%rbp)
je 0x2d07
movq -0x8(%rbp), %rdi
addq $0xc8, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x1160
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)