// File: /workspace/github_cpp_makefile_star2_O2/scattana[P]Crossword-Anagram-CPP/board.cpp
// Function: Board::placeList(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
void Board::placeList(vector<string>& list){
	int hold;
	// list should already be sorted and all caps from main
	for(int i=0; i<list.size(); i++){
		if(i==0){
			for(int j=0; j<list[0].size(); j++){
				// place first (longest) word in middle, horizontally
				setSpot((list[0])[j], 7, (15-list[0].size())/2 + j);
				direction[0] = "ACROSS";
			}
			locations[0][0] = 7;
			locations[0][1] = (15-list[0].size())/2;
		} // end of i=0 if statement
		// alternate placing words vertically and horizontally
		// and if one doesn't work, try the other
		if(i!=0 && i%2==0){
			if(placeNextVer(list[i])){
				direction[i] = "DOWN";
			}
			else if(placeNextHor(list[i])){
				direction[i] = "ACROSS";
			}
			else{
				cout << "Could not place word: " << list[i] << endl;
				list[i] = " ";
				place++;
				direction[i] = " ";
			}
		}
		else if(i!=0 && i%2!=0){
			if(placeNextHor(list[i])){
				direction[i] = "ACROSS";
			}
			else if(placeNextVer(list[i])){
				direction[i] = "DOWN";
			}
			else{
				cout << "Could not place word: " << list[i] << endl;
				list[i] = " ";
				place++;
				direction[i] = " ";
			}
		}
	} // end of outermost for loop
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x188(%rdi), %r15
xorl %r13d, %r13d
movq (%rbx), %rsi
movq 0x8(%rbx), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %r13, %rax
jbe 0x385e
testq %r13, %r13
jne 0x36f1
xorl %r12d, %r12d
movq 0x8(%rsi), %rax
cmpq %r12, %rax
jbe 0x36d6
movq (%rsi), %rcx
movb (%rcx,%r12), %cl
pushq $0xf
popq %rdx
subq %rax, %rdx
shrq %rdx
addl %r12d, %edx
movslq %edx, %rax
movb %cl, 0x69(%r14,%rax)
movq %r15, %rdi
leaq 0xdb4(%rip), %rsi       # 0x447d
callq 0x2260
incq %r12
movq (%rbx), %rsi
jmp 0x369b
movl $0x7, 0xe4(%r14)
pushq $0xf
popq %rcx
subq %rax, %rcx
shrq %rcx
movl %ecx, 0xe8(%r14)
testq %r13, %r13
sete %al
movl %r13d, %ecx
orb %al, %cl
testb $0x1, %cl
jne 0x377f
movq %r13, %r12
shlq $0x5, %r12
addq %r12, %rsi
leaq -0xb0(%rbp), %rdi
callq 0x21b0
movq %r14, %rdi
leaq -0xb0(%rbp), %rsi
callq 0x3870
movb %al, -0x29(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x20c0
leaq 0xd48(%rip), %rsi       # 0x4484
cmpb $0x0, -0x29(%rbp)
jne 0x3847
addq (%rbx), %r12
leaq -0x90(%rbp), %rdi
movq %r12, %rsi
callq 0x21b0
movq %r14, %rdi
leaq -0x90(%rbp), %rsi
callq 0x3a16
movl %eax, %r12d
leaq -0x90(%rbp), %rdi
callq 0x20c0
leaq 0xd00(%rip), %rsi       # 0x447d
jmp 0x37f3
testb $0x1, %r13b
je 0x3856
movq %r13, %r12
shlq $0x5, %r12
addq %r12, %rsi
leaq -0x70(%rbp), %rdi
callq 0x21b0
movq %r14, %rdi
leaq -0x70(%rbp), %rsi
callq 0x3a16
movb %al, -0x29(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x20c0
leaq 0xcc2(%rip), %rsi       # 0x447d
cmpb $0x0, -0x29(%rbp)
jne 0x3847
addq (%rbx), %r12
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
callq 0x21b0
movq %r14, %rdi
leaq -0x50(%rbp), %rsi
callq 0x3870
movl %eax, %r12d
leaq -0x50(%rbp), %rdi
callq 0x20c0
leaq 0xc91(%rip), %rsi       # 0x4484
testb %r12b, %r12b
jne 0x3847
movq 0x27d1(%rip), %rdi      # 0x5fd0
leaq 0xc83(%rip), %rsi       # 0x4489
callq 0x2160
movq %r13, %r12
shlq $0x5, %r12
movq (%rbx), %rsi
addq %r12, %rsi
movq %rax, %rdi
callq 0x2140
movq %rax, %rdi
callq 0x20e0
addq (%rbx), %r12
movq %r12, %rdi
leaq 0xbae(%rip), %r12       # 0x43e3
movq %r12, %rsi
callq 0x2260
incl 0x408(%r14)
movq %r12, %rsi
movq %r13, %rdi
shlq $0x5, %rdi
addq %r15, %rdi
callq 0x2260
incq %r13
jmp 0x367c
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq