// File: murry2018[P]mogazi/kakaotalk_room.cpp
// Function: kakaotalk::room::room(std::istream&)
room::room(std::istream& in) {
    static regex const room_info("(.*) (\\d+?)( 님과)? 카카오톡 대화");
    chat c(in);
    std::smatch m_info;

    if (regex_match(c.content(), m_info, room_info)) {
      name = m_info[1];
      std::cout << "방제: " << name << std::endl;
      nmemb = std::stoi(m_info[2]);
      std::cout << "인원: " << nmemb << std::endl;
    } else {
      throw domain_error("Unexpected File Format(in Heading).");
    }

    while (in >> c) {
      if (c.isextra())
        continue;
      else if (c.istalk())
        // TODO: mem_info가 _nchat과 _nbyte를 갖도록 수정
        // members[c.name()]+=c.message().length(); // 글자 수로 기록
        ++members[c.name()];
      else if (c.isout())
        members[c.name()].out();
      else if (c.isin() && !c.ismyself())
        members[c.name()].in();
    }

    for (auto& each : members) {
      auto& m_name = each.first;
      auto& m_info = each.second;
      if (m_info)
        enrolls.push_back(std::make_pair(m_name, m_info));
    }

    typedef std::pair<std::string, kakaotalk::mem_info> pairtype;
    enrolls.sort([](const pairtype& x, const pairtype& y)
                 { return !(x.second < y.second); }); // 내림차순 정렬
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x9860
movq -0x160(%rbp), %rdi
addq $0x20, %rdi
movq %rdi, -0x168(%rbp)
callq 0x5590
movq -0x160(%rbp), %rdi
addq $0x40, %rdi
movq %rdi, -0x158(%rbp)
callq 0x336d0
cmpb $0x0, 0x1cfa0(%rip)     # 0x4f938
jne 0x329eb
leaq 0x1cf97(%rip), %rdi     # 0x4f938
callq 0x56e0
cmpl $0x0, %eax
je 0x329eb
leaq 0x1cf66(%rip), %rdi     # 0x4f918
leaq 0x3858(%rip), %rsi      # 0x36211
movl $0x10, %edx
callq 0xae50
jmp 0x329c5
leaq -0x27adc(%rip), %rdi    # 0xaef0
leaq 0x1cf45(%rip), %rsi     # 0x4f918
leaq 0x1c9de(%rip), %rdx     # 0x4f3b8
callq 0x53a0
leaq 0x1cf52(%rip), %rdi     # 0x4f938
callq 0x52d0
movq -0x10(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0xa1d0
jmp 0x329fd
leaq -0xb0(%rbp), %rdi
callq 0xaf20
jmp 0x32a0b
leaq -0x90(%rbp), %rdi
callq 0xac70
movq %rax, -0x170(%rbp)
jmp 0x32a20
movq -0x170(%rbp), %rdi
leaq 0x1ceea(%rip), %rdx     # 0x4f918
leaq -0xb0(%rbp), %rsi
xorl %ecx, %ecx
callq 0xaf60
movb %al, -0x171(%rbp)
jmp 0x32a44
movb -0x171(%rbp), %al
testb $0x1, %al
jne 0x32a53
jmp 0x32c2c
leaq -0xb0(%rbp), %rdi
movl $0x1, %esi
callq 0xafc0
movq %rax, -0x180(%rbp)
jmp 0x32a6d
movq -0x180(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
callq 0xb030
jmp 0x32a82
movq -0x160(%rbp), %rdi
addq $0x20, %rdi
leaq -0xd0(%rbp), %rsi
movq %rsi, -0x190(%rbp)
callq 0x5510
movq -0x190(%rbp), %rdi
callq 0x5768
movq 0x1c4f5(%rip), %rdi     # 0x4efa8
leaq 0x3781(%rip), %rsi      # 0x3623b
callq 0x53f0
movq %rax, -0x188(%rbp)
jmp 0x32ac8
movq -0x188(%rbp), %rdi
movq -0x160(%rbp), %rsi
addq $0x20, %rsi
callq 0x53b0
movq %rax, -0x198(%rbp)
jmp 0x32ae8
movq -0x198(%rbp), %rdi
movq 0x1c46a(%rip), %rsi     # 0x4ef60
callq 0x5450
jmp 0x32afd
leaq -0xb0(%rbp), %rdi
movl $0x2, %esi
callq 0xafc0
movq %rax, -0x1a0(%rbp)
jmp 0x32b17
movq -0x1a0(%rbp), %rsi
leaq -0xf0(%rbp), %rdi
callq 0xb030
jmp 0x32b2c
xorl %eax, %eax
movl %eax, %esi
leaq -0xf0(%rbp), %rdi
movl $0xa, %edx
callq 0x336f0
movl %eax, -0x1a4(%rbp)
jmp 0x32b49
movq -0x160(%rbp), %rax
movl -0x1a4(%rbp), %ecx
movslq %ecx, %rcx
movq %rcx, 0x18(%rax)
leaq -0xf0(%rbp), %rdi
callq 0x5768
movq 0x1c438(%rip), %rdi     # 0x4efa8
leaq 0x36cd(%rip), %rsi      # 0x36244
callq 0x53f0
movq %rax, -0x1b0(%rbp)
jmp 0x32b85
movq -0x1b0(%rbp), %rdi
movq -0x160(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x53d0
movq %rax, -0x1b8(%rbp)
jmp 0x32ba5
movq -0x1b8(%rbp), %rdi
movq 0x1c3ad(%rip), %rsi     # 0x4ef60
callq 0x5450
jmp 0x32bba
jmp 0x32c8d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq 0x1cd66(%rip), %rdi     # 0x4f938
callq 0x52b0
jmp 0x32fe9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x32fe9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x32fdd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x32fd1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x5768
jmp 0x32fd1
movl $0x10, %edi
callq 0x51d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x1c0(%rbp)
leaq 0x3603(%rip), %rsi      # 0x3624d
callq 0x52c0
jmp 0x32c51
movq -0x1c0(%rbp), %rdi
movq 0x1c309(%rip), %rsi     # 0x4ef68
movq 0x1c322(%rip), %rdx     # 0x4ef88
callq 0x5660
jmp 0x33016
movq -0x1c0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x5330
jmp 0x32fd1
jmp 0x32c8f
movq -0x10(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xab70
movq %rax, -0x1c8(%rbp)
jmp 0x32ca8
movq -0x1c8(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x5530
movb %al, -0x1c9(%rbp)
jmp 0x32cc6
movb -0x1c9(%rbp), %al
testb $0x1, %al
jne 0x32cd5
jmp 0x32e81
leaq -0x90(%rbp), %rdi
callq 0xac30
movb %al, -0x1ca(%rbp)
jmp 0x32ce9
movb -0x1ca(%rbp), %al
testb $0x1, %al
jne 0x32cf5
jmp 0x32cf7
jmp 0x32c8f
leaq -0x90(%rbp), %rdi
callq 0xac10
movb %al, -0x1cb(%rbp)
jmp 0x32d0b
movb -0x1cb(%rbp), %al
testb $0x1, %al
jne 0x32d17
jmp 0x32d6d
movq -0x160(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x1e0(%rbp)
leaq -0x90(%rbp), %rdi
callq 0xad10
movq %rax, -0x1d8(%rbp)
jmp 0x32d3e
movq -0x1d8(%rbp), %rsi
movq -0x1e0(%rbp), %rdi
callq 0x33730
movq %rax, -0x1e8(%rbp)
jmp 0x32d5a
movq -0x1e8(%rbp), %rdi
callq 0xa120
jmp 0x32d68
jmp 0x32e7a
leaq -0x90(%rbp), %rdi
callq 0xabf0
movb %al, -0x1e9(%rbp)
jmp 0x32d81
movb -0x1e9(%rbp), %al
testb $0x1, %al
jne 0x32d8d
jmp 0x32de3
movq -0x160(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x200(%rbp)
leaq -0x90(%rbp), %rdi
callq 0xad10
movq %rax, -0x1f8(%rbp)
jmp 0x32db4
movq -0x1f8(%rbp), %rsi
movq -0x200(%rbp), %rdi
callq 0x33730
movq %rax, -0x208(%rbp)
jmp 0x32dd0
movq -0x208(%rbp), %rdi
callq 0xa0c0
jmp 0x32dde
jmp 0x32e78
leaq -0x90(%rbp), %rdi
callq 0xabd0
movb %al, -0x209(%rbp)
jmp 0x32df7
movb -0x209(%rbp), %al
testb $0x1, %al
jne 0x32e03
jmp 0x32e76
leaq -0x90(%rbp), %rdi
callq 0xac50
movb %al, -0x20a(%rbp)
jmp 0x32e17
movb -0x20a(%rbp), %al
testb $0x1, %al
jne 0x32e76
jmp 0x32e23
movq -0x160(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x220(%rbp)
leaq -0x90(%rbp), %rdi
callq 0xad10
movq %rax, -0x218(%rbp)
jmp 0x32e4a
movq -0x218(%rbp), %rsi
movq -0x220(%rbp), %rdi
callq 0x33730
movq %rax, -0x228(%rbp)
jmp 0x32e66
movq -0x228(%rbp), %rdi
callq 0xa0a0
jmp 0x32e74
jmp 0x32e76
jmp 0x32e78
jmp 0x32e7a
jmp 0x32e7c
jmp 0x32c8f
movq -0x160(%rbp), %rax
addq $0x40, %rax
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rdi
callq 0x33810
movq %rax, -0x100(%rbp)
movq -0xf8(%rbp), %rdi
callq 0x33840
movq %rax, -0x108(%rbp)
leaq -0x100(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x33870
testb $0x1, %al
jne 0x32ed5
jmp 0x32fa2
leaq -0x100(%rbp), %rdi
callq 0x338a0
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x110(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x120(%rbp)
movq -0x120(%rbp), %rdi
callq 0xa080
movb %al, -0x229(%rbp)
jmp 0x32f1c
movb -0x229(%rbp), %al
testb $0x1, %al
jne 0x32f28
jmp 0x32f8f
movq -0x160(%rbp), %rax
movq %rax, -0x238(%rbp)
movq -0x118(%rbp), %rsi
movq -0x120(%rbp), %rdx
leaq -0x148(%rbp), %rdi
callq 0x33900
jmp 0x32f52
movq -0x238(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x338c0
jmp 0x32f67
leaq -0x148(%rbp), %rdi
callq 0x7200
jmp 0x32f8f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x7200
jmp 0x32fd1
jmp 0x32f91
leaq -0x100(%rbp), %rdi
callq 0x33940
jmp 0x32eb9
movq -0x160(%rbp), %rdi
callq 0x33020
jmp 0x32fb0
leaq -0xb0(%rbp), %rdi
callq 0xb120
leaq -0x90(%rbp), %rdi
callq 0xae10
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
leaq -0xb0(%rbp), %rdi
callq 0xb120
leaq -0x90(%rbp), %rdi
callq 0xae10
movq -0x158(%rbp), %rdi
callq 0x6c70
movq -0x168(%rbp), %rdi
callq 0x5768
movq -0x160(%rbp), %rdi
callq 0x6c90
movq -0x18(%rbp), %rdi
callq 0x56a0
nopw %cs:(%rax,%rax)