// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/map.cpp
// Function: (anonymous namespace)::fill_hc_mainst(std::vector<Coords, std::allocator<Coords>>&, char, short)
void fill_hc_mainst(vector<Coords> &hc, const char num, const short size)
{
	Coords c1, c2;
	// random edge points, not too close to corners
	if(random()%2)
	{
		c1.x = (random()%2)*(size-1);
		c1.y = random()%(size/3)+size/3;
	}
	else
	{
		c1.y = (random()%2)*(size-1);
		c1.x = random()%(size/3)+size/3;
	}
	// Place c2 on another edge:
	if(!(c1.x % (size-1))) // opposite x-wise
	{
		c2.x = (c1.x + size-1)%(2*(size-1));
		c2.y = random()%(size/3)+size/3;
	}
	else // opposite y-wise
	{
		c2.y = (c1.y + size-1)%(2*(size-1));
		c2.x = random()%(size/3)+size/3;
	}
	// If necessary, switch so that c1 is closer to (0,0):
	if(c1.dist_walk(Coords(0,0)) > c2.dist_walk(Coords(0,0)))
	{
		Coords tmp = c1;
		c1 = c2;
		c2 = tmp;
	}
	// The directional vector of the "street":
	Coords v(c2.x - c1.x, c2.y - c1.y);
	// The normal of the directional vector, shrunk:
	Coords p(-v.y, v.x);
	float len = p.dist_eucl(Coords(0,0));
	p.x = p.x*2*MAX_HS/(3*len);
	p.y = p.y*2*MAX_HS/(3*len);
	// Determine step (how far "down the street" the next houses are):
	v.x /= num+1;
	if(v.x > 3*MAX_HS/2)
		v.x = 3*MAX_HS/2;
	v.y /= num+1;
	if(v.y > 3*MAX_HS/2)
		v.y = 3*MAX_HS/2;
	// Place the coords:
	for(char i = 0; i < num; i += 2)
	{
		hc[i].x = c1.x + (i+1)*v.x + p.x;
		hc[i].y = c1.y + (i+1)*v.y + p.y;
		if(i+1 < num)
		{
			hc[i+1].x = c1.x + (i+1)*v.x - p.x;
			hc[i+1].y = c1.y + (i+1)*v.y - p.y;
		}
	}
}

