// File: /workspace/github_cpp_makefile_star2_O3/ddu1[P]polarizedtext/src/dictionary.cc
// Function: fasttext::Dictionary::add(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Dictionary::add(const std::string& w) {
  int32_t h = find(w);
  ntokens_++;

  if (word2int_[h] == -1) {
    entry e;
    e.word = w;
    e.count = 1;

    if( w.find(args_->label) == 0) {
        cur_label_ = w;
        e.type = entry_type::label;
        e.nlabels = 1;
        e.labels.push_back(w);
    }
    else {
        e.type = entry_type::word;
        e.nlabels = 1;
        e.labels.push_back(cur_label_);
    }
    words_.push_back(e);
    word2int_[h] = size_++;
  } else {
    auto e = words_[word2int_[h]];
    if( e.type == entry_type::label ) {
      cur_label_ = e.word;
    }
    else if( std::find( e.labels.begin(), e.labels.end(), cur_label_) == e.labels.end() ) {
        words_[word2int_[h]].labels.push_back(cur_label_);
        ++(words_[word2int_[h]].nlabels);
    }
    words_[word2int_[h]].count++;
  }


}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x4a2e
incq 0x68(%rbx)
movl %eax, %r13d
movq 0x10(%rbx), %rax
movslq (%rax,%r13,4), %rax
cmpq $-0x1, %rax
je 0x4bd5
movq 0x28(%rbx), %r15
imulq $0x68, %rax, %rbp
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
leaq (%r15,%rbp), %r14
addq $0x30, %r14
movq -0x30(%r14), %rsi
movq -0x28(%r14), %rdx
addq %rsi, %rdx
movq %rsp, %r12
movq %r12, %rdi
callq 0x78a2
movb -0x8(%r14), %al
movb %al, 0x28(%r12)
movq -0x10(%r14), %rax
movq %rax, 0x20(%r12)
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0x76d2
addq %rbp, %r15
movb 0x48(%r15), %al
leaq 0x50(%rsp), %r14
movb %al, -0x8(%r14)
addq $0x50, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x75ea
cmpb $0x1, 0x28(%rsp)
jne 0x4c4f
leaq 0x70(%rbx), %rdi
movq %rsp, %rsi
callq 0x3140
movq 0x10(%rbx), %rdx
movq 0x28(%rbx), %rcx
jmp 0x4ca0
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
xorl %eax, %eax
movq %rax, -0x8(%r12)
movb $0x0, (%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%r12)
movq %rax, 0x30(%r12)
movups %xmm0, 0x40(%r12)
movq %rax, 0x50(%r12)
movq %rsp, %rdi
movq %r14, %rsi
callq 0x3140
movq $0x1, 0x20(%rsp)
movq (%rbx), %rax
movq 0xa8(%rax), %rsi
movq 0xb0(%rax), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x3440
testq %rax, %rax
je 0x4cf6
movb $0x0, 0x28(%rsp)
movb $0x1, 0x48(%rsp)
leaq 0x70(%rbx), %r14
jmp 0x4d0c
movq 0x50(%rsp), %rdi
movq 0x58(%rsp), %rsi
leaq 0x70(%rbx), %r15
movq %r15, %rdx
callq 0x810f
movq 0x10(%rbx), %rdx
movq 0x28(%rbx), %rcx
cmpq 0x58(%rsp), %rax
jne 0x4ca0
movslq (%rdx,%r13,4), %rax
imulq $0x68, %rax, %rax
leaq (%rcx,%rax), %rdi
addq $0x50, %rdi
movq %r15, %rsi
callq 0x7546
movq 0x10(%rbx), %rdx
movq 0x28(%rbx), %rcx
movslq (%rdx,%r13,4), %rax
imulq $0x68, %rax, %rax
incb 0x48(%rcx,%rax)
movslq (%rdx,%r13,4), %rax
imulq $0x68, %rax, %rax
incq 0x20(%rcx,%rax)
movq %r14, %rdi
callq 0x7674
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x4ccc
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x3260
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x4ce7
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3260
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x70(%rbx), %rdi
movq %r14, %rsi
callq 0x3140
movb $0x1, %al
movb %al, 0x28(%rsp)
movb %al, 0x48(%rsp)
leaq 0x50(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x7546
leaq 0x28(%rbx), %rdi
movq %rsp, %rsi
callq 0x7584
movl 0x58(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x58(%rbx)
movq 0x10(%rbx), %rcx
movl %eax, (%rcx,%r13,4)
movq %r15, %rdi
callq 0x7674
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x4d58
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x3260
movq (%rsp), %rdi
cmpq %r12, %rdi
jne 0x4cda
jmp 0x4ce7
jmp 0x4da7
jmp 0x4da7
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x4d8a
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x3260
jmp 0x4d8a
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x4db2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x4db2
movq %rax, %rbx
movq %rsp, %rdi
callq 0x75ae
movq %rbx, %rdi
callq 0x3450