// File: /workspace/github_c_makefile_star2_O0/GregorR[P]lstg/source/lst_primitives.c
// Function: primitive
struct object  *primitive(int primitiveNumber, struct object *args,
                          int *failed)
{
  struct object  *returnedValue = nilObject;
  int             i,
                  j;
  FILE           *fp;
  unsigned char  *p;
  struct byteObject *stringReturn;
  char            nameBuffer[80],
                  modeBuffer[80];

  *failed = 0;
  switch (primitiveNumber)
  {
    case 100:                  /* open a file */
      lstGetString(nameBuffer, 80, args->data[0]);
      lstGetString(modeBuffer, 10, args->data[1]);
      fp = fopen(nameBuffer, modeBuffer);
      if(fp != NULL)
      {
        for(i = 0; i < LST_FILEMAX; ++i)
        {
          if(filePointers[i] == NULL)
          {
            break;
          }
        }
        if(i >= LST_FILEMAX)
        {
          sysError("too many open files", 0);
          fclose(fp);
          *failed = 1;
        }
        else
        {
          returnedValue = newInteger(i);
          filePointers[i] = fp;
        }
      }
      else
      {
        *failed = 1;
      }
      break;

    case 101:                  /* read a single character from a file */
      i = integerValue(args->data[0]);
      if((i < 0) || (i >= LST_FILEMAX) || !(fp = filePointers[i]))
      {
        *failed = 1;
        break;
      }
      i = fgetc(fp);
      if(i != EOF)
      {
        returnedValue = newInteger(i);
      }
      break;

    case 102:                  /* write a single character to a file */
      i = integerValue(args->data[0]);
      if((i < 0) || (i >= LST_FILEMAX) || !(fp = filePointers[i]))
      {
        *failed = 1;
        break;
      }
      fputc(integerValue(args->data[1]), fp);
      break;

    case 103:                  /* close file */
      i = integerValue(args->data[0]);
      if((i < 0) || (i >= LST_FILEMAX) || !(fp = filePointers[i]))
      {
        *failed = 1;
        break;
      }
      fclose(fp);
      filePointers[i] = NULL;
      break;

    case 104:                  /* file out image */
      i = integerValue(args->data[0]);
      if((i < 0) || (i >= LST_FILEMAX) || !(fp = filePointers[i]))
      {
        *failed = 1;
        break;
      }
      fileOut(fp);
      break;

    case 105:                  /* edit a string */
      {
        struct stat buf;
        /*
        first get the name of a temp file 
        */
        sprintf(nameBuffer, "%s/lsteditXXXXXX", lstTmpDir);
        mkstemp(nameBuffer);
        /*
        copy string to file.
        write the string in text mode - so even notepad can visualize it without problems.
        */
        fp = fopen(nameBuffer, "w");
        if(fp == NULL)
          sysError("cannot open temp edit file", 0);
        j = SIZE(args->data[0]);
        p = ((struct byteObject *) args->data[0])->bytes;
        for(i = 0; i < j; i++)
          fputc(*p++, fp);
        fputc('\n', fp);
        fclose(fp);
        /*
        edit string 
        */
        strcpy(modeBuffer, defaultEditor);
        strcat(modeBuffer, nameBuffer);
        system(modeBuffer);
        /*
        copy back to new string.
        read the file in binary mode - otherwise we would try to read too many bytes on Windows...
        */
        /*
          get length of file 
        */
        stat(nameBuffer, &buf);
        j = buf.st_size;
        stringReturn = (struct byteObject *)gcialloc(j);
        returnedValue = (struct object *) stringReturn;
        returnedValue->class = args->data[0]->class;

        fp = fopen(nameBuffer, "rb");
        if(fp == NULL)
          sysError("cannot open temp edit file", 0);
        /*
        reset to beginning, and read values 
        */
        for(i = 0; i < j; i++)
          stringReturn->bytes[i] = (unsigned char)fgetc(fp);
        /*
        now clean up files 
        */
        fclose(fp);
        unlink(nameBuffer);
      }
      break;

    case 106:                  /* Read into ByteArray */
      /*
         File descriptor 
       */
      i = integerValue(args->data[0]);
      if((i < 0) || (i >= LST_FILEMAX) || !(fp = filePointers[i]))
      {
        *failed = 1;
        break;
      }

      /*
         Make sure we're populating an array of bytes 
       */
      returnedValue = args->data[1];
      if((returnedValue->size & FLAG_BIN) == 0)
      {
        *failed = 1;
        break;
      }

      /*
         Sanity check on I/O count 
       */
      i = integerValue(args->data[2]);
      if((LstUInt)i > SIZE(returnedValue))
      {
        *failed = 1;
        break;
      }

      /*
         Do the I/O 
       */
      i = fread(bytePtr(returnedValue), sizeof(char), i, fp);
      if(i < 0)
      {
        *failed = 1;
        break;
      }
      returnedValue = newInteger(i);
      break;

    case 107:                  /* Write from ByteArray */
      /*
         File descriptor 
       */
      i = integerValue(args->data[0]);
      if((i < 0) || (i >= LST_FILEMAX) || !(fp = filePointers[i]))
      {
        *failed = 1;
        break;
      }

      /*
         Make sure we're writing an array of bytes 
       */
      returnedValue = args->data[1];
      if((returnedValue->size & FLAG_BIN) == 0)
      {
        *failed = 1;
        break;
      }

      /*
         Sanity check on I/O count 
       */
      i = integerValue(args->data[2]);
      if((LstUInt)i > SIZE(returnedValue))
      {
        *failed = 1;
        break;
      }

      /*
         Do the I/O 
       */
      i = fwrite(bytePtr(returnedValue), sizeof(char), i, fp);
      if(i < 0)
      {
        *failed = 1;
        break;
      }
      returnedValue = newInteger(i);
      break;

    case 108:                  /* Seek to file position */
      /*
         File descriptor 
       */
      i = integerValue(args->data[0]);
      if((i < 0) || (i >= LST_FILEMAX) || !(fp = filePointers[i]))
      {
        *failed = 1;
        break;
      }

      /*
         File position 
       */
      i = integerValue(args->data[1]);
      if((i < 0) || ((i = fseek(fp, i, SEEK_SET)) < 0))
      {
        *failed = 1;
        break;
      }

      /*
         Return position as our value 
       */
      returnedValue = newInteger(i);
      break;

    case 109:  /* Return the name of the current operating system */
        returnedValue = lstNewString(lstOsName);
      break;

    case 110: /* Sleep */
      Sleep(integerValue(args->data[0]));
      break;

    case 111: /* argc */
      returnedValue = newInteger(lstArgc);
      break;

    case 112: /* argv[i] */
      returnedValue = lstNewString(lstArgv[integerValue(args->data[0])]);
      break;

    case 113: /* next arg */
      if (lstArgi + 1 >= lstArgc)
      {
        /* We already passed all the arguments! */
        returnedValue = nilObject;
      } else {
        returnedValue = lstNewString(lstArgv[++lstArgi]);
      }
      break;

    case 114: /* System version */
      returnedValue = lstNewString(LITTLE_SMALLTALK_VERSION);
      break;

    case 115: /* Debugging? */
      returnedValue = lstDebugging ? trueObject : falseObject;
      break;

    case 116: /* read entire file */
    {
      char *buf;
      size_t sz;
      ssize_t used, rd;
      i = integerValue(args->data[0]);
      if((i < 0) || (i >= LST_FILEMAX) || !(fp = filePointers[i]))
      {
        *failed = 1;
        break;
      }
      buf = malloc(4096);
      if (!buf)
      {
        perror("malloc");
        exit(1);
      }
      sz = 4096;
      used = 0;
      while ((rd = fread(buf + used, 1, sz - used, fp)) > 0)
      {
        used += rd;
        if (used >= sz - 1)
        {
          sz *= 2;
          buf = realloc(buf, sz);
          if (!buf)
          {
            perror("realloc");
            exit(1);
          }
        }
      }
      if (used == 0)
      {
        returnedValue = nilObject;
      } else {
        buf[used] = 0;
        returnedValue = lstNewString(buf);
      }
      free(buf);
      break;
    }

#if defined(LST_USE_FFI)
      /* FFI (Foreign Function Interface) primitives */
    case 230:
    case 231:
    case 232:
    case 233:
    case 234:
    case 235:
    case 236:
    case 237:
    case 238:
    case 239:
    case 240:   /* getInt */
    case 241:   /* setInt */
        returnedValue = lstFfiPrimitive(primitiveNumber, args);
        break;
#endif

#if defined(LST_USE_SOCKET)
    case 250: /* Socket */
        returnedValue = lstSocketPrimitive(primitiveNumber, args, failed);
        break;
    case 251: /* Inet */
        returnedValue = lstInetPrimitive(primitiveNumber, args, failed);
        break;
#endif

    default:
	    sysError("unknown primitive", (void *)(INT_PTR)primitiveNumber);
  }
  return (returnedValue);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq 0x414cb(%rip), %rax     # 0x48938
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movl -0x4(%rbp), %eax
addl $-0x64, %eax
movl %eax, %ecx
movq %rcx, -0x198(%rbp)
subl $0x10, %eax
ja 0x7d96
movq -0x198(%rbp), %rax
leaq 0x306c(%rip), %rcx      # 0xa510
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x90(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
movl $0x50, %esi
callq 0x7280
leaq -0xe0(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdx
movl $0xa, %esi
callq 0x7280
leaq -0x90(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x22b0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x757a
movl $0x0, -0x24(%rbp)
cmpl $0x14, -0x24(%rbp)
jge 0x752b
movslq -0x24(%rbp), %rcx
leaq 0x4268b(%rip), %rax     # 0x49ba0
cmpq $0x0, (%rax,%rcx,8)
jne 0x751e
jmp 0x752b
jmp 0x7520
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x7504
cmpl $0x14, -0x24(%rbp)
jl 0x7556
leaq 0x301c(%rip), %rdi      # 0xa554
xorl %eax, %eax
movl %eax, %esi
callq 0x56d0
movq -0x30(%rbp), %rdi
callq 0x20e0
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
jmp 0x7578
movslq -0x24(%rbp), %rax
shlq %rax
orq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x30(%rbp), %rdx
movslq -0x24(%rbp), %rcx
leaq 0x4262c(%rip), %rax     # 0x49ba0
movq %rdx, (%rax,%rcx,8)
jmp 0x7584
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
jmp 0x7da6
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
sarq %rax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jl 0x75bc
cmpl $0x14, -0x24(%rbp)
jge 0x75bc
movslq -0x24(%rbp), %rcx
leaq 0x425f2(%rip), %rax     # 0x49ba0
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x75cb
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
jmp 0x7da6
movq -0x30(%rbp), %rdi
callq 0x2170
movl %eax, -0x24(%rbp)
cmpl $-0x1, -0x24(%rbp)
je 0x75ec
movslq -0x24(%rbp), %rax
shlq %rax
orq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x7da6
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
sarq %rax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jl 0x7624
cmpl $0x14, -0x24(%rbp)
jge 0x7624
movslq -0x24(%rbp), %rcx
leaq 0x4258a(%rip), %rax     # 0x49ba0
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x7633
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
jmp 0x7da6
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
sarq %rax
movl %eax, %edi
movq -0x30(%rbp), %rsi
callq 0x2190
jmp 0x7da6
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
sarq %rax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jl 0x7681
cmpl $0x14, -0x24(%rbp)
jge 0x7681
movslq -0x24(%rbp), %rcx
leaq 0x4252d(%rip), %rax     # 0x49ba0
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x7690
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
jmp 0x7da6
movq -0x30(%rbp), %rdi
callq 0x20e0
movslq -0x24(%rbp), %rcx
leaq 0x424fc(%rip), %rax     # 0x49ba0
movq $0x0, (%rax,%rcx,8)
jmp 0x7da6
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
sarq %rax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jl 0x76e4
cmpl $0x14, -0x24(%rbp)
jge 0x76e4
movslq -0x24(%rbp), %rcx
leaq 0x424ca(%rip), %rax     # 0x49ba0
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x76f3
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
jmp 0x7da6
movq -0x30(%rbp), %rdi
callq 0x6b40
jmp 0x7da6
leaq -0x90(%rbp), %rdi
leaq 0x3d021(%rip), %rax     # 0x44730
movq (%rax), %rdx
leaq 0x2e4f(%rip), %rsi      # 0xa568
movb $0x0, %al
callq 0x2320
leaq -0x90(%rbp), %rdi
callq 0x2260
leaq -0x90(%rbp), %rdi
leaq 0x2e3f(%rip), %rsi      # 0xa579
callq 0x22b0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x775a
leaq 0x2e2a(%rip), %rdi      # 0xa57b
xorl %eax, %eax
movl %eax, %esi
callq 0x56d0
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl (%rax), %eax
shrl $0x2, %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
addq $0x10, %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x77af
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movzbl (%rax), %edi
movq -0x30(%rbp), %rsi
callq 0x2190
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x7781
movq -0x30(%rbp), %rsi
movl $0xa, %edi
callq 0x2190
movq -0x30(%rbp), %rdi
callq 0x20e0
leaq -0xe0(%rbp), %rdi
leaq 0x2dc2(%rip), %rsi      # 0xa596
callq 0x20b0
leaq -0xe0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x2310
leaq -0xe0(%rbp), %rdi
callq 0x2110
leaq -0x90(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x21f0
movq -0x140(%rbp), %rax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %edi
callq 0x6710
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
leaq -0x90(%rbp), %rdi
leaq 0x29f6(%rip), %rsi      # 0xa241
callq 0x22b0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x786b
leaq 0x2d19(%rip), %rdi      # 0xa57b
xorl %eax, %eax
movl %eax, %esi
callq 0x56d0
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x789c
movq -0x30(%rbp), %rdi
callq 0x2170
movb %al, %dl
movq -0x40(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb %dl, 0x10(%rax,%rcx)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x7872
movq -0x30(%rbp), %rdi
callq 0x20e0
leaq -0x90(%rbp), %rdi
callq 0x2090
jmp 0x7da6
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
sarq %rax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jl 0x78e9
cmpl $0x14, -0x24(%rbp)
jge 0x78e9
movslq -0x24(%rbp), %rcx
leaq 0x422c5(%rip), %rax     # 0x49ba0
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x78f8
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
jmp 0x7da6
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x7921
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
jmp 0x7da6
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
sarq %rax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x20(%rbp), %rcx
movl (%rcx), %ecx
shrl $0x2, %ecx
cmpl %ecx, %eax
jbe 0x794e
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
jmp 0x7da6
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
movslq -0x24(%rbp), %rdx
movq -0x30(%rbp), %rcx
movl $0x1, %esi
callq 0x20c0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jge 0x7980
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
jmp 0x7da6
movslq -0x24(%rbp), %rax
shlq %rax
orq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x7da6
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
sarq %rax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jl 0x79c7
cmpl $0x14, -0x24(%rbp)
jge 0x79c7
movslq -0x24(%rbp), %rcx
leaq 0x421e7(%rip), %rax     # 0x49ba0
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x79d6
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
jmp 0x7da6
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x79ff
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
jmp 0x7da6
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
sarq %rax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x20(%rbp), %rcx
movl (%rcx), %ecx
shrl $0x2, %ecx
cmpl %ecx, %eax
jbe 0x7a2c
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
jmp 0x7da6
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
movslq -0x24(%rbp), %rdx
movq -0x30(%rbp), %rcx
movl $0x1, %esi
callq 0x2350
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jge 0x7a5e
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
jmp 0x7da6
movslq -0x24(%rbp), %rax
shlq %rax
orq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x7da6
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
sarq %rax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jl 0x7aa5
cmpl $0x14, -0x24(%rbp)
jge 0x7aa5
movslq -0x24(%rbp), %rcx
leaq 0x42109(%rip), %rax     # 0x49ba0
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x7ab4
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
jmp 0x7da6
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
sarq %rax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jl 0x7adf
movq -0x30(%rbp), %rdi
movslq -0x24(%rbp), %rsi
xorl %edx, %edx
callq 0x2270
movl %eax, -0x24(%rbp)
cmpl $0x0, %eax
jge 0x7aee
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
jmp 0x7da6
movslq -0x24(%rbp), %rax
shlq %rax
orq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x7da6
leaq 0x2a91(%rip), %rdi      # 0xa59a
callq 0x7200
movq %rax, -0x20(%rbp)
jmp 0x7da6
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
sarq %rax
imulq $0x3e8, %rax, %rax      # imm = 0x3E8
movl %eax, %edi
callq 0x2380
jmp 0x7da6
movslq 0x42104(%rip), %rax     # 0x49c40
shlq %rax
orq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x7da6
movq 0x420f5(%rip), %rax     # 0x49c48
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
sarq %rcx
movq (%rax,%rcx,8), %rdi
callq 0x7200
movq %rax, -0x20(%rbp)
jmp 0x7da6
movl 0x420da(%rip), %eax     # 0x49c50
addl $0x1, %eax
cmpl 0x420c1(%rip), %eax     # 0x49c40
jl 0x7b91
leaq 0x40db0(%rip), %rax     # 0x48938
movq (%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x7bb7
movq 0x420b0(%rip), %rax     # 0x49c48
movl 0x420b2(%rip), %ecx     # 0x49c50
addl $0x1, %ecx
movl %ecx, 0x420a9(%rip)     # 0x49c50
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x7200
movq %rax, -0x20(%rbp)
jmp 0x7da6
leaq 0x29dc(%rip), %rdi      # 0xa59f
callq 0x7200
movq %rax, -0x20(%rbp)
jmp 0x7da6
cmpl $0x0, 0x4207c(%rip)     # 0x49c54
je 0x7bed
leaq 0x40d5f(%rip), %rax     # 0x48940
movq (%rax), %rax
movq %rax, -0x1a0(%rbp)
jmp 0x7bfe
leaq 0x40d54(%rip), %rax     # 0x48948
movq (%rax), %rax
movq %rax, -0x1a0(%rbp)
movq -0x1a0(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x7da6
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
sarq %rax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jl 0x7c41
cmpl $0x14, -0x24(%rbp)
jge 0x7c41
movslq -0x24(%rbp), %rcx
leaq 0x41f6d(%rip), %rax     # 0x49ba0
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x7c50
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
jmp 0x7da6
movl $0x1000, %edi           # imm = 0x1000
callq 0x2230
movq %rax, -0x178(%rbp)
cmpq $0x0, -0x178(%rbp)
jne 0x7c81
leaq 0x294d(%rip), %rdi      # 0xa5bf
callq 0x22c0
movl $0x1, %edi
callq 0x2330
movq $0x1000, -0x180(%rbp) # imm = 0x1000
movq $0x0, -0x188(%rbp)
movq -0x178(%rbp), %rdi
addq -0x188(%rbp), %rdi
movq -0x180(%rbp), %rdx
subq -0x188(%rbp), %rdx
movq -0x30(%rbp), %rcx
movl $0x1, %esi
callq 0x20c0
movq %rax, -0x190(%rbp)
cmpq $0x0, %rax
jle 0x7d4c
movq -0x190(%rbp), %rax
addq -0x188(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x188(%rbp), %rax
movq -0x180(%rbp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jb 0x7d47
movq -0x180(%rbp), %rax
shlq %rax
movq %rax, -0x180(%rbp)
movq -0x178(%rbp), %rdi
movq -0x180(%rbp), %rsi
callq 0x2280
movq %rax, -0x178(%rbp)
cmpq $0x0, -0x178(%rbp)
jne 0x7d45
leaq 0x2890(%rip), %rdi      # 0xa5c6
callq 0x22c0
movl $0x1, %edi
callq 0x2330
jmp 0x7d47
jmp 0x7c97
cmpq $0x0, -0x188(%rbp)
jne 0x7d66
leaq 0x40bdb(%rip), %rax     # 0x48938
movq (%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x7d88
movq -0x178(%rbp), %rax
movq -0x188(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x178(%rbp), %rdi
callq 0x7200
movq %rax, -0x20(%rbp)
movq -0x178(%rbp), %rdi
callq 0x2060
jmp 0x7da6
movslq -0x4(%rbp), %rsi
leaq 0x282d(%rip), %rdi      # 0xa5ce
callq 0x56d0
movq -0x20(%rbp), %rax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)