// File: /workspace/github_c_makefile_star2_O3/maandree[P]libkeccak/test.c
// Function: test_squeeze
static int
test_squeeze(void)
{
#define answer1 "03fe12b4b51d56d96377d927e5cd498fc4bc3aee389b2f2ff8393aa5"
#define answer2 "0b8fb64ee5d8836956f49cbe4577afbc638c855c1d553452fc1eceb8"
#define answer3 "1e03b4cd9eef3892a7b5e865fce393c4bc90120d9aea84d0a0dff3b8"
#define answer4 "aac92fbfd22ce62e83ddaf2e61bd7bf696326e46d1327defa4530e20"

#define run_test(fast_squeezes, squeezes, fast_digest)\
	test_squeeze_case(&state, &spec, fast_squeezes, squeezes, fast_digest, hashsum, hexsum, answer##squeezes)

	struct libkeccak_spec spec;
	struct libkeccak_state state;
	unsigned char *restrict hashsum;
	char *restrict hexsum;

	libkeccak_spec_sha3(&spec, 224);
	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_state_initialise(&state, &spec)) {
		perror("libkeccak_state_initialise");
		return -1;
	}

# if defined(__clang__)
#  pragma clang diagnostic push
#  pragma clang diagnostic ignored "-Wcomma"
# endif

	printf("Testing squeeze functions with slow initial digest:\n");
	printf("  1 extra squeeze,  including 0 fast squeezes: "), run_test(0, 1, 0);
	printf("  2 extra squeezes, including 0 fast squeezes: "), run_test(0, 2, 0);
	printf("  2 extra squeezes, including 1 fast squeeze:  "), run_test(1, 2, 0);
	printf("  3 extra squeezes, including 0 fast squeezes: "), run_test(0, 3, 0);
	printf("  3 extra squeezes, including 1 fast squeeze:  "), run_test(1, 3, 0);
	printf("  3 extra squeezes, including 2 fast squeezes: "), run_test(2, 3, 0);
	printf("  4 extra squeezes, including 0 fast squeezes: "), run_test(0, 4, 0);
	printf("  4 extra squeezes, including 1 fast squeeze:  "), run_test(1, 4, 0);
	printf("  4 extra squeezes, including 2 fast squeezes: "), run_test(2, 4, 0);
	printf("  4 extra squeezes, including 3 fast squeezes: "), run_test(3, 4, 0);
	printf("\n");

	printf("Testing squeeze functions with fast initial digest:\n");
	printf("  1 extra squeeze,  including 0 fast squeezes: "), run_test(0, 1, 1);
	printf("  2 extra squeezes, including 0 fast squeezes: "), run_test(0, 2, 1);
	printf("  2 extra squeezes, including 1 fast squeeze:  "), run_test(1, 2, 1);
	printf("  3 extra squeezes, including 0 fast squeezes: "), run_test(0, 3, 1);
	printf("  3 extra squeezes, including 1 fast squeeze:  "), run_test(1, 3, 1);
	printf("  3 extra squeezes, including 2 fast squeezes: "), run_test(2, 3, 1);
	printf("  4 extra squeezes, including 0 fast squeezes: "), run_test(0, 4, 1);
	printf("  4 extra squeezes, including 1 fast squeeze:  "), run_test(1, 4, 1);
	printf("  4 extra squeezes, including 2 fast squeezes: "), run_test(2, 4, 1);
	printf("  4 extra squeezes, including 3 fast squeezes: "), run_test(3, 4, 1);
	printf("\n");

# if defined(__clang__)
#  pragma clang diagnostic pop
# endif

	libkeccak_state_fast_destroy(&state);
	free(hashsum);
	free(hexsum);
	return 0;

#undef run_test
#undef answer4
#undef answer3
#undef answer2
#undef answer1
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq $0x480, (%rsp)          # imm = 0x480
movq $0x1c0, 0x8(%rsp)       # imm = 0x1C0
movq $0xe0, 0x10(%rsp)
movl $0x1c, %edi
callq 0x10e0
testq %rax, %rax
je 0x4228
movq %rax, %rbx
movl $0x39, %edi
callq 0x10e0
testq %rax, %rax
je 0x4228
movq %rax, %r14
leaq 0x18(%rsp), %rdi
movq %rsp, %rsi
callq 0x8fb8
testl %eax, %eax
jne 0x4231
leaq 0xd309(%rip), %rdi      # 0x110ce
callq 0x1060
leaq 0xcd89(%rip), %rdi      # 0x10b5a
xorl %eax, %eax
callq 0x1080
leaq 0xcdab(%rip), %rax      # 0x10b8a
leaq 0x18(%rsp), %r12
movq %rsp, %r13
movl $0x1, %ecx
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
xorl %r8d, %r8d
movq %rbx, %r9
pushq %rax
pushq %r14
callq 0x480d
addq $0x10, %rsp
leaq 0xcdb6(%rip), %rdi      # 0x10bc3
xorl %eax, %eax
callq 0x1080
leaq 0xcdd8(%rip), %rax      # 0x10bf3
movl $0x2, %ecx
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
xorl %r8d, %r8d
movq %rbx, %r9
pushq %rax
movq %rax, %r15
pushq %r14
callq 0x480d
addq $0x10, %rsp
leaq 0xcde8(%rip), %rdi      # 0x10c2c
xorl %eax, %eax
callq 0x1080
movl $0x1, %edx
movl $0x2, %ecx
movq %r12, %rdi
movq %r13, %rsi
xorl %r8d, %r8d
movq %rbx, %r9
pushq %r15
pushq %r14
callq 0x480d
addq $0x10, %rsp
leaq 0xcde7(%rip), %rdi      # 0x10c5c
xorl %eax, %eax
callq 0x1080
leaq 0xce09(%rip), %rax      # 0x10c8c
movl $0x3, %ecx
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
xorl %r8d, %r8d
movq %rbx, %r9
pushq %rax
movq %rax, %r15
pushq %r14
callq 0x480d
addq $0x10, %rsp
leaq 0xce19(%rip), %rdi      # 0x10cc5
xorl %eax, %eax
callq 0x1080
movl $0x1, %edx
movl $0x3, %ecx
movq %r12, %rdi
movq %r13, %rsi
xorl %r8d, %r8d
movq %rbx, %r9
pushq %r15
pushq %r14
callq 0x480d
addq $0x10, %rsp
leaq 0xce18(%rip), %rdi      # 0x10cf5
xorl %eax, %eax
callq 0x1080
movl $0x2, %edx
movl $0x3, %ecx
movq %r12, %rdi
movq %r13, %rsi
xorl %r8d, %r8d
movq %rbx, %r9
pushq %r15
pushq %r14
callq 0x480d
addq $0x10, %rsp
leaq 0xce17(%rip), %rdi      # 0x10d25
xorl %eax, %eax
callq 0x1080
leaq 0xce39(%rip), %rbp      # 0x10d55
movl $0x4, %ecx
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
xorl %r8d, %r8d
movq %rbx, %r9
pushq %rbp
pushq %r14
callq 0x480d
addq $0x10, %rsp
leaq 0xce4c(%rip), %rdi      # 0x10d8e
xorl %eax, %eax
callq 0x1080
movl $0x1, %edx
movl $0x4, %ecx
movq %r12, %rdi
movq %r13, %rsi
xorl %r8d, %r8d
movq %rbx, %r9
pushq %rbp
pushq %r14
callq 0x480d
addq $0x10, %rsp
leaq 0xce4c(%rip), %rdi      # 0x10dbe
xorl %eax, %eax
callq 0x1080
movl $0x2, %edx
movl $0x4, %ecx
movq %r12, %rdi
movq %r13, %rsi
xorl %r8d, %r8d
movq %rbx, %r9
pushq %rbp
pushq %r14
callq 0x480d
addq $0x10, %rsp
leaq 0xce4c(%rip), %rdi      # 0x10dee
xorl %eax, %eax
callq 0x1080
movl $0x3, %edx
movl $0x4, %ecx
movq %r12, %rdi
movq %r13, %rsi
xorl %r8d, %r8d
movq %rbx, %r9
pushq %rbp
pushq %r14
callq 0x480d
addq $0x10, %rsp
movl $0xa, %edi
callq 0x1040
leaq 0xd126(%rip), %rdi      # 0x11102
callq 0x1060
leaq 0xcb72(%rip), %rdi      # 0x10b5a
xorl %eax, %eax
callq 0x1080
movl $0x1, %ecx
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
movl $0x1, %r8d
movq %rbx, %r9
leaq 0xcb7e(%rip), %rax      # 0x10b8a
pushq %rax
pushq %r14
callq 0x480d
addq $0x10, %rsp
leaq 0xcba4(%rip), %rdi      # 0x10bc3
xorl %eax, %eax
callq 0x1080
movl $0x2, %ecx
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
movl $0x1, %r8d
movq %rbx, %r9
leaq 0xcbb0(%rip), %r15      # 0x10bf3
pushq %r15
pushq %r14
callq 0x480d
addq $0x10, %rsp
leaq 0xcbd5(%rip), %rdi      # 0x10c2c
xorl %eax, %eax
callq 0x1080
movl $0x1, %edx
movl $0x2, %ecx
movq %r12, %rdi
movq %r13, %rsi
movl $0x1, %r8d
movq %rbx, %r9
pushq %r15
pushq %r14
callq 0x480d
addq $0x10, %rsp
leaq 0xcbd1(%rip), %rdi      # 0x10c5c
xorl %eax, %eax
callq 0x1080
movl $0x3, %ecx
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
movl $0x1, %r8d
movq %rbx, %r9
leaq 0xcbdd(%rip), %r15      # 0x10c8c
pushq %r15
pushq %r14
callq 0x480d
addq $0x10, %rsp
leaq 0xcc02(%rip), %rdi      # 0x10cc5
xorl %eax, %eax
callq 0x1080
movl $0x1, %edx
movl $0x3, %ecx
movq %r12, %rdi
movq %r13, %rsi
movl $0x1, %r8d
movq %rbx, %r9
pushq %r15
pushq %r14
callq 0x480d
addq $0x10, %rsp
leaq 0xcbfe(%rip), %rdi      # 0x10cf5
xorl %eax, %eax
callq 0x1080
movl $0x2, %edx
movl $0x3, %ecx
movq %r12, %rdi
movq %r13, %rsi
movl $0x1, %r8d
movq %rbx, %r9
pushq %r15
pushq %r14
callq 0x480d
addq $0x10, %rsp
leaq 0xcbfa(%rip), %rdi      # 0x10d25
xorl %eax, %eax
callq 0x1080
movl $0x4, %ecx
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
movl $0x1, %r8d
movq %rbx, %r9
pushq %rbp
pushq %r14
callq 0x480d
addq $0x10, %rsp
leaq 0xcc33(%rip), %rdi      # 0x10d8e
xorl %eax, %eax
callq 0x1080
movl $0x1, %edx
movl $0x4, %ecx
movq %r12, %rdi
movq %r13, %rsi
movl $0x1, %r8d
movq %rbx, %r9
pushq %rbp
pushq %r14
callq 0x480d
addq $0x10, %rsp
leaq 0xcc30(%rip), %rdi      # 0x10dbe
xorl %eax, %eax
callq 0x1080
movl $0x2, %edx
movl $0x4, %ecx
movq %r12, %rdi
movq %r13, %rsi
movl $0x1, %r8d
movq %rbx, %r9
pushq %rbp
pushq %r14
callq 0x480d
addq $0x10, %rsp
leaq 0xcc2d(%rip), %rdi      # 0x10dee
xorl %eax, %eax
callq 0x1080
movl $0x3, %edx
movl $0x4, %ecx
movq %r12, %rdi
movq %r13, %rsi
movl $0x1, %r8d
movq %rbx, %r9
pushq %rbp
pushq %r14
callq 0x480d
addq $0x10, %rsp
movl $0xa, %edi
callq 0x1040
movq 0x118(%r12), %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
xorl %eax, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5f82(%rip), %rdi      # 0xa1b1
jmp 0x4238
leaq 0x5f44(%rip), %rdi      # 0xa17c
callq 0x1120
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4216