// File: /workspace/github_cpp_makefile_star2_O3/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, %ebx
movq %rdi, %r14
leaq -0x28(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2b798
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2b798
callq 0x41d0
movq %rax, %r12
callq 0x41d0
movq %rax, %rcx
shrq $0x3f, %rcx
addl %eax, %ecx
andl $0xfffe, %ecx           # imm = 0xFFFE
subl %ecx, %eax
leal -0x1(%r15), %ecx
imull %eax, %ecx
movswl %r15w, %r15d
testb $0x1, %r12b
jne 0x18157
movw %cx, -0x26(%rbp)
callq 0x41d0
imull $0x5556, %r15d, %ecx    # imm = 0x5556
movl %ecx, %edx
shrl $0x1f, %edx
shrl $0x10, %ecx
addl %edx, %ecx
movswq %cx, %rsi
cqto
idivq %rsi
addl %ecx, %edx
movw %dx, -0x28(%rbp)
jmp 0x18184
movw %cx, -0x28(%rbp)
callq 0x41d0
imull $0x5556, %r15d, %ecx    # imm = 0x5556
movl %ecx, %edx
shrl $0x1f, %edx
shrl $0x10, %ecx
addl %edx, %ecx
movswq %cx, %rsi
cqto
idivq %rsi
addl %ecx, %edx
movw %dx, -0x26(%rbp)
movzwl -0x28(%rbp), %edx
movswl %dx, %ecx
leal -0x1(%r15), %esi
movl %ecx, %eax
cltd
idivl %esi
testl %edx, %edx
je 0x181ca
movswl -0x26(%rbp), %eax
addl %esi, %eax
addl %esi, %esi
cltd
idivl %esi
movw %dx, -0x2e(%rbp)
callq 0x41d0
imull $0x5556, %r15d, %ecx    # imm = 0x5556
movl %ecx, %edx
shrl $0x1f, %edx
shrl $0x10, %ecx
addl %edx, %ecx
movswq %cx, %rsi
cqto
idivq %rsi
addl %ecx, %edx
movw %dx, -0x30(%rbp)
jmp 0x181fc
addl %esi, %ecx
addl %esi, %esi
movl %ecx, %eax
cltd
idivl %esi
movw %dx, -0x30(%rbp)
callq 0x41d0
imull $0x5556, %r15d, %ecx    # imm = 0x5556
movl %ecx, %edx
shrl $0x1f, %edx
shrl $0x10, %ecx
addl %edx, %ecx
movswq %cx, %rsi
cqto
idivq %rsi
addl %ecx, %edx
movw %dx, -0x2e(%rbp)
leaq -0x24(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2b798
leaq -0x28(%rbp), %rdi
leaq -0x24(%rbp), %rsi
callq 0x2b7e4
movl %eax, %r15d
leaq -0x2c(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2b798
leaq -0x30(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x2b7e4
movl %eax, %r12d
leaq -0x2c(%rbp), %rdi
callq 0x2b7a6
leaq -0x24(%rbp), %rdi
callq 0x2b7a6
cmpw %r12w, %r15w
jle 0x18265
movl -0x28(%rbp), %eax
leaq -0x24(%rbp), %rdi
movl %eax, (%rdi)
movl -0x30(%rbp), %ecx
movl %ecx, -0x28(%rbp)
movl %eax, -0x30(%rbp)
callq 0x2b7a6
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 0x2b798
xorl %eax, %eax
subw -0x22(%rbp), %ax
movswl -0x24(%rbp), %edx
movswl %ax, %esi
leaq -0x2c(%rbp), %rdi
callq 0x2b798
leaq -0x34(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2b798
leaq -0x2c(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0x2b7ac
movss %xmm0, -0x38(%rbp)
leaq -0x34(%rbp), %rdi
callq 0x2b7a6
movswl -0x2c(%rbp), %eax
leal (%rax,%rax,8), %ecx
leal (%rcx,%rcx,2), %ecx
addl %eax, %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
movss -0x38(%rbp), %xmm1
mulss 0x1480e(%rip), %xmm1    # 0x2caf0
divss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movw %ax, -0x2c(%rbp)
movswl -0x2a(%rbp), %eax
leal (%rax,%rax,8), %ecx
leal (%rcx,%rcx,2), %ecx
addl %eax, %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
divss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movw %ax, -0x2a(%rbp)
movsbl %bl, %ecx
leal 0x1(%rcx), %esi
movswl -0x24(%rbp), %eax
cltd
idivl %esi
cmpw $0x15, %ax
movl $0x15, %edi
cmovgel %edi, %eax
movw %ax, -0x24(%rbp)
movswl -0x22(%rbp), %eax
cltd
idivl %esi
cmpw $0x15, %ax
cmovll %eax, %edi
movw %di, -0x22(%rbp)
testb %cl, %cl
jle 0x183b2
movq (%r14), %rax
movzbl %bl, %ecx
movl $0x1, %edx
movzwl -0x24(%rbp), %esi
imulw %dx, %si
addw -0x28(%rbp), %si
addw -0x2c(%rbp), %si
movw %si, -0x4(%rax,%rdx,4)
movzwl -0x22(%rbp), %esi
imulw %dx, %si
addw -0x26(%rbp), %si
addw -0x2a(%rbp), %si
movw %si, -0x2(%rax,%rdx,4)
cmpq %rcx, %rdx
jae 0x183a3
movzwl -0x24(%rbp), %esi
imulw %dx, %si
addw -0x28(%rbp), %si
subw -0x2c(%rbp), %si
movw %si, (%rax,%rdx,4)
movzwl -0x22(%rbp), %esi
imulw %dx, %si
addw -0x26(%rbp), %si
subw -0x2a(%rbp), %si
movw %si, 0x2(%rax,%rdx,4)
leaq 0x2(%rdx), %rsi
incq %rdx
cmpq %rcx, %rdx
movq %rsi, %rdx
jb 0x1834b
leaq -0x2c(%rbp), %rdi
callq 0x2b7a6
leaq -0x24(%rbp), %rdi
callq 0x2b7a6
leaq -0x30(%rbp), %rdi
callq 0x2b7a6
leaq -0x28(%rbp), %rdi
callq 0x2b7a6
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x34(%rbp), %rdi
callq 0x2b7a6
jmp 0x183fa
jmp 0x183f7
jmp 0x18407
jmp 0x18415
movq %rax, %rbx
leaq -0x2c(%rbp), %rdi
callq 0x2b7a6
jmp 0x1840a
jmp 0x18407
movq %rax, %rbx
leaq -0x24(%rbp), %rdi
callq 0x2b7a6
jmp 0x18418
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x2b7a6
leaq -0x28(%rbp), %rdi
callq 0x2b7a6
movq %rbx, %rdi
callq 0x4740
movq %rax, %rbx
jmp 0x18421