// File: /workspace/github_cpp_makefile_star2_O3/syky27[P]TicTacToe/src/DNWindow.cpp
// Function: DNWindow::startLocalGameTwoHumans(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool DNWindow::startLocalGameTwoHumans(string & nameOfPlayerOne, string & nameOfPlayerTwo)
{
    struct winsize w;
    ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
    clearScreen();
    drawHeader();
    middleString("Please enter name of first player: ", w.ws_row / 2);
    
    while(true){
        inputString(nameOfPlayerOne);
        if(nameOfPlayerOne.size() == 0){ clearScreen();  middleString("Name cannot be empty, try again: ", w.ws_row / 2); drawHeader();}
        else{
            DNWindow::getInstance().clearScreen();
            DNWindow::getInstance().drawHeader();
            middleString("Please enter name of second player: ", w.ws_row / 2);
            while(true){    
                inputString(nameOfPlayerTwo);
                if(nameOfPlayerTwo.size() == 0) {clearScreen(); middleString("Name cannot be empty, try again: ", w.ws_row / 2); drawHeader(); }
                else break;
            }
            break;
            
        }
    }
    
   
    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x10(%rsp), %r15
movl $0x5413, %esi           # imm = 0x5413
movl $0x1, %edi
movq %r15, %rdx
xorl %eax, %eax
callq 0x33e0
callq 0x34a0
callq 0x3480
callq 0x7692
leaq 0x88(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x10d2(%rip), %rsi      # 0x9558
leaq 0x10ee(%rip), %rdx      # 0x957b
leaq 0x78(%rsp), %r12
movq %r12, %rdi
callq 0x404c
movzwl (%r15), %ebp
shrl %ebp
leaq 0x8(%rsp), %r15
movl $0x5413, %esi           # imm = 0x5413
movl $0x1, %edi
movq %r15, %rdx
xorl %eax, %eax
callq 0x33e0
movzwl 0x2(%r15), %esi
subq 0x8(%r12), %rsi
shrq %rsi
movq (%r12), %rcx
leaq 0xfeb(%rip), %rdx       # 0x94bc
movl %ebp, %edi
xorl %eax, %eax
callq 0x33d0
movq 0x78(%rsp), %rdi
cmpq %r13, %rdi
je 0x84f4
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x32f0
movq %r14, %rsi
callq 0x7da6
cmpq $0x0, 0x8(%r14)
jne 0x85aa
leaq 0x48(%rsp), %r13
leaq 0x8(%rsp), %rbp
leaq 0xfa4(%rip), %r15       # 0x94bc
callq 0x34a0
callq 0x3480
movq %r13, 0x38(%rsp)
leaq 0x38(%rsp), %rdi
leaq 0x1049(%rip), %rsi      # 0x957c
leaq 0x1063(%rip), %rdx      # 0x959d
callq 0x404c
movzwl 0x10(%rsp), %r12d
shrl %r12d
movl $0x5413, %esi           # imm = 0x5413
movl $0x1, %edi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x33e0
movzwl 0xa(%rsp), %esi
subq 0x40(%rsp), %rsi
shrq %rsi
movq 0x38(%rsp), %rcx
movl %r12d, %edi
movq %r15, %rdx
xorl %eax, %eax
callq 0x33d0
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x8592
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x32f0
callq 0x7692
movq %r14, %rsi
callq 0x7da6
cmpq $0x0, 0x8(%r14)
je 0x8518
callq 0x39ee
callq 0x34a0
callq 0x3480
callq 0x39ee
callq 0x7692
leaq 0x68(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0xfcb(%rip), %rsi       # 0x959e
leaq 0xfe8(%rip), %rdx       # 0x95c2
leaq 0x58(%rsp), %r14
movq %r14, %rdi
callq 0x404c
movzwl 0x10(%rsp), %ebp
shrl %ebp
leaq 0x8(%rsp), %r15
movl $0x5413, %esi           # imm = 0x5413
movl $0x1, %edi
movq %r15, %rdx
xorl %eax, %eax
callq 0x33e0
movzwl 0x2(%r15), %esi
subq 0x8(%r14), %rsi
shrq %rsi
movq (%r14), %rcx
leaq 0xe9f(%rip), %rdx       # 0x94bc
movl %ebp, %edi
xorl %eax, %eax
callq 0x33d0
movq 0x58(%rsp), %rdi
cmpq %r13, %rdi
je 0x863d
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x32f0
movq %rbx, %rsi
callq 0x7da6
cmpq $0x0, 0x8(%rbx)
jne 0x86f6
leaq 0x28(%rsp), %r13
leaq 0x18(%rsp), %r12
leaq 0x8(%rsp), %r15
leaq 0xe56(%rip), %rbp       # 0x94bc
callq 0x34a0
callq 0x3480
movq %r13, 0x18(%rsp)
movq %r12, %rdi
leaq 0xefd(%rip), %rsi       # 0x957c
leaq 0xf17(%rip), %rdx       # 0x959d
callq 0x404c
movzwl 0x10(%rsp), %r14d
shrl %r14d
movl $0x5413, %esi           # imm = 0x5413
movl $0x1, %edi
movq %r15, %rdx
xorl %eax, %eax
callq 0x33e0
movzwl 0xa(%rsp), %esi
subq 0x20(%rsp), %rsi
shrq %rsi
movq 0x18(%rsp), %rcx
movl %r14d, %edi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x33d0
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0x86de
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x32f0
callq 0x7692
movq %rbx, %rsi
callq 0x7da6
cmpq $0x0, 0x8(%rbx)
je 0x8666
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x58(%rsp), %rdi
jmp 0x8730
movq %rax, %rbx
movq 0x78(%rsp), %rdi
jmp 0x8730
movq %rax, %rbx
movq 0x18(%rsp), %rdi
jmp 0x8730
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x8741
movq (%r13), %rsi
incq %rsi
callq 0x32f0
movq %rbx, %rdi
callq 0x34b0
nop