// File: /workspace/github_c_makefile_star2_O1/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 0x7ce9(%rip), %rax      # 0xb280
movq %rax, 0x60(%rsp)
movq 0x7cd5(%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 0x7cf6(%rip), %rdi      # 0xb2c0
leaq 0x3ab4(%rip), %rsi      # 0x7085
callq 0x22a0
movq %rax, %r13
movq $0x0, (%rsp)
movq %rbp, 0x68(%rsp)
movq %rax, 0x50(%rsp)
movq 0x7eb6(%rip), %rax      # 0xb4a8
movslq 0x7c6f(%rip), %rcx      # 0xb268
cqto
idivq %rcx
imulq 0x68(%rsp), %rax
movq %r13, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x2270
xorl %ebx, %ebx
movq $0x0, 0x28(%rsp)
xorl %r9d, %r9d
movq %rbx, %rax
subq 0x28(%rsp), %rax
cmpq $0x2711, %rax           # imm = 0x2711
jl 0x375e
addq %rax, 0x7e66(%rip)      # 0xb4a0
cmpl $0x2, 0x7c1b(%rip)      # 0xb25c
jl 0x36e5
movq %r9, %r12
callq 0x2170
xorps %xmm2, %xmm2
cvtsi2ssq 0x7e45(%rip), %xmm2 # 0xb4a0
movq 0x7e36(%rip), %rcx      # 0xb498
imulq 0x7c16(%rip), %rcx      # 0xb280
incq %rcx
xorps %xmm1, %xmm1
cvtsi2ss %rcx, %xmm1
xorps %xmm0, %xmm0
cvtss2sd 0x7c08(%rip), %xmm0     # 0xb288
movaps %xmm2, %xmm3
divss %xmm1, %xmm3
mulss 0x399d(%rip), %xmm3     # 0x702c
xorps %xmm1, %xmm1
cvtss2sd %xmm3, %xmm1
subq 0x7e43(%rip), %rax      # 0xb4e0
incq %rax
xorps %xmm3, %xmm3
cvtsi2ss %rax, %xmm3
divss 0x3980(%rip), %xmm3     # 0x7030
mulss 0x397c(%rip), %xmm3     # 0x7034
divss %xmm3, %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x3a09(%rip), %rdi      # 0x70d0
movl $0xd, %esi
movb $0x3, %al
callq 0x2050
movq 0x78ee(%rip), %rax      # 0xafc8
movq (%rax), %rdi
callq 0x2290
movq %r12, %r9
xorps %xmm0, %xmm0
cvtsi2ssq 0x7daf(%rip), %xmm0 # 0xb4a0
movq 0x7da0(%rip), %rax      # 0xb498
imulq 0x7b80(%rip), %rax      # 0xb280
incq %rax
xorps %xmm1, %xmm1
cvtsi2ss %rax, %xmm1
movss 0x7da5(%rip), %xmm2     # 0xb4b8
divss %xmm1, %xmm0
movss 0x3919(%rip), %xmm1     # 0x7038
subss %xmm0, %xmm1
mulss %xmm2, %xmm1
movss %xmm1, 0x7b59(%rip)     # 0xb288
cvtss2sd %xmm1, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
mulsd 0x38de(%rip), %xmm0     # 0x7020
ucomisd %xmm1, %xmm0
movq %rbx, 0x28(%rsp)
jbe 0x375e
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x7b2f(%rip)     # 0xb288
movq %rbx, 0x28(%rsp)
testq %r9, %r9
jne 0x389b
movq $0x0, 0x10(%rsp)
movq %rbx, %r12
movq %r13, %rdi
callq 0x2975
movl %eax, %ebx
movq %r13, %rdi
callq 0x2370
testl %eax, %eax
jne 0x388b
cmpl $-0x1, %ebx
je 0x3773
incq %r12
testl %ebx, %ebx
je 0x388b
movslq %ebx, %rbx
movss 0x7ae4(%rip), %xmm1     # 0xb28c
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jbe 0x3855
movq 0x7cbd(%rip), %rax      # 0xb478
leaq (%rbx,%rbx,4), %r13
xorps %xmm3, %xmm3
xorps %xmm0, %xmm0
cvtsi2ssq (%rax,%r13,8), %xmm0
xorps %xmm2, %xmm2
cvtsi2ssq 0x7cc1(%rip), %xmm2 # 0xb498
mulss %xmm2, %xmm1
divss %xmm1, %xmm0
ucomiss %xmm3, %xmm0
jb 0x37ea
sqrtss %xmm0, %xmm0
jmp 0x37ef
callq 0x2420
xorps %xmm1, %xmm1
cvtsi2ssq 0x7c9d(%rip), %xmm1 # 0xb498
mulss 0x7a89(%rip), %xmm1     # 0xb28c
movq 0x7c6e(%rip), %rax      # 0xb478
xorps %xmm2, %xmm2
cvtsi2ssq (%rax,%r13,8), %xmm2
addss 0x381d(%rip), %xmm0     # 0x7038
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 0x37e1(%rip), %xmm0     # 0x7028
ucomiss %xmm1, %xmm0
movq 0x50(%rsp), %r13
ja 0x3773
movq 0x10(%rsp), %rcx
movq %rbx, 0x90(%rsp,%rcx,8)
incq %rcx
movl $0x3e8, %r9d            # imm = 0x3E8
movl $0x0, %eax
movq %rax, (%rsp)
movq %rcx, 0x10(%rsp)
cmpq $0x3e8, %rcx            # imm = 0x3E8
movq %r12, %rbx
jne 0x3770
jmp 0x389b
movq $0x0, (%rsp)
movq 0x10(%rsp), %r9
movq %r12, %rbx
movq %r9, 0x8(%rsp)
movq %r13, %rdi
callq 0x2370
testl %eax, %eax
jne 0x411f
movq 0x7be1(%rip), %rax      # 0xb498
movslq 0x79aa(%rip), %rcx      # 0xb268
cqto
idivq %rcx
cmpq %rax, %rbx
jg 0x411f
movq (%rsp), %rax
movq 0x90(%rsp,%rax,8), %r12
cmpq $-0x1, %r12
movq 0x8(%rsp), %r9
je 0x361f
movq 0x798a(%rip), %r13      # 0xb278
testq %r13, %r13
jle 0x390a
leaq (,%r13,4), %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x2150
movq 0x8(%rsp), %r9
movq %rbx, 0x88(%rsp)
testq %r13, %r13
jle 0x392e
leaq (,%r13,4), %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x2150
movq 0x8(%rsp), %r9
movabsq $0x5deece66d, %rax      # imm = 0x5DEECE66D
imulq %rax, %rbp
addq $0xb, %rbp
movslq 0x7919(%rip), %r8       # 0xb260
movq %rbp, %rax
xorl %edx, %edx
divq %r8
movq %rdx, %rbx
leaq 0x1(,%r8,2), %r10
subq %rdx, %r10
cmpl $0x0, 0x78f4(%rip)      # 0xb258
movq %r8, 0x30(%rsp)
movq %r12, 0x58(%rsp)
je 0x3a0e
cmpq %r10, %rbx
movss 0x36bd(%rip), %xmm2     # 0x703c
movss 0x36bd(%rip), %xmm3     # 0x7044
movss 0x36b1(%rip), %xmm4     # 0x7040
movaps 0x36ca(%rip), %xmm5     # 0x7060
jge 0x3ddf
movq (%rsp), %rcx
subq %r8, %rcx
movq 0x7b16(%rip), %rdx      # 0xb4c0
movq %rbx, %rsi
xorl %eax, %eax
cmpq %r8, %rsi
je 0x3a01
movq %rsi, %rdi
addq %rcx, %rdi
js 0x3a01
cmpq %r9, %rdi
jge 0x3a01
movq 0x90(%rsp,%rdi,8), %rdi
cmpq $-0x1, %rdi
je 0x3a01
testq %r13, %r13
jle 0x39f9
imulq %r13, %rdi
leaq (%rdx,%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 0x39df
incq %rax
movq 0x30(%rsp), %r8
incq %rsi
cmpq %r10, %rsi
jl 0x39af
jmp 0x3de1
cmpq %r10, %rbx
movss 0x3623(%rip), %xmm2     # 0x703c
movss 0x3623(%rip), %xmm3     # 0x7044
movss 0x3617(%rip), %xmm4     # 0x7040
jge 0x40f6
movq (%rsp), %rdx
subq %r8, %rdx
movl 0x7aac(%rip), %eax      # 0xb4e8
movl %eax, 0x44(%rsp)
movq 0x7a31(%rip), %rax      # 0xb478
leaq (%r12,%r12,4), %rcx
leaq (%rax,%rcx,8), %rax
movq %rax, 0x38(%rsp)
movl 0x7836(%rip), %eax      # 0xb290
movq %rax, 0x80(%rsp)
incl %eax
movq %rax, 0x10(%rsp)
movq 0x7a50(%rip), %rax      # 0xb4c0
movq %rax, 0x78(%rsp)
leaq (,%r13,4), %rax
movq %rax, 0x70(%rsp)
movq %r10, 0x20(%rsp)
movq %rdx, 0x48(%rsp)
cmpq %r8, %rbx
jne 0x3a9e
incq %rbx
cmpq %r10, %rbx
jl 0x3a8c
jmp 0x40f6
movq %rbx, %rax
addq %rdx, %rax
js 0x3a91
cmpq %r9, %rax
jge 0x3a91
movq 0x90(%rsp,%rax,8), %rax
cmpq $-0x1, %rax
je 0x3a91
testq %r13, %r13
jle 0x3aef
movq %r15, %rdi
movq %rax, 0x18(%rsp)
xorl %esi, %esi
movq 0x70(%rsp), %rdx
callq 0x2150
movq 0x18(%rsp), %rax
movss 0x3561(%rip), %xmm4     # 0x7040
movss 0x355d(%rip), %xmm3     # 0x7044
movss 0x354d(%rip), %xmm2     # 0x703c
imulq %r13, %rax
movq %rax, 0x18(%rsp)
cmpl $0x0, 0x44(%rsp)
movaps 0x355c(%rip), %xmm5     # 0x7060
je 0x3c23
movq 0x38(%rsp), %rax
movsbq 0x20(%rax), %rax
testq %rax, %rax
jle 0x3c23
movq 0x18(%rsp), %rcx
leaq (,%rcx,4), %rcx
addq 0x798f(%rip), %rcx      # 0xb4c0
movq 0x38(%rsp), %rdx
movq 0x8(%rdx), %rdx
movq 0x7987(%rip), %rsi      # 0xb4c8
movq 0x7990(%rip), %rdi      # 0xb4d8
xorl %r8d, %r8d
movslq (%rdx,%r8,4), %r9
imulq %r13, %r9
leaq (%rsi,%r9,4), %r9
xorps %xmm0, %xmm0
testq %r13, %r13
jle 0x3b7a
xorl %r10d, %r10d
movss (%rcx,%r10,4), %xmm1
mulss (%r9,%r10,4), %xmm1
addss %xmm1, %xmm0
incq %r10
cmpq %r10, %r13
jne 0x3b62
movaps %xmm0, %xmm1
andps %xmm5, %xmm1
ucomiss %xmm2, %xmm1
jae 0x3c17
movq 0x38(%rsp), %r10
movq 0x18(%r10), %r10
movsbl (%r10,%r8), %r10d
movl $0x1, %r11d
addss %xmm2, %xmm0
mulss %xmm4, %xmm0
cvttss2si %xmm0, %r12d
subl %r10d, %r11d
xorps %xmm0, %xmm0
cvtsi2ss %r11d, %xmm0
movslq %r12d, %r10
subss (%rdi,%r10,4), %xmm0
mulss 0x76c2(%rip), %xmm0     # 0xb288
testq %r13, %r13
jle 0x3bec
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 0x3bce
testq %r13, %r13
movq 0x58(%rsp), %r12
jle 0x3c17
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 0x3bf9
incq %r8
cmpq %rax, %r8
jne 0x3b4b
cmpl $0x0, 0x80(%rsp)
jle 0x3d80
movq 0x78b8(%rip), %rsi      # 0xb4f0
movq 0x7851(%rip), %rdi      # 0xb490
movq 0x18(%rsp), %rax
leaq (,%rax,4), %r8
addq 0x786d(%rip), %r8       # 0xb4c0
decq %rdi
movq 0x7873(%rip), %r9       # 0xb4d0
movq 0x7874(%rip), %r10      # 0xb4d8
xorl %r11d, %r11d
testq %r11, %r11
je 0x3cc1
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 0x3cb4
movq %rbp, %rax
xorl %edx, %edx
divq %rdi
incq %rdx
cmpq %r12, %rdx
je 0x3d72
xorl %ecx, %ecx
jmp 0x3cc9
movl $0x1, %ecx
movq %r12, %rdx
imulq %r13, %rdx
leaq (%r9,%rdx,4), %rax
xorps %xmm1, %xmm1
testq %r13, %r13
jle 0x3cf2
xorl %edx, %edx
movss (%r8,%rdx,4), %xmm0
mulss (%rax,%rdx,4), %xmm0
addss %xmm0, %xmm1
incq %rdx
cmpq %rdx, %r13
jne 0x3cdb
ucomiss %xmm2, %xmm1
jbe 0x3d02
decl %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
jmp 0x3d23
ucomiss %xmm1, %xmm3
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
ja 0x3d23
addss %xmm2, %xmm1
mulss %xmm4, %xmm1
cvttss2si %xmm1, %ecx
movslq %ecx, %rcx
subss (%r10,%rcx,4), %xmm0
mulss 0x755d(%rip), %xmm0     # 0xb288
testq %r13, %r13
jle 0x3d4f
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 0x3d32
testq %r13, %r13
jle 0x3d72
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 0x3d56
incq %r11
cmpq 0x10(%rsp), %r11
jne 0x3c67
testq %r13, %r13
jle 0x3dc6
movq 0x78(%rsp), %rax
movq 0x18(%rsp), %rcx
leaq (%rax,%rcx,4), %rax
xorl %ecx, %ecx
movq 0x8(%rsp), %r9
movq 0x30(%rsp), %r8
movq 0x20(%rsp), %r10
movq 0x48(%rsp), %rdx
movss (%r15,%rcx,4), %xmm0
addss (%rax,%rcx,4), %xmm0
movss %xmm0, (%rax,%rcx,4)
incq %rcx
cmpq %rcx, %r13
jne 0x3da9
jmp 0x3a91
movq 0x8(%rsp), %r9
movq 0x30(%rsp), %r8
movq 0x20(%rsp), %r10
movq 0x48(%rsp), %rdx
jmp 0x3a91
xorl %eax, %eax
testq %rax, %rax
je 0x40f6
movq %r10, 0x20(%rsp)
testq %r13, %r13
jle 0x3e16
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 0x3dfe
cmpl $0x0, 0x76cb(%rip)      # 0xb4e8
je 0x3f29
movq 0x764e(%rip), %rcx      # 0xb478
leaq (%r12,%r12,4), %rdx
movsbq 0x20(%rcx,%rdx,8), %rax
testq %rax, %rax
jle 0x3f29
leaq (%rcx,%rdx,8), %rcx
movq 0x8(%rcx), %rdx
movq 0x767c(%rip), %rsi      # 0xb4c8
movq 0x7685(%rip), %rdi      # 0xb4d8
xorl %r8d, %r8d
movslq (%rdx,%r8,4), %r9
imulq %r13, %r9
leaq (%rsi,%r9,4), %r9
xorps %xmm0, %xmm0
testq %r13, %r13
jle 0x3e85
xorl %r10d, %r10d
movss (%r14,%r10,4), %xmm1
mulss (%r9,%r10,4), %xmm1
addss %xmm1, %xmm0
incq %r10
cmpq %r10, %r13
jne 0x3e6d
movaps %xmm0, %xmm1
andps %xmm5, %xmm1
ucomiss %xmm2, %xmm1
jae 0x3f1d
movq 0x18(%rcx), %r10
movsbl (%r10,%r8), %r10d
movl $0x1, %r11d
addss %xmm2, %xmm0
mulss %xmm4, %xmm0
cvttss2si %xmm0, %r12d
subl %r10d, %r11d
xorps %xmm0, %xmm0
cvtsi2ss %r11d, %xmm0
movslq %r12d, %r10
subss (%rdi,%r10,4), %xmm0
mulss 0x73bc(%rip), %xmm0     # 0xb288
testq %r13, %r13
jle 0x3ef2
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 0x3ed4
testq %r13, %r13
movq 0x58(%rsp), %r12
jle 0x3f1d
xorl %r10d, %r10d
movss (%r14,%r10,4), %xmm1
mulss %xmm0, %xmm1
addss (%r9,%r10,4), %xmm1
movss %xmm1, (%r9,%r10,4)
incq %r10
cmpq %r10, %r13
jne 0x3eff
incq %r8
cmpq %rax, %r8
jne 0x3e56
movl 0x7361(%rip), %esi      # 0xb290
testl %esi, %esi
jle 0x4073
incq %rsi
movq 0x75af(%rip), %rdi      # 0xb4f0
movq 0x7548(%rip), %r8       # 0xb490
decq %r8
movq 0x757e(%rip), %r9       # 0xb4d0
movq 0x757f(%rip), %r10      # 0xb4d8
xorl %r11d, %r11d
testq %r11, %r11
je 0x3fb6
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 (%rdi,%rcx,4), %rdx
testq %rdx, %rdx
jne 0x3fa9
movq %rbp, %rax
xorl %edx, %edx
divq %r8
incq %rdx
cmpq %r12, %rdx
je 0x4067
xorl %ecx, %ecx
jmp 0x3fbe
movl $0x1, %ecx
movq %r12, %rdx
imulq %r13, %rdx
leaq (%r9,%rdx,4), %rax
xorps %xmm1, %xmm1
testq %r13, %r13
jle 0x3fe7
xorl %edx, %edx
movss (%r14,%rdx,4), %xmm0
mulss (%rax,%rdx,4), %xmm0
addss %xmm0, %xmm1
incq %rdx
cmpq %rdx, %r13
jne 0x3fd0
ucomiss %xmm2, %xmm1
jbe 0x3ff7
decl %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
jmp 0x4018
ucomiss %xmm1, %xmm3
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
ja 0x4018
addss %xmm2, %xmm1
mulss %xmm4, %xmm1
cvttss2si %xmm1, %ecx
movslq %ecx, %rcx
subss (%r10,%rcx,4), %xmm0
mulss 0x7268(%rip), %xmm0     # 0xb288
testq %r13, %r13
jle 0x4044
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 0x4027
testq %r13, %r13
jle 0x4067
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 0x404b
incq %r11
cmpq %rsi, %r11
jne 0x3f5c
movq 0x20(%rsp), %r10
cmpq %r10, %rbx
jge 0x40f1
movq (%rsp), %rax
movq 0x30(%rsp), %r8
subq %r8, %rax
movq 0x7430(%rip), %rcx      # 0xb4c0
movq 0x8(%rsp), %r9
cmpq %r8, %rbx
jne 0x40a4
incq %rbx
cmpq %r10, %rbx
jl 0x4095
jmp 0x40f6
movq %rbx, %rdx
addq %rax, %rdx
js 0x409a
cmpq %r9, %rdx
jge 0x409a
testq %r13, %r13
setle %sil
movq 0x90(%rsp,%rdx,8), %rdx
cmpq $-0x1, %rdx
sete %dil
orb %sil, %dil
jne 0x409a
imulq %r13, %rdx
leaq (%rcx,%rdx,4), %rdx
xorl %esi, %esi
movss (%r15,%rsi,4), %xmm0
addss (%rdx,%rsi,4), %xmm0
movss %xmm0, (%rdx,%rsi,4)
incq %rsi
cmpq %rsi, %r13
jne 0x40d7
jmp 0x409a
movq 0x8(%rsp), %r9
movq (%rsp), %rcx
incq %rcx
movq %rcx, (%rsp)
cmpq %r9, %rcx
movl $0x0, %eax
cmovgeq %rax, %r9
movq 0x50(%rsp), %r13
movq 0x88(%rsp), %rbx
jmp 0x361f
subq 0x28(%rsp), %rbx
addq %rbx, 0x7375(%rip)      # 0xb4a0
decq 0x60(%rsp)
jne 0x35eb
movq %r13, %rdi
callq 0x2220
movq %r14, %rdi
callq 0x22b0
movq %r15, %rdi
callq 0x22b0
xorl %edi, %edi
callq 0x2400