// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: dragpoint
void dragpoint(short pointhighlight, int dax, int day)
{
	short cnt, tempshort;

	wall[pointhighlight].x = dax;
	wall[pointhighlight].y = day;

	cnt = MAXWALLS;
	tempshort = pointhighlight;    //search points CCW
	do
	{
		if (wall[tempshort].nextwall >= 0)
		{
			tempshort = wall[wall[tempshort].nextwall].point2;
			wall[tempshort].x = dax;
			wall[tempshort].y = day;
		}
		else
		{
			tempshort = pointhighlight;    //search points CW if not searched all the way around
			do
			{
				if (wall[lastwall(tempshort)].nextwall >= 0)
				{
					tempshort = wall[lastwall(tempshort)].nextwall;
					wall[tempshort].x = dax;
					wall[tempshort].y = day;
				}
				else
				{
					break;
				}
				cnt--;
			}
			while ((tempshort != pointhighlight) && (cnt > 0));
			break;
		}
		cnt--;
	}
	while ((tempshort != pointhighlight) && (cnt > 0));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %di, %ax
movw %ax, -0x2(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl -0x8(%rbp), %ecx
movswq -0x2(%rbp), %rdx
leaq 0x1a2ccc(%rip), %rax    # 0x1f55b0
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movl -0xc(%rbp), %ecx
movswq -0x2(%rbp), %rdx
leaq 0x1a2cb4(%rip), %rax    # 0x1f55b0
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movw $0x4000, -0xe(%rbp)     # imm = 0x4000
movw -0x2(%rbp), %ax
movw %ax, -0x10(%rbp)
movswq -0x10(%rbp), %rcx
leaq 0x1a2c90(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movswl 0xa(%rax), %eax
cmpl $0x0, %eax
jl 0x52994
movswq -0x10(%rbp), %rcx
leaq 0x1a2c74(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movswq 0xa(%rax), %rcx
leaq 0x1a2c61(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movw 0x8(%rax), %ax
movw %ax, -0x10(%rbp)
movl -0x8(%rbp), %ecx
movswq -0x10(%rbp), %rdx
leaq 0x1a2c43(%rip), %rax    # 0x1f55b0
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movl -0xc(%rbp), %ecx
movswq -0x10(%rbp), %rdx
leaq 0x1a2c2b(%rip), %rax    # 0x1f55b0
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
jmp 0x52a4d
movw -0x2(%rbp), %ax
movw %ax, -0x10(%rbp)
movswl -0x10(%rbp), %edi
callq 0x43880
movslq %eax, %rcx
leaq 0x1a2c01(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movswl 0xa(%rax), %eax
cmpl $0x0, %eax
jl 0x52a14
movswl -0x10(%rbp), %edi
callq 0x43880
movslq %eax, %rcx
leaq 0x1a2bde(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movw 0xa(%rax), %ax
movw %ax, -0x10(%rbp)
movl -0x8(%rbp), %ecx
movswq -0x10(%rbp), %rdx
leaq 0x1a2bc0(%rip), %rax    # 0x1f55b0
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movl -0xc(%rbp), %ecx
movswq -0x10(%rbp), %rdx
leaq 0x1a2ba8(%rip), %rax    # 0x1f55b0
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
jmp 0x52a16
jmp 0x52a4b
movw -0xe(%rbp), %ax
addw $-0x1, %ax
movw %ax, -0xe(%rbp)
movswl -0x10(%rbp), %ecx
movswl -0x2(%rbp), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x11(%rbp)
je 0x52a40
movswl -0xe(%rbp), %eax
cmpl $0x0, %eax
setg %al
movb %al, -0x11(%rbp)
movb -0x11(%rbp), %al
testb $0x1, %al
jne 0x5299c
jmp 0x52a82
movw -0xe(%rbp), %ax
addw $-0x1, %ax
movw %ax, -0xe(%rbp)
movswl -0x10(%rbp), %ecx
movswl -0x2(%rbp), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x12(%rbp)
je 0x52a77
movswl -0xe(%rbp), %eax
cmpl $0x0, %eax
setg %al
movb %al, -0x12(%rbp)
movb -0x12(%rbp), %al
testb $0x1, %al
jne 0x52914
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)