// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/avilib.c
// Function: avi_close_output_file
static int avi_close_output_file(avi_t *AVI)
{

   int ret, njunk, sampsize, hasIndex, ms_per_frame, frate, idxerror, flag;
   unsigned long movi_len;
   int hdrl_start, strl_start, j;
   unsigned char AVI_header[HEADERBYTES];
   long nhb;

#ifdef INFO_LIST
   long info_len;
//   time_t calptr;
#endif

   /* Calculate length of movi list */

   movi_len = AVI->pos - HEADERBYTES + 4;

   /* Try to ouput the index entries. This may fail e.g. if no space
      is left on device. We will report this as an error, but we still
      try to write the header correctly (so that the file still may be
      readable in the most cases */

   idxerror = 0;
   //   fprintf(stderr, "pos=%lu, index_len=%ld             \n", AVI->pos, AVI->n_idx*16);
   ret = avi_add_chunk(AVI, (unsigned char *)"idx1", (unsigned char *)AVI->idx, AVI->n_idx*16);
   hasIndex = (ret==0);
   //fprintf(stderr, "pos=%lu, index_len=%d\n", AVI->pos, hasIndex);

   if(ret) {
     idxerror = 1;
     AVI_errno = AVI_ERR_WRITE_INDEX;
   }

   /* Calculate Microseconds per frame */

   if(AVI->fps < 0.001) {
     frate=0;
     ms_per_frame=0;
   } else {
     frate = (int) (FRAME_RATE_SCALE*AVI->fps + 0.5);
     ms_per_frame=(int) (1000000/AVI->fps + 0.5);
   }

   /* Prepare the file header */

   nhb = 0;

   /* The RIFF header */

   OUT4CC ("RIFF");
   OUTLONG(AVI->pos - 8);    /* # of bytes to follow */
   OUT4CC ("AVI ");

   /* Start the header list */

   OUT4CC ("LIST");
   OUTLONG(0);        /* Length of list in bytes, don't know yet */
   hdrl_start = nhb;  /* Store start position */
   OUT4CC ("hdrl");

   /* The main AVI header */

   /* The Flags in AVI File header */

#define AVIF_HASINDEX           0x00000010      /* Index at end of file */
#define AVIF_MUSTUSEINDEX       0x00000020
#define AVIF_ISINTERLEAVED      0x00000100
#define AVIF_TRUSTCKTYPE        0x00000800      /* Use CKType to find key frames */
#define AVIF_WASCAPTUREFILE     0x00010000
#define AVIF_COPYRIGHTED        0x00020000

   OUT4CC ("avih");
   OUTLONG(56);                 /* # of bytes to follow */
   OUTLONG(ms_per_frame);       /* Microseconds per frame */
   //ThOe ->0
   //   OUTLONG(10000000);           /* MaxBytesPerSec, I hope this will never be used */
   OUTLONG(0);
   OUTLONG(0);                  /* PaddingGranularity (whatever that might be) */
                                /* Other sources call it 'reserved' */
   flag = AVIF_ISINTERLEAVED;
   if(hasIndex) flag |= AVIF_HASINDEX;
   if(hasIndex && AVI->must_use_index) flag |= AVIF_MUSTUSEINDEX;
   OUTLONG(flag);               /* Flags */
   OUTLONG(AVI->video_frames);  /* TotalFrames */
   OUTLONG(0);                  /* InitialFrames */

   OUTLONG(AVI->anum+1);
//   if (AVI->track[0].audio_bytes)
//      { OUTLONG(2); }           /* Streams */
//   else
//      { OUTLONG(1); }           /* Streams */

   OUTLONG(0);                  /* SuggestedBufferSize */
   OUTLONG(AVI->width);         /* Width */
   OUTLONG(AVI->height);        /* Height */
                                /* MS calls the following 'reserved': */
   OUTLONG(0);                  /* TimeScale:  Unit used to measure time */
   OUTLONG(0);                  /* DataRate:   Data rate of playback     */
   OUTLONG(0);                  /* StartTime:  Starting time of AVI data */
   OUTLONG(0);                  /* DataLength: Size of AVI data chunk    */


   /* Start the video stream list ---------------------------------- */

   OUT4CC ("LIST");
   OUTLONG(0);        /* Length of list in bytes, don't know yet */
   strl_start = nhb;  /* Store start position */
   OUT4CC ("strl");

   /* The video stream header */

   OUT4CC ("strh");
   OUTLONG(56);                 /* # of bytes to follow */
   OUT4CC ("vids");             /* Type */
   OUT4CC (AVI->compressor);    /* Handler */
   OUTLONG(0);                  /* Flags */
   OUTLONG(0);                  /* Reserved, MS says: wPriority, wLanguage */
   OUTLONG(0);                  /* InitialFrames */
   OUTLONG(FRAME_RATE_SCALE);              /* Scale */
   OUTLONG(frate);              /* Rate: Rate/Scale == samples/second */
   OUTLONG(0);                  /* Start */
   OUTLONG(AVI->video_frames);  /* Length */
   OUTLONG(0);                  /* SuggestedBufferSize */
   OUTLONG(-1);                 /* Quality */
   OUTLONG(0);                  /* SampleSize */
   OUTLONG(0);                  /* Frame */
   OUTLONG(0);                  /* Frame */
   //   OUTLONG(0);                  /* Frame */
   //OUTLONG(0);                  /* Frame */

   /* The video stream format */

   OUT4CC ("strf");
   OUTLONG(40);                 /* # of bytes to follow */
   OUTLONG(40);                 /* Size */
   OUTLONG(AVI->width);         /* Width */
   OUTLONG(AVI->height);        /* Height */
   OUTSHRT(1); OUTSHRT(24);     /* Planes, Count */
   OUT4CC (AVI->compressor);    /* Compression */
   // ThOe (*3)
   OUTLONG(AVI->width*AVI->height*3);  /* SizeImage (in bytes?) */
   OUTLONG(0);                  /* XPelsPerMeter */
   OUTLONG(0);                  /* YPelsPerMeter */
   OUTLONG(0);                  /* ClrUsed: Number of colors used */
   OUTLONG(0);                  /* ClrImportant: Number of colors important */

   /* Finish stream list, i.e. put number of bytes in the list to proper pos */

   long2str(AVI_header+strl_start-4,nhb-strl_start);

   /* Start the audio stream list ---------------------------------- */

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

     //if (AVI->track[j].a_chans && AVI->track[j].audio_bytes)
       {

	 sampsize = avi_sampsize(AVI, j);

	 OUT4CC ("LIST");
	 OUTLONG(0);        /* Length of list in bytes, don't know yet */
	 strl_start = nhb;  /* Store start position */
	 OUT4CC ("strl");

	 /* The audio stream header */

	 OUT4CC ("strh");
	 OUTLONG(56);            /* # of bytes to follow */
	 OUT4CC ("auds");

	 // -----------
	 // ThOe
	 OUTLONG(0);             /* Format (Optionally) */
	   // -----------

	 OUTLONG(0);             /* Flags */
	 OUTLONG(0);             /* Reserved, MS says: wPriority, wLanguage */
	 OUTLONG(0);             /* InitialFrames */

	 // ThOe /4
	 OUTLONG(sampsize/4);      /* Scale */
	 OUTLONG(1000*AVI->track[j].mp3rate/8);
	 OUTLONG(0);             /* Start */
	 OUTLONG(4*AVI->track[j].audio_bytes/sampsize);   /* Length */
	 OUTLONG(0);             /* SuggestedBufferSize */
	 OUTLONG(-1);            /* Quality */

	 // ThOe /4
	 OUTLONG(sampsize/4);    /* SampleSize */

	 OUTLONG(0);             /* Frame */
	 OUTLONG(0);             /* Frame */
	 //	 OUTLONG(0);             /* Frame */
	 //OUTLONG(0);             /* Frame */

	 /* The audio stream format */

	 OUT4CC ("strf");
	 OUTLONG(16);                   /* # of bytes to follow */
	 OUTSHRT(AVI->track[j].a_fmt);           /* Format */
	 OUTSHRT(AVI->track[j].a_chans);         /* Number of channels */
	 OUTLONG(AVI->track[j].a_rate);          /* SamplesPerSec */
	 // ThOe
	 OUTLONG(1000*AVI->track[j].mp3rate/8);
	 //ThOe (/4)

	 OUTSHRT(sampsize/4);           /* BlockAlign */


	 OUTSHRT(AVI->track[j].a_bits);          /* BitsPerSample */

	 /* Finish stream list, i.e. put number of bytes in the list to proper pos */
       }
       long2str(AVI_header+strl_start-4,nhb-strl_start);
   }

   /* Finish header list */

   long2str(AVI_header+hdrl_start-4,nhb-hdrl_start);


   // add INFO list --- (0.6.0pre4)

