// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]libcperciva/tests/crypto_aes/main.c
// Function: parse_testcase
static int
parse_testcase(const struct testcase testcase,
    struct crypto_aes_key ** key_exp_p, size_t * keylen_p,
    uint8_t plaintext_arr[static MAX_PLAINTEXT_LENGTH],
    uint8_t ciphertext_arr[static MAX_PLAINTEXT_LENGTH])
{
	uint8_t key_unexpanded[32]; /* We will use 16 or 32 of these bytes. */
	const size_t len = strlen(testcase.plaintext_hex) / 2;

	/* Determine key length. */
	*keylen_p = strlen(testcase.keytext_hex) / 2;

	/* Sanity check. */
	assert((*keylen_p == 16) || (*keylen_p == 32));
	assert(len == 16);

	/* Prepare the key. */
	if (unhexify(testcase.keytext_hex, key_unexpanded, *keylen_p)) {
		warn0("unhexify(%s)", testcase.keytext_hex);
		goto err0;
	}
	if ((*key_exp_p = crypto_aes_key_expand(key_unexpanded, *keylen_p))
	    == NULL) {
		warn0("crypto_aes_key_expand");
		goto err0;
	}

	/* Prepare the arrays. */
	if (unhexify(testcase.plaintext_hex, plaintext_arr, len)) {
		warn0("unhexify(%s)", testcase.plaintext_hex);
		goto err1;
	}
	if (unhexify(testcase.ciphertext_hex, ciphertext_arr, len)) {
		warn0("unhexify(%s)", testcase.ciphertext_hex);
		goto err1;
	}

	/* Clean up.  Irrelevant for a test, but it's a good habit. */
	insecure_memzero(key_unexpanded, 32);

	/* Success! */
	return (0);

err1:
	crypto_aes_key_free(*key_exp_p);
err0:
	/* Failure! */
	return (1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq 0x8(%rax), %rdi
callq 0x10f0
movq %rax, %rcx
movq -0x60(%rbp), %rax
shrq %rcx
movq %rcx, -0x58(%rbp)
movq (%rax), %rdi
callq 0x10f0
movq %rax, %rcx
shrq %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
cmpq $0x10, (%rax)
je 0x19d0
movq -0x18(%rbp), %rax
cmpq $0x20, (%rax)
jne 0x19d2
jmp 0x19f1
leaq 0x46b3(%rip), %rdi      # 0x608c
leaq 0x46d3(%rip), %rsi      # 0x60b3
movl $0x7d, %edx
leaq 0x46ce(%rip), %rcx      # 0x60ba
callq 0x1080
cmpq $0x10, -0x58(%rbp)
jne 0x19fa
jmp 0x1a19
leaq 0x47c6(%rip), %rdi      # 0x61c7
leaq 0x46ab(%rip), %rsi      # 0x60b3
movl $0x7e, %edx
leaq 0x46a6(%rip), %rcx      # 0x60ba
callq 0x1080
movq -0x60(%rbp), %rax
movq (%rax), %rdi
leaq -0x50(%rbp), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
callq 0x4ec0
cmpl $0x0, %eax
je 0x1a5c
jmp 0x1a37
movq -0x60(%rbp), %rax
movq (%rax), %rsi
leaq 0x46d9(%rip), %rdi      # 0x611e
movb $0x0, %al
callq 0x58b0
callq 0x1150
movl $0x0, (%rax)
jmp 0x1b3a
leaq -0x50(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x1fe0
movq -0x10(%rbp), %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x1a99
jmp 0x1a7b
leaq 0x46a9(%rip), %rdi      # 0x612b
movb $0x0, %al
callq 0x58b0
callq 0x1150
movl $0x0, (%rax)
jmp 0x1b3a
movq -0x60(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x58(%rbp), %rdx
callq 0x4ec0
cmpl $0x0, %eax
je 0x1ad8
jmp 0x1ab5
movq -0x60(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x465a(%rip), %rdi      # 0x611e
movb $0x0, %al
callq 0x58b0
callq 0x1150
movl $0x0, (%rax)
jmp 0x1b2e
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x58(%rbp), %rdx
callq 0x4ec0
cmpl $0x0, %eax
je 0x1b17
jmp 0x1af4
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rsi
leaq 0x461b(%rip), %rdi      # 0x611e
movb $0x0, %al
callq 0x58b0
callq 0x1150
movl $0x0, (%rax)
jmp 0x1b2e
leaq -0x50(%rbp), %rdi
movl $0x20, %esi
callq 0x1ca0
movl $0x0, -0x4(%rbp)
jmp 0x1b41
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x20f0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)