// File: /workspace/github_c_makefile_star2_O2/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, %r12
movq 0x7f44(%rip), %rax      # 0xb288
movq %rax, 0x60(%rsp)
movq 0x7f30(%rip), %rbx      # 0xb280
pushq $0x4
popq %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2160
movq %rax, %r14
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2160
movq %rax, %r15
leaq 0x7f49(%rip), %rdi      # 0xb2c0
leaq 0x3cf7(%rip), %rsi      # 0x7075
callq 0x2280
movq %rax, 0x30(%rsp)
movq $0x0, (%rsp)
movq %r12, 0x68(%rsp)
movq %r12, %rbx
movq 0x8109(%rip), %rax      # 0xb4a8
movslq 0x7eca(%rip), %rcx      # 0xb270
cqto
idivq %rcx
imulq 0x68(%rsp), %rax
movq 0x30(%rsp), %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x2250
movq $0x0, 0x8(%rsp)
movq $0x0, 0x18(%rsp)
xorl %esi, %esi
movq 0x8(%rsp), %rax
subq 0x18(%rsp), %rax
cmpq $0x2711, %rax           # imm = 0x2711
jl 0x350f
addq 0x80af(%rip), %rax      # 0xb4a0
movq %rax, 0x80a8(%rip)      # 0xb4a0
cmpl $0x2, 0x7e65(%rip)      # 0xb264
jl 0x3499
movq %rsi, %r12
callq 0x2170
cvtsi2ssq 0x808a(%rip), %xmm2 # 0xb4a0
movq 0x807b(%rip), %rcx      # 0xb498
imulq 0x7e63(%rip), %rcx      # 0xb288
incq %rcx
cvtsi2ss %rcx, %xmm1
cvtss2sd 0x7e5b(%rip), %xmm0     # 0xb290
movaps %xmm2, %xmm3
divss %xmm1, %xmm3
mulss 0x3be8(%rip), %xmm3     # 0x702c
cvtss2sd %xmm3, %xmm1
subq 0x8091(%rip), %rax      # 0xb4e0
incq %rax
cvtsi2ss %rax, %xmm3
divss 0x3bd1(%rip), %xmm3     # 0x7030
mulss 0x3bcd(%rip), %xmm3     # 0x7034
divss %xmm3, %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x3c4a(%rip), %rdi      # 0x70c0
pushq $0xd
popq %rsi
movb $0x3, %al
callq 0x2050
movq 0x7b49(%rip), %rax      # 0xafd0
movq (%rax), %rdi
callq 0x2270
movq %r12, %rsi
movq 0x8007(%rip), %rax      # 0xb4a0
cvtsi2ss %rax, %xmm0
movq 0x7ff3(%rip), %rax      # 0xb498
imulq 0x7ddb(%rip), %rax      # 0xb288
incq %rax
cvtsi2ss %rax, %xmm1
movss 0x7ffb(%rip), %xmm2     # 0xb4b8
divss %xmm1, %xmm0
movss 0x3b6f(%rip), %xmm1     # 0x7038
subss %xmm0, %xmm1
mulss %xmm2, %xmm1
movss %xmm1, 0x7db7(%rip)     # 0xb290
cvtss2sd %xmm1, %xmm1
cvtss2sd %xmm2, %xmm0
mulsd 0x3b37(%rip), %xmm0     # 0x7020
ucomisd %xmm1, %xmm0
movq 0x8(%rsp), %rax
movq %rax, 0x18(%rsp)
jbe 0x350f
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x7d8b(%rip)     # 0xb290
movq 0x8(%rsp), %rax
movq %rax, 0x18(%rsp)
testq %rsi, %rsi
jne 0x3626
xorl %r12d, %r12d
movq 0x30(%rsp), %rbp
movq %rbp, %rdi
callq 0x28ab
movl %eax, %r13d
movq %rbp, %rdi
callq 0x2370
testl %eax, %eax
jne 0x361b
cmpl $-0x1, %r13d
je 0x351b
incq 0x8(%rsp)
testl %r13d, %r13d
je 0x361b
movslq %r13d, %r13
movss 0x7d3a(%rip), %xmm1     # 0xb294
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jbe 0x35f3
movq 0x7f0b(%rip), %rax      # 0xb478
imulq $0x28, %r13, %rbp
cvtsi2ssq (%rax,%rbp), %xmm0
cvtsi2ssq 0x7f18(%rip), %xmm2 # 0xb498
mulss %xmm2, %xmm1
xorps %xmm2, %xmm2
divss %xmm1, %xmm0
ucomiss %xmm2, %xmm0
jb 0x3596
sqrtss %xmm0, %xmm0
jmp 0x359b
callq 0x2420
cvtsi2ssq 0x7ef4(%rip), %xmm1 # 0xb498
mulss 0x7ce8(%rip), %xmm1     # 0xb294
movq 0x7ec5(%rip), %rax      # 0xb478
cvtsi2ssq (%rax,%rbp), %xmm2
addss 0x3a77(%rip), %xmm0     # 0x7038
mulss %xmm0, %xmm1
movabsq $0x5deece66d, %rax      # imm = 0x5DEECE66D
imulq %rax, %rbx
addq $0xb, %rbx
movzwl %bx, %eax
cvtsi2ss %eax, %xmm0
divss %xmm2, %xmm1
mulss 0x3a3e(%rip), %xmm0     # 0x7028
ucomiss %xmm1, %xmm0
ja 0x351b
movq %r13, 0x90(%rsp,%r12,8)
incq %r12
movl $0x3e8, %esi            # imm = 0x3E8
movl $0x0, %eax
movq %rax, (%rsp)
cmpq $0x3e8, %r12            # imm = 0x3E8
jne 0x351b
jmp 0x3626
movq $0x0, (%rsp)
movq %r12, %rsi
movq %rsi, 0x20(%rsp)
movq 0x30(%rsp), %rdi
callq 0x2370
testl %eax, %eax
jne 0x3dc9
movq 0x7e54(%rip), %rax      # 0xb498
movslq 0x7c25(%rip), %rcx      # 0xb270
cqto
idivq %rcx
cmpq %rax, 0x8(%rsp)
jg 0x3dc9
movq (%rsp), %rax
movq 0x90(%rsp,%rax,8), %rax
movq %rax, 0x10(%rsp)
cmpq $-0x1, %rax
movq 0x20(%rsp), %rsi
je 0x33d4
movq 0x7bfe(%rip), %rbp      # 0xb280
testq %rbp, %rbp
movl $0x0, %edi
cmovgq %rbp, %rdi
xorl %eax, %eax
cmpq %rax, %rdi
je 0x369f
andl $0x0, (%r14,%rax,4)
incq %rax
jmp 0x3690
xorl %eax, %eax
movss 0x3993(%rip), %xmm2     # 0x703c
movss 0x3993(%rip), %xmm3     # 0x7044
movss 0x3987(%rip), %xmm4     # 0x7040
movaps 0x3990(%rip), %xmm5     # 0x7050
cmpq %rax, %rdi
je 0x36cf
andl $0x0, (%r15,%rax,4)
incq %rax
jmp 0x36c0
movabsq $0x5deece66d, %rax      # imm = 0x5DEECE66D
imulq %rax, %rbx
addq $0xb, %rbx
movslq 0x7b80(%rip), %r12      # 0xb268
movq %rbx, %rax
xorl %edx, %edx
divq %r12
movq %rdx, %rcx
leaq 0x1(,%r12,2), %r11
subq %rdx, %r11
movq (%rsp), %rax
subq %r12, %rax
movq %rax, 0x40(%rsp)
cmpl $0x0, 0x7b4f(%rip)      # 0xb260
movq %rbp, 0x50(%rsp)
movq %r12, 0x28(%rsp)
je 0x39ff
movq 0x7d98(%rip), %rdx      # 0xb4c0
xorl %eax, %eax
movq %rcx, %r8
cmpq %r11, %r8
jge 0x3783
cmpq %r12, %r8
je 0x377e
movq %r8, %r9
addq 0x40(%rsp), %r9
js 0x377e
cmpq %rsi, %r9
jge 0x377e
movq 0x90(%rsp,%r9,8), %r9
cmpq $-0x1, %r9
je 0x377e
imulq %rbp, %r9
leaq (%rdx,%r9,4), %r9
xorl %r10d, %r10d
cmpq %r10, %rdi
je 0x377b
movss (%r9,%r10,4), %xmm0
addss (%r14,%r10,4), %xmm0
movss %xmm0, (%r14,%r10,4)
incq %r10
jmp 0x375f
incq %rax
incq %r8
jmp 0x372d
testq %rax, %rax
je 0x3d47
cvtsi2ss %rax, %xmm0
xorl %eax, %eax
cmpq %rax, %rdi
je 0x37ad
movss (%r14,%rax,4), %xmm1
divss %xmm0, %xmm1
movss %xmm1, (%r14,%rax,4)
incq %rax
jmp 0x3793
movq %r11, 0x38(%rsp)
cmpl $0x0, 0x7d2f(%rip)      # 0xb4e8
je 0x38cb
movq 0x7cb2(%rip), %rdx      # 0xb478
imulq $0x28, 0x10(%rsp), %r8
leaq (%rdx,%r8), %rax
addq %r8, %rdx
addq $0x18, %rdx
movl 0x8(%rdx), %r9d
movq 0x7cf6(%rip), %r8       # 0xb4d8
testb %r9b, %r9b
movl $0x0, %esi
cmovlel %esi, %r9d
movzbl %r9b, %r10d
xorl %r11d, %r11d
cmpq %r10, %r11
je 0x38cb
movq 0x8(%rax), %r9
movslq (%r9,%r11,4), %r12
imulq %rbp, %r12
shlq $0x2, %r12
addq 0x7cb3(%rip), %r12      # 0xb4c8
xorps %xmm0, %xmm0
xorl %r9d, %r9d
cmpq %r9, %rdi
je 0x3835
movss (%r14,%r9,4), %xmm1
mulss (%r12,%r9,4), %xmm1
addss %xmm1, %xmm0
incq %r9
jmp 0x381b
movaps %xmm0, %xmm1
andps %xmm5, %xmm1
ucomiss %xmm2, %xmm1
jae 0x38be
addss %xmm2, %xmm0
mulss %xmm4, %xmm0
cvttss2si %xmm0, %r9d
movq (%rdx), %r13
movsbl (%r13,%r11), %ebp
pushq $0x1
popq %r13
subl %ebp, %r13d
cvtsi2ss %r13d, %xmm0
movslq %r9d, %r9
subss (%r8,%r9,4), %xmm0
mulss 0x7a1d(%rip), %xmm0     # 0xb290
xorl %r9d, %r9d
cmpq %r9, %rdi
je 0x3896
movss (%r12,%r9,4), %xmm1
mulss %xmm0, %xmm1
addss (%r15,%r9,4), %xmm1
movss %xmm1, (%r15,%r9,4)
incq %r9
jmp 0x3876
xorl %r9d, %r9d
movq 0x50(%rsp), %rbp
cmpq %r9, %rdi
je 0x38be
movss (%r14,%r9,4), %xmm1
mulss %xmm0, %xmm1
addss (%r12,%r9,4), %xmm1
movss %xmm1, (%r12,%r9,4)
incq %r9
jmp 0x389e
incq %r11
movq 0x28(%rsp), %r12
jmp 0x37f5
movl 0x79c6(%rip), %r11d     # 0xb298
testl %r11d, %r11d
jle 0x3d68
incq %r11
movq 0x7c0b(%rip), %r8       # 0xb4f0
movq 0x7ba4(%rip), %r12      # 0xb490
decq %r12
movq 0x7be2(%rip), %r13      # 0xb4d8
xorl %r10d, %r10d
cmpq %r11, %r10
je 0x3d63
testq %r10, %r10
je 0x394c
movabsq $0x5deece66d, %rax      # imm = 0x5DEECE66D
imulq %rax, %rbx
addq $0xb, %rbx
movq %rbx, %rax
shrq $0x10, %rax
xorl %edx, %edx
movl $0x5f5e100, %esi        # imm = 0x5F5E100
divq %rsi
movl %edx, %eax
movslq (%r8,%rax,4), %rdx
testq %rdx, %rdx
jne 0x3940
movq %rbx, %rax
xorl %edx, %edx
divq %r12
incq %rdx
cmpq 0x10(%rsp), %rdx
jne 0x3956
incq %r10
jmp 0x38f9
movq 0x10(%rsp), %rdx
pushq $0x1
popq %rax
jmp 0x3958
xorl %eax, %eax
imulq %rbp, %rdx
shlq $0x2, %rdx
addq 0x7b69(%rip), %rdx      # 0xb4d0
xorps %xmm1, %xmm1
xorl %r9d, %r9d
cmpq %r9, %rdi
je 0x3987
movss (%r14,%r9,4), %xmm0
mulss (%rdx,%r9,4), %xmm0
addss %xmm0, %xmm1
incq %r9
jmp 0x396d
ucomiss %xmm2, %xmm1
jbe 0x3994
decl %eax
cvtsi2ss %eax, %xmm0
jmp 0x39b2
ucomiss %xmm1, %xmm3
cvtsi2ss %eax, %xmm0
ja 0x39b2
addss %xmm2, %xmm1
mulss %xmm4, %xmm1
cvttss2si %xmm1, %eax
cltq
subss (%r13,%rax,4), %xmm0
mulss 0x78d6(%rip), %xmm0     # 0xb290
xorl %eax, %eax
cmpq %rax, %rdi
je 0x39db
movss (%rdx,%rax,4), %xmm1
mulss %xmm0, %xmm1
addss (%r15,%rax,4), %xmm1
movss %xmm1, (%r15,%rax,4)
incq %rax
jmp 0x39bc
xorl %eax, %eax
cmpq %rax, %rdi
je 0x3947
movss (%r14,%rax,4), %xmm1
mulss %xmm0, %xmm1
addss (%rdx,%rax,4), %xmm1
movss %xmm1, (%rdx,%rax,4)
incq %rax
jmp 0x39dd
movq %r11, 0x38(%rsp)
movl 0x7ade(%rip), %eax      # 0xb4e8
movl %eax, 0x4c(%rsp)
movq 0x7a63(%rip), %rax      # 0xb478
imulq $0x28, 0x10(%rsp), %rdx
leaq (%rax,%rdx), %rsi
movq %rsi, 0x58(%rsp)
addq %rdx, %rax
addq $0x18, %rax
movq %rax, 0x88(%rsp)
movl 0x785f(%rip), %eax      # 0xb298
movq %rax, 0x70(%rsp)
leal 0x1(%rax), %r11d
cmpq 0x38(%rsp), %rcx
jge 0x3d42
cmpq %r12, %rcx
je 0x3d3a
movq %rcx, %rax
addq 0x40(%rsp), %rax
js 0x3d3a
cmpq 0x20(%rsp), %rax
jge 0x3d3a
movq 0x90(%rsp,%rax,8), %r12
cmpq $-0x1, %r12
je 0x3d35
xorl %eax, %eax
cmpq %rax, %rdi
je 0x3a92
andl $0x0, (%r15,%rax,4)
incq %rax
jmp 0x3a83
imulq %rbp, %r12
cmpl $0x0, 0x4c(%rsp)
je 0x3baf
movq 0x58(%rsp), %rax
movl 0x20(%rax), %edx
movq 0x7a28(%rip), %rax      # 0xb4d8
testb %dl, %dl
movl $0x0, %esi
cmovlel %esi, %edx
movzbl %dl, %edx
xorl %r8d, %r8d
cmpq %rdx, %r8
je 0x3baf
movq 0x58(%rsp), %rsi
movq 0x8(%rsi), %r9
movslq (%r9,%r8,4), %r10
imulq %rbp, %r10
leaq (,%r12,4), %r13
addq 0x79d7(%rip), %r13      # 0xb4c0
shlq $0x2, %r10
addq 0x79d4(%rip), %r10      # 0xb4c8
xorps %xmm0, %xmm0
xorl %r9d, %r9d
cmpq %r9, %rdi
je 0x3b15
movss (%r13,%r9,4), %xmm1
mulss (%r10,%r9,4), %xmm1
addss %xmm1, %xmm0
incq %r9
jmp 0x3afa
movaps %xmm0, %xmm1
andps %xmm5, %xmm1
ucomiss %xmm2, %xmm1
jae 0x3ba7
addss %xmm2, %xmm0
mulss %xmm4, %xmm0
cvttss2si %xmm0, %r9d
movq 0x88(%rsp), %rsi
movq (%rsi), %rbp
movsbl (%rbp,%r8), %ebp
pushq $0x1
popq %rsi
subl %ebp, %esi
cvtsi2ss %esi, %xmm0
movslq %r9d, %rsi
subss (%rax,%rsi,4), %xmm0
mulss 0x7735(%rip), %xmm0     # 0xb290
xorl %r9d, %r9d
cmpq %r9, %rdi
je 0x3b7e
movss (%r10,%r9,4), %xmm1
mulss %xmm0, %xmm1
addss (%r15,%r9,4), %xmm1
movss %xmm1, (%r15,%r9,4)
incq %r9
jmp 0x3b5e
xorl %r9d, %r9d
movq 0x50(%rsp), %rbp
cmpq %r9, %rdi
je 0x3ba7
movss (%r13,%r9,4), %xmm1
mulss %xmm0, %xmm1
addss (%r10,%r9,4), %xmm1
movss %xmm1, (%r10,%r9,4)
incq %r9
jmp 0x3b86
incq %r8
jmp 0x3ac0
cmpl $0x0, 0x70(%rsp)
jle 0x3d0c
movq 0x792f(%rip), %r13      # 0xb4f0
movq 0x78c8(%rip), %rax      # 0xb490
decq %rax
movq %rax, 0x80(%rsp)
movq 0x78fe(%rip), %rax      # 0xb4d8
movq %rax, 0x78(%rsp)
xorl %r10d, %r10d
cmpq %r11, %r10
je 0x3d0c
testq %r10, %r10
je 0x3c3b
movabsq $0x5deece66d, %rax      # imm = 0x5DEECE66D
imulq %rax, %rbx
addq $0xb, %rbx
movq %rbx, %rax
shrq $0x10, %rax
xorl %edx, %edx
movl $0x5f5e100, %esi        # imm = 0x5F5E100
divq %rsi
movl %edx, %eax
movslq (%r13,%rax,4), %rdx
testq %rdx, %rdx
jne 0x3c2f
movq %rbx, %rax
xorl %edx, %edx
divq 0x80(%rsp)
incq %rdx
cmpq 0x10(%rsp), %rdx
jne 0x3c46
incq %r10
jmp 0x3be2
movq 0x10(%rsp), %rdx
pushq $0x1
popq %r9
jmp 0x3c49
xorl %r9d, %r9d
imulq %rbp, %rdx
leaq (,%r12,4), %rax
addq 0x7864(%rip), %rax      # 0xb4c0
shlq $0x2, %rdx
addq 0x7869(%rip), %rdx      # 0xb4d0
xorps %xmm1, %xmm1
xorl %r8d, %r8d
cmpq %r8, %rdi
je 0x3c87
movss (%rax,%r8,4), %xmm0
mulss (%rdx,%r8,4), %xmm0
addss %xmm0, %xmm1
incq %r8
jmp 0x3c6d
ucomiss %xmm2, %xmm1
jbe 0x3c96
decl %r9d
cvtsi2ss %r9d, %xmm0
jmp 0x3cba
ucomiss %xmm1, %xmm3
cvtsi2ss %r9d, %xmm0
ja 0x3cba
addss %xmm2, %xmm1
mulss %xmm4, %xmm1
cvttss2si %xmm1, %esi
movslq %esi, %rsi
movq 0x78(%rsp), %r8
subss (%r8,%rsi,4), %xmm0
mulss 0x75ce(%rip), %xmm0     # 0xb290
xorl %r8d, %r8d
cmpq %r8, %rdi
je 0x3ce5
movss (%rdx,%r8,4), %xmm1
mulss %xmm0, %xmm1
addss (%r15,%r8,4), %xmm1
movss %xmm1, (%r15,%r8,4)
incq %r8
jmp 0x3cc5
xorl %r8d, %r8d
cmpq %r8, %rdi
je 0x3c36
movss (%rax,%r8,4), %xmm1
mulss %xmm0, %xmm1
addss (%rdx,%r8,4), %xmm1
movss %xmm1, (%rdx,%r8,4)
incq %r8
jmp 0x3ce8
shlq $0x2, %r12
addq 0x77a9(%rip), %r12      # 0xb4c0
xorl %eax, %eax
cmpq %rax, %rdi
je 0x3d35
movss (%r15,%rax,4), %xmm0
addss (%r12,%rax,4), %xmm0
movss %xmm0, (%r12,%rax,4)
incq %rax
jmp 0x3d19
movq 0x28(%rsp), %r12
incq %rcx
jmp 0x3a42
movq 0x20(%rsp), %rsi
movq (%rsp), %rcx
incq %rcx
movq %rcx, (%rsp)
cmpq %rsi, %rcx
movl $0x0, %eax
cmovgeq %rax, %rsi
jmp 0x33d4
movq 0x28(%rsp), %r12
movq 0x20(%rsp), %rsi
movq 0x38(%rsp), %r8
cmpq %r8, %rcx
jge 0x3d47
cmpq %r12, %rcx
jne 0x3d81
incq %rcx
jmp 0x3d72
movq %rcx, %rax
addq 0x40(%rsp), %rax
js 0x3d7c
cmpq %rsi, %rax
jge 0x3d7c
movq 0x90(%rsp,%rax,8), %rax
cmpq $-0x1, %rax
je 0x3d7c
imulq %rbp, %rax
shlq $0x2, %rax
addq 0x7713(%rip), %rax      # 0xb4c0
xorl %edx, %edx
cmpq %rdx, %rdi
je 0x3d7c
movss (%r15,%rdx,4), %xmm0
addss (%rax,%rdx,4), %xmm0
movss %xmm0, (%rax,%rdx,4)
incq %rdx
jmp 0x3daf
movq 0x8(%rsp), %rax
subq 0x18(%rsp), %rax
addq %rax, 0x76c6(%rip)      # 0xb4a0
decq 0x60(%rsp)
jne 0x3398
movq 0x30(%rsp), %rdi
callq 0x2210
movq %r14, %rdi
callq 0x2290
movq %r15, %rdi
callq 0x2290
xorl %edi, %edi
callq 0x2400