// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/hmm.c
// Function: gt_hmm_init_random
void gt_hmm_init_random(GtHMM *hmm)
{
  double random_value, cumulative_prob;
  unsigned int i, j;
  gt_assert(hmm);

  /* initialize initial state probabilities in random fashion */
  cumulative_prob = 0.0;
  for (i = 0; i < hmm->num_of_states - 1; i++) {
    random_value = gt_rand_max_double(1.0 - cumulative_prob);
    gt_hmm_set_initial_state_probability(hmm, i, random_value);
    cumulative_prob += random_value;
  }
  gt_assert(cumulative_prob <= 1.0);
  gt_hmm_set_initial_state_probability(hmm, i,  1.0 - cumulative_prob);

  /* initialize transition probabilities in random fashion */
  for (i = 0; i < hmm->num_of_states; i++) {
    cumulative_prob = 0.0;
    for (j = 0; j < hmm->num_of_states - 1; j++) {
      random_value = gt_rand_max_double(1.0 - cumulative_prob);
      gt_hmm_set_transition_probability(hmm, i, j, random_value);
      cumulative_prob += random_value;
    }
    gt_assert(cumulative_prob <= 1.0);
    gt_hmm_set_transition_probability(hmm, i, j, 1.0 - cumulative_prob);
  }

  /* initialize emission probabilities in random fashion */
  for (i = 0; i < hmm->num_of_states; i++) {
    cumulative_prob = 0.0;
    for (j = 0; j < hmm->num_of_symbols - 1; j++) {
      random_value = gt_rand_max_double(1.0 - cumulative_prob);
      gt_hmm_set_emission_probability(hmm, i, j, random_value);
      cumulative_prob += random_value;
    }
    gt_assert(cumulative_prob <= 1.0);
    gt_hmm_set_emission_probability(hmm, i, j, 1.0 - cumulative_prob);
  }

  gt_assert(gt_hmm_is_valid(hmm));
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x18b5a9
movq 0x4b0a28(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x38aa91(%rip), %rsi    # 0x516013
leaq 0x38ee2d(%rip), %rdx    # 0x51a3b6
leaq 0x3ca078(%rip), %rcx    # 0x555608
leaq 0x3c9ec4(%rip), %r8     # 0x55545b
movl $0x107, %r9d            # imm = 0x107
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x18b5ab
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x20(%rsp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jae 0x18b61a
movsd 0x38bc6a(%rip), %xmm0   # 0x517240
subsd 0x10(%rsp), %xmm0
callq 0xec470
movsd %xmm0, 0x18(%rsp)
movq 0x20(%rsp), %rdi
movl 0xc(%rsp), %esi
movsd 0x18(%rsp), %xmm0
callq 0x18a860
movsd 0x18(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x18b5bc
jmp 0x18b61c
movsd 0x38bc1c(%rip), %xmm0   # 0x517240
ucomisd 0x10(%rsp), %xmm0
jae 0x18b664
movq 0x4b096d(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x38a9d6(%rip), %rsi    # 0x516013
leaq 0x3c9fd7(%rip), %rdx    # 0x55561b
leaq 0x3c9fbd(%rip), %rcx    # 0x555608
leaq 0x3c9e09(%rip), %r8     # 0x55545b
movl $0x110, %r9d            # imm = 0x110
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x18b666
movq 0x20(%rsp), %rdi
movl 0xc(%rsp), %esi
movsd 0x38bbc9(%rip), %xmm0   # 0x517240
subsd 0x10(%rsp), %xmm0
callq 0x18a860
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl (%rcx), %eax
jae 0x18b78a
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
movq 0x20(%rsp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jae 0x18b70e
movsd 0x38bb7a(%rip), %xmm0   # 0x517240
subsd 0x10(%rsp), %xmm0
callq 0xec470
movsd %xmm0, 0x18(%rsp)
movq 0x20(%rsp), %rdi
movl 0xc(%rsp), %esi
movl 0x8(%rsp), %edx
movsd 0x18(%rsp), %xmm0
callq 0x18a9b0
movsd 0x18(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x18b6ac
jmp 0x18b710
movsd 0x38bb28(%rip), %xmm0   # 0x517240
ucomisd 0x10(%rsp), %xmm0
jae 0x18b758
movq 0x4b0879(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x38a8e2(%rip), %rsi    # 0x516013
leaq 0x3c9ee3(%rip), %rdx    # 0x55561b
leaq 0x3c9ec9(%rip), %rcx    # 0x555608
leaq 0x3c9d15(%rip), %r8     # 0x55545b
movl $0x11b, %r9d            # imm = 0x11B
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x18b75a
movq 0x20(%rsp), %rdi
movl 0xc(%rsp), %esi
movl 0x8(%rsp), %edx
movsd 0x38bad1(%rip), %xmm0   # 0x517240
subsd 0x10(%rsp), %xmm0
callq 0x18a9b0
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x18b68a
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl (%rcx), %eax
jae 0x18b893
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
movq 0x20(%rsp), %rcx
movl 0x4(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jae 0x18b817
movsd 0x38ba71(%rip), %xmm0   # 0x517240
subsd 0x10(%rsp), %xmm0
callq 0xec470
movsd %xmm0, 0x18(%rsp)
movq 0x20(%rsp), %rdi
movl 0xc(%rsp), %esi
movl 0x8(%rsp), %edx
movsd 0x18(%rsp), %xmm0
callq 0x18ab50
movsd 0x18(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x18b7b4
jmp 0x18b819
movsd 0x38ba1f(%rip), %xmm0   # 0x517240
ucomisd 0x10(%rsp), %xmm0
jae 0x18b861
movq 0x4b0770(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x38a7d9(%rip), %rsi    # 0x516013
leaq 0x3c9dda(%rip), %rdx    # 0x55561b
leaq 0x3c9dc0(%rip), %rcx    # 0x555608
leaq 0x3c9c0c(%rip), %r8     # 0x55545b
movl $0x127, %r9d            # imm = 0x127
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x18b863
movq 0x20(%rsp), %rdi
movl 0xc(%rsp), %esi
movl 0x8(%rsp), %edx
movsd 0x38b9c8(%rip), %xmm0   # 0x517240
subsd 0x10(%rsp), %xmm0
callq 0x18ab50
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x18b792
jmp 0x18b895
movq 0x20(%rsp), %rdi
callq 0x18b260
testb $0x1, %al
jne 0x18b8db
movq 0x4b06f6(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x38a75f(%rip), %rsi    # 0x516013
leaq 0x3c9d77(%rip), %rdx    # 0x555632
leaq 0x3c9d46(%rip), %rcx    # 0x555608
leaq 0x3c9b92(%rip), %r8     # 0x55545b
movl $0x12b, %r9d            # imm = 0x12B
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x18b8dd
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)