// File: /workspace/github_c_makefile_star2_O0/usgs[P]nshmp-haz-catalogs/src/agrid/adaptive/read_write_params.c
// Function: load_poly_data
void load_poly_data(struct compl_levels* cat_comp)
/*--------------------------------------------------------------------------*/
{
   FILE *fplst, *fppoly;
   int cnt, cnt1, cnt2, nheaders, years_gap;
   char buff[BUFFLEN], nm_tmp[200];
   char polygonFilePath[200];

   if( (fplst = fopen(cat_comp->catalogGapsFile, "r"))==NULL) {
     fprintf(stderr,"Cannot open file with list of polygons, %s\n", cat_comp->catalogGapsFile);
     exit(1);
   }
   fprintf(stderr,"Opened file with list of polygons, %s\n", cat_comp->catalogGapsFile);
// loop through list of all polygon files
   cnt=0;
   while(fgets(buff,BUFFLEN,fplst) ) {
     sscanf(buff,"%s %d %d", nm_tmp, &years_gap, &nheaders);
     sprintf(polygonFilePath, "%s/%s", cat_comp->catalogGapsPolygonPath, nm_tmp);

     if( (fppoly  = fopen(polygonFilePath, "r"))==NULL) {
       fprintf(stderr, "Cannot open polygon file, %s\n", polygonFilePath);
       exit(1);
     }
     for(cnt1=0; cnt1<nheaders; cnt1++) fgets(buff,BUFFLEN,fppoly);
     cat_comp->polygons.elem[cnt].nyears=years_gap;
     cnt2=0;
     while(fgets(buff,BUFFLEN,fppoly) ) {
       sscanf(buff,"%f %f", &(cat_comp->polygons.elem[cnt].lon[cnt2]), &(cat_comp->polygons.elem[cnt].lat[cnt2]) );
       cnt2++;
     }
     cat_comp->polygons.elem[cnt].npts=cnt2;
     fclose(fppoly);
     cnt++;
   }
   cat_comp->polygons.npoly=cnt;
   fprintf(stderr,"Read %d polygons.\n", cat_comp->polygons.npoly);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x300, %rsp            # imm = 0x300
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
addq $0x130, %rdi            # imm = 0x130
leaq 0x7416(%rip), %rsi      # 0x88b7
callq 0x1130
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
jne 0x14dd
movq 0xab41(%rip), %rax      # 0xbff8
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
addq $0x130, %rdx            # imm = 0x130
leaq 0x6e50(%rip), %rsi      # 0x831c
movb $0x0, %al
callq 0x10e0
movl $0x1, %edi
callq 0x1160
movq 0xab14(%rip), %rax      # 0xbff8
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
addq $0x130, %rdx            # imm = 0x130
leaq 0x6e4f(%rip), %rsi      # 0x8348
movb $0x0, %al
callq 0x10e0
movl $0x0, -0x1c(%rbp)
leaq -0x160(%rbp), %rdi
movq -0x10(%rbp), %rdx
movl $0x12c, %esi            # imm = 0x12C
callq 0x10c0
cmpq $0x0, %rax
je 0x16dd
leaq -0x160(%rbp), %rdi
leaq -0x230(%rbp), %rdx
leaq 0x6e34(%rip), %rsi      # 0x836f
leaq -0x2c(%rbp), %rcx
leaq -0x28(%rbp), %r8
movb $0x0, %al
callq 0x1100
leaq -0x300(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0x1f8, %rdx            # imm = 0x1F8
leaq -0x230(%rbp), %rcx
leaq 0x6e0e(%rip), %rsi      # 0x8378
movb $0x0, %al
callq 0x1150
leaq -0x300(%rbp), %rdi
leaq 0x7338(%rip), %rsi      # 0x88b7
callq 0x1130
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x15b7
movq 0xaa63(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq -0x300(%rbp), %rdx
leaq 0x6dd8(%rip), %rsi      # 0x837e
movb $0x0, %al
callq 0x10e0
movl $0x1, %edi
callq 0x1160
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x15e6
leaq -0x160(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x12c, %esi            # imm = 0x12C
callq 0x10c0
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x15be
movl -0x2c(%rbp), %ecx
movq -0x8(%rbp), %rax
addq $0x2983c4, %rax         # imm = 0x2983C4
addq $0x4, %rax
movslq -0x1c(%rbp), %rdx
imulq $0xa8, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movl $0x0, -0x24(%rbp)
leaq -0x160(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x12c, %esi            # imm = 0x12C
callq 0x10c0
cmpq $0x0, %rax
je 0x16a5
leaq -0x160(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0x2983c4, %rdx         # imm = 0x2983C4
addq $0x4, %rdx
movslq -0x1c(%rbp), %rax
imulq $0xa8, %rax, %rax
addq %rax, %rdx
addq $0x8, %rdx
movslq -0x24(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdx
movq -0x8(%rbp), %rcx
addq $0x2983c4, %rcx         # imm = 0x2983C4
addq $0x4, %rcx
movslq -0x1c(%rbp), %rax
imulq $0xa8, %rax, %rax
addq %rax, %rcx
addq $0x58, %rcx
movslq -0x24(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rcx
leaq 0x7793(%rip), %rsi      # 0x8e23
movb $0x0, %al
callq 0x1100
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x160f
movl -0x24(%rbp), %ecx
movq -0x8(%rbp), %rax
addq $0x2983c4, %rax         # imm = 0x2983C4
addq $0x4, %rax
movslq -0x1c(%rbp), %rdx
imulq $0xa8, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rdi
callq 0x1080
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1507
movl -0x1c(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x2983c4(%rax)
movq 0xa907(%rip), %rax      # 0xbff8
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x2983c4(%rax), %edx
leaq 0x6c97(%rip), %rsi      # 0x839c
movb $0x0, %al
callq 0x10e0
addq $0x300, %rsp            # imm = 0x300
popq %rbp
retq
nopw %cs:(%rax,%rax)