LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/wierton[P]socket-based-naive-game/server.c
// Function: move_bullets
void move_bullets(int bid) {
	for(int i = 0; i < MAX_ITEM; i++) {
		if(battles[bid].items[i].is_used == false
		|| battles[bid].items[i].kind != ITEM_BULLET)
			continue;
		uint8_t *px = &(battles[bid].items[i].pos.x);
		uint8_t *py = &(battles[bid].items[i].pos.y);

		// log("try to move bullet %d with dir %d\n", i, battles[bid].items[i].dir);

		switch(battles[bid].items[i].dir) {
			case DIR_UP:	(*py)--;break;
			case DIR_DOWN:	(*py)++;break;
			case DIR_LEFT:	(*px)--;break;
			case DIR_RIGHT:	(*px)++;break;
		}

		if(*px >= BATTLE_W || *py >= BATTLE_H) {
			log("free bullet #%d\n", i);
			battles[bid].items[i].is_used = false;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
cmpl $0x87, -0x8(%rbp)
jge 0x22dc
movslq -0x4(%rbp), %rcx
leaq 0x8236(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x78, %rax
movslq -0x8(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, (%rax)
je 0x21a2
movslq -0x4(%rbp), %rcx
leaq 0x820d(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x78, %rax
movslq -0x8(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
cmpl $0x6, 0xc(%rax)
je 0x21a7
jmp 0x22ce
movslq -0x4(%rbp), %rax
imulq $0xb08, %rax, %rdx      # imm = 0xB08
leaq 0x81d7(%rip), %rax      # 0xa390
movq %rax, %rcx
addq %rdx, %rcx
movslq -0x8(%rbp), %rdx
leaq (%rdx,%rdx,4), %rdx
leaq 0x88(%rcx,%rdx,4), %rcx
movq %rcx, -0x10(%rbp)
movslq -0x4(%rbp), %rcx
imulq $0xb08, %rcx, %rdx      # imm = 0xB08
movq %rax, %rcx
addq %rdx, %rcx
movslq -0x8(%rbp), %rdx
leaq (%rdx,%rdx,4), %rdx
leaq 0x89(%rcx,%rdx,4), %rcx
movq %rcx, -0x18(%rbp)
movslq -0x4(%rbp), %rcx
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
movslq -0x8(%rbp), %rcx
leaq (%rcx,%rcx,4), %rcx
movl 0x7c(%rax,%rcx,4), %eax
movq %rax, -0x20(%rbp)
subq $0x3, %rax
ja 0x2262
movq -0x20(%rbp), %rax
leaq 0x3ddd(%rip), %rcx      # 0x6004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rax
movb (%rax), %cl
addb $-0x1, %cl
movb %cl, (%rax)
jmp 0x2262
movq -0x18(%rbp), %rax
movb (%rax), %cl
addb $0x1, %cl
movb %cl, (%rax)
jmp 0x2262
movq -0x10(%rbp), %rax
movb (%rax), %cl
addb $-0x1, %cl
movb %cl, (%rax)
jmp 0x2262
movq -0x10(%rbp), %rax
movb (%rax), %cl
addb $0x1, %cl
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x3c, %eax
jge 0x227a
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x10, %eax
jl 0x22cc
movq 0x7d77(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movl -0x8(%rbp), %r8d
leaq 0x4205(%rip), %rsi      # 0x6494
leaq 0x4227(%rip), %rdx      # 0x64bd
movl $0x11e, %ecx            # imm = 0x11E
movb $0x0, %al
callq 0x10f0
movslq -0x4(%rbp), %rcx
leaq 0x80e3(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x78, %rax
movslq -0x8(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl $0x0, (%rax)
jmp 0x22ce
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x2142
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wierton[P]socket-based-naive-game/server.c
// Function: send_to_client
void send_to_client(int uid, int message) {
	int conn = sessions[uid].conn;
	server_message_t sm;
	memset(&sm, 0, sizeof(server_message_t));
	sm.response = message;
	wrap_send(conn, &sm);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x7c24(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0xc(%rbp)
leaq -0x1af(%rbp), %rdi
xorl %esi, %esi
movl $0x1a3, %edx            # imm = 0x1A3
callq 0x10c0
movl -0x8(%rbp), %eax
movb %al, -0x1af(%rbp)
movl -0xc(%rbp), %edi
leaq -0x1af(%rbp), %rsi
callq 0x1560
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wierton[P]socket-based-naive-game/server.c
// Function: check_who_is_dead
void check_who_is_dead(int bid) {
	for(int i = 0; i < USER_CNT; i++) {
		if(battles[bid].users[i].battle_state == BATTLE_STATE_LIVE
		&& battles[bid].users[i].life <= 0) {
			log("user %d@%s is dead\n", i, sessions[i].user_name);
			battles[bid].users[i].battle_state = BATTLE_STATE_DEAD;
			log("send dead info to user %d@%s\n", i, sessions[i].user_name);
			send_to_client(i, SERVER_MESSAGE_YOU_ARE_DEAD);
		}else if(battles[bid].users[i].battle_state == BATTLE_STATE_DEAD){
			battles[bid].users[i].battle_state = BATTLE_STATE_WITNESS;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
cmpl $0x5, -0x8(%rbp)
jge 0x2fe9
movslq -0x4(%rbp), %rcx
leaq 0x7509(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x8(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
cmpl $0x1, (%rax)
jne 0x2f84
movslq -0x4(%rbp), %rcx
leaq 0x74dc(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x8(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0xc(%rax)
jg 0x2f84
movq 0x711a(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movl -0x8(%rbp), %r8d
movslq -0x8(%rbp), %rax
leaq 0x7330(%rip), %r9       # 0xa220
imulq $0x48, %rax, %rax
addq %rax, %r9
leaq 0x37a2(%rip), %rsi      # 0x66a0
leaq 0x37c7(%rip), %rdx      # 0x66cc
movl $0x1a1, %ecx            # imm = 0x1A1
movb $0x0, %al
callq 0x10f0
movslq -0x4(%rbp), %rcx
leaq 0x7474(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x8(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl $0x3, (%rax)
movq 0x70b6(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movl -0x8(%rbp), %r8d
movslq -0x8(%rbp), %rax
leaq 0x72cc(%rip), %r9       # 0xa220
imulq $0x48, %rax, %rax
addq %rax, %r9
leaq 0x377c(%rip), %rsi      # 0x66de
leaq 0x3763(%rip), %rdx      # 0x66cc
movl $0x1a3, %ecx            # imm = 0x1A3
movb $0x0, %al
callq 0x10f0
movl -0x8(%rbp), %edi
movl $0x1f, %esi
callq 0x25e0
jmp 0x2fd9
movslq -0x4(%rbp), %rcx
leaq 0x7401(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x8(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
cmpl $0x3, (%rax)
jne 0x2fd7
movslq -0x4(%rbp), %rcx
leaq 0x73d8(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x8(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl $0x2, (%rax)
jmp 0x2fd9
jmp 0x2fdb
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x2e72
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/wierton[P]socket-based-naive-game/server.c
// Function: battle_ruler
void *battle_ruler(void *args) {
	int bid = (int)(uintptr_t)args;
	log("battle ruler for battle #%d\n", bid);
	// FIXME: battle re-alloced before exiting loop 
	while(battles[bid].is_alloced) {
		move_bullets(bid);
		check_who_get_blood_vial(bid);
		check_who_traped_in_magma(bid);
		check_who_got_charger(bid);
		check_who_is_shooted(bid);
		check_who_is_dead(bid);
		
		random_generate_items(bid);

		inform_all_user_battle_state(bid);

		usleep(50000);
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl %eax, -0xc(%rbp)
movq 0x6cde(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movl -0xc(%rbp), %r8d
leaq 0x33ec(%rip), %rsi      # 0x6714
leaq 0x341a(%rip), %rdx      # 0x6749
movl $0x1ce, %ecx            # imm = 0x1CE
movb $0x0, %al
callq 0x10f0
movslq -0xc(%rbp), %rcx
leaq 0x704a(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
cmpl $0x0, (%rax)
je 0x33a1
movl -0xc(%rbp), %edi
callq 0x2130
movl -0xc(%rbp), %edi
callq 0x22f0
movl -0xc(%rbp), %edi
callq 0x2640
movl -0xc(%rbp), %edi
callq 0x2920
movl -0xc(%rbp), %edi
callq 0x2bf0
movl -0xc(%rbp), %edi
callq 0x2e60
movl -0xc(%rbp), %edi
callq 0x1f40
movl -0xc(%rbp), %edi
callq 0x2ff0
movl $0xc350, %edi           # imm = 0xC350
callq 0x11b0
jmp 0x333b
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wierton[P]socket-based-naive-game/server.c
// Function: check_user_registered
int check_user_registered(char *user_name, char *password) {
	for(int i = 0; i < REGISTERED_USER_LIST_SIZE; i++) {
		if(strncmp(user_name, registered_user_list[i].user_name, USERNAME_SIZE - 1) != 0)
			continue;

		if(strncmp(password, registered_user_list[i].password, PASSWORD_SIZE - 1) != 0) {
			logi("user name '%s' sent error password\n", user_name);
			return SERVER_RESPONSE_LOGIN_FAIL_ERROR_PASSWORD;
		}else{
			return SERVER_RESPONSE_LOGIN_SUCCESS;
		}
	}

	logi("user name '%s' hasn't been registered\n", user_name);
	return SERVER_RESPONSE_LOGIN_FAIL_UNREGISTERED_USERID;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0xa, -0x1c(%rbp)
jge 0x3469
movq -0x10(%rbp), %rdi
movslq -0x1c(%rbp), %rax
leaq 0xa7b0(%rip), %rsi      # 0xdb90
imulq $0xe, %rax, %rax
addq %rax, %rsi
movl $0x6, %edx
callq 0x1050
cmpl $0x0, %eax
je 0x33f8
jmp 0x345b
movq -0x18(%rbp), %rdi
movslq -0x1c(%rbp), %rax
leaq 0xa789(%rip), %rsi      # 0xdb90
imulq $0xe, %rax, %rax
addq %rax, %rsi
addq $0x7, %rsi
movl $0x6, %edx
callq 0x1050
cmpl $0x0, %eax
je 0x3452
movq 0x6bd0(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movq -0x10(%rbp), %r8
leaq 0x3320(%rip), %rsi      # 0x6756
leaq 0x3359(%rip), %rdx      # 0x6796
movl $0x1e7, %ecx            # imm = 0x1E7
movb $0x0, %al
callq 0x10f0
movl $0x8, -0x4(%rbp)
jmp 0x3498
movl $0x4, -0x4(%rbp)
jmp 0x3498
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x33c7
movq 0x6b88(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movq -0x10(%rbp), %r8
leaq 0x332e(%rip), %rsi      # 0x67ac
leaq 0x3311(%rip), %rdx      # 0x6796
movl $0x1ee, %ecx            # imm = 0x1EE
movb $0x0, %al
callq 0x10f0
movl $0x7, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wierton[P]socket-based-naive-game/server.c
// Function: launch_battle
void launch_battle(int bid) {
	pthread_t thread;

	log("try to create battle_ruler thread\n");
	if(pthread_create(&thread, NULL, battle_ruler, (void *)(uintptr_t)bid) == -1) {
		eprintf("fail to launch battle\n");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movq 0x6b36(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x3323(%rip), %rsi      # 0x67ef
leaq 0x3967(%rip), %rdx      # 0x6e3a
movl $0x1f5, %ecx            # imm = 0x1F5
movb $0x0, %al
callq 0x10f0
movslq -0x4(%rbp), %rcx
leaq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq -0x1f2(%rip), %rdx      # 0x3300
callq 0x1150
cmpl $-0x1, %eax
jne 0x3529
jmp 0x34fe
movq 0x6af3(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x331b(%rip), %rsi      # 0x682a
leaq 0x3924(%rip), %rdx      # 0x6e3a
movl $0x1f7, %ecx            # imm = 0x1F7
movb $0x0, %al
callq 0x10f0
xorl %edi, %edi
callq 0x1170
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/wierton[P]socket-based-naive-game/server.c
// Function: client_command_user_logout
int client_command_user_logout(int uid) {
	if(sessions[uid].state == USER_STATE_BATTLE
	|| sessions[uid].state == USER_STATE_WAIT_TO_BATTLE) {
		log("user %d@%s tries to logout was in battle\n", uid, sessions[uid].user_name);
		user_quit_battle(sessions[uid].bid, uid);
	}

	log("user %d@%s logout\n", uid, sessions[uid].user_name);
	sessions[uid].state = USER_STATE_NOT_LOGIN;
	inform_friends(uid, SERVER_MESSAGE_FRIEND_LOGOUT);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x67ea(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $0x3, 0xc(%rax)
je 0x3a5b
movslq -0x4(%rbp), %rcx
leaq 0x67d2(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $0x4, 0xc(%rax)
jne 0x3ab2
movq 0x6596(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movl -0x4(%rbp), %r8d
movslq -0x4(%rbp), %rax
leaq 0x67ac(%rip), %r9       # 0xa220
imulq $0x48, %rax, %rax
addq %rax, %r9
leaq 0x3081(%rip), %rsi      # 0x6b03
leaq 0x30bc(%rip), %rdx      # 0x6b45
movl $0x24d, %ecx            # imm = 0x24D
movb $0x0, %al
callq 0x10f0
movslq -0x4(%rbp), %rcx
leaq 0x6780(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %edi
movl -0x4(%rbp), %esi
callq 0x1350
movq 0x653f(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movl -0x4(%rbp), %r8d
movslq -0x4(%rbp), %rax
leaq 0x6755(%rip), %r9       # 0xa220
imulq $0x48, %rax, %rax
addq %rax, %r9
leaq 0x3087(%rip), %rsi      # 0x6b60
leaq 0x3065(%rip), %rdx      # 0x6b45
movl $0x251, %ecx            # imm = 0x251
movb $0x0, %al
callq 0x10f0
movslq -0x4(%rbp), %rcx
leaq 0x6729(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl $0x1, 0xc(%rax)
movl -0x4(%rbp), %edi
movl $0x15, %esi
callq 0x1da0
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/server.c
// Function: list_all_users
void list_all_users(server_message_t *psm) {
	for(int i = 0; i < USER_CNT; i++) {
		if(query_session_built(i)) {
			log("%s: found '%s' %s\n", __func__, sessions[i].user_name,
					sessions[i].state == USER_STATE_BATTLE ? "in battle" : "");
			psm->all_users[i].user_state = sessions[i].state;
			strncpy(psm->all_users[i].user_name, sessions[i].user_name, USERNAME_SIZE - 1);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0x5, -0xc(%rbp)
jge 0x3c17
movl -0xc(%rbp), %edi
callq 0x12d0
cmpl $0x0, %eax
je 0x3c07
movq 0x64a3(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movslq -0xc(%rbp), %rax
leaq 0x66bd(%rip), %r9       # 0xa220
imulq $0x48, %rax, %rax
addq %rax, %r9
movslq -0xc(%rbp), %rcx
leaq 0x66ab(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %edx
leaq 0x3b75(%rip), %rax      # 0x76fb
leaq 0x3038(%rip), %rcx      # 0x6bc5
cmpl $0x3, %edx
cmoveq %rcx, %rax
leaq 0x2ff0(%rip), %rsi      # 0x6b8b
leaq 0x3014(%rip), %r8       # 0x6bb6
movl $0x25b, %ecx            # imm = 0x25B
movq %r8, %rdx
movq %rax, (%rsp)
movb $0x0, %al
callq 0x10f0
movslq -0xc(%rbp), %rcx
leaq 0x6660(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movb %dl, 0x8(%rax,%rcx,8)
movq -0x8(%rbp), %rdi
addq $0x1, %rdi
movslq -0xc(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movslq -0xc(%rbp), %rax
leaq 0x662a(%rip), %rsi      # 0xa220
imulq $0x48, %rax, %rax
addq %rax, %rsi
movl $0x6, %edx
callq 0x1040
jmp 0x3c09
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x3b33
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wierton[P]socket-based-naive-game/server.c
// Function: client_command_fetch_all_users
int client_command_fetch_all_users(int uid) {
	char *user_name = sessions[uid].user_name;
	log("user %d@'%s' tries to fetch all users' info\n", uid, user_name);

	if(!query_session_built(uid)) {
		logi("user %d@'%s' who tries to list users hasn't login\n", uid, user_name);
		send_to_client(uid, SERVER_RESPONSE_YOU_HAVE_NOT_LOGIN);
		return 0;
	}

	server_message_t sm;
	memset(&sm, 0, sizeof(server_message_t));
	list_all_users(&sm);
	sm.response = SERVER_RESPONSE_ALL_USERS_INFO;

	wrap_send(sessions[uid].conn, &sm);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movl %edi, -0x8(%rbp)
movslq -0x8(%rbp), %rcx
leaq 0x65e7(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movq 0x63ad(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movl -0x8(%rbp), %r8d
movq -0x10(%rbp), %r9
leaq 0x2f72(%rip), %rsi      # 0x6bcf
leaq 0x2fb0(%rip), %rdx      # 0x6c14
movl $0x264, %ecx            # imm = 0x264
movb $0x0, %al
callq 0x10f0
movl -0x8(%rbp), %edi
callq 0x12d0
cmpl $0x0, %eax
jne 0x3cbf
movq 0x6374(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movl -0x8(%rbp), %r8d
movq -0x10(%rbp), %r9
leaq 0x2f9d(%rip), %rsi      # 0x6c33
leaq 0x2f77(%rip), %rdx      # 0x6c14
movl $0x267, %ecx            # imm = 0x267
movb $0x0, %al
callq 0x10f0
movl -0x8(%rbp), %edi
movl $0x6, %esi
callq 0x25e0
movl $0x0, -0x4(%rbp)
jmp 0x3d0d
leaq -0x1b3(%rbp), %rdi
xorl %esi, %esi
movl $0x1a3, %edx            # imm = 0x1A3
callq 0x10c0
leaq -0x1b3(%rbp), %rdi
callq 0x3b20
movb $0xb, -0x1b3(%rbp)
movslq -0x8(%rbp), %rcx
leaq 0x6530(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %edi
leaq -0x1b3(%rbp), %rsi
callq 0x1560
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wierton[P]socket-based-naive-game/server.c
// Function: client_command_fetch_all_friends
int client_command_fetch_all_friends(int uid) {
	char *user_name = sessions[uid].user_name;
	log("user %d@'%s' tries to fetch all friends' info\n", uid, user_name);

	if(!query_session_built(uid)) {
		logi("user %d@'%s' who tries to list users hasn't login\n", uid, user_name);
		send_to_client(uid, SERVER_RESPONSE_YOU_HAVE_NOT_LOGIN);
		return 0;
	}

	server_message_t sm;
	memset(&sm, 0, sizeof(server_message_t));
	list_all_users(&sm);
	sm.all_users[uid].user_state = USER_STATE_UNUSED;
	sm.response = SERVER_RESPONSE_ALL_FRIENDS_INFO;

	wrap_send(sessions[uid].conn, &sm);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movl %edi, -0x8(%rbp)
movslq -0x8(%rbp), %rcx
leaq 0x64e7(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movq 0x62ad(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movl -0x8(%rbp), %r8d
movq -0x10(%rbp), %r9
leaq 0x2f25(%rip), %rsi      # 0x6c82
leaq 0x2f65(%rip), %rdx      # 0x6cc9
movl $0x278, %ecx            # imm = 0x278
movb $0x0, %al
callq 0x10f0
movl -0x8(%rbp), %edi
callq 0x12d0
cmpl $0x0, %eax
jne 0x3dbf
movq 0x6274(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movl -0x8(%rbp), %r8d
movq -0x10(%rbp), %r9
leaq 0x2e9d(%rip), %rsi      # 0x6c33
leaq 0x2f2c(%rip), %rdx      # 0x6cc9
movl $0x27b, %ecx            # imm = 0x27B
movb $0x0, %al
callq 0x10f0
movl -0x8(%rbp), %edi
movl $0x6, %esi
callq 0x25e0
movl $0x0, -0x4(%rbp)
jmp 0x3e19
leaq -0x1b3(%rbp), %rdi
xorl %esi, %esi
movl $0x1a3, %edx            # imm = 0x1A3
callq 0x10c0
leaq -0x1b3(%rbp), %rdi
callq 0x3b20
movslq -0x8(%rbp), %rax
movb $0x0, -0x1ab(%rbp,%rax,8)
movb $0xc, -0x1b3(%rbp)
movslq -0x8(%rbp), %rcx
leaq 0x6424(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %edi
leaq -0x1b3(%rbp), %rsi
callq 0x1560
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wierton[P]socket-based-naive-game/server.c
// Function: client_command_quit_battle
int client_command_quit_battle(int uid) {
	log("user %d@%s tries to quit battle\n", uid, sessions[uid].user_name);
	if(sessions[uid].state != USER_STATE_BATTLE) {
		logi("but he hasn't join battle\n");
		send_to_client(uid, SERVER_RESPONSE_YOURE_NOT_IN_BATTLE);
	}else{
		logi("call user_quit_battle to quit\n");
		user_quit_battle(sessions[uid].bid, uid);
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movq 0x5e26(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movl -0x4(%rbp), %r8d
movslq -0x4(%rbp), %rax
leaq 0x603c(%rip), %r9       # 0xa220
imulq $0x48, %rax, %rax
addq %rax, %r9
leaq 0x2d41(%rip), %rsi      # 0x6f33
leaq 0x2d73(%rip), %rdx      # 0x6f6c
movl $0x2c6, %ecx            # imm = 0x2C6
movb $0x0, %al
callq 0x10f0
movslq -0x4(%rbp), %rcx
leaq 0x6010(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $0x3, 0xc(%rax)
je 0x4250
movq 0x5dd4(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x2d59(%rip), %rsi      # 0x6f87
leaq 0x2d37(%rip), %rdx      # 0x6f6c
movl $0x2c8, %ecx            # imm = 0x2C8
movb $0x0, %al
callq 0x10f0
movl -0x4(%rbp), %edi
movl $0xf, %esi
callq 0x25e0
jmp 0x4291
movq 0x5da1(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x2d5d(%rip), %rsi      # 0x6fbe
leaq 0x2d04(%rip), %rdx      # 0x6f6c
movl $0x2cb, %ecx            # imm = 0x2CB
movb $0x0, %al
callq 0x10f0
movslq -0x4(%rbp), %rcx
leaq 0x5fa1(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %edi
movl -0x4(%rbp), %esi
callq 0x1350
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wierton[P]socket-based-naive-game/server.c
// Function: client_command_invite_user
int client_command_invite_user(int uid) {
	client_message_t *pcm = &sessions[uid].cm;
	int bid = sessions[uid].bid;
	int friend_id = find_uid_by_user_name(pcm->user_name);
	log("user %d@%s tries to invite friend\n", uid, sessions[uid].user_name);

	if(sessions[uid].state != USER_STATE_BATTLE) {
		log("user %s who invites friend %s wasn't in battle\n", sessions[uid].user_name, pcm->user_name);
		send_to_client(uid, SERVER_RESPONSE_YOURE_NOT_IN_BATTLE);
	}else{
		logi("invite user %s to battle #%d\n", sessions[friend_id].user_name, bid);
		invite_friend_to_battle(bid, uid, pcm->user_name);
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x5f6a(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
addq $0x18, %rax
movq %rax, -0x10(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x5f50(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
addq $0x1, %rdi
callq 0x1a80
movl %eax, -0x18(%rbp)
movq 0x5d04(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movl -0x4(%rbp), %r8d
movslq -0x4(%rbp), %rax
leaq 0x5f1a(%rip), %r9       # 0xa220
imulq $0x48, %rax, %rax
addq %rax, %r9
leaq 0x2ce5(%rip), %rsi      # 0x6ff9
leaq 0x2d19(%rip), %rdx      # 0x7034
movl $0x2d5, %ecx            # imm = 0x2D5
movb $0x0, %al
callq 0x10f0
movslq -0x4(%rbp), %rcx
leaq 0x5eee(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $0x3, 0xc(%rax)
je 0x438c
movq 0x5cb2(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movslq -0x4(%rbp), %rax
leaq 0x5ecc(%rip), %r8       # 0xa220
imulq $0x48, %rax, %rax
addq %rax, %r8
movq -0x10(%rbp), %r9
addq $0x1, %r9
leaq 0x2ce5(%rip), %rsi      # 0x704f
leaq 0x2cc3(%rip), %rdx      # 0x7034
movl $0x2d8, %ecx            # imm = 0x2D8
movb $0x0, %al
callq 0x10f0
movl -0x4(%rbp), %edi
movl $0xf, %esi
callq 0x25e0
jmp 0x43d9
movq 0x5c65(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movslq -0x18(%rbp), %rax
leaq 0x5e7f(%rip), %r8       # 0xa220
imulq $0x48, %rax, %rax
addq %rax, %r8
movl -0x14(%rbp), %r9d
leaq 0x2ce4(%rip), %rsi      # 0x7097
leaq 0x2c7a(%rip), %rdx      # 0x7034
movl $0x2db, %ecx            # imm = 0x2DB
movb $0x0, %al
callq 0x10f0
movl -0x14(%rbp), %edi
movl -0x4(%rbp), %esi
movq -0x10(%rbp), %rdx
addq $0x1, %rdx
callq 0x3e30
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/server.c
// Function: client_command_reject_battle
int client_command_reject_battle(int uid) {
	log("user %s reject battle #%d\n", sessions[uid].user_name, sessions[uid].bid);
	if(sessions[uid].state == USER_STATE_BATTLE) {
		logi("user already in battle\n");
		send_to_client(uid, SERVER_RESPONSE_YOURE_ALREADY_IN_BATTLE);
	}else if(sessions[uid].state == USER_STATE_WAIT_TO_BATTLE) {
		logi("reject success\n");
		int bid = sessions[uid].bid;
		send_to_client(sessions[uid].inviter_id, SERVER_MESSAGE_FRIEND_REJECT_BATTLE);
		sessions[uid].state = USER_STATE_LOGIN;
		battles[bid].users[uid].battle_state = BATTLE_STATE_UNJOINED;
	}else{
		logi("hasn't been invited\n");
		send_to_client(uid, SERVER_RESPONSE_NOBODY_INVITE_YOU);
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movq 0x57c6(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movslq -0x4(%rbp), %rax
leaq 0x59e0(%rip), %r8       # 0xa220
imulq $0x48, %rax, %rax
addq %rax, %r8
movslq -0x4(%rbp), %rcx
leaq 0x59ce(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %r9d
leaq 0x2a6e(%rip), %rsi      # 0x72d2
leaq 0x2a9a(%rip), %rdx      # 0x7305
movl $0x31f, %ecx            # imm = 0x31F
movb $0x0, %al
callq 0x10f0
movslq -0x4(%rbp), %rcx
leaq 0x599e(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $0x3, 0xc(%rax)
jne 0x48c5
movq 0x5762(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x2a82(%rip), %rsi      # 0x7322
leaq 0x2a5e(%rip), %rdx      # 0x7305
movl $0x321, %ecx            # imm = 0x321
movb $0x0, %al
callq 0x10f0
movl -0x4(%rbp), %edi
movl $0x10, %esi
callq 0x25e0
jmp 0x49b4
movslq -0x4(%rbp), %rcx
leaq 0x5950(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $0x4, 0xc(%rax)
jne 0x4981
movq 0x5710(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x2a64(%rip), %rsi      # 0x7356
leaq 0x2a0c(%rip), %rdx      # 0x7305
movl $0x324, %ecx            # imm = 0x324
movb $0x0, %al
callq 0x10f0
movslq -0x4(%rbp), %rcx
leaq 0x5910(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x8(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x58f8(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %edi
movl $0x17, %esi
callq 0x25e0
movslq -0x4(%rbp), %rcx
leaq 0x58d9(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl $0x2, 0xc(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x5a30(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x4(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl $0x0, (%rax)
jmp 0x49b2
movq 0x5670(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x290f(%rip), %rsi      # 0x72a1
leaq 0x296c(%rip), %rdx      # 0x7305
movl $0x32a, %ecx            # imm = 0x32A
movb $0x0, %al
callq 0x10f0
movl -0x4(%rbp), %edi
movl $0x12, %esi
callq 0x25e0
jmp 0x49b4
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wierton[P]socket-based-naive-game/server.c
// Function: client_command_quit
int client_command_quit(int uid) {
	int conn = sessions[uid].conn;
	if(sessions[uid].state == USER_STATE_BATTLE
	|| sessions[uid].state == USER_STATE_WAIT_TO_BATTLE) {
		log("user %d@%s tries to quit client was in battle\n", uid, sessions[uid].user_name);
		user_quit_battle(sessions[uid].bid, uid);
	}

	sessions[uid].conn = -1;
	log("user %d@%s quit\n", uid, sessions[uid].user_name);
	sessions[uid].state = USER_STATE_UNUSED;
	close(conn);
	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x584a(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x8(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x5832(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $0x3, 0xc(%rax)
je 0x4a13
movslq -0x4(%rbp), %rcx
leaq 0x581a(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $0x4, 0xc(%rax)
jne 0x4a6a
movq 0x55de(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movl -0x4(%rbp), %r8d
movslq -0x4(%rbp), %rax
leaq 0x57f4(%rip), %r9       # 0xa220
imulq $0x48, %rax, %rax
addq %rax, %r9
leaq 0x2948(%rip), %rsi      # 0x7382
leaq 0x2988(%rip), %rdx      # 0x73c9
movl $0x334, %ecx            # imm = 0x334
movb $0x0, %al
callq 0x10f0
movslq -0x4(%rbp), %rcx
leaq 0x57c8(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %edi
movl -0x4(%rbp), %esi
callq 0x1350
movslq -0x4(%rbp), %rcx
leaq 0x57ab(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movq 0x556e(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movl -0x4(%rbp), %r8d
movslq -0x4(%rbp), %rax
leaq 0x5784(%rip), %r9       # 0xa220
imulq $0x48, %rax, %rax
addq %rax, %r9
leaq 0x2933(%rip), %rsi      # 0x73dd
leaq 0x2918(%rip), %rdx      # 0x73c9
movl $0x339, %ecx            # imm = 0x339
movb $0x0, %al
callq 0x10f0
movslq -0x4(%rbp), %rcx
leaq 0x5758(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0xc(%rax)
movl -0x8(%rbp), %edi
callq 0x10d0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wierton[P]socket-based-naive-game/server.c
// Function: client_command_move_up
int client_command_move_up(int uid) {
	log("user %s move up\n", sessions[uid].user_name);
	int bid = sessions[uid].bid;
	battles[bid].users[uid].dir = DIR_UP;
	if(battles[bid].users[uid].pos.y > 0) {
		battles[bid].users[uid].pos.y --;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movq 0x54f6(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movslq -0x4(%rbp), %rax
leaq 0x5710(%rip), %r8       # 0xa220
imulq $0x48, %rax, %rax
addq %rax, %r8
leaq 0x28e8(%rip), %rsi      # 0x7406
leaq 0x290a(%rip), %rdx      # 0x742f
movl $0x340, %ecx            # imm = 0x340
movb $0x0, %al
callq 0x10f0
movslq -0x4(%rbp), %rcx
leaq 0x56e4(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x8(%rbp)
movslq -0x8(%rbp), %rcx
leaq 0x583c(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x4(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x8(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x5811(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x4(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movzbl 0x11(%rax), %eax
cmpl $0x0, %eax
jle 0x4bce
movslq -0x8(%rbp), %rcx
leaq 0x57e4(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x4(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movb 0x11(%rax), %cl
addb $-0x1, %cl
movb %cl, 0x11(%rax)
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/server.c
// Function: client_command_move_down
int client_command_move_down(int uid) {
	log("user %s move down\n", sessions[uid].user_name);
	int bid = sessions[uid].bid;
	battles[bid].users[uid].dir = DIR_DOWN;
	if(battles[bid].users[uid].pos.y < BATTLE_H - 1) {
		battles[bid].users[uid].pos.y ++;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movq 0x5406(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movslq -0x4(%rbp), %rax
leaq 0x5620(%rip), %r8       # 0xa220
imulq $0x48, %rax, %rax
addq %rax, %r8
leaq 0x2838(%rip), %rsi      # 0x7446
leaq 0x285c(%rip), %rdx      # 0x7471
movl $0x34a, %ecx            # imm = 0x34A
movb $0x0, %al
callq 0x10f0
movslq -0x4(%rbp), %rcx
leaq 0x55f4(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x8(%rbp)
movslq -0x8(%rbp), %rcx
leaq 0x574c(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x4(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl $0x1, 0x8(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x5721(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x4(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movzbl 0x11(%rax), %eax
cmpl $0xf, %eax
jge 0x4cbe
movslq -0x8(%rbp), %rcx
leaq 0x56f4(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x4(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movb 0x11(%rax), %cl
addb $0x1, %cl
movb %cl, 0x11(%rax)
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/server.c
// Function: client_command_move_left
int client_command_move_left(int uid) {
	log("user %s move left\n", sessions[uid].user_name);
	int bid = sessions[uid].bid;
	battles[bid].users[uid].dir = DIR_LEFT;
	if(battles[bid].users[uid].pos.x > 0) {
		battles[bid].users[uid].pos.x --;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movq 0x5316(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movslq -0x4(%rbp), %rax
leaq 0x5530(%rip), %r8       # 0xa220
imulq $0x48, %rax, %rax
addq %rax, %r8
leaq 0x278c(%rip), %rsi      # 0x748a
leaq 0x27b0(%rip), %rdx      # 0x74b5
movl $0x354, %ecx            # imm = 0x354
movb $0x0, %al
callq 0x10f0
movslq -0x4(%rbp), %rcx
leaq 0x5504(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x8(%rbp)
movslq -0x8(%rbp), %rcx
leaq 0x565c(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x4(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl $0x2, 0x8(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x5631(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x4(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movzbl 0x10(%rax), %eax
cmpl $0x0, %eax
jle 0x4dae
movslq -0x8(%rbp), %rcx
leaq 0x5604(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x4(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movb 0x10(%rax), %cl
addb $-0x1, %cl
movb %cl, 0x10(%rax)
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/server.c
// Function: client_command_move_right
int client_command_move_right(int uid) {
	log("user %s move right\n", sessions[uid].user_name);
	int bid = sessions[uid].bid;
	battles[bid].users[uid].dir = DIR_RIGHT;
	if(battles[bid].users[uid].pos.x < BATTLE_W - 1) {
		battles[bid].users[uid].pos.x ++;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movq 0x5226(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movslq -0x4(%rbp), %rax
leaq 0x5440(%rip), %r8       # 0xa220
imulq $0x48, %rax, %rax
addq %rax, %r8
leaq 0x26e0(%rip), %rsi      # 0x74ce
leaq 0x2705(%rip), %rdx      # 0x74fa
movl $0x35e, %ecx            # imm = 0x35E
movb $0x0, %al
callq 0x10f0
movslq -0x4(%rbp), %rcx
leaq 0x5414(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x8(%rbp)
movslq -0x8(%rbp), %rcx
leaq 0x556c(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x4(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl $0x3, 0x8(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x5541(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x4(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movzbl 0x10(%rax), %eax
cmpl $0x3b, %eax
jge 0x4e9e
movslq -0x8(%rbp), %rcx
leaq 0x5514(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x4(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movb 0x10(%rax), %cl
addb $0x1, %cl
movb %cl, 0x10(%rax)
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/server.c
// Function: wrap_recv
void wrap_recv(int conn, client_message_t *pcm) {
	size_t total_len = 0;
	while(total_len < sizeof(client_message_t)) {
		size_t len = recv(conn, pcm + total_len, sizeof(client_message_t) - total_len, 0);
		if(len < 0) {
			loge("broken pipe\n");
		}

		total_len += len;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x30, -0x18(%rbp)
jae 0x51ea
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
imulq $0x30, -0x18(%rbp), %rax
addq %rax, %rsi
movl $0x30, %edx
subq -0x18(%rbp), %rdx
xorl %ecx, %ecx
callq 0x1030
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jae 0x51dc
movq 0x4e39(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x23f2(%rip), %rsi      # 0x75bb
leaq 0x2412(%rip), %rdx      # 0x75e2
movl $0x39c, %ecx            # imm = 0x39C
movb $0x0, %al
callq 0x10f0
movq -0x20(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x5187
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/wierton[P]socket-based-naive-game/server.c
// Function: session_start
void *session_start(void *args) {
	int uid = -1;
	int conn = (int)(uintptr_t)args;
	client_message_t *pcm = NULL;
	if((uid = get_unused_session()) < 0) {
		close_session(conn, SERVER_RESPONSE_LOGIN_FAIL_SERVER_LIMITS);
		return NULL;
	}else{
		sessions[uid].conn = conn;
		pcm = &sessions[uid].cm;
		memset(pcm, 0, sizeof(client_message_t));
		log("build session #%d\n", uid);
	}

	while(1) {
		wrap_recv(conn, pcm);
		if(pcm->command >= CLIENT_COMMAND_END)
			continue;

		int ret_code = handler[pcm->command](uid);
		log("state of user '%s': %d\n", sessions[uid].user_name, sessions[uid].state);
		if(ret_code < 0) {
			log("close session #%d\n", uid);
			break;
		}
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
movl %eax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
callq 0x1c80
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
jge 0x5269
movl -0x18(%rbp), %edi
movl $0xa, %esi
callq 0x51f0
movq $0x0, -0x8(%rbp)
jmp 0x5394
movl -0x18(%rbp), %ecx
movslq -0x14(%rbp), %rdx
leaq 0x4fa9(%rip), %rax      # 0xa220
imulq $0x48, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movslq -0x14(%rbp), %rcx
leaq 0x4f94(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
addq $0x18, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x10c0
movq 0x4d46(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movl -0x14(%rbp), %r8d
leaq 0x2336(%rip), %rsi      # 0x75f6
leaq 0x235a(%rip), %rdx      # 0x7621
movl $0x3d0, %ecx            # imm = 0x3D0
movb $0x0, %al
callq 0x10f0
jmp 0x52d5
movl -0x18(%rbp), %edi
movq -0x20(%rbp), %rsi
callq 0x5170
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x11, %eax
jl 0x52ef
jmp 0x52d5
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x4e01(%rip), %rax      # 0xa100
movq (%rax,%rcx,8), %rax
movl -0x14(%rbp), %edi
callq *%rax
movl %eax, -0x24(%rbp)
movq 0x4ce6(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movslq -0x14(%rbp), %rax
leaq 0x4f00(%rip), %r8       # 0xa220
imulq $0x48, %rax, %rax
addq %rax, %r8
movslq -0x14(%rbp), %rcx
leaq 0x4eee(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %r9d
leaq 0x22eb(%rip), %rsi      # 0x762f
leaq 0x22d6(%rip), %rdx      # 0x7621
movl $0x3d9, %ecx            # imm = 0x3D9
movb $0x0, %al
callq 0x10f0
cmpl $0x0, -0x24(%rbp)
jge 0x5387
movq 0x4c94(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movl -0x14(%rbp), %r8d
leaq 0x22ed(%rip), %rsi      # 0x765f
leaq 0x22a8(%rip), %rdx      # 0x7621
movl $0x3db, %ecx            # imm = 0x3DB
movb $0x0, %al
callq 0x10f0
jmp 0x538c
jmp 0x52d5
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/wierton[P]socket-based-naive-game/server.c
// Function: server_start
int server_start() {
	int sockfd = socket(AF_INET, SOCK_STREAM, 0);

	if(sockfd < 0) {
		eprintf("Create Socket Failed!\n");
	}

	struct sockaddr_in servaddr;
	memset(&servaddr, 0, sizeof(servaddr));
    servaddr.sin_family = AF_INET;
    servaddr.sin_port = htons(PORT);
    servaddr.sin_addr.s_addr = htonl(INADDR_ANY);

	if(bind(sockfd, (struct sockaddr *)&servaddr, sizeof(servaddr)) == -1) {
		eprintf("Can not bind to port %d!\n", PORT);
	}

	if(listen(sockfd, USER_CNT) == -1) {
		eprintf("fail to listen on socket.\n");
	}

	return sockfd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x2, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x11c0
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jge 0x53ff
jmp 0x53d4
movq 0x4c1d(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x22a5(%rip), %rsi      # 0x768a
leaq 0x22cf(%rip), %rdx      # 0x76bb
movl $0x3eb, %ecx            # imm = 0x3EB
movb $0x0, %al
callq 0x10f0
xorl %edi, %edi
callq 0x1170
leaq -0x14(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x10c0
movw $0x2, -0x14(%rbp)
movl $0xc350, %edi           # imm = 0xC350
callq 0x1070
movw %ax, -0x12(%rbp)
xorl %edi, %edi
callq 0x10b0
movl %eax, -0x10(%rbp)
movl -0x4(%rbp), %edi
leaq -0x14(%rbp), %rsi
movl $0x10, %edx
callq 0x1140
cmpl $-0x1, %eax
jne 0x5476
jmp 0x5445
movq 0x4bac(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x2272(%rip), %rsi      # 0x76c8
leaq 0x225e(%rip), %rdx      # 0x76bb
movl $0x3f5, %ecx            # imm = 0x3F5
movl $0xc350, %r8d           # imm = 0xC350
movb $0x0, %al
callq 0x10f0
xorl %edi, %edi
callq 0x1170
movl -0x4(%rbp), %edi
movl $0x5, %esi
callq 0x1130
cmpl $-0x1, %eax
jne 0x54b5
jmp 0x548a
movq 0x4b67(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x2261(%rip), %rsi      # 0x76fc
leaq 0x2219(%rip), %rdx      # 0x76bb
movl $0x3f9, %ecx            # imm = 0x3F9
movb $0x0, %al
callq 0x10f0
xorl %edi, %edi
callq 0x1170
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/wierton[P]socket-based-naive-game/server.c
// Function: terminate_process
void terminate_process(int recved_signal) {
	for(int i = 0; i < USER_CNT; i++) {
		if(sessions[i].conn >= 0) {
			close(sessions[i].conn);
			log("close conn:%d\n", sessions[i].conn);
		}
	}

	if(server_fd) {
		close(server_fd);
		log("close server fd:%d\n", server_fd);
	}

	pthread_mutex_destroy(&sessions_lock);
	pthread_mutex_destroy(&battles_lock);
	for(int i = 0; i < USER_CNT; i++) {
		pthread_mutex_destroy(&items_lock[i]);
	}

	log("receive terminate signal and exit(0)\n");
	exit(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
cmpl $0x5, -0x8(%rbp)
jge 0x5551
movslq -0x8(%rbp), %rcx
leaq 0x4d3d(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x8(%rax)
jl 0x5544
movslq -0x8(%rbp), %rcx
leaq 0x4d25(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %edi
callq 0x10d0
movq 0x4ae7(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movslq -0x8(%rbp), %rcx
leaq 0x4d01(%rip), %rax      # 0xa220
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %r8d
leaq 0x2200(%rip), %rsi      # 0x7731
leaq 0x2220(%rip), %rdx      # 0x7758
movl $0x403, %ecx            # imm = 0x403
movb $0x0, %al
callq 0x10f0
jmp 0x5546
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x54d2
cmpl $0x0, 0x4cc0(%rip)      # 0xa218
je 0x5590
movl 0x4cb8(%rip), %edi      # 0xa218
callq 0x10d0
movq 0x4a8c(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movl 0x4ca2(%rip), %r8d      # 0xa218
leaq 0x21ed(%rip), %rsi      # 0x776a
leaq 0x21d4(%rip), %rdx      # 0x7758
movl $0x409, %ecx            # imm = 0x409
movb $0x0, %al
callq 0x10f0
leaq 0x4c31(%rip), %rdi      # 0xa1c8
callq 0x1090
leaq 0x4c4d(%rip), %rdi      # 0xa1f0
callq 0x1090
movl $0x0, -0xc(%rbp)
cmpl $0x5, -0xc(%rbp)
jge 0x55d7
movslq -0xc(%rbp), %rax
leaq 0x8500(%rip), %rdi      # 0xdac0
imulq $0x28, %rax, %rax
addq %rax, %rdi
callq 0x1090
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x55af
movq 0x4a1a(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x21ae(%rip), %rsi      # 0x7796
leaq 0x2169(%rip), %rdx      # 0x7758
movl $0x412, %ecx            # imm = 0x412
movb $0x0, %al
callq 0x10f0
xorl %edi, %edi
callq 0x1170
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/umbrant[P]Non-blocking-Buffers/service.c
// Function: main
int main() 
{
  char* service_name = (char*)malloc(sizeof(char)*50);
  char* service_name_other = (char*)malloc(sizeof(char)*50);

  strcpy(service_name, GUI);
  strcpy(service_name_other, "GUI2");

	if(nbb_init_service(NUM_CHANNELS, service_name)) {
		printf("Error initializing as service, failing!\n");
		return -1;
	}

  sleep(1);

  if(nbb_init_service(NUM_CHANNELS, service_name_other)) {
 		printf("Error initializing as service, failing!\n");
		return -1;
	}

  nbb_set_cb_new_connection(service_name, on_new_connection, NULL);
  nbb_set_cb_new_connection(service_name_other, on_new_conn_other, NULL);

  int counter = 0;

  while(1) {
    sleep(1);

/*
    if(is_client == 2 && !(counter % 5)) {
      nbb_send("Client", "Test message", sizeof("Test message"));
      nbb_send("Client2", "Test message", sizeof("Test message"));
    }*/
    counter++;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0x4(%rbp)
movl $0x32, %edi
callq 0x1160
movq %rax, -0x10(%rbp)
movl $0x32, %edi
callq 0x1160
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x2c9e(%rip), %rsi      # 0x4004
callq 0x1040
movq -0x18(%rbp), %rdi
leaq 0x2c92(%rip), %rsi      # 0x4008
callq 0x1040
movq -0x10(%rbp), %rsi
movl $0x5, %edi
callq 0x1fc0
cmpl $0x0, %eax
je 0x13a5
leaq 0x2c78(%rip), %rdi      # 0x400d
movb $0x0, %al
callq 0x10b0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x141d
movl $0x1, %edi
callq 0x1220
movq -0x18(%rbp), %rsi
movl $0x5, %edi
callq 0x1fc0
cmpl $0x0, %eax
je 0x13d9
leaq 0x2c44(%rip), %rdi      # 0x400d
movb $0x0, %al
callq 0x10b0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x141d
movq -0x10(%rbp), %rdi
leaq 0x4c(%rip), %rsi        # 0x1430
xorl %eax, %eax
movl %eax, %edx
callq 0x2ae0
movq -0x18(%rbp), %rdi
leaq 0x78(%rip), %rsi        # 0x1470
xorl %eax, %eax
movl %eax, %edx
callq 0x2ae0
movl $0x0, -0x1c(%rbp)
movl $0x1, %edi
callq 0x1220
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1408
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/michaelnmmeyer[P]gourgandine/cmd/cmd.c
// Function: inform
static void inform(const char *msg, va_list ap)
{
   int my_errno = errno;

   fprintf(stderr, "%s: ", g_progname);
   vfprintf(stderr, msg, ap);

   size_t len = strlen(msg);
   if (len && msg[len - 1] == ':')
      fprintf(stderr, " %s", my_errno ? strerror(my_errno) : "<unknown error>");

   putc('\n', stderr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x2060
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movq 0x11722f(%rip), %rax    # 0x11aff0
movq (%rax), %rdi
movq 0x11737d(%rip), %rdx    # 0x11b148
leaq 0xf51d(%rip), %rsi      # 0x132ef
movb $0x0, %al
callq 0x21c0
movq 0x117210(%rip), %rax    # 0x11aff0
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x2230
movq -0x8(%rbp), %rdi
callq 0x20e0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x3e5e
movq -0x8(%rbp), %rax
movq -0x20(%rbp), %rcx
subq $0x1, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x3a, %eax
jne 0x3e5e
movq 0x1171d0(%rip), %rax    # 0x11aff0
movq (%rax), %rax
movq %rax, -0x28(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x3e3b
movl -0x14(%rbp), %edi
callq 0x2250
movq %rax, -0x30(%rbp)
jmp 0x3e48
leaq 0xf4b2(%rip), %rax      # 0x132f4
movq %rax, -0x30(%rbp)
jmp 0x3e48
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0xf671(%rip), %rsi      # 0x134c8
movb $0x0, %al
callq 0x21c0
movq 0x11718b(%rip), %rax    # 0x11aff0
movq (%rax), %rsi
movl $0xa, %edi
callq 0x21a0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)