// File: atsidaev[P]trx2x/DiskImage.cpp
// Function: TDiskImage::readFDD(int, bool)
void TDiskImage::readFDD(int hfile, bool readonly)
{

   long fsize = filelength(hfile);
   if(fsize < 0 )
   {
      ShowError(ERR_GETLEN);
      return;
   }

   unsigned char *ptr = (unsigned char*)new char[fsize+1024*32];
   if(!ptr)
   {
      ShowError(ERR_NOMEM);
      return;
   }

   unsigned long rsize = read(hfile, ptr, fsize);
   if(rsize < sizeof(FDD_MAIN_HEADER))
   {
      delete ptr;
      ShowError(ERR_CORRUPT);
      return;
   }

   FDD_MAIN_HEADER *fdd_hdr = (FDD_MAIN_HEADER*)ptr;

   int MaxC = fdd_hdr->MaxTracks;
   int MaxH = fdd_hdr->MaxHeads;

   if( MaxH > 2 )
   {
      delete ptr;
      ShowError(ERR_MANYSIDS);
      return;
   }


   MaxH = (MaxH - 1)&0xFF;
   MaxC = (MaxC - 1)&0xFF;


   MaxTrack = MaxC;
   MaxSide = MaxH;


// форматирование нового диска и размещение FDD секторов...
   unsigned int ptrcrc;
   unsigned int r;
   unsigned short vgcrc;
   unsigned int trkdatalen;
   unsigned SecCount;
   unsigned SL;

   FDD_TRACK_HEADER *trackinfo;

   unsigned int trk, side;

   for(trk=0; trk <= unsigned(MaxTrack); trk++)
      for(side=0; side <= unsigned(MaxSide); side++)
      {
         FTrackLength[trk][side] = 6250;

// make unformatted track...
         FTracksPtr[trk][side][0] = (unsigned char*)new char[FTrackLength[trk][side]+1024];      // trk img
         FTracksPtr[trk][side][1] = (unsigned char*)new char[FTrackLength[trk][side]+1024];      // clk img
         for(unsigned ij=0; ij < 6250; ij++)   
         {
            FTracksPtr[trk][side][0][ij] = 0x00;
            FTracksPtr[trk][side][1][ij] = 0x00;         
         }

         if( (fdd_hdr->DataOffset[trk*(MaxSide+1)+side]+2) > int(rsize) )
         {
            delete ptr;
            for(int t=0; t < 256; t++)
               for(int s=0; s < 256; s++)
               {
                  FTrackLength[t][s] = 0;
                  if(FTracksPtr[t][s][0]) delete FTracksPtr[t][s][0];
                  FTracksPtr[t][s][0] = NULL;
                  if(FTracksPtr[t][s][1]) delete FTracksPtr[t][s][1];
                  FTracksPtr[t][s][1] = NULL;
               }
            ShowError(ERR_CORRUPT);
            return;
         }

         trackinfo = (FDD_TRACK_HEADER *) (ptr + fdd_hdr->DataOffset[trk*(MaxSide+1)+side]);

         SecCount = trackinfo->SectNum;

         if( ( 2+SecCount*8 + fdd_hdr->DataOffset[trk*(MaxSide+1)+side]) > rsize )
         {
            delete ptr;
            for(int t=0; t < 256; t++)
               for(int s=0; s < 256; s++)
               {
                  FTrackLength[t][s] = 0;
                  if(FTracksPtr[t][s][0]) delete FTracksPtr[t][s][0];
                  FTracksPtr[t][s][0] = NULL;
                  if(FTracksPtr[t][s][1]) delete FTracksPtr[t][s][1];
                  FTracksPtr[t][s][1] = NULL;
               }
            ShowError(ERR_CORRUPT);
            return;
         }
         else if(trackinfo->sect[SecCount-1].SectPos > int(rsize))
         {
            delete ptr;
            for(int t=0; t < 256; t++)
               for(int s=0; s < 256; s++)
               {
                  FTrackLength[t][s] = 0;
                  if(FTracksPtr[t][s][0]) delete FTracksPtr[t][s][0];
                  FTracksPtr[t][s][0] = NULL;
                  if(FTracksPtr[t][s][1]) delete FTracksPtr[t][s][1];
                  FTracksPtr[t][s][1] = NULL;
               }
            ShowError(ERR_CORRUPT);
            return;
         }



// Вычисляем необходимое число байт под данные:
         trkdatalen = 0;
         for(unsigned int ilsec=0; ilsec < SecCount; ilsec++)
         {
            trkdatalen += 2+6;     // for marks:   0xA1, 0xFE, 6bytes
            SL = unsigned(trackinfo->sect[ilsec].size);
            if(!SL) SL = 128;
            else SL = 128 << SL;

            trkdatalen += 4;       // for data header/crc: 0xA1, 0xFB, ...,2bytes

            trkdatalen += SL;
         }

         if(trkdatalen + SecCount*(3+2) > 6250)    // 3x4E & 2x00 per sec checking
         {
            delete ptr;
            for(int t=0; t < 256; t++)
               for(int s=0; s < 256; s++)
               {
                  FTrackLength[t][s] = 0;
                  if(FTracksPtr[t][s][0]) delete FTracksPtr[t][s][0];
                  FTracksPtr[t][s][0] = NULL;
                  if(FTracksPtr[t][s][1]) delete FTracksPtr[t][s][1];
                  FTracksPtr[t][s][1] = NULL;
               }
            ShowError(ERR_IMPOSSIBLE);
            return;
         }

         unsigned int FreeSpace = 6250 - (trkdatalen + SecCount*(3+2));

         unsigned int SynchroPulseLen = 1; // 1 уже учтен в trkdatalen...
         unsigned int FirstSpaceLen = 1;
         unsigned int SecondSpaceLen = 1;
         unsigned int ThirdSpaceLen = 1;
         unsigned int SynchroSpaceLen = 1;
         FreeSpace -= FirstSpaceLen+SecondSpaceLen+ThirdSpaceLen+SynchroSpaceLen;

// Распределяем длины пробелов и синхропромежутка:
         while(FreeSpace > 0)
         {
            if(FreeSpace>=(SecCount*2)) 
               if(SynchroSpaceLen < 12) {SynchroSpaceLen++; FreeSpace-=SecCount*2;} // Synchro for ADM & DATA
            if(FreeSpace < SecCount) break;

            if(FirstSpaceLen < 10) {FirstSpaceLen++; FreeSpace-=SecCount;}
            if(FreeSpace < SecCount) break;
            if(SecondSpaceLen < 22) {SecondSpaceLen++; FreeSpace-=SecCount;}
            if(FreeSpace < SecCount) break;
            if(ThirdSpaceLen < 60) {ThirdSpaceLen++; FreeSpace-=SecCount;}
            if(FreeSpace < SecCount) break;

            if((SynchroSpaceLen>=12)&&(FirstSpaceLen>=10)&&(SecondSpaceLen>=22)&&(ThirdSpaceLen>=60)) break;
         };
// по возможности делаем три синхроимпульса...
         if(FreeSpace > (SecCount*2)+10) { SynchroPulseLen++; FreeSpace-=SecCount; }
         if(FreeSpace > (SecCount*2)+9) SynchroPulseLen++; 

// Форматируем дорожку...

         unsigned int tptr=0;
         for(unsigned sec=0; sec < SecCount; sec++)
         {
            for(r=0; r < FirstSpaceLen; r++)        // Первый пробел
            {
               FTracksPtr[trk][side][0][tptr] = 0x4E;
               FTracksPtr[trk][side][1][tptr++] = 0x00;
            }
            for(r=0; r < SynchroSpaceLen; r++)        // Синхропромежуток
            {
               FTracksPtr[trk][side][0][tptr] = 0x00;
               FTracksPtr[trk][side][1][tptr++] = 0x00;
            }
            ptrcrc = tptr;
            for(r=0; r < SynchroPulseLen; r++)        // Синхроимпульс
            {
               FTracksPtr[trk][side][0][tptr] = 0xA1;
               FTracksPtr[trk][side][1][tptr++] = 0xFF;
            }
            FTracksPtr[trk][side][0][tptr] = 0xFE;   // Метка "Адрес"
            FTracksPtr[trk][side][1][tptr++] = 0x00;

            FTracksPtr[trk][side][0][tptr] = trackinfo->sect[sec].trk;  // cyl
            FTracksPtr[trk][side][1][tptr++] = 0x00;
            FTracksPtr[trk][side][0][tptr] = trackinfo->sect[sec].side; // head 
            FTracksPtr[trk][side][1][tptr++] = 0x00;
            FTracksPtr[trk][side][0][tptr] = trackinfo->sect[sec].sect; // secN
            FTracksPtr[trk][side][1][tptr++] = 0x00;
            FTracksPtr[trk][side][0][tptr] = trackinfo->sect[sec].size; // len code
            FTracksPtr[trk][side][1][tptr++] = 0x00;

            vgcrc = MakeVGCRC(FTracksPtr[trk][side][0]+ptrcrc, tptr-ptrcrc);
            FTracksPtr[trk][side][0][tptr] = (unsigned char)(vgcrc>>8); // VG93 CRC
            FTracksPtr[trk][side][1][tptr++] = 0x00;
            FTracksPtr[trk][side][0][tptr] = (unsigned char)(vgcrc&0xFF);
            FTracksPtr[trk][side][1][tptr++] = 0x00;

            for(r=0; r < SecondSpaceLen; r++)        // Второй пробел
            {
               FTracksPtr[trk][side][0][tptr] = 0x4E;
               FTracksPtr[trk][side][1][tptr++] = 0x00;
            }
            for(r=0; r < SynchroSpaceLen; r++)        // Синхропромежуток
            {
               FTracksPtr[trk][side][0][tptr] = 0x00;
               FTracksPtr[trk][side][1][tptr++] = 0x00;
            }


// DATA AM
            ptrcrc = tptr;
            for(r=0; r < SynchroPulseLen; r++)        // Синхроимпульс
            {
               FTracksPtr[trk][side][0][tptr] = 0xA1;
               FTracksPtr[trk][side][1][tptr++] = 0xFF;
            }
   
            FTracksPtr[trk][side][0][tptr] = 0xFB;   // Метка "Данные"
            FTracksPtr[trk][side][1][tptr++] = 0x00;


            SL = unsigned( trackinfo->sect[sec].size );
            if(!SL) SL = 128;
            else SL = 128 << SL;

            unsigned int secDATAOFF = trackinfo->sect[sec].SectPos;

            for(r=0; r < SL; r++)        // сектор SL байт
            {
               FTracksPtr[trk][side][0][tptr] = ptr[secDATAOFF+r];
               FTracksPtr[trk][side][1][tptr++] = 0x00;
            }

            vgcrc = MakeVGCRC(FTracksPtr[trk][side][0]+ptrcrc, tptr-ptrcrc);


            FTracksPtr[trk][side][0][tptr] = (unsigned char)(vgcrc>>8); // VG93 CRC
            FTracksPtr[trk][side][1][tptr++] = 0x00;
            FTracksPtr[trk][side][0][tptr] = (unsigned char)(vgcrc&0xFF);
            FTracksPtr[trk][side][1][tptr++] = 0x00;


            for(r=0; r < ThirdSpaceLen; r++)        // Третий пробел
            {
               FTracksPtr[trk][side][0][tptr] = 0x4E;
               FTracksPtr[trk][side][1][tptr++] = 0x00;
            }
         }
         for(int eoftrk=tptr; eoftrk < 6250; eoftrk++) 
         {
            FTracksPtr[trk][side][0][tptr] = 0x4E;
            FTracksPtr[trk][side][1][tptr++] = 0x00;
         }
      }

   delete ptr;
   ReadOnly = readonly;
   FType = DIT_FDD;
   DiskPresent = true;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movb %dl, %al
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
andb $0x1, %al
movb %al, -0xd(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movl -0xc(%rbp), %edi
callq 0xd6a0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jge 0x9cbf
movq -0xb8(%rbp), %rdi
leaq 0x4689(%rip), %rsi      # 0xe33e
callq 0x2c30
jmp 0xb45f
movq -0x18(%rbp), %rdi
addq $0x8000, %rdi           # imm = 0x8000
callq 0x1030
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x9cf2
movq -0xb8(%rbp), %rdi
leaq 0x4674(%rip), %rsi      # 0xe35c
callq 0x2c30
jmp 0xb45f
movl -0xc(%rbp), %edi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x11a0
movq %rax, -0x28(%rbp)
cmpq $0x1024, -0x28(%rbp)    # imm = 0x1024
jae 0x9d4a
movq -0x20(%rbp), %rax
movq %rax, -0xc0(%rbp)
cmpq $0x0, %rax
je 0x9d32
movq -0xc0(%rbp), %rdi
movl $0x1, %esi
callq 0x1130
movq -0xb8(%rbp), %rdi
leaq 0x462e(%rip), %rsi      # 0xe36e
callq 0x2c30
jmp 0xb45f
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movzbl 0x1e(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rax
movzbl 0x1f(%rax), %eax
movl %eax, -0x38(%rbp)
cmpl $0x2, -0x38(%rbp)
jle 0x9da8
movq -0x20(%rbp), %rax
movq %rax, -0xc8(%rbp)
cmpq $0x0, %rax
je 0x9d90
movq -0xc8(%rbp), %rdi
movl $0x1, %esi
callq 0x1130
movq -0xb8(%rbp), %rdi
leaq 0x46fe(%rip), %rsi      # 0xe49c
callq 0x2c30
jmp 0xb45f
movq -0xb8(%rbp), %rax
movl -0x38(%rbp), %ecx
subl $0x1, %ecx
andl $0xff, %ecx
movl %ecx, -0x38(%rbp)
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
andl $0xff, %ecx
movl %ecx, -0x34(%rbp)
movl -0x34(%rbp), %ecx
movb %cl, 0x145007(%rax)
movl -0x38(%rbp), %ecx
movb %cl, 0x145008(%rax)
movl $0x0, -0x5c(%rbp)
movq -0xb8(%rbp), %rcx
movl -0x5c(%rbp), %eax
movzbl 0x145007(%rcx), %ecx
cmpl %ecx, %eax
ja 0xb419
movl $0x0, -0x60(%rbp)
movq -0xb8(%rbp), %rcx
movl -0x60(%rbp), %eax
movzbl 0x145008(%rcx), %ecx
cmpl %ecx, %eax
ja 0xb409
movq -0xb8(%rbp), %rax
movl -0x5c(%rbp), %ecx
movl %ecx, %edx
shlq $0xa, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movl -0x60(%rbp), %edx
movl $0x186a, (%rcx,%rdx,4)  # imm = 0x186A
movl -0x5c(%rbp), %ecx
shlq $0xa, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
movl (%rax,%rcx,4), %eax
addl $0x400, %eax            # imm = 0x400
movl %eax, %eax
movl %eax, %edi
callq 0x1030
movq %rax, %rdx
movq -0xb8(%rbp), %rax
movq %rax, %rcx
addq $0x40000, %rcx          # imm = 0x40000
movl -0x5c(%rbp), %esi
shlq $0xc, %rsi
addq %rsi, %rcx
movl -0x60(%rbp), %esi
shlq $0x4, %rsi
addq %rsi, %rcx
movq %rdx, (%rcx)
movl -0x5c(%rbp), %ecx
shlq $0xa, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
movl (%rax,%rcx,4), %eax
addl $0x400, %eax            # imm = 0x400
movl %eax, %eax
movl %eax, %edi
callq 0x1030
movq %rax, %rcx
movq -0xb8(%rbp), %rax
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %edx
shlq $0xc, %rdx
addq %rdx, %rax
movl -0x60(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movl $0x0, -0x64(%rbp)
cmpl $0x186a, -0x64(%rbp)    # imm = 0x186A
jae 0x9f3d
movq -0xb8(%rbp), %rax
movq %rax, %rcx
addq $0x40000, %rcx          # imm = 0x40000
movl -0x5c(%rbp), %edx
shlq $0xc, %rdx
addq %rdx, %rcx
movl -0x60(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
movl -0x64(%rbp), %edx
movb $0x0, (%rcx,%rdx)
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0x64(%rbp), %ecx
movb $0x0, (%rax,%rcx)
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x9ed5
movq -0xb8(%rbp), %rdx
movq -0x30(%rbp), %rax
movl -0x5c(%rbp), %ecx
movzbl 0x145008(%rdx), %edx
addl $0x1, %edx
imull %edx, %ecx
addl -0x60(%rbp), %ecx
movl %ecx, %ecx
movl 0x24(%rax,%rcx,4), %eax
addl $0x2, %eax
movq -0x28(%rbp), %rcx
cmpl %ecx, %eax
jbe 0xa13b
movq -0x20(%rbp), %rax
movq %rax, -0xd0(%rbp)
cmpq $0x0, %rax
je 0x9f92
movq -0xd0(%rbp), %rdi
movl $0x1, %esi
callq 0x1130
movl $0x0, -0x68(%rbp)
cmpl $0x100, -0x68(%rbp)     # imm = 0x100
jge 0xa123
movl $0x0, -0x6c(%rbp)
cmpl $0x100, -0x6c(%rbp)     # imm = 0x100
jge 0xa113
movq -0xb8(%rbp), %rax
movslq -0x68(%rbp), %rdx
shlq $0xa, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movslq -0x6c(%rbp), %rdx
movl $0x0, (%rcx,%rdx,4)
addq $0x40000, %rax          # imm = 0x40000
movslq -0x68(%rbp), %rcx
shlq $0xc, %rcx
addq %rcx, %rax
movslq -0x6c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
je 0xa042
movq -0xb8(%rbp), %rax
addq $0x40000, %rax          # imm = 0x40000
movslq -0x68(%rbp), %rcx
shlq $0xc, %rcx
addq %rcx, %rax
movslq -0x6c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0xd8(%rbp)
cmpq $0x0, %rax
je 0xa040
movq -0xd8(%rbp), %rdi
movl $0x1, %esi
callq 0x1130
jmp 0xa042
movq -0xb8(%rbp), %rax
movq %rax, %rcx
addq $0x40000, %rcx          # imm = 0x40000
movslq -0x68(%rbp), %rdx
shlq $0xc, %rdx
addq %rdx, %rcx
movslq -0x6c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq $0x0, (%rcx)
addq $0x40000, %rax          # imm = 0x40000
movslq -0x68(%rbp), %rcx
shlq $0xc, %rcx
addq %rcx, %rax
movslq -0x6c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
je 0xa0da
movq -0xb8(%rbp), %rax
addq $0x40000, %rax          # imm = 0x40000
movslq -0x68(%rbp), %rcx
shlq $0xc, %rcx
addq %rcx, %rax
movslq -0x6c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0xe0(%rbp)
cmpq $0x0, %rax
je 0xa0d8
movq -0xe0(%rbp), %rdi
movl $0x1, %esi
callq 0x1130
jmp 0xa0da
movq -0xb8(%rbp), %rax
addq $0x40000, %rax          # imm = 0x40000
movslq -0x68(%rbp), %rcx
shlq $0xc, %rcx
addq %rcx, %rax
movslq -0x6c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq $0x0, 0x8(%rax)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x9fad
jmp 0xa115
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x9f99
movq -0xb8(%rbp), %rdi
leaq 0x423d(%rip), %rsi      # 0xe36e
callq 0x2c30
jmp 0xb45f
movq -0xb8(%rbp), %rsi
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movl -0x5c(%rbp), %edx
movzbl 0x145008(%rsi), %edi
addl $0x1, %edi
imull %edi, %edx
addl -0x60(%rbp), %edx
movl %edx, %edx
movl 0x24(%rcx,%rdx,4), %ecx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movzbl 0x1(%rax), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
shll $0x3, %eax
addl $0x2, %eax
movq -0x30(%rbp), %rcx
movl -0x5c(%rbp), %edx
movzbl 0x145008(%rsi), %esi
addl $0x1, %esi
imull %esi, %edx
addl -0x60(%rbp), %edx
movl %edx, %edx
addl 0x24(%rcx,%rdx,4), %eax
movl %eax, %eax
cmpq -0x28(%rbp), %rax
jbe 0xa372
movq -0x20(%rbp), %rax
movq %rax, -0xe8(%rbp)
cmpq $0x0, %rax
je 0xa1c9
movq -0xe8(%rbp), %rdi
movl $0x1, %esi
callq 0x1130
movl $0x0, -0x70(%rbp)
cmpl $0x100, -0x70(%rbp)     # imm = 0x100
jge 0xa35a
movl $0x0, -0x74(%rbp)
cmpl $0x100, -0x74(%rbp)     # imm = 0x100
jge 0xa34a
movq -0xb8(%rbp), %rax
movslq -0x70(%rbp), %rdx
shlq $0xa, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movslq -0x74(%rbp), %rdx
movl $0x0, (%rcx,%rdx,4)
addq $0x40000, %rax          # imm = 0x40000
movslq -0x70(%rbp), %rcx
shlq $0xc, %rcx
addq %rcx, %rax
movslq -0x74(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
je 0xa279
movq -0xb8(%rbp), %rax
addq $0x40000, %rax          # imm = 0x40000
movslq -0x70(%rbp), %rcx
shlq $0xc, %rcx
addq %rcx, %rax
movslq -0x74(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0xf0(%rbp)
cmpq $0x0, %rax
je 0xa277
movq -0xf0(%rbp), %rdi
movl $0x1, %esi
callq 0x1130
jmp 0xa279
movq -0xb8(%rbp), %rax
movq %rax, %rcx
addq $0x40000, %rcx          # imm = 0x40000
movslq -0x70(%rbp), %rdx
shlq $0xc, %rdx
addq %rdx, %rcx
movslq -0x74(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq $0x0, (%rcx)
addq $0x40000, %rax          # imm = 0x40000
movslq -0x70(%rbp), %rcx
shlq $0xc, %rcx
addq %rcx, %rax
movslq -0x74(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
je 0xa311
movq -0xb8(%rbp), %rax
addq $0x40000, %rax          # imm = 0x40000
movslq -0x70(%rbp), %rcx
shlq $0xc, %rcx
addq %rcx, %rax
movslq -0x74(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0xf8(%rbp)
cmpq $0x0, %rax
je 0xa30f
movq -0xf8(%rbp), %rdi
movl $0x1, %esi
callq 0x1130
jmp 0xa311
movq -0xb8(%rbp), %rax
addq $0x40000, %rax          # imm = 0x40000
movslq -0x70(%rbp), %rcx
shlq $0xc, %rcx
addq %rcx, %rax
movslq -0x74(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq $0x0, 0x8(%rax)
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0xa1e4
jmp 0xa34c
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0xa1d0
movq -0xb8(%rbp), %rdi
leaq 0x4006(%rip), %rsi      # 0xe36e
callq 0x2c30
jmp 0xb45f
movq -0x58(%rbp), %rax
movl -0x4c(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movl 0x6(%rax,%rcx,8), %eax
movq -0x28(%rbp), %rcx
cmpl %ecx, %eax
jbe 0xa559
movq -0x20(%rbp), %rax
movq %rax, -0x100(%rbp)
cmpq $0x0, %rax
je 0xa3b0
movq -0x100(%rbp), %rdi
movl $0x1, %esi
callq 0x1130
movl $0x0, -0x78(%rbp)
cmpl $0x100, -0x78(%rbp)     # imm = 0x100
jge 0xa541
movl $0x0, -0x7c(%rbp)
cmpl $0x100, -0x7c(%rbp)     # imm = 0x100
jge 0xa531
movq -0xb8(%rbp), %rax
movslq -0x78(%rbp), %rdx
shlq $0xa, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movslq -0x7c(%rbp), %rdx
movl $0x0, (%rcx,%rdx,4)
addq $0x40000, %rax          # imm = 0x40000
movslq -0x78(%rbp), %rcx
shlq $0xc, %rcx
addq %rcx, %rax
movslq -0x7c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
je 0xa460
movq -0xb8(%rbp), %rax
addq $0x40000, %rax          # imm = 0x40000
movslq -0x78(%rbp), %rcx
shlq $0xc, %rcx
addq %rcx, %rax
movslq -0x7c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x108(%rbp)
cmpq $0x0, %rax
je 0xa45e
movq -0x108(%rbp), %rdi
movl $0x1, %esi
callq 0x1130
jmp 0xa460
movq -0xb8(%rbp), %rax
movq %rax, %rcx
addq $0x40000, %rcx          # imm = 0x40000
movslq -0x78(%rbp), %rdx
shlq $0xc, %rdx
addq %rdx, %rcx
movslq -0x7c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq $0x0, (%rcx)
addq $0x40000, %rax          # imm = 0x40000
movslq -0x78(%rbp), %rcx
shlq $0xc, %rcx
addq %rcx, %rax
movslq -0x7c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
je 0xa4f8
movq -0xb8(%rbp), %rax
addq $0x40000, %rax          # imm = 0x40000
movslq -0x78(%rbp), %rcx
shlq $0xc, %rcx
addq %rcx, %rax
movslq -0x7c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x110(%rbp)
cmpq $0x0, %rax
je 0xa4f6
movq -0x110(%rbp), %rdi
movl $0x1, %esi
callq 0x1130
jmp 0xa4f8
movq -0xb8(%rbp), %rax
addq $0x40000, %rax          # imm = 0x40000
movslq -0x78(%rbp), %rcx
shlq $0xc, %rcx
addq %rcx, %rax
movslq -0x7c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq $0x0, 0x8(%rax)
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0xa3cb
jmp 0xa533
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0xa3b7
movq -0xb8(%rbp), %rdi
leaq 0x3e1f(%rip), %rsi      # 0xe36e
callq 0x2c30
jmp 0xb45f
jmp 0xa55b
movl $0x0, -0x48(%rbp)
movl $0x0, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jae 0xa5c2
movl -0x48(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x48(%rbp)
movq -0x58(%rbp), %rax
movl -0x80(%rbp), %ecx
movzbl 0x5(%rax,%rcx,8), %eax
movl %eax, -0x50(%rbp)
cmpl $0x0, -0x50(%rbp)
jne 0xa598
movl $0x80, -0x50(%rbp)
jmp 0xa5a5
movl -0x50(%rbp), %ecx
movl $0x80, %eax
shll %cl, %eax
movl %eax, -0x50(%rbp)
movl -0x48(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x48(%rbp)
movl -0x50(%rbp), %eax
addl -0x48(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0xa569
movl -0x48(%rbp), %eax
imull $0x5, -0x4c(%rbp), %ecx
addl %ecx, %eax
cmpl $0x186a, %eax           # imm = 0x186A
jbe 0xa7e3
movq -0x20(%rbp), %rax
movq %rax, -0x118(%rbp)
cmpq $0x0, %rax
je 0xa5f8
movq -0x118(%rbp), %rdi
movl $0x1, %esi
callq 0x1130
movl $0x0, -0x84(%rbp)
cmpl $0x100, -0x84(%rbp)     # imm = 0x100
jge 0xa7cb
movl $0x0, -0x88(%rbp)
cmpl $0x100, -0x88(%rbp)     # imm = 0x100
jge 0xa7b5
movq -0xb8(%rbp), %rax
movslq -0x84(%rbp), %rdx
shlq $0xa, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movslq -0x88(%rbp), %rdx
movl $0x0, (%rcx,%rdx,4)
addq $0x40000, %rax          # imm = 0x40000
movslq -0x84(%rbp), %rcx
shlq $0xc, %rcx
addq %rcx, %rax
movslq -0x88(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
je 0xa6c6
movq -0xb8(%rbp), %rax
addq $0x40000, %rax          # imm = 0x40000
movslq -0x84(%rbp), %rcx
shlq $0xc, %rcx
addq %rcx, %rax
movslq -0x88(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x120(%rbp)
cmpq $0x0, %rax
je 0xa6c4
movq -0x120(%rbp), %rdi
movl $0x1, %esi
callq 0x1130
jmp 0xa6c6
movq -0xb8(%rbp), %rax
movq %rax, %rcx
addq $0x40000, %rcx          # imm = 0x40000
movslq -0x84(%rbp), %rdx
shlq $0xc, %rdx
addq %rdx, %rcx
movslq -0x88(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq $0x0, (%rcx)
addq $0x40000, %rax          # imm = 0x40000
movslq -0x84(%rbp), %rcx
shlq $0xc, %rcx
addq %rcx, %rax
movslq -0x88(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
je 0xa770
movq -0xb8(%rbp), %rax
addq $0x40000, %rax          # imm = 0x40000
movslq -0x84(%rbp), %rcx
shlq $0xc, %rcx
addq %rcx, %rax
movslq -0x88(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x128(%rbp)
cmpq $0x0, %rax
je 0xa76e
movq -0x128(%rbp), %rdi
movl $0x1, %esi
callq 0x1130
jmp 0xa770
movq -0xb8(%rbp), %rax
addq $0x40000, %rax          # imm = 0x40000
movslq -0x84(%rbp), %rcx
shlq $0xc, %rcx
addq %rcx, %rax
movslq -0x88(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq $0x0, 0x8(%rax)
movl -0x88(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x88(%rbp)
jmp 0xa61c
jmp 0xa7b7
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0xa602
movq -0xb8(%rbp), %rdi
leaq 0x3cf4(%rip), %rsi      # 0xe4cd
callq 0x2c30
jmp 0xb45f
movl -0x48(%rbp), %ecx
imull $0x5, -0x4c(%rbp), %eax
addl %eax, %ecx
movl $0x186a, %eax           # imm = 0x186A
subl %ecx, %eax
movl %eax, -0x8c(%rbp)
movl $0x1, -0x90(%rbp)
movl $0x1, -0x94(%rbp)
movl $0x1, -0x98(%rbp)
movl $0x1, -0x9c(%rbp)
movl $0x1, -0xa0(%rbp)
movl -0x94(%rbp), %ecx
addl -0x98(%rbp), %ecx
addl -0x9c(%rbp), %ecx
addl -0xa0(%rbp), %ecx
movl -0x8c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x8c(%rbp)
cmpl $0x0, -0x8c(%rbp)
jbe 0xa97a
movl -0x8c(%rbp), %eax
movl -0x4c(%rbp), %ecx
shll %ecx
cmpl %ecx, %eax
jb 0xa89a
cmpl $0xc, -0xa0(%rbp)
jae 0xa898
movl -0xa0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa0(%rbp)
movl -0x4c(%rbp), %ecx
shll %ecx
movl -0x8c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x8c(%rbp)
jmp 0xa89a
movl -0x8c(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jae 0xa8aa
jmp 0xa97a
cmpl $0xa, -0x94(%rbp)
jae 0xa8d3
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
movl -0x4c(%rbp), %ecx
movl -0x8c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jae 0xa8e3
jmp 0xa97a
cmpl $0x16, -0x98(%rbp)
jae 0xa90c
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
movl -0x4c(%rbp), %ecx
movl -0x8c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jae 0xa919
jmp 0xa97a
cmpl $0x3c, -0x9c(%rbp)
jae 0xa942
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
movl -0x4c(%rbp), %ecx
movl -0x8c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jae 0xa94f
jmp 0xa97a
cmpl $0xc, -0xa0(%rbp)
jb 0xa975
cmpl $0xa, -0x94(%rbp)
jb 0xa975
cmpl $0x16, -0x98(%rbp)
jb 0xa975
cmpl $0x3c, -0x9c(%rbp)
jb 0xa975
jmp 0xa97a
jmp 0xa851
movl -0x8c(%rbp), %eax
movl -0x4c(%rbp), %ecx
shll %ecx
addl $0xa, %ecx
cmpl %ecx, %eax
jbe 0xa9ac
movl -0x90(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x90(%rbp)
movl -0x4c(%rbp), %ecx
movl -0x8c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
movl -0x4c(%rbp), %ecx
shll %ecx
addl $0x9, %ecx
cmpl %ecx, %eax
jbe 0xa9cd
movl -0x90(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x90(%rbp)
movl $0x0, -0xa4(%rbp)
movl $0x0, -0xa8(%rbp)
movl -0xa8(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jae 0xb366
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x94(%rbp), %eax
jae 0xaa74
movq -0xb8(%rbp), %rax
movq %rax, %rcx
addq $0x40000, %rcx          # imm = 0x40000
movl -0x5c(%rbp), %edx
shlq $0xc, %rdx
addq %rdx, %rcx
movl -0x60(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
movl -0xa4(%rbp), %edx
movb $0x4e, (%rcx,%rdx)
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0xa4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xa4(%rbp)
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xa9f7
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0xa0(%rbp), %eax
jae 0xaaf8
movq -0xb8(%rbp), %rax
movq %rax, %rcx
addq $0x40000, %rcx          # imm = 0x40000
movl -0x5c(%rbp), %edx
shlq $0xc, %rdx
addq %rdx, %rcx
movl -0x60(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
movl -0xa4(%rbp), %edx
movb $0x0, (%rcx,%rdx)
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0xa4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xa4(%rbp)
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xaa7b
movl -0xa4(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x90(%rbp), %eax
jae 0xab85
movq -0xb8(%rbp), %rax
movq %rax, %rcx
addq $0x40000, %rcx          # imm = 0x40000
movl -0x5c(%rbp), %edx
shlq $0xc, %rdx
addq %rdx, %rcx
movl -0x60(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
movl -0xa4(%rbp), %edx
movb $-0x5f, (%rcx,%rdx)
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0xa4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xa4(%rbp)
movl %ecx, %ecx
movb $-0x1, (%rax,%rcx)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xab08
movq -0xb8(%rbp), %rdi
movq %rdi, %rax
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl -0xa4(%rbp), %ecx
movb $-0x2, (%rax,%rcx)
movq %rdi, %rax
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0xa4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xa4(%rbp)
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movq -0x58(%rbp), %rax
movl -0xa8(%rbp), %ecx
movb 0x2(%rax,%rcx,8), %dl
movq %rdi, %rax
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl -0xa4(%rbp), %ecx
movb %dl, (%rax,%rcx)
movq %rdi, %rax
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0xa4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xa4(%rbp)
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movq -0x58(%rbp), %rax
movl -0xa8(%rbp), %ecx
movb 0x3(%rax,%rcx,8), %dl
movq %rdi, %rax
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl -0xa4(%rbp), %ecx
movb %dl, (%rax,%rcx)
movq %rdi, %rax
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0xa4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xa4(%rbp)
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movq -0x58(%rbp), %rax
movl -0xa8(%rbp), %ecx
movb 0x4(%rax,%rcx,8), %dl
movq %rdi, %rax
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl -0xa4(%rbp), %ecx
movb %dl, (%rax,%rcx)
movq %rdi, %rax
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0xa4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xa4(%rbp)
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movq -0x58(%rbp), %rax
movl -0xa8(%rbp), %ecx
movb 0x5(%rax,%rcx,8), %dl
movq %rdi, %rax
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl -0xa4(%rbp), %ecx
movb %dl, (%rax,%rcx)
movq %rdi, %rax
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0xa4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xa4(%rbp)
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movq %rdi, %rax
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rsi
movl -0x3c(%rbp), %eax
addq %rax, %rsi
movl -0xa4(%rbp), %eax
subl -0x3c(%rbp), %eax
movl %eax, %eax
movl %eax, %edx
callq 0x1fa0
movw %ax, %cx
movq -0xb8(%rbp), %rax
movw %cx, -0x42(%rbp)
movzwl -0x42(%rbp), %ecx
sarl $0x8, %ecx
movb %cl, %sil
movq %rax, %rcx
addq $0x40000, %rcx          # imm = 0x40000
movl -0x5c(%rbp), %edx
shlq $0xc, %rdx
addq %rdx, %rcx
movl -0x60(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
movl -0xa4(%rbp), %edx
movb %sil, (%rcx,%rdx)
movq %rax, %rcx
addq $0x40000, %rcx          # imm = 0x40000
movl -0x5c(%rbp), %edx
shlq $0xc, %rdx
addq %rdx, %rcx
movl -0x60(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
movl -0xa4(%rbp), %edx
movl %edx, %esi
addl $0x1, %esi
movl %esi, -0xa4(%rbp)
movl %edx, %edx
movb $0x0, (%rcx,%rdx)
movzwl -0x42(%rbp), %ecx
andl $0xff, %ecx
movb %cl, %sil
movq %rax, %rcx
addq $0x40000, %rcx          # imm = 0x40000
movl -0x5c(%rbp), %edx
shlq $0xc, %rdx
addq %rdx, %rcx
movl -0x60(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
movl -0xa4(%rbp), %edx
movb %sil, (%rcx,%rdx)
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0xa4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xa4(%rbp)
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x98(%rbp), %eax
jae 0xaf4f
movq -0xb8(%rbp), %rax
movq %rax, %rcx
addq $0x40000, %rcx          # imm = 0x40000
movl -0x5c(%rbp), %edx
shlq $0xc, %rdx
addq %rdx, %rcx
movl -0x60(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
movl -0xa4(%rbp), %edx
movb $0x4e, (%rcx,%rdx)
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0xa4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xa4(%rbp)
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xaed2
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0xa0(%rbp), %eax
jae 0xafd3
movq -0xb8(%rbp), %rax
movq %rax, %rcx
addq $0x40000, %rcx          # imm = 0x40000
movl -0x5c(%rbp), %edx
shlq $0xc, %rdx
addq %rdx, %rcx
movl -0x60(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
movl -0xa4(%rbp), %edx
movb $0x0, (%rcx,%rdx)
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0xa4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xa4(%rbp)
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xaf56
movl -0xa4(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x90(%rbp), %eax
jae 0xb060
movq -0xb8(%rbp), %rax
movq %rax, %rcx
addq $0x40000, %rcx          # imm = 0x40000
movl -0x5c(%rbp), %edx
shlq $0xc, %rdx
addq %rdx, %rcx
movl -0x60(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
movl -0xa4(%rbp), %edx
movb $-0x5f, (%rcx,%rdx)
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0xa4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xa4(%rbp)
movl %ecx, %ecx
movb $-0x1, (%rax,%rcx)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xafe3
movq -0xb8(%rbp), %rax
movq %rax, %rcx
addq $0x40000, %rcx          # imm = 0x40000
movl -0x5c(%rbp), %edx
shlq $0xc, %rdx
addq %rdx, %rcx
movl -0x60(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
movl -0xa4(%rbp), %edx
movb $-0x5, (%rcx,%rdx)
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0xa4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xa4(%rbp)
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movq -0x58(%rbp), %rax
movl -0xa8(%rbp), %ecx
movzbl 0x5(%rax,%rcx,8), %eax
movl %eax, -0x50(%rbp)
cmpl $0x0, -0x50(%rbp)
jne 0xb0e8
movl $0x80, -0x50(%rbp)
jmp 0xb0f5
movl -0x50(%rbp), %ecx
movl $0x80, %eax
shll %cl, %eax
movl %eax, -0x50(%rbp)
movq -0x58(%rbp), %rax
movl -0xa8(%rbp), %ecx
movl 0x6(%rax,%rcx,8), %eax
movl %eax, -0xac(%rbp)
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x50(%rbp), %eax
jae 0xb1a4
movq -0xb8(%rbp), %rax
movq -0x20(%rbp), %rcx
movl -0xac(%rbp), %edx
addl -0x40(%rbp), %edx
movl %edx, %edx
movb (%rcx,%rdx), %sil
movq %rax, %rcx
addq $0x40000, %rcx          # imm = 0x40000
movl -0x5c(%rbp), %edx
shlq $0xc, %rdx
addq %rdx, %rcx
movl -0x60(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
movl -0xa4(%rbp), %edx
movb %sil, (%rcx,%rdx)
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0xa4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xa4(%rbp)
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xb110
movq -0xb8(%rbp), %rdi
movq %rdi, %rax
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rsi
movl -0x3c(%rbp), %eax
addq %rax, %rsi
movl -0xa4(%rbp), %eax
subl -0x3c(%rbp), %eax
movl %eax, %eax
movl %eax, %edx
callq 0x1fa0
movw %ax, %cx
movq -0xb8(%rbp), %rax
movw %cx, -0x42(%rbp)
movzwl -0x42(%rbp), %ecx
sarl $0x8, %ecx
movb %cl, %sil
movq %rax, %rcx
addq $0x40000, %rcx          # imm = 0x40000
movl -0x5c(%rbp), %edx
shlq $0xc, %rdx
addq %rdx, %rcx
movl -0x60(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
movl -0xa4(%rbp), %edx
movb %sil, (%rcx,%rdx)
movq %rax, %rcx
addq $0x40000, %rcx          # imm = 0x40000
movl -0x5c(%rbp), %edx
shlq $0xc, %rdx
addq %rdx, %rcx
movl -0x60(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
movl -0xa4(%rbp), %edx
movl %edx, %esi
addl $0x1, %esi
movl %esi, -0xa4(%rbp)
movl %edx, %edx
movb $0x0, (%rcx,%rdx)
movzwl -0x42(%rbp), %ecx
andl $0xff, %ecx
movb %cl, %sil
movq %rax, %rcx
addq $0x40000, %rcx          # imm = 0x40000
movl -0x5c(%rbp), %edx
shlq $0xc, %rdx
addq %rdx, %rcx
movl -0x60(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
movl -0xa4(%rbp), %edx
movb %sil, (%rcx,%rdx)
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0xa4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xa4(%rbp)
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x9c(%rbp), %eax
jae 0xb350
movq -0xb8(%rbp), %rax
movq %rax, %rcx
addq $0x40000, %rcx          # imm = 0x40000
movl -0x5c(%rbp), %edx
shlq $0xc, %rdx
addq %rdx, %rcx
movl -0x60(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
movl -0xa4(%rbp), %edx
movb $0x4e, (%rcx,%rdx)
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0xa4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xa4(%rbp)
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xb2d3
jmp 0xb352
movl -0xa8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa8(%rbp)
jmp 0xa9e1
movl -0xa4(%rbp), %eax
movl %eax, -0xb0(%rbp)
cmpl $0x186a, -0xb0(%rbp)    # imm = 0x186A
jge 0xb3f9
movq -0xb8(%rbp), %rax
movq %rax, %rcx
addq $0x40000, %rcx          # imm = 0x40000
movl -0x5c(%rbp), %edx
shlq $0xc, %rdx
addq %rdx, %rcx
movl -0x60(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
movl -0xa4(%rbp), %edx
movb $0x4e, (%rcx,%rdx)
addq $0x40000, %rax          # imm = 0x40000
movl -0x5c(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0xa4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xa4(%rbp)
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movl -0xb0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb0(%rbp)
jmp 0xb372
jmp 0xb3fb
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x9e06
jmp 0xb40b
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x9de6
movq -0x20(%rbp), %rax
movq %rax, -0x130(%rbp)
cmpq $0x0, %rax
je 0xb43b
movq -0x130(%rbp), %rdi
movl $0x1, %esi
callq 0x1130
movq -0xb8(%rbp), %rax
movb -0xd(%rbp), %cl
andb $0x1, %cl
movb %cl, 0x145005(%rax)
movl $0x7, 0x141000(%rax)
movb $0x1, 0x145006(%rax)
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nopl (%rax,%rax)