// File: 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
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movl $0x0, -0x18(%rbp)
movslq -0x18(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3bf0
movq %rax, %rcx
movq -0xc0(%rbp), %rax
cmpq %rcx, %rax
jae 0x5433
cmpl $0x0, -0x18(%rbp)
jne 0x504e
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3cb0
movq %rax, %rdi
callq 0x2130
movq %rax, %rcx
movq -0xc8(%rbp), %rax
cmpq %rcx, %rax
jae 0x500d
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3cb0
movq %rax, %rdi
movslq -0x1c(%rbp), %rsi
callq 0x22e0
movb (%rax), %al
movb %al, -0xc9(%rbp)
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3cb0
movq %rax, %rdi
callq 0x2130
movq -0xb8(%rbp), %rdi
movq %rax, %rdx
movb -0xc9(%rbp), %al
movl $0xf, %ecx
subq %rdx, %rcx
shrq %rcx
movslq -0x1c(%rbp), %rdx
addq %rdx, %rcx
movl $0x7, %edx
movsbl %al, %esi
callq 0x4e80
movq -0xb8(%rbp), %rdi
addq $0x188, %rdi            # imm = 0x188
leaq 0x1483(%rip), %rsi      # 0x647d
callq 0x2200
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x4f4d
movq -0xb8(%rbp), %rax
movl $0x7, 0xe4(%rax)
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3cb0
movq %rax, %rdi
callq 0x2130
movq %rax, %rdx
movq -0xb8(%rbp), %rax
movl $0xf, %ecx
subq %rdx, %rcx
shrq %rcx
movl %ecx, 0xe8(%rax)
cmpl $0x0, -0x18(%rbp)
je 0x5230
movl -0x18(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x5230
movq -0x10(%rbp), %rdi
movslq -0x18(%rbp), %rsi
callq 0x3cb0
movq %rax, %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x20c0
movq -0xb8(%rbp), %rdi
movq -0xd8(%rbp), %rsi
callq 0x5450
movb %al, -0xca(%rbp)
jmp 0x50a7
leaq -0x40(%rbp), %rdi
callq 0x2120
movb -0xca(%rbp), %al
testb $0x1, %al
jne 0x50bc
jmp 0x5100
movq -0xb8(%rbp), %rdi
addq $0x188, %rdi            # imm = 0x188
movslq -0x18(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
leaq 0x13a8(%rip), %rsi      # 0x6484
callq 0x2200
jmp 0x522b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x2120
jmp 0x543c
movq -0x10(%rbp), %rdi
movslq -0x18(%rbp), %rsi
callq 0x3cb0
movq %rax, %rsi
leaq -0x70(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x20c0
movq -0xb8(%rbp), %rdi
movq -0xe8(%rbp), %rsi
callq 0x5780
movb %al, -0xd9(%rbp)
jmp 0x513b
leaq -0x70(%rbp), %rdi
callq 0x2120
movb -0xd9(%rbp), %al
testb $0x1, %al
jne 0x5150
jmp 0x5194
movq -0xb8(%rbp), %rdi
addq $0x188, %rdi            # imm = 0x188
movslq -0x18(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
leaq 0x130d(%rip), %rsi      # 0x647d
callq 0x2200
jmp 0x5229
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x2120
jmp 0x543c
movq 0x3e35(%rip), %rdi      # 0x8fd0
leaq 0x12e7(%rip), %rsi      # 0x6489
callq 0x21a0
movq %rax, -0xf0(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x18(%rbp), %rsi
callq 0x3cb0
movq -0xf0(%rbp), %rdi
movq %rax, %rsi
callq 0x2180
movq %rax, %rdi
movq 0x3dec(%rip), %rsi      # 0x8fc0
callq 0x21c0
movq -0x10(%rbp), %rdi
movslq -0x18(%rbp), %rsi
callq 0x3cb0
movq %rax, %rdi
leaq 0x11f3(%rip), %rsi      # 0x63e3
callq 0x2200
movq -0xb8(%rbp), %rdi
movl 0x408(%rdi), %eax
addl $0x1, %eax
movl %eax, 0x408(%rdi)
addq $0x188, %rdi            # imm = 0x188
movslq -0x18(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
leaq 0x11bf(%rip), %rsi      # 0x63e3
callq 0x2200
jmp 0x522b
jmp 0x5423
cmpl $0x0, -0x18(%rbp)
je 0x5421
movl -0x18(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x5421
movq -0x10(%rbp), %rdi
movslq -0x18(%rbp), %rsi
callq 0x3cb0
movq %rax, %rsi
leaq -0x90(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x20c0
movq -0xb8(%rbp), %rdi
movq -0x100(%rbp), %rsi
callq 0x5780
movb %al, -0xf1(%rbp)
jmp 0x528c
leaq -0x90(%rbp), %rdi
callq 0x2120
movb -0xf1(%rbp), %al
testb $0x1, %al
jne 0x52a4
jmp 0x52eb
movq -0xb8(%rbp), %rdi
addq $0x188, %rdi            # imm = 0x188
movslq -0x18(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
leaq 0x11b9(%rip), %rsi      # 0x647d
callq 0x2200
jmp 0x541f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x2120
jmp 0x543c
movq -0x10(%rbp), %rdi
movslq -0x18(%rbp), %rsi
callq 0x3cb0
movq %rax, %rsi
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x20c0
movq -0xb8(%rbp), %rdi
movq -0x110(%rbp), %rsi
callq 0x5450
movb %al, -0x101(%rbp)
jmp 0x5329
leaq -0xb0(%rbp), %rdi
callq 0x2120
movb -0x101(%rbp), %al
testb $0x1, %al
jne 0x5341
jmp 0x5388
movq -0xb8(%rbp), %rdi
addq $0x188, %rdi            # imm = 0x188
movslq -0x18(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
leaq 0x1123(%rip), %rsi      # 0x6484
callq 0x2200
jmp 0x541d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x2120
jmp 0x543c
movq 0x3c41(%rip), %rdi      # 0x8fd0
leaq 0x10f3(%rip), %rsi      # 0x6489
callq 0x21a0
movq %rax, -0x118(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x18(%rbp), %rsi
callq 0x3cb0
movq -0x118(%rbp), %rdi
movq %rax, %rsi
callq 0x2180
movq %rax, %rdi
movq 0x3bf8(%rip), %rsi      # 0x8fc0
callq 0x21c0
movq -0x10(%rbp), %rdi
movslq -0x18(%rbp), %rsi
callq 0x3cb0
movq %rax, %rdi
leaq 0xfff(%rip), %rsi       # 0x63e3
callq 0x2200
movq -0xb8(%rbp), %rdi
movl 0x408(%rdi), %eax
addl $0x1, %eax
movl %eax, 0x408(%rdi)
addq $0x188, %rdi            # imm = 0x188
movslq -0x18(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
leaq 0xfcb(%rip), %rsi       # 0x63e3
callq 0x2200
jmp 0x541f
jmp 0x5421
jmp 0x5423
jmp 0x5425
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x4f15
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x22a0
nopw %cs:(%rax,%rax)