// File: yahoo[P]UDPing/src/serversession.cc
// Function: ServerSessionManager::getServerSession(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, packet*)
ServerSession* ServerSessionManager::getServerSession (string peer, int port, packet* p) {
    if (!sessionMap.count(p->guid)) {
        stringstream source;
        source << peer << ":" << port;
        ServerSession* ds = new ServerSession(this->writer, peer, port, p);
        // Set the successor for the outgoing session, so that when it times out it checks for
        // a gap in the packet sequence.  This would indicate a lost packet at the end of
        // a session.
        ServerSession* predecessor = sourceMap[source.str()];
        if (predecessor && (predecessor->getClientStartTime() == ds->getClientStartTime())) {
            predecessor->setSuccessor(p->guid);
        }
        sessionMap[p->guid] = ds;
        sourceMap[source.str()] = ds;
    }
    return sessionMap[p->guid];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3d0, %rsp            # imm = 0x3D0
movq %rsi, -0x2f8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x2f0(%rbp)
movq %rax, -0x2e8(%rbp)
movq -0x20(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x2e0(%rbp)
leaq -0x41(%rbp), %rdi
movq %rdi, -0x2d8(%rbp)
callq 0x24c0
movq -0x2e0(%rbp), %rsi
movq -0x2d8(%rbp), %rdx
leaq -0x40(%rbp), %rdi
callq 0x23e0
jmp 0x4dab
movq -0x2f0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x5be0
movq %rax, -0x300(%rbp)
jmp 0x4dc4
movq -0x300(%rbp), %rax
cmpq $0x0, %rax
setne %al
xorb $-0x1, %al
movb %al, -0x301(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x21e0
leaq -0x41(%rbp), %rdi
callq 0x2350
movb -0x301(%rbp), %al
testb $0x1, %al
jne 0x4dfb
jmp 0x5263
leaq -0x1e0(%rbp), %rdi
callq 0x2200
movq -0x2f8(%rbp), %rsi
leaq -0x1d0(%rbp), %rdi
callq 0x22a0
movq %rax, -0x310(%rbp)
jmp 0x4e23
movq -0x310(%rbp), %rdi
leaq 0x6627(%rip), %rsi      # 0xb458
callq 0x2310
movq %rax, -0x318(%rbp)
jmp 0x4e3f
movq -0x318(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x24a0
jmp 0x4e50
movl $0x48, %edi
callq 0x2320
movq %rax, -0x320(%rbp)
jmp 0x4e63
movq -0x2f8(%rbp), %rsi
movq -0x2e8(%rbp), %rax
movb $0x1, -0x209(%rbp)
movq 0x98(%rax), %rax
movq %rax, -0x328(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x2160
jmp 0x4e94
movq -0x328(%rbp), %rsi
movq -0x320(%rbp), %rdi
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %r8
leaq -0x208(%rbp), %rdx
callq 0x4a10
jmp 0x4eb7
movb $0x0, -0x209(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x21e0
movq -0x320(%rbp), %rcx
movq -0x2e8(%rbp), %rax
movq %rcx, -0x1e8(%rbp)
addq $0x30, %rax
movq %rax, -0x330(%rbp)
leaq -0x238(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x2300
jmp 0x4eff
movq -0x330(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x5c40
movq %rax, -0x338(%rbp)
jmp 0x4f1b
movq -0x338(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x340(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x21e0
movq -0x340(%rbp), %rax
movq %rax, -0x218(%rbp)
cmpq $0x0, -0x218(%rbp)
je 0x50eb
movq -0x218(%rbp), %rdi
callq 0x5d20
movq %rax, -0x348(%rbp)
jmp 0x4f69
movq -0x1e8(%rbp), %rdi
callq 0x5d20
movq %rax, -0x350(%rbp)
jmp 0x4f7e
movq -0x348(%rbp), %rax
movq -0x350(%rbp), %rcx
cmpq %rcx, %rax
jne 0x50eb
movq -0x218(%rbp), %rax
movq %rax, -0x368(%rbp)
movq -0x20(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x360(%rbp)
leaq -0x259(%rbp), %rdi
movq %rdi, -0x358(%rbp)
callq 0x24c0
movq -0x360(%rbp), %rsi
movq -0x358(%rbp), %rdx
leaq -0x258(%rbp), %rdi
callq 0x23e0
jmp 0x4fe1
movq -0x368(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x5d40
jmp 0x4ff6
leaq -0x258(%rbp), %rdi
callq 0x21e0
leaq -0x259(%rbp), %rdi
callq 0x2350
jmp 0x50eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x5036
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x21e0
leaq -0x41(%rbp), %rdi
callq 0x2350
jmp 0x5336
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x5252
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x507b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x21e0
testb $0x1, -0x209(%rbp)
jne 0x5086
jmp 0x5092
movq -0x320(%rbp), %rdi
callq 0x22f0
jmp 0x5252
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x21e0
jmp 0x5252
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x50da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x21e0
leaq -0x259(%rbp), %rdi
callq 0x2350
jmp 0x5252
movq -0x2e8(%rbp), %rax
movq -0x1e8(%rbp), %rcx
movq %rcx, -0x388(%rbp)
movq %rax, -0x380(%rbp)
movq -0x20(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x378(%rbp)
leaq -0x281(%rbp), %rdi
movq %rdi, -0x370(%rbp)
callq 0x24c0
movq -0x378(%rbp), %rsi
movq -0x370(%rbp), %rdx
leaq -0x280(%rbp), %rdi
callq 0x23e0
jmp 0x5145
movq -0x380(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x5c40
movq %rax, -0x390(%rbp)
jmp 0x5161
movq -0x390(%rbp), %rax
movq -0x388(%rbp), %rcx
movq %rcx, (%rax)
leaq -0x280(%rbp), %rdi
callq 0x21e0
leaq -0x281(%rbp), %rdi
callq 0x2350
movq -0x2e8(%rbp), %rax
movq -0x1e8(%rbp), %rcx
movq %rcx, -0x3a0(%rbp)
addq $0x30, %rax
movq %rax, -0x398(%rbp)
leaq -0x2a8(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x2300
jmp 0x51bf
movq -0x398(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0x5c40
movq %rax, -0x3a8(%rbp)
jmp 0x51db
movq -0x3a8(%rbp), %rax
movq -0x3a0(%rbp), %rcx
movq %rcx, (%rax)
leaq -0x2a8(%rbp), %rdi
callq 0x21e0
leaq -0x1e0(%rbp), %rdi
callq 0x2220
jmp 0x5263
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x522c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x280(%rbp), %rdi
callq 0x21e0
leaq -0x281(%rbp), %rdi
callq 0x2350
jmp 0x5252
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x2a8(%rbp), %rdi
callq 0x21e0
leaq -0x1e0(%rbp), %rdi
callq 0x2220
jmp 0x5336
movq -0x2e8(%rbp), %rax
movq %rax, -0x3c0(%rbp)
movq -0x20(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x3b8(%rbp)
leaq -0x2c9(%rbp), %rdi
movq %rdi, -0x3b0(%rbp)
callq 0x24c0
movq -0x3b8(%rbp), %rsi
movq -0x3b0(%rbp), %rdx
leaq -0x2c8(%rbp), %rdi
callq 0x23e0
jmp 0x52af
movq -0x3c0(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
callq 0x5c40
movq %rax, -0x3c8(%rbp)
jmp 0x52cb
movq -0x3c8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x3d0(%rbp)
leaq -0x2c8(%rbp), %rdi
callq 0x21e0
leaq -0x2c9(%rbp), %rdi
callq 0x2350
movq -0x3d0(%rbp), %rax
addq $0x3d0, %rsp            # imm = 0x3D0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x532a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x2c8(%rbp), %rdi
callq 0x21e0
leaq -0x2c9(%rbp), %rdi
callq 0x2350
movq -0x50(%rbp), %rdi
callq 0x24b0
nop