// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x110(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x30c0
leaq -0x110(%rbp), %rdi
leaq 0x22d8a(%rip), %rsi     # 0x31d1b
callq 0x3580
leaq -0x110(%rbp), %rdi
leaq 0x1c22d(%rip), %rsi     # 0x2b1d1
callq 0x3520
movq %rax, -0x120(%rbp)
movq -0x120(%rbp), %rdi
leaq 0x22d64(%rip), %rsi     # 0x31d22
movb $0x0, %al
callq 0x3350
movl $0x0, -0x114(%rbp)
cmpl $0xe, -0x114(%rbp)
jge 0xf0f3
movq -0x120(%rbp), %rdi
movq -0x8(%rbp), %rax
movslq -0x114(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movsd (%rax), %xmm0
leaq 0x22c07(%rip), %rsi     # 0x31c07
movb $0x1, %al
callq 0x3350
movq -0x120(%rbp), %rdi
movq -0x8(%rbp), %rax
movslq -0x114(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
leaq 0x22bdb(%rip), %rsi     # 0x31c07
movb $0x1, %al
callq 0x3350
movq -0x120(%rbp), %rdi
movq -0x8(%rbp), %rax
movslq -0x114(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movsd 0x18(%rax), %xmm0
leaq 0x22baf(%rip), %rsi     # 0x31c07
movb $0x1, %al
callq 0x3350
movq -0x120(%rbp), %rdi
movq -0x8(%rbp), %rax
movslq -0x114(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rdx
leaq 0x2159d(%rip), %rsi     # 0x30620
movb $0x0, %al
callq 0x3350
movq -0x120(%rbp), %rdi
movq -0x8(%rbp), %rax
movslq -0x114(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x28(%rax), %rdx
leaq 0x21572(%rip), %rsi     # 0x30620
movb $0x0, %al
callq 0x3350
movq -0x120(%rbp), %rdi
movq -0x8(%rbp), %rax
movslq -0x114(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movl 0x38(%rax), %edx
leaq 0x23911(%rip), %rsi     # 0x329e9
movb $0x0, %al
callq 0x3350
movl -0x114(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x114(%rbp)
jmp 0xefcf
movq -0x120(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x380(%rax), %rdx
leaq 0x21514(%rip), %rsi     # 0x30620
movb $0x0, %al
callq 0x3350
movq -0x120(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x388(%rax), %rdx
leaq 0x214f4(%rip), %rsi     # 0x30620
movb $0x0, %al
callq 0x3350
movq -0x120(%rbp), %rdi
movq -0x8(%rbp), %rax
movsd 0x390(%rax), %xmm0
leaq 0x22aba(%rip), %rsi     # 0x31c07
movb $0x1, %al
callq 0x3350
movq -0x120(%rbp), %rdi
movq -0x8(%rbp), %rax
movsd 0x398(%rax), %xmm0
leaq 0x22a99(%rip), %rsi     # 0x31c07
movb $0x1, %al
callq 0x3350
movq -0x120(%rbp), %rdi
movq -0x8(%rbp), %rax
movsd 0x3a0(%rax), %xmm0
leaq 0x22a78(%rip), %rsi     # 0x31c07
movb $0x1, %al
callq 0x3350
movq -0x120(%rbp), %rdi
movq -0x8(%rbp), %rax
movsd 0x3a8(%rax), %xmm0
leaq 0x22a57(%rip), %rsi     # 0x31c07
movb $0x1, %al
callq 0x3350
movq -0x120(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x3b0(%rax), %edx
leaq 0x2381a(%rip), %rsi     # 0x329e9
movb $0x0, %al
callq 0x3350
movq -0x120(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x3b4(%rax), %edx
leaq 0x237fb(%rip), %rsi     # 0x329e9
movb $0x0, %al
callq 0x3350
movq -0x120(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x3b8(%rax), %edx
leaq 0x237dc(%rip), %rsi     # 0x329e9
movb $0x0, %al
callq 0x3350
movq -0x120(%rbp), %rdi
callq 0x31c0
leaq -0x110(%rbp), %rsi
leaq 0x22b1a(%rip), %rdi     # 0x31d48
movb $0x0, %al
callq 0x3200
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nop