// File: /workspace/github_cpp_makefile_star2_O2/lotuskip[P]yuxtapa/server/actives.cpp
// Function: do_placement()
void do_placement()
{
	short tmp;
	// empty previous stuff
	for(tmp = 0; tmp < MAX_NOE; ++tmp)
		noccents[tmp].clear();
	traps.clear();
	boulders.clear();
	PCs.clear();
	MMs.clear();
	arrows.clear();
	zaps.clear();
	team_flags[T_GREEN].clear();
	team_flags[T_PURPLE].clear();

	// we'll be using the nearby search in placement; see spiral.h
	short msize = Game::curmap->get_size();
	nearby_set_dim(msize);

	vector<Coords> used_coords;
	Coords c, d;
	// First place blocks (occent) and traps (noccent) in a single loop:
	// anywhere on a floor/ground/road tile
	for(c.y = 0; c.y < msize; c.y++)
	{
		for(c.x = 0; c.x < msize; c.x++)
		{
			// traps & blocks go only at open spaces:
			if(Game::curmap->get_tile(c).symbol == '.')
			{
				if(!(random()%TRAP_ONE_IN))
				{
					// random trap type:
					traps.push_back(Trap(c, random()%MAX_TRAP_TYPE, cur_players.end()));
					Game::curmap->mod_tile(c)->flags |= TF_TRAP;
					used_coords.push_back(c);
				}
				if(!(random()%BLOCK_ONE_IN))
				{
					add_block(c);
					// we might end up adding the same coords twice, but that
					// doesn't matter:
					used_coords.push_back(c);
				}
			}
		}
	}
	// Torches in a grid, but not if uninhabited
	if(Game::curmap->is_inhabited())
	{
		for(c.y = TORCH_GRID/2; c.y < msize; c.y += TORCH_GRID)
		{
			for(c.x = TORCH_GRID/2; c.x < msize; c.x += TORCH_GRID)
			{
				if(random()%100 >= CHANCE_NO_TORCH)
				{
					d = c;
					next_unused_tile(d, used_coords);
					add_noccent(d, NOE_TORCH);
				}
			}
		}
	}
	// Flags.
	// One green flag in a random corner:
	e_Dir green_corner = e_Dir(1 + 2*(random()%3));
	d = Game::curmap->get_center_of_sector(green_corner);
	next_unused_tile(d, used_coords, true);
	add_noccent(d, NOE_FLAG, T_GREEN);
	// A purple flag at the opposite side of the map:
	e_Dir purple_corner = !green_corner;
	// possibly rotate so that this flag won't be in a corner:
	switch(random()%3)
	{
	case 0: ++purple_corner; break;
	case 1: --purple_corner; break;
	// case 2: nothing
	}
	d = Game::curmap->get_center_of_sector(purple_corner);
	next_unused_tile(d, used_coords, true);
	add_noccent(d, NOE_FLAG, T_PURPLE);
	/* The result so far is either
	 * G..      G..
	 * ...   or ...   (or some rotated or mirrored version of these)
	 * ..P      .P.
	 */
	// Some more flags depending on mapsize & game mode:
	e_Dir tmpd;
	switch(gamemode)
	{
	case GM_DESTR:
	case GM_DOM:
		// Two neutral flags more always:
		tmpd = green_corner;
		++tmpd;
		if(random()%2) ++tmpd;
		d = Game::curmap->get_center_of_sector(tmpd);
		next_unused_tile(d, used_coords, true);
		add_noccent(d, NOE_FLAG, T_NO_TEAM);
		/* This makes it either
		 * GN.       G.N
		 * ..p   or  ..p   (or some rotation/mirroring of these,
		 * .pp       .pp    + the purple flag in one of the p:s)
		 */
		tmpd = green_corner;
		--tmpd;
		if(random()%2) --tmpd;
		d = Game::curmap->get_center_of_sector(tmpd);
		next_unused_tile(d, used_coords, true);
		add_noccent(d, NOE_FLAG, T_NO_TEAM);
		/* And that added another 'N' on the other side of 'G' */
		// On large maps, one more in central area:
		if(msize >= BIG_MAP_LIM)
		{
			d.y = d.x = msize/2;
			next_unused_tile(d, used_coords, true);
			add_noccent(d, NOE_FLAG, T_NO_TEAM);
		}
		break;
	case GM_CONQ:
		// add one purple-own 3rd flag in central area:
		d.y = d.x = msize/2;
		next_unused_tile(d, used_coords, true);
		add_noccent(d, NOE_FLAG, T_PURPLE);
		break;
	case GM_STEAL:
		/* Give the purples another flag, and also position the item here.
		 * It's going to be:
		 * GN.       G..
		 * .Pi   or  N.P    (where 'i' is the item)
		 * ..P       .Pi
		 */
		if(!(int(purple_corner)%2)) // existing P is not in the corner
		{
			// item:
			tmpd = !green_corner;
			d = Game::curmap->get_center_of_sector(tmpd);
			next_unused_tile(d, used_coords);
			the_item.setpos(d);
			obj_sector = tmpd;
			// flag:
			if(++tmpd == purple_corner)
				--(--tmpd);
			d = Game::curmap->get_center_of_sector(tmpd);
			next_unused_tile(d, used_coords, true);
			add_noccent(d, NOE_FLAG, T_PURPLE);
		}
		else // purple flag is in the corner
		{
			// flag:
			d.y = d.x = msize/2;
			next_unused_tile(d, used_coords, true);
			add_noccent(d, NOE_FLAG, T_PURPLE);
			// item:
			tmpd = !green_corner;
			if(random()%2) ++tmpd;
			else --tmpd;
			d = Game::curmap->get_center_of_sector(tmpd);
			next_unused_tile(d, used_coords);
			the_item.setpos(d);
			obj_sector = tmpd;
		}
		the_item.set_col(C_LIGHT_TRAP);
		// Give the greens a neutral vantage-point (always):
		tmpd = green_corner;
		if(random()%2) ++tmpd;
		else --tmpd;
		d = Game::curmap->get_center_of_sector(tmpd);
		next_unused_tile(d, used_coords, true);
		add_noccent(d, NOE_FLAG, T_NO_TEAM);
		break;
	case GM_TDM: break; // no additional flags
	} // switch game-mode (for flag positioning)
	//
	// Portals:
	// The possibilities are:
	// 2 portals:
	//      * 2 two-ways
	//      * 1 entry, 1 exit
	// 3 portals:
	//      * 3 two-ways
	//      * 2 entries, 1 exit
	//      * 1 entry, 2 exits
	// 	4 portals:
	//      * 4 two-ways
	//      * 2 two-ways, 1 entry, 1 exit
	//      * 1+n entries, 3-n exits (n=0..2)
	// 1. Determine the number of portals to place, if any.
	if(random()%100 < CHANCE_PORTALS)
	{
		vector<Coords> portals(2+random()%3);
		// 2. Collect the coordinates for the portals.
		// First one is just a random point:
		portals[0].x = random()%msize;
		portals[0].y = random()%msize;
		// Second one in the corner furthest away from the first:
		if(portals[0].x < msize/2)
			portals[1].x = msize - 2 - random()%PORTALS_FROM_EDGE;
		else
			portals[1].x = 2 + random()%PORTALS_FROM_EDGE;
		if(portals[0].y < msize/2)
			portals[1].y = msize - 2 - random()%PORTALS_FROM_EDGE;
		else
			portals[1].y = 2 + random()%PORTALS_FROM_EDGE;
		// Third one, if needed:
		if(portals.size() > 2)
		{
			portals[2].x = (portals[0].x + portals[1].x)/2;
			portals[2].y = (portals[0].y + portals[1].y)%msize;
			// Fourth one, if needed:
			if(portals.size() > 3)
			{
				portals[3].x = (portals[0].x + portals[1].x)%msize;
				portals[3].y = (portals[0].y + portals[1].y)/2;
			}
		}
		// 3. Determine what kind of portals to place in these coordinates (above)
		bool twoways = random()%2;
		// place at "the last and second to last coordinates" (either
		// 2 two-ways or 1 entry and 1 exit
		d = portals[portals.size()-1];
		next_unused_tile(d, used_coords);
		if(twoways)
			add_noccent(d, NOE_PORTAL_2WAY);
		else
			add_noccent(d, NOE_PORTAL_ENTRY);
		d = portals[portals.size()-2];
		next_unused_tile(d, used_coords);
		if(twoways)
			add_noccent(d, NOE_PORTAL_2WAY);
		else
			add_noccent(d, NOE_PORTAL_EXIT);
		// If there are 3 portals, add a third two-way, an entry, or an exit:
		if(portals.size()==3)
		{
			d = portals[0];
			next_unused_tile(d, used_coords);
			if(twoways)
				add_noccent(d, NOE_PORTAL_2WAY);
			else if(random()%2)
				add_noccent(d, NOE_PORTAL_ENTRY);
			else
				add_noccent(d, NOE_PORTAL_EXIT);
		}
		else if(portals.size()==4)
		{
			// We have so far either (A) 2 two-ways or (B) 1 one-way entry and 1 exit.
			// In case (A), may add 2 more two-ways or 1 entry & 1 exit.
			// In case (B) may add 2 more two-ways or 2 elements from {entry, exit}.
			// Hence, check if we want more 2-ways:
			if(random()%2) // yes!
			{
				for(char ch = 0; ch < 2; ++ch)
				{
					d = portals[ch];
					next_unused_tile(d, used_coords);
					add_noccent(d, NOE_PORTAL_2WAY);
				}
			}
			else if(twoways) // need 1 entry and 1 exit
			{
				d = portals[0];
				next_unused_tile(d, used_coords);
				add_noccent(d, NOE_PORTAL_ENTRY);
				d = portals[1];
				next_unused_tile(d, used_coords);
				add_noccent(d, NOE_PORTAL_EXIT);
			}
			else // may add freely entries/exits
			{
				for(char ch = 0; ch < 2; ++ch)
				{
					d = portals[ch];
					next_unused_tile(d, used_coords);
					if(random()%2)
						add_noccent(d, NOE_PORTAL_ENTRY);
					else
						add_noccent(d, NOE_PORTAL_EXIT);
				}
			}
		} // four portals
	}
	// Blocks for block destroying objective:
	if(gamemode == GM_DESTR)
	{
		// put blocks in a sector not too close to the green flag
		do
			obj_sector = e_Dir(random()%(MAX_D+1));
		while(obj_sector == green_corner || obj_sector == purple_corner);
		c = Game::curmap->get_center_of_sector(obj_sector);
		for(char j = 0; j < NUM_DESTROY_BLOCKS; ++j)
		{
			d = c;
			// These blocks can go anywhere where other entities can:
			next_unused_tile(d, used_coords);
			add_block(d);
		}
	}
	// Block sources (0-2 at random locations)
	for(tmp = random()%3; tmp > 0; --tmp)
	{
		c.x = 5 + random()%(Game::curmap->get_size()-10);
		c.y = 5 + random()%(Game::curmap->get_size()-10);
		next_unused_tile(c, used_coords);
		add_noccent(c, NOE_BLOCK_SOURCE);
	}	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
xorl %ebx, %ebx
leaq 0x28b86(%rip), %r14     # 0x42db0
cmpq $0xa8, %rbx
je 0x1a242
leaq (%r14,%rbx), %rdi
callq 0x1bd6e
addq $0x18, %rbx
jmp 0x1a22a
leaq 0x28c0f(%rip), %rdi     # 0x42e58
callq 0x1bd90
leaq 0x28c1b(%rip), %rdi     # 0x42e70
callq 0x1bdb2
leaq 0x28c6f(%rip), %rdi     # 0x42ed0
callq 0x1bdd4
leaq 0x28c33(%rip), %rdi     # 0x42ea0
callq 0x1bdf6
leaq 0x28c0f(%rip), %rdi     # 0x42e88
callq 0x1be18
leaq 0x28c33(%rip), %rdi     # 0x42eb8
callq 0x1be3a
leaq 0x28c5f(%rip), %rdi     # 0x42ef0
callq 0x17f74
leaq 0x28c6b(%rip), %rdi     # 0x42f08
callq 0x17f74
leaq 0x279af(%rip), %rax     # 0x41c58
movq (%rax), %rax
movswl (%rax), %r14d
movl %r14d, %edi
callq 0x1d4f4
xorps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
andq $0x0, -0x60(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x24d90
leaq -0x2c(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x24d90
xorl %eax, %eax
pushq $0x55
popq %r13
leaq -0x58(%rbp), %r15
leaq -0x30(%rbp), %r12
movl $0xbe, %ebx
movw %ax, -0x2e(%rbp)
cmpw %r14w, %ax
jge 0x1a3f3
xorl %eax, %eax
movw %ax, -0x30(%rbp)
cmpw %r14w, %ax
jge 0x1a3e8
leaq 0x27942(%rip), %rcx     # 0x41c58
movq (%rcx), %rcx
movswq -0x2e(%rbp), %rdx
movq 0x8(%rcx), %rcx
imulq $0x18, %rdx, %rdx
movswq %ax, %rax
movq (%rcx,%rdx), %rcx
movzbl 0x2(%rcx,%rax,4), %eax
shll $0x10, %eax
cmpl $0x2e0000, %eax         # imm = 0x2E0000
jne 0x1a3de
callq 0x41e0
cqto
idivq %r13
testq %rdx, %rdx
jne 0x1a3bb
callq 0x41e0
cqto
pushq $0x6
popq %rcx
idivq %rcx
movzbl %dl, %edx
movq %r15, %rdi
movq %r12, %rsi
leaq 0x25d43(%rip), %rcx     # 0x400b0
callq 0x1ca60
leaq 0x28adf(%rip), %rdi     # 0x42e58
movq %r15, %rsi
callq 0x1be5c
movq %r15, %rdi
callq 0x1c9c8
leaq 0x278c8(%rip), %rax     # 0x41c58
movq (%rax), %rax
movswq -0x2e(%rbp), %rcx
movq 0x8(%rax), %rax
imulq $0x18, %rcx, %rcx
movswq -0x30(%rbp), %rdx
movq (%rax,%rcx), %rax
orw $0x800, (%rax,%rdx,4)   # imm = 0x800
leaq -0x70(%rbp), %rdi
movq %r12, %rsi
callq 0x139a6
callq 0x41e0
cqto
idivq %rbx
testq %rdx, %rdx
jne 0x1a3de
movq %r12, %rdi
callq 0x1ac90
leaq -0x70(%rbp), %rdi
movq %r12, %rsi
callq 0x139a6
movl -0x30(%rbp), %eax
incl %eax
jmp 0x1a301
movzwl -0x2e(%rbp), %eax
incl %eax
jmp 0x1a2f1
leaq 0x2785e(%rip), %rax     # 0x41c58
movq (%rax), %rax
cmpb $0x1, 0x2(%rax)
pushq $0x64
popq %r13
jne 0x1a470
movw $0x8, %ax
leaq -0x2c(%rbp), %rbx
leaq -0x70(%rbp), %r15
pushq $0x6
popq %r12
movw %ax, -0x2e(%rbp)
cmpw %r14w, %ax
jge 0x1a470
movw $0x8, %ax
movw %ax, -0x30(%rbp)
cmpw %r14w, %ax
jge 0x1a467
callq 0x41e0
cqto
idivq %r13
cmpq $0x1e, %rdx
jl 0x1a45f
movl -0x30(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x1ad0c
movq %rbx, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x1ae3e
movl -0x30(%rbp), %eax
addl $0x11, %eax
jmp 0x1a425
movzwl -0x2e(%rbp), %eax
addl $0x11, %eax
jmp 0x1a417
callq 0x41e0
pushq $0x3
popq %r12
cqto
idivq %r12
leal 0x1(,%rdx,2), %ebx
leaq 0x277cc(%rip), %rax     # 0x41c58
movq (%rax), %rsi
leaq -0x58(%rbp), %rdi
movl %ebx, %edx
callq 0x12596
leaq -0x58(%rbp), %rdi
movl (%rdi), %eax
leaq -0x2c(%rbp), %r15
movl %eax, (%r15)
callq 0x24d9e
leaq -0x70(%rbp), %rsi
pushq $0x1
popq %rdx
movq %r15, %rdi
callq 0x1ad0c
leaq -0x2c(%rbp), %rdi
pushq $0x5
popq %rsi
xorl %edx, %edx
callq 0x1ae3e
movl %ebx, %edi
callq 0x24d7c
movl %eax, -0x38(%rbp)
callq 0x41e0
cqto
idivq %r12
testq %rdx, %rdx
je 0x1a4f3
cmpq $0x1, %rdx
jne 0x1a4fc
leaq -0x38(%rbp), %rdi
callq 0x24d64
jmp 0x1a4fc
leaq -0x38(%rbp), %rdi
callq 0x24d4c
leaq 0x27755(%rip), %rax     # 0x41c58
movq (%rax), %rsi
movl -0x38(%rbp), %edx
leaq -0x58(%rbp), %rdi
callq 0x12596
leaq -0x58(%rbp), %rdi
movl (%rdi), %eax
movl %eax, (%r15)
callq 0x24d9e
leaq -0x70(%rbp), %rsi
pushq $0x1
popq %rdx
movq %r15, %rdi
callq 0x1ad0c
leaq -0x2c(%rbp), %rdi
pushq $0x5
popq %rsi
pushq $0x1
popq %rdx
callq 0x1ae3e
leaq 0x26ccf(%rip), %rax     # 0x41214
movl (%rax), %eax
pushq $0x2
popq %r12
cmpq $0x3, %rax
ja 0x1a836
leaq 0x10c24(%rip), %rcx     # 0x2b180
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x34(%rbp), %rdi
movl %ebx, (%rdi)
callq 0x24d4c
callq 0x41e0
testb $0x1, %al
je 0x1a582
leaq -0x34(%rbp), %rdi
callq 0x24d4c
leaq 0x276cf(%rip), %rax     # 0x41c58
movq (%rax), %rsi
movl -0x34(%rbp), %edx
leaq -0x58(%rbp), %rdi
callq 0x12596
leaq -0x58(%rbp), %rdi
movl (%rdi), %eax
movl %eax, (%r15)
callq 0x24d9e
leaq -0x70(%rbp), %rsi
pushq $0x1
popq %rdx
movq %r15, %rdi
callq 0x1ad0c
leaq -0x2c(%rbp), %rdi
pushq $0x5
popq %rsi
pushq $0x3
popq %rdx
callq 0x1ae3e
leaq -0x34(%rbp), %rdi
movl %ebx, (%rdi)
callq 0x24d64
callq 0x41e0
testb $0x1, %al
je 0x1a5e1
leaq -0x34(%rbp), %rdi
callq 0x24d64
leaq 0x27670(%rip), %rax     # 0x41c58
movq (%rax), %rsi
movl -0x34(%rbp), %edx
leaq -0x58(%rbp), %rdi
callq 0x12596
leaq -0x58(%rbp), %rdi
movl (%rdi), %eax
movl %eax, (%r15)
callq 0x24d9e
leaq -0x70(%rbp), %rsi
pushq $0x1
popq %rdx
movq %r15, %rdi
callq 0x1ad0c
leaq -0x2c(%rbp), %rdi
pushq $0x5
popq %rsi
pushq $0x3
popq %rdx
callq 0x1ae3e
cmpw $0x96, %r14w
jl 0x1a836
movzwl %r14w, %eax
shrl %eax
movw %ax, -0x2c(%rbp)
movw %ax, -0x2a(%rbp)
jmp 0x1a811
movl %r14d, %eax
cltd
idivl %r12d
leaq -0x2c(%rbp), %rdi
movw %ax, (%rdi)
movw %ax, 0x2(%rdi)
movw $0x1, %r15w
leaq -0x70(%rbp), %rsi
pushq $0x1
popq %rdx
callq 0x1ad0c
jmp 0x1a826
testb $0x1, -0x38(%rbp)
jne 0x1a72b
movl %ebx, %edi
callq 0x24d7c
movl %eax, -0x34(%rbp)
leaq 0x275d3(%rip), %rcx     # 0x41c58
movq (%rcx), %rsi
leaq -0x58(%rbp), %rdi
movl %eax, %edx
callq 0x12596
leaq -0x58(%rbp), %rdi
movl (%rdi), %eax
movl %eax, (%r15)
callq 0x24d9e
leaq -0x70(%rbp), %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x1ad0c
movl -0x2c(%rbp), %eax
movl %eax, 0x28958(%rip)     # 0x43010
leaq -0x34(%rbp), %rdi
movl (%rdi), %eax
leaq 0x22d4f(%rip), %rcx     # 0x3d414
movl %eax, (%rcx)
callq 0x24d4c
movl (%rax), %eax
cmpl -0x38(%rbp), %eax
jne 0x1a6e4
leaq -0x34(%rbp), %rdi
callq 0x24d64
movq %rax, %rdi
callq 0x24d64
leaq 0x2756d(%rip), %rax     # 0x41c58
movq (%rax), %rsi
movl -0x34(%rbp), %edx
leaq -0x58(%rbp), %rdi
callq 0x12596
leaq -0x58(%rbp), %rdi
movl (%rdi), %eax
movl %eax, (%r15)
callq 0x24d9e
leaq -0x70(%rbp), %rsi
pushq $0x1
popq %rdx
movq %r15, %rdi
callq 0x1ad0c
leaq -0x2c(%rbp), %rdi
pushq $0x5
popq %rsi
pushq $0x1
popq %rdx
callq 0x1ae3e
jmp 0x1a7c6
movl %r14d, %eax
cltd
idivl %r12d
leaq -0x2c(%rbp), %rdi
movw %ax, (%rdi)
movw %ax, 0x2(%rdi)
leaq -0x70(%rbp), %rsi
pushq $0x1
popq %rdx
callq 0x1ad0c
leaq -0x2c(%rbp), %rdi
pushq $0x5
popq %rsi
pushq $0x1
popq %rdx
callq 0x1ae3e
movl %ebx, %edi
callq 0x24d7c
movl %eax, -0x34(%rbp)
callq 0x41e0
testb $0x1, %al
jne 0x1a776
leaq -0x34(%rbp), %rdi
callq 0x24d64
jmp 0x1a77f
leaq -0x34(%rbp), %rdi
callq 0x24d4c
leaq 0x274d2(%rip), %rax     # 0x41c58
movq (%rax), %rsi
movl -0x34(%rbp), %edx
leaq -0x58(%rbp), %rdi
callq 0x12596
leaq -0x58(%rbp), %rdi
movl (%rdi), %eax
movl %eax, (%r15)
callq 0x24d9e
leaq -0x70(%rbp), %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x1ad0c
movl -0x2c(%rbp), %eax
movl %eax, 0x28856(%rip)     # 0x43010
movl -0x34(%rbp), %eax
leaq 0x22c50(%rip), %rcx     # 0x3d414
movl %eax, (%rcx)
movb $0x22, 0x28848(%rip)    # 0x43015
movl %ebx, -0x34(%rbp)
callq 0x41e0
testb $0x1, %al
jne 0x1a7e4
leaq -0x34(%rbp), %rdi
callq 0x24d64
jmp 0x1a7ed
leaq -0x34(%rbp), %rdi
callq 0x24d4c
leaq 0x27464(%rip), %rax     # 0x41c58
movq (%rax), %rsi
movl -0x34(%rbp), %edx
leaq -0x58(%rbp), %rdi
callq 0x12596
leaq -0x58(%rbp), %rdi
movl (%rdi), %eax
movl %eax, -0x2c(%rbp)
callq 0x24d9e
movw $0x3, %r15w
leaq -0x2c(%rbp), %rdi
leaq -0x70(%rbp), %rsi
pushq $0x1
popq %rdx
callq 0x1ad0c
movzwl %r15w, %edx
leaq -0x2c(%rbp), %rdi
pushq $0x5
popq %rsi
callq 0x1ae3e
callq 0x41e0
cqto
idivq %r13
cmpq $0x2c, %rdx
jg 0x1aaf7
callq 0x41e0
cqto
pushq $0x3
popq %rcx
idivq %rcx
leaq 0x2(%rdx), %rsi
leaq -0x58(%rbp), %rdi
leaq -0x71(%rbp), %rdx
callq 0x139f4
callq 0x41e0
movslq %r14d, %r15
cqto
idivq %r15
movq -0x58(%rbp), %rax
movw %dx, (%rax)
callq 0x41e0
cqto
idivq %r15
movq -0x58(%rbp), %rax
movw %dx, 0x2(%rax)
movswl (%rax), %ecx
movl %r14d, %eax
cltd
idivl %r12d
movl %eax, %r15d
pushq $0xf
popq %r13
cmpl %ecx, %eax
jle 0x1a8ba
callq 0x41e0
cqto
idivq %r13
movq %rdx, %rax
movl %r14d, %edx
subl %eax, %edx
addl $-0x2, %edx
jmp 0x1a8c7
callq 0x41e0
cqto
idivq %r13
addl $0x2, %edx
movq -0x58(%rbp), %rax
movw %dx, 0x4(%rax)
movswl 0x2(%rax), %eax
cmpl %eax, %r15d
jle 0x1a8ec
callq 0x41e0
cqto
idivq %r13
movl %r14d, %ecx
subl %edx, %ecx
addl $-0x2, %ecx
jmp 0x1a8fc
callq 0x41e0
cqto
idivq %r13
movq %rdx, %rcx
addl $0x2, %ecx
movq -0x58(%rbp), %rdi
movw %cx, 0x6(%rdi)
movq -0x50(%rbp), %r8
subq %rdi, %r8
cmpq $0x9, %r8
jb 0x1a951
movswl (%rdi), %eax
movswl 0x4(%rdi), %esi
addl %eax, %esi
movl %esi, %eax
cltd
idivl %r12d
movw %ax, 0x8(%rdi)
movswl 0x2(%rdi), %eax
movswl %cx, %ecx
addl %eax, %ecx
movl %ecx, %eax
cltd
idivl %r14d
movw %dx, 0xa(%rdi)
cmpq $0xc, %r8
je 0x1a951
movl %esi, %eax
cltd
idivl %r14d
movw %dx, 0xc(%rdi)
movl %ecx, %eax
cltd
idivl %r12d
movw %ax, 0xe(%rdi)
callq 0x41e0
movq %rax, %r14
movq -0x50(%rbp), %rax
movl -0x4(%rax), %eax
leaq -0x2c(%rbp), %rdi
movl %eax, (%rdi)
leaq -0x70(%rbp), %rsi
xorl %edx, %edx
callq 0x1ad0c
movl %r14d, %eax
andl $0x1, %eax
leal 0x2(,%rax,2), %esi
leaq -0x2c(%rbp), %rdi
xorl %edx, %edx
callq 0x1ae3e
movq -0x50(%rbp), %rax
movl -0x8(%rax), %eax
leaq -0x2c(%rbp), %rdi
movl %eax, (%rdi)
leaq -0x70(%rbp), %rsi
xorl %edx, %edx
callq 0x1ad0c
movl %r14d, %esi
andl $0x1, %esi
addl $0x3, %esi
leaq -0x2c(%rbp), %rdi
xorl %edx, %edx
callq 0x1ae3e
movq -0x58(%rbp), %rax
movq -0x50(%rbp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq $0x4, %rcx
je 0x1aa04
cmpq $0x3, %rcx
jne 0x1aaee
movl (%rax), %eax
leaq -0x2c(%rbp), %rdi
movl %eax, (%rdi)
leaq -0x70(%rbp), %rsi
xorl %edx, %edx
callq 0x1ad0c
testb $0x1, %r14b
jne 0x1aa9f
callq 0x41e0
movq %rax, %rsi
andl $0x1, %esi
xorl $0x3, %esi
jmp 0x1aae3
callq 0x41e0
testb $0x1, %al
jne 0x1aa60
testb $0x1, %r14b
jne 0x1aaa3
xorl %r12d, %r12d
leaq -0x2c(%rbp), %r14
leaq -0x70(%rbp), %r15
cmpq $0x2, %r12
je 0x1aaee
movq -0x58(%rbp), %rax
movl (%rax,%r12,4), %eax
movl %eax, -0x2c(%rbp)
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x1ad0c
callq 0x41e0
andl $0x1, %eax
xorl $0x3, %eax
movq %r14, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x1ae3e
incq %r12
jmp 0x1aa22
xorl %r13d, %r13d
leaq -0x2c(%rbp), %r14
leaq -0x70(%rbp), %r15
pushq $0x4
popq %r12
cmpq $0x2, %r13
je 0x1aaee
movq -0x58(%rbp), %rax
movl (%rax,%r13,4), %eax
movl %eax, -0x2c(%rbp)
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x1ad0c
movq %r14, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x1ae3e
incq %r13
jmp 0x1aa6f
pushq $0x4
jmp 0x1aae2
movq -0x58(%rbp), %rax
movl (%rax), %eax
leaq -0x2c(%rbp), %rdi
movl %eax, (%rdi)
leaq -0x70(%rbp), %rsi
xorl %edx, %edx
callq 0x1ad0c
leaq -0x2c(%rbp), %rdi
pushq $0x2
popq %rsi
xorl %edx, %edx
callq 0x1ae3e
movq -0x58(%rbp), %rax
movl 0x4(%rax), %eax
leaq -0x2c(%rbp), %rdi
movl %eax, (%rdi)
leaq -0x70(%rbp), %rsi
xorl %edx, %edx
callq 0x1ad0c
pushq $0x3
popq %rsi
leaq -0x2c(%rbp), %rdi
xorl %edx, %edx
callq 0x1ae3e
leaq -0x58(%rbp), %rdi
callq 0x139c8
leaq 0x26716(%rip), %rax     # 0x41214
cmpl $0x3, (%rax)
pushq $0x3
popq %r12
jne 0x1ab77
pushq $0x9
popq %r14
leaq 0x22902(%rip), %r15     # 0x3d414
callq 0x41e0
cqto
idivq %r14
movl %edx, (%r15)
cmpl %edx, %ebx
je 0x1ab12
cmpl %edx, -0x38(%rbp)
je 0x1ab12
leaq 0x27129(%rip), %rax     # 0x41c58
movq (%rax), %rsi
leaq -0x58(%rbp), %rdi
callq 0x12596
leaq -0x58(%rbp), %rdi
movl (%rdi), %eax
movl %eax, -0x30(%rbp)
callq 0x24d9e
movb $0xa, %r15b
leaq -0x2c(%rbp), %rbx
leaq -0x70(%rbp), %r14
subb $0x1, %r15b
jb 0x1ab77
movl -0x30(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x1ad0c
movq %rbx, %rdi
callq 0x1ac90
jmp 0x1ab54
callq 0x41e0
cqto
idivq %r12
movq %rdx, %rbx
leaq -0x30(%rbp), %r14
leaq -0x70(%rbp), %r15
pushq $0x1
popq %r12
testw %bx, %bx
jle 0x1abf4
callq 0x41e0
leaq 0x270b7(%rip), %r13     # 0x41c58
movq (%r13), %rcx
movswq (%rcx), %rcx
addq $-0xa, %rcx
cqto
idivq %rcx
addl $0x5, %edx
movw %dx, -0x30(%rbp)
callq 0x41e0
movq (%r13), %rcx
movswq (%rcx), %rcx
addq $-0xa, %rcx
cqto
idivq %rcx
addl $0x5, %edx
movw %dx, -0x2e(%rbp)
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x1ad0c
movq %r14, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x1ae3e
decl %ebx
jmp 0x1ab90
leaq -0x2c(%rbp), %rdi
callq 0x24d9e
leaq -0x30(%rbp), %rdi
callq 0x24d9e
leaq -0x70(%rbp), %rdi
callq 0x139c8
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1ac6a
jmp 0x1ac6a
jmp 0x1ac6a
jmp 0x1ac6a
jmp 0x1ac6a
jmp 0x1ac6a
jmp 0x1ac6a
jmp 0x1ac6a
jmp 0x1ac6a
jmp 0x1ac6a
movq %rax, %rbx
jmp 0x1ac76
movq %rax, %rbx
jmp 0x1ac7f
jmp 0x1ac6a
jmp 0x1ac44
jmp 0x1ac44
jmp 0x1ac6a
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x139c8
jmp 0x1ac6d
jmp 0x1ac6a
jmp 0x1ac6a
jmp 0x1ac6a
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x1c9c8
jmp 0x1ac6d
jmp 0x1ac6a
jmp 0x1ac6a
movq %rax, %rbx
leaq -0x2c(%rbp), %rdi
callq 0x24d9e
leaq -0x30(%rbp), %rdi
callq 0x24d9e
leaq -0x70(%rbp), %rdi
callq 0x139c8
movq %rbx, %rdi
callq 0x4710