// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
leaq 0x14(%rsp), %r11
movl $0x746567, (%r11)       # imm = 0x746567
leaq 0x10(%rsp), %r14
movl $0x746573, (%r14)       # imm = 0x746573
leaq 0xc(%rsp), %rbx
movl $0x6c6564, (%rbx)       # imm = 0x6C6564
leaq 0x40(%rsp), %r8
movw $0x68, 0x4(%r8)
movl $0x7375706c, (%r8)      # imm = 0x7375706C
xorl %r15d, %r15d
leaq 0x38(%rsp), %r10
movb %r15b, 0x4(%r10)
movl $0x706f706c, (%r10)     # imm = 0x706F706C
leaq 0x48(%rsp), %r9
movl $0x786564, 0x3(%r9)     # imm = 0x786564
movl $0x646e696c, (%r9)      # imm = 0x646E696C
leaq 0x30(%rsp), %rdi
movb %r15b, 0x4(%rdi)
movl $0x74656768, (%rdi)     # imm = 0x74656768
leaq 0x28(%rsp), %rsi
movb %r15b, 0x4(%rsi)
movl $0x74657368, (%rsi)     # imm = 0x74657368
leaq 0x20(%rsp), %rdx
movb %r15b, 0x4(%rdx)
movl $0x6e656c68, (%rdx)     # imm = 0x6E656C68
leaq 0x18(%rsp), %rcx
movb %r15b, 0x4(%rcx)
movl $0x65707974, (%rcx)     # imm = 0x65707974
leaq 0x8(%rsp), %rax
movb %r15b, 0x2(%rax)
movw $0x6264, (%rax)         # imm = 0x6264
movq %r11, 0x50(%rsp)
pushq $0x2
popq %r11
movl %r11d, 0x58(%rsp)
leaq 0x1b2(%rip), %r15       # 0x189f
movq %r15, 0x60(%rsp)
movq %r14, 0x68(%rsp)
pushq $0x3
popq %rbp
movl %ebp, 0x70(%rsp)
leaq 0x229(%rip), %r14       # 0x192e
movq %r14, 0x78(%rsp)
movq %rbx, 0x80(%rsp)
movl %r11d, 0x88(%rsp)
leaq 0x2fa(%rip), %rbx       # 0x1a1b
movq %rbx, 0x90(%rsp)
movq %r8, 0x98(%rsp)
movl $0xfffffffd, 0xa0(%rsp) # imm = 0xFFFFFFFD
leaq 0x333(%rip), %r8        # 0x1a76
movq %r8, 0xa8(%rsp)
movq %r10, 0xb0(%rsp)
movl %r11d, 0xb8(%rsp)
leaq 0x3da(%rip), %r8        # 0x1b3c
movq %r8, 0xc0(%rsp)
movq %r9, 0xc8(%rsp)
movl %ebp, 0xd0(%rsp)
leaq 0x495(%rip), %r8        # 0x1c15
movq %r8, 0xd8(%rsp)
movq %rdi, 0xe0(%rsp)
movl %ebp, 0xe8(%rsp)
leaq 0x5d3(%rip), %rdi       # 0x1d71
movq %rdi, 0xf0(%rsp)
movq %rsi, 0xf8(%rsp)
movl $0xfffffffc, 0x100(%rsp) # imm = 0xFFFFFFFC
leaq 0x673(%rip), %rsi       # 0x1e33
movq %rsi, 0x108(%rsp)
movq %rdx, 0x110(%rsp)
movl %r11d, 0x118(%rsp)
leaq 0x7ff(%rip), %rdx       # 0x1fde
movq %rdx, 0x120(%rsp)
movq %rcx, 0x128(%rsp)
movl %r11d, 0x130(%rsp)
leaq 0x8c9(%rip), %rcx       # 0x20c7
movq %rcx, 0x138(%rsp)
movq %rax, 0x140(%rsp)
movl %ebp, 0x148(%rsp)
leaq 0x941(%rip), %rax       # 0x215d
movq %rax, 0x150(%rsp)
xorl %edi, %edi
xorl %esi, %esi
callq 0x2863
movq %rax, %rbx
pushq $0x10
popq %r12
pushq $0x18
popq %r14
cmpq $0x118, %r12            # imm = 0x118
je 0x187e
movq 0x40(%rsp,%r12), %rdi
movl 0x48(%rsp,%r12), %ebp
movq 0x50(%rsp,%r12), %r13
callq 0x3409
movq %rax, %r15
movq %r14, %rdi
callq 0x3564
movl %ebp, 0x8(%rax)
movq %r15, (%rax)
movq %r13, 0x10(%rax)
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x2c6c
addq $0x18, %r12
jmp 0x1838
leaq 0x38e9(%rip), %rdi      # 0x516e
callq 0x1200
movq %rbx, %rax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq