// File: /workspace/github_c_makefile_star2_O0/maandree[P]libkeccak/test.c
// Function: test_digest_case_inited
static int
test_digest_case_inited(struct libkeccak_state *restrict state, const struct libkeccak_spec *restrict spec,
                        const char *restrict suffix, const char *restrict msg, size_t bytes, size_t bits,
                        const char *restrict expected_answer)
{
	unsigned char *restrict hashsum;
	char *restrict hexsum;
	int ok;

	hashsum = malloc((size_t)((spec->output + 7) / 8));
	if (!hashsum) {
		perror("malloc");
		return -1;
	}
	hexsum = malloc((size_t)((spec->output + 7) / 8 * 2 + 1));
	if (!hexsum) {
		perror("malloc");
		return -1;
	}

	if (libkeccak_digest(state, msg, bytes, bits, suffix, hashsum)) {
		perror("libkeccak_digest");
		return -1;
	}

	libkeccak_behex_lower(hexsum, hashsum, (size_t)((spec->output + 7) / 8));
	ok = !strcmp(hexsum, expected_answer);
	printf("%s%s\n", ok ? "OK" : "Fail: ", ok ? "" : hexsum);
	if (!ok)
		printf("  r, c, n = %li, %li, %li\n", spec->bitrate, spec->capacity, spec->output);

	free(hashsum);
	free(hexsum);

	return ok - 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
addq $0x7, %rax
movl $0x8, %ecx
cqto
idivq %rcx
movq %rax, %rdi
callq 0x10c0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x4e55
leaq 0x8455(%rip), %rdi      # 0xd299
callq 0x1100
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4fad
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
addq $0x7, %rax
movl $0x8, %ecx
cqto
idivq %rcx
movq %rax, %rdi
shlq %rdi
addq $0x1, %rdi
callq 0x10c0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x4e9d
leaq 0x840d(%rip), %rdi      # 0xd299
callq 0x1100
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4fad
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x40(%rbp), %r9
callq 0x7900
cmpl $0x0, %eax
je 0x4ed7
leaq 0x9a03(%rip), %rdi      # 0xe8c9
callq 0x1100
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4fad
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
addq $0x7, %rax
movl $0x8, %ecx
cqto
idivq %rcx
movq %rax, %rdx
callq 0xbe30
movq -0x48(%rbp), %rdi
movq 0x10(%rbp), %rsi
callq 0x10a0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %edx
leaq 0x99bf(%rip), %rax      # 0xe8e3
leaq 0x99b5(%rip), %rcx      # 0xe8e0
cmpl $0x0, %edx
cmovneq %rcx, %rax
movq %rax, -0x58(%rbp)
cmpl $0x0, -0x4c(%rbp)
je 0x4f49
leaq 0x8dc2(%rip), %rax      # 0xdd05
movq %rax, -0x60(%rbp)
jmp 0x4f51
movq -0x48(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rsi
movq -0x60(%rbp), %rdx
leaq 0x997a(%rip), %rdi      # 0xe8da
movb $0x0, %al
callq 0x1060
cmpl $0x0, -0x4c(%rbp)
jne 0x4f92
movq -0x18(%rbp), %rax
movq (%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
leaq 0x995f(%rip), %rdi      # 0xe8ea
movb $0x0, %al
callq 0x1060
movq -0x40(%rbp), %rdi
callq 0x1030
movq -0x48(%rbp), %rdi
callq 0x1030
movl -0x4c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)