// File: /workspace/github_c_makefile_star2_O3/Leeheng86[P]word2vec/word2vec.c
// Function: TrainModelThread(void*)
void *TrainModelThread(void *id) {
  long long a, b, d, cw, word, last_word, sentence_length = 0, sentence_position = 0;
  long long word_count = 0, last_word_count = 0, sen[MAX_SENTENCE_LENGTH + 1];
  long long l1, l2, c, target, label, local_iter = iter;
  unsigned long long next_random = (long long)id;
  real f, g;
  clock_t now;
  real *neu1 = (real *)calloc(layer1_size, sizeof(real));
  real *neu1e = (real *)calloc(layer1_size, sizeof(real));
  FILE *fi = fopen(train_file, "rb");
  fseek(fi, file_size / (long long)num_threads * (long long)id, SEEK_SET);
  while (1) {
    if (word_count - last_word_count > 10000) {
      word_count_actual += word_count - last_word_count;
      last_word_count = word_count;
      if ((debug_mode > 1)) {
        now=clock();
        printf("%cAlpha: %f  Progress: %.2f%%  Words/thread/sec: %.2fk  ", 13, alpha,
         word_count_actual / (real)(iter * train_words + 1) * 100,
         word_count_actual / ((real)(now - start + 1) / (real)CLOCKS_PER_SEC * 1000));
        fflush(stdout);
      }
      alpha = starting_alpha * (1 - word_count_actual / (real)(iter * train_words + 1));
      if (alpha < starting_alpha * 0.0001) alpha = starting_alpha * 0.0001;
    }
    if (sentence_length == 0) {
      while (1) {
        word = ReadWordIndex(fi);
        if (feof(fi)) break;
        if (word == -1) continue;
        word_count++;
        if (word == 0) break;
        // The subsampling randomly discards frequent words while keeping the ranking same
        if (sample > 0) {
          real ran = (sqrt(vocab[word].cn / (sample * train_words)) + 1) * (sample * train_words) / vocab[word].cn;
          next_random = next_random * (unsigned long long)25214903917 + 11;
          if (ran < (next_random & 0xFFFF) / (real)65536) continue;
        }
        sen[sentence_length] = word;
        sentence_length++;
        if (sentence_length >= MAX_SENTENCE_LENGTH) break;
      }
      sentence_position = 0;
    }
    if (feof(fi) || (word_count > train_words / num_threads)) {
      word_count_actual += word_count - last_word_count;
      local_iter--;
      if (local_iter == 0) break;
      word_count = 0;
      last_word_count = 0;
      sentence_length = 0;
      fseek(fi, file_size / (long long)num_threads * (long long)id, SEEK_SET);
      continue;
    }
    word = sen[sentence_position];
    if (word == -1) continue;
    for (c = 0; c < layer1_size; c++) neu1[c] = 0;
    for (c = 0; c < layer1_size; c++) neu1e[c] = 0;
    next_random = next_random * (unsigned long long)25214903917 + 11;
    b = next_random % window;
    if (cbow) {  //train the cbow architecture
      // in -> hidden
      cw = 0;
      for (a = b; a < window * 2 + 1 - b; a++) if (a != window) {
        c = sentence_position - window + a;
        if (c < 0) continue;
        if (c >= sentence_length) continue;
        last_word = sen[c];
        if (last_word == -1) continue;
        for (c = 0; c < layer1_size; c++) neu1[c] += syn0[c + last_word * layer1_size];
        cw++;
      }
      if (cw) {
        for (c = 0; c < layer1_size; c++) neu1[c] /= cw;
        if (hs) for (d = 0; d < vocab[word].codelen; d++) {
          f = 0;
          l2 = vocab[word].point[d] * layer1_size;
          // Propagate hidden -> output
          for (c = 0; c < layer1_size; c++) f += neu1[c] * syn1[c + l2];
          if (f <= -MAX_EXP) continue;
          else if (f >= MAX_EXP) continue;
          else f = expTable[(int)((f + MAX_EXP) * (EXP_TABLE_SIZE / MAX_EXP / 2))];
          // 'g' is the gradient multiplied by the learning rate
          g = (1 - vocab[word].code[d] - f) * alpha;
          // Propagate errors output -> hidden
          for (c = 0; c < layer1_size; c++) neu1e[c] += g * syn1[c + l2];
          // Learn weights hidden -> output
          for (c = 0; c < layer1_size; c++) syn1[c + l2] += g * neu1[c];
        }
        // NEGATIVE SAMPLING
        if (negative > 0) for (d = 0; d < negative + 1; d++) {
          if (d == 0) {
            target = word;
            label = 1;
          } else {
            next_random = next_random * (unsigned long long)25214903917 + 11;
            target = table[(next_random >> 16) % table_size];
            if (target == 0) target = next_random % (vocab_size - 1) + 1;
            if (target == word) continue;
            label = 0;
          }
          l2 = target * layer1_size;
          f = 0;
          for (c = 0; c < layer1_size; c++) f += neu1[c] * syn1neg[c + l2];
          if (f > MAX_EXP) g = (label - 1) * alpha;
          else if (f < -MAX_EXP) g = (label - 0) * alpha;
          else g = (label - expTable[(int)((f + MAX_EXP) * (EXP_TABLE_SIZE / MAX_EXP / 2))]) * alpha;
          for (c = 0; c < layer1_size; c++) neu1e[c] += g * syn1neg[c + l2];
          for (c = 0; c < layer1_size; c++) syn1neg[c + l2] += g * neu1[c];
        }
        // hidden -> in
        for (a = b; a < window * 2 + 1 - b; a++) if (a != window) {
          c = sentence_position - window + a;
          if (c < 0) continue;
          if (c >= sentence_length) continue;
          last_word = sen[c];
          if (last_word == -1) continue;
          for (c = 0; c < layer1_size; c++) syn0[c + last_word * layer1_size] += neu1e[c];
        }
      }
    } else {  //train skip-gram
      for (a = b; a < window * 2 + 1 - b; a++) if (a != window) {
        c = sentence_position - window + a;
        if (c < 0) continue;
        if (c >= sentence_length) continue;
        last_word = sen[c];
        if (last_word == -1) continue;
        l1 = last_word * layer1_size;
        for (c = 0; c < layer1_size; c++) neu1e[c] = 0;
        // HIERARCHICAL SOFTMAX
        if (hs) for (d = 0; d < vocab[word].codelen; d++) {
          f = 0;
          l2 = vocab[word].point[d] * layer1_size;
          // Propagate hidden -> output
          for (c = 0; c < layer1_size; c++) f += syn0[c + l1] * syn1[c + l2];
          if (f <= -MAX_EXP) continue;
          else if (f >= MAX_EXP) continue;
          else f = expTable[(int)((f + MAX_EXP) * (EXP_TABLE_SIZE / MAX_EXP / 2))];
          // 'g' is the gradient multiplied by the learning rate
          g = (1 - vocab[word].code[d] - f) * alpha;
          // Propagate errors output -> hidden
          for (c = 0; c < layer1_size; c++) neu1e[c] += g * syn1[c + l2];
          // Learn weights hidden -> output
          for (c = 0; c < layer1_size; c++) syn1[c + l2] += g * syn0[c + l1];
        }
        // NEGATIVE SAMPLING
        if (negative > 0) for (d = 0; d < negative + 1; d++) {
          if (d == 0) {
            target = word;
            label = 1;
          } else {
            next_random = next_random * (unsigned long long)25214903917 + 11;
            target = table[(next_random >> 16) % table_size];
            if (target == 0) target = next_random % (vocab_size - 1) + 1;
            if (target == word) continue;
            label = 0;
          }
          l2 = target * layer1_size;
          f = 0;
          for (c = 0; c < layer1_size; c++) f += syn0[c + l1] * syn1neg[c + l2];
          if (f > MAX_EXP) g = (label - 1) * alpha;
          else if (f < -MAX_EXP) g = (label - 0) * alpha;
          else g = (label - expTable[(int)((f + MAX_EXP) * (EXP_TABLE_SIZE / MAX_EXP / 2))]) * alpha;
          for (c = 0; c < layer1_size; c++) neu1e[c] += g * syn1neg[c + l2];
          for (c = 0; c < layer1_size; c++) syn1neg[c + l2] += g * syn0[c + l1];
        }
        // Learn weights input -> hidden
        for (c = 0; c < layer1_size; c++) syn0[c + l1] += neu1e[c];
      }
    }
    sentence_position++;
    if (sentence_position >= sentence_length) {
      sentence_length = 0;
      continue;
    }
  }
  fclose(fi);
  free(neu1);
  free(neu1e);
  pthread_exit(NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1fd8, %rsp           # imm = 0x1FD8
movq %rdi, %rbp
movq 0x7c11(%rip), %rax      # 0xb280
movq %rax, 0x50(%rsp)
movq 0x7bfd(%rip), %rbx      # 0xb278
movl $0x4, %esi
movq %rbx, %rdi
callq 0x2160
movq %rax, %r14
movl $0x4, %esi
movq %rbx, %rdi
callq 0x2160
movq %rax, %r15
leaq 0x7c1e(%rip), %rdi      # 0xb2c0
leaq 0x3a28(%rip), %rsi      # 0x70d1
callq 0x22a0
movq %rax, %r13
xorl %r12d, %r12d
movq %rbp, 0x58(%rsp)
movq %rax, 0x48(%rsp)
movq 0x7de3(%rip), %rax      # 0xb4a8
movslq 0x7b9c(%rip), %rcx      # 0xb268
cqto
idivq %rcx
imulq 0x58(%rsp), %rax
movq %r13, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x2270
xorl %ebx, %ebx
movq $0x0, 0x30(%rsp)
xorl %r9d, %r9d
movq %rbx, %rax
subq 0x30(%rsp), %rax
cmpq $0x2711, %rax           # imm = 0x2711
jl 0x383f
addq 0x7d93(%rip), %rax      # 0xb4a0
movq %rax, 0x7d8c(%rip)      # 0xb4a0
cmpl $0x2, 0x7b41(%rip)      # 0xb25c
jl 0x37ca
movq %r9, 0x8(%rsp)
callq 0x2170
xorps %xmm2, %xmm2
cvtsi2ssq 0x7d69(%rip), %xmm2 # 0xb4a0
movq 0x7d5a(%rip), %rcx      # 0xb498
imulq 0x7b3a(%rip), %rcx      # 0xb280
incq %rcx
xorps %xmm1, %xmm1
cvtsi2ss %rcx, %xmm1
xorps %xmm0, %xmm0
cvtss2sd 0x7b2c(%rip), %xmm0     # 0xb288
movaps %xmm2, %xmm3
divss %xmm1, %xmm3
mulss 0x3939(%rip), %xmm3     # 0x70a4
xorps %xmm1, %xmm1
cvtss2sd %xmm3, %xmm1
subq 0x7d67(%rip), %rax      # 0xb4e0
incq %rax
xorps %xmm3, %xmm3
cvtsi2ss %rax, %xmm3
divss 0x391c(%rip), %xmm3     # 0x70a8
mulss 0x3918(%rip), %xmm3     # 0x70ac
divss %xmm3, %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x3979(%rip), %rdi      # 0x711c
movl $0xd, %esi
movb $0x3, %al
callq 0x2050
movq 0x7812(%rip), %rax      # 0xafc8
movq (%rax), %rdi
callq 0x2290
movq 0x8(%rsp), %r9
movq 0x7cd6(%rip), %rax      # 0xb4a0
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
movq 0x7cbf(%rip), %rax      # 0xb498
imulq 0x7a9f(%rip), %rax      # 0xb280
incq %rax
xorps %xmm1, %xmm1
cvtsi2ss %rax, %xmm1
movss 0x7cc4(%rip), %xmm2     # 0xb4b8
divss %xmm1, %xmm0
movss 0x38b0(%rip), %xmm1     # 0x70b0
subss %xmm0, %xmm1
mulss %xmm2, %xmm1
movss %xmm1, 0x7a78(%rip)     # 0xb288
cvtss2sd %xmm1, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
mulsd 0x37fd(%rip), %xmm0     # 0x7020
ucomisd %xmm1, %xmm0
movq %rbx, 0x30(%rsp)
jbe 0x383f
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x7a4e(%rip)     # 0xb288
movq %rbx, 0x30(%rsp)
testq %r9, %r9
jne 0x3969
xorl %eax, %eax
movq %rax, (%rsp)
movq %rbx, %r12
movq %r13, %rdi
callq 0x2975
movl %eax, %ebx
movq %r13, %rdi
callq 0x2370
testl %eax, %eax
jne 0x395f
cmpl $-0x1, %ebx
je 0x3851
incq %r12
testl %ebx, %ebx
je 0x395f
movslq %ebx, %rbx
movss 0x7a06(%rip), %xmm1     # 0xb28c
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jbe 0x3933
movq 0x7bdf(%rip), %rax      # 0xb478
leaq (%rbx,%rbx,4), %r13
xorps %xmm3, %xmm3
xorps %xmm0, %xmm0
cvtsi2ssq (%rax,%r13,8), %xmm0
xorps %xmm2, %xmm2
cvtsi2ssq 0x7be3(%rip), %xmm2 # 0xb498
mulss %xmm2, %xmm1
divss %xmm1, %xmm0
ucomiss %xmm3, %xmm0
jb 0x38c8
sqrtss %xmm0, %xmm0
jmp 0x38cd
callq 0x2420
xorps %xmm1, %xmm1
cvtsi2ssq 0x7bbf(%rip), %xmm1 # 0xb498
mulss 0x79ab(%rip), %xmm1     # 0xb28c
movq 0x7b90(%rip), %rax      # 0xb478
xorps %xmm2, %xmm2
cvtsi2ssq (%rax,%r13,8), %xmm2
addss 0x37b7(%rip), %xmm0     # 0x70b0
mulss %xmm0, %xmm1
movabsq $0x5deece66d, %rax      # imm = 0x5DEECE66D
imulq %rax, %rbp
addq $0xb, %rbp
movzwl %bp, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss %xmm2, %xmm1
mulss 0x377b(%rip), %xmm0     # 0x70a0
ucomiss %xmm1, %xmm0
movq 0x48(%rsp), %r13
ja 0x3851
movq (%rsp), %rax
movq %rbx, 0x90(%rsp,%rax,8)
incq %rax
movl $0x3e8, %r9d            # imm = 0x3E8
cmpq $0x3e8, %rax            # imm = 0x3E8
movq %r12, %rbx
movl $0x0, %r12d
jne 0x384a
jmp 0x3969
movq (%rsp), %r9
movq %r12, %rbx
xorl %r12d, %r12d
movq %r9, 0x8(%rsp)
movq %r13, %rdi
callq 0x2370
testl %eax, %eax
jne 0x41fe
movq 0x7b13(%rip), %rax      # 0xb498
movslq 0x78dc(%rip), %rcx      # 0xb268
cqto
idivq %rcx
cmpq %rax, %rbx
jg 0x41fe
movq 0x90(%rsp,%r12,8), %rcx
movq %rcx, (%rsp)
cmpq $-0x1, %rcx
movq 0x8(%rsp), %r9
je 0x36f2
movq %rbx, 0x80(%rsp)
movq 0x78b4(%rip), %r13      # 0xb278
testq %r13, %r13
jle 0x39eb
leaq (,%r13,4), %rbx
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x2150
movq %r15, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x2150
movabsq $0x5deece66d, %rax      # imm = 0x5DEECE66D
imulq %rax, %rbp
addq $0xb, %rbp
movslq 0x785c(%rip), %r10      # 0xb260
movq %rbp, %rax
xorl %edx, %edx
divq %r10
movq %rdx, %rbx
leaq 0x1(,%r10,2), %r8
subq %rdx, %r8
cmpl $0x0, 0x7837(%rip)      # 0xb258
movq %r8, 0x20(%rsp)
movq %r12, 0x78(%rsp)
je 0x3df2
cmpq %r8, %rbx
movq 0x8(%rsp), %r9
jge 0x41d8
movq %r12, %rsi
subq %r10, %rsi
movq 0x7a74(%rip), %rcx      # 0xb4c0
movq %rbx, %rdx
xorl %eax, %eax
movss 0x365b(%rip), %xmm2     # 0x70b4
movss 0x365b(%rip), %xmm3     # 0x70bc
movss 0x364f(%rip), %xmm4     # 0x70b8
movaps 0x35e0(%rip), %xmm5     # 0x7050
cmpq %r10, %rdx
je 0x3ac2
movq %rdx, %rdi
addq %rsi, %rdi
js 0x3ac2
cmpq %r9, %rdi
jge 0x3ac2
movq 0x90(%rsp,%rdi,8), %rdi
cmpq $-0x1, %rdi
je 0x3ac2
testq %r13, %r13
jle 0x3aba
imulq %r13, %rdi
leaq (%rcx,%rdi,4), %rdi
xorl %r8d, %r8d
movss (%rdi,%r8,4), %xmm0
addss (%r14,%r8,4), %xmm0
movss %xmm0, (%r14,%r8,4)
incq %r8
cmpq %r8, %r13
jne 0x3aa0
incq %rax
movq 0x20(%rsp), %r8
incq %rdx
cmpq %r8, %rdx
jl 0x3a70
testq %rax, %rax
je 0x41d8
movq %r10, 0x28(%rsp)
testq %r13, %r13
jle 0x3aff
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
xorl %eax, %eax
movss (%r14,%rax,4), %xmm1
divss %xmm0, %xmm1
movss %xmm1, (%r14,%rax,4)
incq %rax
cmpq %rax, %r13
jne 0x3ae7
cmpl $0x0, 0x79e2(%rip)      # 0xb4e8
je 0x3c28
movq 0x7965(%rip), %rcx      # 0xb478
movq (%rsp), %rax
leaq (%rax,%rax,4), %rdx
movsbq 0x20(%rcx,%rdx,8), %rax
testq %rax, %rax
jle 0x3c28
leaq (%rcx,%rdx,8), %rcx
movq 0x8(%rcx), %rdx
movq 0x798f(%rip), %rdi      # 0xb4c8
movq 0x7998(%rip), %r8       # 0xb4d8
movq %r8, 0x18(%rsp)
xorl %r9d, %r9d
movslq (%rdx,%r9,4), %r10
imulq %r13, %r10
testq %r13, %r13
jle 0x3b79
leaq (%rdi,%r10,4), %r11
xorps %xmm0, %xmm0
xorl %r12d, %r12d
movss (%r14,%r12,4), %xmm1
mulss (%r11,%r12,4), %xmm1
addss %xmm1, %xmm0
incq %r12
cmpq %r12, %r13
jne 0x3b5f
jmp 0x3b7c
xorps %xmm0, %xmm0
movaps %xmm0, %xmm1
andps %xmm5, %xmm1
ucomiss %xmm2, %xmm1
jae 0x3c1c
addss %xmm2, %xmm0
mulss %xmm4, %xmm0
testq %r13, %r13
jle 0x3c1c
movq 0x18(%rcx), %r11
movsbl (%r11,%r9), %r11d
movl $0x1, %r12d
cvttss2si %xmm0, %r8d
subl %r11d, %r12d
xorps %xmm0, %xmm0
cvtsi2ss %r12d, %xmm0
movslq %r8d, %r8
movq 0x18(%rsp), %r11
subss (%r11,%r8,4), %xmm0
mulss 0x76b7(%rip), %xmm0     # 0xb288
leaq (%rdi,%r10,4), %r10
xorl %r11d, %r11d
movss (%r10,%r11,4), %xmm1
mulss %xmm0, %xmm1
addss (%r15,%r11,4), %xmm1
movss %xmm1, (%r15,%r11,4)
incq %r11
cmpq %r11, %r13
jne 0x3bd8
testq %r13, %r13
jle 0x3c1c
xorl %r11d, %r11d
movss (%r14,%r11,4), %xmm1
mulss %xmm0, %xmm1
addss (%r10,%r11,4), %xmm1
movss %xmm1, (%r10,%r11,4)
incq %r11
cmpq %r11, %r13
jne 0x3bfe
incq %r9
cmpq %rax, %r9
jne 0x3b48
movl 0x7662(%rip), %edi      # 0xb290
testl %edi, %edi
jle 0x3d76
incq %rdi
movq 0x78b0(%rip), %r8       # 0xb4f0
movq 0x7849(%rip), %r9       # 0xb490
decq %r9
movq 0x787f(%rip), %r10      # 0xb4d0
movq 0x7880(%rip), %r11      # 0xb4d8
xorl %r12d, %r12d
testq %r12, %r12
je 0x3cb6
movabsq $0x5deece66d, %rax      # imm = 0x5DEECE66D
imulq %rax, %rbp
addq $0xb, %rbp
movq %rbp, %rcx
shrq $0x10, %rcx
movq %rcx, %rax
movabsq $0x55e63b88c231, %rdx   # imm = 0x55E63B88C231
mulq %rdx
shrl $0x9, %edx
imull $0x5f5e100, %edx, %eax  # imm = 0x5F5E100
subl %eax, %ecx
movslq (%r8,%rcx,4), %rdx
testq %rdx, %rdx
jne 0x3ca8
movq %rbp, %rax
xorl %edx, %edx
divq %r9
incq %rdx
cmpq (%rsp), %rdx
je 0x3d6a
xorl %ecx, %ecx
jmp 0x3cbf
movl $0x1, %ecx
movq (%rsp), %rdx
imulq %r13, %rdx
leaq (%r10,%rdx,4), %rax
xorps %xmm1, %xmm1
testq %r13, %r13
jle 0x3cff
xorl %edx, %edx
movss (%r14,%rdx,4), %xmm0
mulss (%rax,%rdx,4), %xmm0
addss %xmm0, %xmm1
incq %rdx
cmpq %rdx, %r13
jne 0x3cd1
ucomiss %xmm2, %xmm1
jbe 0x3cf1
decl %ecx
jmp 0x3cf6
ucomiss %xmm1, %xmm3
jbe 0x3cff
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
jmp 0x3d1b
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
addss %xmm2, %xmm1
mulss %xmm4, %xmm1
cvttss2si %xmm1, %ecx
movslq %ecx, %rcx
subss (%r11,%rcx,4), %xmm0
mulss 0x7565(%rip), %xmm0     # 0xb288
testq %r13, %r13
jle 0x3d6a
xorl %ecx, %ecx
movss (%rax,%rcx,4), %xmm1
mulss %xmm0, %xmm1
addss (%r15,%rcx,4), %xmm1
movss %xmm1, (%r15,%rcx,4)
incq %rcx
cmpq %rcx, %r13
jne 0x3d2a
testq %r13, %r13
jle 0x3d6a
xorl %ecx, %ecx
movss (%r14,%rcx,4), %xmm1
mulss %xmm0, %xmm1
addss (%rax,%rcx,4), %xmm1
movss %xmm1, (%rax,%rcx,4)
incq %rcx
cmpq %rcx, %r13
jne 0x3d4e
incq %r12
cmpq %rdi, %r12
jne 0x3c5b
cmpq 0x20(%rsp), %rbx
jge 0x41d3
movq 0x7738(%rip), %rax      # 0xb4c0
movq 0x8(%rsp), %r9
movq 0x28(%rsp), %r8
cmpq %r8, %rbx
jne 0x3da6
incq %rbx
cmpq 0x20(%rsp), %rbx
jl 0x3d92
jmp 0x41d8
movq %rbx, %rcx
addq %rsi, %rcx
js 0x3d97
cmpq %r9, %rcx
jge 0x3d97
testq %r13, %r13
setle %dl
movq 0x90(%rsp,%rcx,8), %rcx
cmpq $-0x1, %rcx
sete %dil
orb %dl, %dil
jne 0x3d97
imulq %r13, %rcx
leaq (%rax,%rcx,4), %rcx
xorl %edx, %edx
movss (%r15,%rdx,4), %xmm0
addss (%rcx,%rdx,4), %xmm0
movss %xmm0, (%rcx,%rdx,4)
incq %rdx
cmpq %rdx, %r13
jne 0x3dd8
jmp 0x3d97
cmpq %r8, %rbx
movq 0x8(%rsp), %r9
jge 0x41d8
movq %r12, %rdx
subq %r10, %rdx
movl 0x76dc(%rip), %eax      # 0xb4e8
movl %eax, 0x3c(%rsp)
movq 0x7661(%rip), %rax      # 0xb478
movq (%rsp), %rcx
leaq (%rcx,%rcx,4), %rcx
leaq (%rax,%rcx,8), %rax
movq %rax, 0x18(%rsp)
movl 0x7462(%rip), %eax      # 0xb290
movq %rax, 0x70(%rsp)
leal 0x1(%rax), %r12d
movq 0x7682(%rip), %rax      # 0xb4c0
movq %rax, 0x68(%rsp)
leaq (,%r13,4), %rax
movq %rax, 0x60(%rsp)
movss 0x325c(%rip), %xmm2     # 0x70b4
movss 0x3258(%rip), %xmm4     # 0x70b8
movq %r10, 0x28(%rsp)
movq %rdx, 0x40(%rsp)
cmpq %r10, %rbx
jne 0x3e7c
incq %rbx
cmpq %r8, %rbx
jl 0x3e6a
jmp 0x41d8
movq %rbx, %rax
addq %rdx, %rax
js 0x3e6f
cmpq %r9, %rax
jge 0x3e6f
movq 0x90(%rsp,%rax,8), %rax
cmpq $-0x1, %rax
je 0x3e6f
testq %r13, %r13
jle 0x3ec5
movq %r15, %rdi
movq %rax, 0x10(%rsp)
xorl %esi, %esi
movq 0x60(%rsp), %rdx
callq 0x2150
movq 0x10(%rsp), %rax
movss 0x31fb(%rip), %xmm4     # 0x70b8
movss 0x31ef(%rip), %xmm2     # 0x70b4
imulq %r13, %rax
movq %rax, 0x10(%rsp)
cmpl $0x0, 0x3c(%rsp)
movss 0x31e1(%rip), %xmm3     # 0x70bc
movaps 0x316e(%rip), %xmm5     # 0x7050
je 0x4018
movq 0x18(%rsp), %rax
movsbq 0x20(%rax), %rax
testq %rax, %rax
jle 0x4018
movq 0x10(%rsp), %rcx
leaq (,%rcx,4), %rcx
addq 0x75b1(%rip), %rcx      # 0xb4c0
movq 0x18(%rsp), %rdx
movq 0x8(%rdx), %rdx
movq 0x75a9(%rip), %rsi      # 0xb4c8
movq 0x75b2(%rip), %rdi      # 0xb4d8
movq %rdi, 0x88(%rsp)
xorl %r8d, %r8d
movslq (%rdx,%r8,4), %r9
imulq %r13, %r9
testq %r13, %r13
jle 0x3f62
leaq (%rsi,%r9,4), %r10
xorps %xmm0, %xmm0
xorl %r11d, %r11d
movss (%rcx,%r11,4), %xmm1
mulss (%r10,%r11,4), %xmm1
addss %xmm1, %xmm0
incq %r11
cmpq %r11, %r13
jne 0x3f48
jmp 0x3f65
xorps %xmm0, %xmm0
movaps %xmm0, %xmm1
andps %xmm5, %xmm1
ucomiss %xmm2, %xmm1
jae 0x400c
addss %xmm2, %xmm0
mulss %xmm4, %xmm0
testq %r13, %r13
jle 0x400c
movq 0x18(%rsp), %rdi
movq 0x18(%rdi), %r10
movsbl (%r10,%r8), %r10d
movl $0x1, %r11d
cvttss2si %xmm0, %edi
subl %r10d, %r11d
xorps %xmm0, %xmm0
cvtsi2ss %r11d, %xmm0
movslq %edi, %rdi
movq 0x88(%rsp), %r10
subss (%r10,%rdi,4), %xmm0
mulss 0x72c7(%rip), %xmm0     # 0xb288
leaq (%rsi,%r9,4), %r9
xorl %r10d, %r10d
movss (%r9,%r10,4), %xmm1
mulss %xmm0, %xmm1
addss (%r15,%r10,4), %xmm1
movss %xmm1, (%r15,%r10,4)
incq %r10
cmpq %r10, %r13
jne 0x3fc8
testq %r13, %r13
jle 0x400c
xorl %r10d, %r10d
movss (%rcx,%r10,4), %xmm1
mulss %xmm0, %xmm1
addss (%r9,%r10,4), %xmm1
movss %xmm1, (%r9,%r10,4)
incq %r10
cmpq %r10, %r13
jne 0x3fee
incq %r8
cmpq %rax, %r8
jne 0x3f31
cmpl $0x0, 0x70(%rsp)
jle 0x4174
movq 0x74c6(%rip), %rsi      # 0xb4f0
movq 0x745f(%rip), %rdi      # 0xb490
movq 0x10(%rsp), %rax
leaq (,%rax,4), %r8
addq 0x747b(%rip), %r8       # 0xb4c0
decq %rdi
movq 0x7481(%rip), %r9       # 0xb4d0
movq 0x7482(%rip), %r10      # 0xb4d8
xorl %r11d, %r11d
testq %r11, %r11
je 0x40b4
movabsq $0x5deece66d, %rax      # imm = 0x5DEECE66D
imulq %rax, %rbp
addq $0xb, %rbp
movq %rbp, %rcx
shrq $0x10, %rcx
movq %rcx, %rax
movabsq $0x55e63b88c231, %rdx   # imm = 0x55E63B88C231
mulq %rdx
shrl $0x9, %edx
imull $0x5f5e100, %edx, %eax  # imm = 0x5F5E100
subl %eax, %ecx
movslq (%rsi,%rcx,4), %rdx
testq %rdx, %rdx
jne 0x40a6
movq %rbp, %rax
xorl %edx, %edx
divq %rdi
incq %rdx
cmpq (%rsp), %rdx
je 0x4168
xorl %ecx, %ecx
jmp 0x40bd
movl $0x1, %ecx
movq (%rsp), %rdx
imulq %r13, %rdx
leaq (%r9,%rdx,4), %rax
xorps %xmm1, %xmm1
testq %r13, %r13
jle 0x40fd
xorl %edx, %edx
movss (%r8,%rdx,4), %xmm0
mulss (%rax,%rdx,4), %xmm0
addss %xmm0, %xmm1
incq %rdx
cmpq %rdx, %r13
jne 0x40cf
ucomiss %xmm2, %xmm1
jbe 0x40ef
decl %ecx
jmp 0x40f4
ucomiss %xmm1, %xmm3
jbe 0x40fd
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
jmp 0x4119
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
addss %xmm2, %xmm1
mulss %xmm4, %xmm1
cvttss2si %xmm1, %ecx
movslq %ecx, %rcx
subss (%r10,%rcx,4), %xmm0
mulss 0x7167(%rip), %xmm0     # 0xb288
testq %r13, %r13
jle 0x4168
xorl %ecx, %ecx
movss (%rax,%rcx,4), %xmm1
mulss %xmm0, %xmm1
addss (%r15,%rcx,4), %xmm1
movss %xmm1, (%r15,%rcx,4)
incq %rcx
cmpq %rcx, %r13
jne 0x4128
testq %r13, %r13
jle 0x4168
xorl %ecx, %ecx
movss (%r8,%rcx,4), %xmm1
mulss %xmm0, %xmm1
addss (%rax,%rcx,4), %xmm1
movss %xmm1, (%rax,%rcx,4)
incq %rcx
cmpq %rcx, %r13
jne 0x414c
incq %r11
cmpq %r12, %r11
jne 0x4059
testq %r13, %r13
jle 0x41ba
movq 0x68(%rsp), %rax
movq 0x10(%rsp), %rcx
leaq (%rax,%rcx,4), %rax
xorl %ecx, %ecx
movq 0x8(%rsp), %r9
movq 0x28(%rsp), %r10
movq 0x20(%rsp), %r8
movq 0x40(%rsp), %rdx
movss (%r15,%rcx,4), %xmm0
addss (%rax,%rcx,4), %xmm0
movss %xmm0, (%rax,%rcx,4)
incq %rcx
cmpq %rcx, %r13
jne 0x419d
jmp 0x3e6f
movq 0x8(%rsp), %r9
movq 0x28(%rsp), %r10
movq 0x20(%rsp), %r8
movq 0x40(%rsp), %rdx
jmp 0x3e6f
movq 0x8(%rsp), %r9
movq 0x78(%rsp), %r12
incq %r12
cmpq %r9, %r12
movl $0x0, %eax
cmovgeq %rax, %r9
movq 0x48(%rsp), %r13
movq 0x80(%rsp), %rbx
jmp 0x36f2
subq 0x30(%rsp), %rbx
addq %rbx, 0x7296(%rip)      # 0xb4a0
decq 0x50(%rsp)
jne 0x36be
movq %r13, %rdi
callq 0x2220
movq %r14, %rdi
callq 0x22b0
movq %r15, %rdi
callq 0x22b0
xorl %edi, %edi
callq 0x2400