// 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
leaq -0x28(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x24d90
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x24d90
callq 0x41e0
movq %rax, %r12
callq 0x41e0
pushq $0x2
popq %rcx
cqto
idivq %rcx
leal -0x1(%r15), %eax
imull %eax, %edx
testb $0x1, %r12b
jne 0x13375
movw %dx, -0x26(%rbp)
callq 0x41e0
movq %rax, %rcx
movw $0x3, %si
movl %r15d, %eax
cwtd
idivw %si
movl %eax, %esi
movswq %ax, %rdi
movq %rcx, %rax
cqto
idivq %rdi
addl %esi, %edx
movw %dx, -0x28(%rbp)
jmp 0x133a5
movw %dx, -0x28(%rbp)
callq 0x41e0
movq %rax, %rcx
movw $0x3, %si
movl %r15d, %eax
cwtd
idivw %si
movl %eax, %esi
movswq %ax, %rdi
movq %rcx, %rax
cqto
idivq %rdi
addl %esi, %edx
movw %dx, -0x26(%rbp)
movzwl -0x28(%rbp), %edx
movswl %dx, %ecx
movswl %r15w, %esi
decl %esi
movl %ecx, %eax
cltd
idivl %esi
testl %edx, %edx
je 0x133f0
movswl -0x26(%rbp), %eax
addl %esi, %eax
addl %esi, %esi
cltd
idivl %esi
movw %dx, -0x2e(%rbp)
callq 0x41e0
movq %rax, %rcx
movw $0x3, %si
movl %r15d, %eax
cwtd
idivw %si
movl %eax, %esi
movswq %ax, %rdi
movq %rcx, %rax
cqto
idivq %rdi
addl %esi, %edx
movw %dx, -0x30(%rbp)
jmp 0x13425
addl %esi, %ecx
addl %esi, %esi
movl %ecx, %eax
cltd
idivl %esi
movw %dx, -0x30(%rbp)
callq 0x41e0
movq %rax, %rcx
movw $0x3, %si
movl %r15d, %eax
cwtd
idivw %si
movl %eax, %esi
movswq %ax, %rdi
movq %rcx, %rax
cqto
idivq %rdi
addl %esi, %edx
movw %dx, -0x2e(%rbp)
leaq -0x24(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x24d90
leaq -0x28(%rbp), %rdi
leaq -0x24(%rbp), %rsi
callq 0x24dd8
movl %eax, %r15d
leaq -0x2c(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x24d90
leaq -0x30(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x24dd8
movl %eax, %r12d
leaq -0x2c(%rbp), %rdi
callq 0x24d9e
leaq -0x24(%rbp), %rdi
callq 0x24d9e
cmpw %r12w, %r15w
jle 0x1348e
movl -0x28(%rbp), %eax
leaq -0x24(%rbp), %rdi
movl %eax, (%rdi)
movl -0x30(%rbp), %ecx
movl %ecx, -0x28(%rbp)
movl %eax, -0x30(%rbp)
callq 0x24d9e
movzwl -0x30(%rbp), %eax
movzwl -0x2e(%rbp), %ecx
subw -0x28(%rbp), %ax
subw -0x26(%rbp), %cx
movswl %ax, %esi
movswl %cx, %edx
leaq -0x24(%rbp), %rdi
callq 0x24d90
xorl %eax, %eax
subw -0x22(%rbp), %ax
movswl -0x24(%rbp), %edx
movswl %ax, %esi
leaq -0x2c(%rbp), %rdi
callq 0x24d90
leaq -0x34(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x24d90
leaq -0x2c(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0x24da4
movss %xmm0, -0x38(%rbp)
leaq -0x34(%rbp), %rdi
callq 0x24d9e
movswl -0x2c(%rbp), %eax
imull $0x1c, %eax, %eax
cvtsi2ss %eax, %xmm0
movss -0x38(%rbp), %xmm1
mulss 0x1361d(%rip), %xmm1    # 0x26b20
divss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movw %ax, -0x2c(%rbp)
movswl -0x2a(%rbp), %eax
imull $0x1c, %eax, %eax
cvtsi2ss %eax, %xmm0
divss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movw %ax, -0x2a(%rbp)
movsbl %r14b, %ecx
leal 0x1(%rcx), %esi
movswl -0x24(%rbp), %eax
cltd
idivl %esi
cmpw $0x15, %ax
pushq $0x15
popq %rdi
cmovgel %edi, %eax
movw %ax, -0x24(%rbp)
movswl -0x22(%rbp), %eax
cltd
idivl %esi
cmpw $0x15, %ax
cmovll %eax, %edi
movw %di, -0x22(%rbp)
movq (%rbx), %rax
movsbq %cl, %rcx
xorl %edx, %edx
cmpq %rcx, %rdx
jge 0x135c6
leaq 0x1(%rdx), %rsi
movzwl -0x24(%rbp), %edi
imulw %si, %di
addw -0x28(%rbp), %di
addw -0x2c(%rbp), %di
movw %di, (%rax,%rdx,4)
movzwl -0x22(%rbp), %edi
imulw %si, %di
addw -0x26(%rbp), %di
addw -0x2a(%rbp), %di
movw %di, 0x2(%rax,%rdx,4)
cmpq %rcx, %rsi
jge 0x135be
movzwl -0x24(%rbp), %edi
imulw %si, %di
addw -0x28(%rbp), %di
subw -0x2c(%rbp), %di
movw %di, 0x4(%rax,%rdx,4)
movzwl -0x22(%rbp), %edi
imulw %si, %di
addw -0x26(%rbp), %di
subw -0x2a(%rbp), %di
movw %di, 0x6(%rax,%rdx,4)
incq %rsi
movq %rsi, %rdx
jmp 0x1355d
leaq -0x2c(%rbp), %rdi
callq 0x24d9e
leaq -0x24(%rbp), %rdi
callq 0x24d9e
leaq -0x30(%rbp), %rdi
callq 0x24d9e
leaq -0x28(%rbp), %rdi
callq 0x24d9e
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x34(%rbp), %rdi
callq 0x24d9e
jmp 0x1360e
jmp 0x1360b
jmp 0x1361b
jmp 0x13629
movq %rax, %rbx
leaq -0x2c(%rbp), %rdi
callq 0x24d9e
jmp 0x1361e
jmp 0x1361b
movq %rax, %rbx
leaq -0x24(%rbp), %rdi
callq 0x24d9e
jmp 0x1362c
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x24d9e
leaq -0x28(%rbp), %rdi
callq 0x24d9e
movq %rbx, %rdi
callq 0x4710
movq %rax, %rbx
jmp 0x13635