// File: /workspace/github_cpp_makefile_star2_O1/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 0x76a2
leaq 0x88(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x10c2(%rip), %rsi      # 0x9558
leaq 0x10de(%rip), %rdx      # 0x957b
leaq 0x78(%rsp), %r12
movq %r12, %rdi
callq 0x4048
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 0xfdb(%rip), %rdx       # 0x94bc
movl %ebp, %edi
xorl %eax, %eax
callq 0x33d0
movq 0x78(%rsp), %rdi
cmpq %r13, %rdi
je 0x8504
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x32f0
movq %r14, %rsi
callq 0x7db6
cmpq $0x0, 0x8(%r14)
jne 0x85ba
leaq 0x48(%rsp), %r13
leaq 0x8(%rsp), %rbp
leaq 0xf94(%rip), %r15       # 0x94bc
callq 0x34a0
callq 0x3480
movq %r13, 0x38(%rsp)
leaq 0x38(%rsp), %rdi
leaq 0x1039(%rip), %rsi      # 0x957c
leaq 0x1053(%rip), %rdx      # 0x959d
callq 0x4048
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 0x85a2
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x32f0
callq 0x76a2
movq %r14, %rsi
callq 0x7db6
cmpq $0x0, 0x8(%r14)
je 0x8528
callq 0x39ee
callq 0x34a0
callq 0x3480
callq 0x39ee
callq 0x76a2
leaq 0x68(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0xfbb(%rip), %rsi       # 0x959e
leaq 0xfd8(%rip), %rdx       # 0x95c2
leaq 0x58(%rsp), %r14
movq %r14, %rdi
callq 0x4048
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 0xe8f(%rip), %rdx       # 0x94bc
movl %ebp, %edi
xorl %eax, %eax
callq 0x33d0
movq 0x58(%rsp), %rdi
cmpq %r13, %rdi
je 0x864d
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x32f0
movq %rbx, %rsi
callq 0x7db6
cmpq $0x0, 0x8(%rbx)
jne 0x8706
leaq 0x28(%rsp), %r13
leaq 0x18(%rsp), %r12
leaq 0x8(%rsp), %r15
leaq 0xe46(%rip), %rbp       # 0x94bc
callq 0x34a0
callq 0x3480
movq %r13, 0x18(%rsp)
movq %r12, %rdi
leaq 0xeed(%rip), %rsi       # 0x957c
leaq 0xf07(%rip), %rdx       # 0x959d
callq 0x4048
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 0x86ee
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x32f0
callq 0x76a2
movq %rbx, %rsi
callq 0x7db6
cmpq $0x0, 0x8(%rbx)
je 0x8676
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 0x8740
movq %rax, %rbx
movq 0x78(%rsp), %rdi
jmp 0x8740
movq %rax, %rbx
movq 0x18(%rsp), %rdi
jmp 0x8740
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x8751
movq (%r13), %rsi
incq %rsi
callq 0x32f0
movq %rbx, %rdi
callq 0x34b0
nop