// File: /workspace/github_c_makefile_star2_O0/josch[P]stride/measure.c
// Function: Sov
int Sov(char *Asn1, int L1, char *Asn2, int L2, char SecStr, float Threshold, float *Q2)
{
  int Bound1[MAX_ASSIGN][2], Bound2[MAX_ASSIGN][2], Length1[MAX_ASSIGN], 
      Length2[MAX_ASSIGN], NSeg1, NSeg2;
  int Overlap, MaxOverlap, TP=0, FN=0;
  register int i, j;

  NSeg1 = Boundaries(Asn1,L1,SecStr,Bound1);
  NSeg2 = Boundaries(Asn2,L2,SecStr,Bound2);
  

  for(i=0; i<NSeg1; i++)
    Length1[i] = Bound1[i][1]-Bound1[i][0]+1;

  for(j=0; j<NSeg2; j++)
    Length2[j] = Bound2[j][1]-Bound2[j][0]+1;
									    
  for(i=0; i<NSeg1; i++) {
    MaxOverlap = 0;
    for(j=0; j<NSeg2; j++) {
      
      if( Bound1[i][0] > Bound2[j][1] || Bound1[i][1] < Bound2[j][0] ) /*No overlap */
	Overlap = 0;
      else if ( Bound2[j][0] >= Bound1[i][0] && Bound2[j][1] <= Bound1[i][1] ) /* j inside i */
	Overlap = Length2[j];
      else if ( Bound1[i][0] <= Bound2[j][0] ) /* j shifted to the right with respect to i */ 
	Overlap = Minimum(Bound2[j][1]-Bound2[j][0],Bound1[i][1]-Bound2[j][0])+1;
      else if( Bound1[i][0] >= Bound2[j][0] ) /* i shifted to the right with respect to j */
	Overlap = Minimum(Bound2[j][1]-Bound2[j][0],Bound2[j][1]-Bound1[i][0])+1;
      else
	Overlap = Length1[i]; /* i inside j */
      if( Overlap > MaxOverlap ) MaxOverlap = Overlap;
    }
    if( (float)MaxOverlap/(float)Length1[i] >= Threshold ) 
      TP++;
    else
      FN++;
  }
  if( TP+FN != 0 )
    *Q2 = (float)TP/((float)TP+(float)FN);
  else
    *Q2 = -1.0;
/*  O  = (float)TP/((float)TP+(float)FN);*/
  return(1);
}

