LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: button_logout
int button_logout() {
	wlog("call button handler %s\n", __func__);
	user_name = "<unknown>";
	user_state = USER_STATE_NOT_LOGIN;
	send_command(CLIENT_COMMAND_USER_LOGOUT);
	bottom_bar_output(0, "logout");
	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x73b8(%rip), %rsi      # 0xa160
leaq 0x32e9(%rip), %rdi      # 0x6098
leaq 0x3574(%rip), %rcx      # 0x632a
movl $0x122, %edx            # imm = 0x122
xorl %eax, %eax
callq 0x27b3
leaq 0x356f(%rip), %rax      # 0x6338
movq %rax, 0x7390(%rip)      # 0xa160
movl $0x1, 0x7392(%rip)      # 0xa16c
movl $0x3, %edi
callq 0x25b1
leaq 0x4072(%rip), %rsi      # 0x6e5d
xorl %edi, %edi
xorl %eax, %eax
callq 0x28a9
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: disable_buffer
void disable_buffer() {
	struct termio tbuf;
	wrap_get_term_attr(&tbuf);

	tbuf.c_lflag &= ~ICANON;
	tbuf.c_cc[VMIN] = raw_termio.c_cc[VMIN];

	wrap_set_term_attr(&tbuf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
leaq -0x1a(%rbp), %rbx
movq %rbx, %rdi
callq 0x2dfb
andb $-0x3, 0x6(%rbx)
movb 0x740b(%rip), %al       # 0xa267
movb %al, 0xf(%rbx)
movq %rbx, %rdi
callq 0x2e1c
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: enable_buffer
void enable_buffer() {
	struct termio tbuf;
	wrap_get_term_attr(&tbuf);

	tbuf.c_lflag |= ICANON;
	tbuf.c_cc[VMIN] = 60;

	wrap_set_term_attr(&tbuf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
leaq -0x1a(%rbp), %rbx
movq %rbx, %rdi
callq 0x2dfb
orb $0x2, 0x6(%rbx)
movb $0x3c, 0xf(%rbx)
movq %rbx, %rdi
callq 0x2e1c
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: echo_off
void echo_off() {
	struct termio tbuf;
	wrap_get_term_attr(&tbuf);

	tbuf.c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHONL);

	wrap_set_term_attr(&tbuf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
leaq -0x1a(%rbp), %rbx
movq %rbx, %rdi
callq 0x2dfb
andb $-0x79, 0x6(%rbx)
movq %rbx, %rdi
callq 0x2e1c
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: echo_on
void echo_on() {
	struct termio tbuf;
	wrap_get_term_attr(&tbuf);

	tbuf.c_lflag |= (ECHO|ECHOE|ECHOK|ECHONL);

	wrap_set_term_attr(&tbuf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
leaq -0x1a(%rbp), %rbx
movq %rbx, %rdi
callq 0x2dfb
orb $0x78, 0x6(%rbx)
movq %rbx, %rdi
callq 0x2e1c
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: readline
char *readline() {
	char ch;
	int line_ptr = 0;
	char line[LINE_MAX_LEN];
	memset(line, 0, sizeof(line));
	lock_cursor();
	echo_off();
	disable_buffer();
	while((ch = fgetc(stdin)) != '\n') {
		switch(ch) {
			case '\033':{
				ch = fgetc(stdin);
				ch = fgetc(stdin);
				assert('A' <= ch && ch <= 'D');
				break;
			}
			case 0x7f: //handle backspace(sends delete)
				if(line_ptr==0)break;
				line[--line_ptr]='\0';
				fputc(ch,stdout);
				fflush(stdout);
				break;
			default: {
				if(line_ptr < sizeof(line) - 1
				&& 0x20 <= ch && ch < 0x80) {
					line[line_ptr ++] = ch;
					fputc(ch, stdout);
					fflush(stdout);
				}
			}
		}
	}
	line[line_ptr] = 0;
	unlock_cursor();
	return strdup(line);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, -0x30(%rbp)
movl $0x0, -0x20(%rbp)
leaq 0x726a(%rip), %rdi      # 0xa230
callq 0x2200
leaq -0x42(%rbp), %rbx
movq %rbx, %rdi
callq 0x2dfb
andb $-0x79, 0x6(%rbx)
movq %rbx, %rdi
callq 0x2e1c
movq %rbx, %rdi
callq 0x2dfb
andb $-0x3, 0x6(%rbx)
movb 0x7272(%rip), %al       # 0xa267
movb %al, 0xf(%rbx)
movq %rbx, %rdi
callq 0x2e1c
movq 0x6fc9(%rip), %rbx      # 0x9fd0
movq (%rbx), %rdi
callq 0x20e0
movl %eax, %edi
shll $0x18, %edi
xorl %r14d, %r14d
cmpl $0xa000000, %edi        # imm = 0xA000000
je 0x30a5
movq 0x6f9e(%rip), %r15      # 0x9fc8
sarl $0x18, %edi
cmpl $0x7f, %edi
je 0x3054
cmpl $0x1b, %edi
jne 0x3063
movq (%rbx), %rdi
callq 0x20e0
movq (%rbx), %rdi
callq 0x20e0
movsbl %al, %eax
addl $-0x41, %eax
cmpl $0x4, %eax
jb 0x308d
jmp 0x30cb
testl %r14d, %r14d
je 0x308a
decl %r14d
movslq %r14d, %rcx
xorl %eax, %eax
jmp 0x3074
cmpl $0x12, %r14d
ja 0x308d
cmpl $0x20, %edi
jl 0x308d
movl %r14d, %ecx
incl %r14d
movb %al, -0x30(%rbp,%rcx)
movq (%r15), %rsi
callq 0x2100
movq (%r15), %rdi
callq 0x2160
jmp 0x308d
xorl %r14d, %r14d
movq (%rbx), %rdi
callq 0x20e0
movl %eax, %edi
shll $0x18, %edi
cmpl $0xa000000, %edi        # imm = 0xA000000
jne 0x302a
movslq %r14d, %r14
movb $0x0, -0x30(%rbp,%r14)
leaq 0x717e(%rip), %rdi      # 0xa230
callq 0x2150
leaq -0x30(%rbp), %rdi
callq 0x21f0
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3376(%rip), %rdi      # 0x6448
leaq 0x3386(%rip), %rsi      # 0x645f
leaq 0x3388(%rip), %rcx      # 0x6468
movl $0x1b1, %edx            # imm = 0x1B1
callq 0x20c0
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: sformat
char *sformat(const char *format, ...) {
	static char text[100];

	va_list ap;
	va_start(ap, format);
	int len = vsprintf(text, format, ap);
	va_end(ap);

	if(len >= sizeof(text))
		eprintf("buffer overflow\n");

	return text;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, %r10
leaq -0xd0(%rbp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x313d
movaps %xmm0, -0xa0(%rbp)
movaps %xmm1, -0x90(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm4, -0x60(%rbp)
movaps %xmm5, -0x50(%rbp)
movaps %xmm6, -0x40(%rbp)
movaps %xmm7, -0x30(%rbp)
leaq -0x20(%rbp), %rdx
movq %rdi, 0x10(%rdx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
leaq 0x710f(%rip), %rdi      # 0xa270
movq %r10, %rsi
callq 0x2180
cmpl $0x64, %eax
jae 0x317e
leaq 0x70fb(%rip), %rax      # 0xa270
addq $0xd0, %rsp
popq %rbp
retq
callq 0x22ef
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: accept_yesno
int accept_yesno(const char *prompt) {
	while(1) {
		char *input = accept_input(prompt);
		strlwr(input);
		if(strcmp(input, "y") == 0
		|| strcmp(input, "yes") == 0) {
			return true;
		}else if(strcmp(input, "n") == 0
		|| strcmp(input, "no") == 0) {
			return false;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x3ffc(%rip), %r14      # 0x7231
movq %rbx, %rdi
callq 0x2862
movq %rax, %r12
movb (%rax), %al
testb %al, %al
je 0x3261
leaq 0x1(%r12), %rcx
leal -0x41(%rax), %edx
cmpb $0x19, %dl
ja 0x3258
orb $0x20, %al
movb %al, -0x1(%rcx)
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x324b
movq %r12, %rdi
movq %r14, %rsi
callq 0x2120
testl %eax, %eax
je 0x32b4
movq %r12, %rdi
leaq 0x32e4(%rip), %rsi      # 0x655e
callq 0x2120
xorl %r15d, %r15d
testl %eax, %eax
je 0x32b7
movq %r12, %rdi
leaq 0x3ca7(%rip), %rsi      # 0x6f37
callq 0x2120
testl %eax, %eax
je 0x32c8
movq %r12, %rdi
leaq 0x32bf(%rip), %rsi      # 0x6562
callq 0x2120
testl %eax, %eax
setne %r15b
cmovel %eax, %r13d
jmp 0x32bd
xorl %r15d, %r15d
movl $0x1, %r13d
testb %r15b, %r15b
jne 0x3235
jmp 0x32cd
xorl %r13d, %r13d
jmp 0x32bd
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: cmd_ulist
int cmd_ulist(char *args) {
	if(user_state==USER_STATE_NOT_LOGIN)
		bottom_bar_output(0,"Please login first!");
	else
		send_command(CLIENT_COMMAND_FETCH_ALL_USERS);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x1, 0x6e77(%rip)      # 0xa16c
jne 0x3309
leaq 0x329e(%rip), %rsi      # 0x659c
xorl %edi, %edi
xorl %eax, %eax
callq 0x28a9
jmp 0x3313
movl $0x4, %edi
callq 0x25b1
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: cmd_invite
int cmd_invite(char *args) {
	if(user_state==USER_STATE_NOT_LOGIN)
	{
		bottom_bar_output(0,"Please login first!");
		return 0;
	}
	client_message_t cm;
	cm.command = CLIENT_COMMAND_INVITE_USER;
	strncpy(cm.user_name, args, USERNAME_SIZE - 1);
	wrap_send(&cm);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x38, %rsp
cmpl $0x1, 0x6e45(%rip)      # 0xa16c
jne 0x333b
leaq 0x326c(%rip), %rsi      # 0x659c
xorl %edi, %edi
xorl %eax, %eax
callq 0x28a9
jmp 0x3380
movq %rdi, %rsi
leaq -0x37(%rbp), %rdi
movb $0xa, -0x1(%rdi)
movl $0x6, %edx
callq 0x2050
xorl %ebx, %ebx
movl 0x6e00(%rip), %edi      # 0xa158
leaq (%rbx,%rbx,2), %rax
shlq $0x4, %rax
leaq (%rax,%rbp), %rsi
addq $-0x38, %rsi
movl $0x30, %edx
subq %rbx, %rdx
xorl %ecx, %ecx
callq 0x20a0
addq %rax, %rbx
cmpq $0x30, %rbx
jb 0x3352
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: cmd_yell
int cmd_yell(char *args)
{
	if(user_state==USER_STATE_NOT_LOGIN)
	{
		bottom_bar_output(0,"Please login first!");
		return 0;
	}
	char *msg=accept_input("Yell at all users: ");
	client_message_t cm;
	cm.command = CLIENT_COMMAND_SEND_MESSAGE;
	cm.user_name[0]='\0';
	strncpy(cm.message, msg, MSG_SIZE - 1);
	wrap_send(&cm);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x38, %rsp
cmpl $0x1, 0x6dd3(%rip)      # 0xa16c
jne 0x33ad
leaq 0x31fa(%rip), %rsi      # 0x659c
xorl %edi, %edi
xorl %eax, %eax
callq 0x28a9
jmp 0x3400
leaq 0x31fc(%rip), %rdi      # 0x65b0
callq 0x2862
leaq -0x30(%rbp), %rdi
movw $0xb, -0x8(%rdi)
movl $0x27, %edx
movq %rax, %rsi
callq 0x2050
xorl %ebx, %ebx
movl 0x6d80(%rip), %edi      # 0xa158
leaq (%rbx,%rbx,2), %rax
shlq $0x4, %rax
leaq (%rax,%rbp), %rsi
addq $-0x38, %rsi
movl $0x30, %edx
subq %rbx, %rdx
xorl %ecx, %ecx
callq 0x20a0
addq %rax, %rbx
cmpq $0x30, %rbx
jb 0x33d2
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: cmd_tell
int cmd_tell(char *args)
{
	if(user_state==USER_STATE_NOT_LOGIN)
	{
		bottom_bar_output(0,"Please login first!");
		return 0;
	}
	if(!args)
	{
		bottom_bar_output(0, "Input a friend, or try \"yell\"");
		return 0;
	}
	char *msg=accept_input(sformat("Speak to %s: ",args));
	client_message_t cm;
	cm.command = CLIENT_COMMAND_SEND_MESSAGE;
	strncpy(cm.user_name, args, USERNAME_SIZE - 1);
	strncpy(cm.message, msg, MSG_SIZE - 1);
	wrap_send(&cm);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
cmpl $0x1, 0x6d4f(%rip)      # 0xa16c
jne 0x342b
leaq 0x3176(%rip), %rsi      # 0x659c
jmp 0x34b3
movq %rdi, %rbx
testq %rdi, %rdi
je 0x34ac
leaq 0x31a8(%rip), %rdi      # 0x65e2
xorl %r15d, %r15d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x30ea
leaq 0x6e22(%rip), %rdi      # 0xa270
callq 0x2862
movq %rax, %r14
leaq -0x47(%rbp), %rdi
movb $0xb, -0x1(%rdi)
movl $0x6, %edx
movq %rbx, %rsi
callq 0x2050
leaq -0x40(%rbp), %rdi
movl $0x27, %edx
movq %r14, %rsi
callq 0x2050
movl 0x6cd6(%rip), %edi      # 0xa158
leaq (%r15,%r15,2), %rax
shlq $0x4, %rax
leaq (%rax,%rbp), %rsi
addq $-0x48, %rsi
movl $0x30, %edx
subq %r15, %rdx
xorl %ecx, %ecx
callq 0x20a0
addq %rax, %r15
cmpq $0x30, %r15
jb 0x347c
jmp 0x34bc
leaq 0x3111(%rip), %rsi      # 0x65c4
xorl %edi, %edi
xorl %eax, %eax
callq 0x28a9
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: cmd_help
int cmd_help(char *args) {
	if(args) {
		if(strcmp(args, "--list") == 0) {
			bottom_bar_output(0, "quit, help, ulist, invite, yell, tell");
		}else if(strcmp(args, "quit") == 0) {
			bottom_bar_output(0, "quit the game and return terminal");
		}else if(strcmp(args, "ulist") == 0) {
			bottom_bar_output(0, "list all online friends");
		}else if(strcmp(args, "invite") == 0) {
			bottom_bar_output(0, "invite friend to your battle(need args)");
		}else if(strcmp(args, "yell") == 0) {
			bottom_bar_output(0, "send message to all friends");
		}else if(strcmp(args, "tell") == 0) {
			bottom_bar_output(0, "send message to one friend(need args)");
		}else{
			bottom_bar_output(0, "no help for '%s'", args);
		}
	}else{
		bottom_bar_output(0, "usage: help [--list|command]");
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x355f
movq %rdi, %rbx
leaq 0x310e(%rip), %rsi      # 0x65f0
callq 0x2120
testl %eax, %eax
je 0x3568
leaq 0x312b(%rip), %rsi      # 0x661d
movq %rbx, %rdi
callq 0x2120
testl %eax, %eax
je 0x3571
leaq 0x313f(%rip), %rsi      # 0x6644
movq %rbx, %rdi
callq 0x2120
testl %eax, %eax
je 0x357a
leaq 0x314a(%rip), %rsi      # 0x6662
movq %rbx, %rdi
callq 0x2120
testl %eax, %eax
je 0x3583
leaq 0x3166(%rip), %rsi      # 0x6691
movq %rbx, %rdi
callq 0x2120
testl %eax, %eax
je 0x358c
leaq 0x30da(%rip), %rsi      # 0x6618
movq %rbx, %rdi
callq 0x2120
testl %eax, %eax
je 0x3595
leaq 0x3187(%rip), %rsi      # 0x66d8
xorl %edi, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x28a9
jmp 0x35a5
leaq 0x3183(%rip), %rsi      # 0x66e9
jmp 0x359c
leaq 0x3088(%rip), %rsi      # 0x65f7
jmp 0x359c
leaq 0x30aa(%rip), %rsi      # 0x6622
jmp 0x359c
leaq 0x30c9(%rip), %rsi      # 0x664a
jmp 0x359c
leaq 0x30df(%rip), %rsi      # 0x6669
jmp 0x359c
leaq 0x3103(%rip), %rsi      # 0x6696
jmp 0x359c
leaq 0x3116(%rip), %rsi      # 0x66b2
xorl %edi, %edi
xorl %eax, %eax
callq 0x28a9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: read_and_execute_command
void read_and_execute_command() {
	char *command = accept_input("command: ");
	wlog("accept command: '%s'\n", command);
	strtok(command, " \t");
	char *args = strtok(NULL, " \t");

	for(int i = 0; i < NR_HANDLER; i++) {
		if(strcmp(command, command_handler[i].cmd) == 0) {
			command_handler[i].func(args);
			return;
		}
	}

	if(strlen(command) > 0) {
		bottom_bar_output(0, "invalid command '%s'", command);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x3146(%rip), %rdi      # 0x6706
callq 0x2862
movq %rax, %rbx
movq 0x6b91(%rip), %rsi      # 0xa160
leaq 0x313a(%rip), %rdi      # 0x6710
movl $0x291, %edx            # imm = 0x291
movq %rax, %rcx
xorl %eax, %eax
callq 0x27b3
leaq 0x3141(%rip), %r14      # 0x672d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21a0
xorl %edi, %edi
movq %r14, %rsi
callq 0x21a0
movq %rax, %r14
movl $0x8, %eax
leaq 0x6640(%rip), %r12      # 0x9c50
movq %rax, %r15
movq -0x8(%rax,%r12), %rsi
movq %rbx, %rdi
callq 0x2120
testl %eax, %eax
je 0x3651
movq %r15, %rax
addq $0x10, %rax
cmpq $0x68, %rax
jne 0x3610
cmpb $0x0, (%rbx)
je 0x3665
leaq 0x30f3(%rip), %rsi      # 0x6730
xorl %edi, %edi
movq %rbx, %rdx
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x28a9
movq %r14, %rdi
movq %r15, %rax
movq %r12, %rcx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmpq *(%rax,%rcx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: flip_screen
void flip_screen() {
	lock_cursor();
	set_cursor(0, SCR_H);
	printf("\033[2J");
	unlock_cursor();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x6bb5(%rip), %rbx      # 0xa230
movq %rbx, %rdi
callq 0x2200
leaq 0x2da0(%rip), %rdi      # 0x642a
movl $0x13, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x20b0
leaq 0x30a3(%rip), %rdi      # 0x6745
xorl %eax, %eax
callq 0x20b0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2150
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: draw_button
void draw_button(uint32_t button_id) {
	int x = buttons[button_id].pos.x;
	int y = buttons[button_id].pos.y;
	const char *s = buttons[button_id].s;
	int len = strlen(s);
	lock_cursor();
	set_cursor(x, y);
	printf("┌");
	for(int i = 0; i < len; i++)
		printf("─");
	printf("┐");
	set_cursor(x, y + 1);
	printf("│");
	printf("%s", s);
	printf("│");
	set_cursor(x, y + 2);
	printf("└");
	for(int i = 0; i < len; i++)
		printf("─");
	printf("┘");
	unlock_cursor();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %eax
leaq (%rax,%rax,2), %rax
leaq 0x6a9e(%rip), %rcx      # 0xa170
movzbl (%rcx,%rax,8), %r14d
movzbl 0x1(%rcx,%rax,8), %r15d
movq 0x8(%rcx,%rax,8), %rdi
movq %rdi, -0x30(%rbp)
callq 0x2080
movq %rax, %rbx
leaq 0x6b3b(%rip), %rdi      # 0xa230
callq 0x2200
leal 0x1(%r15), %esi
incl %r14d
leaq 0x2d22(%rip), %rdi      # 0x642a
movl %r14d, %edx
xorl %eax, %eax
callq 0x20b0
leaq 0x3031(%rip), %rdi      # 0x674a
xorl %eax, %eax
callq 0x20b0
testl %ebx, %ebx
jle 0x373d
leaq 0x3023(%rip), %r13      # 0x674e
movl %ebx, %r12d
movq %r13, %rdi
xorl %eax, %eax
callq 0x20b0
decl %r12d
jne 0x372e
leaq 0x300e(%rip), %rdi      # 0x6752
xorl %eax, %eax
callq 0x20b0
leal 0x2(%r15), %esi
leaq 0x2cd4(%rip), %r12      # 0x642a
movq %r12, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x20b0
leaq 0x2fec(%rip), %r13      # 0x6756
movq %r13, %rdi
xorl %eax, %eax
callq 0x20b0
leaq 0x358e(%rip), %rdi      # 0x6d09
movq -0x30(%rbp), %rsi
xorl %eax, %eax
callq 0x20b0
movq %r13, %rdi
xorl %eax, %eax
callq 0x20b0
addl $0x3, %r15d
movq %r12, %rdi
movl %r15d, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x20b0
leaq 0x2faf(%rip), %rdi      # 0x675a
xorl %eax, %eax
callq 0x20b0
testl %ebx, %ebx
jle 0x37cb
leaq 0x2f91(%rip), %r14      # 0x674e
movq %r14, %rdi
xorl %eax, %eax
callq 0x20b0
decl %ebx
jne 0x37bd
leaq 0x2f8c(%rip), %rdi      # 0x675e
xorl %eax, %eax
callq 0x20b0
leaq 0x6a50(%rip), %rdi      # 0xa230
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2150
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: draw_selected_button
void draw_selected_button(uint32_t button_id) {
	int x = buttons[button_id].pos.x;
	int y = buttons[button_id].pos.y;
	const char *s = buttons[button_id].s;
	int len = strlen(s);
	lock_cursor();
	set_cursor(x, y);
	printf("\033[1m");
	printf("┏");
	for(int i = 0; i < len; i++)
		printf("━");
	printf("┓");
	set_cursor(x, y + 1);
	printf("┃");
	printf("%s", s);
	printf("┃");
	set_cursor(x, y + 2);
	printf("┗");
	for(int i = 0; i < len; i++)
		printf("━");
	printf("┛");
	printf("\033[0m");
	unlock_cursor();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %eax
leaq (%rax,%rax,2), %rax
leaq 0x6962(%rip), %rcx      # 0xa170
movzbl (%rcx,%rax,8), %r14d
movzbl 0x1(%rcx,%rax,8), %r15d
movq 0x8(%rcx,%rax,8), %rdi
movq %rdi, -0x30(%rbp)
callq 0x2080
movq %rax, %rbx
leaq 0x69ff(%rip), %rdi      # 0xa230
callq 0x2200
leal 0x1(%r15), %esi
incl %r14d
leaq 0x2be6(%rip), %rdi      # 0x642a
movl %r14d, %edx
xorl %eax, %eax
callq 0x20b0
leaq 0x2f0d(%rip), %rdi      # 0x6762
xorl %eax, %eax
callq 0x20b0
leaq 0x2f04(%rip), %rdi      # 0x6767
xorl %eax, %eax
callq 0x20b0
testl %ebx, %ebx
jle 0x3887
leaq 0x2ef6(%rip), %r13      # 0x676b
movl %ebx, %r12d
movq %r13, %rdi
xorl %eax, %eax
callq 0x20b0
decl %r12d
jne 0x3878
leaq 0x2ee1(%rip), %rdi      # 0x676f
xorl %eax, %eax
callq 0x20b0
leal 0x2(%r15), %esi
leaq 0x2b8a(%rip), %r13      # 0x642a
movq %r13, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x20b0
leaq 0x2ebf(%rip), %r12      # 0x6773
movq %r12, %rdi
xorl %eax, %eax
callq 0x20b0
leaq 0x3444(%rip), %rdi      # 0x6d09
movq -0x30(%rbp), %rsi
xorl %eax, %eax
callq 0x20b0
movq %r12, %rdi
xorl %eax, %eax
callq 0x20b0
addl $0x3, %r15d
movq %r13, %rdi
movl %r15d, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x20b0
leaq 0x2e82(%rip), %rdi      # 0x6777
xorl %eax, %eax
callq 0x20b0
testl %ebx, %ebx
jle 0x3915
leaq 0x2e64(%rip), %r14      # 0x676b
movq %r14, %rdi
xorl %eax, %eax
callq 0x20b0
decl %ebx
jne 0x3907
leaq 0x2e5f(%rip), %rdi      # 0x677b
xorl %eax, %eax
callq 0x20b0
leaq 0x2e55(%rip), %rdi      # 0x677f
xorl %eax, %eax
callq 0x20b0
leaq 0x68f8(%rip), %rdi      # 0xa230
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2150
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: run_battle
void run_battle() {
	wlog("run battle\n");
	flip_screen();
	bottom_bar_output(0,"type <TAB> to enter command mode and invite more friends\n");
	echo_off();
	disable_buffer();
	while(user_state == USER_STATE_BATTLE) {
		int ch = fgetc(stdin);
		if(ch == 'q') {
			wlog("type q and quit battle\n");
			user_state = USER_STATE_LOGIN;
			send_command(CLIENT_COMMAND_QUIT_BATTLE);
			send_command(CLIENT_COMMAND_FETCH_ALL_FRIENDS);
			break;
		}else if(ch == '\t') {
			wlog("type <TAB> and enter command mode\n");
			read_and_execute_command();
		}

		switch(ch) {
			case 'w':send_command(CLIENT_COMMAND_MOVE_UP);break;
			case 's':send_command(CLIENT_COMMAND_MOVE_DOWN);break;
			case 'a':send_command(CLIENT_COMMAND_MOVE_LEFT);break;
			case 'd':send_command(CLIENT_COMMAND_MOVE_RIGHT);break;
			case ' ':send_command(CLIENT_COMMAND_FIRE);break;
		}
	}

	flip_screen();
	wlog("exit run_battle\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq 0x6558(%rip), %rsi      # 0xa160
leaq 0x2b80(%rip), %rdi      # 0x678f
movl $0x311, %edx            # imm = 0x311
xorl %eax, %eax
callq 0x27b3
callq 0x366e
leaq 0x2b7b(%rip), %rsi      # 0x67a2
xorl %edi, %edi
xorl %eax, %eax
callq 0x28a9
leaq -0x32(%rbp), %rbx
movq %rbx, %rdi
callq 0x2dfb
andb $-0x79, 0x6(%rbx)
movq %rbx, %rdi
callq 0x2e1c
movq %rbx, %rdi
callq 0x2dfb
andb $-0x3, 0x6(%rbx)
movb 0x660d(%rip), %al       # 0xa267
movb %al, 0xf(%rbx)
movq %rbx, %rdi
callq 0x2e1c
cmpl $0x3, 0x6500(%rip)      # 0xa16c
jne 0x3d50
movq 0x6357(%rip), %r15      # 0x9fd0
leaq 0x2b7b(%rip), %rbx      # 0x67fb
leaq 0x2b55(%rip), %r14      # 0x67dc
movq (%r15), %rdi
callq 0x20e0
movb $0x1, %r12b
cmpl $0x63, %eax
jle 0x3ce2
cmpl $0x72, %eax
jg 0x3cf8
cmpl $0x64, %eax
je 0x3d26
cmpl $0x71, %eax
jne 0x3d3e
movq 0x64ab(%rip), %rsi      # 0xa160
xorl %r12d, %r12d
movq %r14, %rdi
movl $0x319, %edx            # imm = 0x319
xorl %eax, %eax
callq 0x27b3
movl $0x2, 0x649b(%rip)      # 0xa16c
movl $0x7, %edi
callq 0x25b1
movl $0x5, %edi
jmp 0x3d39
cmpl $0x9, %eax
je 0x3d09
cmpl $0x20, %eax
je 0x3d34
cmpl $0x61, %eax
jne 0x3d3e
movl $0xe, %edi
jmp 0x3d39
cmpl $0x73, %eax
je 0x3d2d
cmpl $0x77, %eax
jne 0x3d3e
movl $0xc, %edi
jmp 0x3d39
movq 0x6450(%rip), %rsi      # 0xa160
movq %rbx, %rdi
movl $0x31f, %edx            # imm = 0x31F
xorl %eax, %eax
callq 0x27b3
callq 0x35ae
jmp 0x3d3e
movl $0xf, %edi
jmp 0x3d39
movl $0xd, %edi
jmp 0x3d39
movl $0x10, %edi
callq 0x25b1
testb %r12b, %r12b
je 0x3d50
cmpl $0x3, 0x6422(%rip)      # 0xa16c
je 0x3c87
callq 0x366e
movq 0x6404(%rip), %rsi      # 0xa160
leaq 0x2ac2(%rip), %rdi      # 0x6825
movl $0x32d, %edx            # imm = 0x32D
xorl %eax, %eax
callq 0x27b3
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: draw_button_in_main_ui
void draw_button_in_main_ui() {
	draw_button(buttonLaunchBattle);
	draw_button(buttonInviteUser);
	draw_button(buttonJoinBattle);
	draw_button(buttonLogout);
	draw_catalog(&friend_list);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x3, %edi
callq 0x36b7
movl $0x4, %edi
callq 0x36b7
movl $0x5, %edi
callq 0x36b7
movl $0x6, %edi
callq 0x36b7
leaq 0x61ad(%rip), %rdi      # 0xa120
popq %rbp
jmp 0x394b
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: main_ui
void main_ui() {
	flip_screen();
	while(1) {
		draw_button_in_main_ui();
		display_user_state();
		int sel = switch_selected_button_respond_to_key(3, 7);
		wlog("user select %d\n", sel);

		int ret_code = buttons[sel].button_func();
		wlog("button handler return %d\n", ret_code);

		if(ret_code < 0 || user_state == USER_STATE_NOT_LOGIN) {
			flip_screen();
			wlog("quit main ui with user_state:%d\n", user_state);
			break;
		}

		if(user_state == USER_STATE_BATTLE) {
			wlog("enter battle mode\n");
			run_battle();
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x366e
leaq 0x255d(%rip), %rbx      # 0x64f0
leaq 0x292e(%rip), %r14      # 0x68c8
leaq 0x61cf(%rip), %r13      # 0xa170
leaq 0x2937(%rip), %r15      # 0x68df
callq 0x3f40
movl 0x61b9(%rip), %eax      # 0xa16c
movq 0x61a6(%rip), %rdx      # 0xa160
movl 0x6314(%rip), %ecx      # 0xa2d4
movl 0x6311(%rip), %r8d      # 0xa2d8
leaq 0x5c62(%rip), %rsi      # 0x9c30
movq (%rsi,%rax,8), %r9
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movq %rbx, %rsi
xorl %eax, %eax
callq 0x28a9
movl $0x3, %edi
movl $0x7, %esi
callq 0x3d7c
movl %eax, %r12d
movq 0x6166(%rip), %rsi      # 0xa160
movq %r14, %rdi
movl $0x372, %edx            # imm = 0x372
movl %eax, %ecx
xorl %eax, %eax
callq 0x27b3
movslq %r12d, %rax
leaq (%rax,%rax,2), %rcx
xorl %eax, %eax
callq *0x10(%r13,%rcx,8)
movl %eax, %r12d
movq 0x613d(%rip), %rsi      # 0xa160
movq %r15, %rdi
movl $0x375, %edx            # imm = 0x375
movl %eax, %ecx
xorl %eax, %eax
callq 0x27b3
testl %r12d, %r12d
setns %cl
movl 0x612c(%rip), %eax      # 0xa16c
cmpl $0x1, %eax
setne %r12b
andb %cl, %r12b
je 0x4072
cmpl $0x3, %eax
jne 0x4097
movq 0x6108(%rip), %rsi      # 0xa160
leaq 0x28c9(%rip), %rdi      # 0x6928
movl $0x37e, %edx            # imm = 0x37E
xorl %eax, %eax
callq 0x27b3
callq 0x3bf2
jmp 0x4097
callq 0x366e
movq 0x60e2(%rip), %rsi      # 0xa160
movl 0x60e8(%rip), %ecx      # 0xa16c
leaq 0x2875(%rip), %rdi      # 0x6900
movl $0x379, %edx            # imm = 0x379
xorl %eax, %eax
callq 0x27b3
testb %r12b, %r12b
jne 0x3fa8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: start_ui
void start_ui() {
	wlog("enter start ui\n");
	bottom_bar_output(0, "type w s a d to switch button, type <TAB> to enter command");
	while(1) {
		draw_button_in_start_ui();
		display_user_state();
		int sel = switch_selected_button_respond_to_key(0, 3);
		wlog("user select %d@%s\n", sel, buttons[sel].s);
		buttons[sel].button_func();

		if(user_state == USER_STATE_LOGIN) {
			wlog("user state changed into LOGIN\n");
			wlog("enter main ui\n");
			main_ui();
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x607c(%rip), %rsi      # 0xa160
leaq 0x2857(%rip), %rdi      # 0x6942
movl $0x38b, %edx            # imm = 0x38B
xorl %eax, %eax
callq 0x27b3
leaq 0x285b(%rip), %rsi      # 0x6959
xorl %edi, %edi
xorl %eax, %eax
callq 0x28a9
leaq 0x5b22(%rip), %r13      # 0x9c30
leaq 0x23db(%rip), %rbx      # 0x64f0
leaq 0x6054(%rip), %r15      # 0xa170
leaq 0x2871(%rip), %r14      # 0x6994
callq 0x40af
movl 0x603e(%rip), %eax      # 0xa16c
movq 0x602b(%rip), %rdx      # 0xa160
movl 0x6199(%rip), %ecx      # 0xa2d4
movl 0x6196(%rip), %r8d      # 0xa2d8
movq (%r13,%rax,8), %r9
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movq %rbx, %rsi
xorl %eax, %eax
callq 0x28a9
xorl %edi, %edi
movl $0x3, %esi
callq 0x3d7c
movq 0x5ff7(%rip), %rsi      # 0xa160
movslq %eax, %rcx
leaq (%rcx,%rcx,2), %r12
movq 0x8(%r15,%r12,8), %r8
movq %r14, %rdi
movl $0x391, %edx            # imm = 0x391
xorl %eax, %eax
callq 0x27b3
xorl %eax, %eax
callq *0x10(%r15,%r12,8)
cmpl $0x2, 0x5fda(%rip)      # 0xa16c
jne 0x4123
movq 0x5fc5(%rip), %rsi      # 0xa160
leaq 0x280c(%rip), %rdi      # 0x69ae
movl $0x395, %edx            # imm = 0x395
xorl %eax, %eax
callq 0x27b3
movq 0x5fab(%rip), %rsi      # 0xa160
leaq 0x2818(%rip), %rdi      # 0x69d4
movl $0x396, %edx            # imm = 0x396
xorl %eax, %eax
callq 0x27b3
callq 0x3f79
jmp 0x4123
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: serv_response_login_success
int serv_response_login_success(server_message_t *psm) {
	wlog("call message handler %s\n", __func__);
	wlog("==> try server_say\n");
	server_say("welcome to simple net-based game");
	wlog("==> change user_state from %s into %s\n", user_state_s[user_state], user_state_s[USER_STATE_LOGIN]);
	user_state = USER_STATE_LOGIN;
	wlog("==> update user state to screen\n");
	display_user_state();
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x5e65(%rip), %rsi      # 0xa160
leaq 0x26e8(%rip), %rdi      # 0x69ea
leaq 0x27d1(%rip), %rcx      # 0x6ada
movl $0x3b6, %edx            # imm = 0x3B6
xorl %eax, %eax
callq 0x27b3
movq 0x5e44(%rip), %rsi      # 0xa160
leaq 0x27d3(%rip), %rdi      # 0x6af6
movl $0x3b7, %edx            # imm = 0x3B7
xorl %eax, %eax
callq 0x27b3
leaq 0x21e3(%rip), %rsi      # 0x6519
leaq 0x1d1b(%rip), %rdx      # 0x6058
leaq 0x27cd(%rip), %rcx      # 0x6b11
xorl %edi, %edi
xorl %eax, %eax
callq 0x28a9
movq 0x5e0c(%rip), %rsi      # 0xa160
movl 0x5e12(%rip), %eax      # 0xa16c
leaq 0x58cf(%rip), %rbx      # 0x9c30
movq (%rbx,%rax,8), %rcx
leaq 0x27c6(%rip), %rdi      # 0x6b32
leaq 0x2bc0(%rip), %r8       # 0x6f33
movl $0x3b9, %edx            # imm = 0x3B9
xorl %eax, %eax
callq 0x27b3
movl $0x2, 0x5de3(%rip)      # 0xa16c
movq 0x5dd0(%rip), %rsi      # 0xa160
leaq 0x27c9(%rip), %rdi      # 0x6b60
movl $0x3bb, %edx            # imm = 0x3BB
xorl %eax, %eax
callq 0x27b3
movl 0x5dc3(%rip), %eax      # 0xa16c
movq 0x5db0(%rip), %rdx      # 0xa160
movl 0x5f1e(%rip), %ecx      # 0xa2d4
movl 0x5f1b(%rip), %r8d      # 0xa2d8
movq (%rbx,%rax,8), %r9
leaq 0x2128(%rip), %rsi      # 0x64f0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x28a9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: serv_response_login_fail_unregistered_userid
int serv_response_login_fail_unregistered_userid(server_message_t *psm) {
	wlog("call message handler %s\n", __func__);
	server_say("your name hasn't been registered!");
	display_user_state();
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x5d78(%rip), %rsi      # 0xa160
leaq 0x25fb(%rip), %rdi      # 0x69ea
leaq 0x2792(%rip), %rcx      # 0x6b88
movl $0x3c1, %edx            # imm = 0x3C1
xorl %eax, %eax
callq 0x27b3
leaq 0x2110(%rip), %rsi      # 0x6519
leaq 0x1c48(%rip), %rdx      # 0x6058
leaq 0x279e(%rip), %rcx      # 0x6bb5
xorl %edi, %edi
xorl %eax, %eax
callq 0x28a9
movl 0x5d46(%rip), %eax      # 0xa16c
movq 0x5d33(%rip), %rdx      # 0xa160
movl 0x5ea1(%rip), %ecx      # 0xa2d4
movl 0x5e9e(%rip), %r8d      # 0xa2d8
leaq 0x57ef(%rip), %rsi      # 0x9c30
movq (%rsi,%rax,8), %r9
leaq 0x20a4(%rip), %rsi      # 0x64f0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x28a9
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: serv_response_login_fail_error_password
int serv_response_login_fail_error_password(server_message_t *psm) {
	wlog("call message handler %s\n", __func__);
	server_say("error password!");
	display_user_state();
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x5cf9(%rip), %rsi      # 0xa160
leaq 0x257c(%rip), %rdi      # 0x69ea
leaq 0x2762(%rip), %rcx      # 0x6bd7
movl $0x3c8, %edx            # imm = 0x3C8
xorl %eax, %eax
callq 0x27b3
leaq 0x2091(%rip), %rsi      # 0x6519
leaq 0x1bc9(%rip), %rdx      # 0x6058
leaq 0x2769(%rip), %rcx      # 0x6bff
xorl %edi, %edi
xorl %eax, %eax
callq 0x28a9
movl 0x5cc7(%rip), %eax      # 0xa16c
movq 0x5cb4(%rip), %rdx      # 0xa160
movl 0x5e22(%rip), %ecx      # 0xa2d4
movl 0x5e1f(%rip), %r8d      # 0xa2d8
leaq 0x5770(%rip), %rsi      # 0x9c30
movq (%rsi,%rax,8), %r9
leaq 0x2025(%rip), %rsi      # 0x64f0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x28a9
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: serv_response_login_fail_dup_userid
int serv_response_login_fail_dup_userid(server_message_t *psm) {
	wlog("call message handler %s\n", __func__);
	server_say("you have logined in another place!");
	display_user_state();
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x5c7a(%rip), %rsi      # 0xa160
leaq 0x24fd(%rip), %rdi      # 0x69ea
leaq 0x271b(%rip), %rcx      # 0x6c0f
movl $0x3cf, %edx            # imm = 0x3CF
xorl %eax, %eax
callq 0x27b3
leaq 0x2012(%rip), %rsi      # 0x6519
leaq 0x1b4a(%rip), %rdx      # 0x6058
leaq 0x271e(%rip), %rcx      # 0x6c33
xorl %edi, %edi
xorl %eax, %eax
callq 0x28a9
movl 0x5c48(%rip), %eax      # 0xa16c
movq 0x5c35(%rip), %rdx      # 0xa160
movl 0x5da3(%rip), %ecx      # 0xa2d4
movl 0x5da0(%rip), %r8d      # 0xa2d8
leaq 0x56f1(%rip), %rsi      # 0x9c30
movq (%rsi,%rax,8), %r9
leaq 0x1fa6(%rip), %rsi      # 0x64f0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x28a9
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: serv_response_login_fail_server_limits
int serv_response_login_fail_server_limits(server_message_t *psm) {
	wlog("call message handler %s\n", __func__);
	server_say("server fail");
	display_user_state();
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x5bfb(%rip), %rsi      # 0xa160
leaq 0x247e(%rip), %rdi      # 0x69ea
leaq 0x26e3(%rip), %rcx      # 0x6c56
movl $0x3d6, %edx            # imm = 0x3D6
xorl %eax, %eax
callq 0x27b3
leaq 0x1f93(%rip), %rsi      # 0x6519
leaq 0x1acb(%rip), %rdx      # 0x6058
leaq 0x26e9(%rip), %rcx      # 0x6c7d
xorl %edi, %edi
xorl %eax, %eax
callq 0x28a9
movl 0x5bc9(%rip), %eax      # 0xa16c
movq 0x5bb6(%rip), %rdx      # 0xa160
movl 0x5d24(%rip), %ecx      # 0xa2d4
movl 0x5d21(%rip), %r8d      # 0xa2d8
leaq 0x5672(%rip), %rsi      # 0x9c30
movq (%rsi,%rax,8), %r9
leaq 0x1f27(%rip), %rsi      # 0x64f0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x28a9
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: serv_response_all_users_info
int serv_response_all_users_info(server_message_t *psm) {
	int len = 0;
	static char users[USERNAME_SIZE * USER_CNT];
	wlog("call message handler %s\n", __func__);
	for(int i = 0; i < USER_CNT; i++) {
		int state = psm->all_users[i].user_state;
		if(state != USER_STATE_UNUSED
		&& state != USER_STATE_NOT_LOGIN) {
			len += sprintf(users + len, "%s, ", psm->all_users[i].user_name);
		}
	}
	if(len > sizeof(users) - 1)
		eprintf("buffer overflow\n");

	users[len - 2] = 0;
	wlog("server response user list: %s\n", users);
	bottom_bar_output(0, "online: %s", users);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x5b28(%rip), %rsi      # 0xa160
leaq 0x23ab(%rip), %rdi      # 0x69ea
leaq 0x2673(%rip), %rcx      # 0x6cb9
movl $0x3e5, %edx            # imm = 0x3E5
xorl %eax, %eax
callq 0x27b3
leaq 0x1(%r14), %r13
leaq 0x2679(%rip), %r15      # 0x6cd6
xorl %ebx, %ebx
xorl %r12d, %r12d
cmpb $0x2, 0x8(%r14,%rbx)
jb 0x4689
leaq (%rbx,%r13), %rdx
movslq %r12d, %r12
leaq 0x5c68(%rip), %rax      # 0xa2e0
leaq (%rax,%r12), %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x21c0
addl %eax, %r12d
addq $0x8, %rbx
cmpq $0x28, %rbx
jne 0x4662
cmpl $0x22, %r12d
ja 0x46e9
movslq %r12d, %rax
leaq 0x5c3d(%rip), %rbx      # 0xa2e0
movb $0x0, -0x2(%rax,%rbx)
movq 0x5ab1(%rip), %rsi      # 0xa160
leaq 0x2625(%rip), %rdi      # 0x6cdb
movl $0x3f1, %edx            # imm = 0x3F1
movq %rbx, %rcx
xorl %eax, %eax
callq 0x27b3
leaq 0x2635(%rip), %rsi      # 0x6d01
xorl %edi, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x28a9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x231e
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: serv_response_all_friends_info
int serv_response_all_friends_info(server_message_t *psm) {
	int j = 0;
	wlog("call message handler %s\n", __func__);
	for(int i = 0; i < USER_CNT; i++) {
		int state = psm->all_users[i].user_state;
		if(state != USER_STATE_UNUSED
		&& state != USER_STATE_NOT_LOGIN) {
			strncpy(friend_list.records[j ++],
					psm->all_users[i].user_name,
					USERNAME_SIZE - 1);
		}
	}
	wlog("draw catalogs of friends\n");
	draw_catalog(&friend_list);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x5a5a(%rip), %rsi      # 0xa160
leaq 0x22dd(%rip), %rdi      # 0x69ea
leaq 0x25f8(%rip), %rcx      # 0x6d0c
xorl %r14d, %r14d
movl $0x3f8, %edx            # imm = 0x3F8
xorl %eax, %eax
callq 0x27b3
leaq 0x1(%rbx), %r15
leaq 0x59f2(%rip), %r12      # 0xa120
xorl %r13d, %r13d
cmpb $0x2, 0x8(%rbx,%r14)
jb 0x4760
leaq (%r15,%r14), %rsi
movslq %r13d, %rax
incl %r13d
leaq (,%rax,8), %rcx
subq %rax, %rcx
leaq (%rcx,%r12), %rdi
addq $0x10, %rdi
movl $0x6, %edx
callq 0x2050
addq $0x8, %r14
cmpq $0x28, %r14
jne 0x4731
movq 0x59ef(%rip), %rsi      # 0xa160
leaq 0x25b3(%rip), %rdi      # 0x6d2b
movl $0x402, %edx            # imm = 0x402
xorl %eax, %eax
callq 0x27b3
leaq 0x5995(%rip), %rdi      # 0xa120
callq 0x394b
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: serv_response_launch_battle_success
int serv_response_launch_battle_success(server_message_t *psm) {
	wlog("call message handler %s\n", __func__);
	server_say("launch battle success");
	user_state = USER_STATE_BATTLE;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x596d(%rip), %rsi      # 0xa160
leaq 0x21f0(%rip), %rdi      # 0x69ea
leaq 0x2581(%rip), %rcx      # 0x6d82
movl $0x40e, %edx            # imm = 0x40E
xorl %eax, %eax
callq 0x27b3
leaq 0x1d05(%rip), %rsi      # 0x6519
leaq 0x183d(%rip), %rdx      # 0x6058
leaq 0x2584(%rip), %rcx      # 0x6da6
xorl %edi, %edi
xorl %eax, %eax
callq 0x28a9
movl $0x3, 0x5937(%rip)      # 0xa16c
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: serv_response_nobody_invite_you
int serv_response_nobody_invite_you(server_message_t *psm) {
	wlog("call message handler %s\n", __func__);
	server_say("no body invite you");
	user_state = USER_STATE_LOGIN;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x591c(%rip), %rsi      # 0xa160
leaq 0x219f(%rip), %rdi      # 0x69ea
leaq 0x256a(%rip), %rcx      # 0x6dbc
movl $0x415, %edx            # imm = 0x415
xorl %eax, %eax
callq 0x27b3
leaq 0x1cb4(%rip), %rsi      # 0x6519
leaq 0x17ec(%rip), %rdx      # 0x6058
leaq 0x2569(%rip), %rcx      # 0x6ddc
xorl %edi, %edi
xorl %eax, %eax
callq 0x28a9
movl $0x2, 0x58e6(%rip)      # 0xa16c
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: serv_msg_friend_login
int serv_msg_friend_login(server_message_t *psm) {
	wlog("call message handler %s\n", __func__);
	for(int i = 0; i < USER_CNT; i++) {
		if(friend_list.records[i][0] == 0) {
			strncpy(friend_list.records[i], psm->friend_name, USERNAME_SIZE - 1);
			break;
		}
	}
	if(user_state == USER_STATE_LOGIN)
		draw_catalog(&friend_list);
	server_say(sformat("friend %s login\n", psm->friend_name));
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x587f(%rip), %rsi      # 0xa160
leaq 0x2102(%rip), %rdi      # 0x69ea
leaq 0x2537(%rip), %rcx      # 0x6e26
movl $0x422, %edx            # imm = 0x422
xorl %eax, %eax
callq 0x27b3
movl $0x10, %eax
leaq 0x5819(%rip), %rdi      # 0xa120
cmpb $0x0, (%rax,%rdi)
je 0x4919
addq $0x7, %rax
cmpq $0x33, %rax
jne 0x4907
jmp 0x492a
leaq 0x1(%rbx), %rsi
addq %rax, %rdi
movl $0x6, %edx
callq 0x2050
cmpl $0x2, 0x583b(%rip)      # 0xa16c
jne 0x493f
leaq 0x57e6(%rip), %rdi      # 0xa120
callq 0x394b
incq %rbx
leaq 0x24f3(%rip), %rdi      # 0x6e3c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x30ea
leaq 0x1bbf(%rip), %rsi      # 0x6519
leaq 0x16f7(%rip), %rdx      # 0x6058
leaq 0x5908(%rip), %rcx      # 0xa270
xorl %edi, %edi
xorl %eax, %eax
callq 0x28a9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: serv_msg_friend_logout
int serv_msg_friend_logout(server_message_t *psm) {
	wlog("call message handler %s\n", __func__);
	for(int i = 0; i < USER_CNT; i++) {
		if(strncmp(friend_list.records[i], psm->friend_name, USERNAME_SIZE - 1) == 0) {
			friend_list.records[i][0] = 0;
			break;
		}
	}
	if(user_state == USER_STATE_LOGIN)
		draw_catalog(&friend_list);
	server_say(sformat("friend %s logout\n", psm->friend_name));
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x57d2(%rip), %rsi      # 0xa160
leaq 0x2055(%rip), %rdi      # 0x69ea
leaq 0x24b1(%rip), %rcx      # 0x6e4d
movl $0x430, %edx            # imm = 0x430
xorl %eax, %eax
callq 0x27b3
incq %rbx
movl $0x10, %r14d
leaq 0x5768(%rip), %r15      # 0xa120
leaq (%r15,%r14), %rdi
movl $0x6, %edx
movq %rbx, %rsi
callq 0x2060
testl %eax, %eax
je 0x49d9
addq $0x7, %r14
cmpq $0x33, %r14
jne 0x49b8
jmp 0x49de
movb $0x0, (%r14,%r15)
cmpl $0x2, 0x5787(%rip)      # 0xa16c
jne 0x49f3
leaq 0x5732(%rip), %rdi      # 0xa120
callq 0x394b
leaq 0x246a(%rip), %rdi      # 0x6e64
movq %rbx, %rsi
xorl %eax, %eax
callq 0x30ea
leaq 0x1b0e(%rip), %rsi      # 0x6519
leaq 0x1646(%rip), %rdx      # 0x6058
leaq 0x5857(%rip), %rcx      # 0xa270
xorl %edi, %edi
xorl %eax, %eax
callq 0x28a9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: serv_msg_reject_battle
int serv_msg_reject_battle(server_message_t *psm) {
	wlog("call message handler %s\n", __func__);
	wlog("friend '%s' reject battle\n", psm->friend_name);
	server_say(sformat("friend %s reject your invitation", psm->friend_name));
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x56bc(%rip), %rsi      # 0xa160
leaq 0x1f3f(%rip), %rdi      # 0x69ea
leaq 0x23fc(%rip), %rcx      # 0x6eae
movl $0x444, %edx            # imm = 0x444
xorl %eax, %eax
callq 0x27b3
movq 0x569b(%rip), %rsi      # 0xa160
incq %rbx
leaq 0x23f6(%rip), %rdi      # 0x6ec5
movl $0x445, %edx            # imm = 0x445
movq %rbx, %rcx
xorl %eax, %eax
callq 0x27b3
leaq 0x2402(%rip), %rdi      # 0x6ee7
movq %rbx, %rsi
xorl %eax, %eax
callq 0x30ea
leaq 0x1a23(%rip), %rsi      # 0x6519
leaq 0x155b(%rip), %rdx      # 0x6058
leaq 0x576c(%rip), %rcx      # 0xa270
xorl %edi, %edi
xorl %eax, %eax
callq 0x28a9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: serv_msg_you_are_invited
int serv_msg_you_are_invited(server_message_t *psm) {
	// FIXME:
	wlog("call message handler %s\n", __func__);
	server_say(sformat("friend %s invite you to his battle [press button to join]", psm->friend_name));
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x5570(%rip), %rsi      # 0xa160
leaq 0x1df3(%rip), %rdi      # 0x69ea
leaq 0x237f(%rip), %rcx      # 0x6f7d
movl $0x458, %edx            # imm = 0x458
xorl %eax, %eax
callq 0x27b3
incq %rbx
leaq 0x2382(%rip), %rdi      # 0x6f96
movq %rbx, %rsi
xorl %eax, %eax
callq 0x30ea
leaq 0x18f4(%rip), %rsi      # 0x6519
leaq 0x142c(%rip), %rdx      # 0x6058
leaq 0x563d(%rip), %rcx      # 0xa270
xorl %edi, %edi
xorl %eax, %eax
callq 0x28a9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: flip_old_items
void flip_old_items(server_message_t *psm) {
	static server_message_t sm = {0};
	wlog("call flip old items\n");
	lock_cursor();
	for(int i = 0; i < USER_CNT; i++) {
		if(sm.user_pos[i].x >= BATTLE_W
		|| sm.user_pos[i].y >= BATTLE_H)
			continue;

		wlog("clear user %d@(%d, %d)\n", i, sm.user_pos[i].x, sm.user_pos[i].y);
		set_cursor(sm.user_pos[i].x, sm.user_pos[i].y);
		printf(" ");
	}

	for(int i = 0; i < MAX_ITEM; i++) {
		if(sm.item_kind[i] != ITEM_BULLET)
			continue;

		set_cursor(sm.item_pos[i].x, sm.item_pos[i].y);
		printf(" ");
	}

	fflush(stdout);

	unlock_cursor();
	memcpy(&sm, psm, sizeof(server_message_t));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x53ed(%rip), %rsi      # 0xa160
leaq 0x22d1(%rip), %rdi      # 0x704b
movl $0x472, %edx            # imm = 0x472
xorl %eax, %eax
callq 0x27b3
leaq 0x54a3(%rip), %rdi      # 0xa230
callq 0x2200
leaq 0x556a(%rip), %r13      # 0xa303
leaq 0x22c7(%rip), %r14      # 0x7067
leaq 0x1683(%rip), %r15      # 0x642a
xorl %r12d, %r12d
movzbl 0x4(%r13,%r12,2), %r8d
cmpl $0x3b, %r8d
ja 0x4dff
movzbl 0x5(%r13,%r12,2), %r9d
cmpl $0xf, %r9d
ja 0x4dff
movq 0x5397(%rip), %rsi      # 0xa160
movq %r14, %rdi
movl $0x479, %edx            # imm = 0x479
movl %r12d, %ecx
xorl %eax, %eax
callq 0x27b3
movzbl 0x4(%r13,%r12,2), %edx
movzbl 0x5(%r13,%r12,2), %esi
incl %esi
incl %edx
movq %r15, %rdi
xorl %eax, %eax
callq 0x20b0
movl $0x20, %edi
callq 0x2040
incq %r12
cmpq $0x5, %r12
jne 0x4daa
movl $0x4b, %r15d
leaq 0x1615(%rip), %r14      # 0x642a
cmpb $0x6, -0x3d(%r15,%r13)
jne 0x4e41
movzbl -0x1(%r13,%r15,2), %edx
movzbl (%r13,%r15,2), %esi
incl %esi
incl %edx
movq %r14, %rdi
xorl %eax, %eax
callq 0x20b0
movl $0x20, %edi
callq 0x2040
incq %r15
cmpq $0xd2, %r15
jne 0x4e15
movq 0x5174(%rip), %rax      # 0x9fc8
movq (%rax), %rdi
callq 0x2160
leaq 0x53cd(%rip), %rdi      # 0xa230
callq 0x2150
leaq 0x5494(%rip), %rdi      # 0xa303
movl $0x1a3, %edx            # imm = 0x1A3
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2140
// File: /workspace/github_c_makefile_star2_O1/wierton[P]socket-based-naive-game/client.c
// Function: draw_users
void draw_users(server_message_t *psm) {
	lock_cursor();
	for(int i = 0; i < USER_CNT; i++) {
		if(psm->user_pos[i].x >= BATTLE_W
		|| psm->user_pos[i].y >= BATTLE_H)
			continue;

		set_cursor(psm->user_pos[i].x, psm->user_pos[i].y);
		if(i == psm->index)
			printf("Y");
		else
			printf("A");
	}

	fflush(stdout);
	unlock_cursor();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x5391(%rip), %rdi      # 0xa230
callq 0x2200
leaq 0x157f(%rip), %r14      # 0x642a
movl $0x59, %r15d
xorl %r12d, %r12d
movzbl 0x4(%rbx,%r12,2), %edx
cmpl $0x3b, %edx
ja 0x4eed
movzbl 0x5(%rbx,%r12,2), %esi
cmpl $0xf, %esi
ja 0x4eed
incl %esi
incl %edx
movq %r14, %rdi
xorl %eax, %eax
callq 0x20b0
movzbl 0x2(%rbx), %eax
cmpq %rax, %r12
movl $0x41, %edi
cmovel %r15d, %edi
callq 0x2040
incq %r12
cmpq $0x5, %r12
jne 0x4eb4
movq 0x50cb(%rip), %rax      # 0x9fc8
movq (%rax), %rdi
callq 0x2160
leaq 0x5324(%rip), %rdi      # 0xa230
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2150