LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/rafa9811[P]theIndiependenceGame/background.c
// Function: bg_meeting
int bg_meeting(Meeting *meet, Player *c, Mobjects *m, Stat *s, int question, int answer, char *nextq, int*correct){
	int id,roomid,px,py,oid,solution,uses;
	Object *meeting;

	if(!meet || !c || !m || !s || question>MAX_Q) return -1;

	roomid=player_get_room(c);
	px=player_get_px(c);
	py=player_get_py(c);

  oid = mobjects_search(m,roomid,px,py);
	meeting = mobjects_get(m,roomid,oid);
	id = object_getId(meeting);
	uses = object_getUses(meeting);
	if(uses<=0)return 3;	

	if(question==0 && answer == 0){
		strcpy(nextq,meet->meet[id][0]);
		return 0;
	}
	solution=meet->solution[id][question];
	if(answer==solution){
		stat_add_chaos(s,MEETING_CHAOS);
		*correct = 1;
	}
	else{
		stat_add_chaos(s,-MEETING_CHAOS);
		*correct = 0;
	}
	if(question+1<MAX_Q){
		strcpy(nextq,meet->meet[id][question+1]);
		return 1;
	}
	else{
		object_setUses(meeting,0);
		return 2;
	} 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r13
movq %rsi, %xmm0
movq %rdi, %xmm1
punpcklqdq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0]
movq %rcx, %xmm0
movq %rdx, %xmm2
punpcklqdq %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0]
pxor %xmm0, %xmm0
cmpl $0x4, %r8d
setge %al
pcmpeqd %xmm0, %xmm2
pcmpeqd %xmm0, %xmm1
movdqa %xmm1, %xmm0
shufps $0xdd, %xmm2, %xmm0     # xmm0 = xmm0[1,3],xmm2[1,3]
shufps $0x88, %xmm2, %xmm1     # xmm1 = xmm1[0,2],xmm2[0,2]
andps %xmm0, %xmm1
movmskps %xmm1, %edx
testl %edx, %edx
setne %dl
orb %al, %dl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0x37e7
movl %r8d, %ebp
movq %rsi, %r15
movl %r9d, 0x4(%rsp)
movq %rcx, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
movq %rsi, %rdi
callq 0x3dee
movl %eax, %r14d
xorl %r12d, %r12d
movq %r15, %rdi
xorl %eax, %eax
callq 0x3dfd
movl %eax, %ebx
movq %r15, %rdi
xorl %eax, %eax
callq 0x3e0b
movq %r13, %rdi
movl %r14d, %esi
movl %ebx, %edx
movl %eax, %ecx
callq 0x26e2
cmpl $0x1a, %r14d
ja 0x3724
movl %r14d, %ecx
cltq
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
addq %rcx, %r13
movq (%r13,%rax,8), %r12
movq %r12, %rdi
callq 0x3999
movl %eax, %r14d
movq %r12, %rdi
callq 0x3a11
testl %eax, %eax
jle 0x37b8
movq 0x50(%rsp), %rdi
movl 0x4(%rsp), %ecx
movl %ecx, %eax
orl %ebp, %eax
je 0x37bf
movslq %r14d, %rax
leaq (%rax,%rax,2), %rbx
movq 0x8(%rsp), %r13
leaq (,%rbx,2), %rax
addq %r13, %rax
movslq %ebp, %r14
movswl 0x78(%rax,%r14,2), %eax
xorl %r15d, %r15d
cmpl %ecx, %eax
sete %r15b
movl $0x64, %eax
movl $0xffffff9c, %esi       # imm = 0xFFFFFF9C
cmovel %eax, %esi
movq 0x10(%rsp), %rdi
callq 0x420a
movq 0x58(%rsp), %rax
movl %r15d, (%rax)
cmpl $0x1, %ebp
jg 0x37d8
leaq (,%rbx,8), %rax
addq %r13, %rax
movq 0x8(%rax,%r14,8), %rsi
movq 0x50(%rsp), %rdi
callq 0x1050
movl $0x1, %eax
jmp 0x37e7
movl $0x3, %eax
jmp 0x37e7
movslq %r14d, %rax
leaq (%rax,%rax,2), %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
callq 0x1050
xorl %eax, %eax
jmp 0x37e7
movq %r12, %rdi
xorl %esi, %esi
callq 0x3943
movl $0x2, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/rafa9811[P]theIndiependenceGame/object.c
// Function: object_setPosition
Object* object_setPosition(Object *O, int px, int py){
  if(!O ||  px<0 || py<0)return NULL;

  O->px=px;
  O->py=py;

  return O;
}