#ifdef INFO_LIST
   OUT4CC ("LIST");

   //FIXME
   info_len = MAX_INFO_STRLEN + 12;
   OUTLONG(info_len);
   OUT4CC ("INFO");

//   OUT4CC ("INAM");
//   OUTLONG(MAX_INFO_STRLEN);

//   sprintf(id_str, "\t");
//   memset(AVI_header+nhb, 0, MAX_INFO_STRLEN);
//   memcpy(AVI_header+nhb, id_str, strlen(id_str));
//   nhb += MAX_INFO_STRLEN;

   OUT4CC ("ISFT");
   OUTLONG(MAX_INFO_STRLEN);

   //sprintf(id_str, "%s-%s", PACKAGE, VERSION);
   memset(AVI_header+nhb, 0, MAX_INFO_STRLEN);
   //memcpy(AVI_header+nhb, id_str, strlen(id_str));
   nhb += MAX_INFO_STRLEN;

//   OUT4CC ("ICMT");
//   OUTLONG(MAX_INFO_STRLEN);

//   calptr=time(NULL);
//   sprintf(id_str, "\t%s %s", ctime(&calptr), "");
//   memset(AVI_header+nhb, 0, MAX_INFO_STRLEN);
//   memcpy(AVI_header+nhb, id_str, 25);
//   nhb += MAX_INFO_STRLEN;
#endif

   // ----------------------------

   /* Calculate the needed amount of junk bytes, output junk */

   njunk = HEADERBYTES - nhb - 8 - 12;

   /* Safety first: if njunk <= 0, somebody has played with
      HEADERBYTES without knowing what (s)he did.
      This is a fatal error */

   if(njunk<=0)
   {
      fprintf(stderr,"AVI_close_output_file: # of header bytes too small\n");
      exit(1);
   }

   OUT4CC ("JUNK");
   OUTLONG(njunk);
   memset(AVI_header+nhb,0,njunk);

   nhb += njunk;

   /* Start the movi list */

   OUT4CC ("LIST");
   OUTLONG(movi_len); /* Length of list in bytes */
   OUT4CC ("movi");

   /* Output the header, truncate the file to the number of bytes
      actually written, report an error if someting goes wrong */

   if ( lseek(AVI->fdes,0,SEEK_SET)<0 ||
        avi_write(AVI->fdes,(char *)AVI_header,HEADERBYTES)!=HEADERBYTES ||
        ftruncate(AVI->fdes,AVI->pos)<0 )
   {
      AVI_errno = AVI_ERR_CLOSE;
      return -1;
   }

   if(idxerror) return -1;

   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x860, %rsp            # imm = 0x860
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x3e0(%rax), %rax
subq $0x800, %rax            # imm = 0x800
addq $0x4, %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x408(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x3e8(%rax), %rax
shlq $0x4, %rax
movl %eax, %ecx
leaq 0xdf39b(%rip), %rsi     # 0x4e30c1
callq 0x408050
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x403d55
movl $0x1, -0x2c(%rbp)
movq $0x5, 0x124bdb(%rip) # 0x528930
movq -0x10(%rbp), %rax
movsd 0xdf2a7(%rip), %xmm0    # 0x4e3008
ucomisd 0x20(%rax), %xmm0
jbe 0x403d78
movl $0x0, -0x28(%rbp)
movl $0x0, -0x24(%rbp)
jmp 0x403dc4
movq -0x10(%rbp), %rax
movsd 0x20(%rax), %xmm0
movsd 0xdf28f(%rip), %xmm1    # 0x4e3018
mulsd %xmm1, %xmm0
movsd 0xdf27b(%rip), %xmm1    # 0x4e3010
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movsd 0xdf26c(%rip), %xmm0    # 0x4e3018
divsd 0x20(%rax), %xmm0
movsd 0xdf257(%rip), %xmm1    # 0x4e3010
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x24(%rbp)
movq $0x0, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x403df0
movq -0x858(%rbp), %rax
movl 0xdf263(%rip), %ecx     # 0x4e304c
movl %ecx, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x403e33
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x3e0(%rax), %rax
subq $0x8, %rax
movl %eax, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x403e66
movq -0x858(%rbp), %rax
movl 0xdf1f2(%rip), %ecx     # 0x4e3051
movl %ecx, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x403e99
movq -0x858(%rbp), %rax
movl 0xdf1c4(%rip), %ecx     # 0x4e3056
movl %ecx, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x403ecd
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
movq -0x858(%rbp), %rax
movl %eax, -0x3c(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x403f0a
movq -0x858(%rbp), %rax
movl 0xdf158(%rip), %ecx     # 0x4e305b
movl %ecx, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x403f3d
movq -0x858(%rbp), %rax
movl 0xdf12a(%rip), %ecx     # 0x4e3060
movl %ecx, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x403f74
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movl $0x38, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x403fa9
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x403fdd
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404011
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
movl $0x100, -0x30(%rbp)     # imm = 0x100
cmpl $0x0, -0x20(%rbp)
je 0x404039
movl -0x30(%rbp), %eax
orl $0x10, %eax
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x20(%rbp)
je 0x404055
movq -0x10(%rbp), %rax
cmpl $0x0, 0x428(%rax)
je 0x404055
movl -0x30(%rbp), %eax
orl $0x20, %eax
movl %eax, -0x30(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404078
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movl -0x30(%rbp), %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x4040b4
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl %eax, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x4040e8
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404127
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x438(%rax), %esi
addl $0x1, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x40415b
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404197
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl %eax, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x4041d3
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movl %eax, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404207
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x40423b
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x40426f
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x4042a3
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x4042d6
movq -0x858(%rbp), %rax
movl 0xded87(%rip), %ecx     # 0x4e3056
movl %ecx, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x40430a
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
movq -0x858(%rbp), %rax
movl %eax, -0x40(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404347
movq -0x858(%rbp), %rax
movl 0xded25(%rip), %ecx     # 0x4e3065
movl %ecx, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x40437a
movq -0x858(%rbp), %rax
movl 0xdecf7(%rip), %ecx     # 0x4e306a
movl %ecx, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x4043b1
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movl $0x38, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x4043e4
movq -0x858(%rbp), %rax
movl 0xdec92(%rip), %ecx     # 0x4e306f
movl %ecx, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404418
movq -0x858(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x28(%rcx), %ecx
movl %ecx, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x40444c
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404480
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x4044b4
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x4044eb
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movl $0xf4240, %esi          # imm = 0xF4240
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404520
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movl -0x28(%rbp), %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404554
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404590
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl %eax, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x4045c4
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x4045fb
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x40462f
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404663
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404697
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x4046ca
movq -0x858(%rbp), %rax
movl 0xde9b1(%rip), %ecx     # 0x4e3074
movl %ecx, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404701
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movl $0x28, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404738
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movl $0x28, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404774
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl %eax, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x4047b0
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movl %eax, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fe, -0x858(%rbp) # imm = 0x7FE
jg 0x4047ed
movq -0x858(%rbp), %rax
movb $0x1, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
movb $0x0, -0x84f(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fe, -0x858(%rbp) # imm = 0x7FE
jg 0x40482a
movq -0x858(%rbp), %rax
movb $0x18, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
movb $0x0, -0x84f(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x40485e
movq -0x858(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x28(%rcx), %ecx
movl %ecx, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x4048a7
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
imulq 0x18(%rcx), %rax
imulq $0x3, %rax, %rax
movl %eax, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x4048db
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x40490f
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404943
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404977
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
leaq -0x850(%rbp), %rdi
movslq -0x40(%rbp), %rax
addq %rax, %rdi
addq $-0x4, %rdi
movq -0x858(%rbp), %rax
movslq -0x40(%rbp), %rcx
subq %rcx, %rax
movl %eax, %esi
callq 0x4032e0
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x438(%rcx), %eax
jge 0x40513a
movq -0x10(%rbp), %rdi
movl -0x44(%rbp), %esi
callq 0x403340
movl %eax, -0x1c(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x4049fa
movq -0x858(%rbp), %rax
movl 0xde663(%rip), %ecx     # 0x4e3056
movl %ecx, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404a2e
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
movq -0x858(%rbp), %rax
movl %eax, -0x40(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404a6b
movq -0x858(%rbp), %rax
movl 0xde601(%rip), %ecx     # 0x4e3065
movl %ecx, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404a9e
movq -0x858(%rbp), %rax
movl 0xde5d3(%rip), %ecx     # 0x4e306a
movl %ecx, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404ad5
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movl $0x38, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404b08
movq -0x858(%rbp), %rax
movl 0xde578(%rip), %ecx     # 0x4e3079
movl %ecx, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404b3c
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404b70
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404ba4
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404bd8
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404c17
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movl -0x1c(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %eax, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404c70
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0x44(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
imulq $0x3e8, 0x20(%rax), %rax # imm = 0x3E8
movl $0x8, %ecx
cqto
idivq %rcx
movl %eax, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404ca4
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404cfc
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0x44(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq 0x30(%rax), %rax
shlq $0x2, %rax
movslq -0x1c(%rbp), %rcx
cqto
idivq %rcx
movl %eax, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404d30
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404d67
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404da6
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movl -0x1c(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %eax, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404dda
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404e0e
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404e41
movq -0x858(%rbp), %rax
movl 0xde23a(%rip), %ecx     # 0x4e3074
movl %ecx, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404e78
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movl $0x10, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fe, -0x858(%rbp) # imm = 0x7FE
jg 0x404ef3
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0x44(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
andq $0xff, %rax
movb %al, %cl
movq -0x858(%rbp), %rax
movb %cl, -0x850(%rbp,%rax)
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0x44(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
sarq $0x8, %rax
andq $0xff, %rax
movb %al, %cl
movq -0x858(%rbp), %rax
movb %cl, -0x84f(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fe, -0x858(%rbp) # imm = 0x7FE
jg 0x404f70
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0x44(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
andq $0xff, %rax
movb %al, %cl
movq -0x858(%rbp), %rax
movb %cl, -0x850(%rbp,%rax)
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0x44(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
sarq $0x8, %rax
andq $0xff, %rax
movb %al, %cl
movq -0x858(%rbp), %rax
movb %cl, -0x84f(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x404fbb
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0x44(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl %eax, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x405014
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0x44(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
imulq $0x3e8, 0x20(%rax), %rax # imm = 0x3E8
movl $0x8, %ecx
cqto
idivq %rcx
movl %eax, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fe, -0x858(%rbp) # imm = 0x7FE
jg 0x405076
movl -0x1c(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
andl $0xff, %eax
movb %al, %cl
movq -0x858(%rbp), %rax
movb %cl, -0x850(%rbp,%rax)
movl -0x1c(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
sarl $0x8, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x858(%rbp), %rax
movb %cl, -0x84f(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fe, -0x858(%rbp) # imm = 0x7FE
jg 0x4050f3
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0x44(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
andq $0xff, %rax
movb %al, %cl
movq -0x858(%rbp), %rax
movb %cl, -0x850(%rbp,%rax)
movq -0x10(%rbp), %rax
addq $0x60, %rax
movslq -0x44(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
sarq $0x8, %rax
andq $0xff, %rax
movb %al, %cl
movq -0x858(%rbp), %rax
movb %cl, -0x84f(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x858(%rbp)
leaq -0x850(%rbp), %rdi
movslq -0x40(%rbp), %rax
addq %rax, %rdi
addq $-0x4, %rdi
movq -0x858(%rbp), %rax
movslq -0x40(%rbp), %rcx
subq %rcx, %rax
movl %eax, %esi
callq 0x4032e0
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x4049b7
leaq -0x850(%rbp), %rdi
movslq -0x3c(%rbp), %rax
addq %rax, %rdi
addq $-0x4, %rdi
movq -0x858(%rbp), %rax
movslq -0x3c(%rbp), %rcx
subq %rcx, %rax
movl %eax, %esi
callq 0x4032e0
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x405182
movq -0x858(%rbp), %rax
movl 0xddedb(%rip), %ecx     # 0x4e3056
movl %ecx, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
movq $0x4c, -0x860(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x4051c8
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movq -0x860(%rbp), %rax
movl %eax, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x4051fb
movq -0x858(%rbp), %rax
movl 0xde114(%rip), %ecx     # 0x4e3308
movl %ecx, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x40522e
movq -0x858(%rbp), %rax
movl 0xde0e6(%rip), %ecx     # 0x4e330d
movl %ecx, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x405265
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movl $0x40, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x4010e0
movq -0x858(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x858(%rbp)
movl $0x800, %eax            # imm = 0x800
subq -0x858(%rbp), %rax
subq $0x8, %rax
subq $0xc, %rax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jg 0x4052e2
movq $0x526c68, %rax         # imm = 0x526C68
movq (%rax), %rdi
leaq 0xdddad(%rip), %rsi     # 0x4e307e
movb $0x0, %al
callq 0x435870
movl $0x1, %edi
callq 0x434710
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x405303
movq -0x858(%rbp), %rax
movl 0xdddb6(%rip), %ecx     # 0x4e30b2
movl %ecx, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x405338
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movslq -0x18(%rbp), %rdx
xorl %esi, %esi
callq 0x4010e0
movslq -0x18(%rbp), %rax
addq -0x858(%rbp), %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x405396
movq -0x858(%rbp), %rax
movl 0xddcc7(%rip), %ecx     # 0x4e3056
movl %ecx, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x4053ce
leaq -0x850(%rbp), %rdi
addq -0x858(%rbp), %rdi
movq -0x38(%rbp), %rax
movl %eax, %esi
callq 0x4032e0
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
cmpq $0x7fc, -0x858(%rbp) # imm = 0x7FC
jg 0x405401
movq -0x858(%rbp), %rax
movl 0xddcbd(%rip), %ecx     # 0x4e30b7
movl %ecx, -0x850(%rbp,%rax)
movq -0x858(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x858(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x48fba0
cmpq $0x0, %rax
jl 0x40546d
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
leaq -0x850(%rbp), %rsi
movl $0x800, %edx            # imm = 0x800
callq 0x401a30
cmpq $0x800, %rax            # imm = 0x800
jne 0x40546d
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %edi
movq -0x10(%rbp), %rax
movq 0x3e0(%rax), %rsi
callq 0x4909a0
cmpl $0x0, %eax
jge 0x405481
movq $0x6, 0x1234b8(%rip) # 0x528930
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x405497
cmpl $0x0, -0x2c(%rbp)
je 0x405490
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x405497
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x860, %rsp            # imm = 0x860
popq %rbp
retq
nopw %cs:(%rax,%rax)