// File: /workspace/github_cpp_makefile_star2_O3/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, 0x61f36(%rip)     # 0x6e1fc
movl %esi, 0x61f34(%rip)     # 0x6e200
leal -0x4(%rdi), %eax
cltq
movslq %esi, %rcx
imulq $0x258, %rax, %rdx      # imm = 0x258
leaq 0x1505e(%rip), %rax     # 0x21340
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, %esi
movl %esi, 0x4(%rdx,%rcx,4)
leal -0x2(%rdi), %edx
movslq %edx, %rdx
imulq $0x258, %rdx, %rdx      # imm = 0x258
addq %rax, %rdx
movl %esi, 0x8(%rdx,%rcx,4)
movaps 0xbe21(%rip), %xmm0     # 0x18150
movups %xmm0, -0x8(%rdx,%rcx,4)
leal -0x1(%rdi), %edx
movslq %edx, %rdx
imulq $0x258, %rdx, %rdx      # imm = 0x258
addq %rax, %rdx
movl $0xb, %esi
movl %esi, -0x8(%rdx,%rcx,4)
movl %esi, 0x8(%rdx,%rcx,4)
movslq %edi, %rdx
imulq $0x258, %rdx, %r8       # imm = 0x258
leaq (%rax,%r8), %r9
movl %esi, -0x8(%r9,%rcx,4)
movl %esi, 0x8(%r9,%rcx,4)
leal 0x1(%rdx), %r9d
movslq %r9d, %r9
imulq $0x258, %r9, %r9        # imm = 0x258
addq %rax, %r9
movl %esi, -0x8(%r9,%rcx,4)
movl %esi, 0x8(%r9,%rcx,4)
addl $0x2, %edx
movslq %edx, %rdx
imulq $0x258, %rdx, %rdx      # imm = 0x258
addq %rax, %rdx
movl $0x6, 0x8(%rdx,%rcx,4)
movaps 0xbdbd(%rip), %xmm0     # 0x18160
movups %xmm0, -0x8(%rdx,%rcx,4)
leaq (%r8,%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 0xc3c2
addl $0x3, %edi
movslq %edi, %rdx
imulq $0x258, %rdx, %rsi      # imm = 0x258
leaq (%rax,%rsi), %rdi
movl (%rdi,%rcx,4), %edx
cmpl $0x3, %edx
je 0xc40f
cmpl $0x5, %edx
je 0xc40f
cmpl $0x4, %edx
jne 0xc433
leaq (%rdi,%rcx,4), %rdx
movl $0x5, (%rdx)
movl $0x5, %edx
leaq (%rsi,%rcx,4), %rcx
addq %rcx, %rax
cmpl $0x3, %edx
je 0xc420
cmpl $0x5, %edx
jne 0xc42e
movl 0x258(%rax), %edx
addq $0x258, %rax            # imm = 0x258
jmp 0xc416
cmpl $0x3, %edx
jae 0xc434
retq
movl $0x5, (%rax)
retq