// Assembly:
movq %rdi, %rax
testq %rdi, %rdi
sete %cl
movl %edx, %edi
orl %esi, %edi
sets %dil
orb %cl, %dil
je 0x38cc
xorl %eax, %eax
retq
movl %esi, 0x10(%rax)
movl %edx, 0x14(%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/rafa9811[P]theIndiependenceGame/places.c
// Function: place_ini
Place* place_ini (){
	Place *p;
	p = (Place*) malloc(sizeof(Place));
	if (!p) return NULL;
	p->is_locked = 0;
	p->stars=0;
	p->up=-1;
	p->down=-1;
	p->left=-1;
	p->right=-1;
	return p;
}

// Assembly:
pushq %rax
movl $0x11cc, %edi           # imm = 0x11CC
callq 0x1130
testq %rax, %rax
je 0x3ade
movw $0x0, 0x4(%rax)
movl $0x0, 0xc(%rax)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x10(%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/rafa9811[P]theIndiependenceGame/places.c
// Function: place_copy
Place* place_copy (Place *src){
	Place *p;
	if (!src) return NULL;
	p = place_ini();
	if (!p) return NULL;
	p->placeID = src->placeID;
	p->is_locked = src->is_locked;
	p->stars = src->stars;
	p->leavebox = src -> leavebox;
	p->leftbox = src -> leftbox;
	p->up = src->up;
	p->down = src->down;
	p->left = src->left;
	p->right = src->right;

	strcpy(p->draw,src->draw);
	strcpy(p->desc,src->desc);
	return p;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x3d30
movq %rdi, %r14
movl $0x11cc, %edi           # imm = 0x11CC
callq 0x1130
testq %rax, %rax
je 0x3d30
movq %rax, %rbx
movl (%r14), %eax
movl %eax, (%rbx)
movzwl 0x4(%r14), %eax
movw %ax, 0x4(%rbx)
movl 0xc(%r14), %eax
movl %eax, 0xc(%rbx)
movl 0x6(%r14), %eax
movl %eax, 0x6(%rbx)
movups 0x10(%r14), %xmm0
movups %xmm0, 0x10(%rbx)
movl $0x420, %esi            # imm = 0x420
leaq (%rbx,%rsi), %rdi
addq %r14, %rsi
callq 0x1050
movq %rbx, %rdi
addq $0x20, %rdi
addq $0x20, %r14
movq %r14, %rsi
callq 0x1050
jmp 0x3d32
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/rafa9811[P]theIndiependenceGame/places.c
// Function: place_drawchar
Place* place_drawchar(Place* p, int x, int y, char c){
	if (!p || x<0 || y<0) return NULL;
  if((y*ROWSPCOL+x-2)<2) return p;
	p->draw[y * ROWSPCOL + x - 2] = c;
	return p;
}

// Assembly:
movq %rdi, %rax
testq %rdi, %rdi
sete %dil
movl %edx, %r8d
orl %esi, %r8d
sets %r8b
orb %dil, %r8b
je 0x3d59
xorl %eax, %eax
retq
leal (%rdx,%rdx,4), %edx
shll $0x4, %edx
addl %esi, %edx
cmpl $0x4, %edx
jl 0x3d70
addl $-0x2, %edx
movb %cl, 0x420(%rax,%rdx)
retq
// File: /workspace/github_c_makefile_star2_O3/rafa9811[P]theIndiependenceGame/player.c
// Function: player_ini
Player* player_ini(){
	Player *c;
	c = (Player*) malloc(sizeof(Player));
	if(!c) return NULL;
	c->px = INIX;
	c->py = INIY;
	c->room_id = INIROOM;
	return c;
}

// Assembly:
pushq %rax
movl $0xc, %edi
callq 0x1130
testq %rax, %rax
je 0x3dc8
movabsq $0x1400000046, %rcx     # imm = 0x1400000046
movq %rcx, (%rax)
movl $0x0, 0x8(%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/rafa9811[P]theIndiependenceGame/player.c
// Function: player_move
Player* player_move(Player *c,int x, int y){
	if(!c) return NULL;
	c->px=x;
	c->py=y;
	return c;
}

// Assembly:
movq %rdi, %rax
testq %rdi, %rdi
je 0x3de1
movl %esi, (%rax)
movl %edx, 0x4(%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/rafa9811[P]theIndiependenceGame/rectangles.c
// Function: win_cls
void win_cls(sc_rectangle *sc) {
    char *buf;
    int i;

    sc->last_line = 0;
    //    if (!_is_visible(sc)) return;
    buf = (char *) malloc((sc->nc + 1) * sizeof (char));
    memset(buf, ' ', sc->nc);
    buf[sc->nc] = 0;
    _prepare_font(sc);
    for (i = sc->r1; i < sc->r1 + sc->nr; i++) {
        _move_to(sc, i - sc->r1, 0); /*Este -1 esta puesto de forma aleatoria, pero funciona*/
        printf("%s", buf);
        /*    printf("%d", i);
            fflush(stdout); */
    }
    fflush(stdout);
    free(buf);
    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x0, 0x18(%rdi)
movslq 0xc(%rdi), %r15
leaq 0x1(%r15), %rdi
callq 0x1130
movq %rax, %r14
movq %rax, %rdi
movl $0x20, %esi
movq %r15, %rdx
callq 0x10c0
movb $0x0, (%r14,%r15)
movl 0x1c(%rbx), %edx
movl 0x20(%rbx), %ecx
leaq 0x2242(%rip), %rdi      # 0x6197
movl $0x1b, %esi
xorl %eax, %eax
callq 0x10a0
cmpl $0x0, 0x8(%rbx)
jle 0x3f9c
movl 0x4(%rbx), %eax
leaq 0x2bd8(%rip), %r15      # 0x6b49
movl %eax, %ebp
movl %ebp, %esi
subl %eax, %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3e84
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x10a0
incl %ebp
movl 0x4(%rbx), %eax
movl 0x8(%rbx), %ecx
addl %eax, %ecx
cmpl %ecx, %ebp
jl 0x3f73
movq 0x6035(%rip), %rax      # 0x9fd8
movq (%rax), %rdi
callq 0x1140
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O3/rafa9811[P]theIndiependenceGame/rectangles.c
// Function: win_write_line_at
int win_write_line_at(sc_rectangle *sc, int r, int c, char *str) {
    char *nl_p;
    char save, av_space, ret;

    if (!_is_visible(sc)) return 0;
    if (r >= sc->nr || c >= sc->nc) return 0;
    nl_p = strchr(str, '\n');
    if (nl_p) *nl_p = 0;

    av_space = sc->nc - c;
    save = -1;
    if (strlen(str) > av_space) {
        save = str[av_space - 1];
        str[av_space - 1] = 0;
    }

    _prepare_font(sc);
    _move_to(sc, r, c);
    printf("%s", str);
    fflush(stdout);
    if (save > 0) {
        str[av_space - 1] = save;
        ret = av_space;
    } else
        ret = strlen(str);
    if (nl_p) *nl_p = '\n';
    sc->last_line = r;
    return ret;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0x414e
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
cmpl $0x0, 0x4(%rdi)
js 0x4140
cmpl $0x0, (%r14)
js 0x4140
movq %rcx, %r15
movl 0x8(%r14), %ecx
testl %ecx, %ecx
jle 0x4140
movl %edx, %ebp
movl %esi, %ebx
movl 0xc(%r14), %r12d
testl %r12d, %r12d
setle %dl
cmpl %esi, %ecx
setle %cl
cmpl %ebp, %r12d
setle %sil
orb %cl, %sil
orb %dl, %sil
jne 0x4140
movq %r15, %rdi
movl $0xa, %esi
callq 0x1090
testq %rax, %rax
je 0x40a0
movb $0x0, (%rax)
movl 0xc(%r14), %r12d
movq %rax, (%rsp)
subl %ebp, %r12d
movq %r15, %rdi
callq 0x1080
movsbq %r12b, %rcx
movb $-0x1, %r13b
cmpq %rcx, %rax
jbe 0x40ca
movsbq %r12b, %rax
movb -0x1(%r15,%rax), %r13b
movb $0x0, -0x1(%r15,%rax)
movl 0x1c(%r14), %edx
movl 0x20(%r14), %ecx
leaq 0x20be(%rip), %rdi      # 0x6197
movl $0x1b, %esi
xorl %eax, %eax
callq 0x10a0
movq %r14, %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0x3e84
leaq 0x2a51(%rip), %rdi      # 0x6b49
movq %r15, %rsi
xorl %eax, %eax
callq 0x10a0
movq 0x5ecf(%rip), %rax      # 0x9fd8
movq (%rax), %rdi
callq 0x1140
testb %r13b, %r13b
jle 0x4121
movsbq %r12b, %rax
movb %r13b, -0x1(%r15,%rax)
jmp 0x412c
movq %r15, %rdi
callq 0x1080
movq %rax, %r12
movq (%rsp), %rax
testq %rax, %rax
je 0x4138
movb $0xa, (%rax)
movl %ebx, 0x18(%r14)
movsbl %r12b, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/rafa9811[P]theIndiependenceGame/rectangles.c
// Function: win_write_char_at
int win_write_char_at(sc_rectangle *sc, int r, int c, char ch) {

    if (!_is_visible(sc)) return 0;
    if (r >= sc->nr || c >= sc->nc) return 0;

    _move_to(sc, r, c);
    printf("%c", ch);
    fflush(stdout);
    return 1;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0x41ac
cmpl $0x0, 0x4(%rdi)
js 0x41ac
cmpl $0x0, (%rdi)
js 0x41ac
pushq %rbx
movl %ecx, %ebx
movl 0x8(%rdi), %ecx
testl %ecx, %ecx
jle 0x41ab
movl 0xc(%rdi), %r8d
testl %r8d, %r8d
setle %r9b
cmpl %esi, %ecx
setle %cl
cmpl %edx, %r8d
setle %r8b
orb %cl, %r8b
orb %r9b, %r8b
jne 0x41ab
callq 0x3e84
movsbl %bl, %edi
callq 0x1040
movq 0x5e3a(%rip), %rax      # 0x9fd8
movq (%rax), %rdi
callq 0x1140
movl $0x1, %eax
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/rafa9811[P]theIndiependenceGame/stats.c
// Function: stat_add_chaos
Stat* stat_add_chaos (Stat* stat, int chaos){
    if (!stat){
        return NULL;
    }
    stat->chaos+=chaos;
    if(stat->chaos<0) stat->chaos = 0;
    return stat;
}

// Assembly:
movq %rdi, %rax
testq %rdi, %rdi
je 0x421f
addl 0x4(%rax), %esi
xorl %ecx, %ecx
testl %esi, %esi
cmovgl %esi, %ecx
movl %ecx, 0x4(%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/rafa9811[P]theIndiependenceGame/stats.c
// Function: stat_stars
Stat* stat_stars (Stat* stat){
    int stars;
    if (!stat){
        return NULL;
    }
    stars = (int) stat->danger/DPERSTAR;
    if (stars > 5){
        stat->stars=5;
    }
    else if (stars < 0){
        return NULL;
    }
    else{
        stat->stars=stars;
    }
    return stat;
}

// Assembly:
testq %rdi, %rdi
je 0x42b8
movq %rdi, %rax
movl 0x8(%rdi), %edx
movl $0x5, %ecx
cmpl $0x176f, %edx           # imm = 0x176F
jg 0x42d2
cmpl $0xfffffc19, %edx       # imm = 0xFFFFFC19
jge 0x42bb
xorl %eax, %eax
retq
movslq %edx, %rcx
imulq $0x10624dd3, %rcx, %rcx # imm = 0x10624DD3
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x26, %rcx
addl %edx, %ecx
movl %ecx, 0xc(%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/rafa9811[P]theIndiependenceGame/interact.c
// Function: interact_updateClk
void interact_updateClk(double remaining, Interact *interact){
  int newDanger, motivation, chaos, remainingtime, nodanger;
  if(!interact) return;
  if(!IN(stat)) return;
  motivation = stat_get_motivation(IN(stat));
  chaos = stat_get_chaos(IN(stat));
  nodanger = stat_get_nodanger(IN(stat));
  remainingtime = TIME - remaining;
  remainingtime = (remainingtime*remainingtime)/DANGER1;
  newDanger = motivation - chaos + remainingtime + nodanger;
  /*if(newDanger<0){
    newDanger=0;
  }*/
  stat_set_danger(IN(stat),newDanger);
  stat_stars(IN(stat));
  return;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
testq %rdi, %rdi
je 0x469b
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x469b
movsd %xmm0, 0x8(%rsp)
callq 0x41f0
movl %eax, %ebp
movq 0x8(%rbx), %rdi
callq 0x4220
movl %eax, %r14d
movq 0x8(%rbx), %rdi
callq 0x4289
movsd 0x19ae(%rip), %xmm0     # 0x6010
subsd 0x8(%rsp), %xmm0
cvttsd2si %xmm0, %ecx
imull %ecx, %ecx
imulq $0x3e0f83e1, %rcx, %rsi # imm = 0x3E0F83E1
shrq $0x23, %rsi
addl %ebp, %esi
subl %r14d, %esi
addl %eax, %esi
movq 0x8(%rbx), %rdi
callq 0x422f
movq 0x8(%rbx), %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x4298
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/rafa9811[P]theIndiependenceGame/interface.c
// Function: interface_printDialog
int interface_printDialog(Interact* interact, Interface* interface){
    char *dialog,*ini,line[2*DLG_LINE];
    int len,i=0,linenumber=2;
    if(!interact || !interface) return -1;
    win_cls(interface->dlgs);
    dialog=(char*)malloc(1024);
    strcpy(dialog,interact_getDialog(interact));
    len = strlen(dialog);
    if(len>DLG_LINE){
        ini=dialog;
        while(i<len && linenumber<DLG_LINE){
        dialog = ini + i;
        memcpy(line,dialog,DLG_LINE);
        win_write_line_at(interface->dlgs,linenumber,2,line);
        i+=DLG_LINE;
        linenumber++;
        }
    }
    else win_write_line_at(interface->dlgs,linenumber,2,dialog);
    dialog=ini;
    if(dialog)free(dialog);
    return 0;
}

// Assembly:
testq %rdi, %rdi
sete %cl
testq %rsi, %rsi
sete %dl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
orb %cl, %dl
jne 0x50d8
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %rbx
movq %rdi, %r15
movq 0x8(%rsi), %rdi
callq 0x3f12
movl $0x400, %edi            # imm = 0x400
callq 0x1130
movq %rax, %r14
movq %r15, %rdi
callq 0x4567
movq %r14, %rdi
movq %rax, %rsi
callq 0x1050
movq %r14, %rdi
callq 0x1080
movq %rax, %r15
cmpl $0x6a, %r15d
jl 0x50a2
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
movl $0x2, %r13d
movl $0x69, %ebp
movq %rsp, %r12
leaq (%r14,%rbp), %rsi
addq $-0x69, %rsi
movl $0x69, %edx
movq %r12, %rdi
callq 0x1100
movq 0x8(%rbx), %rdi
movl %r13d, %esi
movl $0x2, %edx
movq %r12, %rcx
callq 0x4025
cmpq %r15, %rbp
jae 0x50bd
leal 0x1(%r13), %eax
addq $0x69, %rbp
cmpl $0x68, %r13d
movl %eax, %r13d
jb 0x5061
jmp 0x50bd
movq 0x8(%rbx), %rdi
movl $0x2, %esi
movl $0x2, %edx
movq %r14, %rcx
callq 0x4025
testq %r14, %r14
je 0x50c5
movq %r14, %rdi
callq 0x1030
xorl %eax, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/rafa9811[P]theIndiependenceGame/interface.c
// Function: interface_printScreen
int interface_printScreen(Interact *interact, Interface* interface){
    int linenumber=0,room;
    char line[SCREEN_LINE*2],*draw,*ini;
    int i=0;
    if(!interact || !interface) return -1;
    win_cls(interface->screen);
    room=player_get_room(interact_getPlayer(interact));
    draw=map_getRoomDraw(interact_getMap(interact),room);
    if(!draw)return -1;
    ini=draw;
    while(linenumber<=YLIMIT){
      draw = ini + i;
      memcpy(line,draw,SCREEN_LINE);
      win_write_line_at(interface->screen,linenumber,2,line);
      i+=SCREEN_LINE;
      linenumber++;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xa0, %rsp
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
orb %al, %cl
jne 0x5380
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rdi
callq 0x3f12
movq %r14, %rdi
callq 0x45bb
movq %rax, %rdi
callq 0x3dee
movl %eax, %r15d
movq %r14, %rdi
callq 0x45c7
movq %rax, %rdi
movl %r15d, %esi
callq 0x2ad0
testq %rax, %rax
je 0x5380
movq %rax, %r14
xorl %ebp, %ebp
movq %rsp, %r15
xorl %r12d, %r12d
movl $0x50, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x1100
movq (%rbx), %rdi
movl %r12d, %esi
movl $0x2, %edx
movq %r15, %rcx
callq 0x4025
incl %r12d
addq $0x50, %r14
cmpl $0x25, %r12d
jne 0x5350
movl %ebp, %eax
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/rafa9811[P]theIndiependenceGame/interface.c
// Function: interface_printPlayer
int interface_printPlayer(Interact *interact, Interface* interface){
  int px,py;
  Player*player;
  if(!interact||!interface) return -1;
  player=interact_getPlayer(interact);
  if(!player) return -1;
  px=player_get_px(player);
  py=player_get_py(player);
  if(px<0||py<0||px>XLIMIT||py>YLIMIT) return -1;
  win_write_char_at(interface->screen,py,px,PLAYER_CHAR);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
orb %al, %cl
jne 0x53fa
movq %rsi, %rbx
callq 0x45bb
testq %rax, %rax
je 0x53fa
movq %rax, %r15
movq %rax, %rdi
xorl %eax, %eax
callq 0x3dfd
movl %eax, %r14d
movq %r15, %rdi
xorl %eax, %eax
callq 0x3e0b
cmpl $0x51, %r14d
setae %cl
cmpl $0x25, %eax
setae %dl
orb %cl, %dl
jne 0x53fa
movq (%rbx), %rdi
movl %eax, %esi
movl %r14d, %edx
movl $0x40, %ecx
callq 0x414f
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
orb %al, %cl
jne 0x545e
movq %rsi, %rbx
movq %rdi, %r15
callq 0x45fb
movl %eax, %r14d
movq %r15, %rdi
callq 0x460d
cmpl $0x51, %r14d
setae %cl
cmpl $0x25, %eax
setae %dl
orb %cl, %dl
jne 0x545e
movq (%rbx), %rdi
movl %eax, %esi
movl %r14d, %edx
movl $0x20, %ecx
callq 0x414f
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x58d8
movq %rdi, %rbx
movsd %xmm0, 0x8(%rsp)
callq 0x3f12
xorpd %xmm0, %xmm0
testw %bp, %bp
je 0x5837
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x5874
cvttsd2si %xmm1, %eax
movslq %eax, %rcx
imulq $-0x77777777, %rcx, %rdx # imm = 0x88888889
shrq $0x20, %rdx
addl %ecx, %edx
movl %edx, %eax
shrl $0x1f, %eax
sarl $0x5, %edx
addl %eax, %edx
imull $0x3c, %edx, %eax
subl %eax, %ecx
cmpl $0x9, %ecx
jg 0x58a5
leaq 0x1351(%rip), %rsi      # 0x6b86
jmp 0x58b5
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x588c
cvttsd2si %xmm1, %eax
movslq %eax, %rcx
imulq $-0x77777777, %rcx, %rdx # imm = 0x88888889
shrq $0x20, %rdx
addl %ecx, %edx
movl %edx, %eax
shrl $0x1f, %eax
sarl $0x5, %edx
addl %eax, %edx
imull $0x3c, %edx, %eax
subl %eax, %ecx
cmpl $0x9, %ecx
jg 0x58ae
leaq 0x12da(%rip), %rsi      # 0x6b4c
jmp 0x58b5
movabsq $0x4445545345525241, %rax # imm = 0x4445545345525241
movq %rax, 0x10(%rsp)
movw $0x21, 0x18(%rsp)
jmp 0x58c1
movabsq $0x55205327454d4954, %rax # imm = 0x55205327454D4954
movq %rax, 0x10(%rsp)
movl $0x215055, 0x17(%rsp)   # imm = 0x215055
jmp 0x58c1
leaq 0x12f8(%rip), %rsi      # 0x6ba4
jmp 0x58b5
leaq 0x12af(%rip), %rsi      # 0x6b64
leaq 0x10(%rsp), %rdi
xorl %eax, %eax
callq 0x11a0
leaq 0x10(%rsp), %rcx
movq %rbx, %rdi
movl $0x1, %esi
movl $0x2, %edx
callq 0x4025
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5923
movq %rsi, %rbx
testq %rsi, %rsi
je 0x5923
movq %rdi, %r14
movq %rbx, %rsi
callq 0x4fe2
movq %r14, %rdi
movq %rbx, %rsi
callq 0x50d9
movq %r14, %rdi
movq %rbx, %rsi
callq 0x52e8
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5392
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x11b0
// File: /workspace/github_c_makefile_star2_O3/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 0x5a0e
movq %rsi, %rbx
testq %rsi, %rsi
je 0x5a0e
cmpl $0xc, %edx
jae 0x5a0e
movq %rdi, %r14
movl %edx, %eax
leaq 0x1111(%rip), %rcx      # 0x6a6c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4fe2
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x50d9
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4fe2
movq %r14, %rdi
movq %rbx, %rsi
callq 0x50d9
movq %r14, %rdi
movq %rbx, %rsi
callq 0x52e8
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5392
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4fe2
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5610
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5392
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5407
jmp 0x596f
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4fe2
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x546b
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x11b0
// File: /workspace/github_c_makefile_star2_O3/lh3[P]pre-pe/pre-lianti.c
// Function: trim_bseq_5
static inline void trim_bseq_5(bseq1_t *s, int l)
{
	memmove(s->seq, s->seq + l, s->l_seq - l);
	memmove(s->qual, s->qual + l, s->l_seq - l);
	s->l_seq -= l;
	s->seq[s->l_seq] = s->qual[s->l_seq] = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
movslq %esi, %r15
leaq (%rdi,%r15), %rsi
movl (%rbx), %edx
movl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
andq %r14, %rdx
subq %r15, %rdx
callq 0x21d0
movq 0x18(%rbx), %rdi
leaq (%rdi,%r15), %rsi
movl (%rbx), %edx
andq %r14, %rdx
subq %r15, %rdx
callq 0x21d0
movl (%rbx), %eax
movl %eax, %ecx
subl %r15d, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x80000000, %eax       # imm = 0x80000000
orl %ecx, %eax
movl %eax, (%rbx)
movq 0x18(%rbx), %rax
xorl %edx, %edx
movb %dl, (%rax,%rcx)
movq 0x10(%rbx), %rax
movl (%rbx), %ecx
andq %r14, %rcx
movb %dl, (%rax,%rcx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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
testl %edx, %edx
je 0x21aec
movl %edx, %ebp
movq %rsi, %r14
movl %edi, %r15d
xorl %ebx, %ebx
movl %ebp, %eax
subl %ebx, %eax
movslq %eax, %rdx
movl %r15d, %edi
movq %r14, %rsi
callq 0x1f330
cmpl $-0x1, %eax
je 0x21af0
testl %eax, %eax
je 0x21af2
addl %eax, %ebx
cltq
addq %rax, %r14
cmpl %ebp, %ebx
jne 0x21ac2
movl %ebp, %ebx
jmp 0x21af2
xorl %ebx, %ebx
jmp 0x21af2
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
testl %edx, %edx
je 0x21b3e
movl %edx, %ebp
movq %rsi, %r14
movl %edi, %r15d
xorl %ebx, %ebx
movl %ebp, %eax
subl %ebx, %eax
movslq %eax, %rdx
movl %r15d, %edi
movq %r14, %rsi
callq 0x1fb30
cmpl $-0x1, %eax
je 0x21b42
testl %eax, %eax
je 0x21b44
addl %eax, %ebx
cltq
addq %rax, %r14
cmpl %ebp, %ebx
jne 0x21b14
movl %ebp, %ebx
jmp 0x21b44
xorl %ebx, %ebx
jmp 0x21b44
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x21f2f
cmpw $0x2, 0x10(%rsp)
jne 0x21f47
testq %r14, %r14
je 0x21f61
leaq 0x14(%rsp), %rsi
movl $0x2, %edi
jmp 0x21f56
testq %rbx, %rbx
je 0x21f3a
movl $0x0, (%rbx)
movw $0x3f, (%r14)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x21f76
testq %r14, %r14
je 0x21f61
leaq 0x18(%rsp), %rsi
movl $0xa, %edi
movq %r14, %rdx
movl %r15d, %ecx
callq 0x1fbc0
xorl %eax, %eax
testq %rbx, %rbx
je 0x21f76
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_O3/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 0x22511
cmpl $0x0, 0x54(%r14)
jne 0x22565
movq %r14, %rdi
movl $0x1, %esi
callq 0x22270
cmpl $-0x1, 0x50(%r14)
jne 0x22565
movq 0x18(%r14), %rcx
testq %rcx, %rcx
je 0x2253f
movq 0x28(%r14), %rsi
cmpq %rcx, %rsi
jb 0x22565
cmpb $0x1, 0xa7a7a(%rip)     # 0xc9fa4
jne 0x2253a
movq %rsi, %rax
xorl %edx, %edx
divq %rcx
cmpq $0x6, %rax
jb 0x22565
addq %rsi, %rsi
jmp 0x22544
movl $0x4, %esi
movq %r14, %rdi
callq 0x221e2
testl %eax, %eax
je 0x22565
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)
movl %eax, 0x4(%rsp)
leaq 0x10(%r14), %r13
movb $0x1, %r15b
xorl %eax, %eax
shlq $0x5, %rax
movl 0x10(%r13,%rax), %r12d
andl 0x4(%rsp), %r12d
movq (%r13,%rax), %rax
movq (%rax,%r12,8), %rbp
testq %rbp, %rbp
je 0x225c1
movq (%r14), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x225b5
movq 0x8(%r14), %rdi
movq (%rbp), %rdx
movq %rbx, %rsi
callq *%rax
testl %eax, %eax
je 0x225bb
jmp 0x22550
cmpq %rbx, (%rbp)
je 0x22550
movq 0x10(%rbp), %rbp
jmp 0x22591
movl 0x50(%r14), %ecx
cmpl $-0x1, %ecx
setne %dl
movl $0x1, %eax
testb %dl, %r15b
movl $0x0, %r15d
jne 0x2257a
cmpl $-0x1, %r12d
je 0x22550
xorl %r15d, %r15d
cmpl $-0x1, %ecx
setne %r15b
shll $0x5, %r15d
movl $0x18, %edi
callq 0x299b5
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 0x22631
movq 0x8(%r14), %rdi
movq %rbx, %rsi
callq *%rax
movq %rax, %rbx
movq %rbx, (%r13)
jmp 0x22553
// File: /workspace/github_c_makefile_star2_O3/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 0x22753
movq %rsi, %rbx
movq %rdi, %r14
cmpl $-0x1, 0x50(%rdi)
je 0x226e2
cmpl $0x0, 0x54(%r14)
jne 0x226e2
movq %r14, %rdi
movl $0x1, %esi
callq 0x22270
leaq 0x10(%r14), %r12
movq (%r14), %rax
movq %rbx, %rdi
callq *(%rax)
movl %eax, %ebp
movb $0x1, %r13b
xorl %eax, %eax
shlq $0x5, %rax
movl 0x10(%r12,%rax), %ecx
andl %ebp, %ecx
movq (%r12,%rax), %rax
movq (%rax,%rcx,8), %r15
testq %r15, %r15
je 0x22736
movq (%r14), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x2272b
movq 0x8(%r14), %rdi
movq (%r15), %rdx
movq %rbx, %rsi
callq *%rax
testl %eax, %eax
je 0x22730
jmp 0x22756
cmpq %rbx, (%r15)
je 0x22756
movq 0x10(%r15), %r15
jmp 0x22708
cmpl $-0x1, 0x50(%r14)
setne %cl
movl $0x1, %eax
xorl %r15d, %r15d
testb %r13b, %cl
movl $0x0, %r13d
jne 0x226f5
jmp 0x22756
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_O3/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 0x226ac
testq %rax, %rax
je 0x229e0
movq 0x8(%rax), %rax
jmp 0x229e2
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/dict.c
// Function: dictGetSafeIterator
dictIterator *dictGetSafeIterator(dict *d) {
    dictIterator *i = dictGetIterator(d);

    // 设置安全迭代器标识
    i->safe = 1;

    return i;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x30, %edi
callq 0x299b5
movq %rbx, (%rax)
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
movq %rcx, 0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
movl $0x1, 0x10(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x22b60
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 0x22b28
cmpl $0x0, 0x10(%rbx)
je 0x22b1c
incl 0x54(%r14)
jmp 0x22b28
movq %r14, %rdi
callq 0x229e4
movq %rax, 0x28(%rbx)
incl %r13d
movl %r13d, 0xc(%rbx)
cmpl 0x8(%r12), %r13d
jl 0x22b55
xorl %eax, %eax
cmpl $-0x1, 0x50(%r14)
je 0x22b77
testl %ebp, %ebp
jne 0x22b77
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 0x22aeb
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_O3/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 0x22bff
xorl %r14d, %r14d
jmp 0x22c9c
movq %rdi, %rbx
cmpl $-0x1, 0x50(%rdi)
je 0x22c5f
cmpl $0x0, 0x54(%rbx)
jne 0x22c21
movq %rbx, %rdi
movl $0x1, %esi
callq 0x22270
cmpl $-0x1, 0x50(%rbx)
je 0x22c5f
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 0x22c4d
shlq $0x3, %rcx
addq 0x10(%rbx), %rcx
movq %rcx, %rax
jmp 0x22c55
shlq $0x3, %rax
addq 0x30(%rbx), %rax
movq (%rax), %r14
testq %r14, %r14
je 0x22c21
jmp 0x22c74
callq 0x1f9c0
movq 0x10(%rbx), %rcx
andl 0x20(%rbx), %eax
movq (%rcx,%rax,8), %r14
testq %r14, %r14
je 0x22c5f
xorl %ebx, %ebx
movq %r14, %rax
movq 0x10(%rax), %rax
incq %rbx
testq %rax, %rax
jne 0x22c79
callq 0x1f9c0
cqto
idivq %rbx
testq %rdx, %rdx
je 0x22c9c
movq 0x10(%r14), %r14
decl %edx
jne 0x22c94
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x48(%rdi), %rax
addq 0x28(%rdi), %rax
movslq %edx, %rbx
cmpq %rbx, %rax
cmovbl %eax, %ebx
testl %ebx, %ebx
jle 0x22d4d
movq %rsi, %r14
movq %rdi, %r15
leaq 0x10(%rdi), %r12
xorl %ebp, %ebp
movb $0x1, 0x7(%rsp)
xorl %r13d, %r13d
callq 0x1f9c0
shlq $0x5, %rbp
movl 0x8(%r12,%rbp), %ecx
testl %ecx, %ecx
je 0x22d2a
addq %r12, %rbp
movl 0x10(%rbp), %edx
andl %edx, %eax
decl %ecx
movl %eax, %esi
shlq $0x3, %rsi
addq (%rbp), %rsi
movq (%rsi), %rsi
testq %rsi, %rsi
je 0x22d22
movq %rsi, (%r14)
addq $0x8, %r14
addq $0x10, %rsi
incl %r13d
cmpl %r13d, %ebx
jne 0x22d05
jmp 0x22d4f
incl %eax
andl %edx, %eax
testl %ecx, %ecx
jne 0x22cf9
cmpl $-0x1, 0x50(%r15)
je 0x22d65
movl $0x1, %ebp
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x22d45
cmpl %ebx, %r13d
jge 0x22d60
xorl %ebp, %ebp
xorb $0x1, %al
movb %al, 0x7(%rsp)
jmp 0x22cdf
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r13d, %ebx
jmp 0x22d4f
leaq 0x71497(%rip), %rdi     # 0x94203
leaq 0x7d85b(%rip), %rsi     # 0xa05ce
movl $0x478, %edx            # imm = 0x478
callq 0x4ca32
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/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 0x228ea
leaq 0x30(%r14), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x228ea
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x50(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x22ff6
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
jmp 0x23008
jle 0x23001
leaq 0xa7881(%rip), %rax     # 0xca880
jmp 0x23047
leaq 0x72553(%rip), %rdi     # 0x9555b
callq 0x26b5d
movq %rax, %r14
callq 0x2845e
movslq -0x8(%r14), %rdx
leaq 0x72f5f(%rip), %rsi     # 0x95f7f
movq %rax, %rdi
xorl %eax, %eax
callq 0x28a5e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2db20
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2db20
leaq 0xa77b9(%rip), %rax     # 0xca800
movq (%rax), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2d97c
// File: /workspace/github_c_makefile_star2_O3/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 0x2308f
pushq %rbx
movq %rdi, %rbx
orl $0x5, %eax
movl %eax, 0x90(%rdi)
movq 0xa70f9(%rip), %rdi     # 0xca170
movq %rbx, %rsi
callq 0x204cb
movq 0xa7782(%rip), %rsi     # 0xca808
movq %rbx, %rdi
popq %rbx
jmp 0x2d97c
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xa731d(%rip), %r15d    # 0xca40c
jl 0x23214
movq %rsi, %rbx
movq 0xa7479(%rip), %rdi     # 0xca578
movb (%rdi), %r12b
testb %r12b, %r12b
je 0x23118
leaq 0x7f26a(%rip), %rsi     # 0xa2378
callq 0x1fa60
movq %rax, %r14
jmp 0x23122
movq 0xa2ed1(%rip), %rax     # 0xc5ff0
movq (%rax), %r14
testq %r14, %r14
je 0x23214
btl $0xa, %ebp
jb 0x231cd
movq %rsp, %rbp
movq %rbp, %rdi
xorl %esi, %esi
callq 0x1f2f0
movq %rbp, %rdi
callq 0x1fb20
leaq 0x7157b(%rip), %rdx     # 0x946cc
leaq 0x10(%rsp), %rdi
movl $0x40, %r13d
movl $0x40, %esi
movq %rax, %rcx
callq 0x1fb60
cltq
leaq (%rsp,%rax), %rdi
addq $0x10, %rdi
subq %rax, %r13
movslq 0x8(%rbp), %rax
imulq $0x10624dd3, %rax, %rcx # imm = 0x10624DD3
movq %rcx, %rax
shrq $0x3f, %rax
sarq $0x26, %rcx
addl %eax, %ecx
leaq 0x71547(%rip), %rdx     # 0x946dc
movq %r13, %rsi
xorl %eax, %eax
callq 0x1f120
callq 0x1f410
leaq 0x7151c(%rip), %rcx     # 0x946c7
movsbl (%r15,%rcx), %r8d
leaq 0x7152a(%rip), %rsi     # 0x946e1
movq %r14, %rdi
movl %eax, %edx
leaq 0x10(%rsp), %rcx
movq %rbx, %r9
xorl %eax, %eax
callq 0x1fb10
jmp 0x231d8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f6c0
movq %r14, %rdi
callq 0x1fc60
testb %r12b, %r12b
je 0x231ed
movq %r14, %rdi
callq 0x1f9a0
cmpl $0x0, 0xa738c(%rip)     # 0xca580
je 0x23214
movl %r15d, %eax
leaq 0x71040(%rip), %rcx     # 0x94240
movl (%rcx,%rax,4), %edi
leaq 0x7c278(%rip), %rsi     # 0x9f482
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1f180
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq