// File: /workspace/github_c_makefile_star2_O3/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
movq 0x3233c(%rip), %r14     # 0x3efc0
leaq -0x58(%rbp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0xbc84
leaq 0x2aa(%rip), %rax       # 0xcf46
movq %rax, 0x28(%rbx)
movq %rax, 0x30(%rbx)
movq %r14, 0x38(%rbx)
movq %r14, 0x40(%rbx)
leaq 0x2886f(%rip), %r14     # 0x35522
leaq 0x249f1(%rip), %rdx     # 0x316ab
movq %rbx, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0xc56c
leaq 0x24203(%rip), %rsi     # 0x30ed1
leaq 0x24bfb(%rip), %rdx     # 0x318d0
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0xc56c
leaq 0x2452f(%rip), %rsi     # 0x31215
leaq 0x24174(%rip), %rdx     # 0x30e61
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0xc56c
leaq -0x6d0(%rip), %rsi      # 0xc62e
movq %rbx, %rdi
movq %r14, %rdx
callq 0xbf6e
testq %rax, %rax
je 0xcd2b
movq 0x8(%rax), %rax
testq %rax, %rax
je 0xcd2b
movq 0x10(%rax), %rax
testq %rax, %rax
je 0xcd2b
cmpb $0x31, (%rax)
jne 0xcd2b
cmpb $0x0, 0x1(%rax)
je 0xcd45
leaq 0x21015(%rip), %rdi     # 0x2dd47
leaq 0x213ab(%rip), %rdx     # 0x2e0e4
movl $0x130, %esi            # imm = 0x130
xorl %eax, %eax
callq 0xcf58
leaq -0x71e(%rip), %rsi      # 0xc62e
leaq 0x2417e(%rip), %rdx     # 0x30ed1
leaq -0x58(%rbp), %rdi
callq 0xbf6e
testq %rax, %rax
je 0xcd7e
movq 0x8(%rax), %rax
testq %rax, %rax
je 0xcd7e
movq 0x10(%rax), %rax
testq %rax, %rax
je 0xcd7e
cmpb $0x32, (%rax)
jne 0xcd7e
cmpb $0x0, 0x1(%rax)
je 0xcd98
leaq 0x20fc2(%rip), %rdi     # 0x2dd47
leaq 0x21358(%rip), %rdx     # 0x2e0e4
movl $0x135, %esi            # imm = 0x135
xorl %eax, %eax
callq 0xcf58
leaq -0x771(%rip), %rsi      # 0xc62e
leaq 0x2446f(%rip), %rdx     # 0x31215
leaq -0x58(%rbp), %rdi
callq 0xbf6e
testq %rax, %rax
je 0xcdd1
movq 0x8(%rax), %rax
testq %rax, %rax
je 0xcdd1
movq 0x10(%rax), %rax
testq %rax, %rax
je 0xcdd1
cmpb $0x33, (%rax)
jne 0xcdd1
cmpb $0x0, 0x1(%rax)
je 0xcdeb
leaq 0x20f6f(%rip), %rdi     # 0x2dd47
leaq 0x21305(%rip), %rdx     # 0x2e0e4
movl $0x13a, %esi            # imm = 0x13A
xorl %eax, %eax
callq 0xcf58
leaq -0x7c4(%rip), %rsi      # 0xc62e
leaq 0x212f4(%rip), %rdx     # 0x2e0ed
leaq -0x58(%rbp), %rdi
callq 0xbf6e
testq %rax, %rax
je 0xce31
movq 0x8(%rax), %rax
testq %rax, %rax
je 0xce31
cmpq $0x0, 0x10(%rax)
je 0xce31
leaq 0x20f29(%rip), %rdi     # 0x2dd47
leaq 0x212bf(%rip), %rdx     # 0x2e0e4
movl $0x13f, %esi            # imm = 0x13F
xorl %eax, %eax
callq 0xcf58
leaq 0x24099(%rip), %rbx     # 0x30ed1
leaq 0x212bd(%rip), %rdx     # 0x2e0fc
leaq -0x58(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0xc56c
leaq -0x829(%rip), %rsi      # 0xc62e
movq %r14, %rdi
movq %rbx, %rdx
callq 0xbf6e
testq %rax, %rax
je 0xce8a
movq 0x8(%rax), %rax
testq %rax, %rax
je 0xce8a
movq 0x10(%rax), %rax
testq %rax, %rax
je 0xce8a
cmpb $0x32, (%rax)
jne 0xce8a
cmpb $0x30, 0x1(%rax)
jne 0xce8a
cmpb $0x0, 0x2(%rax)
je 0xcea4
leaq 0x20eb6(%rip), %rdi     # 0x2dd47
leaq 0x2124c(%rip), %rdx     # 0x2e0e4
movl $0x147, %esi            # imm = 0x147
xorl %eax, %eax
callq 0xcf58
leaq -0x87d(%rip), %rsi      # 0xc62e
leaq 0x2401f(%rip), %rdx     # 0x30ed1
leaq -0x58(%rbp), %rdi
callq 0xbf6e
testq %rax, %rax
je 0xcec7
cmpq $0x0, 0x8(%rax)
jne 0xcee1
leaq 0x20e79(%rip), %rdi     # 0x2dd47
leaq 0x2120f(%rip), %rdx     # 0x2e0e4
movl $0x14c, %esi            # imm = 0x14C
xorl %eax, %eax
callq 0xcf58
leaq 0x23fe9(%rip), %rbx     # 0x30ed1
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xc765
leaq -0x8d0(%rip), %rsi      # 0xc62e
movq %r14, %rdi
movq %rbx, %rdx
callq 0xbf6e
testq %rax, %rax
je 0xcf2f
cmpq $0x0, 0x8(%rax)
je 0xcf2f
leaq 0x20e2b(%rip), %rdi     # 0x2dd47
leaq 0x211c1(%rip), %rdx     # 0x2e0e4
movl $0x153, %esi            # imm = 0x153
xorl %eax, %eax
callq 0xcf58
leaq -0x58(%rbp), %rdi
movl $0x1, %esi
callq 0xbd25
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq