// File: /workspace/github_c_makefile_star2_O0/wierton[P]socket-based-naive-game/server.c
// Function: check_who_traped_in_magma
void check_who_traped_in_magma(int bid) {
	for(int i = 0; i < MAX_ITEM; i++) {
		if(battles[bid].items[i].is_used == false
		|| battles[bid].items[i].kind != ITEM_MAGMA)
			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 --;
				battles[bid].items[i].times --;
				log("user %d@%s is trapped in magma\n", j, sessions[j].user_name);
				send_to_client(j, SERVER_MESSAGE_YOU_ARE_TRAPPED_IN_MAGMA);
				if(battles[bid].items[i].times <= 0) {
					log("magma %d is exhausted\n", i);
					battles[bid].items[i].is_used = false;
					battles[bid].num_of_other --;
				}
				break;
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
cmpl $0x87, -0x8(%rbp)
jge 0x2917
movslq -0x4(%rbp), %rcx
leaq 0x7d26(%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 0x26b2
movslq -0x4(%rbp), %rcx
leaq 0x7cfd(%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 $0x2, 0xc(%rax)
je 0x26b7
jmp 0x2909
movslq -0x4(%rbp), %rcx
leaq 0x7cce(%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 0x7ca3(%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 0x2907
movslq -0x4(%rbp), %rcx
leaq 0x7c67(%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 0x274c
jmp 0x28f9
movslq -0x4(%rbp), %rcx
leaq 0x7c39(%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 0x7c0e(%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 0x28f7
movl -0x10(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jne 0x28f7
movslq -0x4(%rbp), %rcx
leaq 0x7bcb(%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 $-0x1, %ecx
movl %ecx, 0xc(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x7b9e(%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 0x8(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x8(%rax)
movq 0x77dd(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movl -0x14(%rbp), %r8d
movslq -0x14(%rbp), %rax
leaq 0x79f3(%rip), %r9       # 0xa220
imulq $0x48, %rax, %rax
addq %rax, %r9
leaq 0x3d16(%rip), %rsi      # 0x6551
leaq 0x3d47(%rip), %rdx      # 0x6589
movl $0x156, %ecx            # imm = 0x156
movb $0x0, %al
callq 0x10f0
movl -0x14(%rbp), %edi
movl $0x21, %esi
callq 0x25e0
movslq -0x4(%rbp), %rcx
leaq 0x7b2a(%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, 0x8(%rax)
jg 0x28f5
movq 0x776c(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movl -0x8(%rbp), %r8d
leaq 0x3d09(%rip), %rsi      # 0x65a3
leaq 0x3ce8(%rip), %rdx      # 0x6589
movl $0x159, %ecx            # imm = 0x159
movb $0x0, %al
callq 0x10f0
movslq -0x4(%rbp), %rcx
leaq 0x7ad8(%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 0x7aae(%rip), %rax      # 0xa390
imulq $0xb08, %rcx, %rcx      # imm = 0xB08
addq %rcx, %rax
movl 0x74(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x74(%rax)
jmp 0x2907
jmp 0x28f9
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2714
jmp 0x2909
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x2652
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)