// File: lotuskip[P]yuxtapa/server/map.cpp
// Function: (anonymous namespace)::fill_hc_circular(std::vector<Coords, std::allocator<Coords>>&, char, short)
void fill_hc_circular(vector<Coords> &hc, const char num, const short size)
{
	// putting just one point onto a circle is silly:
	if(num == 1)
	{
		hc[0].x = size/3 + random()%(size/3);
		hc[0].y = size/3 + random()%(size/3);
		return;
	}
	// The angle between the points, 2Pi/num:
	float theta = 6.28318f/num;
	// We want the points to be at a *walking* distance of MAX_HS+1:
	short rad = (MAX_HS+1)/max(abs(1.0f-cos(theta)), abs(sin(theta)))+1;
	/* NOTE: the maximum number of houses being limited by map size should
	 * ensure that rad cannot be too large. If rad is too large the houses
	 * will be put outside of the map... */
	if(rad >= size/2 - MAX_HS)
	{
#ifdef DEBUG
		cerr << "Debug warning: circular house placement has too big radius!" << endl;
#endif
		rad = size/2 - MAX_HS - 1;
	}
	for(char i = 0; i < num; ++i)
	{
		hc[i].x = size/2 + rad*cos(theta*i);
		hc[i].y = size/2 + rad*sin(theta*i);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movw %dx, %ax
movb %sil, %cl
movq %rdi, -0x8(%rbp)
movb %cl, -0x9(%rbp)
movw %ax, -0xc(%rbp)
movsbl -0x9(%rbp), %eax
cmpl $0x1, %eax
jne 0x2d4e4
movswl -0xc(%rbp), %eax
movl $0x3, %ecx
cltd
idivl %ecx
cltq
movq %rax, -0x40(%rbp)
callq 0x5270
movq %rax, -0x48(%rbp)
movswl -0xc(%rbp), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x48(%rbp), %rax
movslq %ecx, %rcx
cqto
idivq %rcx
movq -0x40(%rbp), %rax
addq %rdx, %rax
movw %ax, -0x32(%rbp)
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2e610
movw -0x32(%rbp), %cx
movw %cx, (%rax)
movswl -0xc(%rbp), %eax
movl $0x3, %ecx
cltd
idivl %ecx
cltq
movq %rax, -0x28(%rbp)
callq 0x5270
movq %rax, -0x30(%rbp)
movswl -0xc(%rbp), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x30(%rbp), %rax
movslq %ecx, %rcx
cqto
idivq %rcx
movq -0x28(%rbp), %rax
addq %rdx, %rax
movw %ax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2e610
movw -0x20(%rbp), %cx
movw %cx, 0x2(%rax)
jmp 0x2d6b6
movsbl -0x9(%rbp), %eax
cvtsi2ss %eax, %xmm1
movss 0x345f8(%rip), %xmm0    # 0x61aec
divss %xmm1, %xmm0
movss %xmm0, -0x10(%rbp)
movss -0x10(%rbp), %xmm0
callq 0x30320
movaps %xmm0, %xmm1
movss 0x345de(%rip), %xmm0    # 0x61af0
movss %xmm0, -0x50(%rbp)
subss %xmm1, %xmm0
callq 0x30300
movss %xmm0, -0x18(%rbp)
movss -0x10(%rbp), %xmm0
callq 0x30340
callq 0x30300
movss %xmm0, -0x1c(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x302c0
movss -0x50(%rbp), %xmm1
movss (%rax), %xmm2
movss 0x3459d(%rip), %xmm0    # 0x61af4
divss %xmm2, %xmm0
addss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movw %ax, -0x12(%rbp)
movswl -0x12(%rbp), %eax
movl %eax, -0x4c(%rbp)
movswl -0xc(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x4c(%rbp), %eax
subl $0xe, %ecx
cmpl %ecx, %eax
jl 0x2d5be
movq 0x5fa5b(%rip), %rdi     # 0x8cfe8
leaq 0x368db(%rip), %rsi     # 0x63e6f
callq 0x5510
movq %rax, %rdi
movq 0x5fa05(%rip), %rsi     # 0x8cfa8
callq 0x5560
movswl -0xc(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
subl $0xe, %eax
subl $0x1, %eax
movw %ax, -0x12(%rbp)
movb $0x0, -0x1d(%rbp)
movsbl -0x1d(%rbp), %eax
movsbl -0x9(%rbp), %ecx
cmpl %ecx, %eax
jge 0x2d6b6
movswl -0xc(%rbp), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
sarl %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x68(%rbp)
movswl -0x12(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x64(%rbp)
movss -0x10(%rbp), %xmm0
movsbl -0x1d(%rbp), %eax
cvtsi2ss %eax, %xmm1
mulss %xmm1, %xmm0
callq 0x30320
movss -0x68(%rbp), %xmm1
movaps %xmm0, %xmm2
movss -0x64(%rbp), %xmm0
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movw %ax, -0x5e(%rbp)
movq -0x8(%rbp), %rdi
movsbq -0x1d(%rbp), %rsi
callq 0x2e610
movw -0x5e(%rbp), %cx
movw %cx, (%rax)
movswl -0xc(%rbp), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
sarl %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x5c(%rbp)
movswl -0x12(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x58(%rbp)
movss -0x10(%rbp), %xmm0
movsbl -0x1d(%rbp), %eax
cvtsi2ss %eax, %xmm1
mulss %xmm1, %xmm0
callq 0x30340
movss -0x5c(%rbp), %xmm1
movaps %xmm0, %xmm2
movss -0x58(%rbp), %xmm0
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movw %ax, -0x52(%rbp)
movq -0x8(%rbp), %rdi
movsbq -0x1d(%rbp), %rsi
callq 0x2e610
movw -0x52(%rbp), %cx
movw %cx, 0x2(%rax)
movb -0x1d(%rbp), %al
addb $0x1, %al
movb %al, -0x1d(%rbp)
jmp 0x2d5c2
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)