// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALEhelpers.c
// Function: saveLibraryParameters
void saveLibraryParameters(libraryParametersT *libParams, char aleFile[256]){
  char paramFile[256];
  int j;
  strcpy(paramFile, aleFile);
  strcat(paramFile, ".param");
  FILE *out = fopen(paramFile, "w");
  fprintf(out, "#ALE_library_parameter_file,_see_doc\n");
  for(j=0; j < MATE_ORIENTATION_MAX; j++) {
      fprintf(out, "%lf\n", libParams->mateParameters[j].insertLength);
      fprintf(out, "%lf\n", libParams->mateParameters[j].insertStd);
      fprintf(out, "%lf\n", libParams->mateParameters[j].libraryFraction);
      fprintf(out, "%ld\n", libParams->mateParameters[j].count);
      fprintf(out, "%ld\n", libParams->mateParameters[j].mapped);
      // placed is always calculated
      fprintf(out, "%d\n", libParams->mateParameters[j].isValid);
  }
  fprintf(out, "%ld\n", libParams->avgReadSize);
  fprintf(out, "%ld\n", libParams->numReads);
  fprintf(out, "%lf\n", libParams->totalValidSingleFraction);
  fprintf(out, "%lf\n", libParams->totalValidMateFraction);
  fprintf(out, "%lf\n", libParams->totalChimerMateFraction);
  fprintf(out, "%lf\n", libParams->totalUnmappedFraction);
  fprintf(out, "%d\n", libParams->qOff);
  fprintf(out, "%d\n", libParams->isSortedByName);
  fprintf(out, "%d\n", libParams->primaryOrientation);
  fclose(out);
  printf("Saved library parameters to %s\n", paramFile);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
callq 0x30e0
movq %r14, %rdi
callq 0x31e0
movl $0x7261702e, (%rsp,%rax) # imm = 0x7261702E
movl $0x6d6172, 0x3(%rsp,%rax) # imm = 0x6D6172
leaq 0xed60(%rip), %rsi      # 0x19185
movq %r14, %rdi
callq 0x3530
movq %rax, %r14
leaq 0x15d2e(%rip), %rdi     # 0x20165
pushq $0x25
popq %rsi
pushq $0x1
popq %rdx
movq %rax, %rcx
callq 0x35e0
pushq $0x38
popq %rbp
leaq 0x15c18(%rip), %r15     # 0x20067
leaq 0x1413a(%rip), %r12     # 0x1e590
leaq 0x16ae8(%rip), %r13     # 0x20f45
cmpq $0x3b8, %rbp            # imm = 0x3B8
je 0xa4d9
movsd -0x38(%rbx,%rbp), %xmm0
movq %r14, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x3350
movsd -0x30(%rbx,%rbp), %xmm0
movq %r14, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x3350
movsd -0x20(%rbx,%rbp), %xmm0
movq %r14, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x3350
movq -0x18(%rbx,%rbp), %rdx
movq %r14, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x3350
movq -0x10(%rbx,%rbp), %rdx
movq %r14, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x3350
movl (%rbx,%rbp), %edx
movq %r14, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x3350
addq $0x40, %rbp
jmp 0xa45d
movq 0x380(%rbx), %rdx
leaq 0x140a9(%rip), %r15     # 0x1e590
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3350
movq 0x388(%rbx), %rdx
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3350
movsd 0x390(%rbx), %xmm0
leaq 0x15b50(%rip), %r15     # 0x20067
movq %r14, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x3350
movsd 0x398(%rbx), %xmm0
movq %r14, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x3350
movsd 0x3a0(%rbx), %xmm0
movq %r14, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x3350
movsd 0x3a8(%rbx), %xmm0
movq %r14, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x3350
movl 0x3b0(%rbx), %edx
leaq 0x169d5(%rip), %r15     # 0x20f45
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3350
movl 0x3b4(%rbx), %edx
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3350
movl 0x3b8(%rbx), %edx
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3350
movq %r14, %rdi
callq 0x31c0
leaq 0x15bd9(%rip), %rdi     # 0x2018b
movq %rsp, %rsi
xorl %eax, %eax
callq 0x3210
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq