// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/avilib.c
// Function: avi_parse_input_file
int avi_parse_input_file(avi_t *AVI, int getIndex)
{
  long i, rate, scale, idx_type;
  off_t n;
  unsigned char *hdrl_data;
  long header_offset=0, hdrl_len=0;
  long nvi, nai[AVI_MAX_TRACKS], ioff;
  long tot[AVI_MAX_TRACKS];
  int j;
  int lasttag = 0;
  int vids_strh_seen = 0;
  int vids_strf_seen = 0;
  int auds_strh_seen = 0;
  //  int auds_strf_seen = 0;
  int num_stream = 0;
  char data[256];

  /* Read first 12 bytes and check that this is an AVI file */

   if( avi_read(AVI->fdes,data,12) != 12 ) ERR_EXIT(AVI_ERR_READ)

   if( strncasecmp(data  ,"RIFF",4) !=0 ||
       strncasecmp(data+8,"AVI ",4) !=0 ) ERR_EXIT(AVI_ERR_NO_AVI)

   /* Go through the AVI file and extract the header list,
      the start position of the 'movi' list and an optionally
      present idx1 tag */

   hdrl_data = 0;

   while(1)
   {
      if( avi_read(AVI->fdes,data,8) != 8 ) break; /* We assume it's EOF */

      n = str2ulong((unsigned char *)data+4);
      n = PAD_EVEN(n);

      if(strncasecmp(data,"LIST",4) == 0)
      {
         if( avi_read(AVI->fdes,data,4) != 4 ) ERR_EXIT(AVI_ERR_READ)
         n -= 4;
         if(strncasecmp(data,"hdrl",4) == 0)
         {
            hdrl_len = n;
            hdrl_data = (unsigned char *) malloc(n);
            if(hdrl_data==0) ERR_EXIT(AVI_ERR_NO_MEM);

	    // offset of header

	    header_offset = lseek(AVI->fdes,0,SEEK_CUR);

            if( avi_read(AVI->fdes,(char *)hdrl_data,n) != n ) ERR_EXIT(AVI_ERR_READ)
         }
         else if(strncasecmp(data,"movi",4) == 0)
         {
            AVI->movi_start = lseek(AVI->fdes,0,SEEK_CUR);
            lseek(AVI->fdes,n,SEEK_CUR);
         }
         else
            lseek(AVI->fdes,n,SEEK_CUR);
      }
      else if(strncasecmp(data,"idx1",4) == 0)
      {
         /* n must be a multiple of 16, but the reading does not
            break if this is not the case */

         AVI->n_idx = AVI->max_idx = n/16;
         AVI->idx = (unsigned  char((*)[16]) ) malloc(n);
         if(AVI->idx==0) ERR_EXIT(AVI_ERR_NO_MEM)
         if(avi_read(AVI->fdes, (char *) AVI->idx, n) != n ) ERR_EXIT(AVI_ERR_READ)
      }
      else
         lseek(AVI->fdes,n,SEEK_CUR);
   }

   if(!hdrl_data      ) ERR_EXIT(AVI_ERR_NO_HDRL)
   if(!AVI->movi_start) ERR_EXIT(AVI_ERR_NO_MOVI)

   /* Interpret the header list */

   for(i=0;i<hdrl_len;)
   {
      /* List tags are completly ignored */

      if(strncasecmp((char *)hdrl_data+i,"LIST",4)==0) { i+= 12; continue; }

      n = str2ulong(hdrl_data+i+4);
      n = PAD_EVEN(n);

      /* Interpret the tag and its args */

      if(strncasecmp((char *)hdrl_data+i,"strh",4)==0)
      {
         i += 8;
         if(strncasecmp((char *)hdrl_data+i,"vids",4) == 0 && !vids_strh_seen)
         {
            memcpy(AVI->compressor,hdrl_data+i+4,4);
            AVI->compressor[4] = 0;

	    // ThOe
	    AVI->v_codech_off = header_offset + i+4;

            scale = str2ulong(hdrl_data+i+20);
            rate  = str2ulong(hdrl_data+i+24);
            if(scale!=0) AVI->fps = (double)rate/(double)scale;
            AVI->video_frames = str2ulong(hdrl_data+i+32);
            AVI->video_strn = num_stream;
	    AVI->max_len = 0;
            vids_strh_seen = 1;
            lasttag = 1; /* vids */
         }
         else if (strncasecmp ((char *)hdrl_data+i,"auds",4) ==0 && ! auds_strh_seen)
         {

	   //inc audio tracks
	   AVI->aptr=AVI->anum;
	   ++AVI->anum;

	   if(AVI->anum > AVI_MAX_TRACKS) {
	     fprintf(stderr, "error - only %d audio tracks supported\n", AVI_MAX_TRACKS);
	     return(-1);
	   }

	   AVI->track[AVI->aptr].audio_bytes = str2ulong(hdrl_data+i+32)*avi_sampsize(AVI, 0);
	   AVI->track[AVI->aptr].audio_strn = num_stream;
	   //	   auds_strh_seen = 1;
	   lasttag = 2; /* auds */

	   // ThOe
	   AVI->track[AVI->aptr].a_codech_off = header_offset + i;

         }
         else
            lasttag = 0;
         num_stream++;
      }
      else if(strncasecmp((char *)hdrl_data+i,"strf",4)==0)
      {
         i += 8;
         if(lasttag == 1)
         {
            BITMAPINFOHEADER_avilib bih;

            memcpy(&bih, hdrl_data + i, sizeof(BITMAPINFOHEADER_avilib));
            AVI->bitmap_info_header = (BITMAPINFOHEADER_avilib *)malloc(bih.bi_size);
            if (AVI->bitmap_info_header != NULL)
              memcpy(AVI->bitmap_info_header, hdrl_data + i, bih.bi_size);

            AVI->width  = str2ulong(hdrl_data+i+4);
            AVI->height = str2ulong(hdrl_data+i+8);
                    vids_strf_seen = 1;
	    //ThOe
	    AVI->v_codecf_off = header_offset + i+16;

	    memcpy(AVI->compressor2, hdrl_data+i+16, 4);
            AVI->compressor2[4] = 0;

         }
         else if(lasttag == 2)
         {
            WAVEFORMATEX_avilib *wfe;
	    char *nwfe;
            int wfes;

            if ((hdrl_len - i) < sizeof(WAVEFORMATEX_avilib))
              wfes = hdrl_len - i;
            else
              wfes = sizeof(WAVEFORMATEX_avilib);
            wfe = (WAVEFORMATEX_avilib *)malloc(sizeof(WAVEFORMATEX_avilib));
            if (wfe != NULL) {
              memset(wfe, 0, sizeof(WAVEFORMATEX_avilib));
	      memcpy(wfe, hdrl_data + i, wfes);
	      if (wfe->cb_size != 0) {
		nwfe = (char *)realloc(wfe, sizeof(WAVEFORMATEX_avilib) +
				       wfe->cb_size);
		if (nwfe != 0) {
		  off_t lpos = lseek(AVI->fdes, 0, SEEK_CUR);
		  lseek(AVI->fdes, header_offset + i + sizeof(WAVEFORMATEX_avilib),
			SEEK_SET);
		  wfe = (WAVEFORMATEX_avilib *)nwfe;
		  nwfe = &nwfe[sizeof(WAVEFORMATEX_avilib)];
		  avi_read(AVI->fdes, nwfe, wfe->cb_size);
		  lseek(AVI->fdes, lpos, SEEK_SET);
		}
	      }
	      AVI->wave_format_ex[AVI->aptr] = wfe;
	    }

            AVI->track[AVI->aptr].a_fmt   = str2ushort(hdrl_data+i  );

	    //ThOe
	    AVI->track[AVI->aptr].a_codecf_off = header_offset + i;

            AVI->track[AVI->aptr].a_chans = str2ushort(hdrl_data+i+2);
            AVI->track[AVI->aptr].a_rate  = str2ulong (hdrl_data+i+4);
	    //ThOe: read mp3bitrate
	    AVI->track[AVI->aptr].mp3rate = 8*str2ulong(hdrl_data+i+8)/1000;
	    //:ThOe
            AVI->track[AVI->aptr].a_bits  = str2ushort(hdrl_data+i+14);
	    //            auds_strf_seen = 1;
         }
         lasttag = 0;
      }
      else
      {
         i += 8;
         lasttag = 0;
      }

      i += n;
   }

   free(hdrl_data);

   if(!vids_strh_seen || !vids_strf_seen) ERR_EXIT(AVI_ERR_NO_VIDS)

   AVI->video_tag[0] = (char)(AVI->video_strn/10) + '0';
   AVI->video_tag[1] = (char)(AVI->video_strn%10) + '0';
   AVI->video_tag[2] = 'd';
   AVI->video_tag[3] = 'b';

   /* Audio tag is set to "99wb" if no audio present */
   if(!AVI->track[0].a_chans) AVI->track[0].audio_strn = 99;

   for(j=0; j<AVI->anum; ++j) {
     AVI->track[j].audio_tag[0] = (j+1)/10 + '0';
     AVI->track[j].audio_tag[1] = (j+1)%10 + '0';
     AVI->track[j].audio_tag[2] = 'w';
     AVI->track[j].audio_tag[3] = 'b';
   }

   lseek(AVI->fdes,AVI->movi_start,SEEK_SET);

   /* get index if wanted */

   if(!getIndex) return(0);

   /* if the file has an idx1, check if this is relative
      to the start of the file or to the start of the movi list */

   idx_type = 0;

   if(AVI->idx)
   {
      off_t pos, len;

      /* Search the first videoframe in the idx1 and look where
         it is in the file */

      for(i=0;i<AVI->n_idx;i++)
         if( strncasecmp((char *)AVI->idx[i],(char *)AVI->video_tag,3)==0 ) break;
      if(i>=AVI->n_idx) ERR_EXIT(AVI_ERR_NO_VIDS)

      pos = str2ulong(AVI->idx[i]+ 8);
      len = str2ulong(AVI->idx[i]+12);

      lseek(AVI->fdes,pos,SEEK_SET);
      if(avi_read(AVI->fdes,data,8)!=8) ERR_EXIT(AVI_ERR_READ)
      if( strncasecmp(data,(char *)AVI->idx[i],4)==0 && str2ulong((unsigned char *)data+4)==len )
      {
         idx_type = 1; /* Index from start of file */
      }
      else
      {
         lseek(AVI->fdes,pos+AVI->movi_start-4,SEEK_SET);
         if(avi_read(AVI->fdes,data,8)!=8) ERR_EXIT(AVI_ERR_READ)
         if( strncasecmp(data,(char *)AVI->idx[i],4)==0 && str2ulong((unsigned char *)data+4)==len )
         {
            idx_type = 2; /* Index from start of movi list */
         }
      }
      /* idx_type remains 0 if neither of the two tests above succeeds */
   }

   if(idx_type == 0)
   {
      /* we must search through the file to get the index */

      lseek(AVI->fdes, AVI->movi_start, SEEK_SET);

      AVI->n_idx = 0;

      while(1)
      {
         if( avi_read(AVI->fdes,data,8) != 8 ) break;
         n = str2ulong((unsigned char *)data+4);

         /* The movi list may contain sub-lists, ignore them */

         if(strncasecmp(data,"LIST",4)==0)
         {
            lseek(AVI->fdes,4,SEEK_CUR);
            continue;
         }

         /* Check if we got a tag ##db, ##dc or ##wb */

         if( ( (data[2]=='d' || data[2]=='D') &&
               (data[3]=='b' || data[3]=='B' || data[3]=='c' || data[3]=='C') )
	     || ( (data[2]=='w' || data[2]=='W') &&
		  (data[3]=='b' || data[3]=='B') ) )
	   {
	   avi_add_index_entry(AVI,(unsigned char *)data,0,lseek(AVI->fdes,0,SEEK_CUR)-8,n);
         }

         lseek(AVI->fdes,PAD_EVEN(n),SEEK_CUR);
      }
      idx_type = 1;
   }

   /* Now generate the video index and audio index arrays */

   nvi = 0;
   for(j=0; j<AVI->anum; ++j) nai[j] = 0;

   for(i=0;i<AVI->n_idx;i++) {

     if(strncasecmp((char *)AVI->idx[i],AVI->video_tag,3) == 0) nvi++;

     for(j=0; j<AVI->anum; ++j) if(strncasecmp((char *)AVI->idx[i], AVI->track[j].audio_tag,4) == 0) nai[j]++;
   }

   AVI->video_frames = nvi;
   for(j=0; j<AVI->anum; ++j) AVI->track[j].audio_chunks = nai[j];

//   fprintf(stderr, "chunks = %ld %d %s\n", AVI->track[0].audio_chunks, AVI->anum, AVI->track[0].audio_tag);

   if(AVI->video_frames==0) ERR_EXIT(AVI_ERR_NO_VIDS);
   AVI->video_index = (video_index_entry *) malloc(nvi*sizeof(video_index_entry));
   if(AVI->video_index==0) ERR_EXIT(AVI_ERR_NO_MEM);

   for(j=0; j<AVI->anum; ++j) {
       if(AVI->track[j].audio_chunks) {
	   AVI->track[j].audio_index = (audio_index_entry *) malloc((nai[j]+1)*sizeof(audio_index_entry));
	   memset(AVI->track[j].audio_index, 0, (nai[j]+1)*(sizeof(audio_index_entry)));
	   if(AVI->track[j].audio_index==0) ERR_EXIT(AVI_ERR_NO_MEM);
       }
   }

   nvi = 0;
   for(j=0; j<AVI->anum; ++j) nai[j] = tot[j] = 0;

   ioff = idx_type == 1 ? 8 : AVI->movi_start+4;

   for(i=0;i<AVI->n_idx;i++) {

     //video
     if(strncasecmp((char *)AVI->idx[i],AVI->video_tag,3) == 0) {
       AVI->video_index[nvi].key = str2ulong(AVI->idx[i]+ 4);
       AVI->video_index[nvi].pos = str2ulong(AVI->idx[i]+ 8)+ioff;
       AVI->video_index[nvi].len = str2ulong(AVI->idx[i]+12);
       nvi++;
     }

     //audio
     for(j=0; j<AVI->anum; ++j) {

       if(strncasecmp((char *)AVI->idx[i],AVI->track[j].audio_tag,4) == 0) {
	 AVI->track[j].audio_index[nai[j]].pos = str2ulong(AVI->idx[i]+ 8)+ioff;
	 AVI->track[j].audio_index[nai[j]].len = str2ulong(AVI->idx[i]+12);
	 AVI->track[j].audio_index[nai[j]].tot = tot[j];
	 tot[j] += AVI->track[j].audio_index[nai[j]].len;
	 nai[j]++;
       }
     }
   }


   for(j=0; j<AVI->anum; ++j) AVI->track[j].audio_bytes = tot[j];

   /* Reposition the file */

   lseek(AVI->fdes,AVI->movi_start,SEEK_SET);
   AVI->video_pos = 0;

   return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x290, %rsp            # imm = 0x290
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movl $0x0, -0xf8(%rbp)
movl $0x0, -0xfc(%rbp)
movl $0x0, -0x100(%rbp)
movl $0x0, -0x104(%rbp)
movl $0x0, -0x108(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
leaq -0x210(%rbp), %rsi
movl $0xc, %edx
callq 0x406dc0
cmpq $0xc, %rax
je 0x405614
movq -0x10(%rbp), %rdi
callq 0x403ba0
movq $0x3, 0x123328(%rip) # 0x528930
movl $0x0, -0x4(%rbp)
jmp 0x406d0e
leaq -0x210(%rbp), %rdi
leaq 0xdda2a(%rip), %rsi     # 0x4e304c
movl $0x4, %edx
callq 0x401070
cmpl $0x0, %eax
jne 0x405652
leaq -0x210(%rbp), %rdi
addq $0x8, %rdi
leaq 0xdda0e(%rip), %rsi     # 0x4e3051
movl $0x4, %edx
callq 0x401070
cmpl $0x0, %eax
je 0x405672
movq -0x10(%rbp), %rdi
callq 0x403ba0
movq $0x9, 0x1232ca(%rip) # 0x528930
movl $0x0, -0x4(%rbp)
jmp 0x406d0e
movq $0x0, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
leaq -0x210(%rbp), %rsi
movl $0x8, %edx
callq 0x406dc0
cmpq $0x8, %rax
je 0x40569f
jmp 0x40594f
leaq -0x210(%rbp), %rdi
addq $0x4, %rdi
callq 0x403a50
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
andq $-0x2, %rax
movq %rax, -0x40(%rbp)
leaq -0x210(%rbp), %rdi
leaq 0xdd985(%rip), %rsi     # 0x4e3056
movl $0x4, %edx
callq 0x401070
cmpl $0x0, %eax
jne 0x40585f
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
leaq -0x210(%rbp), %rsi
movl $0x4, %edx
callq 0x406dc0
cmpq $0x4, %rax
je 0x405724
movq -0x10(%rbp), %rdi
callq 0x403ba0
movq $0x3, 0x123218(%rip) # 0x528930
movl $0x0, -0x4(%rbp)
jmp 0x406d0e
movq -0x40(%rbp), %rax
subq $0x4, %rax
movq %rax, -0x40(%rbp)
leaq -0x210(%rbp), %rdi
leaq 0xdd91d(%rip), %rsi     # 0x4e305b
movl $0x4, %edx
callq 0x401070
cmpl $0x0, %eax
jne 0x4057e6
movq -0x40(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rdi
callq 0x452d20
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x40578d
movq -0x10(%rbp), %rdi
callq 0x403ba0
movq $0x8, 0x1231af(%rip) # 0x528930
movl $0x0, -0x4(%rbp)
jmp 0x406d0e
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x48fba0
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x406dc0
cmpq -0x40(%rbp), %rax
je 0x4057e4
movq -0x10(%rbp), %rdi
callq 0x403ba0
movq $0x3, 0x123158(%rip) # 0x528930
movl $0x0, -0x4(%rbp)
jmp 0x406d0e
jmp 0x40585a
leaq -0x210(%rbp), %rdi
leaq 0xdd8c3(%rip), %rsi     # 0x4e30b7
movl $0x4, %edx
callq 0x401070
cmpl $0x0, %eax
jne 0x405841
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x48fba0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x430(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
movq -0x40(%rbp), %rsi
movl $0x1, %edx
callq 0x48fba0
jmp 0x405858
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
movq -0x40(%rbp), %rsi
movl $0x1, %edx
callq 0x48fba0
jmp 0x40585a
jmp 0x40594a
leaq -0x210(%rbp), %rdi
leaq 0xdd854(%rip), %rsi     # 0x4e30c1
movl $0x4, %edx
callq 0x401070
cmpl $0x0, %eax
jne 0x405931
movq -0x40(%rbp), %rax
movl $0x10, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x3f0(%rax)
movq -0x10(%rbp), %rax
movq %rcx, 0x3e8(%rax)
movq -0x40(%rbp), %rdi
callq 0x452d20
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x408(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x408(%rax)
jne 0x4058ec
movq -0x10(%rbp), %rdi
callq 0x403ba0
movq $0x8, 0x123050(%rip) # 0x528930
movl $0x0, -0x4(%rbp)
jmp 0x406d0e
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
movq -0x10(%rbp), %rax
movq 0x408(%rax), %rsi
movq -0x40(%rbp), %rdx
callq 0x406dc0
cmpq -0x40(%rbp), %rax
je 0x40592f
movq -0x10(%rbp), %rdi
callq 0x403ba0
movq $0x3, 0x12300d(%rip) # 0x528930
movl $0x0, -0x4(%rbp)
jmp 0x406d0e
jmp 0x405948
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
movq -0x40(%rbp), %rsi
movl $0x1, %edx
callq 0x48fba0
jmp 0x40594a
jmp 0x40567a
cmpq $0x0, -0x48(%rbp)
jne 0x405976
movq -0x10(%rbp), %rdi
callq 0x403ba0
movq $0xa, 0x122fc6(%rip) # 0x528930
movl $0x0, -0x4(%rbp)
jmp 0x406d0e
movq -0x10(%rbp), %rax
cmpq $0x0, 0x430(%rax)
jne 0x4059a4
movq -0x10(%rbp), %rdi
callq 0x403ba0
movq $0xb, 0x122f98(%rip) # 0x528930
movl $0x0, -0x4(%rbp)
jmp 0x406d0e
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x58(%rbp), %rax
jge 0x406076
movq -0x48(%rbp), %rdi
addq -0x20(%rbp), %rdi
leaq 0xdd68d(%rip), %rsi     # 0x4e3056
movl $0x4, %edx
callq 0x401070
cmpl $0x0, %eax
jne 0x4059e6
movq -0x20(%rbp), %rax
addq $0xc, %rax
movq %rax, -0x20(%rbp)
jmp 0x4059ac
movq -0x48(%rbp), %rdi
addq -0x20(%rbp), %rdi
addq $0x4, %rdi
callq 0x403a50
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
andq $-0x2, %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rdi
addq -0x20(%rbp), %rdi
leaq 0xdd650(%rip), %rsi     # 0x4e306a
movl $0x4, %edx
callq 0x401070
cmpl $0x0, %eax
jne 0x405c85
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x48(%rbp), %rdi
addq -0x20(%rbp), %rdi
leaq 0xdd627(%rip), %rsi     # 0x4e306f
movl $0x4, %edx
callq 0x401070
cmpl $0x0, %eax
jne 0x405b34
cmpl $0x0, -0xfc(%rbp)
jne 0x405b34
movq -0x10(%rbp), %rax
movq -0x48(%rbp), %rcx
movq -0x20(%rbp), %rdx
movl 0x4(%rcx,%rdx), %ecx
movl %ecx, 0x28(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x2c(%rax)
movq -0x50(%rbp), %rcx
addq -0x20(%rbp), %rcx
addq $0x4, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x3f8(%rax)
movq -0x48(%rbp), %rdi
addq -0x20(%rbp), %rdi
addq $0x14, %rdi
callq 0x403a50
movq %rax, -0x30(%rbp)
movq -0x48(%rbp), %rdi
addq -0x20(%rbp), %rdi
addq $0x18, %rdi
callq 0x403a50
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x405ae4
cvtsi2sdq -0x28(%rbp), %xmm0
cvtsi2sdq -0x30(%rbp), %xmm1
divsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0x20(%rax)
movq -0x48(%rbp), %rdi
addq -0x20(%rbp), %rdi
addq $0x20, %rdi
callq 0x403a50
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x40(%rax)
movslq -0x108(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x58(%rax)
movl $0x1, -0xfc(%rbp)
movl $0x1, -0xf8(%rbp)
jmp 0x405c71
movq -0x48(%rbp), %rdi
addq -0x20(%rbp), %rdi
leaq 0xdd536(%rip), %rsi     # 0x4e3079
movl $0x4, %edx
callq 0x401070
cmpl $0x0, %eax
jne 0x405c65
cmpl $0x0, -0x104(%rbp)
jne 0x405c65
movq -0x10(%rbp), %rax
movl 0x438(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x43c(%rax)
movq -0x10(%rbp), %rax
movl 0x438(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x438(%rax)
movq -0x10(%rbp), %rax
cmpl $0x8, 0x438(%rax)
jle 0x405bc0
movq $0x526c68, %rax         # imm = 0x526C68
movq (%rax), %rdi
leaq 0xdd47c(%rip), %rsi     # 0x4e3024
movl $0x8, %edx
movb $0x0, %al
callq 0x435870
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x406d0e
movq -0x48(%rbp), %rdi
addq -0x20(%rbp), %rdi
addq $0x20, %rdi
callq 0x403a50
movq %rax, -0x270(%rbp)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x403340
movq -0x270(%rbp), %rcx
cltq
imulq %rax, %rcx
movq -0x10(%rbp), %rax
addq $0x60, %rax
movq -0x10(%rbp), %rdx
movslq 0x43c(%rdx), %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x30(%rax)
movslq -0x108(%rbp), %rcx
movq -0x10(%rbp), %rax
addq $0x60, %rax
movq -0x10(%rbp), %rdx
movslq 0x43c(%rdx), %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x28(%rax)
movl $0x2, -0xf8(%rbp)
movq -0x50(%rbp), %rcx
addq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
addq $0x60, %rax
movq -0x10(%rbp), %rdx
movslq 0x43c(%rdx), %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x58(%rax)
jmp 0x405c6f
movl $0x0, -0xf8(%rbp)
jmp 0x405c71
movl -0x108(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x108(%rbp)
jmp 0x406065
movq -0x48(%rbp), %rdi
addq -0x20(%rbp), %rdi
leaq 0xdd3e0(%rip), %rsi     # 0x4e3074
movl $0x4, %edx
callq 0x401070
cmpl $0x0, %eax
jne 0x40604d
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
cmpl $0x1, -0xf8(%rbp)
jne 0x405d9b
movq -0x48(%rbp), %rsi
addq -0x20(%rbp), %rsi
leaq -0x238(%rbp), %rdi
movl $0x28, %edx
callq 0x401058
movl -0x238(%rbp), %eax
movl %eax, %edi
callq 0x452d20
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x440(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x440(%rax)
je 0x405d22
movq -0x10(%rbp), %rax
movq 0x440(%rax), %rdi
movq -0x48(%rbp), %rsi
addq -0x20(%rbp), %rsi
movl -0x238(%rbp), %eax
movl %eax, %edx
callq 0x401058
movq -0x48(%rbp), %rdi
addq -0x20(%rbp), %rdi
addq $0x4, %rdi
callq 0x403a50
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x48(%rbp), %rdi
addq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x403a50
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movl $0x1, -0x100(%rbp)
movq -0x50(%rbp), %rcx
addq -0x20(%rbp), %rcx
addq $0x10, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x400(%rax)
movq -0x10(%rbp), %rax
movq -0x48(%rbp), %rcx
movq -0x20(%rbp), %rdx
movl 0x10(%rcx,%rdx), %ecx
movl %ecx, 0x30(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x34(%rax)
jmp 0x406041
cmpl $0x2, -0xf8(%rbp)
jne 0x40603f
movq -0x58(%rbp), %rax
subq -0x20(%rbp), %rax
cmpq $0x14, %rax
jae 0x405dc6
movq -0x58(%rbp), %rax
subq -0x20(%rbp), %rax
movl %eax, -0x24c(%rbp)
jmp 0x405dd0
movl $0x14, -0x24c(%rbp)
movl $0x14, %edi
callq 0x452d20
movq %rax, -0x240(%rbp)
cmpq $0x0, -0x240(%rbp)
je 0x405f16
movq -0x240(%rbp), %rdi
xorl %esi, %esi
movl $0x14, %edx
callq 0x4010e0
movq -0x240(%rbp), %rdi
movq -0x48(%rbp), %rsi
addq -0x20(%rbp), %rsi
movslq -0x24c(%rbp), %rdx
callq 0x401058
movq -0x240(%rbp), %rax
movzwl 0x10(%rax), %eax
cmpl $0x0, %eax
je 0x405ef8
movq -0x240(%rbp), %rdi
movq -0x240(%rbp), %rax
movzwl 0x10(%rax), %eax
movl %eax, %esi
addq $0x14, %rsi
callq 0x4533b0
movq %rax, -0x248(%rbp)
cmpq $0x0, -0x248(%rbp)
je 0x405ef6
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x48fba0
movq %rax, -0x258(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
movq -0x50(%rbp), %rsi
addq -0x20(%rbp), %rsi
addq $0x14, %rsi
xorl %edx, %edx
callq 0x48fba0
movq -0x248(%rbp), %rax
movq %rax, -0x240(%rbp)
movq -0x248(%rbp), %rax
addq $0x14, %rax
movq %rax, -0x248(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
movq -0x248(%rbp), %rsi
movq -0x240(%rbp), %rax
movzwl 0x10(%rax), %eax
movl %eax, %edx
callq 0x406dc0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
movq -0x258(%rbp), %rsi
xorl %edx, %edx
callq 0x48fba0
jmp 0x405ef8
movq -0x240(%rbp), %rdx
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x43c(%rcx), %rcx
movq %rdx, 0x448(%rax,%rcx,8)
movq -0x48(%rbp), %rdi
addq -0x20(%rbp), %rdi
callq 0x406e40
movq %rax, %rcx
movq -0x10(%rbp), %rax
addq $0x60, %rax
movq -0x10(%rbp), %rdx
movslq 0x43c(%rdx), %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x50(%rbp), %rcx
addq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
addq $0x60, %rax
movq -0x10(%rbp), %rdx
movslq 0x43c(%rdx), %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x60(%rax)
movq -0x48(%rbp), %rdi
addq -0x20(%rbp), %rdi
addq $0x2, %rdi
callq 0x406e40
movq %rax, %rcx
movq -0x10(%rbp), %rax
addq $0x60, %rax
movq -0x10(%rbp), %rdx
movslq 0x43c(%rdx), %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x48(%rbp), %rdi
addq -0x20(%rbp), %rdi
addq $0x4, %rdi
callq 0x403a50
movq %rax, %rcx
movq -0x10(%rbp), %rax
addq $0x60, %rax
movq -0x10(%rbp), %rdx
movslq 0x43c(%rdx), %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x48(%rbp), %rdi
addq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x403a50
shlq $0x3, %rax
movl $0x3e8, %ecx            # imm = 0x3E8
xorl %edx, %edx
divq %rcx
movq %rax, %rcx
movq -0x10(%rbp), %rax
addq $0x60, %rax
movq -0x10(%rbp), %rdx
movslq 0x43c(%rdx), %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x20(%rax)
movq -0x48(%rbp), %rdi
addq -0x20(%rbp), %rdi
addq $0xe, %rdi
callq 0x406e40
movq %rax, %rcx
movq -0x10(%rbp), %rax
addq $0x60, %rax
movq -0x10(%rbp), %rdx
movslq 0x43c(%rdx), %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x18(%rax)
jmp 0x406041
movl $0x0, -0xf8(%rbp)
jmp 0x406063
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0xf8(%rbp)
jmp 0x406065
movq -0x40(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x4059ac
movq -0x48(%rbp), %rdi
callq 0x453060
cmpl $0x0, -0xfc(%rbp)
je 0x406091
cmpl $0x0, -0x100(%rbp)
jne 0x4060b1
movq -0x10(%rbp), %rdi
callq 0x403ba0
movq $0xc, 0x12288b(%rip) # 0x528930
movl $0x0, -0x4(%rbp)
jmp 0x406d0e
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movl $0xa, %ecx
cqto
idivq %rcx
movsbl %al, %eax
addl $0x30, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x48(%rax)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movl $0xa, %ecx
cqto
idivq %rcx
movb %dl, %al
movsbl %al, %eax
addl $0x30, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x49(%rax)
movq -0x10(%rbp), %rax
movb $0x64, 0x4a(%rax)
movq -0x10(%rbp), %rax
movb $0x62, 0x4b(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x68(%rax)
jne 0x40611f
movq -0x10(%rbp), %rax
movq $0x63, 0x88(%rax)
movl $0x0, -0xf4(%rbp)
movl -0xf4(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x438(%rcx), %eax
jge 0x4061e5
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl $0xa, %ecx
cltd
idivl %ecx
addl $0x30, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0xf4(%rbp), %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x40(%rax)
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl $0xa, %ecx
cltd
idivl %ecx
addl $0x30, %edx
movb %dl, %cl
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0xf4(%rbp), %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x41(%rax)
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0xf4(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movb $0x77, 0x42(%rax)
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0xf4(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movb $0x62, 0x43(%rax)
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0x406129
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
movq -0x10(%rbp), %rax
movq 0x430(%rax), %rsi
xorl %edx, %edx
callq 0x48fba0
cmpl $0x0, -0x14(%rbp)
jne 0x406212
movl $0x0, -0x4(%rbp)
jmp 0x406d0e
movq $0x0, -0x38(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x408(%rax)
je 0x406461
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x3e8(%rcx), %rax
jge 0x406284
movq -0x10(%rbp), %rax
movq 0x408(%rax), %rdi
movq -0x20(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
addq $0x48, %rsi
movl $0x3, %edx
callq 0x401070
cmpl $0x0, %eax
jne 0x406274
jmp 0x406284
jmp 0x406276
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x406234
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x3e8(%rcx), %rax
jl 0x4062b5
movq -0x10(%rbp), %rdi
callq 0x403ba0
movq $0xc, 0x122687(%rip) # 0x528930
movl $0x0, -0x4(%rbp)
jmp 0x406d0e
movq -0x10(%rbp), %rax
movq 0x408(%rax), %rdi
movq -0x20(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
addq $0x8, %rdi
callq 0x403a50
movq %rax, -0x260(%rbp)
movq -0x10(%rbp), %rax
movq 0x408(%rax), %rdi
movq -0x20(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
addq $0xc, %rdi
callq 0x403a50
movq %rax, -0x268(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
movq -0x260(%rbp), %rsi
xorl %edx, %edx
callq 0x48fba0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
leaq -0x210(%rbp), %rsi
movl $0x8, %edx
callq 0x406dc0
cmpq $0x8, %rax
je 0x406358
movq -0x10(%rbp), %rdi
callq 0x403ba0
movq $0x3, 0x1225e4(%rip) # 0x528930
movl $0x0, -0x4(%rbp)
jmp 0x406d0e
leaq -0x210(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x408(%rax), %rsi
movq -0x20(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rsi
movl $0x4, %edx
callq 0x401070
cmpl $0x0, %eax
jne 0x4063aa
leaq -0x210(%rbp), %rdi
addq $0x4, %rdi
callq 0x403a50
cmpq -0x268(%rbp), %rax
jne 0x4063aa
movq $0x1, -0x38(%rbp)
jmp 0x40645f
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
movq -0x260(%rbp), %rsi
movq -0x10(%rbp), %rax
addq 0x430(%rax), %rsi
subq $0x4, %rsi
xorl %edx, %edx
callq 0x48fba0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
leaq -0x210(%rbp), %rsi
movl $0x8, %edx
callq 0x406dc0
cmpq $0x8, %rax
je 0x406410
movq -0x10(%rbp), %rdi
callq 0x403ba0
movq $0x3, 0x12252c(%rip) # 0x528930
movl $0x0, -0x4(%rbp)
jmp 0x406d0e
leaq -0x210(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x408(%rax), %rsi
movq -0x20(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rsi
movl $0x4, %edx
callq 0x401070
cmpl $0x0, %eax
jne 0x40645d
leaq -0x210(%rbp), %rdi
addq $0x4, %rdi
callq 0x403a50
cmpq -0x268(%rbp), %rax
jne 0x40645d
movq $0x2, -0x38(%rbp)
jmp 0x40645f
jmp 0x406461
cmpq $0x0, -0x38(%rbp)
jne 0x4065fc
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
movq -0x10(%rbp), %rax
movq 0x430(%rax), %rsi
xorl %edx, %edx
callq 0x48fba0
movq -0x10(%rbp), %rax
movq $0x0, 0x3e8(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
leaq -0x210(%rbp), %rsi
movl $0x8, %edx
callq 0x406dc0
cmpq $0x8, %rax
je 0x4064bb
jmp 0x4065f4
leaq -0x210(%rbp), %rdi
addq $0x4, %rdi
callq 0x403a50
movq %rax, -0x40(%rbp)
leaq -0x210(%rbp), %rdi
leaq 0xdcb79(%rip), %rsi     # 0x4e3056
movl $0x4, %edx
callq 0x401070
cmpl $0x0, %eax
jne 0x406506
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
movl $0x4, %esi
movl $0x1, %edx
callq 0x48fba0
jmp 0x406496
movsbl -0x20e(%rbp), %eax
cmpl $0x64, %eax
je 0x40651e
movsbl -0x20e(%rbp), %eax
cmpl $0x44, %eax
jne 0x40654e
movsbl -0x20d(%rbp), %eax
cmpl $0x62, %eax
je 0x40657e
movsbl -0x20d(%rbp), %eax
cmpl $0x42, %eax
je 0x40657e
movsbl -0x20d(%rbp), %eax
cmpl $0x63, %eax
je 0x40657e
movsbl -0x20d(%rbp), %eax
cmpl $0x43, %eax
je 0x40657e
movsbl -0x20e(%rbp), %eax
cmpl $0x77, %eax
je 0x406566
movsbl -0x20e(%rbp), %eax
cmpl $0x57, %eax
jne 0x4065d0
movsbl -0x20d(%rbp), %eax
cmpl $0x62, %eax
je 0x40657e
movsbl -0x20d(%rbp), %eax
cmpl $0x42, %eax
jne 0x4065d0
movq -0x10(%rbp), %rax
movq %rax, -0x280(%rbp)
leaq -0x210(%rbp), %rax
movq %rax, -0x278(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x48fba0
movq -0x280(%rbp), %rdi
movq -0x278(%rbp), %rsi
movq %rax, %rcx
subq $0x8, %rcx
movq -0x40(%rbp), %r8
xorl %eax, %eax
movl %eax, %edx
callq 0x403660
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
movq -0x40(%rbp), %rsi
addq $0x1, %rsi
andq $-0x2, %rsi
movl $0x1, %edx
callq 0x48fba0
jmp 0x406496
movq $0x1, -0x38(%rbp)
movq $0x0, -0x60(%rbp)
movl $0x0, -0xf4(%rbp)
movl -0xf4(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x438(%rcx), %eax
jge 0x406644
movslq -0xf4(%rbp), %rax
movq $0x0, -0xa0(%rbp,%rax,8)
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0x40660e
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x3e8(%rcx), %rax
jge 0x406736
movq -0x10(%rbp), %rax
movq 0x408(%rax), %rdi
movq -0x20(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
addq $0x48, %rsi
movl $0x3, %edx
callq 0x401070
cmpl $0x0, %eax
jne 0x40669a
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0xf4(%rbp)
movl -0xf4(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x438(%rcx), %eax
jge 0x406723
movq -0x10(%rbp), %rax
movq 0x408(%rax), %rdi
movq -0x20(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
addq $0x60, %rsi
movslq -0xf4(%rbp), %rax
imulq $0x70, %rax, %rax
addq %rax, %rsi
addq $0x40, %rsi
movl $0x4, %edx
callq 0x401070
cmpl $0x0, %eax
jne 0x406710
movslq -0xf4(%rbp), %rax
movq -0xa0(%rbp,%rax,8), %rcx
addq $0x1, %rcx
movq %rcx, -0xa0(%rbp,%rax,8)
jmp 0x406712
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0x4066a4
jmp 0x406725
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x40664c
movq -0x60(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x40(%rax)
movl $0x0, -0xf4(%rbp)
movl -0xf4(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x438(%rcx), %eax
jge 0x406798
movslq -0xf4(%rbp), %rax
movq -0xa0(%rbp,%rax,8), %rcx
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0xf4(%rbp), %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x38(%rax)
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0x40674c
movq -0x10(%rbp), %rax
cmpq $0x0, 0x40(%rax)
jne 0x4067c3
movq -0x10(%rbp), %rdi
callq 0x403ba0
movq $0xc, 0x122179(%rip) # 0x528930
movl $0x0, -0x4(%rbp)
jmp 0x406d0e
imulq $0x18, -0x60(%rbp), %rdi
callq 0x452d20
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x410(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x410(%rax)
jne 0x406809
movq -0x10(%rbp), %rdi
callq 0x403ba0
movq $0x8, 0x122133(%rip) # 0x528930
movl $0x0, -0x4(%rbp)
jmp 0x406d0e
movl $0x0, -0xf4(%rbp)
movl -0xf4(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x438(%rcx), %eax
jge 0x406910
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0xf4(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x38(%rax)
je 0x4068fa
movslq -0xf4(%rbp), %rax
movq -0xa0(%rbp,%rax,8), %rax
addq $0x1, %rax
imulq $0x18, %rax, %rdi
callq 0x452d20
movq %rax, %rcx
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0xf4(%rbp), %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x68(%rax)
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0xf4(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq 0x68(%rax), %rdi
movslq -0xf4(%rbp), %rax
movq -0xa0(%rbp,%rax,8), %rax
addq $0x1, %rax
imulq $0x18, %rax, %rdx
xorl %esi, %esi
callq 0x4010e0
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0xf4(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x68(%rax)
jne 0x4068f8
movq -0x10(%rbp), %rdi
callq 0x403ba0
movq $0x8, 0x122044(%rip) # 0x528930
movl $0x0, -0x4(%rbp)
jmp 0x406d0e
jmp 0x4068fa
jmp 0x4068fc
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0x406813
movq $0x0, -0x60(%rbp)
movl $0x0, -0xf4(%rbp)
movl -0xf4(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x438(%rcx), %eax
jge 0x40696b
movslq -0xf4(%rbp), %rax
movq $0x0, -0xf0(%rbp,%rax,8)
movslq -0xf4(%rbp), %rax
movq $0x0, -0xa0(%rbp,%rax,8)
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0x406922
cmpq $0x1, -0x38(%rbp)
jne 0x406980
movl $0x8, %eax
movq %rax, -0x288(%rbp)
jmp 0x406996
movq -0x10(%rbp), %rax
movq 0x430(%rax), %rax
addq $0x4, %rax
movq %rax, -0x288(%rbp)
movq -0x288(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x3e8(%rcx), %rax
jge 0x406c8a
movq -0x10(%rbp), %rax
movq 0x408(%rax), %rdi
movq -0x20(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
addq $0x48, %rsi
movl $0x3, %edx
callq 0x401070
cmpl $0x0, %eax
jne 0x406aaf
movq -0x10(%rbp), %rax
movq 0x408(%rax), %rdi
movq -0x20(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
addq $0x4, %rdi
callq 0x403a50
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq 0x410(%rax), %rax
imulq $0x18, -0x60(%rbp), %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq 0x408(%rax), %rdi
movq -0x20(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
addq $0x8, %rdi
callq 0x403a50
movq %rax, %rcx
addq -0xa8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x410(%rax), %rax
imulq $0x18, -0x60(%rbp), %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x408(%rax), %rdi
movq -0x20(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
addq $0xc, %rdi
callq 0x403a50
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq 0x410(%rax), %rax
imulq $0x18, -0x60(%rbp), %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0xf4(%rbp)
movl -0xf4(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x438(%rcx), %eax
jge 0x406c77
movq -0x10(%rbp), %rax
movq 0x408(%rax), %rdi
movq -0x20(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
addq $0x60, %rsi
movslq -0xf4(%rbp), %rax
imulq $0x70, %rax, %rax
addq %rax, %rsi
addq $0x40, %rsi
movl $0x4, %edx
callq 0x401070
cmpl $0x0, %eax
jne 0x406c61
movq -0x10(%rbp), %rax
movq 0x408(%rax), %rdi
movq -0x20(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
addq $0x8, %rdi
callq 0x403a50
movq %rax, %rcx
addq -0xa8(%rbp), %rcx
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0xf4(%rbp), %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
movq 0x68(%rax), %rax
movslq -0xf4(%rbp), %rdx
imulq $0x18, -0xa0(%rbp,%rdx,8), %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq 0x408(%rax), %rdi
movq -0x20(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
addq $0xc, %rdi
callq 0x403a50
movq %rax, %rcx
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0xf4(%rbp), %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
movq 0x68(%rax), %rax
movslq -0xf4(%rbp), %rdx
imulq $0x18, -0xa0(%rbp,%rdx,8), %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movslq -0xf4(%rbp), %rax
movq -0xf0(%rbp,%rax,8), %rcx
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0xf4(%rbp), %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
movq 0x68(%rax), %rax
movslq -0xf4(%rbp), %rdx
imulq $0x18, -0xa0(%rbp,%rdx,8), %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0xf4(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq 0x68(%rax), %rax
movslq -0xf4(%rbp), %rcx
imulq $0x18, -0xa0(%rbp,%rcx,8), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
movslq -0xf4(%rbp), %rax
addq -0xf0(%rbp,%rax,8), %rcx
movq %rcx, -0xf0(%rbp,%rax,8)
movslq -0xf4(%rbp), %rax
movq -0xa0(%rbp,%rax,8), %rcx
addq $0x1, %rcx
movq %rcx, -0xa0(%rbp,%rax,8)
jmp 0x406c63
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0x406ab9
jmp 0x406c79
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x4069ac
movl $0x0, -0xf4(%rbp)
movl -0xf4(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x438(%rcx), %eax
jge 0x406ce0
movslq -0xf4(%rbp), %rax
movq -0xf0(%rbp,%rax,8), %rcx
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0xf4(%rbp), %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x30(%rax)
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0x406c94
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
movq -0x10(%rbp), %rax
movq 0x430(%rax), %rsi
xorl %edx, %edx
callq 0x48fba0
movq -0x10(%rbp), %rax
movq $0x0, 0x50(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x290, %rsp            # imm = 0x290
popq %rbp
retq
nopw (%rax,%rax)