// File: /workspace/github_c_makefile_star2_O0/usgs[P]nshmp-haz-catalogs/src/agrid/adaptive/smooth_seis_rates.c
// Function: check_earthquake_catalog_gaps
float check_earthquake_catalog_gaps(struct eqcat* eqcatp, struct compl_levels* cat_compp, int eqno)
/*--------------------------------------------------------------------------*/
{
  int cnt, cnt1, np, nyrs;
  int eqyr, eqmon, eqday, eqlineno;
  float eqlon, eqlat, eqmag;
  float plon[NPP], plat[NPP];

// assign coordinates
  eqlon=eqcatp->lon[eqno];
  eqlat=eqcatp->lat[eqno];
  eqmag=eqcatp->mag[eqno];
  eqyr=eqcatp->year[eqno];
  eqmon=eqcatp->month[eqno];
  eqday=eqcatp->day[eqno];
  eqlineno=eqcatp->lineno[eqno];

// loop through polygons and check if eq epicenter is within polygons
  for(cnt=0;cnt<cat_compp->polygons.npoly; cnt++) {
    np=cat_compp->polygons.elem[cnt].npts;
    nyrs=cat_compp->polygons.elem[cnt].nyears;
    for(cnt1=0;cnt1<np;cnt1++) {
      plon[cnt1]=cat_compp->polygons.elem[cnt].lon[cnt1];
      plat[cnt1]=cat_compp->polygons.elem[cnt].lat[cnt1];
    }
    if ( lxyint_(&eqlon,&eqlat,plon,plat,&np) ) { 
      fprintf(
          stderr,
          "EQ-reduced-time-for-rate: %8.3f %8.3f %6d %4d %4d %8.4f %6d\n",
          eqlon, eqlat, eqyr, eqmon, eqday, eqmag, eqlineno);
      return nyrs;
    }
  }

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movss 0x668a4(%rax,%rcx,4), %xmm0
movss %xmm0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movss 0x75304(%rax,%rcx,4), %xmm0
movss %xmm0, -0x44(%rbp)
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movss 0x57e44(%rax,%rcx,4), %xmm0
movss %xmm0, -0x48(%rbp)
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl 0x4(%rax,%rcx,4), %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl 0xea64(%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl 0x1d4c4(%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl 0x3a984(%rax,%rcx,4), %eax
movl %eax, -0x3c(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x2983c4(%rcx), %eax
jge 0x48fb
movq -0x18(%rbp), %rax
addq $0x2983c4, %rax         # imm = 0x2983C4
addq $0x4, %rax
movslq -0x20(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rax
addq $0x2983c4, %rax         # imm = 0x2983C4
addq $0x4, %rax
movslq -0x20(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x2c(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x487a
movq -0x18(%rbp), %rax
addq $0x2983c4, %rax         # imm = 0x2983C4
addq $0x4, %rax
movslq -0x20(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movslq -0x24(%rbp), %rcx
movss 0x8(%rax,%rcx,4), %xmm0
movslq -0x24(%rbp), %rax
movss %xmm0, -0xa0(%rbp,%rax,4)
movq -0x18(%rbp), %rax
addq $0x2983c4, %rax         # imm = 0x2983C4
addq $0x4, %rax
movslq -0x20(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movslq -0x24(%rbp), %rcx
movss 0x58(%rax,%rcx,4), %xmm0
movslq -0x24(%rbp), %rax
movss %xmm0, -0xf0(%rbp,%rax,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x4801
leaq -0xa0(%rbp), %rdx
leaq -0xf0(%rbp), %rcx
leaq -0x40(%rbp), %rdi
leaq -0x44(%rbp), %rsi
leaq -0x28(%rbp), %r8
callq 0x3c0f
cmpl $0x0, %eax
je 0x48eb
movq 0x7753(%rip), %rax      # 0xbff8
movq (%rax), %rdi
movss -0x40(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss -0x44(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movl -0x30(%rbp), %edx
movl -0x34(%rbp), %ecx
movl -0x38(%rbp), %r8d
movss -0x48(%rbp), %xmm2
cvtss2sd %xmm2, %xmm2
movl -0x3c(%rbp), %r9d
leaq 0x4900(%rip), %rsi      # 0x91d8
movb $0x3, %al
callq 0x10e0
cvtsi2ssl -0x2c(%rbp), %xmm0
movss %xmm0, -0x4(%rbp)
jmp 0x4903
jmp 0x48ed
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x47a4
xorps %xmm0, %xmm0
movss %xmm0, -0x4(%rbp)
movss -0x4(%rbp), %xmm0
addq $0xf0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)