// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/build.c
// Function: deletepoint
void deletepoint(short point)
{
	int i, j, k, sucksect;

	sucksect = sectorofwall(point);

	sector[sucksect].wallnum--;
	for(i=sucksect+1;i<numsectors;i++)
		sector[i].wallptr--;

	j = lastwall(point);
	k = wall[point].point2;
	wall[j].point2 = k;

	if (wall[j].nextwall >= 0)
	{
		wall[wall[j].nextwall].nextwall = -1;
		wall[wall[j].nextwall].nextsector = -1;
	}
	if (wall[point].nextwall >= 0)
	{
		wall[wall[point].nextwall].nextwall = -1;
		wall[wall[point].nextwall].nextsector = -1;
	}
	movewalls((int)point,-1L);

	checksectorpointer((short)j,(short)sucksect);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %di, %ax
movw %ax, -0x2(%rbp)
movswl -0x2(%rbp), %edi
callq 0x58ba0
movl %eax, -0x14(%rbp)
movslq -0x14(%rbp), %rcx
leaq 0x256b7a(%rip), %rax    # 0x2805c0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movw 0x2(%rax), %cx
addw $-0x1, %cx
movw %cx, 0x2(%rax)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
leaq 0x3e3054(%rip), %rcx    # 0x40cac0
movswl (%rcx), %ecx
cmpl %ecx, %eax
jge 0x29a9a
movslq -0x8(%rbp), %rcx
leaq 0x256b42(%rip), %rax    # 0x2805c0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movw (%rax), %cx
addw $-0x1, %cx
movw %cx, (%rax)
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x29a62
movswl -0x2(%rbp), %edi
callq 0x43880
movl %eax, -0xc(%rbp)
movswq -0x2(%rbp), %rcx
leaq 0x1cbafe(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movswl 0x8(%rax), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
movw %ax, %cx
movslq -0xc(%rbp), %rdx
leaq 0x1cbadf(%rip), %rax    # 0x1f55b0
shlq $0x5, %rdx
addq %rdx, %rax
movw %cx, 0x8(%rax)
movslq -0xc(%rbp), %rcx
leaq 0x1cbac9(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movswl 0xa(%rax), %eax
cmpl $0x0, %eax
jl 0x29b4d
movslq -0xc(%rbp), %rcx
leaq 0x1cbaae(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movswq 0xa(%rax), %rcx
leaq 0x1cba9b(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movw $0xffff, 0xa(%rax)      # imm = 0xFFFF
movslq -0xc(%rbp), %rcx
leaq 0x1cba83(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movswq 0xa(%rax), %rcx
leaq 0x1cba70(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movw $0xffff, 0xc(%rax)      # imm = 0xFFFF
movswq -0x2(%rbp), %rcx
leaq 0x1cba57(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movswl 0xa(%rax), %eax
cmpl $0x0, %eax
jl 0x29bc1
movswq -0x2(%rbp), %rcx
leaq 0x1cba3b(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movswq 0xa(%rax), %rcx
leaq 0x1cba28(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movw $0xffff, 0xa(%rax)      # imm = 0xFFFF
movswq -0x2(%rbp), %rcx
leaq 0x1cba0f(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movswq 0xa(%rax), %rcx
leaq 0x1cb9fc(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movw $0xffff, 0xc(%rax)      # imm = 0xFFFF
movswl -0x2(%rbp), %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x2b860
movl -0xc(%rbp), %eax
movw %ax, %cx
movl -0x14(%rbp), %eax
movswl %cx, %edi
movswl %ax, %esi
callq 0x296d0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)