// File: /workspace/github_cpp_makefile_star2_O1/Leeingnyo[P]newPuyoC/game.cpp
// Function: VSRemoteGame::GameInit()
bool VSRemoteGame::GameInit() {
    int input;

    Console::ScreenClear();
    std::cout << Console::GotoXY(X(0), X(0));
    std::cout << "하실 것을 골라주세요" << std::endl;
    std::cout << "0. 돌아가기" << std::endl;
    std::cout << "1. 서버" << std::endl;
    std::cout << "2. 클라" << std::endl;
    input = getch();

    switch (input) {
        case '0': return false;
        case '1': break;
        case '2': break;
        default: return false;
    }

    Console::ScreenClear();
    // 서버 인지 클라 인지
    int seed;
    if (input == '1') {
        socket = std::make_shared<ServerSocket>();
        auto server_socket = std::dynamic_pointer_cast<ServerSocket>(socket);
        // 서버 일 경우 연결을 만들고 자기 아이피 주소를 보여줌
        std::cout << Console::white
            << "안녕하세요. 당신은 서버 역할입니다." << std::endl
            << "클라이언트 역할의 분께 당신의 IP를 알려드려야 합니다." << std::endl
            << "혹시 공유기를 사용하시고 계시다면 포트 포워딩이 필요합니다." << std::endl
            << "ip는 http://www.myipaddress.com/show-my-ip-address/ 나" << std::endl
            << "shell 에서 (linux, MaxOS) ifconfig 명령어, 혹은 (Windows) ipconfig 명령어 를 사용하시면 됩니다." << std::endl
            << "포트는 9595를 사용하므로 열려있으면 닫아주세요" << std::endl;
        if (server_socket->Bind("0.0.0.0", 9595)) {
            std::cout << Console::red
                << "9595 포트에 Bind 실패했습니다. 이미 사용 중인지 확인해주세요." << std::endl
                << "3초 뒤 화면으로 돌아갑니다." << std::endl;
            Console::Sleep(3000);
            return false;
        }
        if (server_socket->Listen(5)) {
            std::cout << Console::red
                << "Listen 실패했습니다." << std::endl
                << "3초 뒤 화면으로 돌아갑니다." << std::endl;
            Console::Sleep(3000);
            return false;
        }
        if (server_socket->Accept()) {
            std::cout << Console::red
                << "Accept 실패했습니다." << std::endl
                << "3초 뒤 화면으로 돌아갑니다." << std::endl;
            Console::Sleep(3000);
            return false;
        }

        int generated_seed = rand();
        server_socket->Send(std::to_string(generated_seed));
        seed = generated_seed;
    }
    else {
        socket = std::make_shared<ClientSocket>();
        auto client_socket = std::dynamic_pointer_cast<ClientSocket>(socket);
        // 클라일 경우 IP 주소 입력받게 함
        std::string ip_address;
        std::cout << Console::white
            << "안녕하세요. 당신은 클라이언트 역할입니다." << std::endl
            << "서버 역할의 분께서 당신에게 IP를 알려드릴 겁니다." << std::endl
            << "그것을 입력해주시기 바랍니다." << std::endl
            << "예시) 127.0.0.1" << std::endl;
        std::cin >> ip_address;
        if (client_socket->Connect(ip_address, 9595)) {
            std::cout << Console::red
                << "Connect 실패했습니다. 올바른 IP인지 확인해주세요." << std::endl
                << "3초 뒤 화면으로 돌아갑니다." << std::endl;
            Console::Sleep(3000);
            return false;
        }
        seed = std::stoi(client_socket->Recv());
    }

    my_bipuyo_generator = std::make_shared<BiPuyoGenerator>(seed);
    my_board = std::make_shared<Board>();
    my_board->SetNextBiPuyo(my_bipuyo_generator->GenerateBipuyo());
    my_next_bipuyo = my_bipuyo_generator->GenerateBipuyo();

    other_board = std::make_shared<Board>();
    other_board->SetNextBiPuyo(BiPuyoGenerator::GenerateEmptyBipuyo());
    other_next_bipuyo = BiPuyoGenerator::GenerateEmptyBipuyo();

    Console::ScreenClear();
    std::cout << Console::GotoXY(X(0), X(0));
    std::cout << "Loading..." << std::endl;
    Console::Sleep(500);
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdi, -0x60(%rbp)
callq 0x3de0
leaq -0x50(%rbp), %rsi
movq $0x0, (%rsi)
movq 0xbdf3(%rip), %rbx      # 0x10fd0
movq %rbx, %rdi
callq 0x3e7e
leaq 0x70bd(%rip), %rsi      # 0xc2a9
movl $0x1d, %edx
movq %rbx, %rdi
callq 0x3310
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
leaq 0x70a0(%rip), %rsi      # 0xc2c7
movl $0xf, %edx
movq %rbx, %rdi
callq 0x3310
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
leaq 0x7075(%rip), %rsi      # 0xc2d7
movl $0x9, %edx
movq %rbx, %rdi
callq 0x3310
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
leaq 0x7044(%rip), %rsi      # 0xc2e1
movl $0x9, %edx
movq %rbx, %rdi
callq 0x3310
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
callq 0x3d5f
movl %eax, %r15d
leal -0x31(%r15), %eax
cmpl $0x1, %eax
ja 0x5d77
callq 0x3de0
leaq -0x48(%rbp), %rdi
cmpl $0x31, %r15d
jne 0x536d
movq $0x0, -0x8(%rdi)
leaq -0x50(%rbp), %r15
leaq -0x80(%rbp), %rdx
movq %r15, %rsi
callq 0x9ec6
movaps (%r15), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r15)
movq -0x60(%rbp), %r15
movq 0x98(%r15), %rdi
movups %xmm0, 0x90(%r15)
testq %rdi, %rdi
je 0x5335
callq 0x7fac
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x5343
callq 0x7fac
movq 0x90(%r15), %rdi
testq %rdi, %rdi
je 0x53e1
leaq 0xb566(%rip), %rsi      # 0x108c0
leaq 0xb5a7(%rip), %rdx      # 0x10908
xorl %ecx, %ecx
callq 0x32f0
movq %rax, %r12
jmp 0x53e4
movq $0x0, -0x8(%rdi)
leaq -0x50(%rbp), %r15
leaq -0x80(%rbp), %rdx
movq %r15, %rsi
callq 0x9fc4
movaps (%r15), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r15)
movq -0x60(%rbp), %r15
movq 0x98(%r15), %rdi
movups %xmm0, 0x90(%r15)
testq %rdi, %rdi
je 0x53ad
callq 0x7fac
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x53bb
callq 0x7fac
movq 0x90(%r15), %rdi
testq %rdi, %rdi
je 0x540e
leaq 0xb4f2(%rip), %rsi      # 0x108c0
leaq 0xb583(%rip), %rdx      # 0x10958
xorl %ecx, %ecx
callq 0x32f0
movq %rax, %r12
jmp 0x5411
xorl %r12d, %r12d
testq %r12, %r12
je 0x5446
movq 0x98(%r15), %rcx
movq %rcx, -0x30(%rbp)
testq %rcx, %rcx
je 0x546b
movq 0xbbc8(%rip), %rax      # 0x10fc8
cmpb $0x0, (%rax)
je 0x5463
movq -0x30(%rbp), %rax
incl 0x8(%rax)
jmp 0x546b
xorl %r12d, %r12d
testq %r12, %r12
je 0x5453
movq 0x98(%r15), %rcx
movq %rcx, -0x30(%rbp)
testq %rcx, %rcx
je 0x576d
movq 0xbb97(%rip), %rax      # 0x10fc8
cmpb $0x0, (%rax)
je 0x5765
movq -0x30(%rbp), %rax
incl 0x8(%rax)
jmp 0x576d
movq $0x0, -0x30(%rbp)
xorl %r12d, %r12d
jmp 0x546b
xorl %r12d, %r12d
movq $0x0, -0x30(%rbp)
jmp 0x576d
movq -0x30(%rbp), %rax
lock
incl 0x8(%rax)
movq 0xbb5e(%rip), %rdi      # 0x10fd0
leaq 0xbe4b(%rip), %rsi      # 0x112c4
callq 0x3e37
movq %rax, %r13
leaq 0x6e63(%rip), %rsi      # 0xc2eb
movl $0x32, %edx
movq %rax, %rdi
callq 0x3310
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r13, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
movq %rax, %r13
leaq 0x6e57(%rip), %rsi      # 0xc31e
movl $0x4b, %edx
movq %rax, %rdi
callq 0x3310
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r13, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
movq %rax, %r13
leaq 0x6e64(%rip), %rsi      # 0xc36a
movl $0x55, %edx
movq %rax, %rdi
callq 0x3310
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r13, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
movq %rax, %r13
leaq 0x6e7b(%rip), %rsi      # 0xc3c0
movl $0x38, %edx
movq %rax, %rdi
callq 0x3310
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r13, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
movq %rax, %r13
leaq 0x6e75(%rip), %rsi      # 0xc3f9
movl $0x72, %edx
movq %rax, %rdi
callq 0x3310
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r13, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
movq %rax, %r13
leaq 0x6ea9(%rip), %rsi      # 0xc46c
movl $0x41, %edx
movq %rax, %rdi
callq 0x3310
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r13, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
leaq -0xb0(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x6ea4(%rip), %rsi      # 0xc4ae
leaq 0x6ea4(%rip), %rdx      # 0xc4b5
leaq -0xc0(%rbp), %rdi
callq 0x3bfa
leaq -0xc0(%rbp), %rsi
movq %r12, %rdi
movl $0x257b, %edx           # imm = 0x257B
callq 0x385c
movl %eax, %r13d
movq -0xc0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5645
callq 0x3260
testl %r13d, %r13d
je 0x56cf
movq 0xb97b(%rip), %rdi      # 0x10fd0
leaq 0xbc5c(%rip), %rsi      # 0x112b8
callq 0x3e37
movq %rax, %rbx
leaq 0x6e4b(%rip), %rsi      # 0xc4b6
movl $0x53, %edx
movq %rax, %rdi
callq 0x3310
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
movq %rax, %rbx
leaq 0x6e61(%rip), %rsi      # 0xc50a
movl $0x26, %edx
movq %rax, %rdi
callq 0x3310
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
jmp 0x5d4c
movq %r12, %rdi
movl $0x5, %esi
callq 0x38ba
testl %eax, %eax
je 0x5cc0
movq 0xb8e5(%rip), %rdi      # 0x10fd0
leaq 0xbbc6(%rip), %rsi      # 0x112b8
callq 0x3e37
movq %rax, %rbx
leaq 0x6e30(%rip), %rsi      # 0xc531
movl $0x1a, %edx
movq %rax, %rdi
callq 0x3310
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
movq %rax, %rbx
leaq 0x6dcb(%rip), %rsi      # 0xc50a
movl $0x26, %edx
movq %rax, %rdi
callq 0x3310
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
jmp 0x5d4c
movq -0x30(%rbp), %rax
lock
incl 0x8(%rax)
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0xb849(%rip), %rdi      # 0x10fd0
leaq 0xbb36(%rip), %rsi      # 0x112c4
callq 0x3e37
movq %rax, %r13
leaq 0x6dca(%rip), %rsi      # 0xc567
movl $0x3b, %edx
movq %rax, %rdi
callq 0x3310
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r13, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
movq %rax, %r13
leaq 0x6dc7(%rip), %rsi      # 0xc5a3
movl $0x45, %edx
movq %rax, %rdi
callq 0x3310
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r13, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
movq %rax, %r13
leaq 0x6dce(%rip), %rsi      # 0xc5e9
movl $0x2a, %edx
movq %rax, %rdi
callq 0x3310
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r13, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
movq %rax, %r13
leaq 0x6dba(%rip), %rsi      # 0xc614
movl $0x11, %edx
movq %rax, %rdi
callq 0x3310
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r13, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
movq 0xb74a(%rip), %rdi      # 0x10fe0
leaq -0x50(%rbp), %rsi
callq 0x3350
leaq -0x90(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0xa0(%rbp), %rdi
callq 0x9652
leaq -0xa0(%rbp), %rsi
movq %r12, %rdi
movl $0x257b, %edx           # imm = 0x257B
callq 0x3a3e
movl %eax, %r13d
movq -0xa0(%rbp), %rdi
cmpq %r14, %rdi
je 0x58e9
callq 0x3260
testl %r13d, %r13d
je 0x5992
movq 0xb6d7(%rip), %rdi      # 0x10fd0
leaq 0xb9b8(%rip), %rsi      # 0x112b8
callq 0x3e37
movq %rax, %r12
leaq 0x6d17(%rip), %rsi      # 0xc626
movl $0x42, %edx
movq %rax, %rdi
callq 0x3310
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
movq %rax, %r12
leaq 0x6bbc(%rip), %rsi      # 0xc50a
movl $0x26, %edx
movq %rax, %rdi
callq 0x3310
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
movl $0xbb8, %edi            # imm = 0xBB8
callq 0x3dd0
jmp 0x5a16
movq (%r12), %rax
leaq -0x80(%rbp), %rdi
movq %r12, %rsi
callq *0x10(%rax)
movq -0x80(%rbp), %r15
callq 0x3040
movq %rax, %r12
movl (%rax), %eax
movl %eax, -0x54(%rbp)
movl $0x0, (%r12)
leaq -0xe8(%rbp), %r14
movq %r15, %rdi
movq %r14, %rsi
movl $0xa, %edx
callq 0x33a0
cmpq %r15, (%r14)
je 0x5de2
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x5dee
movl (%r12), %ecx
cmpl $0x22, %ecx
je 0x5dee
testl %ecx, %ecx
movq -0x60(%rbp), %r15
jne 0x5a01
movl -0x54(%rbp), %ecx
movl %ecx, (%r12)
movl %eax, -0x58(%rbp)
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5a16
callq 0x3260
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x5a28
callq 0x3260
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x5a36
callq 0x7fac
testl %r13d, %r13d
jne 0x5d77
leaq -0x48(%rbp), %rdi
movq $0x0, -0x8(%rdi)
leaq -0x50(%rbp), %r14
leaq -0x80(%rbp), %rdx
leaq -0x58(%rbp), %rcx
movq %r14, %rsi
callq 0x9cd6
movaps (%r14), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r14)
movq 0x18(%r15), %rdi
movups %xmm0, 0x10(%r15)
testq %rdi, %rdi
je 0x5a7d
callq 0x7fac
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x5a8b
callq 0x7fac
leaq -0x48(%rbp), %rdi
movq $0x0, -0x8(%rdi)
leaq -0x80(%rbp), %rdx
movq %r14, %rsi
callq 0x9bba
movaps (%r14), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r14)
movq 0x28(%r15), %rdi
movups %xmm0, 0x20(%r15)
testq %rdi, %rdi
je 0x5ac1
callq 0x7fac
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x5acf
callq 0x7fac
movq 0x20(%r15), %r12
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x6ef2
movq (%r14), %rax
movq %rax, 0x50(%r12)
leaq 0x58(%r12), %rdi
leaq -0x48(%rbp), %r14
movq %r14, %rsi
callq 0x8026
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, 0x60(%r12)
movl $0x0, 0x68(%r12)
movq (%r14), %rdi
testq %rdi, %rdi
je 0x5b1d
callq 0x7fac
movq 0x10(%r15), %rsi
leaq -0x50(%rbp), %r14
movq %r14, %rdi
callq 0x6ef2
movaps (%r14), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r14)
movq 0x38(%r15), %rdi
movups %xmm0, 0x30(%r15)
testq %rdi, %rdi
je 0x5b4b
callq 0x7fac
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x5b59
callq 0x7fac
leaq -0x48(%rbp), %rdi
movq $0x0, -0x8(%rdi)
leaq -0x80(%rbp), %rdx
movq %r14, %rsi
callq 0x9bba
movaps (%r14), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r14)
movq 0x68(%r15), %rdi
movups %xmm0, 0x60(%r15)
testq %rdi, %rdi
je 0x5b8f
callq 0x7fac
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x5b9d
callq 0x7fac
movq 0x60(%r15), %r15
leaq -0x48(%rbp), %r14
movq $0x0, -0x8(%r14)
movl $0x18, %edi
callq 0x32a0
movabsq $0x100000001, %rcx      # imm = 0x100000001
movq %rcx, 0x8(%rax)
leaq 0xae9c(%rip), %r13      # 0x10a68
movq %r13, (%rax)
leaq 0x10(%rax), %rcx
movw $0x0, 0x10(%rax)
xorl %r12d, %r12d
movl %r12d, 0x14(%rax)
movq %rax, (%r14)
movq %rcx, -0x8(%r14)
movq %rcx, 0x50(%r15)
leaq 0x58(%r15), %rdi
movq %r14, %rsi
callq 0x8026
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, 0x60(%r15)
movl %r12d, 0x68(%r15)
movq (%r14), %rdi
testq %rdi, %rdi
je 0x5c16
callq 0x7fac
movl $0x18, %edi
callq 0x32a0
movabsq $0x100000001, %rcx      # imm = 0x100000001
movq %rcx, 0x8(%rax)
movq %r13, (%rax)
leaq 0x10(%rax), %rcx
movw $0x0, 0x10(%rax)
movl $0x0, 0x14(%rax)
movq -0x60(%rbp), %rdx
movq %rcx, 0x70(%rdx)
movq 0x78(%rdx), %rdi
movq %rax, 0x78(%rdx)
testq %rdi, %rdi
je 0x5c5c
callq 0x7fac
callq 0x3de0
leaq -0x50(%rbp), %rsi
movq $0x0, (%rsi)
movq %rbx, %rdi
callq 0x3e7e
leaq 0x6575(%rip), %rsi      # 0xc1f0
movl $0xa, %edx
movq %rbx, %rdi
callq 0x3310
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
movl $0x1f4, %edi            # imm = 0x1F4
callq 0x3dd0
movb $0x1, %al
jmp 0x5d79
movq %r12, %rdi
callq 0x38f4
testl %eax, %eax
je 0x5d8b
movq 0xb2f9(%rip), %rdi      # 0x10fd0
leaq 0xb5da(%rip), %rsi      # 0x112b8
callq 0x3e37
movq %rax, %rbx
leaq 0x685f(%rip), %rsi      # 0xc54c
movl $0x1a, %edx
movq %rax, %rdi
callq 0x3310
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
movq %rax, %rbx
leaq 0x67df(%rip), %rsi      # 0xc50a
movl $0x26, %edx
movq %rax, %rdi
callq 0x3310
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
movl $0xbb8, %edi            # imm = 0xBB8
callq 0x3dd0
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x5d77
callq 0x7fac
xorl %eax, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x30a0
movl %eax, %r13d
leaq -0xe0(%rbp), %rdi
movl %eax, %esi
callq 0x7266
movq (%r12), %rax
leaq -0xe0(%rbp), %rsi
movq %r12, %rdi
callq *0x18(%rax)
leaq -0xd0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5dc7
callq 0x3260
movl %r13d, -0x58(%rbp)
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x5a3f
callq 0x7fac
jmp 0x5a3f
leaq 0x6959(%rip), %rdi      # 0xc742
callq 0x31b0
leaq 0x694d(%rip), %rdi      # 0xc742
callq 0x33c0
movq %rax, %rbx
leaq -0xd0(%rbp), %rax
movq -0x10(%rax), %rdi
jmp 0x5e62
jmp 0x5e6e
jmp 0x5e57
movq %rax, %rbx
cmpl $0x0, (%r12)
jne 0x5e1f
movl -0x54(%rbp), %eax
movl %eax, (%r12)
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x5e50
jmp 0x5e5a
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
cmpq %r14, %rdi
jne 0x5e67
jmp 0x5e71
jmp 0x5e6e
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5e5a
callq 0x3260
jmp 0x5e5a
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x5e71
callq 0x3260
jmp 0x5e71
movq %rax, %rbx
cmpq $0x0, -0x30(%rbp)
je 0x5e81
movq -0x30(%rbp), %rdi
callq 0x7fac
movq %rbx, %rdi
callq 0x3480
nop