// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]libcperciva/tests/crypto_aesctr/main.c
// Function: selftest
static int
selftest(void)
{
	uint64_t nonce;
	size_t num_tests;
	int failures = 0;

	/* Test with nonce = 0. */
	num_tests = sizeof(tests_128) / sizeof(tests_128[0]);
	if (selftest_cases(tests_128, num_tests, 0))
		failures++;
	num_tests = sizeof(tests_256) / sizeof(tests_256[0]);
	if (selftest_cases(tests_256, num_tests, 0))
		failures++;

	/* Test with nonce = 0xfedcba9876543210. */
	nonce = 0xfedcba9876543210;
	num_tests = sizeof(tests_128_nonce) / sizeof(tests_128_nonce[0]);
	if (selftest_cases(tests_128_nonce, num_tests, nonce))
		failures++;
	num_tests = sizeof(tests_256_nonce) / sizeof(tests_256_nonce[0]);
	if (selftest_cases(tests_256_nonce, num_tests, nonce))
		failures++;

	/* Test with nonce = 0, re-using the same object. */
	num_tests = sizeof(tests_128) / sizeof(tests_128[0]);
	if (selftest_cases_singleobj(tests_128, num_tests, 0))
		failures++;
	num_tests = sizeof(tests_256) / sizeof(tests_256[0]);
	if (selftest_cases_singleobj(tests_256, num_tests, 0))
		failures++;

	/* Test with nonce = 0xfedcba9876543210. */
	nonce = 0xfedcba9876543210;
	num_tests = sizeof(tests_128_nonce) / sizeof(tests_128_nonce[0]);
	if (selftest_cases_singleobj(tests_128_nonce, num_tests, nonce))
		failures++;
	num_tests = sizeof(tests_256_nonce) / sizeof(tests_256_nonce[0]);
	if (selftest_cases_singleobj(tests_256_nonce, num_tests, nonce))
		failures++;

	/* Test unaligned access. */
	if (selftest_unaligned_access(16))
		failures++;
	if (selftest_unaligned_access(32))
		failures++;

	/* Report overall success to exit code. */
	if (failures)
		return (1);
	else
		return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0x1c(%rbp)
movq $0x9, -0x18(%rbp)
movq -0x18(%rbp), %rsi
leaq 0xa3ee(%rip), %rdi      # 0xca60
xorl %eax, %eax
movl %eax, %edx
callq 0x29e0
cmpq $0x0, %rax
je 0x268a
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq $0x9, -0x18(%rbp)
movq -0x18(%rbp), %rsi
leaq 0xa4a3(%rip), %rdi      # 0xcb40
xorl %eax, %eax
movl %eax, %edx
callq 0x29e0
cmpq $0x0, %rax
je 0x26b5
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movabsq $-0x123456789abcdf0, %rax # imm = 0xFEDCBA9876543210
movq %rax, -0x10(%rbp)
movq $0x9, -0x18(%rbp)
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq 0xa546(%rip), %rdi      # 0xcc20
callq 0x29e0
cmpq $0x0, %rax
je 0x26ee
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq $0x9, -0x18(%rbp)
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq 0xa5fb(%rip), %rdi      # 0xcd00
callq 0x29e0
cmpq $0x0, %rax
je 0x2719
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq $0x9, -0x18(%rbp)
movq -0x18(%rbp), %rsi
leaq 0xa334(%rip), %rdi      # 0xca60
xorl %eax, %eax
movl %eax, %edx
callq 0x2bc0
cmpq $0x0, %rax
je 0x2744
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq $0x9, -0x18(%rbp)
movq -0x18(%rbp), %rsi
leaq 0xa3e9(%rip), %rdi      # 0xcb40
xorl %eax, %eax
movl %eax, %edx
callq 0x2bc0
cmpq $0x0, %rax
je 0x276f
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movabsq $-0x123456789abcdf0, %rax # imm = 0xFEDCBA9876543210
movq %rax, -0x10(%rbp)
movq $0x9, -0x18(%rbp)
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq 0xa48c(%rip), %rdi      # 0xcc20
callq 0x2bc0
cmpq $0x0, %rax
je 0x27a8
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq $0x9, -0x18(%rbp)
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq 0xa541(%rip), %rdi      # 0xcd00
callq 0x2bc0
cmpq $0x0, %rax
je 0x27d3
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl $0x10, %edi
callq 0x2e90
cmpq $0x0, %rax
je 0x27ec
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl $0x20, %edi
callq 0x2e90
cmpq $0x0, %rax
je 0x2805
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x2814
movl $0x1, -0x4(%rbp)
jmp 0x281b
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)