LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/rafa9811[P]theIndiependenceGame/interface.c
// Function: interface_blankSpace
int interface_blankSpace(Interact *interact, Interface* interface){
  int px,py;
  if(!interact||!interface) return -1;
  px=interact_getPx(interact);
  py=interact_getPy(interact);
  if(px<0||py<0||px>XLIMIT||py>YLIMIT) return -1;
  win_write_char_at(interface->screen,py,px,' ');
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
pushq $-0x1
popq %rbp
orb %al, %cl
jne 0x509e
movq %rsi, %rbx
movq %rdi, %r15
callq 0x42fa
movl %eax, %r14d
movq %r15, %rdi
callq 0x430a
cmpl $0x51, %r14d
setae %cl
cmpl $0x25, %eax
setae %dl
orb %cl, %dl
jne 0x509e
movq (%rbx), %rdi
pushq $0x20
popq %rcx
movl %eax, %esi
movl %r14d, %edx
callq 0x3e8a
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/rafa9811[P]theIndiependenceGame/interface.c
// Function: interface_printClock
void interface_printClock(sc_rectangle *clk,double remaining, short inDanger){
  char line[STAT_LINE];
  if(inDanger < 0 || inDanger > 1) return;
  win_cls(clk);
  if(inDanger == 0){
    if(remaining>0){
      if(((int)remaining)%60<10) sprintf(line,"Remaining time: %d:0%d\n",(int)remaining/60,(int)remaining%60);
      else sprintf(line,"Remaining time: %d:%d\n",(int)remaining/60,(int)remaining%60);
    }
    else sprintf(line,"TIME'S UP!");
  }
  else{
    if(remaining>0){
      if(((int)remaining)%60<10) sprintf(line,"Time until detention: %d:0%d\n",(int)remaining/60,(int)remaining%60);
      else sprintf(line,"Time until detention: %d:%d\n",(int)remaining/60,(int)remaining%60);
    }
    else sprintf(line,"ARRESTED!");
  }
  win_write_line_at(clk,1,2,line);
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x38, %rsp
movl %esi, %ebp
cmpw $0x1, %bp
ja 0x54be
movq %rdi, %rbx
movsd %xmm0, 0x8(%rsp)
callq 0x3c71
xorpd %xmm0, %xmm0
testw %bp, %bp
je 0x5436
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x545c
cvttsd2si %xmm1, %eax
pushq $0x3c
popq %rcx
cltd
idivl %ecx
movl %edx, %ecx
cmpl $0x9, %edx
jg 0x548d
leaq 0x1752(%rip), %rsi      # 0x6b86
jmp 0x549d
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x5474
cvttsd2si %xmm1, %eax
pushq $0x3c
popq %rcx
cltd
idivl %ecx
movl %edx, %ecx
cmpl $0x9, %edx
jg 0x5496
leaq 0x16f2(%rip), %rsi      # 0x6b4c
jmp 0x549d
movabsq $0x4445545345525241, %rax # imm = 0x4445545345525241
movq %rax, 0x10(%rsp)
movw $0x21, 0x18(%rsp)
jmp 0x54ab
movabsq $0x55205327454d4954, %rax # imm = 0x55205327454D4954
movq %rax, 0x10(%rsp)
movl $0x215055, 0x17(%rsp)   # imm = 0x215055
jmp 0x54ab
leaq 0x1710(%rip), %rsi      # 0x6ba4
jmp 0x549d
leaq 0x16c7(%rip), %rsi      # 0x6b64
leaq 0x10(%rsp), %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x11b0
pushq $0x1
popq %rsi
pushq $0x2
popq %rdx
leaq 0x10(%rsp), %rcx
movq %rbx, %rdi
callq 0x3d9a
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/rafa9811[P]theIndiependenceGame/interface.c
// Function: interface_start
void interface_start(Interact *interact, Interface* interface){
  if(!interact || !interface) exit(-1);
  PRINT_DIALOG;
  PRINT_STAT;
  PRINT_SCREEN;
  PRINT_PLAYER;
  return;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x5509
movq %rsi, %rbx
testq %rsi, %rsi
je 0x5509
movq %rdi, %r14
movq %rbx, %rsi
callq 0x4c62
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4d3a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4f2b
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4fda
pushq $-0x1
popq %rdi
callq 0x11c0
// File: /workspace/github_c_makefile_star2_O2/rafa9811[P]theIndiependenceGame/interface.c
// Function: interface_play
void interface_play(Interact *interact, Interface* interface, State state){
  if(!interact || !interface || state > MEETING3) exit(-1);
  switch(state){
    case(QUIT1):{
      PRINT_DIALOG;
      PRINT_STAT;
      return;
    }
    case(QUIT2):{
      return;
    }
    case(NOTHING):{
      PRINT_STAT;
      return;
    }
    case(MOVE):{
      PRINT_PLAYER;
      PRINT_SPACE;
      PRINT_STAT;
      return;
    }
    case(PICK):{
      PRINT_DIALOG;
      PRINT_STAT;
      PRINT_SCREEN;
      PRINT_PLAYER;
      return;
    }
    case(SCREEN):{
      PRINT_DIALOG;
      PRINT_STAT;
      PRINT_SCREEN;
      PRINT_PLAYER;
      return;
    }
    case(TALK):{
      PRINT_DIALOG;
      PRINT_STAT;
      return;
    }
    case(INVENTORY):{
      PRINT_DIALOG;
      PRINT_INVENTORY;
      return;
    }
    case(SHOP):{
      PRINT_DIALOG;
      PRINT_SHOP;
      return;
    }
    case(MEETING1):{
      PRINT_DIALOG;
      PRINT_STAT;
      return;
    }
    case(MEETING2):{
      PRINT_DIALOG;
      PRINT_STAT;
      return;
    }
    case(MEETING3):{
      PRINT_DIALOG;
      PRINT_STAT;
      return;
    }
    default:exit(-1);
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x55f2
movq %rsi, %rbx
testq %rsi, %rsi
je 0x55f2
cmpl $0xc, %edx
jae 0x55f2
movq %rdi, %r14
movl %edx, %eax
leaq 0x152d(%rip), %rcx      # 0x6a6c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4c62
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4d3a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4c62
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4d3a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4f2b
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4fda
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4c62
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x523b
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4fda
movq %r14, %rdi
movq %rbx, %rsi
callq 0x504b
jmp 0x5553
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4c62
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x50ab
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $-0x1
popq %rdi
callq 0x11c0
// File: /workspace/github_c_makefile_star2_O2/lh3[P]pre-pe/pre-lianti.c
// Function: merge_base
static inline int merge_base(int max_qual, char fc, char fq, char rc, char rq)
{
	int y;
	if (fc == rc) {
		int q = fq > rq? (fq - 33) + (rq - 33) / 2 : (rq - 33) + (fq - 33) / 2;
		y = toupper(fc) | (33 + (q < max_qual? q : max_qual)) << 8;
	} else {
		if (fq > rq) y = toupper(fc) | (33 + (fq - rq)) << 8;
		else y = toupper(rc) | (33 + (rq - fq)) << 8;
	}
	return y;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %r14d
movl %esi, %ebp
cmpb %r14b, %bpl
jne 0x4471
movl %edi, %ebx
movzbl %dl, %eax
movzbl %r8b, %ecx
cmpb %r8b, %dl
movl %ecx, %edx
cmovgl %eax, %edx
cmovll %eax, %ecx
movsbl %dl, %esi
movsbl %cl, %eax
addl $-0x21, %eax
movw $0x2, %cx
cwtd
idivw %cx
cwtl
leal (%rsi,%rax), %r14d
addl $-0x21, %r14d
callq 0x2030
movsbq %bpl, %rcx
shlq $0x2, %rcx
addq (%rax), %rcx
cmpl %ebx, %r14d
cmovll %r14d, %ebx
jmp 0x44a0
movsbl %dl, %ebx
movsbl %r8b, %r15d
callq 0x2030
movq (%rax), %rax
cmpb %r15b, %bl
jle 0x4492
movsbq %bpl, %rcx
leaq (%rax,%rcx,4), %rcx
subl %r15d, %ebx
jmp 0x44a0
movsbq %r14b, %rcx
leaq (%rax,%rcx,4), %rcx
subl %ebx, %r15d
movl %r15d, %ebx
shll $0x8, %ebx
addl $0x2100, %ebx           # imm = 0x2100
orl (%rcx), %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/anet.c
// Function: anetRead
int anetRead(int fd, char *buf, int count)
{
    int nread, totlen = 0;
    while(totlen != count) {
        nread = read(fd,buf,count-totlen);
        if (nread == 0) return totlen;
        if (nread == -1) return -1;
        totlen += nread;
        buf += nread;
    }
    return totlen;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movl %edi, %r15d
xorl %ebx, %ebx
movl %ebp, %eax
subl %ebx, %eax
je 0x210b4
movslq %eax, %rdx
movl %r15d, %edi
movq %r14, %rsi
callq 0x1f330
cmpl $-0x1, %eax
je 0x210b8
testl %eax, %eax
je 0x210ba
addl %eax, %ebx
cltq
addq %rax, %r14
jmp 0x2108e
movl %ebp, %ebx
jmp 0x210ba
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/anet.c
// Function: anetWrite
int anetWrite(int fd, char *buf, int count)
{
    int nwritten, totlen = 0;
    while(totlen != count) {
        nwritten = write(fd,buf,count-totlen);
        if (nwritten == 0) return totlen;
        if (nwritten == -1) return -1;
        totlen += nwritten;
        buf += nwritten;
    }
    return totlen;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movl %edi, %r15d
xorl %ebx, %ebx
movl %ebp, %eax
subl %ebx, %eax
je 0x210fe
movslq %eax, %rdx
movl %r15d, %edi
movq %r14, %rsi
callq 0x1fb30
cmpl $-0x1, %eax
je 0x21102
testl %eax, %eax
je 0x21104
addl %eax, %ebx
cltq
addq %rax, %r14
jmp 0x210d8
movl %ebp, %ebx
jmp 0x21104
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/anet.c
// Function: anetPeerToString
int anetPeerToString(int fd, char *ip, size_t ip_len, int *port) {
    struct sockaddr_storage sa;
    socklen_t salen = sizeof(sa);

    if (getpeername(fd,(struct sockaddr*)&sa,&salen) == -1) {
        if (port) *port = 0;
        ip[0] = '?';
        ip[1] = '\0';
        return -1;
    }
    if (sa.ss_family == AF_INET) {
        struct sockaddr_in *s = (struct sockaddr_in *)&sa;
        if (ip) inet_ntop(AF_INET,(void*)&(s->sin_addr),ip,ip_len);
        if (port) *port = ntohs(s->sin_port);
    } else {
        struct sockaddr_in6 *s = (struct sockaddr_in6 *)&sa;
        if (ip) inet_ntop(AF_INET6,(void*)&(s->sin6_addr),ip,ip_len);
        if (port) *port = ntohs(s->sin6_port);
    }
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r14
leaq 0xc(%rsp), %rdx
movl $0x80, (%rdx)
leaq 0x10(%rsp), %rsi
callq 0x1f2a0
cmpl $-0x1, %eax
je 0x214c6
cmpw $0x2, 0x10(%rsp)
jne 0x214d9
testq %r14, %r14
je 0x214f1
leaq 0x14(%rsp), %rsi
pushq $0x2
jmp 0x214e5
testq %rbx, %rbx
je 0x214ce
andl $0x0, (%rbx)
movw $0x3f, (%r14)
pushq $-0x1
popq %rax
jmp 0x21506
testq %r14, %r14
je 0x214f1
leaq 0x18(%rsp), %rsi
pushq $0xa
popq %rdi
movq %r14, %rdx
movl %r15d, %ecx
callq 0x1fbc0
xorl %eax, %eax
testq %rbx, %rbx
je 0x21506
movzwl 0x12(%rsp), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
movl %ecx, (%rbx)
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/dict.c
// Function: dictAddRaw
dictEntry *dictAddRaw(dict *d, void *key)
{
    int index;
    dictEntry *entry;
    dictht *ht;

    // 如果条件允许的话，进行单步 rehash
    // T = O(1)
    if (dictIsRehashing(d)) _dictRehashStep(d);

    /* Get the index of the new element, or -1 if
     * the element already exists. */
    // 计算键在哈希表中的索引值
    // 如果值为 -1 ，那么表示键已经存在
    // T = O(N)
    if ((index = _dictKeyIndex(d, key)) == -1)
        return NULL;

    // T = O(1)
    /* Allocate the memory and store the new entry */
    // 如果字典正在 rehash ，那么将新键添加到 1 号哈希表
    // 否则，将新键添加到 0 号哈希表
    ht = dictIsRehashing(d) ? &d->ht[1] : &d->ht[0];
    // 为新节点分配空间
    entry = zmalloc(sizeof(*entry));
    // 将新节点插入到链表表头
    entry->next = ht->table[index];
    ht->table[index] = entry;
    // 更新哈希表已使用节点数量
    ht->used++;

    /* Set the hash entry fields. */
    // 设置新节点的键
    // T = O(1)
    dictSetKey(d, entry, key);

    return entry;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpl $-0x1, 0x50(%rdi)
je 0x219bd
movq %r14, %rdi
callq 0x21ae5
cmpl $-0x1, 0x50(%r14)
jne 0x21a0f
movq 0x18(%r14), %rcx
testq %rcx, %rcx
je 0x219eb
movq 0x28(%r14), %rsi
cmpq %rcx, %rsi
jb 0x21a0f
cmpb $0x1, 0xa55ce(%rip)     # 0xc6fa4
jne 0x219e6
movq %rsi, %rax
xorl %edx, %edx
divq %rcx
cmpq $0x6, %rax
jb 0x21a0f
addq %rsi, %rsi
jmp 0x219ee
pushq $0x4
popq %rsi
movq %r14, %rdi
callq 0x21751
testl %eax, %eax
je 0x21a0f
xorl %r13d, %r13d
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rax
movq %rbx, %rdi
callq *(%rax)
leaq 0x10(%r14), %r13
xorl %r15d, %r15d
movl %eax, 0x4(%rsp)
cmpq $0x2, %r15
je 0x21a86
movq %r15, %rcx
shlq $0x5, %rcx
movl 0x10(%r13,%rcx), %r12d
andl %eax, %r12d
leaq (,%r12,8), %rbp
addq (%r13,%rcx), %rbp
movq (%rbp), %rbp
testq %rbp, %rbp
je 0x21a78
movq (%r14), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x21a6c
movq 0x8(%r14), %rdi
movq (%rbp), %rdx
movq %rbx, %rsi
callq *%rax
testl %eax, %eax
je 0x21a72
jmp 0x219fa
cmpq %rbx, (%rbp)
je 0x219fa
addq $0x10, %rbp
jmp 0x21a44
incq %r15
cmpl $-0x1, 0x50(%r14)
movl 0x4(%rsp), %eax
jne 0x21a22
cmpl $-0x1, %r12d
je 0x219fa
xorl %r15d, %r15d
cmpl $-0x1, 0x50(%r14)
setne %r15b
shll $0x5, %r15d
pushq $0x18
popq %rdi
callq 0x2828d
movq %rax, %r13
movq 0x10(%r14,%r15), %rax
movslq %r12d, %rcx
movq (%rax,%rcx,8), %rdx
movq %rdx, 0x10(%r13)
movq %r13, (%rax,%rcx,8)
incq 0x28(%r14,%r15)
movq (%r14), %rax
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x21adc
movq 0x8(%r14), %rdi
movq %rbx, %rsi
callq *%rax
movq %rax, %rbx
movq %rbx, (%r13)
jmp 0x219fd
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/dict.c
// Function: dictFind
dictEntry *dictFind(dict *d, const void *key)
{
    dictEntry *he;
    unsigned int h, idx, table;

    // 字典（的哈希表）为空
    if (d->ht[0].size == 0) return NULL; /* We don't have a table at all */

    // 如果条件允许的话，进行单步 rehash
    if (dictIsRehashing(d)) _dictRehashStep(d);

    // 计算键的哈希值
    h = dictHashKey(d, key);
    // 在字典的哈希表中查找这个键
    // T = O(1)
    for (table = 0; table <= 1; table++) {

        // 计算索引值
        idx = h & d->ht[table].sizemask;

        // 遍历给定索引上的链表的所有节点，查找 key
        he = d->ht[table].table[idx];
        // T = O(1)
        while(he) {

            if (dictCompareKeys(d, key, he->key))
                return he;

            he = he->next;
        }

        // 如果程序遍历完 0 号哈希表，仍然没找到指定的键的节点
        // 那么程序会检查字典是否在进行 rehash ，
        // 然后才决定是直接返回 NULL ，还是继续查找 1 号哈希表
        if (!dictIsRehashing(d)) return NULL;
    }

    // 进行到这里时，说明两个哈希表都没找到
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x0, 0x18(%rdi)
je 0x21bf3
movq %rsi, %rbx
movq %rdi, %r14
cmpl $-0x1, 0x50(%rdi)
je 0x21b8a
movq %r14, %rdi
callq 0x21ae5
leaq 0x10(%r14), %r12
movq (%r14), %rax
movq %rbx, %rdi
callq *(%rax)
movl %eax, %ebp
xorl %r13d, %r13d
cmpq $0x2, %r13
je 0x21bf3
movq %r13, %rax
shlq $0x5, %rax
movl 0x10(%r12,%rax), %r15d
andl %ebp, %r15d
shlq $0x3, %r15
addq (%r12,%rax), %r15
movq (%r15), %r15
testq %r15, %r15
je 0x21be9
movq (%r14), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x21bde
movq 0x8(%r14), %rdi
movq (%r15), %rdx
movq %rbx, %rsi
callq *%rax
testl %eax, %eax
je 0x21be3
jmp 0x21bf6
cmpq %rbx, (%r15)
je 0x21bf6
addq $0x10, %r15
jmp 0x21bb8
incq %r13
cmpl $-0x1, 0x50(%r14)
jne 0x21b9b
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/dict.c
// Function: dictFetchValue
void *dictFetchValue(dict *d, const void *key) {
    dictEntry *he;

    // T = O(1)
    he = dictFind(d,key);

    return he ? dictGetVal(he) : NULL;
}

// Assembly:
pushq %rax
callq 0x21b64
testq %rax, %rax
je 0x21e68
movq 0x8(%rax), %rax
jmp 0x21e6a
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/dict.c
// Function: dictNext
dictEntry *dictNext(dictIterator *iter)
{
    while (1) {

        // 进入这个循环有两种可能：
        // 1) 这是迭代器第一次运行
        // 2) 当前索引链表中的节点已经迭代完（NULL 为链表的表尾）
        if (iter->entry == NULL) {

            // 指向被迭代的哈希表
            dictht *ht = &iter->d->ht[iter->table];

            // 初次迭代时执行
            if (iter->index == -1 && iter->table == 0) {
                // 如果是安全迭代器，那么更新安全迭代器计数器
                if (iter->safe)
                    iter->d->iterators++;
                // 如果是不安全迭代器，那么计算指纹
                else
                    iter->fingerprint = dictFingerprint(iter->d);
            }
            // 更新索引
            iter->index++;

            // 如果迭代器的当前索引大于当前被迭代的哈希表的大小
            // 那么说明这个哈希表已经迭代完毕
            if (iter->index >= (signed) ht->size) {
                // 如果正在 rehash 的话，那么说明 1 号哈希表也正在使用中
                // 那么继续对 1 号哈希表进行迭代
                if (dictIsRehashing(iter->d) && iter->table == 0) {
                    iter->table++;
                    iter->index = 0;
                    ht = &iter->d->ht[1];
                // 如果没有 rehash ，那么说明迭代已经完成
                } else {
                    break;
                }
            }

            // 如果进行到这里，说明这个哈希表并未迭代完
            // 更新节点指针，指向下个索引链表的表头节点
            iter->entry = ht->table[iter->index];
        } else {
            // 执行到这里，说明程序正在迭代某个链表
            // 将节点指针指向链表的下个节点
            iter->entry = iter->nextEntry;
        }

        // 如果当前节点不为空，那么也记录下该节点的下个节点
        // 因为安全迭代器有可能会将迭代器返回的当前节点删除
        if (iter->entry) {
            /* We need to save the 'next' here, the iterator user
             * may delete the entry we are returning. */
            iter->nextEntry = iter->entry->next;
            return iter->entry;
        }
    }

    // 迭代完毕
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x20(%rdi), %r15
cmpq $0x0, 0x18(%rdi)
movq %r15, %rax
jne 0x21fc0
movq (%rbx), %r14
movl 0x8(%rbx), %ebp
movslq %ebp, %rax
movq %rax, %rcx
shlq $0x5, %rcx
leaq (%r14,%rcx), %r12
addq $0x10, %r12
movl 0xc(%rbx), %r13d
movl %r13d, %ecx
notl %ecx
orl %ecx, %eax
jne 0x21f88
cmpl $0x0, 0x10(%rbx)
je 0x21f7c
incl 0x54(%r14)
jmp 0x21f88
movq %r14, %rdi
callq 0x21e6c
movq %rax, 0x28(%rbx)
incl %r13d
movl %r13d, 0xc(%rbx)
cmpl 0x8(%r12), %r13d
jl 0x21fb5
xorl %eax, %eax
cmpl $-0x1, 0x50(%r14)
je 0x21fd7
testl %ebp, %ebp
jne 0x21fd7
movq $0x1, 0x8(%rbx)
addq $0x30, %r14
xorl %r13d, %r13d
movq %r14, %r12
movslq %r13d, %rax
shlq $0x3, %rax
addq (%r12), %rax
movq (%rax), %rax
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x21f4b
movq 0x10(%rax), %rcx
movq %rcx, (%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/dict.c
// Function: dictGetRandomKey
dictEntry *dictGetRandomKey(dict *d)
{
    dictEntry *he, *orighe;
    unsigned int h;
    int listlen, listele;

    // 字典为空
    if (dictSize(d) == 0) return NULL;

    // 进行单步 rehash
    if (dictIsRehashing(d)) _dictRehashStep(d);

    // 如果正在 rehash ，那么将 1 号哈希表也作为随机查找的目标
    if (dictIsRehashing(d)) {
        // T = O(N)
        do {
            h = random() % (d->ht[0].size+d->ht[1].size);
            he = (h >= d->ht[0].size) ? d->ht[1].table[h - d->ht[0].size] :
                                      d->ht[0].table[h];
        } while(he == NULL);
    // 否则，只从 0 号哈希表中查找节点
    } else {
        // T = O(N)
        do {
            h = random() & d->ht[0].sizemask;
            he = d->ht[0].table[h];
        } while(he == NULL);
    }

    /* Now we found a non empty bucket, but it is a linked
     * list and we need to get a random element from the list.
     * The only sane way to do so is counting the elements and
     * select a random index. */
    // 目前 he 已经指向一个非空的节点链表
    // 程序将从这个链表随机返回一个节点
    listlen = 0;
    orighe = he;
    // 计算节点数量, T = O(1)
    while(he) {
        he = he->next;
        listlen++;
    }
    // 取模，得出随机节点的索引
    listele = random() % listlen;
    he = orighe;
    // 按索引查找节点
    // T = O(1)
    while(listele--) he = he->next;

    // 返回随机节点
    return he;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x28(%rdi), %rax
addq 0x48(%rdi), %rax
jne 0x22063
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rdi, %rbx
cmpl $-0x1, 0x50(%rdi)
je 0x220b8
movq %rbx, %rdi
callq 0x21ae5
cmpl $-0x1, 0x50(%rbx)
je 0x220b8
callq 0x1f9c0
movq 0x18(%rbx), %rsi
movq 0x38(%rbx), %rcx
addq %rsi, %rcx
xorl %edx, %edx
divq %rcx
movl %edx, %ecx
movq %rcx, %rax
subq %rsi, %rax
jae 0x220a6
shlq $0x3, %rcx
addq 0x10(%rbx), %rcx
movq %rcx, %rax
jmp 0x220ae
shlq $0x3, %rax
addq 0x30(%rbx), %rax
movq (%rax), %r14
testq %r14, %r14
je 0x2207a
jmp 0x220cd
callq 0x1f9c0
movq 0x10(%rbx), %rcx
andl 0x20(%rbx), %eax
movq (%rcx,%rax,8), %r14
testq %r14, %r14
je 0x220b8
xorl %ebx, %ebx
movq %r14, %rax
testq %rax, %rax
je 0x220e0
movq 0x10(%rax), %rax
incq %rbx
jmp 0x220d2
callq 0x1f9c0
cqto
idivq %rbx
subl $0x1, %edx
jb 0x22058
movq 0x10(%r14), %r14
jmp 0x220ea
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/dict.c
// Function: dictGetRandomKeys
int dictGetRandomKeys(dict *d, dictEntry **des, int count) {
    int j; /* internal hash table id, 0 or 1. */
    int stored = 0;

    if (dictSize(d) < count) count = dictSize(d);
    while(stored < count) {
        for (j = 0; j < 2; j++) {
            /* Pick a random point inside the hash table 0 or 1. */
            unsigned int i = random() & d->ht[j].sizemask;
            int size = d->ht[j].size;

            /* Make sure to visit every bucket by iterating 'size' times. */
            while(size--) {
                dictEntry *he = d->ht[j].table[i];
                while (he) {
                    /* Collect all the elements of the buckets found non
                     * empty while iterating. */
                    *des = he;
                    des++;
                    he = he->next;
                    stored++;
                    if (stored == count) return stored;
                }
                i = (i+1) & d->ht[j].sizemask;
            }
            /* If there is only one table and we iterated it all, we should
             * already have 'count' elements. Assert this condition. */
            assert(dictIsRehashing(d) != 0);
        }
    }
    return stored; /* Never reached. */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rdi), %r12
movq 0x48(%rdi), %rax
addq 0x28(%rdi), %rax
movslq %edx, %r13
cmpq %r13, %rax
cmovbl %eax, %r13d
xorl %r15d, %r15d
cmpl %r13d, %r15d
jge 0x221ac
xorl %ebp, %ebp
cmpq $0x2, %rbp
je 0x22123
callq 0x1f9c0
movq %rbp, %rsi
shlq $0x5, %rsi
leaq (%r12,%rsi), %rcx
movl 0x8(%r12,%rsi), %edx
movl 0x10(%r12,%rsi), %esi
andl %esi, %eax
subl $0x1, %edx
jb 0x2217f
movl %eax, %edi
shlq $0x3, %rdi
addq (%rcx), %rdi
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x2217b
movq %rdi, (%rbx)
addq $0x8, %rbx
addq $0x10, %rdi
incl %r15d
cmpl %r15d, %r13d
jne 0x2215e
jmp 0x221a9
incl %eax
jmp 0x2214e
incq %rbp
cmpl $-0x1, 0x50(%r14)
jne 0x2212e
leaq 0x68027(%rip), %rdi     # 0x8a1b7
leaq 0x743b4(%rip), %rsi     # 0x9654b
movl $0x478, %edx            # imm = 0x478
callq 0x4906b
pushq $0x1
popq %rdi
callq 0x1f3b0
movl %r13d, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/dict.c
// Function: dictEmpty
void dictEmpty(dict *d, void(callback)(void*)) {

    // 删除两个哈希表上的所有节点
    // T = O(N)
    _dictClear(d,&d->ht[0],callback);
    _dictClear(d,&d->ht[1],callback);
    // 重置属性 
    d->rehashidx = -1;
    d->iterators = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rdi), %rsi
movq %rbx, %rdx
callq 0x21d79
leaq 0x30(%r14), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x21d79
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x50(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/redis.c
// Function: infoCommand
void infoCommand(redisClient *c) {
    char *section = c->argc == 2 ? c->argv[1]->ptr : "default";

    if (c->argc > 2) {
        addReply(c,shared.syntaxerr);
        return;
    }
    sds info = genRedisInfoString(section);
    addReplySds(c,sdscatprintf(sdsempty(),"$%lu\r\n",
        (unsigned long)sdslen(info)));
    addReplySds(c,info);
    addReply(c,shared.crlf);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x2, 0x30(%rdi)
jne 0x223f7
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
jmp 0x22409
jle 0x22402
leaq 0xa5480(%rip), %rax     # 0xc7880
jmp 0x22448
leaq 0x69112(%rip), %rdi     # 0x8b51b
callq 0x25a0f
movq %rax, %r14
callq 0x271bf
movslq -0x8(%r14), %rdx
leaq 0x69b1e(%rip), %rsi     # 0x8bf3f
movq %rax, %rdi
xorl %eax, %eax
callq 0x2763d
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2c20f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2c20f
leaq 0xa53b8(%rip), %rax     # 0xc7800
movq (%rax), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2c10d
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/redis.c
// Function: monitorCommand
void monitorCommand(redisClient *c) {
    /* ignore MONITOR if already slave or in monitor mode */

    // 这个客户端是从服务器，或者已经是监视器
    if (c->flags & REDIS_SLAVE) return;

    // 打开 SLAVE 标志和 MONITOR 标志
    c->flags |= (REDIS_SLAVE|REDIS_MONITOR);

    // 添加客户端到 monitors 链表
    listAddNodeTail(server.monitors,c);

    // 返回 OK
    addReply(c,shared.ok);
}

// Assembly:
movl 0x90(%rdi), %eax
testb $0x1, %al
jne 0x22490
pushq %rbx
movq %rdi, %rbx
orl $0x5, %eax
movl %eax, 0x90(%rdi)
movq 0xa4cf8(%rip), %rdi     # 0xc7170
movq %rbx, %rsi
callq 0x1fe4c
movq 0xa5381(%rip), %rsi     # 0xc7808
movq %rbx, %rdi
popq %rbx
jmp 0x2c10d
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/redis.c
// Function: redisLogRaw
void redisLogRaw(int level, const char *msg) {
    const int syslogLevelMap[] = { LOG_DEBUG, LOG_INFO, LOG_NOTICE, LOG_WARNING };
    const char *c = ".-*#";
    FILE *fp;
    char buf[64];
    int rawmode = (level & REDIS_LOG_RAW);
    int log_to_stdout = server.logfile[0] == '\0';

    level &= 0xff; /* clear flags */
    if (level < server.verbosity) return;

    fp = log_to_stdout ? stdout : fopen(server.logfile,"a");
    if (!fp) return;

    if (rawmode) {
        fprintf(fp,"%s",msg);
    } else {
        int off;
        struct timeval tv;

        gettimeofday(&tv,NULL);
        off = strftime(buf,sizeof(buf),"%d %b %H:%M:%S.",localtime(&tv.tv_sec));
        snprintf(buf+off,sizeof(buf)-off,"%03d",(int)tv.tv_usec/1000);
        fprintf(fp,"[%d] %s %c %s\n",(int)getpid(),buf,c[level],msg);
    }
    fflush(fp);

    if (!log_to_stdout) fclose(fp);
    if (server.syslog_enabled) syslog(syslogLevelMap[level], "%s", msg);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %edi, %ebp
movzbl %bpl, %r15d
cmpl 0xa4f1e(%rip), %r15d    # 0xc740c
jl 0x22604
movq %rsi, %rbx
movq 0xa507a(%rip), %rdi     # 0xc7578
movb (%rdi), %r12b
testb %r12b, %r12b
je 0x22517
leaq 0x75de2(%rip), %rsi     # 0x982ef
callq 0x1fa60
movq %rax, %r14
jmp 0x22521
movq 0xa0ad2(%rip), %rax     # 0xc2ff0
movq (%rax), %r14
testq %r14, %r14
je 0x22604
btl $0xa, %ebp
jb 0x225bd
movq %rsp, %rbp
movq %rbp, %rdi
xorl %esi, %esi
callq 0x1f2f0
movq %rbp, %rdi
callq 0x1fb20
leaq 0x6813c(%rip), %rdx     # 0x8a68c
leaq 0x10(%rsp), %rdi
pushq $0x40
popq %r13
movq %r13, %rsi
movq %rax, %rcx
callq 0x1fb60
cltq
leaq (%rsp,%rax), %rdi
addq $0x10, %rdi
subq %rax, %r13
movl 0x8(%rbp), %eax
movl $0x3e8, %ecx            # imm = 0x3E8
cltd
idivl %ecx
leaq 0x68119(%rip), %rdx     # 0x8a69c
movq %r13, %rsi
movl %eax, %ecx
xorl %eax, %eax
callq 0x1f120
callq 0x1f410
leaq 0x680ec(%rip), %rcx     # 0x8a687
movsbl (%r15,%rcx), %r8d
leaq 0x680fa(%rip), %rsi     # 0x8a6a1
movq %r14, %rdi
movl %eax, %edx
leaq 0x10(%rsp), %rcx
movq %rbx, %r9
xorl %eax, %eax
callq 0x1fb10
jmp 0x225c8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f6c0
movq %r14, %rdi
callq 0x1fc60
testb %r12b, %r12b
je 0x225dd
movq %r14, %rdi
callq 0x1f9a0
cmpl $0x0, 0xa4f9c(%rip)     # 0xc7580
je 0x22604
movl %r15d, %eax
leaq 0x67c10(%rip), %rcx     # 0x8a200
movl (%rcx,%rax,4), %edi
leaq 0x72dfc(%rip), %rsi     # 0x953f6
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1f180
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/redis.c
// Function: redisLog
void redisLog(int level, const char *fmt, ...) {
    va_list ap;
    char msg[REDIS_MAX_LOGMSG_LEN];

    if ((level&0xff) < server.verbosity) return;

    va_start(ap, fmt);
    vsnprintf(msg, sizeof(msg), fmt, ap);
    va_end(ap);

    redisLogRaw(level,msg);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x4d8, %rsp            # imm = 0x4D8
movl %edi, %ebx
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x2266e
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movzbl %bl, %eax
cmpl 0xa4d95(%rip), %eax     # 0xc740c
jl 0x226c3
movq %rsi, %r10
leaq 0x20(%rsp), %rax
movq %rsp, %rcx
movq %rax, 0x10(%rcx)
leaq 0x4f0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
leaq 0xd0(%rsp), %r14
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdi
movq %r10, %rdx
callq 0x1f7b0
movl %ebx, %edi
movq %r14, %rsi
callq 0x224d3
addq $0x4d8, %rsp            # imm = 0x4D8
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/redis.c
// Function: redisLogFromHandler
void redisLogFromHandler(int level, const char *msg) {
    int fd;
    int log_to_stdout = server.logfile[0] == '\0';
    char buf[64];

    if ((level&0xff) < server.verbosity || (log_to_stdout && server.daemonize))
        return;
    fd = log_to_stdout ? STDOUT_FILENO : 
                         open(server.logfile, O_APPEND|O_CREAT|O_WRONLY, 0644);
    if (fd == -1) return;
    ll2string(buf,sizeof(buf),getpid());
    if (write(fd,"[",1) == -1) goto err;
    if (write(fd,buf,strlen(buf)) == -1) goto err;
    if (write(fd," | signal handler] (",20) == -1) goto err;
    ll2string(buf,sizeof(buf),time(NULL));
    if (write(fd,buf,strlen(buf)) == -1) goto err;
    if (write(fd,") ",2) == -1) goto err;
    if (write(fd,msg,strlen(msg)) == -1) goto err;
    if (write(fd,"\n",1) == -1) goto err;
err:
    if (!log_to_stdout) close(fd);
}

// Assembly:
movzbl %dil, %eax
cmpl 0xa4d34(%rip), %eax     # 0xc740c
jl 0x2281f
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq 0xa4e86(%rip), %rdi     # 0xc7578
movb (%rdi), %r15b
testb %r15b, %r15b
jne 0x22707
cmpl $0x0, 0xa4d2b(%rip)     # 0xc742c
jne 0x22815
testb %r15b, %r15b
je 0x22729
movl $0x441, %esi            # imm = 0x441
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x1f640
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0x2272c
jmp 0x22815
pushq $0x1
popq %rbp
callq 0x1f410
movslq %eax, %rdx
movq %rsp, %rdi
pushq $0x40
popq %rsi
callq 0x2e511
leaq 0x67f6a(%rip), %rsi     # 0x8a6b0
pushq $0x1
popq %rdx
movl %ebp, %edi
callq 0x1fb30
cmpq $-0x1, %rax
je 0x22809
movq %rsp, %r14
movq %r14, %rdi
callq 0x1f4f0
movl %ebp, %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1fb30
cmpq $-0x1, %rax
je 0x22809
leaq 0x67f2f(%rip), %rsi     # 0x8a6b2
pushq $0x14
popq %rdx
movl %ebp, %edi
callq 0x1fb30
cmpq $-0x1, %rax
je 0x22809
xorl %edi, %edi
callq 0x1fc50
movq %rsp, %r14
pushq $0x40
popq %rsi
movq %r14, %rdi
movq %rax, %rdx
callq 0x2e511
movq %r14, %rdi
callq 0x1f4f0
movl %ebp, %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1fb30
cmpq $-0x1, %rax
je 0x22809
leaq 0x71534(%rip), %rsi     # 0x93d01
pushq $0x2
popq %rdx
movl %ebp, %edi
callq 0x1fb30
cmpq $-0x1, %rax
je 0x22809
movq %rbx, %rdi
callq 0x1f4f0
movl %ebp, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x1fb30
cmpq $-0x1, %rax
je 0x22809
leaq 0x69f52(%rip), %rsi     # 0x8c751
pushq $0x1
popq %rdx
movl %ebp, %edi
callq 0x1fb30
testb %r15b, %r15b
je 0x22815
movl %ebp, %edi
callq 0x1f170
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/redis.c
// Function: dictEncObjHash
unsigned int dictEncObjHash(const void *key) {
    robj *o = (robj*) key;

    if (sdsEncodedObject(o)) {
        return dictGenHashFunction(o->ptr, sdslen((sds)o->ptr));
    } else {
        if (o->encoding == REDIS_ENCODING_INT) {
            char buf[32];
            int len;

            len = ll2string(buf,32,(long)o->ptr);
            return dictGenHashFunction((unsigned char*)buf, len);
        } else {
            unsigned int hash;

            o = getDecodedObject(o);
            hash = dictGenHashFunction(o->ptr, sdslen((sds)o->ptr));
            decrRefCount(o);
            return hash;
        }
    }
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x28, %rsp
movl (%rdi), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x8, %eax
je 0x2296c
cmpl $0x1, %eax
je 0x2297e
testl %eax, %eax
jne 0x2299c
movq 0x8(%rdi), %rdi
movl -0x8(%rdi), %esi
addq $0x28, %rsp
popq %rbx
popq %rbp
jmp 0x2163c
movq 0x8(%rdi), %rdx
movq %rsp, %rbx
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq 0x2e511
movq %rbx, %rdi
movl %eax, %esi
callq 0x2163c
jmp 0x229bc
callq 0x2f087
movq %rax, %rbx
movq 0x8(%rax), %rdi
movl -0x8(%rdi), %esi
callq 0x2163c
movl %eax, %ebp
movq %rbx, %rdi
callq 0x2ee1f
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/redis.c
// Function: trackOperationsPerSecond
void trackOperationsPerSecond(void) {

    // 计算两次抽样之间的时间长度，毫秒格式
    long long t = mstime() - server.ops_sec_last_sample_time;

    // 计算两次抽样之间，执行了多少个命令
    long long ops = server.stat_numcommands - server.ops_sec_last_sample_ops;

    long long ops_sec;

    // 计算距离上一次抽样之后，每秒执行命令的数量
    ops_sec = t > 0 ? (ops*1000/t) : 0;

    // 将计算出的执行命令数量保存到抽样数组
    server.ops_sec_samples[server.ops_sec_idx] = ops_sec;
    // 更新抽样数组的索引
    server.ops_sec_idx = (server.ops_sec_idx+1) % REDIS_OPS_SEC_SAMPLES;
    // 更新最后一次抽样的时间
    server.ops_sec_last_sample_time = mstime();
    // 更新最后一次抽样时的执行命令数量
    server.ops_sec_last_sample_ops = server.stat_numcommands;
}

// Assembly:
pushq %rax
callq 0x22843
movq %rax, %rcx
subq 0xa464d(%rip), %rcx     # 0xc7378
jle 0x22d49
movq 0xa45bc(%rip), %rax     # 0xc72f0
subq 0xa4645(%rip), %rax     # 0xc7380
imulq $0x3e8, %rax, %rax      # imm = 0x3E8
cqto
idivq %rcx
jmp 0x22d4b
xorl %eax, %eax
movslq 0xa46b6(%rip), %rcx     # 0xc7408
leaq 0xa424f(%rip), %rdx     # 0xc6fa8
movq %rax, 0x3e0(%rdx,%rcx,8)
leal 0x1(%rcx), %eax
pushq $0x10
popq %rcx
cltd
idivl %ecx
movl %edx, 0xa4698(%rip)     # 0xc7408
callq 0x22843
movq %rax, 0xa45fc(%rip)     # 0xc7378
movq 0xa456d(%rip), %rax     # 0xc72f0
movq %rax, 0xa45f6(%rip)     # 0xc7380
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/redis.c
// Function: getOperationsPerSecond
long long getOperationsPerSecond(void) {
    int j;
    long long sum = 0;

    // 计算所有取样值的总和
    for (j = 0; j < REDIS_OPS_SEC_SAMPLES; j++)
        sum += server.ops_sec_samples[j];

    // 计算取样的平均值
    return sum / REDIS_OPS_SEC_SAMPLES;
}

// Assembly:
xorl %ecx, %ecx
leaq 0xa4213(%rip), %rdx     # 0xc6fa8
xorl %eax, %eax
cmpq $0x10, %rcx
je 0x22daa
addq 0x3e0(%rdx,%rcx,8), %rax
incq %rcx
jmp 0x22d97
pushq $0x10
popq %rcx
cqto
idivq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/redis.c
// Function: clientsCronHandleTimeout
int clientsCronHandleTimeout(redisClient *c) {

    // 获取当前时间
    time_t now = server.unixtime;

    // 服务器设置了 maxidletime 时间
    if (server.maxidletime &&
        // 不检查作为从服务器的客户端
        !(c->flags & REDIS_SLAVE) &&    /* no timeout for slaves */
        // 不检查作为主服务器的客户端
        !(c->flags & REDIS_MASTER) &&   /* no timeout for masters */
        // 不检查被阻塞的客户端
        !(c->flags & REDIS_BLOCKED) &&  /* no timeout for BLPOP */
        // 不检查订阅了频道的客户端
        dictSize(c->pubsub_channels) == 0 && /* no timeout for pubsub */
        // 不检查订阅了模式的客户端
        listLength(c->pubsub_patterns) == 0 &&
        // 客户端最后一次与服务器通讯的时间已经超过了 maxidletime 时间
        (now - c->lastinteraction > server.maxidletime))
    {
        redisLog(REDIS_VERBOSE,"Closing idle client");
        // 关闭超时客户端
        freeClient(c);
        return 1;
    } else if (c->flags & REDIS_BLOCKED) {

        /* Blocked OPS timeout is handled with milliseconds resolution.
         * However note that the actual resolution is limited by
         * server.hz. */
        // 获取最新的系统时间
        mstime_t now_ms = mstime();

        // 检查被 BLPOP 等命令阻塞的客户端的阻塞时间是否已经到达
        // 如果是的话，取消客户端的阻塞
        if (c->bpop.timeout != 0 && c->bpop.timeout < now_ms) {
            // 向客户端返回空回复
            replyToBlockedClientTimedOut(c);
            // 取消客户端的阻塞状态
            unblockClient(c);
        }
    }

    // 客户度没有被关闭
    return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0xa4650(%rip), %rcx     # 0xc7410
testq %rcx, %rcx
setne %dl
movl 0x90(%rdi), %eax
testb $0x13, %al
sete %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x22e2a
movq 0x158(%rbx), %rdx
movq 0x28(%rdx), %rsi
addq 0x48(%rdx), %rsi
jne 0x22e2a
movq 0x160(%rbx), %rdx
cmpq $0x0, 0x28(%rdx)
jne 0x22e2a
movq 0xa493f(%rip), %rdx     # 0xc7740
subq 0x80(%rbx), %rdx
cmpq %rcx, %rdx
jle 0x22e2a
leaq 0x678bb(%rip), %rsi     # 0x8a6cf
pushq $0x1
popq %rbp
movl %ebp, %edi
xorl %eax, %eax
callq 0x22613
movq %rbx, %rdi
callq 0x2cb56
jmp 0x22e5e
xorl %ebp, %ebp
testb $0x10, %al
je 0x22e5e
callq 0x22843
movq 0x120(%rbx), %rcx
testq %rcx, %rcx
setne %dl
cmpq %rax, %rcx
setl %al
andb %dl, %al
cmpb $0x1, %al
jne 0x22e5e
movq %rbx, %rdi
callq 0x5badf
movq %rbx, %rdi
callq 0x5ba5f
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/redis.c
// Function: beforeSleep
void beforeSleep(struct aeEventLoop *eventLoop) {
    REDIS_NOTUSED(eventLoop);

    /* Run a fast expire cycle (the called function will return
     * ASAP if a fast cycle is not needed). */
    // 执行一次快速的主动过期检查
    if (server.active_expire_enabled && server.masterhost == NULL)
        activeExpireCycle(ACTIVE_EXPIRE_CYCLE_FAST);

    /* Send all the slaves an ACK request if at least one client blocked
     * during the previous event loop iteration. */
    if (server.get_ack_from_slaves) {
        robj *argv[3];

        argv[0] = createStringObject("REPLCONF",8);
        argv[1] = createStringObject("GETACK",6);
        argv[2] = createStringObject("*",1); /* Not used argument. */
        replicationFeedSlaves(server.slaves, server.slaveseldb, argv, 3);
        decrRefCount(argv[0]);
        decrRefCount(argv[1]);
        decrRefCount(argv[2]);
        server.get_ack_from_slaves = 0;
    }

    /* Unblock all the clients blocked for synchronous replication
     * in WAIT. */
    if (listLength(server.clients_waiting_acks))
        processClientsWaitingReplicas();

    /* Try to process pending commands for clients that were just unblocked. */
    if (listLength(server.unblocked_clients))
        processUnblockedClients();

    /* Write the AOF buffer on disk */
    // 将 AOF 缓冲区的内容写入到 AOF 文件
    flushAppendOnlyFile(0);

    /* Call the Redis Cluster before sleep function. */
    // 在进入下个事件循环前，执行一些集群收尾工作
    if (server.cluster_enabled) clusterBeforeSleep();
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
cmpl $0x0, 0xa3ef6(%rip)     # 0xc7418
je 0x23536
cmpq $0x0, 0xa40cc(%rip)     # 0xc75f8
jne 0x23536
pushq $0x1
popq %rdi
callq 0x22b11
cmpl $0x0, 0xa4183(%rip)     # 0xc76c0
je 0x235b3
leaq 0x672ee(%rip), %rdi     # 0x8a834
pushq $0x8
popq %rsi
callq 0x2ea81
movq %rsp, %rbx
movq %rax, (%rbx)
leaq 0x672e2(%rip), %rdi     # 0x8a83d
pushq $0x6
popq %rsi
callq 0x2ea81
movq %rax, 0x8(%rbx)
leaq 0x672d6(%rip), %rdi     # 0x8a844
pushq $0x1
popq %rsi
callq 0x2ea81
movq %rax, 0x10(%rbx)
movq 0xa3be7(%rip), %rdi     # 0xc7168
movl 0xa400d(%rip), %esi     # 0xc7594
pushq $0x3
popq %rcx
movq %rbx, %rdx
callq 0x31639
movq (%rbx), %rdi
callq 0x2ee1f
movq 0x8(%rbx), %rdi
callq 0x2ee1f
movq 0x10(%rbx), %rdi
callq 0x2ee1f
andl $0x0, 0xa410d(%rip)     # 0xc76c0
movq 0xa40fe(%rip), %rax     # 0xc76b8
cmpq $0x0, 0x28(%rax)
je 0x235c6
callq 0x33a88
movq 0xa4113(%rip), %rax     # 0xc76e0
cmpq $0x0, 0x28(%rax)
je 0x235d9
callq 0x5b9d9
xorl %edi, %edi
callq 0x45c80
cmpl $0x0, 0xa417d(%rip)     # 0xc7764
je 0x235ee
callq 0x4f985
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/redis.c
// Function: resetServerStats
void resetServerStats(void) {
    server.stat_numcommands = 0;
    server.stat_numconnections = 0;
    server.stat_expiredkeys = 0;
    server.stat_evictedkeys = 0;
    server.stat_keyspace_misses = 0;
    server.stat_keyspace_hits = 0;
    server.stat_fork_time = 0;
    server.stat_rejected_conn = 0;
    server.stat_sync_full = 0;
    server.stat_sync_partial_ok = 0;
    server.stat_sync_partial_err = 0;
    memset(server.ops_sec_samples,0,sizeof(server.ops_sec_samples));
    server.ops_sec_idx = 0;
    server.ops_sec_last_sample_time = mstime();
    server.ops_sec_last_sample_ops = 0;
}

// Assembly:
pushq %rax
xorps %xmm0, %xmm0
movups %xmm0, 0xa2df8(%rip)    # 0xc7310
movups %xmm0, 0xa2de1(%rip)    # 0xc7300
movups %xmm0, 0xa2dca(%rip)    # 0xc72f0
movups %xmm0, 0xa2dfb(%rip)    # 0xc7328
movups %xmm0, 0xa2e04(%rip)    # 0xc7338
andq $0x0, 0xa2e0c(%rip)     # 0xc7348
leaq 0xa2e45(%rip), %rdi     # 0xc7388
movl $0x84, %edx
xorl %esi, %esi
callq 0x1f110
callq 0x22843
movq %rax, 0xa2e1d(%rip)     # 0xc7378
andq $0x0, 0xa2e1d(%rip)     # 0xc7380
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/redis.c
// Function: evictionPoolAlloc
struct evictionPoolEntry *evictionPoolAlloc(void) {
    struct evictionPoolEntry *ep;
    int j;

    ep = zmalloc(sizeof(*ep)*REDIS_EVICTION_POOL_SIZE);
    for (j = 0; j < REDIS_EVICTION_POOL_SIZE; j++) {
        ep[j].idle = 0;
        ep[j].key = NULL;
    }
    return ep;
}

// Assembly:
pushq %rax
movl $0x100, %edi            # imm = 0x100
callq 0x2828d
xorl %ecx, %ecx
xorps %xmm0, %xmm0
cmpq $0x100, %rcx            # imm = 0x100
je 0x24ae7
movups %xmm0, (%rax,%rcx)
addq $0x10, %rcx
jmp 0x24ad4
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/redis.c
// Function: lookupCommandOrOriginal
struct redisCommand *lookupCommandOrOriginal(sds name) {

    // 查找当前表
    struct redisCommand *cmd = dictFetchValue(server.commands, name);

    // 如果有需要的话，查找原始表
    if (!cmd) cmd = dictFetchValue(server.orig_commands,name);

    return cmd;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0xa23da(%rip), %rdi     # 0xc6fc0
movq %rbx, %rsi
callq 0x21e57
testq %rax, %rax
je 0x24bf5
popq %rbx
retq
movq 0xa23cc(%rip), %rdi     # 0xc6fc8
movq %rbx, %rsi
popq %rbx
jmp 0x21e57
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/redis.c
// Function: propagate
void propagate(struct redisCommand *cmd, int dbid, robj **argv, int argc,
               int flags)
{
    // 传播到 AOF
    if (server.aof_state != REDIS_AOF_OFF && flags & REDIS_PROPAGATE_AOF)
        feedAppendOnlyFile(cmd,dbid,argv,argc);

    // 传播到 slave
    if (flags & REDIS_PROPAGATE_REPL)
        replicationFeedSlaves(server.slaves,dbid,argv,argc);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %r8d, %r15d
movl %ecx, %ebx
movq %rdx, %r14
movl %esi, %ebp
testb $0x1, %r15b
je 0x24c31
cmpl $0x0, 0xa2855(%rip)     # 0xc7478
je 0x24c31
movl %ebp, %esi
movq %r14, %rdx
movl %ebx, %ecx
callq 0x46371
testb $0x2, %r15b
jne 0x24c42
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0xa251f(%rip), %rdi     # 0xc7168
movl %ebp, %esi
movq %r14, %rdx
movl %ebx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x31639
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/redis.c
// Function: closeListeningSockets
void closeListeningSockets(int unlink_unix_socket) {
    int j;

    for (j = 0; j < server.ipfd_count; j++) close(server.ipfd[j]);

    if (server.sofd != -1) close(server.sofd);

    if (server.cluster_enabled)
        for (j = 0; j < server.cfd_count; j++) close(server.cfd[j]);

    if (unlink_unix_socket && server.unixsocket) {
        redisLog(REDIS_NOTICE,"Removing the unix socket file.");
        unlink(server.unixsocket); /* don't care if this fails */
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edi, %ebx
xorl %r15d, %r15d
leaq 0xa18b9(%rip), %r14     # 0xc6fa8
movslq 0xa1a16(%rip), %rax     # 0xc710c
cmpq %rax, %r15
jge 0x2570d
movl 0x124(%r14,%r15,4), %edi
callq 0x1f170
incq %r15
jmp 0x256ef
movl 0xa19fd(%rip), %edi     # 0xc7110
cmpl $-0x1, %edi
je 0x2571d
callq 0x1f170
cmpl $0x0, 0xa2040(%rip)     # 0xc7764
je 0x25747
xorl %r15d, %r15d
movslq 0xa1a24(%rip), %rax     # 0xc7154
cmpq %rax, %r15
jge 0x25747
movl 0x16c(%r14,%r15,4), %edi
callq 0x1f170
incq %r15
jmp 0x25729
testl %ebx, %ebx
je 0x25777
cmpq $0x0, 0xa196d(%rip)     # 0xc70c0
je 0x25777
leaq 0x65c14(%rip), %rsi     # 0x8b370
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x22613
movq 0xa1953(%rip), %rdi     # 0xc70c0
popq %rbx
popq %r14
popq %r15
jmp 0x1f3a0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/redis.c
// Function: time_independent_strcmp
int time_independent_strcmp(char *a, char *b) {
    char bufa[REDIS_AUTHPASS_MAX_LEN], bufb[REDIS_AUTHPASS_MAX_LEN];
    /* The above two strlen perform len(a) + len(b) operations where either
     * a or b are fixed (our password) length, and the difference is only
     * relative to the length of the user provided string, so no information
     * leak is possible in the following two lines of code. */
    int alen = strlen(a);
    int blen = strlen(b);
    int j;
    int diff = 0;

    /* We can't compare strings longer than our static buffers.
     * Note that this will never pass the first test in practical circumstances
     * so there is no info leak. */
    if (alen > sizeof(bufa) || blen > sizeof(bufb)) return 1;

    memset(bufa,0,sizeof(bufa));        /* Constant time. */
    memset(bufb,0,sizeof(bufb));        /* Constant time. */
    /* Again the time of the following two copies is proportional to
     * len(a) + len(b) so no info is leaked. */
    memcpy(bufa,a,alen);
    memcpy(bufb,b,blen);

    /* Always compare all the chars in the two buffers without
     * conditional expressions. */
    for (j = 0; j < sizeof(bufa); j++) {
        diff |= (bufa[j] ^ bufb[j]);
    }
    /* Length must be equal as well. */
    diff |= alen ^ blen;
    return diff; /* If zero strings are the same. */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movq %rsi, %r15
movq %rdi, %r12
callq 0x1f4f0
movq %rax, %rbx
movq %r15, %rdi
callq 0x1f4f0
movq %rax, %r14
movslq %ebx, %rbp
movl $0x201, %eax            # imm = 0x201
cmpq %rax, %rbp
setae %cl
movslq %r14d, %r13
cmpq %rax, %r13
setae %al
orb %cl, %al
je 0x25909
pushq $0x1
popq %rax
jmp 0x25980
movq %rbx, 0x8(%rsp)
leaq 0x210(%rsp), %rdi
xorl %ebx, %ebx
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x1f110
leaq 0x10(%rsp), %rdi
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x1f110
leaq 0x210(%rsp), %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x1fbd0
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x1fbd0
xorl %eax, %eax
cmpq $0x200, %rbx            # imm = 0x200
je 0x25978
movb 0x10(%rsp,%rbx), %cl
xorb 0x210(%rsp,%rbx), %cl
movsbl %cl, %ecx
orl %ecx, %eax
incq %rbx
jmp 0x2595a
xorl 0x8(%rsp), %r14d
orl %r14d, %eax
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq