// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %edx, %r15d
movl %esi, %r14d
movq %rdi, %rbx
cmpb $0x1, %r14b
jne 0x17ed6
movswl %r15w, %eax
imull $0x5556, %eax, %r14d    # imm = 0x5556
movl %r14d, %eax
shrl $0x1f, %eax
shrl $0x10, %r14d
addl %eax, %r14d
movswq %r14w, %r15
callq 0x41d0
cqto
idivq %r15
addl %r14d, %edx
movq (%rbx), %rax
movw %dx, (%rax)
callq 0x41d0
cqto
idivq %r15
addl %r14d, %edx
movq (%rbx), %rax
movw %dx, 0x2(%rax)
jmp 0x1802b
movsbl %r14b, %eax
cvtsi2ss %eax, %xmm1
movss 0x14bfe(%rip), %xmm0    # 0x2cae4
divss %xmm1, %xmm0
movss %xmm0, -0x24(%rbp)
callq 0x42a0
movss 0x14bec(%rip), %xmm1    # 0x2cae8
subss %xmm0, %xmm1
andps 0x14c09(%rip), %xmm1    # 0x2cb10
movaps %xmm1, -0x40(%rbp)
movss -0x24(%rbp), %xmm0
callq 0x4320
andps 0x14bf4(%rip), %xmm0    # 0x2cb10
maxss -0x40(%rbp), %xmm0
movss 0x14bc3(%rip), %xmm1    # 0x2caec
divss %xmm0, %xmm1
addss 0x14bb3(%rip), %xmm1    # 0x2cae8
cvttss2si %xmm1, %eax
movzwl %r15w, %ecx
shrl $0xf, %ecx
addl %r15d, %ecx
movswl %cx, %r12d
shrl %r12d
movl %r12d, %ecx
addl $-0xe, %ecx
cmpw %ax, %cx
jg 0x17f9c
movq 0x28094(%rip), %r15     # 0x3fff0
leaq 0x16db8(%rip), %rsi     # 0x2ed1b
movl $0x3b, %edx
movq %r15, %rdi
callq 0x4460
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x43d0
movsbl %al, %esi
movq %r15, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4250
leal -0xf(%r12), %eax
testb %r14b, %r14b
movss -0x24(%rbp), %xmm2
jle 0x1802b
movswl %r12w, %ecx
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
movss %xmm1, -0x40(%rbp)
cwtl
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
movss %xmm1, -0x28(%rbp)
movzbl %r14b, %r14d
xorl %r15d, %r15d
movsbl %r15b, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss %xmm2, %xmm0
movss %xmm0, -0x2c(%rbp)
callq 0x42a0
mulss -0x28(%rbp), %xmm0
addss -0x40(%rbp), %xmm0
cvttss2si %xmm0, %eax
movq (%rbx), %rcx
movw %ax, (%rcx,%r15,4)
movss -0x2c(%rbp), %xmm0
callq 0x4320
mulss -0x28(%rbp), %xmm0
addss -0x40(%rbp), %xmm0
cvttss2si %xmm0, %eax
movss -0x24(%rbp), %xmm2
movq (%rbx), %rcx
movw %ax, 0x2(%rcx,%r15,4)
incq %r15
cmpq %r15, %r14
jne 0x17fce
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq