// File: TTLIUJJ[P]acker_redis/command.cpp
// Function: initCommandTable()
dict *initCommandTable()
{
	char k1[4] = "get";
	char k2[4] = "set";
	char k3[4] = "del";
	char k4[6] = "lpush";
	char k5[5] = "lpop";
	char k6[7] = "lindex";
	char k7[5] = "hget";
	char k8[5] = "hset";
	char k9[5] = "hlen";
	char k10[5]= "type";
	char k11[3] = "db";
	redisCommand cmdtable[11] = {
		{ k1, 2, &getCommand },
		{ k2, 3, &setCommand },
		{ k3, 2, &delCommand },
		{ k4, -3, &lpushCommand },
		{ k5, 2, &lpopCommand },
		{ k6, 3, &lindexCommand },
		{ k7, 3, &hgetCommand },
		{ k8, -4 ,&hsetCommand },
		{ k9, 2 ,&hlenCommand },
		{ k10, 2, &typeCommand },
		{ k11, 3, &dbCommand},
	};
	dict *d = dictCreate(NULL, NULL);

	for (size_t i = 0; i < 11; ++i) {
		redisCommand cmd = cmdtable[i];
		sds k = sdsNew(cmd.name);
		redisCommand *v = (redisCommand *)zmalloc(sizeof(struct redisCommand));
		v->arbity = cmd.arbity;
		v->name = k;
		v->proc = cmd.proc;

		dictAdd(d, k, v);
	}
	printf("========= After init CommandTabel =========\n");
	return d;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movl 0x563a(%rip), %eax      # 0x701b
movl %eax, -0x4(%rbp)
movl 0x5636(%rip), %eax      # 0x7020
movl %eax, -0x8(%rbp)
movl 0x5611(%rip), %eax      # 0x7004
movl %eax, -0xc(%rbp)
movl 0x560c(%rip), %eax      # 0x7008
movl %eax, -0x12(%rbp)
movw 0x5606(%rip), %ax       # 0x700c
movw %ax, -0xe(%rbp)
movl 0x55fe(%rip), %eax      # 0x700e
movl %eax, -0x17(%rbp)
movb 0x55f9(%rip), %al       # 0x7012
movb %al, -0x13(%rbp)
movl 0x55f1(%rip), %eax      # 0x7013
movl %eax, -0x1e(%rbp)
movw 0x55eb(%rip), %ax       # 0x7017
movw %ax, -0x1a(%rbp)
movb 0x55e3(%rip), %al       # 0x7019
movb %al, -0x18(%rbp)
movl 0x55db(%rip), %eax      # 0x701a
movl %eax, -0x23(%rbp)
movb 0x55d6(%rip), %al       # 0x701e
movb %al, -0x1f(%rbp)
movl 0x55ce(%rip), %eax      # 0x701f
movl %eax, -0x28(%rbp)
movb 0x55c9(%rip), %al       # 0x7023
movb %al, -0x24(%rbp)
movl 0x55c1(%rip), %eax      # 0x7024
movl %eax, -0x2d(%rbp)
movb 0x55bc(%rip), %al       # 0x7028
movb %al, -0x29(%rbp)
movl 0x55b4(%rip), %eax      # 0x7029
movl %eax, -0x32(%rbp)
movb 0x55af(%rip), %al       # 0x702d
movb %al, -0x2e(%rbp)
movw 0x55a6(%rip), %ax       # 0x702e
movw %ax, -0x35(%rbp)
movb 0x559e(%rip), %al       # 0x7030
movb %al, -0x33(%rbp)
leaq -0x4(%rbp), %rax
movq %rax, -0x140(%rbp)
movl $0x2, -0x138(%rbp)
leaq 0x24f(%rip), %rax       # 0x1d00
movq %rax, -0x130(%rbp)
leaq -0x8(%rbp), %rax
movq %rax, -0x128(%rbp)
movl $0x3, -0x120(%rbp)
leaq 0x33c(%rip), %rax       # 0x1e10
movq %rax, -0x118(%rbp)
leaq -0xc(%rbp), %rax
movq %rax, -0x110(%rbp)
movl $0x2, -0x108(%rbp)
leaq 0x499(%rip), %rax       # 0x1f90
movq %rax, -0x100(%rbp)
leaq -0x12(%rbp), %rax
movq %rax, -0xf8(%rbp)
movl $0xfffffffd, -0xf0(%rbp) # imm = 0xFFFFFFFD
leaq 0x546(%rip), %rax       # 0x2060
movq %rax, -0xe8(%rbp)
leaq -0x17(%rbp), %rax
movq %rax, -0xe0(%rbp)
movl $0x2, -0xd8(%rbp)
leaq 0x663(%rip), %rax       # 0x21a0
movq %rax, -0xd0(%rbp)
leaq -0x1e(%rbp), %rax
movq %rax, -0xc8(%rbp)
movl $0x3, -0xc0(%rbp)
leaq 0x7c0(%rip), %rax       # 0x2320
movq %rax, -0xb8(%rbp)
leaq -0x23(%rbp), %rax
movq %rax, -0xb0(%rbp)
movl $0x3, -0xa8(%rbp)
leaq 0x98d(%rip), %rax       # 0x2510
movq %rax, -0xa0(%rbp)
leaq -0x28(%rbp), %rax
movq %rax, -0x98(%rbp)
movl $0xfffffffc, -0x90(%rbp) # imm = 0xFFFFFFFC
leaq 0xaea(%rip), %rax       # 0x2690
movq %rax, -0x88(%rbp)
leaq -0x2d(%rbp), %rax
movq %rax, -0x80(%rbp)
movl $0x2, -0x78(%rbp)
leaq 0xd7d(%rip), %rax       # 0x2940
movq %rax, -0x70(%rbp)
leaq -0x32(%rbp), %rax
movq %rax, -0x68(%rbp)
movl $0x2, -0x60(%rbp)
leaq 0xe93(%rip), %rax       # 0x2a70
movq %rax, -0x58(%rbp)
leaq -0x35(%rbp), %rax
movq %rax, -0x50(%rbp)
movl $0x3, -0x48(%rbp)
leaq 0xfe9(%rip), %rax       # 0x2be0
movq %rax, -0x40(%rbp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, %rdi
callq 0x3be0
movq %rax, -0x148(%rbp)
movq $0x0, -0x150(%rbp)
cmpq $0xb, -0x150(%rbp)
jae 0x1ce1
leaq -0x140(%rbp), %rax
imulq $0x18, -0x150(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x168(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x160(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x158(%rbp)
movq -0x168(%rbp), %rdi
callq 0x53b0
movq %rax, -0x170(%rbp)
movl $0x18, %edi
callq 0x5710
movq %rax, -0x178(%rbp)
movl -0x160(%rbp), %ecx
movq -0x178(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x170(%rbp), %rcx
movq -0x178(%rbp), %rax
movq %rcx, (%rax)
movq -0x158(%rbp), %rcx
movq -0x178(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x148(%rbp), %rdi
movq -0x170(%rbp), %rsi
movq -0x178(%rbp), %rdx
callq 0x4520
movq -0x150(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x150(%rbp)
jmp 0x1c19
leaq 0x5349(%rip), %rdi      # 0x7031
movb $0x0, %al
callq 0x1030
movq -0x148(%rbp), %rax
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
nop