// File: /workspace/github_c_makefile_star2_O0/maandree[P]libkeccak/test.c
// Function: test_hex
static int
test_hex(void)
{
	const unsigned char bindata[] = {0x04, 0x2F, 0x12, 0x83, 0xFF, 0x80, 0xA3, 0x00};
	const char hexdata_upper[] = "042F1283FF80A300";
	const char hexdata_lower[] = "042f1283ff80a300";
	char hextest[2 * 8 + 1];

	printf("Testing libkeccak_behex_lower: ");
	libkeccak_behex_lower(hextest, (const char *)bindata, 8);
	if (!strcmp(hextest, hexdata_lower)) {
		printf("OK\n");
	} else {
		printf("Fail\n");
		return -1;
	}

	printf("Testing libkeccak_behex_upper: ");
	libkeccak_behex_upper(hextest, (const char *)bindata, 8);
	if (!strcmp(hextest, hexdata_upper)) {
		printf("OK\n");
	} else {
		printf("Fail\n");
		return -1;
	}

	printf("Testing libkeccak_unhex on uppercase: ");
	libkeccak_unhex(hextest, hexdata_upper);
	if (!memcmp(bindata, hextest, 8 * sizeof(char))) {
		printf("OK\n");
	} else {
		printf("Fail\n");
		return -1;
	}

	printf("Testing libkeccak_unhex on lowercase: ");
	libkeccak_unhex(hextest, hexdata_lower);
	if (!memcmp(bindata, hextest, 8 * sizeof(char))) {
		printf("OK\n");
	} else {
		printf("Fail\n");
		return -1;
	}

	printf("\n");
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq 0xbd94(%rip), %rax      # 0xd183
movq %rax, -0xc(%rbp)
movq 0x12d66(%rip), %rax     # 0x14160
movq %rax, -0x20(%rbp)
movq 0x12d63(%rip), %rax     # 0x14168
movq %rax, -0x18(%rbp)
movb 0x12d61(%rip), %al      # 0x14170
movb %al, -0x10(%rbp)
movq 0x12d67(%rip), %rax     # 0x14180
movq %rax, -0x40(%rbp)
movq 0x12d64(%rip), %rax     # 0x14188
movq %rax, -0x38(%rbp)
movb 0x12d62(%rip), %al      # 0x14190
movb %al, -0x30(%rbp)
leaq 0xbd53(%rip), %rdi      # 0xd18b
movb $0x0, %al
callq 0x1060
leaq -0x60(%rbp), %rdi
leaq -0xc(%rbp), %rsi
movl $0x8, %edx
callq 0xbe30
leaq -0x60(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x10a0
cmpl $0x0, %eax
jne 0x1473
leaq 0xbd41(%rip), %rdi      # 0xd1ab
movb $0x0, %al
callq 0x1060
jmp 0x148d
leaq 0xbd35(%rip), %rdi      # 0xd1af
movb $0x0, %al
callq 0x1060
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x15ba
leaq 0xbd21(%rip), %rdi      # 0xd1b5
movb $0x0, %al
callq 0x1060
leaq -0x60(%rbp), %rdi
leaq -0xc(%rbp), %rsi
movl $0x8, %edx
callq 0xbed0
leaq -0x60(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x10a0
cmpl $0x0, %eax
jne 0x14cf
leaq 0xbce5(%rip), %rdi      # 0xd1ab
movb $0x0, %al
callq 0x1060
jmp 0x14e9
leaq 0xbcd9(%rip), %rdi      # 0xd1af
movb $0x0, %al
callq 0x1060
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x15ba
leaq 0xbce5(%rip), %rdi      # 0xd1d5
movb $0x0, %al
callq 0x1060
leaq -0x60(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xc2c0
leaq -0xc(%rbp), %rax
leaq -0x60(%rbp), %rcx
movq (%rcx), %rcx
movq (%rax), %rax
subq %rcx, %rax
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x1530
leaq 0xbc84(%rip), %rdi      # 0xd1ab
movb $0x0, %al
callq 0x1060
jmp 0x1547
leaq 0xbc78(%rip), %rdi      # 0xd1af
movb $0x0, %al
callq 0x1060
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x15ba
leaq 0xbcae(%rip), %rdi      # 0xd1fc
movb $0x0, %al
callq 0x1060
leaq -0x60(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xc2c0
leaq -0xc(%rbp), %rax
leaq -0x60(%rbp), %rcx
movq (%rcx), %rcx
movq (%rax), %rax
subq %rcx, %rax
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x158e
leaq 0xbc26(%rip), %rdi      # 0xd1ab
movb $0x0, %al
callq 0x1060
jmp 0x15a5
leaq 0xbc1a(%rip), %rdi      # 0xd1af
movb $0x0, %al
callq 0x1060
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x15ba
leaq 0xba99(%rip), %rdi      # 0xd045
movb $0x0, %al
callq 0x1060
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)