// File: /workspace/github_cpp_makefile_star2_O1/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, 0x61a7f(%rip)     # 0x6e20c
movl %esi, 0x61a7d(%rip)     # 0x6e210
leal -0x4(%rdi), %eax
cltq
movslq %esi, %rcx
imulq $0x258, %rax, %rdx      # imm = 0x258
leaq 0x14ba7(%rip), %rax     # 0x21350
addq %rax, %rdx
movl $0x8, (%rdx,%rcx,4)
leal -0x3(%rdi), %edx
movslq %edx, %rdx
imulq $0x258, %rdx, %rdx      # imm = 0x258
addq %rax, %rdx
movabsq $0x900000006, %rsi      # imm = 0x900000006
movq %rsi, -0x4(%rdx,%rcx,4)
movl $0x7, 0x4(%rdx,%rcx,4)
leal -0x2(%rdi), %edx
movslq %edx, %rdx
imulq $0x258, %rdx, %rsi      # imm = 0x258
addq %rax, %rsi
movl $0x6, %edx
movl %edx, -0x8(%rsi,%rcx,4)
movaps 0xb956(%rip), %xmm0     # 0x18150
movups %xmm0, -0x4(%rsi,%rcx,4)
leal -0x1(%rdi), %esi
movslq %esi, %rsi
imulq $0x258, %rsi, %rsi      # imm = 0x258
addq %rax, %rsi
movl $0xb, %r8d
movl %r8d, -0x8(%rsi,%rcx,4)
movl %r8d, 0x8(%rsi,%rcx,4)
movslq %edi, %rsi
imulq $0x258, %rsi, %r9       # imm = 0x258
leaq (%rax,%r9), %r10
movl %r8d, -0x8(%r10,%rcx,4)
movl %r8d, 0x8(%r10,%rcx,4)
leal 0x1(%rsi), %r10d
movslq %r10d, %r10
imulq $0x258, %r10, %r10      # imm = 0x258
addq %rax, %r10
movl %r8d, -0x8(%r10,%rcx,4)
movl %r8d, 0x8(%r10,%rcx,4)
addl $0x2, %esi
movslq %esi, %rsi
imulq $0x258, %rsi, %rsi      # imm = 0x258
addq %rax, %rsi
movl %edx, 0x8(%rsi,%rcx,4)
movaps 0xb8f3(%rip), %xmm0     # 0x18160
movups %xmm0, -0x8(%rsi,%rcx,4)
leaq (%r9,%rcx,4), %rdx
addq %rax, %rdx
addq $-0x254, %rdx           # imm = 0xFDAC
xorl %esi, %esi
movabsq $0x300000003, %r8       # imm = 0x300000003
movq %r8, -0x8(%rdx,%rsi)
movl $0x3, (%rdx,%rsi)
addq $0x258, %rsi            # imm = 0x258
cmpl $0x708, %esi            # imm = 0x708
jne 0xc88c
addl $0x3, %edi
movslq %edi, %rdx
imulq $0x258, %rdx, %rdx      # imm = 0x258
leaq (%rax,%rdx), %rsi
leaq (%rsi,%rcx,4), %rsi
cmpl $0x4, (%rsi)
jne 0xc8c7
movl $0x5, (%rsi)
movl (%rsi), %esi
cmpl $0x5, %esi
je 0xc8d3
cmpl $0x3, %esi
jne 0xc8f3
leaq (%rdx,%rcx,4), %rcx
addq %rcx, %rax
movl (%rax), %ecx
cmpl $0x3, %ecx
je 0xc8e6
cmpl $0x5, %ecx
jne 0xc8ee
addq $0x258, %rax            # imm = 0x258
jmp 0xc8da
cmpl $0x3, %ecx
jae 0xc8f4
retq
movl $0x5, (%rax)
retq