LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
cmpl $0x1, 0x6d75(%rip)      # 0xa2b8
jne 0x355e
xorl %edi, %edi
leaq 0x30e0(%rip), %rsi      # 0x662e
movb $0x0, %al
callq 0x2890
movl $0x0, -0x4(%rbp)
jmp 0x3588
movb $0xa, -0x40(%rbp)
leaq -0x40(%rbp), %rdi
addq $0x1, %rdi
movq -0x10(%rbp), %rsi
movl $0x6, %edx
callq 0x2040
leaq -0x40(%rbp), %rdi
callq 0x2470
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
cmpl $0x1, 0x6d05(%rip)      # 0xa2b8
jne 0x35ce
xorl %edi, %edi
leaq 0x3070(%rip), %rsi      # 0x662e
movb $0x0, %al
callq 0x2890
movl $0x0, -0x4(%rbp)
jmp 0x360c
leaq 0x306d(%rip), %rdi      # 0x6642
callq 0x2840
movq %rax, -0x18(%rbp)
movb $0xb, -0x48(%rbp)
movb $0x0, -0x47(%rbp)
leaq -0x48(%rbp), %rdi
addq $0x8, %rdi
movq -0x18(%rbp), %rsi
movl $0x27, %edx
callq 0x2040
leaq -0x48(%rbp), %rdi
callq 0x2470
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
cmpl $0x1, 0x6c85(%rip)      # 0xa2b8
jne 0x364e
xorl %edi, %edi
leaq 0x2ff0(%rip), %rsi      # 0x662e
movb $0x0, %al
callq 0x2890
movl $0x0, -0x4(%rbp)
jmp 0x36cc
cmpq $0x0, -0x10(%rbp)
jne 0x366e
xorl %edi, %edi
leaq 0x2ff8(%rip), %rsi      # 0x6656
movb $0x0, %al
callq 0x2890
movl $0x0, -0x4(%rbp)
jmp 0x36cc
movq -0x10(%rbp), %rsi
leaq 0x2ffb(%rip), %rdi      # 0x6674
movb $0x0, %al
callq 0x3240
movq %rax, %rdi
callq 0x2840
movq %rax, -0x18(%rbp)
movb $0xb, -0x48(%rbp)
leaq -0x48(%rbp), %rdi
addq $0x1, %rdi
movq -0x10(%rbp), %rsi
movl $0x6, %edx
callq 0x2040
leaq -0x48(%rbp), %rdi
addq $0x8, %rdi
movq -0x18(%rbp), %rsi
movl $0x27, %edx
callq 0x2040
leaq -0x48(%rbp), %rdi
callq 0x2470
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x380a
movq -0x8(%rbp), %rdi
leaq 0x2f80(%rip), %rsi      # 0x6682
callq 0x2130
cmpl $0x0, %eax
jne 0x3721
xorl %edi, %edi
leaq 0x2f74(%rip), %rsi      # 0x6689
movb $0x0, %al
callq 0x2890
jmp 0x3808
movq -0x8(%rbp), %rdi
leaq 0x2f83(%rip), %rsi      # 0x66af
callq 0x2130
cmpl $0x0, %eax
jne 0x374b
xorl %edi, %edi
leaq 0x2f75(%rip), %rsi      # 0x66b4
movb $0x0, %al
callq 0x2890
jmp 0x3806
movq -0x8(%rbp), %rdi
leaq 0x2f80(%rip), %rsi      # 0x66d6
callq 0x2130
cmpl $0x0, %eax
jne 0x3775
xorl %edi, %edi
leaq 0x2f73(%rip), %rsi      # 0x66dc
movb $0x0, %al
callq 0x2890
jmp 0x3804
movq -0x8(%rbp), %rdi
leaq 0x2f74(%rip), %rsi      # 0x66f4
callq 0x2130
cmpl $0x0, %eax
jne 0x379c
xorl %edi, %edi
leaq 0x2f68(%rip), %rsi      # 0x66fb
movb $0x0, %al
callq 0x2890
jmp 0x3802
movq -0x8(%rbp), %rdi
leaq 0x2f7c(%rip), %rsi      # 0x6723
callq 0x2130
cmpl $0x0, %eax
jne 0x37c3
xorl %edi, %edi
leaq 0x2f6e(%rip), %rsi      # 0x6728
movb $0x0, %al
callq 0x2890
jmp 0x3800
movq -0x8(%rbp), %rdi
leaq 0x2edc(%rip), %rsi      # 0x66aa
callq 0x2130
cmpl $0x0, %eax
jne 0x37ea
xorl %edi, %edi
leaq 0x2f63(%rip), %rsi      # 0x6744
movb $0x0, %al
callq 0x2890
jmp 0x37fe
movq -0x8(%rbp), %rdx
xorl %edi, %edi
leaq 0x2f73(%rip), %rsi      # 0x676a
movb $0x0, %al
callq 0x2890
jmp 0x3800
jmp 0x3802
jmp 0x3804
jmp 0x3806
jmp 0x3808
jmp 0x381a
xorl %edi, %edi
leaq 0x2f68(%rip), %rsi      # 0x677b
movb $0x0, %al
callq 0x2890
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
leaq 0x2f59(%rip), %rdi      # 0x6798
callq 0x2840
movq %rax, -0x8(%rbp)
movq 0x6929(%rip), %rsi      # 0xa178
movq -0x8(%rbp), %rcx
leaq 0x2f48(%rip), %rdi      # 0x67a2
movl $0x291, %edx            # imm = 0x291
movb $0x0, %al
callq 0x2780
movq -0x8(%rbp), %rdi
leaq 0x2f4e(%rip), %rsi      # 0x67bf
callq 0x21b0
xorl %eax, %eax
movl %eax, %edi
leaq 0x2f3e(%rip), %rsi      # 0x67bf
callq 0x21b0
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movslq -0x14(%rbp), %rax
cmpq $0x6, %rax
jae 0x38e9
movq -0x8(%rbp), %rdi
movslq -0x14(%rbp), %rcx
leaq 0x6ae6(%rip), %rax      # 0xa390
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0x2130
cmpl $0x0, %eax
jne 0x38dc
movslq -0x14(%rbp), %rcx
leaq 0x6ac7(%rip), %rax      # 0xa390
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
jmp 0x390c
jmp 0x38de
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3891
movq -0x8(%rbp), %rdi
callq 0x2070
cmpq $0x0, %rax
jbe 0x390c
movq -0x8(%rbp), %rdx
xorl %edi, %edi
leaq 0x2ebd(%rip), %rsi      # 0x67c2
movb $0x0, %al
callq 0x2890
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
callq 0x3030
xorl %edi, %edi
movl $0x12, %esi
callq 0x2f70
leaq 0x2e9b(%rip), %rdi      # 0x67d7
movb $0x0, %al
callq 0x20b0
callq 0x3050
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x6959(%rip), %rax      # 0xa2c0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movzbl (%rax), %eax
movl %eax, -0x8(%rbp)
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x6940(%rip), %rax      # 0xa2c0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movzbl 0x1(%rax), %eax
movl %eax, -0xc(%rbp)
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x6926(%rip), %rax      # 0xa2c0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2070
movl %eax, -0x1c(%rbp)
callq 0x3030
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %esi
callq 0x2f70
leaq 0x2e10(%rip), %rdi      # 0x67dc
movb $0x0, %al
callq 0x20b0
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x39fb
leaq 0x2df7(%rip), %rdi      # 0x67e0
movb $0x0, %al
callq 0x20b0
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x39da
leaq 0x2de2(%rip), %rdi      # 0x67e4
movb $0x0, %al
callq 0x20b0
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %esi
addl $0x1, %esi
callq 0x2f70
leaq 0x2dca(%rip), %rdi      # 0x67e8
movb $0x0, %al
callq 0x20b0
movq -0x18(%rbp), %rsi
leaq 0x336b(%rip), %rdi      # 0x6d9b
movb $0x0, %al
callq 0x20b0
leaq 0x2daa(%rip), %rdi      # 0x67e8
movb $0x0, %al
callq 0x20b0
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %esi
addl $0x2, %esi
callq 0x2f70
leaq 0x2d92(%rip), %rdi      # 0x67ec
movb $0x0, %al
callq 0x20b0
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x3a89
leaq 0x2d69(%rip), %rdi      # 0x67e0
movb $0x0, %al
callq 0x20b0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x3a68
leaq 0x2d60(%rip), %rdi      # 0x67f0
movb $0x0, %al
callq 0x20b0
callq 0x3050
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x67f9(%rip), %rax      # 0xa2c0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movzbl (%rax), %eax
movl %eax, -0x8(%rbp)
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x67e0(%rip), %rax      # 0xa2c0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movzbl 0x1(%rax), %eax
movl %eax, -0xc(%rbp)
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x67c6(%rip), %rax      # 0xa2c0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2070
movl %eax, -0x1c(%rbp)
callq 0x3030
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %esi
callq 0x2f70
leaq 0x2cc8(%rip), %rdi      # 0x67f4
movb $0x0, %al
callq 0x20b0
leaq 0x2cbf(%rip), %rdi      # 0x67f9
movb $0x0, %al
callq 0x20b0
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x3b69
leaq 0x2ca6(%rip), %rdi      # 0x67fd
movb $0x0, %al
callq 0x20b0
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x3b48
leaq 0x2c91(%rip), %rdi      # 0x6801
movb $0x0, %al
callq 0x20b0
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %esi
addl $0x1, %esi
callq 0x2f70
leaq 0x2c79(%rip), %rdi      # 0x6805
movb $0x0, %al
callq 0x20b0
movq -0x18(%rbp), %rsi
leaq 0x31fd(%rip), %rdi      # 0x6d9b
movb $0x0, %al
callq 0x20b0
leaq 0x2c59(%rip), %rdi      # 0x6805
movb $0x0, %al
callq 0x20b0
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %esi
addl $0x2, %esi
callq 0x2f70
leaq 0x2c41(%rip), %rdi      # 0x6809
movb $0x0, %al
callq 0x20b0
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x3bf7
leaq 0x2c18(%rip), %rdi      # 0x67fd
movb $0x0, %al
callq 0x20b0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x3bd6
leaq 0x2c0f(%rip), %rdi      # 0x680d
movb $0x0, %al
callq 0x20b0
leaq 0x2c05(%rip), %rdi      # 0x6811
movb $0x0, %al
callq 0x20b0
callq 0x3050
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq 0x6279(%rip), %rsi      # 0xa178
leaq 0x291b(%rip), %rdi      # 0x6821
movl $0x311, %edx            # imm = 0x311
movb $0x0, %al
callq 0x2780
callq 0x3920
xorl %edi, %edi
leaq 0x2914(%rip), %rsi      # 0x6834
movb $0x0, %al
callq 0x2890
callq 0x2f10
callq 0x2ea0
cmpl $0x3, 0x6380(%rip)      # 0xa2b8
jne 0x402e
movq 0x6093(%rip), %rax      # 0x9fd8
movq (%rax), %rdi
callq 0x20f0
movl %eax, -0x4(%rbp)
cmpl $0x71, -0x4(%rbp)
jne 0x3f93
movq 0x621b(%rip), %rsi      # 0xa178
leaq 0x290a(%rip), %rdi      # 0x686e
movl $0x319, %edx            # imm = 0x319
movb $0x0, %al
callq 0x2780
movl $0x2, 0x633e(%rip)      # 0xa2b8
movl $0x7, %edi
callq 0x2580
movl $0x5, %edi
callq 0x2580
jmp 0x402e
cmpl $0x9, -0x4(%rbp)
jne 0x3fb8
movq 0x61d8(%rip), %rsi      # 0xa178
leaq 0x28e6(%rip), %rdi      # 0x688d
movl $0x31f, %edx            # imm = 0x31F
movb $0x0, %al
callq 0x2780
callq 0x3830
jmp 0x3fba
movl -0x4(%rbp), %eax
movl %eax, -0x8(%rbp)
subl $0x20, %eax
je 0x401f
jmp 0x3fc7
movl -0x8(%rbp), %eax
subl $0x61, %eax
je 0x4007
jmp 0x3fd1
movl -0x8(%rbp), %eax
subl $0x64, %eax
je 0x4013
jmp 0x3fdb
movl -0x8(%rbp), %eax
subl $0x73, %eax
je 0x3ffb
jmp 0x3fe5
movl -0x8(%rbp), %eax
subl $0x77, %eax
jne 0x4029
jmp 0x3fef
movl $0xc, %edi
callq 0x2580
jmp 0x4029
movl $0xd, %edi
callq 0x2580
jmp 0x4029
movl $0xe, %edi
callq 0x2580
jmp 0x4029
movl $0xf, %edi
callq 0x2580
jmp 0x4029
movl $0x10, %edi
callq 0x2580
jmp 0x3f31
callq 0x3920
movq 0x613e(%rip), %rsi      # 0xa178
leaq 0x2876(%rip), %rdi      # 0x68b7
movl $0x32d, %edx            # imm = 0x32D
movb $0x0, %al
callq 0x2780
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 0x3950
movl $0x4, %edi
callq 0x3950
movl $0x5, %edi
callq 0x3950
movl $0x6, %edi
callq 0x3950
leaq 0x5eed(%rip), %rdi      # 0xa130
callq 0x3c20
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
callq 0x3920
callq 0x4210
callq 0x3330
movl $0x3, %edi
movl $0x7, %esi
callq 0x4060
movl %eax, -0x4(%rbp)
movq 0x5ef8(%rip), %rsi      # 0xa178
movl -0x4(%rbp), %ecx
leaq 0x26d0(%rip), %rdi      # 0x695a
movl $0x372, %edx            # imm = 0x372
movb $0x0, %al
callq 0x2780
movslq -0x4(%rbp), %rax
leaq 0x601f(%rip), %rcx      # 0xa2c0
imulq $0x18, %rax, %rax
addq %rax, %rcx
movb $0x0, %al
callq *0x10(%rcx)
movl %eax, -0x8(%rbp)
movq 0x5ec1(%rip), %rsi      # 0xa178
movl -0x8(%rbp), %ecx
leaq 0x26b0(%rip), %rdi      # 0x6971
movl $0x375, %edx            # imm = 0x375
movb $0x0, %al
callq 0x2780
cmpl $0x0, -0x8(%rbp)
jl 0x42dc
cmpl $0x1, 0x5fde(%rip)      # 0xa2b8
jne 0x4303
callq 0x3920
movq 0x5e90(%rip), %rsi      # 0xa178
movl 0x5fca(%rip), %ecx      # 0xa2b8
leaq 0x269d(%rip), %rdi      # 0x6992
movl $0x379, %edx            # imm = 0x379
movb $0x0, %al
callq 0x2780
jmp 0x4330
cmpl $0x3, 0x5fae(%rip)      # 0xa2b8
jne 0x432b
movq 0x5e65(%rip), %rsi      # 0xa178
leaq 0x26a0(%rip), %rdi      # 0x69ba
movl $0x37e, %edx            # imm = 0x37E
movb $0x0, %al
callq 0x2780
callq 0x3ef0
jmp 0x425d
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq 0x5df9(%rip), %rsi      # 0xa178
leaq 0x264e(%rip), %rdi      # 0x69d4
movl $0x38b, %edx            # imm = 0x38B
movb $0x0, %al
callq 0x2780
xorl %edi, %edi
leaq 0x2650(%rip), %rsi      # 0x69eb
movb $0x0, %al
callq 0x2890
callq 0x4340
callq 0x3330
xorl %edi, %edi
movl $0x3, %esi
callq 0x4060
movl %eax, -0x4(%rbp)
movq 0x5db6(%rip), %rsi      # 0xa178
movl -0x4(%rbp), %ecx
movslq -0x4(%rbp), %rdx
leaq 0x5ef0(%rip), %rax      # 0xa2c0
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq 0x8(%rax), %r8
leaq 0x2644(%rip), %rdi      # 0x6a26
movl $0x391, %edx            # imm = 0x391
movb $0x0, %al
callq 0x2780
movslq -0x4(%rbp), %rax
leaq 0x5ec7(%rip), %rcx      # 0xa2c0
imulq $0x18, %rax, %rax
addq %rax, %rcx
movb $0x0, %al
callq *0x10(%rcx)
cmpl $0x2, 0x5eac(%rip)      # 0xa2b8
jne 0x4447
movq 0x5d63(%rip), %rsi      # 0xa178
leaq 0x2624(%rip), %rdi      # 0x6a40
movl $0x395, %edx            # imm = 0x395
movb $0x0, %al
callq 0x2780
movq 0x5d49(%rip), %rsi      # 0xa178
leaq 0x2630(%rip), %rdi      # 0x6a66
movl $0x396, %edx            # imm = 0x396
movb $0x0, %al
callq 0x2780
callq 0x4250
jmp 0x43a2
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq 0x5bd5(%rip), %rsi      # 0xa178
leaq 0x24d2(%rip), %rdi      # 0x6a7c
movl $0x3b6, %edx            # imm = 0x3B6
leaq 0x25b6(%rip), %rcx      # 0x6b6c
movb $0x0, %al
callq 0x2780
movq 0x5bb4(%rip), %rsi      # 0xa178
leaq 0x25bd(%rip), %rdi      # 0x6b88
movl $0x3b7, %edx            # imm = 0x3B7
movb $0x0, %al
callq 0x2780
leaq 0x25c5(%rip), %rdi      # 0x6ba3
callq 0x33a0
movq 0x5b8e(%rip), %rsi      # 0xa178
movslq 0x5cc7(%rip), %rcx      # 0xa2b8
leaq 0x5d78(%rip), %rax      # 0xa370
movq (%rax,%rcx,8), %rcx
movq 0x5d7d(%rip), %r8       # 0xa380
leaq 0x25ba(%rip), %rdi      # 0x6bc4
movl $0x3b9, %edx            # imm = 0x3B9
movb $0x0, %al
callq 0x2780
movl $0x2, 0x5c98(%rip)      # 0xa2b8
movq 0x5b51(%rip), %rsi      # 0xa178
leaq 0x25c4(%rip), %rdi      # 0x6bf2
movl $0x3bb, %edx            # imm = 0x3BB
movb $0x0, %al
callq 0x2780
callq 0x3330
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq 0x5b15(%rip), %rsi      # 0xa178
leaq 0x2412(%rip), %rdi      # 0x6a7c
movl $0x3c1, %edx            # imm = 0x3C1
leaq 0x25a4(%rip), %rcx      # 0x6c1a
movb $0x0, %al
callq 0x2780
leaq 0x25c3(%rip), %rdi      # 0x6c47
callq 0x33a0
callq 0x3330
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq 0x5ac5(%rip), %rsi      # 0xa178
leaq 0x23c2(%rip), %rdi      # 0x6a7c
movl $0x3c8, %edx            # imm = 0x3C8
leaq 0x25a3(%rip), %rcx      # 0x6c69
movb $0x0, %al
callq 0x2780
leaq 0x25bd(%rip), %rdi      # 0x6c91
callq 0x33a0
callq 0x3330
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq 0x5a75(%rip), %rsi      # 0xa178
leaq 0x2372(%rip), %rdi      # 0x6a7c
movl $0x3cf, %edx            # imm = 0x3CF
leaq 0x258b(%rip), %rcx      # 0x6ca1
movb $0x0, %al
callq 0x2780
leaq 0x25a1(%rip), %rdi      # 0x6cc5
callq 0x33a0
callq 0x3330
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq 0x5a25(%rip), %rsi      # 0xa178
leaq 0x2322(%rip), %rdi      # 0x6a7c
movl $0x3d6, %edx            # imm = 0x3D6
leaq 0x2582(%rip), %rcx      # 0x6ce8
movb $0x0, %al
callq 0x2780
leaq 0x259b(%rip), %rdi      # 0x6d0f
callq 0x33a0
callq 0x3330
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq 0x597e(%rip), %rsi      # 0xa178
leaq 0x227b(%rip), %rdi      # 0x6a7c
movl $0x3e5, %edx            # imm = 0x3E5
leaq 0x253e(%rip), %rcx      # 0x6d4b
movb $0x0, %al
callq 0x2780
movl $0x0, -0x10(%rbp)
cmpl $0x5, -0x10(%rbp)
jge 0x487f
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movzbl 0x8(%rax,%rcx,8), %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x4872
cmpl $0x1, -0x14(%rbp)
je 0x4872
movslq -0xc(%rbp), %rax
leaq 0x5da8(%rip), %rdi      # 0xa5f0
addq %rax, %rdi
movq -0x8(%rbp), %rdx
addq $0x1, %rdx
movslq -0x10(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdx
leaq 0x2503(%rip), %rsi      # 0x6d68
movb $0x0, %al
callq 0x21d0
addl -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
jmp 0x4874
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x481b
movslq -0xc(%rbp), %rax
cmpq $0x22, %rax
jbe 0x48b6
jmp 0x488b
movq 0x5766(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x1c18(%rip), %rsi      # 0x64b4
leaq 0x24a8(%rip), %rdx      # 0x6d4b
movl $0x3ee, %ecx            # imm = 0x3EE
movb $0x0, %al
callq 0x2140
xorl %edi, %edi
callq 0x21e0
movl -0xc(%rbp), %eax
subl $0x2, %eax
movslq %eax, %rcx
leaq 0x5d2a(%rip), %rax      # 0xa5f0
movb $0x0, (%rax,%rcx)
movq 0x58a7(%rip), %rsi      # 0xa178
leaq 0x2495(%rip), %rdi      # 0x6d6d
movl $0x3f1, %edx            # imm = 0x3F1
leaq 0x5d0c(%rip), %rcx      # 0xa5f0
movb $0x0, %al
callq 0x2780
xorl %edi, %edi
leaq 0x249f(%rip), %rsi      # 0x6d93
leaq 0x5cf5(%rip), %rdx      # 0xa5f0
movb $0x0, %al
callq 0x2890
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq 0x584e(%rip), %rsi      # 0xa178
leaq 0x214b(%rip), %rdi      # 0x6a7c
movl $0x3f8, %edx            # imm = 0x3F8
leaq 0x2461(%rip), %rcx      # 0x6d9e
movb $0x0, %al
callq 0x2780
movl $0x0, -0x10(%rbp)
cmpl $0x5, -0x10(%rbp)
jge 0x49b6
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movzbl 0x8(%rax,%rcx,8), %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x49a9
cmpl $0x1, -0x14(%rbp)
je 0x49a9
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc(%rbp)
cltq
leaq 0x57af(%rip), %rdi      # 0xa130
addq $0x10, %rdi
imulq $0x7, %rax, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
addq $0x1, %rsi
movslq -0x10(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movl $0x6, %edx
callq 0x2040
jmp 0x49ab
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x494b
movq 0x57bb(%rip), %rsi      # 0xa178
leaq 0x23f9(%rip), %rdi      # 0x6dbd
movl $0x402, %edx            # imm = 0x402
movb $0x0, %al
callq 0x2780
leaq 0x5759(%rip), %rdi      # 0xa130
callq 0x3c20
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq 0x5725(%rip), %rsi      # 0xa178
leaq 0x2022(%rip), %rdi      # 0x6a7c
movl $0x40e, %edx            # imm = 0x40E
leaq 0x23ae(%rip), %rcx      # 0x6e14
movb $0x0, %al
callq 0x2780
leaq 0x23c4(%rip), %rdi      # 0x6e38
callq 0x33a0
movl $0x3, 0x5835(%rip)      # 0xa2b8
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq 0x56d5(%rip), %rsi      # 0xa178
leaq 0x1fd2(%rip), %rdi      # 0x6a7c
movl $0x415, %edx            # imm = 0x415
leaq 0x2398(%rip), %rcx      # 0x6e4e
movb $0x0, %al
callq 0x2780
leaq 0x23aa(%rip), %rdi      # 0x6e6e
callq 0x33a0
movl $0x2, 0x57e5(%rip)      # 0xa2b8
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq 0x5635(%rip), %rsi      # 0xa178
leaq 0x1f32(%rip), %rdi      # 0x6a7c
movl $0x422, %edx            # imm = 0x422
leaq 0x2362(%rip), %rcx      # 0x6eb8
movb $0x0, %al
callq 0x2780
movl $0x0, -0xc(%rbp)
cmpl $0x5, -0xc(%rbp)
jge 0x4bbf
movslq -0xc(%rbp), %rcx
leaq 0x55bb(%rip), %rax      # 0xa130
addq $0x10, %rax
imulq $0x7, %rcx, %rcx
addq %rcx, %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x4bb2
movslq -0xc(%rbp), %rax
leaq 0x559d(%rip), %rdi      # 0xa130
addq $0x10, %rdi
imulq $0x7, %rax, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
addq $0x1, %rsi
movl $0x6, %edx
callq 0x2040
jmp 0x4bbf
jmp 0x4bb4
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x4b64
cmpl $0x2, 0x56f2(%rip)      # 0xa2b8
jne 0x4bd4
leaq 0x5561(%rip), %rdi      # 0xa130
callq 0x3c20
movq -0x8(%rbp), %rsi
addq $0x1, %rsi
leaq 0x22eb(%rip), %rdi      # 0x6ece
movb $0x0, %al
callq 0x3240
movq %rax, %rdi
callq 0x33a0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq 0x5565(%rip), %rsi      # 0xa178
leaq 0x1e62(%rip), %rdi      # 0x6a7c
movl $0x430, %edx            # imm = 0x430
leaq 0x22b9(%rip), %rcx      # 0x6edf
movb $0x0, %al
callq 0x2780
movl $0x0, -0xc(%rbp)
cmpl $0x5, -0xc(%rbp)
jge 0x4c8f
movslq -0xc(%rbp), %rax
leaq 0x54eb(%rip), %rdi      # 0xa130
addq $0x10, %rdi
imulq $0x7, %rax, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
addq $0x1, %rsi
movl $0x6, %edx
callq 0x2050
cmpl $0x0, %eax
jne 0x4c82
movslq -0xc(%rbp), %rcx
leaq 0x54be(%rip), %rax      # 0xa130
addq $0x10, %rax
imulq $0x7, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
jmp 0x4c8f
jmp 0x4c84
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x4c34
cmpl $0x2, 0x5622(%rip)      # 0xa2b8
jne 0x4ca4
leaq 0x5491(%rip), %rdi      # 0xa130
callq 0x3c20
movq -0x8(%rbp), %rsi
addq $0x1, %rsi
leaq 0x2243(%rip), %rdi      # 0x6ef6
movb $0x0, %al
callq 0x3240
movq %rax, %rdi
callq 0x33a0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq 0x5435(%rip), %rsi      # 0xa178
leaq 0x1d32(%rip), %rdi      # 0x6a7c
movl $0x444, %edx            # imm = 0x444
leaq 0x21ea(%rip), %rcx      # 0x6f40
movb $0x0, %al
callq 0x2780
movq 0x5414(%rip), %rsi      # 0xa178
movq -0x8(%rbp), %rcx
addq $0x1, %rcx
leaq 0x21e4(%rip), %rdi      # 0x6f57
movl $0x445, %edx            # imm = 0x445
movb $0x0, %al
callq 0x2780
movq -0x8(%rbp), %rsi
addq $0x1, %rsi
leaq 0x21eb(%rip), %rdi      # 0x6f79
movb $0x0, %al
callq 0x3240
movq %rax, %rdi
callq 0x33a0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq 0x52f5(%rip), %rsi      # 0xa178
leaq 0x1bf2(%rip), %rdi      # 0x6a7c
movl $0x458, %edx            # imm = 0x458
leaq 0x2179(%rip), %rcx      # 0x700f
movb $0x0, %al
callq 0x2780
movq -0x8(%rbp), %rsi
addq $0x1, %rsi
leaq 0x217c(%rip), %rdi      # 0x7028
movb $0x0, %al
callq 0x3240
movq %rax, %rdi
callq 0x33a0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq 0x5185(%rip), %rsi      # 0xa178
leaq 0x20e3(%rip), %rdi      # 0x70dd
movl $0x472, %edx            # imm = 0x472
movb $0x0, %al
callq 0x2780
callq 0x3030
movl $0x0, -0xc(%rbp)
cmpl $0x5, -0xc(%rbp)
jge 0x50c8
movslq -0xc(%rbp), %rcx
leaq 0x55ec(%rip), %rax      # 0xa613
movzbl 0x4(%rax,%rcx,2), %eax
cmpl $0x3c, %eax
jge 0x5046
movslq -0xc(%rbp), %rcx
leaq 0x55d7(%rip), %rax      # 0xa613
movzbl 0x5(%rax,%rcx,2), %eax
cmpl $0x10, %eax
jl 0x5048
jmp 0x50ba
movq 0x5129(%rip), %rsi      # 0xa178
movl -0xc(%rbp), %ecx
movslq -0xc(%rbp), %rdx
leaq 0x55b6(%rip), %rax      # 0xa613
movzbl 0x4(%rax,%rdx,2), %r8d
movslq -0xc(%rbp), %rdx
leaq 0x55a5(%rip), %rax      # 0xa613
movzbl 0x5(%rax,%rdx,2), %r9d
leaq 0x207e(%rip), %rdi      # 0x70f9
movl $0x479, %edx            # imm = 0x479
movb $0x0, %al
callq 0x2780
movslq -0xc(%rbp), %rcx
leaq 0x5581(%rip), %rax      # 0xa613
movzbl 0x4(%rax,%rcx,2), %edi
movslq -0xc(%rbp), %rcx
leaq 0x5571(%rip), %rax      # 0xa613
movzbl 0x5(%rax,%rcx,2), %esi
callq 0x2f70
leaq 0x1312(%rip), %rdi      # 0x63c5
movb $0x0, %al
callq 0x20b0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x5012
movl $0x0, -0x10(%rbp)
cmpl $0x87, -0x10(%rbp)
jge 0x5133
movslq -0x10(%rbp), %rcx
leaq 0x5530(%rip), %rax      # 0xa613
movzbl 0xe(%rax,%rcx), %eax
cmpl $0x6, %eax
je 0x50ef
jmp 0x5128
movslq -0x10(%rbp), %rcx
leaq 0x5519(%rip), %rax      # 0xa613
movzbl 0x95(%rax,%rcx,2), %edi
movslq -0x10(%rbp), %rcx
leaq 0x5506(%rip), %rax      # 0xa613
movzbl 0x96(%rax,%rcx,2), %esi
callq 0x2f70
leaq 0x12a4(%rip), %rdi      # 0x63c5
movb $0x0, %al
callq 0x20b0
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x50cf
movq 0x4e96(%rip), %rax      # 0x9fd0
movq (%rax), %rdi
callq 0x2170
callq 0x3050
movq -0x8(%rbp), %rsi
leaq 0x54c1(%rip), %rdi      # 0xa613
movl $0x1a3, %edx            # imm = 0x1A3
callq 0x2150
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
callq 0x3030
movl $0x0, -0xc(%rbp)
cmpl $0x5, -0xc(%rbp)
jge 0x5214
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movzbl 0x4(%rax,%rcx,2), %eax
cmpl $0x3c, %eax
jge 0x51b6
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movzbl 0x5(%rax,%rcx,2), %eax
cmpl $0x10, %eax
jl 0x51b8
jmp 0x5206
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movzbl 0x4(%rax,%rcx,2), %edi
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movzbl 0x5(%rax,%rcx,2), %esi
callq 0x2f70
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
cmpl %ecx, %eax
jne 0x51f6
leaq 0x260e(%rip), %rdi      # 0x77fb
movb $0x0, %al
callq 0x20b0
jmp 0x5204
leaq 0x25b6(%rip), %rdi      # 0x77b3
movb $0x0, %al
callq 0x20b0
jmp 0x5206
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x5188
movq 0x4db5(%rip), %rax      # 0x9fd0
movq (%rax), %rdi
callq 0x2170
callq 0x3050
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/wierton[P]socket-based-naive-game/client.c
// Function: draw_items
void draw_items(server_message_t *psm) {
	lock_cursor();
	for(int i = 0; i < MAX_ITEM; i++) {
		if(psm->item_kind[i] == ITEM_NONE)
			continue;

		set_cursor(psm->item_pos[i].x, psm->item_pos[i].y);
		switch(psm->item_kind[i]) {
			case ITEM_MAGAZINE:printf("+");break;
			case ITEM_MAGMA:printf("╳");break;
			case ITEM_GRASS:printf("█");break;
			case ITEM_BLOOD_VIAL:printf("*");break;
			case ITEM_BULLET:printf(".");
		}
	}

	fflush(stdout);

	unlock_cursor();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
callq 0x3030
movl $0x0, -0xc(%rbp)
cmpl $0x87, -0xc(%rbp)
jge 0x5315
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movzbl 0xe(%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x526c
jmp 0x5307
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movzbl 0x95(%rax,%rcx,2), %edi
movzbl 0x96(%rax,%rcx,2), %esi
callq 0x2f70
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movzbl 0xe(%rax,%rcx), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x5, %eax
ja 0x5305
movq -0x18(%rbp), %rax
leaq 0xd56(%rip), %rcx       # 0x6004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x126b(%rip), %rdi      # 0x6529
movb $0x0, %al
callq 0x20b0
jmp 0x5305
leaq 0x1e4a(%rip), %rdi      # 0x7118
movb $0x0, %al
callq 0x20b0
jmp 0x5305
leaq 0x1e3e(%rip), %rdi      # 0x711c
movb $0x0, %al
callq 0x20b0
jmp 0x5305
leaq 0x1531(%rip), %rdi      # 0x681f
movb $0x0, %al
callq 0x20b0
jmp 0x5305
leaq 0xe8b(%rip), %rdi       # 0x6189
movb $0x0, %al
callq 0x20b0
jmp 0x5307
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x5248
movq 0x4cb4(%rip), %rax      # 0x9fd0
movq (%rax), %rdi
callq 0x2170
callq 0x3050
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/wierton[P]socket-based-naive-game/client.c
// Function: serv_msg_battle_info
int serv_msg_battle_info(server_message_t *psm) {
	wlog("call message handler %s\n", __func__);
	if(user_state == USER_STATE_BATTLE) {
		log_psm_info(psm);
		user_bullets = psm->bullets_num;
		user_hp = psm->life;
		flip_old_items(psm);
		draw_users(psm);
		draw_items(psm);
		display_user_state();
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq 0x4c45(%rip), %rsi      # 0xa178
leaq 0x1542(%rip), %rdi      # 0x6a7c
movl $0x4cd, %edx            # imm = 0x4CD
leaq 0x1c4c(%rip), %rcx      # 0x7192
movb $0x0, %al
callq 0x2780
cmpl $0x3, 0x4d64(%rip)      # 0xa2b8
jne 0x559b
movq -0x8(%rbp), %rdi
callq 0x5330
movq -0x8(%rbp), %rax
movzbl 0x3(%rax), %eax
movl %eax, 0x507b(%rip)      # 0xa5e8
movq -0x8(%rbp), %rax
movzbl 0x1(%rax), %eax
movl %eax, 0x5069(%rip)      # 0xa5e4
movq -0x8(%rbp), %rdi
callq 0x4fe0
movq -0x8(%rbp), %rdi
callq 0x5170
movq -0x8(%rbp), %rdi
callq 0x5230
callq 0x3330
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wierton[P]socket-based-naive-game/client.c
// Function: message_monitor
void *message_monitor(void *args) {
	server_message_t sm;
	wlog("monitor thread starts\n");
	while(1) {
		wrap_recv(&sm);
		wlog("receive server message: %s\n", server_message_s[sm.message]);
		if(recv_msg_func[sm.message]) {
			wlog("==> call message handler\n");
			recv_msg_func[sm.message](&sm);
			wlog("==> quit message handler\n");
		}

		// delay assignment
		if(sm.message == SERVER_RESPONSE_LOGIN_SUCCESS
			|| sm.message == SERVER_RESPONSE_YOU_HAVE_LOGINED
			|| sm.message == SERVER_RESPONSE_LOGIN_FAIL_UNREGISTERED_USERID
			|| sm.message == SERVER_RESPONSE_LOGIN_FAIL_ERROR_PASSWORD
			|| sm.message == SERVER_RESPONSE_LOGIN_FAIL_DUP_USERID
			|| sm.message == SERVER_RESPONSE_LOGIN_FAIL_SERVER_LIMITS
			|| sm.message == SERVER_RESPONSE_LAUNCH_BATTLE_SUCCESS
			|| sm.message == SERVER_RESPONSE_LAUNCH_BATTLE_FAIL)
		global_serv_message = sm.message;
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x8(%rbp)
movq 0x49d2(%rip), %rsi      # 0xa178
leaq 0x1b18(%rip), %rdi      # 0x72c5
movl $0x524, %edx            # imm = 0x524
movb $0x0, %al
callq 0x2780
leaq -0x1ab(%rbp), %rdi
callq 0x24f0
movq 0x49ac(%rip), %rsi      # 0xa178
movzbl -0x1ab(%rbp), %eax
movl %eax, %ecx
leaq 0x49b4(%rip), %rax      # 0xa190
movq (%rax,%rcx,8), %rcx
leaq 0x1afc(%rip), %rdi      # 0x72e3
movl $0x527, %edx            # imm = 0x527
movb $0x0, %al
callq 0x2780
movzbl -0x1ab(%rbp), %eax
movl %eax, %ecx
leaq 0x4bed(%rip), %rax      # 0xa3f0
cmpq $0x0, (%rax,%rcx,8)
je 0x5858
movq 0x4967(%rip), %rsi      # 0xa178
leaq 0x1aee(%rip), %rdi      # 0x7306
movl $0x529, %edx            # imm = 0x529
movb $0x0, %al
callq 0x2780
movzbl -0x1ab(%rbp), %eax
movl %eax, %ecx
leaq -0x1ab(%rbp), %rdi
leaq 0x4bb5(%rip), %rax      # 0xa3f0
callq *(%rax,%rcx,8)
movq 0x4933(%rip), %rsi      # 0xa178
leaq 0x1adb(%rip), %rdi      # 0x7327
movl $0x52b, %edx            # imm = 0x52B
movb $0x0, %al
callq 0x2780
movzbl -0x1ab(%rbp), %eax
cmpl $0x4, %eax
je 0x58b8
movzbl -0x1ab(%rbp), %eax
cmpl $0x5, %eax
je 0x58b8
movzbl -0x1ab(%rbp), %eax
cmpl $0x7, %eax
je 0x58b8
movzbl -0x1ab(%rbp), %eax
cmpl $0x8, %eax
je 0x58b8
movzbl -0x1ab(%rbp), %eax
cmpl $0x9, %eax
je 0x58b8
movzbl -0x1ab(%rbp), %eax
cmpl $0xa, %eax
je 0x58b8
movzbl -0x1ab(%rbp), %eax
cmpl $0xe, %eax
je 0x58b8
movzbl -0x1ab(%rbp), %eax
cmpl $0xd, %eax
jne 0x58c5
movzbl -0x1ab(%rbp), %eax
movl %eax, 0x48bb(%rip)      # 0xa180
jmp 0x57b9
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wierton[P]socket-based-naive-game/client.c
// Function: main
int main() {
	wlog("====================START====================\n");
	client_fd = connect_to_server();

	system("clear");
	init_scr_wh();
	wrap_get_term_attr(&raw_termio);
	hide_cursor();

	flip_screen();

	start_message_monitor();
	start_ui();

	resume_and_exit(0);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
movq 0x4832(%rip), %rsi      # 0xa178
leaq 0x1a4b(%rip), %rdi      # 0x7398
movl $0x545, %edx            # imm = 0x545
movb $0x0, %al
callq 0x2780
callq 0x2390
movl %eax, 0x480c(%rip)      # 0xa170
leaq 0x1a63(%rip), %rdi      # 0x73ce
callq 0x2080
callq 0x3070
leaq 0x4bdc(%rip), %rdi      # 0xa558
callq 0x2de0
callq 0x2fa0
callq 0x3920
callq 0x58d0
callq 0x4370
xorl %edi, %edi
callq 0x2b10
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/983[P]bigint/cpp_examples.cpp
// Function: xorshift32()
uint32_t xorshift32() {
    static uint32_t x = 314159265;
    x ^= x << 13;
    x ^= x >> 17;
    x ^= x << 5;
    return x;
}

// Assembly:
movl 0x7e2a(%rip), %eax      # 0x90b0
shll $0xd, %eax
xorl 0x7e21(%rip), %eax      # 0x90b0
movl %eax, 0x7e1b(%rip)      # 0x90b0
movl 0x7e15(%rip), %eax      # 0x90b0
shrl $0x11, %eax
xorl 0x7e0c(%rip), %eax      # 0x90b0
movl %eax, 0x7e06(%rip)      # 0x90b0
movl 0x7e00(%rip), %eax      # 0x90b0
shll $0x5, %eax
xorl 0x7df7(%rip), %eax      # 0x90b0
movl %eax, 0x7df1(%rip)      # 0x90b0
movl 0x7deb(%rip), %eax      # 0x90b0
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/983[P]bigint/./bigint.hpp
// Function: std::ostream& BigInt::write<std::ostream>(std::ostream&, int) const
STREAM& write(STREAM &s, int dst_base = 10) const {
        int n = bigint_write_size(data, dst_base);
        char *buf = (char*)malloc(n);
        write(buf, &n, dst_base);
        s << buf;
        free(buf);
        return s;
    }

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl %edx, 0x14(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, (%rsp)
cvtsi2sdl 0x14(%rsp), %xmm0
callq 0x39a0
movl %eax, 0x10(%rsp)
movslq 0x10(%rsp), %rdi
callq 0x10f0
movq (%rsp), %rdi
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rsi
movl 0x14(%rsp), %ecx
leaq 0x10(%rsp), %rdx
movl $0x1, %r8d
callq 0x1c80
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x10c0
movq 0x8(%rsp), %rdi
callq 0x10e0
movq 0x18(%rsp), %rax
addq $0x28, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/hobo0xcc[P]rve/src/cpu.c
// Function: GetRange
uint64_t GetRange(uint64_t v, uint64_t start, uint64_t end) {
    if (start < 0 || end >= 64) {
        Error("Out of range: GetRange");
    }
    
    uint64_t mask = SetNBits(end - start + 1);
    return (v & (mask << start)) >> start;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jb 0x1332
cmpq $0x40, -0x18(%rbp)
jb 0x1340
leaq 0xe043(%rip), %rdi      # 0xf37c
movb $0x0, %al
callq 0xd690
movq -0x18(%rbp), %rax
subq -0x10(%rbp), %rax
addq $0x1, %rax
movl %eax, %edi
callq 0x12b0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rcx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
movq -0x10(%rbp), %rcx
shrq %cl, %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)