// File: essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: draw_ship(int, int)
void draw_ship(int x,int y)
{
	ship_x = x;
	ship_y = y;
	map_terrain[x-4][y] = NOSE;
	map_terrain[x-3][y] = CPANEL;
	map_terrain[x-3][y-1] = SW_NE;
	map_terrain[x-3][y+1] = NW_SE;
	map_terrain[x-2][y-2] = SW_NE;
	map_terrain[x-2][y+2] = NW_SE;
	map_terrain[x-2][y-1] = CPANEL;
	map_terrain[x-2][y] = FLOOR;
	map_terrain[x-2][y+2] = NW_SE;
	map_terrain[x-2][y+1] = CPANEL;
	map_terrain[x-1][y-2] = WE;
	map_terrain[x-1][y+2] = WE;
	map_terrain[x][y-2] = WE;
	map_terrain[x][y+2] = WE;
	map_terrain[x+1][y-2] = WE;
	map_terrain[x+1][y+2] = WE;
	map_terrain[x+2][y-2] = NW_SE;
	map_terrain[x+2][y+2] = SW_NE;
	map_terrain[x+2][y-1] = NS;
	map_terrain[x+2][y+1] = NS;
	map_terrain[x+2][y] = DOOR;
	for(int i=x-1;i<x+2;i++)
	{
		for(int j=y-1;j<y+2;j++)
		{
				map_terrain[i][j] = FLOOR;
		}

	}
	if(map_terrain[x+3][y] == WALL)
	{
		map_terrain[x+3][y] = DOOR;
	}
	if(map_terrain[x+3][y] == FLOOR || map_terrain[x+3][y] == DOOR)
	{
		int i = x+3;
		while(map_terrain[i][y] == FLOOR || map_terrain[i][y] == DOOR) {i++;}
		if(map_terrain[i][y] != STREE && map_terrain[i][y] != BTREE && map_terrain[i][y] != DIRT)
		{
			map_terrain[i][y] = DOOR;
		}
	}

}

