// File: /workspace/github_c_makefile_star2_O0/wierton[P]socket-based-naive-game/server.c
// Function: check_who_get_blood_vial
void check_who_get_blood_vial(int bid) {
	for(int i = 0; i < MAX_ITEM; i++) {
		if(battles[bid].items[i].is_used == false
		|| battles[bid].items[i].kind != ITEM_BLOOD_VIAL)
			continue;

		int ix = battles[bid].items[i].pos.x;
		int iy = battles[bid].items[i].pos.y;

		for(int j = 0; j < USER_CNT; j++) {
			if(battles[bid].users[j].battle_state != BATTLE_STATE_LIVE)
				continue;
			int ux = battles[bid].users[j].pos.x;
			int uy = battles[bid].users[j].pos.y;

			if(ix == ux && iy == uy) {
				battles[bid].users[j].life += LIFE_PER_VIAL;
				log("user %d@%s got blood vial\n", j, sessions[j].user_name);
				if(battles[bid].users[j].life > MAX_LIFE) {
					log("user %d@%s life exceeds max value\n", j, sessions[j].user_name);
					battles[bid].users[j].life = MAX_LIFE;
				}

				battles[bid].items[i].is_used = false;
				battles[bid].num_of_other --;
				send_to_client(j, SERVER_MESSAGE_YOU_GOT_BLOOD_VIAL);
				break;
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
cmpl $0x87, -0x8(%rbp)
jge 0x25d7
movslq -0x4(%rbp), %rcx
leaq 0x8076(%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 0x2362
movslq -0x4(%rbp), %rcx
leaq 0x804d(%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 $0x4, 0xc(%rax)
je 0x2367
jmp 0x25c9
movslq -0x4(%rbp), %rcx
leaq 0x801e(%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
movzbl 0x10(%rax), %eax
movl %eax, -0xc(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x7ff3(%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
movzbl 0x11(%rax), %eax
movl %eax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x5, -0x14(%rbp)
jge 0x25c7
movslq -0x4(%rbp), %rcx
leaq 0x7fb7(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x14(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
cmpl $0x1, (%rax)
je 0x23fc
jmp 0x25b9
movslq -0x4(%rbp), %rcx
leaq 0x7f89(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x14(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movzbl 0x10(%rax), %eax
movl %eax, -0x18(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x7f5e(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x14(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movzbl 0x11(%rax), %eax
movl %eax, -0x1c(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x18(%rbp), %eax
jne 0x25b7
movl -0x10(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jne 0x25b7
movslq -0x4(%rbp), %rcx
leaq 0x7f1b(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x14(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
addl $0x3, %ecx
movl %ecx, 0xc(%rax)
movq 0x7b5a(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movl -0x14(%rbp), %r8d
movslq -0x14(%rbp), %rax
leaq 0x7d70(%rip), %r9       # 0xa220
imulq $0x48, %rax, %rax
addq %rax, %r9
leaq 0x400c(%rip), %rsi      # 0x64ca
leaq 0x4038(%rip), %rdx      # 0x64fd
movl $0x135, %ecx            # imm = 0x135
movb $0x0, %al
callq 0x10f0
movslq -0x4(%rbp), %rcx
leaq 0x7eb4(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x14(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
cmpl $0x14, 0xc(%rax)
jle 0x2560
movq 0x7af6(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movl -0x14(%rbp), %r8d
movslq -0x14(%rbp), %rax
leaq 0x7d0c(%rip), %r9       # 0xa220
imulq $0x48, %rax, %rax
addq %rax, %r9
leaq 0x3ff4(%rip), %rsi      # 0x6516
leaq 0x3fd4(%rip), %rdx      # 0x64fd
movl $0x137, %ecx            # imm = 0x137
movb $0x0, %al
callq 0x10f0
movslq -0x4(%rbp), %rcx
leaq 0x7e50(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
addq $0x10, %rax
movslq -0x14(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl $0x14, 0xc(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x7e25(%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)
movslq -0x4(%rbp), %rcx
leaq 0x7dfb(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
movl 0x74(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x74(%rax)
movl -0x14(%rbp), %edi
movl $0x22, %esi
callq 0x25e0
jmp 0x25c7
jmp 0x25b9
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x23c4
jmp 0x25c9
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x2302
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)