// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x6c8, %rsp            # imm = 0x6C8
movq %rdi, %rbx
movq %rdi, 0x8(%rdi)
movq %rdi, (%rdi)
andq $0x0, 0x10(%rdi)
movq %rsi, %r12
leaq 0x30(%rdi), %rax
movq %rax, 0x20(%rdi)
andq $0x0, 0x28(%rdi)
movb $0x0, 0x30(%rdi)
leaq 0x48(%rdi), %r15
andl $0x0, 0x48(%rdi)
andq $0x0, 0x50(%rdi)
movq %r15, 0x58(%rdi)
movq %r15, 0x60(%rdi)
andq $0x0, 0x68(%rdi)
leaq 0x20(%rdi), %r13
leaq 0x40(%rdi), %rax
movq %rax, -0x38(%rbp)
movb 0xd0e5(%rip), %al       # 0x1f828
testb %al, %al
je 0x12ad6
leaq -0xe8(%rbp), %rdi
movq %r12, %rsi
callq 0x5a58
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movaps %xmm0, -0x60(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x62ac
leaq 0xd090(%rip), %rdx      # 0x1f808
leaq -0x60(%rbp), %rsi
movq %rax, %rdi
xorl %ecx, %ecx
callq 0x6468
testb %al, %al
je 0x12b2b
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rcx
pushq $0x18
popq %rdi
subq %rsi, %rcx
je 0x127b6
movq %rcx, %rax
cqto
idivq %rdi
addq $-0x5, %rax
cmpq $-0x3, %rax
ja 0x127b6
addq $0x18, %rsi
jmp 0x127bd
addq %rcx, %rsi
addq $-0x48, %rsi
leaq -0x6f0(%rbp), %rdi
callq 0x12544
leaq -0x6f0(%rbp), %r14
movq %r13, %rdi
movq %r14, %rsi
callq 0x43a0
movq %r14, %rdi
callq 0x4538
movq 0xc7c6(%rip), %rdi      # 0x1efb0
leaq 0x29ca(%rip), %rsi      # 0x151bb
callq 0x42d0
pushq $0x18
popq %r14
movq %rax, %rdi
movq %r13, %rsi
callq 0x42b0
movq %rax, %rdi
callq 0x4160
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rcx
subq %rsi, %rcx
je 0x12832
movq %rcx, %rax
cqto
idivq %r14
addq $-0x6, %rax
cmpq $-0x4, %rax
ja 0x12832
addq $0x30, %rsi
jmp 0x12839
addq %rcx, %rsi
addq $-0x48, %rsi
leaq -0x6f0(%rbp), %rdi
callq 0x12544
leaq -0x6f0(%rbp), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x12d4c
cltq
movq %rax, 0x18(%rbx)
leaq -0x6f0(%rbp), %rdi
callq 0x4538
movq 0xc741(%rip), %rdi      # 0x1efb0
leaq 0x294e(%rip), %rsi      # 0x151c4
callq 0x42d0
movq 0x18(%rbx), %rsi
movq %rax, %rdi
callq 0x4220
movq %rax, %rdi
callq 0x4160
movq %r13, -0x30(%rbp)
leaq -0xe8(%rbp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x6215
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x12958
movq %r13, %rdi
callq 0x6294
testb %al, %al
jne 0x1289a
movq %r13, %rdi
callq 0x6286
testb %al, %al
je 0x128ed
movq %r13, %rdi
callq 0x6312
movq -0x38(%rbp), %rdi
movq %rax, %rsi
callq 0x12d6e
movq %rax, %rdi
callq 0x59ee
jmp 0x1289a
movq %r13, %rdi
callq 0x6278
testb %al, %al
je 0x12917
movq %r13, %rdi
callq 0x6312
movq -0x38(%rbp), %rdi
movq %rax, %rsi
callq 0x12d6e
movq %rax, %rdi
callq 0x59d0
jmp 0x1289a
movq %r13, %rdi
callq 0x626a
testb %al, %al
je 0x1289a
movq %r13, %rdi
callq 0x62a2
testb %al, %al
jne 0x1289a
movq %r13, %rdi
callq 0x6312
movq -0x38(%rbp), %rdi
movq %rax, %rsi
callq 0x12d6e
movq %rax, %rdi
callq 0x59c6
jmp 0x1289a
movq 0x58(%rbx), %r14
leaq -0x6f0(%rbp), %r12
cmpq %r15, %r14
je 0x129a7
leaq 0x40(%r14), %r13
movq %r13, %rdi
callq 0x59be
testb %al, %al
je 0x1299a
leaq 0x20(%r14), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x12ebe
movq %rbx, %rdi
movq %r12, %rsi
callq 0x12dd8
movq %r12, %rdi
callq 0x4538
movq %r14, %rdi
callq 0x4230
movq %rax, %r14
jmp 0x12963
movq (%rbx), %rcx
cmpq %rbx, %rcx
je 0x12aaf
cmpq %rbx, (%rcx)
je 0x12aaf
leaq -0x78(%rbp), %rax
movq %rax, 0x8(%rax)
movq %rax, (%rax)
andq $0x0, 0x10(%rax)
xorl %eax, %eax
leaq (%rax,%rbp), %rdx
addq $-0x6f0, %rdx           # imm = 0xF910
movq %rdx, 0x8(%rdx)
movq %rdx, (%rdx)
andq $0x0, 0x10(%rdx)
addq $0x18, %rax
cmpq $0x600, %rax            # imm = 0x600
jne 0x129ce
leaq -0x78(%rbp), %r14
movq %r12, %r15
movq -0x78(%rbp), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x5922
leaq -0x6f0(%rbp), %r13
cmpq %r15, %r13
je 0x12a35
cmpq (%r13), %r13
je 0x12a3e
movq %r13, %rdi
movq %r14, %rsi
callq 0x12c8e
movq %r14, %rdi
movq %r13, %rsi
callq 0x58fa
addq $0x18, %r13
jmp 0x12a0e
movq %r15, %rsi
pushq $0x18
popq %r12
jmp 0x12a44
movq %r13, %rsi
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x58fa
addq %r15, %r12
movq (%rbx), %rcx
cmpq %rbx, %rcx
jne 0x129f5
leaq -0x6f0(%rbp), %rsi
leaq 0x18(%rsi), %r14
cmpq %r12, %r14
je 0x12a74
movq %r14, %rdi
callq 0x12c8e
movq %r14, %rsi
jmp 0x12a5e
leaq -0x18(%r15), %rsi
cmpq %r15, %r13
cmoveq %r15, %rsi
movq %rbx, %rdi
callq 0x58fa
movl $0x5e8, %ebx            # imm = 0x5E8
leaq (%rbx,%rbp), %rdi
addq $-0x6f0, %rdi           # imm = 0xF910
callq 0x4d7a
addq $-0x18, %rbx
cmpq $-0x18, %rbx
jne 0x12a8c
leaq -0x78(%rbp), %rdi
callq 0x4d7a
leaq -0x60(%rbp), %rdi
callq 0x64c2
leaq -0xe8(%rbp), %rdi
callq 0x63b0
addq $0x6c8, %rsp            # imm = 0x6C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xcd4b(%rip), %rdi      # 0x1f828
callq 0x44e0
testl %eax, %eax
je 0x1274b
leaq 0xcd17(%rip), %rdi      # 0x1f808
leaq 0x2699(%rip), %rsi      # 0x15191
pushq $0x10
popq %rdx
callq 0x63da
leaq -0xc6c3(%rip), %rdi     # 0x6444
leaq 0xccfa(%rip), %rsi      # 0x1f808
leaq 0xc793(%rip), %rdx      # 0x1f2a8
callq 0x42a0
leaq 0xcd07(%rip), %rdi      # 0x1f828
callq 0x4210
jmp 0x1274b
pushq $0x10
popq %rdi
callq 0x4170
movq %rax, %r14
leaq 0x2690(%rip), %rsi      # 0x151cd
movq %rax, %rdi
callq 0x4200
movq 0xc42c(%rip), %rsi      # 0x1ef78
movq 0xc43d(%rip), %rdx      # 0x1ef90
movq %r14, %rdi
callq 0x4480
movq %rax, %r12
leaq 0xccc3(%rip), %rdi      # 0x1f828
callq 0x41f0
jmp 0x12c51
movq %rax, %r12
movq %r14, %rdi
callq 0x4260
jmp 0x12c3c
movq %rax, %r12
leaq -0x6f0(%rbp), %rdi
callq 0x4538
jmp 0x12c3c
jmp 0x12b9f
jmp 0x12b9f
movq %rax, %r12
jmp 0x12c51
movq %rax, %r12
jmp 0x12c3c
jmp 0x12bc3
jmp 0x12bbe
movq %rax, %r12
leaq -0x6f0(%rbp), %rdi
callq 0x4538
jmp 0x12c38
jmp 0x12bbe
movq %rax, %r12
jmp 0x12c38
movq %rax, %rdi
callq 0x4110
leaq -0x78(%rbp), %rdx
movq %rbx, %rdi
movq %rbx, %rsi
callq 0x133f4
xorl %r14d, %r14d
cmpq $0x600, %r14            # imm = 0x600
je 0x12c02
leaq (%r14,%rbp), %rdx
addq $-0x6f0, %rdx           # imm = 0xF910
movq %rbx, %rdi
movq %rbx, %rsi
callq 0x133f4
addq $0x18, %r14
jmp 0x12bdd
callq 0x4430
movq %rax, %r12
callq 0x4460
movl $0x5e8, %r14d           # imm = 0x5E8
leaq (%r14,%rbp), %rdi
addq $-0x6f0, %rdi           # imm = 0xF910
callq 0x4d7a
addq $-0x18, %r14
cmpq $-0x18, %r14
jne 0x12c15
leaq -0x78(%rbp), %rdi
callq 0x4d7a
movq -0x30(%rbp), %r13
leaq -0x60(%rbp), %rdi
callq 0x64c2
leaq -0xe8(%rbp), %rdi
callq 0x63b0
movq -0x38(%rbp), %rdi
callq 0x4cf0
movq %r13, %rdi
callq 0x4538
movq %rbx, %rdi
callq 0x4d7a
movq %r12, %rdi
callq 0x44b0
movq %rax, %rdi
callq 0x4d48