// Assembly:
movl %edi, -0x4(%rsp)
movl %esi, -0x8(%rsp)
movl -0x4(%rsp), %eax
movl %eax, 0x76c7a(%rip)     # 0x8826c
movl -0x8(%rsp), %eax
movl %eax, 0x76c74(%rip)     # 0x88270
movl -0x4(%rsp), %eax
subl $0x4, %eax
movslq %eax, %rcx
leaq 0x29da3(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movslq -0x8(%rsp), %rcx
movl $0x8, (%rax,%rcx,4)
movl -0x4(%rsp), %eax
subl $0x3, %eax
movslq %eax, %rcx
leaq 0x29d7c(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movslq -0x8(%rsp), %rcx
movl $0x9, (%rax,%rcx,4)
movl -0x4(%rsp), %eax
subl $0x3, %eax
movslq %eax, %rcx
leaq 0x29d55(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movl -0x8(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl $0x6, (%rax,%rcx,4)
movl -0x4(%rsp), %eax
subl $0x3, %eax
movslq %eax, %rcx
leaq 0x29d29(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movl -0x8(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl $0x7, (%rax,%rcx,4)
movl -0x4(%rsp), %eax
subl $0x2, %eax
movslq %eax, %rcx
leaq 0x29cfd(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movl -0x8(%rsp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movl $0x6, (%rax,%rcx,4)
movl -0x4(%rsp), %eax
subl $0x2, %eax
movslq %eax, %rcx
leaq 0x29cd1(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movl -0x8(%rsp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl $0x7, (%rax,%rcx,4)
movl -0x4(%rsp), %eax
subl $0x2, %eax
movslq %eax, %rcx
leaq 0x29ca5(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movl -0x8(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl $0x9, (%rax,%rcx,4)
movl -0x4(%rsp), %eax
subl $0x2, %eax
movslq %eax, %rcx
leaq 0x29c79(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movslq -0x8(%rsp), %rcx
movl $0x3, (%rax,%rcx,4)
movl -0x4(%rsp), %eax
subl $0x2, %eax
movslq %eax, %rcx
leaq 0x29c52(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movl -0x8(%rsp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl $0x7, (%rax,%rcx,4)
movl -0x4(%rsp), %eax
subl $0x2, %eax
movslq %eax, %rcx
leaq 0x29c26(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movl -0x8(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl $0x9, (%rax,%rcx,4)
movl -0x4(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0x29bfa(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movl -0x8(%rsp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movl $0xb, (%rax,%rcx,4)
movl -0x4(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0x29bce(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movl -0x8(%rsp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl $0xb, (%rax,%rcx,4)
movslq -0x4(%rsp), %rcx
leaq 0x29ba7(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movl -0x8(%rsp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movl $0xb, (%rax,%rcx,4)
movslq -0x4(%rsp), %rcx
leaq 0x29b80(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movl -0x8(%rsp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl $0xb, (%rax,%rcx,4)
movl -0x4(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x29b54(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movl -0x8(%rsp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movl $0xb, (%rax,%rcx,4)
movl -0x4(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x29b28(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movl -0x8(%rsp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl $0xb, (%rax,%rcx,4)
movl -0x4(%rsp), %eax
addl $0x2, %eax
movslq %eax, %rcx
leaq 0x29afc(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movl -0x8(%rsp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movl $0x7, (%rax,%rcx,4)
movl -0x4(%rsp), %eax
addl $0x2, %eax
movslq %eax, %rcx
leaq 0x29ad0(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movl -0x8(%rsp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl $0x6, (%rax,%rcx,4)
movl -0x4(%rsp), %eax
addl $0x2, %eax
movslq %eax, %rcx
leaq 0x29aa4(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movl -0x8(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl $0xa, (%rax,%rcx,4)
movl -0x4(%rsp), %eax
addl $0x2, %eax
movslq %eax, %rcx
leaq 0x29a78(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movl -0x8(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl $0xa, (%rax,%rcx,4)
movl -0x4(%rsp), %eax
addl $0x2, %eax
movslq %eax, %rcx
leaq 0x29a4c(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movslq -0x8(%rsp), %rcx
movl $0x5, (%rax,%rcx,4)
movl -0x4(%rsp), %eax
subl $0x1, %eax
movl %eax, -0xc(%rsp)
movl -0xc(%rsp), %eax
movl -0x4(%rsp), %ecx
addl $0x2, %ecx
cmpl %ecx, %eax
jge 0x119ec
movl -0x8(%rsp), %eax
subl $0x1, %eax
movl %eax, -0x10(%rsp)
movl -0x10(%rsp), %eax
movl -0x8(%rsp), %ecx
addl $0x2, %ecx
cmpl %ecx, %eax
jge 0x119dd
movslq -0xc(%rsp), %rcx
leaq 0x299f6(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movslq -0x10(%rsp), %rcx
movl $0x3, (%rax,%rcx,4)
movl -0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rsp)
jmp 0x1199f
jmp 0x119df
movl -0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rsp)
jmp 0x11985
movl -0x4(%rsp), %eax
addl $0x3, %eax
movslq %eax, %rcx
leaq 0x299b3(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movslq -0x8(%rsp), %rcx
cmpl $0x4, (%rax,%rcx,4)
jne 0x11a39
movl -0x4(%rsp), %eax
addl $0x3, %eax
movslq %eax, %rcx
leaq 0x2998d(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movslq -0x8(%rsp), %rcx
movl $0x5, (%rax,%rcx,4)
movl -0x4(%rsp), %eax
addl $0x3, %eax
movslq %eax, %rcx
leaq 0x29966(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movslq -0x8(%rsp), %rcx
cmpl $0x3, (%rax,%rcx,4)
je 0x11a89
movl -0x4(%rsp), %eax
addl $0x3, %eax
movslq %eax, %rcx
leaq 0x29940(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movslq -0x8(%rsp), %rcx
cmpl $0x5, (%rax,%rcx,4)
jne 0x11b7f
movl -0x4(%rsp), %eax
addl $0x3, %eax
movl %eax, -0x14(%rsp)
movslq -0x14(%rsp), %rax
leaq 0x29910(%rip), %rcx     # 0x3b3b0
imulq $0x258, %rax, %rax      # imm = 0x258
addq %rax, %rcx
movslq -0x8(%rsp), %rdx
movb $0x1, %al
cmpl $0x3, (%rcx,%rdx,4)
movb %al, -0x15(%rsp)
je 0x11ae1
movslq -0x14(%rsp), %rcx
leaq 0x298e9(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movslq -0x8(%rsp), %rcx
cmpl $0x5, (%rax,%rcx,4)
sete %al
movb %al, -0x15(%rsp)
movb -0x15(%rsp), %al
testb $0x1, %al
jne 0x11aeb
jmp 0x11af8
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
jmp 0x11a94
movslq -0x14(%rsp), %rcx
leaq 0x298ac(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movslq -0x8(%rsp), %rcx
cmpl $0x1, (%rax,%rcx,4)
je 0x11b7d
movslq -0x14(%rsp), %rcx
leaq 0x2988b(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movslq -0x8(%rsp), %rcx
cmpl $0x2, (%rax,%rcx,4)
je 0x11b7d
movslq -0x14(%rsp), %rcx
leaq 0x2986a(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movslq -0x8(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x11b7d
movslq -0x14(%rsp), %rcx
leaq 0x29849(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movslq -0x8(%rsp), %rcx
movl $0x5, (%rax,%rcx,4)
jmp 0x11b7f
retq