// File: /workspace/github_c_makefile_star2_O0/Leeheng86[P]word2vec/word2vec.c
// Function: LearnVocabFromTrainFile()
void LearnVocabFromTrainFile() {
  char word[MAX_STRING];
  FILE *fin;
  long long a, i;
  for (a = 0; a < vocab_hash_size; a++) vocab_hash[a] = -1;
  fin = fopen(train_file, "rb");
  if (fin == NULL) {
    printf("ERROR: training data file not found!\n");
    exit(1);
  }
  vocab_size = 0;
  AddWordToVocab((char *)"
");
  while (1) {
    ReadWord(word, fin);
    if (feof(fin)) break;
    train_words++;
    if ((debug_mode > 1) && (train_words % 100000 == 0)) {
      printf("%lldK%c", train_words / 1000, 13);
      fflush(stdout);
    }
    i = SearchVocab(word);
    if (i == -1) {
      a = AddWordToVocab(word);
      vocab[a].cn = 1;
    } else vocab[i].cn++;
    if (vocab_size > vocab_hash_size * 0.7) ReduceVocab();
  }
  SortVocab();
  if (debug_mode > 0) {
    printf("Vocab size: %lld\n", vocab_size);
    printf("Words in train file: %lld\n", train_words);
  }
  file_size = ftell(fin);
  fclose(fin);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq $0x0, -0x80(%rbp)
cmpq $0x1c9c380, -0x80(%rbp) # imm = 0x1C9C380
jge 0x442d
movq 0x100f4(%rip), %rax     # 0x14508
movq -0x80(%rbp), %rcx
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x4403
leaq 0xff0c(%rip), %rdi      # 0x14340
leaq 0x9c26(%rip), %rsi      # 0xe061
callq 0x3330
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x78(%rbp)
jne 0x4463
leaq 0x9c12(%rip), %rdi      # 0xe064
movb $0x0, %al
callq 0x3060
movl $0x1, %edi
callq 0x3350
movq $0x0, 0x100a2(%rip) # 0x14510
leaq 0x9be7(%rip), %rdi      # 0xe05c
callq 0x3ad0
leaq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x38a0
movq -0x78(%rbp), %rdi
callq 0x3430
cmpl $0x0, %eax
je 0x449a
jmp 0x4582
movq 0x10077(%rip), %rax     # 0x14518
addq $0x1, %rax
movq %rax, 0x1006c(%rip)     # 0x14518
cmpl $0x1, 0xfe31(%rip)      # 0x142e4
jle 0x4502
movq 0x1005c(%rip), %rax     # 0x14518
movl $0x186a0, %ecx          # imm = 0x186A0
cqto
idivq %rcx
cmpq $0x0, %rdx
jne 0x4502
movq 0x10045(%rip), %rax     # 0x14518
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
movq %rax, %rsi
leaq 0x9ba3(%rip), %rdi      # 0xe08a
movl $0xd, %edx
movb $0x0, %al
callq 0x3060
movq 0xfad6(%rip), %rax      # 0x13fd0
movq (%rax), %rdi
callq 0x3320
leaq -0x70(%rbp), %rdi
callq 0x39f0
cltq
movq %rax, -0x88(%rbp)
cmpq $-0x1, -0x88(%rbp)
jne 0x4545
leaq -0x70(%rbp), %rdi
callq 0x3ad0
cltq
movq %rax, -0x80(%rbp)
movq 0xffc4(%rip), %rax      # 0x144f8
imulq $0x28, -0x80(%rbp), %rcx
addq %rcx, %rax
movq $0x1, (%rax)
jmp 0x4561
movq 0xffac(%rip), %rax      # 0x144f8
imulq $0x28, -0x88(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
cvtsi2sdq 0xffa6(%rip), %xmm0 # 0x14510
movsd 0x9aa6(%rip), %xmm1     # 0xe018
ucomisd %xmm1, %xmm0
jbe 0x457d
callq 0x3e30
jmp 0x447a
callq 0x3c30
cmpl $0x0, 0xfd56(%rip)      # 0x142e4
jle 0x45ba
movq 0xff79(%rip), %rsi      # 0x14510
leaq 0x9af4(%rip), %rdi      # 0xe092
movb $0x0, %al
callq 0x3060
movq 0xff6c(%rip), %rsi      # 0x14518
leaq 0x9af1(%rip), %rdi      # 0xe0a4
movb $0x0, %al
callq 0x3060
movq -0x78(%rbp), %rdi
callq 0x3030
movq %rax, 0xff5e(%rip)      # 0x14528
movq -0x78(%rbp), %rdi
callq 0x3280
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)