// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]libcperciva/tests/crypto_aesctr/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_str);

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

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

	/* 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. */
	memcpy(plaintext_arr, testcase.plaintext_str, len);
	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 0x2110
movq %rax, %rcx
movq -0x60(%rbp), %rax
movq %rcx, -0x58(%rbp)
movq (%rax), %rdi
callq 0x2110
movq %rax, %rcx
shrq %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
cmpq $0x10, (%rax)
je 0x312d
movq -0x18(%rbp), %rax
cmpq $0x20, (%rax)
jne 0x312f
jmp 0x314e
leaq 0x5fb1(%rip), %rdi      # 0x90e7
leaq 0x5fd1(%rip), %rsi      # 0x910e
movl $0xd7, %edx
leaq 0x5fcc(%rip), %rcx      # 0x9115
callq 0x2090
cmpq $0x20, -0x58(%rbp)
ja 0x3157
jmp 0x3176
leaq 0x601b(%rip), %rdi      # 0x9179
leaq 0x5fa9(%rip), %rsi      # 0x910e
movl $0xd8, %edx
leaq 0x5fa4(%rip), %rcx      # 0x9115
callq 0x2090
movq -0x60(%rbp), %rax
movq (%rax), %rdi
leaq -0x50(%rbp), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
callq 0x7140
cmpl $0x0, %eax
je 0x31b9
jmp 0x3194
movq -0x60(%rbp), %rax
movq (%rax), %rsi
leaq 0x5ff3(%rip), %rdi      # 0x9195
movb $0x0, %al
callq 0x7b30
callq 0x2170
movl $0x0, (%rax)
jmp 0x326a
leaq -0x50(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x35c0
movq -0x10(%rbp), %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x31f3
jmp 0x31d8
leaq 0x5fc3(%rip), %rdi      # 0x91a2
movb $0x0, %al
callq 0x7b30
callq 0x2170
movl $0x0, (%rax)
jmp 0x326a
movq -0x60(%rbp), %rax
movq -0x20(%rbp), %rdi
movq 0x8(%rax), %rsi
movq -0x58(%rbp), %rdx
callq 0x21f0
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x58(%rbp), %rdx
callq 0x7140
cmpl $0x0, %eax
je 0x3247
jmp 0x3224
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rsi
leaq 0x5f62(%rip), %rdi      # 0x9195
movb $0x0, %al
callq 0x7b30
callq 0x2170
movl $0x0, (%rax)
jmp 0x325e
leaq -0x50(%rbp), %rdi
movl $0x20, %esi
callq 0x3300
movl $0x0, -0x4(%rbp)
jmp 0x3271
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x36d0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)