// File: /workspace/github_cpp_makefile_star2_O2/murry2018[P]mogazi/kakaotalk_chat.cpp
// Function: kakaotalk::chat::analyse()
void chat::analyse() {
    static const regex pattern_common("\
^(\\d+)년 (\\d+)월 (\\d+)일 (오전|오후) (\\d+):(\\d+), ((?:.|\\n)*)");
    static const regex pattern_in("(?:([^:]*)님이 들어왔습니다\\.((?:.|\\n)*)|(?:[^:]*)님이 ([^:]*)님을 초대했습니다\\.)");
    static const regex pattern_out("([^:]*)님(이 나갔습니다|을 내보냈습니다)\\.");
    static const regex pattern_talk("(?:([^:]*) : ?)((?:.|\\n)*)");
    static const string pattern_extra1("삭제된 메시지입니다.");
    static const string pattern_extra2("채팅방 관리자가 메시지를 가렸습니다.");
    
    std::smatch m_common;
    if (regex_match(full_content, m_common, pattern_common)) {
      string chat_content = m_common[7];
      std::smatch m_content;
      if (regex_match(chat_content, m_content, pattern_talk)) {
        /* 떠드는 패턴인 경우: 

           '2019년 5월 27일 오전 12:22, 악성유저 : 악성유저님이 나갔습니다.'

           이와 같은 특수 케이스로부터 방어하기 위해 떠드는 패턴을
           우선적으로 체크한다. */
        type = chat::TALK;
        _name = m_content[1], _content = m_content[2];
      } else if (regex_match(chat_content, m_content, pattern_in)) {
        // 들어온 패턴인 경우 (나가는 패턴과의 확인 순서는 중요치 않다)
        type = chat::IN;
        _name = m_content[1];
        if (m_content[2] != "") {
          /* 들어온 사람이 자기자신인지 확인: 자기 자신은 들어올땐
             이름으로 표시되고 떠들땐 회원님이라 표시되기 때문에 이를
             구분해주지 않으면 가만히 있는 사람 한명이 더 생긴다. */
          _myself = true;
        } else {
          _myself = false;
        }
      } else if (regex_match(chat_content, m_content, pattern_out)) {
        // 나가는 패턴인 경우
        type = chat::OUT;
        _name = m_content[1];
      } else if (chat_content == pattern_extra1
                 || chat_content == pattern_extra2) {
        type = chat::EXTRA;
      } else {
        // '2019년 5월 27일 오전 12:22, 이런시발' 과 같은 잘못된 형식인 경우
        std::cout << chat_content << std::endl;
        throw runtime_error("Unexpected Chat Pattern");
      }
    } else {
      /* 채팅 내용이 아닌 패턴 */
      type = chat::EXTRA;
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rbx
movb 0x19b01(%rip), %al      # 0x1f6f0
testb %al, %al
je 0x5f29
movb 0x19b1b(%rip), %al      # 0x1f718
testb %al, %al
je 0x5f7e
movb 0x19b35(%rip), %al      # 0x1f740
testb %al, %al
je 0x5fd3
movb 0x19b4f(%rip), %al      # 0x1f768
testb %al, %al
je 0x6028
movb 0x19b69(%rip), %al      # 0x1f790
testb %al, %al
je 0x607d
movb 0x19b83(%rip), %al      # 0x1f7b8
testb %al, %al
je 0x60d6
xorps %xmm0, %xmm0
leaq -0xa0(%rbp), %rsi
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
leaq 0x19a7b(%rip), %rdx     # 0x1f6d0
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x6468
testb %al, %al
je 0x5c95
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rcx
pushq $0x18
popq %r15
subq %rsi, %rcx
je 0x5ca1
movq %rcx, %rax
cqto
idivq %r15
addq $-0xb, %rax
cmpq $-0x9, %rax
ja 0x5ca1
addq $0xa8, %rsi
jmp 0x5ca8
movl $0x3, 0x20(%rbx)
jmp 0x5de1
addq %rcx, %rsi
addq $-0x48, %rsi
leaq -0x60(%rbp), %rdi
callq 0x12544
xorps %xmm0, %xmm0
leaq -0x40(%rbp), %rsi
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
leaq 0x19a82(%rip), %rdx     # 0x1f748
leaq -0x60(%rbp), %rdi
xorl %ecx, %ecx
callq 0x6468
testb %al, %al
je 0x5d01
movl $0x2, 0x20(%rbx)
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rcx
subq %rsi, %rcx
je 0x5d53
movq %rcx, %rax
cqto
idivq %r15
addq $-0x5, %rax
cmpq $-0x3, %rax
ja 0x5d53
addq $0x18, %rsi
jmp 0x5d5a
leaq 0x199f0(%rip), %rdx     # 0x1f6f8
leaq -0x60(%rbp), %rdi
leaq -0x40(%rbp), %rsi
xorl %ecx, %ecx
callq 0x6468
testb %al, %al
je 0x5dfb
andl $0x0, 0x20(%rbx)
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rcx
subq %rsi, %rcx
je 0x5e50
movq %rcx, %rax
cqto
idivq %r15
addq $-0x5, %rax
cmpq $-0x3, %rax
ja 0x5e50
addq $0x18, %rsi
jmp 0x5e57
addq %rcx, %rsi
addq $-0x48, %rsi
leaq -0x80(%rbp), %rdi
callq 0x12544
leaq 0x48(%rbx), %rdi
leaq -0x80(%rbp), %rsi
callq 0x43a0
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rcx
subq %rsi, %rcx
je 0x5d95
movq %rcx, %rax
cqto
idivq %r15
addq $-0x6, %rax
cmpq $-0x4, %rax
ja 0x5d95
addq $0x30, %rsi
jmp 0x5d9c
addq %rcx, %rsi
addq $-0x48, %rsi
leaq -0xc0(%rbp), %rdi
callq 0x12544
addq $0x28, %rbx
leaq -0xc0(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x43a0
movq %r14, %rdi
callq 0x4538
leaq -0x80(%rbp), %rdi
callq 0x4538
leaq -0x40(%rbp), %rdi
callq 0x64c2
leaq -0x60(%rbp), %rdi
callq 0x4538
leaq -0xa0(%rbp), %rdi
callq 0x64c2
addq $0xa8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1991e(%rip), %rdx     # 0x1f720
leaq -0x60(%rbp), %rdi
leaq -0x40(%rbp), %rsi
xorl %ecx, %ecx
callq 0x6468
testb %al, %al
je 0x5ebd
movl $0x1, 0x20(%rbx)
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rcx
subq %rsi, %rcx
je 0x5efe
movq %rcx, %rax
cqto
idivq %r15
addq $-0x5, %rax
cmpq $-0x3, %rax
ja 0x5efe
addq $0x18, %rsi
jmp 0x5f05
addq %rcx, %rsi
addq $-0x48, %rsi
leaq -0x80(%rbp), %rdi
callq 0x12544
leaq 0x48(%rbx), %rdi
leaq -0x80(%rbp), %r14
movq %r14, %rsi
callq 0x43a0
movq %r14, %rdi
callq 0x4538
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rcx
subq %rdi, %rcx
je 0x5e9d
movq %rcx, %rax
cqto
idivq %r15
addq $-0x6, %rax
cmpq $-0x4, %rax
ja 0x5e9d
addq $0x30, %rdi
jmp 0x5ea4
addq %rcx, %rdi
addq $-0x48, %rdi
leaq 0xe536(%rip), %rsi      # 0x143e1
callq 0x6488
testb %al, %al
je 0x5ef5
movb $0x1, 0x68(%rbx)
jmp 0x5dcf
leaq 0x198ac(%rip), %rsi     # 0x1f770
leaq -0x60(%rbp), %rdi
callq 0x6495
testb %al, %al
jne 0x5ee9
leaq 0x198c0(%rip), %rsi     # 0x1f798
leaq -0x60(%rbp), %rdi
callq 0x6495
testb %al, %al
je 0x612f
movl $0x3, 0x20(%rbx)
jmp 0x5dcf
movb $0x0, 0x68(%rbx)
jmp 0x5dcf
addq %rcx, %rsi
addq $-0x48, %rsi
leaq -0x80(%rbp), %rdi
callq 0x12544
addq $0x48, %rbx
leaq -0x80(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x43a0
movq %r14, %rdi
jmp 0x5dca
leaq 0x197c0(%rip), %rdi     # 0x1f6f0
callq 0x44e0
testl %eax, %eax
je 0x5bf7
leaq 0x1978c(%rip), %rdi     # 0x1f6d0
leaq 0xe2a0(%rip), %rsi      # 0x141eb
pushq $0x10
popq %rdx
callq 0x63da
leaq 0x4ea(%rip), %rdi       # 0x6444
leaq 0x1976f(%rip), %rsi     # 0x1f6d0
leaq 0x19340(%rip), %rdx     # 0x1f2a8
callq 0x42a0
leaq 0x1977c(%rip), %rdi     # 0x1f6f0
callq 0x4210
jmp 0x5bf7
leaq 0x19793(%rip), %rdi     # 0x1f718
callq 0x44e0
testl %eax, %eax
je 0x5c05
leaq 0x1975f(%rip), %rdi     # 0x1f6f8
leaq 0xe290(%rip), %rsi      # 0x14230
pushq $0x10
popq %rdx
callq 0x63da
leaq 0x495(%rip), %rdi       # 0x6444
leaq 0x19742(%rip), %rsi     # 0x1f6f8
leaq 0x192eb(%rip), %rdx     # 0x1f2a8
callq 0x42a0
leaq 0x1974f(%rip), %rdi     # 0x1f718
callq 0x4210
jmp 0x5c05
leaq 0x19766(%rip), %rdi     # 0x1f740
callq 0x44e0
testl %eax, %eax
je 0x5c13
leaq 0x19732(%rip), %rdi     # 0x1f720
leaq 0xe2a0(%rip), %rsi      # 0x14295
pushq $0x10
popq %rdx
callq 0x63da
leaq 0x440(%rip), %rdi       # 0x6444
leaq 0x19715(%rip), %rsi     # 0x1f720
leaq 0x19296(%rip), %rdx     # 0x1f2a8
callq 0x42a0
leaq 0x19722(%rip), %rdi     # 0x1f740
callq 0x4210
jmp 0x5c13
leaq 0x19739(%rip), %rdi     # 0x1f768
callq 0x44e0
testl %eax, %eax
je 0x5c21
leaq 0x19705(%rip), %rdi     # 0x1f748
leaq 0xe284(%rip), %rsi      # 0x142ce
pushq $0x10
popq %rdx
callq 0x63da
leaq 0x3eb(%rip), %rdi       # 0x6444
leaq 0x196e8(%rip), %rsi     # 0x1f748
leaq 0x19241(%rip), %rdx     # 0x1f2a8
callq 0x42a0
leaq 0x196f5(%rip), %rdi     # 0x1f768
callq 0x4210
jmp 0x5c21
leaq 0x1970c(%rip), %rdi     # 0x1f790
callq 0x44e0
testl %eax, %eax
je 0x5c2f
leaq 0x196d8(%rip), %rdi     # 0x1f770
leaq 0xe24a(%rip), %rsi      # 0x142e9
leaq -0xa0(%rbp), %rdx
callq 0x4c22
movq 0x18ebe(%rip), %rdi     # 0x1ef70
leaq 0x196b7(%rip), %rsi     # 0x1f770
leaq 0x191e8(%rip), %rdx     # 0x1f2a8
callq 0x42a0
leaq 0x196c4(%rip), %rdi     # 0x1f790
callq 0x4210
jmp 0x5c2f
leaq 0x196db(%rip), %rdi     # 0x1f7b8
callq 0x44e0
testl %eax, %eax
je 0x5c3d
leaq 0x196a7(%rip), %rdi     # 0x1f798
leaq 0xe20f(%rip), %rsi      # 0x14307
leaq -0xa0(%rbp), %rdx
callq 0x4c22
movq 0x18e65(%rip), %rdi     # 0x1ef70
leaq 0x19686(%rip), %rsi     # 0x1f798
leaq 0x1918f(%rip), %rdx     # 0x1f2a8
callq 0x42a0
leaq 0x19693(%rip), %rdi     # 0x1f7b8
callq 0x4210
jmp 0x5c3d
movq 0x18e7a(%rip), %rdi     # 0x1efb0
leaq -0x60(%rbp), %rsi
callq 0x42b0
movq %rax, %rdi
callq 0x4160
pushq $0x10
popq %rdi
callq 0x4170
movq %rax, %r14
leaq 0xe1e3(%rip), %rsi      # 0x1433c
movq %rax, %rdi
callq 0x4100
movq 0x18e88(%rip), %rsi     # 0x1eff0
movq 0x18e29(%rip), %rdx     # 0x1ef98
movq %r14, %rdi
callq 0x4480
movq %rax, %rbx
leaq 0x19637(%rip), %rdi     # 0x1f7b8
jmp 0x61bd
movq %rax, %rbx
leaq 0x19603(%rip), %rdi     # 0x1f790
jmp 0x61bd
movq %rax, %rbx
leaq 0x195cf(%rip), %rdi     # 0x1f768
jmp 0x61bd
movq %rax, %rbx
leaq 0x1959b(%rip), %rdi     # 0x1f740
jmp 0x61bd
movq %rax, %rbx
leaq 0x19567(%rip), %rdi     # 0x1f718
jmp 0x61bd
movq %rax, %rbx
leaq 0x19533(%rip), %rdi     # 0x1f6f0
callq 0x41f0
jmp 0x620d
movq %rax, %rbx
movq %r14, %rdi
callq 0x4260
jmp 0x61ef
jmp 0x61ec
jmp 0x61ec
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x4538
jmp 0x61ef
jmp 0x61ec
jmp 0x61e7
movq %rax, %rbx
jmp 0x6201
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x64c2
leaq -0x60(%rbp), %rdi
callq 0x4538
leaq -0xa0(%rbp), %rdi
callq 0x64c2
movq %rbx, %rdi
callq 0x44b0