// File: /workspace/github_c_makefile_star2_O0/sc932[P]ALE/src/ALElike.c
// Function: applyDepthAndMatchToContig
int applyDepthAndMatchToContig(alignSet_t *alignment, assemblyT *theAssembly, double likeNormalizer, libraryParametersT *libParams) {
  assert(alignment->likelihood >= 0.0);
  double logLikelihood = validateLogLikelihood( log(alignment->likelihood) );
  double logLikelihoodInsert = validateLogLikelihood( log(alignment->likelihoodInsert) );
  double totalPositionPlaceLogLikelihood = 0.0;
  int j, i;
  int numberMapped = 0;
  double depthContribution;
  double norm = 0.5; // set default to 0.5 (paired reads will hit this function separately)

  enum MATE_ORIENTATION orientation = alignment->orientation;
  double orientationLogLikelihood = log(libParams->mateParameters[orientation].libraryFraction);

  switch(orientation) {
  case(VALID_FR):
  case(VALID_RF):
  case(VALID_FF):
  case(NOT_PROPER_FR):
  case(NOT_PROPER_RF):
  case(NOT_PROPER_FF):
      norm = 1.0; // This function will only be called once for 2 reads
  	  break;

  case(SINGLE_UNMAPPED_MATE):
  case(SINGLE_READ):
  	  orientationLogLikelihood = log(libParams->totalValidSingleFraction); break;
  case(CHIMER):
  	  orientationLogLikelihood = log(libParams->totalChimerMateFraction); break;
  default:
	  break;
  }
  double logLikelihoodPlacement = 0.0;

  // READ 1
  if (alignment->start1 >= 0 && alignment->end1 >= 0 && alignment->contigId1 >= 0 && alignment->contigId1 < theAssembly->numContigs) {
    numberMapped += 1;
    contig_t *contig1 = theAssembly->contigs[alignment->contigId1];
    assert(alignment->start1 < contig1->seqLen);
    assert(alignment->end1 <= contig1->seqLen);
    assert(alignment->start1 < alignment->end1);
    int alignmentLength = alignment->end1 - alignment->start1;
    float depthContributions[alignmentLength];
    double placeLogLikelihoods[alignmentLength];
    logLikelihood += getContributionsForPositions(alignment->bamOfAlignment1, contig1, libParams->qOff, alignmentLength, depthContributions, placeLogLikelihoods, 0);
    i = 0;
    for(j = alignment->start1; j < alignment->end1; j++){
      // DEPTH SCORE
      // discount indels
      depthContribution = depthContributions[i]; //getDepthContributionAtPositionBAM(alignment->bamOfAlignment1, qOff, i);
      contig1->depth[j] += depthContribution;
      theAssembly->overlapAvgSum += depthContribution;      
      //contig1->depth[j] += 1.0; // We picked a winner, it gets full prob

      // PLACEMENT SCORE
      // TODO make it BAM dependent
      // BAMv2 version
      logLikelihoodPlacement = orientationLogLikelihood + placeLogLikelihoods[i]; //exp(getMatchLogLikelihoodAtPosition(alignment->bamOfAlignment1, qOff, i, md1)); // + log(alignment->likelihoodInsert);
      totalPositionPlaceLogLikelihood += placeLogLikelihoods[i];
      i++;
      contig1->matchLogLikelihood[j]  += logLikelihoodPlacement; // will be validated later
      contig1->insertLogLikelihood[j] += logLikelihoodInsert;    // will be validated later
    }
    totalPositionPlaceLogLikelihood -= logzNormalizationReadQual(alignment->bamOfAlignment1, libParams->qOff);

    theAssembly->overlapAvgNorm += 1.0;
    //printf("Pplacement %lf Read1 for %s\n", logLikelihood, bam1_qname(alignment->bamOfAlignment1));
  }

  // READ 2
  // check for a valid read2 entry
  if (alignment->start2 >= 0 && alignment->end2 >= 0 && alignment->contigId2 >= 0 && alignment->contigId2 < theAssembly->numContigs && alignment->start2 != alignment->start1) {
    numberMapped += 1;
    contig_t *contig2 = theAssembly->contigs[alignment->contigId2];
    assert(alignment->start2 < contig2->seqLen);
    assert(alignment->end2 <= contig2->seqLen);
    assert(alignment->start2 < alignment->end2);
    assert(alignment->bamOfAlignment2 != NULL);
    int alignmentLength = alignment->end2 - alignment->start2;
    float depthContributions[alignmentLength];
    double placeLogLikelihoods[alignmentLength];
    logLikelihood += getContributionsForPositions(alignment->bamOfAlignment2, contig2, libParams->qOff, alignmentLength, depthContributions, placeLogLikelihoods, 0);
    i = 0;
    for(j = alignment->start2; j < alignment->end2; j++){
      // DEPTH SCORE
      // discount indels
      depthContribution = depthContributions[i]; // getDepthContributionAtPositionBAM(alignment->bamOfAlignment2, qOff, i);
      contig2->depth[j] += depthContribution;
      theAssembly->overlapAvgSum += depthContribution;
      //contig2->depth[j] += 1.0;
      
      // PLACEMENT SCORE
      // TODO make it BAM dependent
      // BAMv2 version
      logLikelihoodPlacement = orientationLogLikelihood + placeLogLikelihoods[i]; // exp(getMatchLogLikelihoodAtPosition(alignment->bamOfAlignment2, qOff, i, md2)); // + log(alignment->likelihoodInsert);
      totalPositionPlaceLogLikelihood += placeLogLikelihoods[i];
      i++;
      contig2->matchLogLikelihood[j]  += logLikelihoodPlacement; // will be validated later
      contig2->insertLogLikelihood[j] += logLikelihoodInsert;    // will be validated later
    }
    totalPositionPlaceLogLikelihood -= logzNormalizationReadQual(alignment->bamOfAlignment2, libParams->qOff);
    theAssembly->overlapAvgNorm += 1.0;
    //printf("Pplacement %lf Read2 for %s\n", logLikelihood, bam1_qname(alignment->bamOfAlignment2));
  }
  // TOTAL SCORE
  // apply match likelihood to total likelihood
  if(numberMapped == 0){
	  logLikelihood = getMinLogLike();
  } else if (norm != 1.0) {
	  // This function is called once per read.... not per pair for this orientation
	  logLikelihood *= norm;
	  logLikelihoodInsert *= norm;
  }
  // printf("perbase vs perread placement: %lf %lf\n", validateLogLikelihood(totalPositionPlaceLogLikelihood + orientationLogLikelihood), tmpLogLike);
  // mated reads and single reads both only hit the total score once
  theAssembly->totalScore += logLikelihood; // match contribution to totalScore from placement
  theAssembly->placeAvgSum += logLikelihood;
  theAssembly->placeAvgNorm += norm;
  
  // this happens whether double, single or unmapped
  theAssembly->totalScore += logLikelihoodInsert; // match contribution to totalScore from insert
  theAssembly->insertAvgSum += logLikelihoodInsert;
  theAssembly->insertAvgNorm += norm;

  //printf("totalScore: %lf %lf\n", theAssembly->totalScore, theAssembly->insertAvgSum);
  return numberMapped;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movsd %xmm0, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x672f
jmp 0x674e
leaq 0x29ab3(%rip), %rdi     # 0x301e9
leaq 0x29688(%rip), %rsi     # 0x2fdc5
movl $0x448, %edx            # imm = 0x448
leaq 0x29abd(%rip), %rcx     # 0x30206
callq 0x3220
movq -0x8(%rbp), %rax
movsd (%rax), %xmm0
callq 0x3280
callq 0xbe00
movsd %xmm0, -0x28(%rbp)
movq -0x8(%rbp), %rax
movsd 0x8(%rax), %xmm0
callq 0x3280
callq 0xbe00
movsd %xmm0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movl $0x0, -0x44(%rbp)
movabsq $0x3fe0000000000000, %rax # imm = 0x3FE0000000000000
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movl 0x40(%rax), %eax
movl %eax, -0x5c(%rbp)
movq -0x20(%rbp), %rax
movl -0x5c(%rbp), %ecx
shlq $0x6, %rcx
movsd 0x18(%rax,%rcx), %xmm0
callq 0x3280
movsd %xmm0, -0x68(%rbp)
movl -0x5c(%rbp), %eax
movq %rax, -0xc8(%rbp)
subq $0xb, %rax
ja 0x6825
movq -0xc8(%rbp), %rax
leaq 0x254cf(%rip), %rcx     # 0x2bcac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movsd 0x25252(%rip), %xmm0    # 0x2ba40
movsd %xmm0, -0x58(%rbp)
jmp 0x6827
movq -0x20(%rbp), %rax
movsd 0x390(%rax), %xmm0
callq 0x3280
movsd %xmm0, -0x68(%rbp)
jmp 0x6827
movq -0x20(%rbp), %rax
movsd 0x3a0(%rax), %xmm0
callq 0x3280
movsd %xmm0, -0x68(%rbp)
jmp 0x6827
jmp 0x6827
xorps %xmm0, %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jl 0x6b0f
movq -0x8(%rbp), %rax
cmpl $0x0, 0x18(%rax)
jl 0x6b0f
movq -0x8(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jl 0x6b0f
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x6b0f
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
movq -0x10(%rbp), %rax
movq 0xa0(%rax), %rax
movq -0x8(%rbp), %rcx
movslq 0x20(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x78(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x68a2
jmp 0x68c1
leaq 0x299b5(%rip), %rdi     # 0x3025e
leaq 0x29515(%rip), %rsi     # 0x2fdc5
movl $0x46c, %edx            # imm = 0x46C
leaq 0x2994a(%rip), %rcx     # 0x30206
callq 0x3220
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
movq -0x78(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jg 0x68d3
jmp 0x68f2
leaq 0x299a8(%rip), %rdi     # 0x30282
leaq 0x294e4(%rip), %rsi     # 0x2fdc5
movl $0x46d, %edx            # imm = 0x46D
leaq 0x29919(%rip), %rcx     # 0x30206
callq 0x3220
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x6904
jmp 0x6923
leaq 0x2999a(%rip), %rdi     # 0x302a5
leaq 0x294b3(%rip), %rsi     # 0x2fdc5
movl $0x46e, %edx            # imm = 0x46E
leaq 0x298e8(%rip), %rcx     # 0x30206
callq 0x3220
movq -0x8(%rbp), %rax
movl 0x10(%rax), %ecx
movl 0x18(%rax), %eax
subl %ecx, %eax
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movq %rsp, %rcx
movq %rcx, -0x88(%rbp)
leaq 0xf(,%rax,4), %rcx
andq $-0x10, %rcx
movq %rsp, %r8
subq %rcx, %r8
movq %r8, -0xd8(%rbp)
movq %r8, %rsp
movq %rax, -0x90(%rbp)
movl -0x7c(%rbp), %eax
leaq 0xf(,%rax,8), %rcx
andq $-0x10, %rcx
movq %rsp, %r9
subq %rcx, %r9
movq %r9, -0xd0(%rbp)
movq %r9, %rsp
movq %rax, -0x98(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x78(%rbp), %rsi
movq -0x20(%rbp), %rax
movl 0x3b0(%rax), %edx
movl -0x7c(%rbp), %ecx
xorl %eax, %eax
subq $0x10, %rsp
movl $0x0, (%rsp)
callq 0x4e40
addq $0x10, %rsp
addsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x6ac7
movq -0xd0(%rbp), %rax
movq -0xd8(%rbp), %rcx
movslq -0x40(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm1
movq -0x78(%rbp), %rcx
movq 0x30(%rcx), %rcx
movslq -0x3c(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
cvtss2sd %xmm0, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rcx,%rdx,4)
movsd -0x50(%rbp), %xmm0
movq -0x10(%rbp), %rcx
addsd 0x68(%rcx), %xmm0
movsd %xmm0, 0x68(%rcx)
movsd -0x68(%rbp), %xmm0
movslq -0x40(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x70(%rbp)
movslq -0x40(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
movsd -0x70(%rbp), %xmm1
movq -0x78(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x3c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rax,%rcx,4)
movsd -0x30(%rbp), %xmm1
movq -0x78(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x3c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x69d2
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x20(%rbp), %rax
movl 0x3b0(%rax), %esi
callq 0x6f20
movaps %xmm0, %xmm1
movsd -0x38(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movsd 0x24f45(%rip), %xmm0    # 0x2ba40
addsd 0x70(%rax), %xmm0
movsd %xmm0, 0x70(%rax)
movq -0x88(%rbp), %rax
movq %rax, %rsp
movq -0x8(%rbp), %rax
cmpl $0x0, 0x14(%rax)
jl 0x6e50
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
jl 0x6e50
movq -0x8(%rbp), %rax
cmpl $0x0, 0x24(%rax)
jl 0x6e50
movq -0x8(%rbp), %rax
movl 0x24(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x6e50
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
je 0x6e50
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
movq -0x10(%rbp), %rax
movq 0xa0(%rax), %rax
movq -0x8(%rbp), %rcx
movslq 0x24(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xa0(%rbp)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
movq -0xa0(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x6b9c
jmp 0x6bbb
leaq 0x29726(%rip), %rdi     # 0x302c9
leaq 0x2921b(%rip), %rsi     # 0x2fdc5
movl $0x490, %edx            # imm = 0x490
leaq 0x29650(%rip), %rcx     # 0x30206
callq 0x3220
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
movq -0xa0(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jg 0x6bd0
jmp 0x6bef
leaq 0x29716(%rip), %rdi     # 0x302ed
leaq 0x291e7(%rip), %rsi     # 0x2fdc5
movl $0x491, %edx            # imm = 0x491
leaq 0x2961c(%rip), %rcx     # 0x30206
callq 0x3220
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
jge 0x6c01
jmp 0x6c20
leaq 0x29708(%rip), %rdi     # 0x30310
leaq 0x291b6(%rip), %rsi     # 0x2fdc5
movl $0x492, %edx            # imm = 0x492
leaq 0x295eb(%rip), %rcx     # 0x30206
callq 0x3220
movq -0x8(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x6c2d
jmp 0x6c4c
leaq 0x29700(%rip), %rdi     # 0x30334
leaq 0x2918a(%rip), %rsi     # 0x2fdc5
movl $0x493, %edx            # imm = 0x493
leaq 0x295bf(%rip), %rcx     # 0x30206
callq 0x3220
movq -0x8(%rbp), %rax
movl 0x14(%rax), %ecx
movl 0x1c(%rax), %eax
subl %ecx, %eax
movl %eax, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
movq %rsp, %rcx
movq %rcx, -0xb0(%rbp)
leaq 0xf(,%rax,4), %rcx
andq $-0x10, %rcx
movq %rsp, %r8
subq %rcx, %r8
movq %r8, -0xe8(%rbp)
movq %r8, %rsp
movq %rax, -0xb8(%rbp)
movl -0xa4(%rbp), %eax
leaq 0xf(,%rax,8), %rcx
andq $-0x10, %rcx
movq %rsp, %r9
subq %rcx, %r9
movq %r9, -0xe0(%rbp)
movq %r9, %rsp
movq %rax, -0xc0(%rbp)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0xa0(%rbp), %rsi
movq -0x20(%rbp), %rax
movl 0x3b0(%rax), %edx
movl -0xa4(%rbp), %ecx
xorl %eax, %eax
subq $0x10, %rsp
movl $0x0, (%rsp)
callq 0x4e40
addq $0x10, %rsp
addsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
jge 0x6e08
movq -0xe0(%rbp), %rax
movq -0xe8(%rbp), %rcx
movslq -0x40(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm1
movq -0xa0(%rbp), %rcx
movq 0x30(%rcx), %rcx
movslq -0x3c(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
cvtss2sd %xmm0, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rcx,%rdx,4)
movsd -0x50(%rbp), %xmm0
movq -0x10(%rbp), %rcx
addsd 0x68(%rcx), %xmm0
movsd %xmm0, 0x68(%rcx)
movsd -0x68(%rbp), %xmm0
movslq -0x40(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x70(%rbp)
movslq -0x40(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
movsd -0x70(%rbp), %xmm1
movq -0xa0(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x3c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rax,%rcx,4)
movsd -0x30(%rbp), %xmm1
movq -0xa0(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x3c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x6d0a
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x20(%rbp), %rax
movl 0x3b0(%rax), %esi
callq 0x6f20
movaps %xmm0, %xmm1
movsd -0x38(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movsd 0x24c04(%rip), %xmm0    # 0x2ba40
addsd 0x70(%rax), %xmm0
movsd %xmm0, 0x70(%rax)
movq -0xb0(%rbp), %rax
movq %rax, %rsp
cmpl $0x0, -0x44(%rbp)
jne 0x6e64
movb $0x0, %al
callq 0xbdf0
movsd %xmm0, -0x28(%rbp)
jmp 0x6e9b
movsd -0x58(%rbp), %xmm0
movsd 0x24bcf(%rip), %xmm1    # 0x2ba40
ucomisd %xmm1, %xmm0
jne 0x6e7b
jp 0x6e7b
jmp 0x6e99
movsd -0x58(%rbp), %xmm0
mulsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x58(%rbp), %xmm0
mulsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
jmp 0x6e9b
movsd -0x28(%rbp), %xmm0
movq -0x10(%rbp), %rax
addsd 0x10(%rax), %xmm0
movsd %xmm0, 0x10(%rax)
movsd -0x28(%rbp), %xmm0
movq -0x10(%rbp), %rax
addsd 0x28(%rax), %xmm0
movsd %xmm0, 0x28(%rax)
movsd -0x58(%rbp), %xmm0
movq -0x10(%rbp), %rax
addsd 0x30(%rax), %xmm0
movsd %xmm0, 0x30(%rax)
movsd -0x30(%rbp), %xmm0
movq -0x10(%rbp), %rax
addsd 0x10(%rax), %xmm0
movsd %xmm0, 0x10(%rax)
movsd -0x30(%rbp), %xmm0
movq -0x10(%rbp), %rax
addsd 0x38(%rax), %xmm0
movsd %xmm0, 0x38(%rax)
movsd -0x58(%rbp), %xmm0
movq -0x10(%rbp), %rax
addsd 0x40(%rax), %xmm0
movsd %xmm0, 0x40(%rax)
movl -0x44(%rbp), %eax
movq %rbp, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)