// File: 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
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x120(%rbp)
movq -0x10(%rbp), %rsi
callq 0x66c0
movq -0x120(%rbp), %rdi
movl %eax, -0x14(%rbp)
movq 0x68(%rdi), %rax
addq $0x1, %rax
movq %rax, 0x68(%rdi)
addq $0x10, %rdi
movslq -0x14(%rbp), %rsi
callq 0x9f60
cmpl $-0x1, (%rax)
jne 0x6962
leaq -0x80(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0xa130
movq -0x128(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4050
jmp 0x6865
movq -0x120(%rbp), %rdi
movq $0x1, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x130(%rbp)
callq 0xa170
movq -0x130(%rbp), %rdi
movq %rax, %rsi
addq $0xa8, %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x4670
cmpq $0x0, %rax
jne 0x68f3
movq -0x120(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x70, %rdi
callq 0x4050
jmp 0x68ba
movb $0x1, -0x58(%rbp)
movb $0x1, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xa190
jmp 0x68d1
jmp 0x6913
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0xa270
jmp 0x6b59
movq -0x120(%rbp), %rsi
movb $0x0, -0x58(%rbp)
movb $0x1, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
addq $0x70, %rsi
callq 0xa190
jmp 0x6911
jmp 0x6913
movq -0x120(%rbp), %rdi
addq $0x28, %rdi
leaq -0x80(%rbp), %rsi
callq 0xa200
jmp 0x6929
movq -0x120(%rbp), %rdi
movl 0x58(%rdi), %eax
movl %eax, -0x134(%rbp)
addl $0x1, %eax
movl %eax, 0x58(%rdi)
addq $0x10, %rdi
movslq -0x14(%rbp), %rsi
callq 0x9f60
movl -0x134(%rbp), %ecx
movl %ecx, (%rax)
leaq -0x80(%rbp), %rdi
callq 0xa270
jmp 0x6b50
movq -0x120(%rbp), %rdi
movq %rdi, %rax
addq $0x28, %rax
movq %rax, -0x140(%rbp)
addq $0x10, %rdi
movslq -0x14(%rbp), %rsi
callq 0x9f60
movq -0x140(%rbp), %rdi
movslq (%rax), %rsi
callq 0xa2b0
movq %rax, %rsi
leaq -0xf8(%rbp), %rdi
callq 0xa2d0
cmpb $0x1, -0xd0(%rbp)
jne 0x69ec
movq -0x120(%rbp), %rdi
addq $0x70, %rdi
leaq -0xf8(%rbp), %rsi
callq 0x4050
jmp 0x69c4
jmp 0x6b07
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0xa270
jmp 0x6b59
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0xa420
movq -0x150(%rbp), %rdi
movq %rax, -0x108(%rbp)
callq 0xa450
movq -0x120(%rbp), %rdx
movq %rax, -0x110(%rbp)
addq $0x70, %rdx
movq -0x108(%rbp), %rdi
movq -0x110(%rbp), %rsi
callq 0xa3d0
movq %rax, -0x148(%rbp)
jmp 0x6a40
movq -0x148(%rbp), %rax
movq %rax, -0x100(%rbp)
leaq -0xf8(%rbp), %rdi
addq $0x50, %rdi
callq 0xa450
movq %rax, -0x118(%rbp)
leaq -0x100(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0xa390
testb $0x1, %al
jne 0x6a81
jmp 0x6b05
movq -0x120(%rbp), %rdi
movq %rdi, %rax
addq $0x28, %rax
movq %rax, -0x158(%rbp)
addq $0x10, %rdi
movslq -0x14(%rbp), %rsi
callq 0x9f60
movq -0x158(%rbp), %rdi
movslq (%rax), %rsi
callq 0xa2b0
movq -0x120(%rbp), %rsi
movq %rax, %rdi
addq $0x50, %rdi
addq $0x70, %rsi
callq 0xa190
jmp 0x6acb
movq -0x120(%rbp), %rdi
movq %rdi, %rax
addq $0x28, %rax
movq %rax, -0x160(%rbp)
addq $0x10, %rdi
movslq -0x14(%rbp), %rsi
callq 0x9f60
movq -0x160(%rbp), %rdi
movslq (%rax), %rsi
callq 0xa2b0
movb 0x48(%rax), %cl
addb $0x1, %cl
movb %cl, 0x48(%rax)
jmp 0x6b07
movq -0x120(%rbp), %rdi
movq %rdi, %rax
addq $0x28, %rax
movq %rax, -0x168(%rbp)
addq $0x10, %rdi
movslq -0x14(%rbp), %rsi
callq 0x9f60
movq -0x168(%rbp), %rdi
movslq (%rax), %rsi
callq 0xa2b0
movq 0x20(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rax)
leaq -0xf8(%rbp), %rdi
callq 0xa270
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
movq -0x88(%rbp), %rdi
callq 0x45b0
nopw %cs:(%rax,%rax)