// File: /workspace/github_c_makefile_star2_O0/Leeheng86[P]word2vec/word2vec.c
// Function: SortVocab()
void SortVocab() {
  int a, size;
  unsigned int hash;
  // Sort the vocabulary and keep 
 at the first position
  qsort(&vocab[1], vocab_size - 1, sizeof(struct vocab_word), VocabCompare);
  for (a = 0; a < vocab_hash_size; a++) vocab_hash[a] = -1;
  size = vocab_size;
  train_words = 0;
  for (a = 0; a < size; a++) {
    // Words occuring less than min_count times will be discarded from the vocab
    if ((vocab[a].cn < min_count) && (a != 0)) {
      vocab_size--;
      free(vocab[a].word);
    } else {
      // Hash will be re-computed, as after the sorting it is not actual
      hash=GetWordHash(vocab[a].word);
      while (vocab_hash[hash] != -1) hash = (hash + 1) % vocab_hash_size;
      vocab_hash[hash] = a;
      train_words += vocab[a].cn;
    }
  }
  vocab = (struct vocab_word *)realloc(vocab, (vocab_size + 1) * sizeof(struct vocab_word));
  // Allocate memory for the binary tree construction
  for (a = 0; a < vocab_size; a++) {
    vocab[a].code = (char *)calloc(MAX_CODE_LENGTH, sizeof(char));
    vocab[a].point = (int *)calloc(MAX_CODE_LENGTH, sizeof(int));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq 0x108b9(%rip), %rdi     # 0x144f8
addq $0x28, %rdi
movq 0x108c6(%rip), %rsi     # 0x14510
subq $0x1, %rsi
movl $0x28, %edx
leaq -0x4a(%rip), %rcx       # 0x3c10
callq 0x3530
movl $0x0, -0x4(%rbp)
cmpl $0x1c9c380, -0x4(%rbp)  # imm = 0x1C9C380
jge 0x3c8c
movq 0x10892(%rip), %rax     # 0x14508
movslq -0x4(%rbp), %rcx
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x3c66
movq 0x1087d(%rip), %rax     # 0x14510
movl %eax, -0x8(%rbp)
movq $0x0, 0x10877(%rip) # 0x14518
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x3d8f
movq 0x1083d(%rip), %rax     # 0x144f8
movslq -0x4(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq 0x1061c(%rip), %rcx     # 0x142ec
cmpq %rcx, %rax
jge 0x3d0a
cmpl $0x0, -0x4(%rbp)
je 0x3d0a
movq 0x1082e(%rip), %rax     # 0x14510
addq $-0x1, %rax
movq %rax, 0x10823(%rip)     # 0x14510
movq 0x10804(%rip), %rax     # 0x144f8
movslq -0x4(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
callq 0x3340
jmp 0x3d7f
movq 0x107e7(%rip), %rax     # 0x144f8
movslq -0x4(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
callq 0x3970
movl %eax, -0xc(%rbp)
movq 0x107d9(%rip), %rax     # 0x14508
movl -0xc(%rbp), %ecx
cmpl $-0x1, (%rax,%rcx,4)
je 0x3d4c
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl $0x1c9c380, %ecx        # imm = 0x1C9C380
xorl %edx, %edx
divl %ecx
movl %edx, -0xc(%rbp)
jmp 0x3d28
movl -0x4(%rbp), %edx
movq 0x107b2(%rip), %rax     # 0x14508
movl -0xc(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movq 0x10795(%rip), %rax     # 0x144f8
movslq -0x4(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
addq 0x107a0(%rip), %rax     # 0x14518
movq %rax, 0x10799(%rip)     # 0x14518
jmp 0x3d81
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x3ca8
movq 0x10762(%rip), %rdi     # 0x144f8
movq 0x10773(%rip), %rax     # 0x14510
addq $0x1, %rax
imulq $0x28, %rax, %rsi
callq 0x3490
movq %rax, 0x10747(%rip)     # 0x144f8
movl $0x0, -0x4(%rbp)
movslq -0x4(%rbp), %rax
cmpq 0x1074d(%rip), %rax     # 0x14510
jge 0x3e20
movl $0x28, %edi
movl $0x1, %esi
callq 0x31b0
movq %rax, %rcx
movq 0x1071a(%rip), %rax     # 0x144f8
movslq -0x4(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x18(%rax)
movl $0x28, %edi
movl $0x4, %esi
callq 0x31b0
movq %rax, %rcx
movq 0x106f2(%rip), %rax     # 0x144f8
movslq -0x4(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x3db8
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)