// Assembly:
subq $0x2f48, %rsp           # imm = 0x2F48
movb %r8b, %al
movq %rdi, 0x2f40(%rsp)
movl %esi, 0x2f3c(%rsp)
movq %rdx, 0x2f30(%rsp)
movl %ecx, 0x2f2c(%rsp)
movb %al, 0x2f2b(%rsp)
movss %xmm0, 0x2f24(%rsp)
movq %r9, 0x2f18(%rsp)
movl $0x0, 0x1c(%rsp)
movl $0x0, 0x18(%rsp)
movq 0x2f40(%rsp), %rdi
movl 0x2f3c(%rsp), %esi
movb 0x2f2b(%rsp), %al
leaq 0x1f70(%rsp), %rcx
movsbl %al, %edx
callq 0x61f0
movl %eax, 0x2c(%rsp)
movq 0x2f30(%rsp), %rdi
movl 0x2f2c(%rsp), %esi
movb 0x2f2b(%rsp), %al
leaq 0xfd0(%rsp), %rcx
movsbl %al, %edx
callq 0x61f0
movl %eax, 0x28(%rsp)
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x2c(%rsp), %eax
jge 0x28dda
movslq 0x14(%rsp), %rax
movl 0x1f74(%rsp,%rax,8), %ecx
movslq 0x14(%rsp), %rax
subl 0x1f70(%rsp,%rax,8), %ecx
addl $0x1, %ecx
movslq 0x14(%rsp), %rax
movl %ecx, 0x800(%rsp,%rax,4)
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x28d9c
movl $0x0, 0x10(%rsp)
movl 0x10(%rsp), %eax
cmpl 0x28(%rsp), %eax
jge 0x28e1d
movslq 0x10(%rsp), %rax
movl 0xfd4(%rsp,%rax,8), %ecx
movslq 0x10(%rsp), %rax
subl 0xfd0(%rsp,%rax,8), %ecx
addl $0x1, %ecx
movslq 0x10(%rsp), %rax
movl %ecx, 0x30(%rsp,%rax,4)
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x28de2
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x2c(%rsp), %eax
jge 0x2908b
movl $0x0, 0x20(%rsp)
movl $0x0, 0x10(%rsp)
movl 0x10(%rsp), %eax
cmpl 0x28(%rsp), %eax
jge 0x2903f
movslq 0x14(%rsp), %rax
movl 0x1f70(%rsp,%rax,8), %eax
movslq 0x10(%rsp), %rcx
cmpl 0xfd4(%rsp,%rcx,8), %eax
jg 0x28e85
movslq 0x14(%rsp), %rax
movl 0x1f74(%rsp,%rax,8), %eax
movslq 0x10(%rsp), %rcx
cmpl 0xfd0(%rsp,%rcx,8), %eax
jge 0x28e92
movl $0x0, 0x24(%rsp)
jmp 0x2901b
movslq 0x10(%rsp), %rax
movl 0xfd0(%rsp,%rax,8), %eax
movslq 0x14(%rsp), %rcx
cmpl 0x1f70(%rsp,%rcx,8), %eax
jl 0x28ed8
movslq 0x10(%rsp), %rax
movl 0xfd4(%rsp,%rax,8), %eax
movslq 0x14(%rsp), %rcx
cmpl 0x1f74(%rsp,%rcx,8), %eax
jg 0x28ed8
movslq 0x10(%rsp), %rax
movl 0x30(%rsp,%rax,4), %eax
movl %eax, 0x24(%rsp)
jmp 0x29019
movslq 0x14(%rsp), %rax
movl 0x1f70(%rsp,%rax,8), %eax
movslq 0x10(%rsp), %rcx
cmpl 0xfd0(%rsp,%rcx,8), %eax
jg 0x28f70
movslq 0x10(%rsp), %rax
movl 0xfd4(%rsp,%rax,8), %eax
movslq 0x10(%rsp), %rcx
subl 0xfd0(%rsp,%rcx,8), %eax
movslq 0x14(%rsp), %rcx
movl 0x1f74(%rsp,%rcx,8), %ecx
movslq 0x10(%rsp), %rdx
subl 0xfd0(%rsp,%rdx,8), %ecx
cmpl %ecx, %eax
jge 0x28f44
movslq 0x10(%rsp), %rax
movl 0xfd4(%rsp,%rax,8), %eax
movslq 0x10(%rsp), %rcx
subl 0xfd0(%rsp,%rcx,8), %eax
movl %eax, 0xc(%rsp)
jmp 0x28f60
movslq 0x14(%rsp), %rax
movl 0x1f74(%rsp,%rax,8), %eax
movslq 0x10(%rsp), %rcx
subl 0xfd0(%rsp,%rcx,8), %eax
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x29017
movslq 0x14(%rsp), %rax
movl 0x1f70(%rsp,%rax,8), %eax
movslq 0x10(%rsp), %rcx
cmpl 0xfd0(%rsp,%rcx,8), %eax
jl 0x29005
movslq 0x10(%rsp), %rax
movl 0xfd4(%rsp,%rax,8), %eax
movslq 0x10(%rsp), %rcx
subl 0xfd0(%rsp,%rcx,8), %eax
movslq 0x10(%rsp), %rcx
movl 0xfd4(%rsp,%rcx,8), %ecx
movslq 0x14(%rsp), %rdx
subl 0x1f70(%rsp,%rdx,8), %ecx
cmpl %ecx, %eax
jge 0x28fdc
movslq 0x10(%rsp), %rax
movl 0xfd4(%rsp,%rax,8), %eax
movslq 0x10(%rsp), %rcx
subl 0xfd0(%rsp,%rcx,8), %eax
movl %eax, 0x8(%rsp)
jmp 0x28ff8
movslq 0x10(%rsp), %rax
movl 0xfd4(%rsp,%rax,8), %eax
movslq 0x14(%rsp), %rcx
subl 0x1f70(%rsp,%rcx,8), %eax
movl %eax, 0x8(%rsp)
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x29015
movslq 0x14(%rsp), %rax
movl 0x800(%rsp,%rax,4), %eax
movl %eax, 0x24(%rsp)
jmp 0x29017
jmp 0x29019
jmp 0x2901b
movl 0x24(%rsp), %eax
cmpl 0x20(%rsp), %eax
jle 0x2902d
movl 0x24(%rsp), %eax
movl %eax, 0x20(%rsp)
jmp 0x2902f
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x28e43
cvtsi2ssl 0x20(%rsp), %xmm0
movslq 0x14(%rsp), %rax
cvtsi2ssl 0x800(%rsp,%rax,4), %xmm1
divss %xmm1, %xmm0
ucomiss 0x2f24(%rsp), %xmm0
jb 0x2906e
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x29079
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x2907b
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x28e25
movl 0x1c(%rsp), %eax
addl 0x18(%rsp), %eax
cmpl $0x0, %eax
je 0x290c0
cvtsi2ssl 0x1c(%rsp), %xmm0
cvtsi2ssl 0x1c(%rsp), %xmm1
cvtsi2ssl 0x18(%rsp), %xmm2
addss %xmm2, %xmm1
divss %xmm1, %xmm0
movq 0x2f18(%rsp), %rax
movss %xmm0, (%rax)
jmp 0x290d4
movq 0x2f18(%rsp), %rax
movss 0x1f5c(%rip), %xmm0     # 0x2b02c
movss %xmm0, (%rax)
movl $0x1, %eax
addq $0x2f48, %rsp           # imm = 0x2F48
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)