// File: /workspace/github_c_makefile_star2_O2/Ihsoh[P]ilang/map.c
// Function: map_test
void map_test(void) {
	Map map;

	map_init(&map, _test_str_comparer, _test_str_comparer, free, free);

	map_set(&map, "A", "1", false);
	map_set(&map, "B", "2", false);
	map_set(&map, "C", "3", false);

	void *value = NULL;

	value = map_get(&map, "A");
	MYASSERT(
		value != NULL && strcmp(value, "1") == 0,
		"TEST map"
	);
	value = map_get(&map, "B");
	MYASSERT(
		value != NULL && strcmp(value, "2") == 0,
		"TEST map"
	);
	value = map_get(&map, "C");
	MYASSERT(
		value != NULL && strcmp(value, "3") == 0,
		"TEST map"
	);
	value = map_get(&map, "__NOT_EXISTS__");
	MYASSERT(
		value == NULL,
		"TEST map"
	);

	map_set(&map, "B", "20", false);

	value = map_get(&map, "B");
	MYASSERT(
		value != NULL && strcmp(value, "20") == 0,
		"TEST map"
	);

	MYASSERT(
		map_exists_key(&map, "B"),
		"TEST map"
	);

	map_remove(&map, "B", false, false);

	MYASSERT(
		!map_exists_key(&map, "B"),
		"TEST map"
	);

	map_free(&map, false, false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
leaq 0x219(%rip), %rdx       # 0xcb74
movq 0x3165e(%rip), %rcx     # 0x3dfc0
leaq -0x58(%rbp), %rbx
movq %rbx, %rdi
movq %rdx, %rsi
movq %rcx, %r8
callq 0xc13c
leaq 0x27c36(%rip), %r14     # 0x345b1
leaq 0x23d39(%rip), %rdx     # 0x306bb
movq %rbx, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0xc29d
leaq 0x2354b(%rip), %rsi     # 0x2fee1
leaq 0x23f43(%rip), %rdx     # 0x308e0
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0xc29d
leaq 0x23877(%rip), %rsi     # 0x30225
leaq 0x234bc(%rip), %rdx     # 0x2fe71
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0xc29d
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc417
testq %rax, %rax
je 0xc9da
cmpb $0x31, (%rax)
jne 0xc9da
cmpb $0x0, 0x1(%rax)
je 0xc9f4
leaq 0x20366(%rip), %rdi     # 0x2cd47
leaq 0x206fc(%rip), %rdx     # 0x2d0e4
movl $0x130, %esi            # imm = 0x130
xorl %eax, %eax
callq 0xcb84
leaq 0x234e6(%rip), %rsi     # 0x2fee1
leaq -0x58(%rbp), %rdi
callq 0xc417
testq %rax, %rax
je 0xca14
cmpb $0x32, (%rax)
jne 0xca14
cmpb $0x0, 0x1(%rax)
je 0xca2e
leaq 0x2032c(%rip), %rdi     # 0x2cd47
leaq 0x206c2(%rip), %rdx     # 0x2d0e4
movl $0x135, %esi            # imm = 0x135
xorl %eax, %eax
callq 0xcb84
leaq 0x237f0(%rip), %rsi     # 0x30225
leaq -0x58(%rbp), %rdi
callq 0xc417
testq %rax, %rax
je 0xca4e
cmpb $0x33, (%rax)
jne 0xca4e
cmpb $0x0, 0x1(%rax)
je 0xca68
leaq 0x202f2(%rip), %rdi     # 0x2cd47
leaq 0x20688(%rip), %rdx     # 0x2d0e4
movl $0x13a, %esi            # imm = 0x13A
xorl %eax, %eax
callq 0xcb84
leaq 0x2067e(%rip), %rsi     # 0x2d0ed
leaq -0x58(%rbp), %rdi
callq 0xc417
testq %rax, %rax
je 0xca97
leaq 0x202c3(%rip), %rdi     # 0x2cd47
leaq 0x20659(%rip), %rdx     # 0x2d0e4
movl $0x13f, %esi            # imm = 0x13F
xorl %eax, %eax
callq 0xcb84
leaq 0x23443(%rip), %rbx     # 0x2fee1
leaq 0x20657(%rip), %rdx     # 0x2d0fc
leaq -0x58(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0xc29d
movq %r14, %rdi
movq %rbx, %rsi
callq 0xc417
testq %rax, %rax
je 0xcad7
cmpb $0x32, (%rax)
jne 0xcad7
cmpb $0x30, 0x1(%rax)
jne 0xcad7
cmpb $0x0, 0x2(%rax)
je 0xcaf1
leaq 0x20269(%rip), %rdi     # 0x2cd47
leaq 0x205ff(%rip), %rdx     # 0x2d0e4
movl $0x147, %esi            # imm = 0x147
xorl %eax, %eax
callq 0xcb84
leaq 0x233e9(%rip), %rsi     # 0x2fee1
leaq -0x58(%rbp), %rdi
callq 0xc52c
testb %al, %al
jne 0xcb1f
leaq 0x2023b(%rip), %rdi     # 0x2cd47
leaq 0x205d1(%rip), %rdx     # 0x2d0e4
movl $0x14c, %esi            # imm = 0x14C
xorl %eax, %eax
callq 0xcb84
leaq 0x233bb(%rip), %rbx     # 0x2fee1
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xc477
movq %r14, %rdi
movq %rbx, %rsi
callq 0xc52c
testb %al, %al
je 0xcb5e
leaq 0x201fc(%rip), %rdi     # 0x2cd47
leaq 0x20592(%rip), %rdx     # 0x2d0e4
movl $0x153, %esi            # imm = 0x153
xorl %eax, %eax
callq 0xcb84
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xc214
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq