LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/wierton[P]socket-based-naive-game/client.c
// Function: button_invite_user
int button_invite_user() {
	wlog("call button handler %s\n", __func__);
	/* send invitation */
	wlogi("ask friend's name\n");
	char *name = accept_input("invite who to your battle: ");
	wlogi("friend name '%s'\n", name);
	client_message_t cm;
	memset(&cm, 0, sizeof(client_message_t));
	cm.command = CLIENT_COMMAND_LAUNCH_BATTLE;
	strncpy(cm.user_name, name, USERNAME_SIZE - 1);
	wlogi("send `launch battle` and invitation to server\n");
	global_serv_message=-1;
	wrap_send(&cm);
	/* wait for server reply */
	do {
		if(global_serv_message == SERVER_RESPONSE_LAUNCH_BATTLE_SUCCESS
		|| global_serv_message == SERVER_RESPONSE_LAUNCH_BATTLE_FAIL)
			break;
	} while(1);
	wlog("wait until message=%s\n", server_message_s[global_serv_message]);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq 0x7513(%rip), %rsi      # 0xa160
leaq 0x3444(%rip), %rdi      # 0x6098
leaq 0x3618(%rip), %rcx      # 0x6273
xorl %r14d, %r14d
movl $0x104, %edx            # imm = 0x104
xorl %eax, %eax
callq 0x27b9
movq 0x74ef(%rip), %rsi      # 0xa160
leaq 0x360e(%rip), %rdi      # 0x6286
movl $0x106, %edx            # imm = 0x106
xorl %eax, %eax
callq 0x27b9
leaq 0x3619(%rip), %rdi      # 0x62a4
callq 0x2868
movq %rax, %rbx
movq 0x74c6(%rip), %rsi      # 0xa160
leaq 0x361f(%rip), %rdi      # 0x62c0
movl $0x108, %edx            # imm = 0x108
movq %rax, %rcx
xorl %eax, %eax
callq 0x27b9
xorps %xmm0, %xmm0
leaq -0x3f(%rbp), %rdi
movups %xmm0, 0x1f(%rdi)
movups %xmm0, 0x16(%rdi)
movups %xmm0, 0x6(%rdi)
movb $0x6, -0x1(%rdi)
movl $0x6, %edx
movq %rbx, %rsi
callq 0x2050
movq 0x7485(%rip), %rsi      # 0xa160
leaq 0x35fb(%rip), %rdi      # 0x62dd
movl $0x10d, %edx            # imm = 0x10D
xorl %eax, %eax
callq 0x27b9
movl $0xffffffff, 0x7470(%rip) # imm = 0xFFFFFFFF
movl 0x745a(%rip), %edi      # 0xa158
leaq (%r14,%r14,2), %rax
shlq $0x4, %rax
leaq (%rax,%rbp), %rsi
addq $-0x40, %rsi
movl $0x30, %edx
subq %r14, %rdx
xorl %ecx, %ecx
callq 0x20a0
addq %rax, %r14
cmpq $0x30, %r14
jb 0x2cf8
movl 0x743c(%rip), %eax      # 0xa168
leal -0xd(%rax), %ecx
cmpl $0x2, %ecx
jae 0x2d64
movq 0x7425(%rip), %rsi      # 0xa160
leaq 0x6dbe(%rip), %rcx      # 0x9b00
movq (%rcx,%rax,8), %rcx
leaq 0x342c(%rip), %rdi      # 0x6179
movl $0x116, %edx            # imm = 0x116
xorl %eax, %eax
callq 0x27b9
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x2d64
// File: /workspace/github_c_makefile_star2_O3/wierton[P]socket-based-naive-game/client.c
// Function: button_join_battle
int button_join_battle() {
	wlog("call button handler %s\n", __func__);
	send_command(CLIENT_COMMAND_ACCEPT_BATTLE);
	user_state = USER_STATE_BATTLE;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x73ef(%rip), %rsi      # 0xa160
leaq 0x3320(%rip), %rdi      # 0x6098
leaq 0x3598(%rip), %rcx      # 0x6317
movl $0x11b, %edx            # imm = 0x11B
xorl %eax, %eax
callq 0x27b9
movl $0x8, %edi
callq 0x25b2
movl $0x3, 0x73cd(%rip)      # 0xa16c
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x73b2(%rip), %rsi      # 0xa160
leaq 0x32e3(%rip), %rdi      # 0x6098
leaq 0x356e(%rip), %rcx      # 0x632a
movl $0x122, %edx            # imm = 0x122
xorl %eax, %eax
callq 0x27b9
leaq 0x3569(%rip), %rax      # 0x6338
movq %rax, 0x738a(%rip)      # 0xa160
movl $0x1, 0x738c(%rip)      # 0xa16c
movl $0x3, %edi
callq 0x25b2
leaq 0x4069(%rip), %rsi      # 0x6e5a
xorl %edi, %edi
xorl %eax, %eax
callq 0x28af
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2e01
andb $-0x3, 0x6(%rbx)
movb 0x7405(%rip), %al       # 0xa267
movb %al, 0xf(%rbx)
movq %rbx, %rdi
callq 0x2e22
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2e01
orb $0x2, 0x6(%rbx)
movb $0x3c, 0xf(%rbx)
movq %rbx, %rdi
callq 0x2e22
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2e01
andb $-0x79, 0x6(%rbx)
movq %rbx, %rdi
callq 0x2e22
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2e01
orb $0x78, 0x6(%rbx)
movq %rbx, %rdi
callq 0x2e22
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x7264(%rip), %rdi      # 0xa230
callq 0x2200
leaq -0x42(%rbp), %rbx
movq %rbx, %rdi
callq 0x2e01
andb $-0x79, 0x6(%rbx)
movq %rbx, %rdi
callq 0x2e22
movq %rbx, %rdi
callq 0x2e01
andb $-0x3, 0x6(%rbx)
movb 0x726c(%rip), %al       # 0xa267
movb %al, 0xf(%rbx)
movq %rbx, %rdi
callq 0x2e22
movq 0x6fc3(%rip), %rbx      # 0x9fd0
movq (%rbx), %rdi
callq 0x20e0
movl %eax, %edi
shll $0x18, %edi
xorl %r14d, %r14d
cmpl $0xa000000, %edi        # imm = 0xA000000
je 0x30b0
movq 0x6f98(%rip), %r15      # 0x9fc8
sarl $0x18, %edi
cmpl $0x7f, %edi
je 0x305a
cmpl $0x1b, %edi
jne 0x306e
movq (%rbx), %rdi
callq 0x20e0
movq (%rbx), %rdi
callq 0x20e0
movsbl %al, %eax
addl $-0x41, %eax
cmpl $0x4, %eax
jb 0x3098
jmp 0x30d6
testl %r14d, %r14d
je 0x3095
decl %r14d
movslq %r14d, %rcx
movl $0x7f, %edi
xorl %eax, %eax
jmp 0x307f
cmpl $0x12, %r14d
ja 0x3098
cmpl $0x20, %edi
jl 0x3098
movl %r14d, %ecx
incl %r14d
movb %al, -0x30(%rbp,%rcx)
movq (%r15), %rsi
callq 0x2100
movq (%r15), %rdi
callq 0x2160
jmp 0x3098
xorl %r14d, %r14d
movq (%rbx), %rdi
callq 0x20e0
movl %eax, %edi
shll $0x18, %edi
cmpl $0xa000000, %edi        # imm = 0xA000000
jne 0x3030
movslq %r14d, %r14
movb $0x0, -0x30(%rbp,%r14)
leaq 0x7173(%rip), %rdi      # 0xa230
callq 0x2150
leaq -0x30(%rbp), %rdi
callq 0x21f0
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x336b(%rip), %rdi      # 0x6448
leaq 0x337b(%rip), %rsi      # 0x645f
leaq 0x337d(%rip), %rcx      # 0x6468
movl $0x1b1, %edx            # imm = 0x1B1
callq 0x20c0
// File: /workspace/github_c_makefile_star2_O3/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 0x3148
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 0x7104(%rip), %rdi      # 0xa270
movq %r10, %rsi
callq 0x2180
cmpl $0x64, %eax
jae 0x3189
leaq 0x70f0(%rip), %rax      # 0xa270
addq $0xd0, %rsp
popq %rbp
retq
callq 0x22ef
// File: /workspace/github_c_makefile_star2_O3/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 %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x3321(%rip), %r14      # 0x655e
movq %rbx, %rdi
callq 0x2868
movq %rax, %r15
movb (%rax), %al
testb %al, %al
je 0x32a8
movq %r15, %rcx
incq %rcx
leal -0x41(%rax), %edx
cmpb $0x19, %dl
ja 0x3261
orb $0x20, %al
movb %al, -0x1(%rcx)
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x3254
movb (%r15), %r12b
cmpb $0x79, %r12b
jne 0x327a
cmpb $0x0, 0x1(%r15)
je 0x32b7
movq %r15, %rdi
movq %r14, %rsi
callq 0x2120
testl %eax, %eax
je 0x32b7
cmpb $0x6e, %r12b
jne 0x323d
xorl %eax, %eax
cmpb $0x0, 0x1(%r15)
je 0x32bc
cmpb $0x6f, 0x1(%r15)
jne 0x323d
cmpb $0x0, 0x2(%r15)
jne 0x323d
jmp 0x32bc
movq %r15, %rdi
movq %r14, %rsi
callq 0x2120
testl %eax, %eax
jne 0x323d
movl $0x1, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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, 0x6e91(%rip)      # 0xa16c
jne 0x32ef
leaq 0x32b5(%rip), %rsi      # 0x6599
xorl %edi, %edi
xorl %eax, %eax
callq 0x28af
jmp 0x32f9
movl $0x4, %edi
callq 0x25b2
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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, 0x6e5f(%rip)      # 0xa16c
jne 0x3321
leaq 0x3283(%rip), %rsi      # 0x6599
xorl %edi, %edi
xorl %eax, %eax
callq 0x28af
jmp 0x3366
movq %rdi, %rsi
leaq -0x37(%rbp), %rdi
movb $0xa, -0x1(%rdi)
movl $0x6, %edx
callq 0x2050
xorl %ebx, %ebx
movl 0x6e1a(%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 0x3338
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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, 0x6ded(%rip)      # 0xa16c
jne 0x3393
leaq 0x3211(%rip), %rsi      # 0x6599
xorl %edi, %edi
xorl %eax, %eax
callq 0x28af
jmp 0x33e6
leaq 0x3213(%rip), %rdi      # 0x65ad
callq 0x2868
leaq -0x30(%rbp), %rdi
movw $0xb, -0x8(%rdi)
movl $0x27, %edx
movq %rax, %rsi
callq 0x2050
xorl %ebx, %ebx
movl 0x6d9a(%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 0x33b8
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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, 0x6d69(%rip)      # 0xa16c
jne 0x3411
leaq 0x318d(%rip), %rsi      # 0x6599
jmp 0x3499
movq %rdi, %rbx
testq %rdi, %rdi
je 0x3492
leaq 0x31bf(%rip), %rdi      # 0x65df
xorl %r15d, %r15d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x30f5
leaq 0x6e3c(%rip), %rdi      # 0xa270
callq 0x2868
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 0x6cf0(%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 0x3462
jmp 0x34a2
leaq 0x3128(%rip), %rsi      # 0x65c1
xorl %edi, %edi
xorl %eax, %eax
callq 0x28af
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x3545
movq %rdi, %rbx
leaq 0x3125(%rip), %rsi      # 0x65ed
callq 0x2120
testl %eax, %eax
je 0x354e
leaq 0x3142(%rip), %rsi      # 0x661a
movq %rbx, %rdi
callq 0x2120
testl %eax, %eax
je 0x3557
leaq 0x3156(%rip), %rsi      # 0x6641
movq %rbx, %rdi
callq 0x2120
testl %eax, %eax
je 0x3560
leaq 0x3161(%rip), %rsi      # 0x665f
movq %rbx, %rdi
callq 0x2120
testl %eax, %eax
je 0x3569
leaq 0x317d(%rip), %rsi      # 0x668e
movq %rbx, %rdi
callq 0x2120
testl %eax, %eax
je 0x3572
leaq 0x30f1(%rip), %rsi      # 0x6615
movq %rbx, %rdi
callq 0x2120
testl %eax, %eax
je 0x357b
leaq 0x319e(%rip), %rsi      # 0x66d5
xorl %edi, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x28af
jmp 0x358b
leaq 0x319a(%rip), %rsi      # 0x66e6
jmp 0x3582
leaq 0x309f(%rip), %rsi      # 0x65f4
jmp 0x3582
leaq 0x30c1(%rip), %rsi      # 0x661f
jmp 0x3582
leaq 0x30e0(%rip), %rsi      # 0x6647
jmp 0x3582
leaq 0x30f6(%rip), %rsi      # 0x6666
jmp 0x3582
leaq 0x311a(%rip), %rsi      # 0x6693
jmp 0x3582
leaq 0x312d(%rip), %rsi      # 0x66af
xorl %edi, %edi
xorl %eax, %eax
callq 0x28af
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x315d(%rip), %rdi      # 0x6703
callq 0x2868
movq %rax, %rbx
movq 0x6bab(%rip), %rsi      # 0xa160
leaq 0x3151(%rip), %rdi      # 0x670d
movl $0x291, %edx            # imm = 0x291
movq %rax, %rcx
xorl %eax, %eax
callq 0x27b9
leaq 0x3158(%rip), %r14      # 0x672a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21a0
xorl %edi, %edi
movq %r14, %rsi
callq 0x21a0
movq %rax, %r14
movl $0x8, %eax
leaq 0x665a(%rip), %r12      # 0x9c50
movq %rax, %r15
movq -0x8(%rax,%r12), %rsi
movq %rbx, %rdi
callq 0x2120
testl %eax, %eax
je 0x3637
movq %r15, %rax
addq $0x10, %rax
cmpq $0x68, %rax
jne 0x35f6
cmpb $0x0, (%rbx)
je 0x364b
leaq 0x310a(%rip), %rsi      # 0x672d
xorl %edi, %edi
movq %rbx, %rdx
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x28af
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_O3/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 0x6bcf(%rip), %rbx      # 0xa230
movq %rbx, %rdi
callq 0x2200
leaq 0x2dba(%rip), %rdi      # 0x642a
movl $0x13, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x20b0
leaq 0x30ba(%rip), %rdi      # 0x6742
xorl %eax, %eax
callq 0x20b0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2150
// File: /workspace/github_c_makefile_star2_O3/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 0x6ab8(%rip), %rcx      # 0xa170
movzbl (%rcx,%rax,8), %ebx
movzbl 0x1(%rcx,%rax,8), %r14d
movq 0x8(%rcx,%rax,8), %r12
movq %r12, %rdi
callq 0x2080
movq %rax, %r15
leaq 0x6b57(%rip), %rdi      # 0xa230
callq 0x2200
leal 0x1(%r14), %esi
incl %ebx
leaq 0x2d3f(%rip), %rdi      # 0x642a
movl %ebx, %edx
xorl %eax, %eax
callq 0x20b0
leaq 0x304c(%rip), %rdi      # 0x6747
xorl %eax, %eax
callq 0x20b0
testl %r15d, %r15d
jle 0x37bc
movq %r12, -0x30(%rbp)
leaq 0x3035(%rip), %r13      # 0x674b
movl %r15d, %r12d
movq %r13, %rdi
xorl %eax, %eax
callq 0x20b0
decl %r12d
jne 0x3719
leaq 0x3020(%rip), %rdi      # 0x674f
xorl %eax, %eax
callq 0x20b0
leal 0x2(%r14), %esi
leaq 0x2ce9(%rip), %r12      # 0x642a
movq %r12, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x20b0
leaq 0x2fff(%rip), %r13      # 0x6753
movq %r13, %rdi
xorl %eax, %eax
callq 0x20b0
leaq 0x35a1(%rip), %rdi      # 0x6d06
movq -0x30(%rbp), %rsi
xorl %eax, %eax
callq 0x20b0
movq %r13, %rdi
xorl %eax, %eax
callq 0x20b0
addl $0x3, %r14d
movq %r12, %rdi
movl %r14d, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x20b0
leaq 0x2fc3(%rip), %rdi      # 0x6757
xorl %eax, %eax
callq 0x20b0
testl %r15d, %r15d
jle 0x382e
leaq 0x2fa0(%rip), %rbx      # 0x674b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20b0
decl %r15d
jne 0x37ab
jmp 0x382e
leaq 0x2f8c(%rip), %rdi      # 0x674f
xorl %eax, %eax
callq 0x20b0
leal 0x2(%r14), %esi
leaq 0x2c55(%rip), %r15      # 0x642a
movq %r15, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x20b0
leaq 0x2f6b(%rip), %r13      # 0x6753
movq %r13, %rdi
xorl %eax, %eax
callq 0x20b0
leaq 0x350d(%rip), %rdi      # 0x6d06
movq %r12, %rsi
xorl %eax, %eax
callq 0x20b0
movq %r13, %rdi
xorl %eax, %eax
callq 0x20b0
addl $0x3, %r14d
movq %r15, %rdi
movl %r14d, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x20b0
leaq 0x2f30(%rip), %rdi      # 0x6757
xorl %eax, %eax
callq 0x20b0
leaq 0x2f26(%rip), %rdi      # 0x675b
xorl %eax, %eax
callq 0x20b0
leaq 0x69ed(%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_O3/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 0x68ff(%rip), %rcx      # 0xa170
movzbl (%rcx,%rax,8), %ebx
movzbl 0x1(%rcx,%rax,8), %r14d
movq 0x8(%rcx,%rax,8), %r12
movq %r12, %rdi
callq 0x2080
movq %rax, %r15
leaq 0x699e(%rip), %rdi      # 0xa230
callq 0x2200
leal 0x1(%r14), %esi
incl %ebx
leaq 0x2b86(%rip), %rdi      # 0x642a
movl %ebx, %edx
xorl %eax, %eax
callq 0x20b0
leaq 0x2eab(%rip), %rdi      # 0x675f
xorl %eax, %eax
callq 0x20b0
leaq 0x2ea2(%rip), %rdi      # 0x6764
xorl %eax, %eax
callq 0x20b0
testl %r15d, %r15d
jle 0x3983
movq %r12, -0x30(%rbp)
leaq 0x2e8b(%rip), %r13      # 0x6768
movl %r15d, %r12d
movq %r13, %rdi
xorl %eax, %eax
callq 0x20b0
decl %r12d
jne 0x38e0
leaq 0x2e76(%rip), %rdi      # 0x676c
xorl %eax, %eax
callq 0x20b0
leal 0x2(%r14), %esi
leaq 0x2b22(%rip), %r12      # 0x642a
movq %r12, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x20b0
leaq 0x2e55(%rip), %r13      # 0x6770
movq %r13, %rdi
xorl %eax, %eax
callq 0x20b0
leaq 0x33da(%rip), %rdi      # 0x6d06
movq -0x30(%rbp), %rsi
xorl %eax, %eax
callq 0x20b0
movq %r13, %rdi
xorl %eax, %eax
callq 0x20b0
addl $0x3, %r14d
movq %r12, %rdi
movl %r14d, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x20b0
leaq 0x2e19(%rip), %rdi      # 0x6774
xorl %eax, %eax
callq 0x20b0
testl %r15d, %r15d
jle 0x39f5
leaq 0x2df6(%rip), %rbx      # 0x6768
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20b0
decl %r15d
jne 0x3972
jmp 0x39f5
leaq 0x2de2(%rip), %rdi      # 0x676c
xorl %eax, %eax
callq 0x20b0
leal 0x2(%r14), %esi
leaq 0x2a8e(%rip), %r15      # 0x642a
movq %r15, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x20b0
leaq 0x2dc1(%rip), %r13      # 0x6770
movq %r13, %rdi
xorl %eax, %eax
callq 0x20b0
leaq 0x3346(%rip), %rdi      # 0x6d06
movq %r12, %rsi
xorl %eax, %eax
callq 0x20b0
movq %r13, %rdi
xorl %eax, %eax
callq 0x20b0
addl $0x3, %r14d
movq %r15, %rdi
movl %r14d, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x20b0
leaq 0x2d86(%rip), %rdi      # 0x6774
xorl %eax, %eax
callq 0x20b0
leaq 0x2d7c(%rip), %rdi      # 0x6778
xorl %eax, %eax
callq 0x20b0
leaq 0x2d72(%rip), %rdi      # 0x677c
xorl %eax, %eax
callq 0x20b0
leaq 0x6818(%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_O3/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 %r14
pushq %rbx
subq $0x20, %rsp
movq 0x647c(%rip), %rsi      # 0xa160
leaq 0x2aa1(%rip), %rdi      # 0x678c
movl $0x311, %edx            # imm = 0x311
xorl %eax, %eax
callq 0x27b9
callq 0x3654
leaq 0x2a9c(%rip), %rsi      # 0x679f
xorl %edi, %edi
xorl %eax, %eax
callq 0x28af
leaq -0x22(%rbp), %rbx
movq %rbx, %rdi
callq 0x2e01
andb $-0x79, 0x6(%rbx)
movq %rbx, %rdi
callq 0x2e22
movq %rbx, %rdi
callq 0x2e01
andb $-0x3, 0x6(%rbx)
movb 0x6531(%rip), %al       # 0xa267
movb %al, 0xf(%rbx)
movq %rbx, %rdi
callq 0x2e22
cmpl $0x3, 0x6424(%rip)      # 0xa16c
jne 0x3e17
movq 0x627b(%rip), %r14      # 0x9fd0
leaq 0x2a9c(%rip), %rbx      # 0x67f8
movq (%r14), %rdi
callq 0x20e0
cmpl $0x63, %eax
jle 0x3d7f
cmpl $0x72, %eax
jle 0x3d95
cmpl $0x73, %eax
je 0x3da1
cmpl $0x77, %eax
jne 0x3dcf
movl $0xc, %edi
jmp 0x3dca
cmpl $0x9, %eax
je 0x3da8
cmpl $0x20, %eax
je 0x3dc5
cmpl $0x61, %eax
jne 0x3dcf
movl $0xe, %edi
jmp 0x3dca
cmpl $0x64, %eax
jne 0x3dda
movl $0xf, %edi
jmp 0x3dca
movl $0xd, %edi
jmp 0x3dca
movq 0x63b1(%rip), %rsi      # 0xa160
movq %rbx, %rdi
movl $0x31f, %edx            # imm = 0x31F
xorl %eax, %eax
callq 0x27b9
callq 0x3594
jmp 0x3dcf
movl $0x10, %edi
callq 0x25b2
cmpl $0x3, 0x6396(%rip)      # 0xa16c
je 0x3d5c
jmp 0x3e17
cmpl $0x71, %eax
jne 0x3dcf
movq 0x637a(%rip), %rsi      # 0xa160
leaq 0x29ec(%rip), %rdi      # 0x67d9
movl $0x319, %edx            # imm = 0x319
xorl %eax, %eax
callq 0x27b9
movl $0x2, 0x6369(%rip)      # 0xa16c
movl $0x7, %edi
callq 0x25b2
movl $0x5, %edi
callq 0x25b2
callq 0x3654
movq 0x633d(%rip), %rsi      # 0xa160
leaq 0x29f8(%rip), %rdi      # 0x6822
movl $0x32d, %edx            # imm = 0x32D
xorl %eax, %eax
callq 0x27b9
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x369d
movl $0x4, %edi
callq 0x369d
movl $0x5, %edi
callq 0x369d
movl $0x6, %edi
callq 0x369d
leaq 0x60f7(%rip), %rdi      # 0xa120
popq %rbp
jmp 0x3a2b
// File: /workspace/github_c_makefile_star2_O3/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 0x3654
leaq 0x24a7(%rip), %rbx      # 0x64f0
leaq 0x2875(%rip), %r14      # 0x68c5
leaq 0x6119(%rip), %r12      # 0xa170
leaq 0x287e(%rip), %r15      # 0x68dc
callq 0x3ff6
movl 0x6103(%rip), %eax      # 0xa16c
movq 0x60f0(%rip), %rdx      # 0xa160
movl 0x625e(%rip), %ecx      # 0xa2d4
movl 0x625b(%rip), %r8d      # 0xa2d8
leaq 0x5bac(%rip), %rsi      # 0x9c30
movq (%rsi,%rax,8), %r9
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movq %rbx, %rsi
xorl %eax, %eax
callq 0x28af
movl $0x3, %edi
movl $0x7, %esi
callq 0x3e3f
movl %eax, %r13d
movq 0x60b0(%rip), %rsi      # 0xa160
movq %r14, %rdi
movl $0x372, %edx            # imm = 0x372
movl %eax, %ecx
xorl %eax, %eax
callq 0x27b9
movslq %r13d, %rax
leaq (%rax,%rax,2), %rcx
xorl %eax, %eax
callq *0x10(%r12,%rcx,8)
movl %eax, %r13d
movq 0x6087(%rip), %rsi      # 0xa160
movq %r15, %rdi
movl $0x375, %edx            # imm = 0x375
movl %eax, %ecx
xorl %eax, %eax
callq 0x27b9
testl %r13d, %r13d
js 0x4127
movl 0x6077(%rip), %eax      # 0xa16c
cmpl $0x1, %eax
je 0x4127
cmpl $0x3, %eax
jne 0x405e
movq 0x6056(%rip), %rsi      # 0xa160
leaq 0x2814(%rip), %rdi      # 0x6925
movl $0x37e, %edx            # imm = 0x37E
xorl %eax, %eax
callq 0x27b9
callq 0x3cd2
jmp 0x405e
callq 0x3654
movq 0x602d(%rip), %rsi      # 0xa160
movl 0x6033(%rip), %ecx      # 0xa16c
leaq 0x27bd(%rip), %rdi      # 0x68fd
movl $0x379, %edx            # imm = 0x379
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x27b9
// File: /workspace/github_c_makefile_star2_O3/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 0x5fd1(%rip), %rsi      # 0xa160
leaq 0x27a9(%rip), %rdi      # 0x693f
movl $0x38b, %edx            # imm = 0x38B
xorl %eax, %eax
callq 0x27b9
leaq 0x27ad(%rip), %rsi      # 0x6956
xorl %edi, %edi
xorl %eax, %eax
callq 0x28af
leaq 0x5a77(%rip), %r13      # 0x9c30
leaq 0x2330(%rip), %rbx      # 0x64f0
leaq 0x5fa9(%rip), %r15      # 0xa170
leaq 0x27c3(%rip), %r14      # 0x6991
callq 0x415a
movl 0x5f93(%rip), %eax      # 0xa16c
movq 0x5f80(%rip), %rdx      # 0xa160
movl 0x60ee(%rip), %ecx      # 0xa2d4
movl 0x60eb(%rip), %r8d      # 0xa2d8
movq (%r13,%rax,8), %r9
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movq %rbx, %rsi
xorl %eax, %eax
callq 0x28af
xorl %edi, %edi
movl $0x3, %esi
callq 0x3e3f
movq 0x5f4c(%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 0x27b9
xorl %eax, %eax
callq *0x10(%r15,%r12,8)
cmpl $0x2, 0x5f2f(%rip)      # 0xa16c
jne 0x41ce
movq 0x5f1a(%rip), %rsi      # 0xa160
leaq 0x275e(%rip), %rdi      # 0x69ab
movl $0x395, %edx            # imm = 0x395
xorl %eax, %eax
callq 0x27b9
movq 0x5f00(%rip), %rsi      # 0xa160
leaq 0x276a(%rip), %rdi      # 0x69d1
movl $0x396, %edx            # imm = 0x396
xorl %eax, %eax
callq 0x27b9
callq 0x402f
jmp 0x41ce
// File: /workspace/github_c_makefile_star2_O3/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 0x5dba(%rip), %rsi      # 0xa160
leaq 0x263a(%rip), %rdi      # 0x69e7
leaq 0x2723(%rip), %rcx      # 0x6ad7
movl $0x3b6, %edx            # imm = 0x3B6
xorl %eax, %eax
callq 0x27b9
movq 0x5d99(%rip), %rsi      # 0xa160
leaq 0x2725(%rip), %rdi      # 0x6af3
movl $0x3b7, %edx            # imm = 0x3B7
xorl %eax, %eax
callq 0x27b9
leaq 0x2138(%rip), %rsi      # 0x6519
leaq 0x1c70(%rip), %rdx      # 0x6058
leaq 0x271f(%rip), %rcx      # 0x6b0e
xorl %edi, %edi
xorl %eax, %eax
callq 0x28af
movq 0x5d61(%rip), %rsi      # 0xa160
movl 0x5d67(%rip), %eax      # 0xa16c
leaq 0x5824(%rip), %rbx      # 0x9c30
movq (%rbx,%rax,8), %rcx
leaq 0x2718(%rip), %rdi      # 0x6b2f
leaq 0x2b12(%rip), %r8       # 0x6f30
movl $0x3b9, %edx            # imm = 0x3B9
xorl %eax, %eax
callq 0x27b9
movl $0x2, 0x5d38(%rip)      # 0xa16c
movq 0x5d25(%rip), %rsi      # 0xa160
leaq 0x271b(%rip), %rdi      # 0x6b5d
movl $0x3bb, %edx            # imm = 0x3BB
xorl %eax, %eax
callq 0x27b9
movl 0x5d18(%rip), %eax      # 0xa16c
movq 0x5d05(%rip), %rdx      # 0xa160
movl 0x5e73(%rip), %ecx      # 0xa2d4
movl 0x5e70(%rip), %r8d      # 0xa2d8
movq (%rbx,%rax,8), %r9
leaq 0x207d(%rip), %rsi      # 0x64f0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x28af
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5ccd(%rip), %rsi      # 0xa160
leaq 0x254d(%rip), %rdi      # 0x69e7
leaq 0x26e4(%rip), %rcx      # 0x6b85
movl $0x3c1, %edx            # imm = 0x3C1
xorl %eax, %eax
callq 0x27b9
leaq 0x2065(%rip), %rsi      # 0x6519
leaq 0x1b9d(%rip), %rdx      # 0x6058
leaq 0x26f0(%rip), %rcx      # 0x6bb2
xorl %edi, %edi
xorl %eax, %eax
callq 0x28af
movl 0x5c9b(%rip), %eax      # 0xa16c
movq 0x5c88(%rip), %rdx      # 0xa160
movl 0x5df6(%rip), %ecx      # 0xa2d4
movl 0x5df3(%rip), %r8d      # 0xa2d8
leaq 0x5744(%rip), %rsi      # 0x9c30
movq (%rsi,%rax,8), %r9
leaq 0x1ff9(%rip), %rsi      # 0x64f0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x28af
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5c4e(%rip), %rsi      # 0xa160
leaq 0x24ce(%rip), %rdi      # 0x69e7
leaq 0x26b4(%rip), %rcx      # 0x6bd4
movl $0x3c8, %edx            # imm = 0x3C8
xorl %eax, %eax
callq 0x27b9
leaq 0x1fe6(%rip), %rsi      # 0x6519
leaq 0x1b1e(%rip), %rdx      # 0x6058
leaq 0x26bb(%rip), %rcx      # 0x6bfc
xorl %edi, %edi
xorl %eax, %eax
callq 0x28af
movl 0x5c1c(%rip), %eax      # 0xa16c
movq 0x5c09(%rip), %rdx      # 0xa160
movl 0x5d77(%rip), %ecx      # 0xa2d4
movl 0x5d74(%rip), %r8d      # 0xa2d8
leaq 0x56c5(%rip), %rsi      # 0x9c30
movq (%rsi,%rax,8), %r9
leaq 0x1f7a(%rip), %rsi      # 0x64f0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x28af
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5bcf(%rip), %rsi      # 0xa160
leaq 0x244f(%rip), %rdi      # 0x69e7
leaq 0x266d(%rip), %rcx      # 0x6c0c
movl $0x3cf, %edx            # imm = 0x3CF
xorl %eax, %eax
callq 0x27b9
leaq 0x1f67(%rip), %rsi      # 0x6519
leaq 0x1a9f(%rip), %rdx      # 0x6058
leaq 0x2670(%rip), %rcx      # 0x6c30
xorl %edi, %edi
xorl %eax, %eax
callq 0x28af
movl 0x5b9d(%rip), %eax      # 0xa16c
movq 0x5b8a(%rip), %rdx      # 0xa160
movl 0x5cf8(%rip), %ecx      # 0xa2d4
movl 0x5cf5(%rip), %r8d      # 0xa2d8
leaq 0x5646(%rip), %rsi      # 0x9c30
movq (%rsi,%rax,8), %r9
leaq 0x1efb(%rip), %rsi      # 0x64f0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x28af
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5b50(%rip), %rsi      # 0xa160
leaq 0x23d0(%rip), %rdi      # 0x69e7
leaq 0x2635(%rip), %rcx      # 0x6c53
movl $0x3d6, %edx            # imm = 0x3D6
xorl %eax, %eax
callq 0x27b9
leaq 0x1ee8(%rip), %rsi      # 0x6519
leaq 0x1a20(%rip), %rdx      # 0x6058
leaq 0x263b(%rip), %rcx      # 0x6c7a
xorl %edi, %edi
xorl %eax, %eax
callq 0x28af
movl 0x5b1e(%rip), %eax      # 0xa16c
movq 0x5b0b(%rip), %rdx      # 0xa160
movl 0x5c79(%rip), %ecx      # 0xa2d4
movl 0x5c76(%rip), %r8d      # 0xa2d8
leaq 0x55c7(%rip), %rsi      # 0x9c30
movq (%rsi,%rax,8), %r9
leaq 0x1e7c(%rip), %rsi      # 0x64f0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x28af
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5a7d(%rip), %rsi      # 0xa160
leaq 0x22fd(%rip), %rdi      # 0x69e7
leaq 0x25c5(%rip), %rcx      # 0x6cb6
movl $0x3e5, %edx            # imm = 0x3E5
xorl %eax, %eax
callq 0x27b9
leaq 0x1(%r14), %r13
leaq 0x25cb(%rip), %r15      # 0x6cd3
xorl %ebx, %ebx
xorl %r12d, %r12d
cmpb $0x2, 0x8(%r14,%rbx)
jb 0x4734
leaq (%rbx,%r13), %rdx
movslq %r12d, %r12
leaq 0x5bbd(%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 0x470d
cmpl $0x22, %r12d
ja 0x4794
movslq %r12d, %rax
leaq 0x5b92(%rip), %rbx      # 0xa2e0
movb $0x0, -0x2(%rax,%rbx)
movq 0x5a06(%rip), %rsi      # 0xa160
leaq 0x2577(%rip), %rdi      # 0x6cd8
movl $0x3f1, %edx            # imm = 0x3F1
movq %rbx, %rcx
xorl %eax, %eax
callq 0x27b9
leaq 0x2587(%rip), %rsi      # 0x6cfe
xorl %edi, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x28af
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_O3/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 0x59af(%rip), %rsi      # 0xa160
leaq 0x222f(%rip), %rdi      # 0x69e7
leaq 0x254a(%rip), %rcx      # 0x6d09
xorl %r14d, %r14d
movl $0x3f8, %edx            # imm = 0x3F8
xorl %eax, %eax
callq 0x27b9
leaq 0x1(%rbx), %r15
leaq 0x5947(%rip), %r12      # 0xa120
xorl %r13d, %r13d
cmpb $0x2, 0x8(%rbx,%r14)
jb 0x480b
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 0x47dc
movq 0x5944(%rip), %rsi      # 0xa160
leaq 0x2505(%rip), %rdi      # 0x6d28
movl $0x402, %edx            # imm = 0x402
xorl %eax, %eax
callq 0x27b9
leaq 0x58ea(%rip), %rdi      # 0xa120
callq 0x3a2b
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_O3/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 0x58c2(%rip), %rsi      # 0xa160
leaq 0x2142(%rip), %rdi      # 0x69e7
leaq 0x24d3(%rip), %rcx      # 0x6d7f
movl $0x40e, %edx            # imm = 0x40E
xorl %eax, %eax
callq 0x27b9
leaq 0x1c5a(%rip), %rsi      # 0x6519
leaq 0x1792(%rip), %rdx      # 0x6058
leaq 0x24d6(%rip), %rcx      # 0x6da3
xorl %edi, %edi
xorl %eax, %eax
callq 0x28af
movl $0x3, 0x588c(%rip)      # 0xa16c
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5871(%rip), %rsi      # 0xa160
leaq 0x20f1(%rip), %rdi      # 0x69e7
leaq 0x24bc(%rip), %rcx      # 0x6db9
movl $0x415, %edx            # imm = 0x415
xorl %eax, %eax
callq 0x27b9
leaq 0x1c09(%rip), %rsi      # 0x6519
leaq 0x1741(%rip), %rdx      # 0x6058
leaq 0x24bb(%rip), %rcx      # 0x6dd9
xorl %edi, %edi
xorl %eax, %eax
callq 0x28af
movl $0x2, 0x583b(%rip)      # 0xa16c
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x57d4(%rip), %rsi      # 0xa160
leaq 0x2054(%rip), %rdi      # 0x69e7
leaq 0x2489(%rip), %rcx      # 0x6e23
movl $0x422, %edx            # imm = 0x422
xorl %eax, %eax
callq 0x27b9
movl $0x10, %eax
leaq 0x576e(%rip), %rdi      # 0xa120
cmpb $0x0, (%rax,%rdi)
je 0x49c4
addq $0x7, %rax
cmpq $0x33, %rax
jne 0x49b2
jmp 0x49d5
leaq 0x1(%rbx), %rsi
addq %rax, %rdi
movl $0x6, %edx
callq 0x2050
cmpl $0x2, 0x5790(%rip)      # 0xa16c
jne 0x49ea
leaq 0x573b(%rip), %rdi      # 0xa120
callq 0x3a2b
incq %rbx
leaq 0x2445(%rip), %rdi      # 0x6e39
movq %rbx, %rsi
xorl %eax, %eax
callq 0x30f5
leaq 0x1b14(%rip), %rsi      # 0x6519
leaq 0x164c(%rip), %rdx      # 0x6058
leaq 0x585d(%rip), %rcx      # 0xa270
xorl %edi, %edi
xorl %eax, %eax
callq 0x28af
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5727(%rip), %rsi      # 0xa160
leaq 0x1fa7(%rip), %rdi      # 0x69e7
leaq 0x2403(%rip), %rcx      # 0x6e4a
movl $0x430, %edx            # imm = 0x430
xorl %eax, %eax
callq 0x27b9
incq %rbx
movl $0x10, %r14d
leaq 0x56bd(%rip), %r15      # 0xa120
leaq (%r15,%r14), %rdi
movl $0x6, %edx
movq %rbx, %rsi
callq 0x2060
testl %eax, %eax
je 0x4a84
addq $0x7, %r14
cmpq $0x33, %r14
jne 0x4a63
jmp 0x4a89
movb $0x0, (%r14,%r15)
cmpl $0x2, 0x56dc(%rip)      # 0xa16c
jne 0x4a9e
leaq 0x5687(%rip), %rdi      # 0xa120
callq 0x3a2b
leaq 0x23bc(%rip), %rdi      # 0x6e61
movq %rbx, %rsi
xorl %eax, %eax
callq 0x30f5
leaq 0x1a63(%rip), %rsi      # 0x6519
leaq 0x159b(%rip), %rdx      # 0x6058
leaq 0x57ac(%rip), %rcx      # 0xa270
xorl %edi, %edi
xorl %eax, %eax
callq 0x28af
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5611(%rip), %rsi      # 0xa160
leaq 0x1e91(%rip), %rdi      # 0x69e7
leaq 0x234e(%rip), %rcx      # 0x6eab
movl $0x444, %edx            # imm = 0x444
xorl %eax, %eax
callq 0x27b9
movq 0x55f0(%rip), %rsi      # 0xa160
incq %rbx
leaq 0x2348(%rip), %rdi      # 0x6ec2
movl $0x445, %edx            # imm = 0x445
movq %rbx, %rcx
xorl %eax, %eax
callq 0x27b9
leaq 0x2354(%rip), %rdi      # 0x6ee4
movq %rbx, %rsi
xorl %eax, %eax
callq 0x30f5
leaq 0x1978(%rip), %rsi      # 0x6519
leaq 0x14b0(%rip), %rdx      # 0x6058
leaq 0x56c1(%rip), %rcx      # 0xa270
xorl %edi, %edi
xorl %eax, %eax
callq 0x28af
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x54c5(%rip), %rsi      # 0xa160
leaq 0x1d45(%rip), %rdi      # 0x69e7
leaq 0x22d1(%rip), %rcx      # 0x6f7a
movl $0x458, %edx            # imm = 0x458
xorl %eax, %eax
callq 0x27b9
incq %rbx
leaq 0x22d4(%rip), %rdi      # 0x6f93
movq %rbx, %rsi
xorl %eax, %eax
callq 0x30f5
leaq 0x1849(%rip), %rsi      # 0x6519
leaq 0x1381(%rip), %rdx      # 0x6058
leaq 0x5592(%rip), %rcx      # 0xa270
xorl %edi, %edi
xorl %eax, %eax
callq 0x28af
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq