// File: /workspace/github_c_makefile_star2_O0/usgs[P]nshmp-haz-catalogs/src/agrid/adaptive/read_write_params.c
// Function: write_params_to_file
void write_params_to_file(char *fnm, struct compl_levels* cat_comp, struct boundaries* reg, 
  struct catalog* cat, struct smoothp* smp1, char *outfnm) 
/*--------------------------------------------------------------------------*/
{
  FILE *fpout;
  int cnt;
  
// open summary file for writing
  fpout=fopen(fnm,"w");
  fprintf(fpout,"----------------------------------------------------------\n");
  fprintf(fpout,"---------  Summary of processing steps -------------------\n");
  fprintf(fpout,"----------------------------------------------------------\n\n");
  
// write out parameters
  fprintf(fpout,"Latitudes: %.2f %.2f\n", reg->minlat, reg->maxlat);
  fprintf(fpout,"Longitudes: %.2f %.2f\n", reg->minlon, reg->maxlon);
  fprintf(fpout,"dlat, dlon: %.2f %.2f\n", reg->dlat, reg->dlon);
// completeness levels
  fprintf(fpout,"Number of magnitude completeness levels: %d\n  M yr\n", cat_comp->nlevels);
  for (cnt=0; cnt<cat_comp->nlevels; cnt++) {
    fprintf(fpout,"  %.2f %d\n", cat_comp->mag_comp[cnt], cat_comp->yr_comp[cnt]);
  }
// catalog end year, name, and min-magnitude/d-mag/b-value
  fprintf(fpout,"Last year of catalog: %d\n", cat->end_yr);
  fprintf(fpout,"Name of catalog file: %s\n", cat->catnm);
  fprintf(fpout,"Minimum-M/dM/b-value: %.2f %.2f %.3f\n", cat->minMag, cat->dMag, cat->bval);
// effective/actual numbers earthquakes
  if (smp1->use_neff) {
    fprintf(fpout,"Using effective numbers of earthquakes: N>=1.\n");
  }
  else {
    fprintf(fpout,"Using actual numbers of earthquakes (not effective-numbers): N=1.\n");
  }
// smoothing parameters
  if (smp1->cumul_rates) {
    fprintf(fpout,"Output cumulative rates.\n");
  }
  else {
    fprintf(fpout,"Output incremental rates.\n");
  }
  if (smp1->adj_compl) {
    fprintf(fpout,"Adjust completeness levels.\n");
  }
  else {
    fprintf(fpout,"Don't adjust completeness levels.\n");
  }
  if (smp1->apply_sm) {
    fprintf(fpout,"Apply smoothing to seismicity rates... ");
// gauss/power-law
    if ( smp1->gauss_kern ) {
      fprintf(fpout,"  gaussian kernel ... ");
    }
    else {
      fprintf(fpout,"  power-law kernel ... ");
    }
    if (smp1->adapt_sm) {
      fprintf(fpout," adaptive smoothing - ");
      if (smp1->nnum2_log == 0) {
        fprintf(fpout,"neighbor number %d\n", smp1->nnum);
      }
      else {
        fprintf(fpout,"average of neighbor numbers %d, %d\n", smp1->nnum, smp1->nnum2);
      }
    }
    else {
      fprintf(fpout,"  fixed-radius smoothing: %.1f km\n", smp1->sigfix);
    }
  }
  else {
    fprintf(fpout,"Don't apply smoothing to seismicity rates.\n");
  }
  fprintf(fpout,"Seismicity rates (10^a) written to files, %s[_M0/3/4/5.out]\n", outfnm); 
  
  fclose(fpout);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x5cf0(%rip), %rsi      # 0x85fb
callq 0x1130
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
leaq 0x6311(%rip), %rsi      # 0x8c30
movb $0x0, %al
callq 0x10e0
movq -0x38(%rbp), %rdi
leaq 0x633b(%rip), %rsi      # 0x8c6c
movb $0x0, %al
callq 0x10e0
movq -0x38(%rbp), %rdi
leaq 0x6365(%rip), %rsi      # 0x8ca8
movb $0x0, %al
callq 0x10e0
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rax
movss 0x14(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x18(%rbp), %rax
movss 0x18(%rax), %xmm1
cvtss2sd %xmm1, %xmm1
leaq 0x5f98(%rip), %rsi      # 0x8907
movb $0x2, %al
callq 0x10e0
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rax
movss 0xc(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x18(%rbp), %rax
movss 0x10(%rax), %xmm1
cvtss2sd %xmm1, %xmm1
leaq 0x5f82(%rip), %rsi      # 0x891d
movb $0x2, %al
callq 0x10e0
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rax
movss 0x20(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x18(%rbp), %rax
movss 0x1c(%rax), %xmm1
cvtss2sd %xmm1, %xmm1
leaq 0x5f6d(%rip), %rsi      # 0x8934
movb $0x2, %al
callq 0x10e0
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %edx
leaq 0x5f6b(%rip), %rsi      # 0x894b
movb $0x0, %al
callq 0x10e0
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x2a35
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movss 0x3c(%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x10(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movl 0x14(%rax,%rcx,4), %edx
leaq 0x5f5c(%rip), %rsi      # 0x897f
movb $0x1, %al
callq 0x10e0
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x29ee
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rax
movl (%rax), %edx
leaq 0x5f44(%rip), %rsi      # 0x898a
movb $0x0, %al
callq 0x10e0
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rdx
addq $0x10, %rdx
leaq 0x5f44(%rip), %rsi      # 0x89a4
movb $0x0, %al
callq 0x10e0
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rax
movss 0x4(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x20(%rbp), %rax
movss 0x8(%rax), %xmm1
cvtss2sd %xmm1, %xmm1
movq -0x20(%rbp), %rax
movss 0xc(%rax), %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x5f25(%rip), %rsi      # 0x89be
movb $0x3, %al
callq 0x10e0
movq -0x28(%rbp), %rax
cmpl $0x0, 0x14(%rax)
je 0x2abe
movq -0x38(%rbp), %rdi
leaq 0x5f85(%rip), %rsi      # 0x8a3a
movb $0x0, %al
callq 0x10e0
jmp 0x2ad0
movq -0x38(%rbp), %rdi
leaq 0x5fa0(%rip), %rsi      # 0x8a69
movb $0x0, %al
callq 0x10e0
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2aed
movq -0x38(%rbp), %rdi
leaq 0x5fc8(%rip), %rsi      # 0x8aac
movb $0x0, %al
callq 0x10e0
jmp 0x2aff
movq -0x38(%rbp), %rdi
leaq 0x5fce(%rip), %rsi      # 0x8ac6
movb $0x0, %al
callq 0x10e0
movq -0x28(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0x2b1d
movq -0x38(%rbp), %rdi
leaq 0x5fcd(%rip), %rsi      # 0x8ae1
movb $0x0, %al
callq 0x10e0
jmp 0x2b2f
movq -0x38(%rbp), %rdi
leaq 0x5fd6(%rip), %rsi      # 0x8afe
movb $0x0, %al
callq 0x10e0
movq -0x28(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x2c03
movq -0x38(%rbp), %rdi
leaq 0x5fd9(%rip), %rsi      # 0x8b21
movb $0x0, %al
callq 0x10e0
movq -0x28(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0x2b6d
movq -0x38(%rbp), %rdi
leaq 0x5fe5(%rip), %rsi      # 0x8b49
movb $0x0, %al
callq 0x10e0
jmp 0x2b7f
movq -0x38(%rbp), %rdi
leaq 0x5fe8(%rip), %rsi      # 0x8b60
movb $0x0, %al
callq 0x10e0
movq -0x28(%rbp), %rax
cmpl $0x0, 0xc(%rax)
je 0x2be2
movq -0x38(%rbp), %rdi
leaq 0x5fe4(%rip), %rsi      # 0x8b78
movb $0x0, %al
callq 0x10e0
movq -0x28(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x2bc0
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x18(%rax), %edx
leaq 0x5fd8(%rip), %rsi      # 0x8b8f
movb $0x0, %al
callq 0x10e0
jmp 0x2be0
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x18(%rax), %edx
movq -0x28(%rbp), %rax
movl 0x1c(%rax), %ecx
leaq 0x5fca(%rip), %rsi      # 0x8ba3
movb $0x0, %al
callq 0x10e0
jmp 0x2c01
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rax
movss 0x2c(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x60eb(%rip), %rsi      # 0x8ce5
movb $0x1, %al
callq 0x10e0
jmp 0x2c15
movq -0x38(%rbp), %rdi
leaq 0x5fb9(%rip), %rsi      # 0x8bc7
movb $0x0, %al
callq 0x10e0
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x5fcf(%rip), %rsi      # 0x8bf3
movb $0x0, %al
callq 0x10e0
movq -0x38(%rbp), %rdi
callq 0x1080
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)