// File: legendddhgf[P]Text2RPG/GameEngine.cpp
// Function: GameEngine::GameEngine(_IO_FILE*)
GameEngine::GameEngine (FILE *fp) {
  map_room_descriptions.clear(); // are these done automatically?
  map_room_contents.clear();
  map_room_opts.clear();
  map_room_tags.clear();

  int parseMode = PARSEMODENONE;
  string lastKey = string(""); // the key for the current parseMode
  // (IE: the current room if PARSEMODEROOM)
  char *buf = (char *) calloc(1024, sizeof(char)); // this is simply a
  // temporary string which
  // gets trimmed to modstr
  char *modstr = (char *) calloc(1024, sizeof(char)); // THIS IS THE STRING
  // WE ARE USING!!!
  int linecount = 0; // helps the user debug their text file
  while (fgets(buf, 1023, fp)) {
    linecount++;
    if (strlen(modstr) >= 1000) {
      fprintf(stderr, "line %d: Too long\n", linecount);
      exit(1);
    }
    stringTrim(buf, "\n\r ", modstr); // trim newline, carriage return,
    // and space from front and back
    if (strlen(modstr) == 0) { // skip empty lines
      continue;
    }
    if (strlen(modstr) == 1) {
      fprintf(stderr, "line %d: No parameters specified\n", linecount);
      exit(1);
    }
    char tag = modstr[0]; // in this case, by tag we mean the character of
    // the line (IE: 'r', 'd', 'g', etc.)
    strncpy(buf, modstr, strlen(modstr) + 1); // this line and the
    // following one trim
    // everything from
    stringTrim(buf + 1, "\n\r ", modstr);     // the tag to the beginning
    // of the parameter
    vector<string> params = {};
    stringToParams(modstr, &params, " ");
    // (room for 'r', description for 'd', etc)
    switch (tag) { // REMEMBER: at this point modstr only contains the
      // parameter, tag contains the current tag
      case 'r': // room
        {
          if (params.size() != 1) {
            fprintf(stderr, "line %d: 'r' takes one parameter\n", linecount);
            exit(1);
          }
          // TODO: create a function that checks if it is ok to
          // continue parsing, in other words, checks that the
          // previous thing being modified is ok up to this point
          parseMode = PARSEMODEROOM;

          /* VERY BAD BECAUSE WE DON'T KNOW IF LASTKEY IS A ROOM!,
           * just make a complete checking function already
           if (map_room_descriptions.size() > 0 &&
          // if desc is blank, none specified
          map_room_descriptions.at(lastKey).compare(string("")) == 0) {
          fprintf(stderr, "%s: Room has no description\n",
          list_rooms.back().c_str());
          exit(1);
          }
          */

          if (map_room_opts.size() != map_room_tags.size()) {
            fprintf(stderr, "line %d: There must be one tag for every option\n",
                linecount);
            exit(1);
          }
          lastKey = params.at(0); // key is now the current room
          if (map_room_descriptions.find(lastKey) !=
              map_room_descriptions.end()) {
            fprintf(stderr, "line %d: Can't have duplicate room names\n",
                linecount);
            exit(1);
          }
          if (map_room_descriptions.size() == 0) { // don't check tags if there
            // are no rooms yet
            map_room_descriptions.insert(pair<string, // new entry
                string>(lastKey, string("")));
            break;
          }
          auto opts_iter = map_room_opts.find(lastKey); // the next ~10 lines
          // are for checking
          // opts : tags
          auto tags_iter = map_room_tags.find(lastKey);
          if (opts_iter == map_room_opts.end() &&
              tags_iter == map_room_tags.end()) { // no tags or opts, thus equal
            map_room_descriptions.insert(pair<string,
                string>(lastKey, string(""))); // if unchanged, if
            // statement above is trigerred
            break;
          }
          if (opts_iter == map_room_opts.end() || // only opts has nothing
              tags_iter == map_room_tags.end() || // or only tags has nothing
              opts_iter->second.size() !=
              tags_iter->second.size()) { // or for key: numopts != numtags
            fprintf(stderr, "line %d: There must be one tag for every option\n",
                linecount);
            exit(1);
          }
          map_room_descriptions.insert(pair<string,
              string>(lastKey, string("")));
          break;
        }
      case 'd': // description
        // NOTE: that there is only ever one description per room. The
        // functionality of having multiple descriptions is implemented
        // by appending to the previous description string for a given
        // room if it already exists
        if (parseMode == PARSEMODEROOM) {
          // in all cases, append: we know the entry must exist at
          // this point
          // Note: in this case we take the entire group of parameters excluding
          // the newline and space after the tag as the description
          map_room_descriptions.at(lastKey).append(string("\t")
              + string(modstr) + string("\n"));
        } else if (parseMode == PARSEMODEITEM) {
          // in all cases, append: we know the entry must exist at
          // this point
          // Note: in this case we take the entire group of parameters excluding
          // the newline and space after the tag as the description
          map_item_descriptions.at(lastKey).append(string("\t")
              + string(modstr) + string("\n"));
        } else {
          fprintf(stderr, "line %d: Invalid parsemode for 'd'\n", linecount);
          exit(1);
        }
        break;
      case 'o':
        {
          if (parseMode == PARSEMODEROOM) {
            if (map_room_opts.find(lastKey) != map_room_opts.end() &&
                map_room_tags.find(lastKey) != map_room_tags.end() &&
                map_room_opts.find(lastKey)->second.size() !=
                map_room_tags.find(lastKey)->second.size()) { // numopts should
              // equal numtags
              // at this point
              fprintf(stderr, "line %d: Expected another tag first\n",
                  linecount);
              exit(1);
            }
            // if there are no transitions from the current room, insert
            // a blank one
            if (map_room_opts.find(lastKey) == map_room_opts.end()) {
              map_room_opts.insert(pair<string, vector<string>>(lastKey, {}));
            }
            // finally, append to the appropriate vector
            map_room_opts.find(lastKey)->second.push_back(params.at(0));
          } else if (parseMode == PARSEMODEITEM) {
            // TODO: dat functionality
          } else {
            fprintf(stderr, "line %d: Invalid parsemode for 'o'\n", linecount);
            exit(1);
          }
          break;
        }
      case 't':
        {
          if (parseMode == PARSEMODEROOM) {
            // can't have tags before opts
            if (map_room_opts.find(lastKey) == map_room_opts.end() ||
                (map_room_opts.find(lastKey) != map_room_opts.end() &&
                 map_room_tags.find(lastKey) != map_room_tags.end() &&
                 map_room_opts.find(lastKey)->second.size() ==
                 map_room_tags.find(lastKey)->second.size())) {
              // numopts should equal numtags - 1 at this point
              fprintf(stderr, "line %d: Expected another option first\n",
                  linecount);
              exit(1);
            }
            // if there are no transitions from the current room, insert
            // a blank one
            if (map_room_tags.find(lastKey) == map_room_tags.end())
              map_room_tags.insert(pair<string, vector<string>>(lastKey, {}));
            // finally, append to the appropriate vector
            map_room_tags.find(lastKey)->second.push_back(params.at(0));
          } else if (parseMode == PARSEMODEITEM) {
            // TODO: dat functionality
          } else {
            fprintf(stderr, "line %d: Invalid parsemode for 't'\n", linecount);
            exit(1);
          }
          break;
        }
      case 'm':
        if (parseMode == PARSEMODEROOM) {
          if (params.size() > 2) {
            fprintf(stderr, "line %d: in room parsing, 'm' %s",
                linecount, "takes one or two parameters\n");
            exit(1);
          }
          // Cannot have a room be a member of itself
          if (params.at(0).compare(lastKey) == 0) {
            fprintf(stderr, "line %d: %s cannot be a member of itself\n",
                linecount, modstr);
            exit(1);
          }
          if (map_room_contents.find(lastKey) == map_room_contents.end()) {
            // sometimes life isn't simple but it could be
            map_room_contents.insert(pair<string,
                vector<tuple<string, string>>>(lastKey, {}));
          }
          if (params.size() == 1) {
            map_room_contents.find(lastKey)->second.emplace_back(
                params.at(0), to_string(PRIORITYDEFAULT));
          } else {
            if (params.at(1).find_first_not_of("1234567890") != string::npos) {
              fprintf(stderr, "line %d: Priority must be an integer\n",
                  linecount);
              exit(1);
            }
            map_room_contents.find(lastKey)->second.emplace_back(
                params.at(0), params.at(1));
          }
        } else {
          fprintf(stderr, "line %d: Invalid parsemode for 'm'\n", linecount);
          exit(1);
        }
        break;
      case 'e':
        // TODO
        break;
      case 'a':
        // TODO
        break;
      case 'i':
        {
          // TODO: create a function that checks if it is ok to
          // continue parsing, in other words, checks that the
          // previous thing being modified is ok up to this point
          parseMode = PARSEMODEITEM;
          if (params.size() != 1) {
            fprintf(stderr, "line %d: 'i' takes one parameter\n", linecount);
            exit(1);
          }
          lastKey = params.at(0); // key is now the current item
          if (map_item_descriptions.find(lastKey) !=
              map_item_descriptions.end()) {
            fprintf(stderr, "line %d: Can't have duplicate item names\n",
                linecount);
            exit(1);
          }
          map_item_descriptions.insert(pair<string, // new entry
              string>(lastKey, string("")));
          break;
        }
      case 'q':
        {
          if (parseMode == PARSEMODEITEM) {
            // TODO
          } else {
            fprintf(stderr, "line %d: Invalid parsemode for 'q'\n", linecount);
            exit(1);
          }
          break;
        }
      case '#': // support those comments
        // Yes, this works.
        break;
      default:
        fprintf(stderr, "%c: No Corresponding field\n", tag);
        exit(1);
        break;
    }
  }
  /* General checking function needed
     if (list_rooms.size() != list_room_descriptions.size()) {
// one description per room required
fprintf(stderr, "%s: Room has no description\n",
list_rooms.back().c_str());
exit(1); }
*/
  // TODO resolve regex
  // TODO:
  // check that for all keys num opts = num tags and all opts are valid rooms
  // (will have to add checking for non-visitable rooms later)

  // print all info
  auto iter_room = map_room_descriptions.begin();
  int count_rooms = 1;
  fprintf(stdout, "ROOMS:\n=====\n");
  while (iter_room != map_room_descriptions.end()) {
    string room = iter_room->first;
    string description = iter_room->second;
    iter_room++;
    fprintf(stdout, "%d: %s\n", count_rooms++, room.c_str());
    // assumes description was modified in a certain way first
    fprintf(stdout, "%s", description.c_str());
    if (map_room_contents.find(room) != map_room_contents.end()) {
      fprintf(stdout, "\tHas Members:\n");
      auto list_contents = map_room_contents.find(room)->second;
      for (size_t k = 0; k < list_contents.size(); k++) {
        fprintf(stdout, "\t\t%s: Priority=%s\n",
            get<0>(list_contents.at(k)).c_str(),
            get<1>(list_contents.at(k)).c_str());
      }
    }
    // if no opts/tags
    if (map_room_opts.find(room) == map_room_opts.end()) continue;
    fprintf(stdout, "\tHas Options and Tags:\n");
    auto list_opts = map_room_opts.at(room);
    auto list_tags = map_room_tags.at(room);
    for (size_t k = 0; k < list_opts.size(); k++) { // since numopts = numtags
      fprintf(stdout, "\t\tOption: %s\n", list_opts.at(k).c_str());
      fprintf(stdout, "\t\t\tTag: %s\n", list_tags.at(k).c_str());
    }
  }
  fprintf(stdout, "=====\nITEMS:\n=====\n");
  auto iter_items = map_item_descriptions.begin();
  int count_items = 1;
  // print item info
  while(iter_items != map_item_descriptions.end()) {
    string item = iter_items->first;
    string description = iter_items->second;
    iter_items++;
    fprintf(stdout, "%d: %s\n", count_items++, item.c_str());
    // assumes description was modified in a certain way first
    fprintf(stdout, "%s", description.c_str());
  }
  fprintf(stdout, "=====\n");
  free(buf);
  free(modstr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb30, %rsp            # imm = 0xB30
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x7a8(%rbp)
movq %rdi, %rax
movq %rax, -0x7c0(%rbp)
callq 0x3d70
movq -0x7a8(%rbp), %rdi
addq $0x38, %rdi
movq %rdi, -0x7a0(%rbp)
callq 0x95e0
movq -0x7a8(%rbp), %rdi
addq $0x70, %rdi
movq %rdi, -0x798(%rbp)
callq 0x9600
movq -0x7a8(%rbp), %rdi
addq $0xa8, %rdi
movq %rdi, -0x790(%rbp)
callq 0x9600
movq -0x7a8(%rbp), %rdi
addq $0xe0, %rdi
movq %rdi, -0x7b8(%rbp)
callq 0x3d70
movq -0x7a8(%rbp), %rdi
addq $0x118, %rdi            # imm = 0x118
movq %rdi, -0x7b0(%rbp)
callq 0x9620
movq -0x7a8(%rbp), %rdi
callq 0x9640
movq -0x7a0(%rbp), %rdi
callq 0x9660
movq -0x798(%rbp), %rdi
callq 0x9680
movq -0x790(%rbp), %rdi
callq 0x9680
movl $0x0, -0x14(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0x788(%rbp)
callq 0x2310
movq -0x788(%rbp), %rdx
leaq 0x8fd5(%rip), %rsi      # 0x10313
leaq -0x38(%rbp), %rdi
callq 0x2260
jmp 0x7349
leaq -0x39(%rbp), %rdi
callq 0x21f0
movl $0x400, %edi            # imm = 0x400
movl $0x1, %esi
callq 0x2160
movq %rax, -0x58(%rbp)
movl $0x400, %edi            # imm = 0x400
movl $0x1, %esi
callq 0x2160
movq %rax, -0x60(%rbp)
movl $0x0, -0x64(%rbp)
movq -0x58(%rbp), %rdi
movq -0x10(%rbp), %rdx
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x22d0
movq %rax, -0x7c8(%rbp)
jmp 0x739a
movq -0x7c8(%rbp), %rax
cmpq $0x0, %rax
je 0x8dea
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
movq -0x60(%rbp), %rdi
callq 0x20e0
cmpq $0x3e8, %rax            # imm = 0x3E8
jb 0x7415
movq 0x11c14(%rip), %rax     # 0x18fe0
movq (%rax), %rdi
movl -0x64(%rbp), %edx
leaq 0x8e83(%rip), %rsi      # 0x1025c
movb $0x0, %al
callq 0x2280
movl $0x1, %edi
callq 0x2220
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x39(%rbp), %rdi
callq 0x21f0
jmp 0x958a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x9581
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rdx
leaq 0x8e4b(%rip), %rsi      # 0x1026f
callq 0x2440
jmp 0x742b
movq -0x60(%rbp), %rdi
callq 0x20e0
cmpq $0x0, %rax
jne 0x743f
jmp 0x737f
movq -0x60(%rbp), %rdi
callq 0x20e0
cmpq $0x1, %rax
jne 0x7473
movq 0x11b8b(%rip), %rax     # 0x18fe0
movq (%rax), %rdi
movl -0x64(%rbp), %edx
leaq 0x8e11(%rip), %rsi      # 0x10273
movb $0x0, %al
callq 0x2280
movl $0x1, %edi
callq 0x2220
movq -0x60(%rbp), %rax
movb (%rax), %al
movb %al, -0x65(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x7d8(%rbp)
movq -0x60(%rbp), %rdi
movq %rdi, -0x7d0(%rbp)
callq 0x20e0
movq -0x7d8(%rbp), %rdi
movq -0x7d0(%rbp), %rsi
movq %rax, %rdx
incq %rdx
callq 0x2100
movq -0x58(%rbp), %rdi
incq %rdi
movq -0x60(%rbp), %rdx
leaq 0x8dad(%rip), %rsi      # 0x1026f
callq 0x2440
jmp 0x74c9
xorps %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
movq $0x0, -0x70(%rbp)
leaq -0x80(%rbp), %rdi
movq %rdi, -0x7e0(%rbp)
callq 0x3d50
movq -0x7e0(%rbp), %rsi
movq -0x60(%rbp), %rdi
leaq 0x8d77(%rip), %rdx      # 0x10271
callq 0x2530
jmp 0x7501
movsbl -0x65(%rbp), %eax
addl $-0x23, %eax
movl %eax, %ecx
movq %rcx, -0x7e8(%rbp)
subl $0x51, %eax
ja 0x8da8
movq -0x7e8(%rbp), %rax
leaq 0x8bec(%rip), %rcx      # 0x10114
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x8ddc
leaq -0x80(%rbp), %rdi
callq 0x2d30
cmpq $0x1, %rax
je 0x7576
movq 0x11a88(%rip), %rax     # 0x18fe0
movq (%rax), %rdi
movl -0x64(%rbp), %edx
leaq 0x8d30(%rip), %rsi      # 0x10295
movb $0x0, %al
callq 0x2280
movl $0x1, %edi
callq 0x2220
movq -0x7c0(%rbp), %rdi
movl $0x1, -0x14(%rbp)
addq $0x70, %rdi
callq 0x96a0
movq -0x7c0(%rbp), %rdi
movq %rax, -0x7f0(%rbp)
addq $0xa8, %rdi
callq 0x96a0
movq %rax, %rcx
movq -0x7f0(%rbp), %rax
cmpq %rcx, %rax
je 0x75db
movq 0x11a23(%rip), %rax     # 0x18fe0
movq (%rax), %rdi
movl -0x64(%rbp), %edx
leaq 0x8ced(%rip), %rsi      # 0x102b7
movb $0x0, %al
callq 0x2280
movl $0x1, %edi
callq 0x2220
xorl %eax, %eax
movl %eax, %esi
leaq -0x80(%rbp), %rdi
callq 0x96c0
movq %rax, -0x7f8(%rbp)
jmp 0x75f1
movq -0x7f8(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x2050
jmp 0x7603
movq -0x7c0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x4130
movq %rax, -0x800(%rbp)
jmp 0x761c
movq -0x7c0(%rbp), %rdi
movq -0x800(%rbp), %rax
movq %rax, -0x88(%rbp)
callq 0x4160
movq %rax, -0x90(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x9700
testb $0x1, %al
jne 0x7656
jmp 0x767b
movq 0x11983(%rip), %rax     # 0x18fe0
movq (%rax), %rdi
movl -0x64(%rbp), %edx
leaq 0x8c7e(%rip), %rsi      # 0x102e8
movb $0x0, %al
callq 0x2280
movl $0x1, %edi
callq 0x2220
movq -0x7c0(%rbp), %rdi
callq 0x9730
cmpq $0x0, %rax
jne 0x779d
movq -0x7c0(%rbp), %rax
movq %rax, -0x810(%rbp)
leaq -0xf1(%rbp), %rdi
movq %rdi, -0x808(%rbp)
callq 0x2310
movq -0x808(%rbp), %rdx
leaq 0x8c53(%rip), %rsi      # 0x10313
leaq -0xf0(%rbp), %rdi
callq 0x2260
jmp 0x76ce
leaq -0xd0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
callq 0x9750
jmp 0x76e7
movq -0x810(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x4030
movb %dl, -0x819(%rbp)
movq %rax, -0x818(%rbp)
jmp 0x7709
movb -0x819(%rbp), %al
movq -0x818(%rbp), %rcx
movq %rcx, -0x108(%rbp)
movb %al, -0x100(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x40d0
leaq -0xf0(%rbp), %rdi
callq 0x2150
leaq -0xf1(%rbp), %rdi
callq 0x21f0
jmp 0x8dce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x778c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x7780
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x40d0
leaq -0xf0(%rbp), %rdi
callq 0x2150
leaq -0xf1(%rbp), %rdi
callq 0x21f0
jmp 0x8ddc
movq -0x7c0(%rbp), %rdi
addq $0x70, %rdi
leaq -0x38(%rbp), %rsi
callq 0x9790
movq %rax, -0x828(%rbp)
jmp 0x77ba
movq -0x7c0(%rbp), %rdi
movq -0x828(%rbp), %rax
movq %rax, -0x110(%rbp)
addq $0xa8, %rdi
leaq -0x38(%rbp), %rsi
callq 0x9790
movq %rax, -0x830(%rbp)
jmp 0x77e8
movq -0x7c0(%rbp), %rdi
movq -0x830(%rbp), %rax
movq %rax, -0x118(%rbp)
addq $0x70, %rdi
callq 0x97f0
movq %rax, -0x120(%rbp)
leaq -0x110(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x97c0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x831(%rbp)
jne 0x7831
jmp 0x7864
movq -0x7c0(%rbp), %rdi
addq $0xa8, %rdi
callq 0x97f0
movq %rax, -0x128(%rbp)
leaq -0x118(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x97c0
movb %al, -0x831(%rbp)
movb -0x831(%rbp), %al
testb $0x1, %al
jne 0x7873
jmp 0x797f
movq -0x7c0(%rbp), %rax
movq %rax, -0x848(%rbp)
leaq -0x189(%rbp), %rdi
movq %rdi, -0x840(%rbp)
callq 0x2310
movq -0x840(%rbp), %rdx
leaq 0x8a71(%rip), %rsi      # 0x10313
leaq -0x188(%rbp), %rdi
callq 0x2260
jmp 0x78b0
leaq -0x168(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x188(%rbp), %rdx
callq 0x9750
jmp 0x78c9
movq -0x848(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x4030
movb %dl, -0x851(%rbp)
movq %rax, -0x850(%rbp)
jmp 0x78eb
movb -0x851(%rbp), %al
movq -0x850(%rbp), %rcx
movq %rcx, -0x1a0(%rbp)
movb %al, -0x198(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x40d0
leaq -0x188(%rbp), %rdi
callq 0x2150
leaq -0x189(%rbp), %rdi
callq 0x21f0
jmp 0x8dce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x796e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x7962
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x40d0
leaq -0x188(%rbp), %rdi
callq 0x2150
leaq -0x189(%rbp), %rdi
callq 0x21f0
jmp 0x8ddc
movq -0x7c0(%rbp), %rdi
addq $0x70, %rdi
callq 0x97f0
movq %rax, -0x1a8(%rbp)
leaq -0x110(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0x97c0
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x852(%rbp)
jne 0x7a45
movq -0x7c0(%rbp), %rdi
addq $0xa8, %rdi
callq 0x97f0
movq %rax, -0x1b0(%rbp)
leaq -0x118(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x97c0
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x852(%rbp)
jne 0x7a45
leaq -0x110(%rbp), %rdi
callq 0x9820
movq %rax, %rdi
addq $0x20, %rdi
callq 0x2d30
movq %rax, -0x860(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x9820
movq %rax, %rdi
addq $0x20, %rdi
callq 0x2d30
movq %rax, %rcx
movq -0x860(%rbp), %rax
cmpq %rcx, %rax
setne %al
movb %al, -0x852(%rbp)
movb -0x852(%rbp), %al
testb $0x1, %al
jne 0x7a51
jmp 0x7a76
movq 0x11588(%rip), %rax     # 0x18fe0
movq (%rax), %rdi
movl -0x64(%rbp), %edx
leaq 0x8852(%rip), %rsi      # 0x102b7
movb $0x0, %al
callq 0x2280
movl $0x1, %edi
callq 0x2220
movq -0x7c0(%rbp), %rax
movq %rax, -0x870(%rbp)
leaq -0x211(%rbp), %rdi
movq %rdi, -0x868(%rbp)
callq 0x2310
movq -0x868(%rbp), %rdx
leaq 0x886e(%rip), %rsi      # 0x10313
leaq -0x210(%rbp), %rdi
callq 0x2260
jmp 0x7ab3
leaq -0x1f0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x210(%rbp), %rdx
callq 0x9750
jmp 0x7acc
movq -0x870(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0x4030
movb %dl, -0x879(%rbp)
movq %rax, -0x878(%rbp)
jmp 0x7aee
movb -0x879(%rbp), %al
movq -0x878(%rbp), %rcx
movq %rcx, -0x228(%rbp)
movb %al, -0x220(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x40d0
leaq -0x210(%rbp), %rdi
callq 0x2150
leaq -0x211(%rbp), %rdi
callq 0x21f0
jmp 0x8dce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x7b71
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x7b65
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x40d0
leaq -0x210(%rbp), %rdi
callq 0x2150
leaq -0x211(%rbp), %rdi
callq 0x21f0
jmp 0x8ddc
cmpl $0x1, -0x14(%rbp)
jne 0x7da9
movq -0x7c0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x4190
movq %rax, -0x888(%rbp)
jmp 0x7ba5
leaq -0x289(%rbp), %rdi
movq %rdi, -0x890(%rbp)
callq 0x2310
movq -0x890(%rbp), %rdx
leaq 0x874c(%rip), %rsi      # 0x10312
leaq -0x288(%rbp), %rdi
callq 0x2260
jmp 0x7bd4
movq -0x60(%rbp), %rax
movq %rax, -0x8a0(%rbp)
leaq -0x2b1(%rbp), %rdi
movq %rdi, -0x898(%rbp)
callq 0x2310
movq -0x8a0(%rbp), %rsi
movq -0x898(%rbp), %rdx
leaq -0x2b0(%rbp), %rdi
callq 0x2260
jmp 0x7c0e
leaq -0x268(%rbp), %rdi
leaq -0x288(%rbp), %rsi
leaq -0x2b0(%rbp), %rdx
callq 0x9850
jmp 0x7c2a
leaq -0x2d9(%rbp), %rdi
movq %rdi, -0x8a8(%rbp)
callq 0x2310
movq -0x8a8(%rbp), %rdx
leaq 0x86eb(%rip), %rsi      # 0x10336
leaq -0x2d8(%rbp), %rdi
callq 0x2260
jmp 0x7c59
leaq -0x248(%rbp), %rdi
leaq -0x268(%rbp), %rsi
leaq -0x2d8(%rbp), %rdx
callq 0x9850
jmp 0x7c75
movq -0x888(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x2320
jmp 0x7c8a
leaq -0x248(%rbp), %rdi
callq 0x2150
leaq -0x2d8(%rbp), %rdi
callq 0x2150
leaq -0x2d9(%rbp), %rdi
callq 0x21f0
leaq -0x268(%rbp), %rdi
callq 0x2150
leaq -0x2b0(%rbp), %rdi
callq 0x2150
leaq -0x2b1(%rbp), %rdi
callq 0x21f0
leaq -0x288(%rbp), %rdi
callq 0x2150
leaq -0x289(%rbp), %rdi
callq 0x21f0
jmp 0x7ffe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x7d98
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x7d80
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x7d74
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x7d5c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x7d50
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x248(%rbp), %rdi
callq 0x2150
leaq -0x2d8(%rbp), %rdi
callq 0x2150
leaq -0x2d9(%rbp), %rdi
callq 0x21f0
leaq -0x268(%rbp), %rdi
callq 0x2150
leaq -0x2b0(%rbp), %rdi
callq 0x2150
leaq -0x2b1(%rbp), %rdi
callq 0x21f0
leaq -0x288(%rbp), %rdi
callq 0x2150
leaq -0x289(%rbp), %rdi
callq 0x21f0
jmp 0x8ddc
cmpl $0x3, -0x14(%rbp)
jne 0x7fd7
movq -0x7c0(%rbp), %rdi
addq $0xe0, %rdi
leaq -0x38(%rbp), %rsi
callq 0x4190
movq %rax, -0x8b0(%rbp)
jmp 0x7dd3
leaq -0x341(%rbp), %rdi
movq %rdi, -0x8b8(%rbp)
callq 0x2310
movq -0x8b8(%rbp), %rdx
leaq 0x851e(%rip), %rsi      # 0x10312
leaq -0x340(%rbp), %rdi
callq 0x2260
jmp 0x7e02
movq -0x60(%rbp), %rax
movq %rax, -0x8c8(%rbp)
leaq -0x369(%rbp), %rdi
movq %rdi, -0x8c0(%rbp)
callq 0x2310
movq -0x8c8(%rbp), %rsi
movq -0x8c0(%rbp), %rdx
leaq -0x368(%rbp), %rdi
callq 0x2260
jmp 0x7e3c
leaq -0x320(%rbp), %rdi
leaq -0x340(%rbp), %rsi
leaq -0x368(%rbp), %rdx
callq 0x9850
jmp 0x7e58
leaq -0x391(%rbp), %rdi
movq %rdi, -0x8d0(%rbp)
callq 0x2310
movq -0x8d0(%rbp), %rdx
leaq 0x84bd(%rip), %rsi      # 0x10336
leaq -0x390(%rbp), %rdi
callq 0x2260
jmp 0x7e87
leaq -0x300(%rbp), %rdi
leaq -0x320(%rbp), %rsi
leaq -0x390(%rbp), %rdx
callq 0x9850
jmp 0x7ea3
movq -0x8b0(%rbp), %rdi
leaq -0x300(%rbp), %rsi
callq 0x2320
jmp 0x7eb8
leaq -0x300(%rbp), %rdi
callq 0x2150
leaq -0x390(%rbp), %rdi
callq 0x2150
leaq -0x391(%rbp), %rdi
callq 0x21f0
leaq -0x320(%rbp), %rdi
callq 0x2150
leaq -0x368(%rbp), %rdi
callq 0x2150
leaq -0x369(%rbp), %rdi
callq 0x21f0
leaq -0x340(%rbp), %rdi
callq 0x2150
leaq -0x341(%rbp), %rdi
callq 0x21f0
jmp 0x7ffc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x7fc6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x7fae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x7fa2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x7f8a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x7f7e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x300(%rbp), %rdi
callq 0x2150
leaq -0x390(%rbp), %rdi
callq 0x2150
leaq -0x391(%rbp), %rdi
callq 0x21f0
leaq -0x320(%rbp), %rdi
callq 0x2150
leaq -0x368(%rbp), %rdi
callq 0x2150
leaq -0x369(%rbp), %rdi
callq 0x21f0
leaq -0x340(%rbp), %rdi
callq 0x2150
leaq -0x341(%rbp), %rdi
callq 0x21f0
jmp 0x8ddc
movq 0x11002(%rip), %rax     # 0x18fe0
movq (%rax), %rdi
movl -0x64(%rbp), %edx
leaq 0x8329(%rip), %rsi      # 0x10314
movb $0x0, %al
callq 0x2280
movl $0x1, %edi
callq 0x2220
jmp 0x7ffe
jmp 0x8dce
cmpl $0x1, -0x14(%rbp)
jne 0x8369
movq -0x7c0(%rbp), %rdi
addq $0x70, %rdi
leaq -0x38(%rbp), %rsi
callq 0x9790
movq %rax, -0x8d8(%rbp)
jmp 0x802a
movq -0x7c0(%rbp), %rdi
movq -0x8d8(%rbp), %rax
movq %rax, -0x3a0(%rbp)
addq $0x70, %rdi
callq 0x97f0
movq %rax, -0x3a8(%rbp)
leaq -0x3a0(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
callq 0x9920
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x8d9(%rbp)
jne 0x8076
jmp 0x818b
movq -0x7c0(%rbp), %rdi
addq $0xa8, %rdi
leaq -0x38(%rbp), %rsi
callq 0x9790
movq %rax, -0x8e8(%rbp)
jmp 0x8096
movq -0x7c0(%rbp), %rdi
movq -0x8e8(%rbp), %rax
movq %rax, -0x3b0(%rbp)
addq $0xa8, %rdi
callq 0x97f0
movq %rax, -0x3b8(%rbp)
leaq -0x3b0(%rbp), %rdi
leaq -0x3b8(%rbp), %rsi
callq 0x9920
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x8d9(%rbp)
jne 0x80e5
jmp 0x818b
movq -0x7c0(%rbp), %rdi
addq $0x70, %rdi
leaq -0x38(%rbp), %rsi
callq 0x9790
movq %rax, -0x8f0(%rbp)
jmp 0x8102
movq -0x8f0(%rbp), %rax
movq %rax, -0x3c0(%rbp)
leaq -0x3c0(%rbp), %rdi
callq 0x9820
movq %rax, %rdi
addq $0x20, %rdi
callq 0x2d30
movq -0x7c0(%rbp), %rdi
movq %rax, -0x900(%rbp)
addq $0xa8, %rdi
leaq -0x38(%rbp), %rsi
callq 0x9790
movq %rax, -0x8f8(%rbp)
jmp 0x814f
movq -0x8f8(%rbp), %rax
movq %rax, -0x3c8(%rbp)
leaq -0x3c8(%rbp), %rdi
callq 0x9820
movq %rax, %rdi
addq $0x20, %rdi
callq 0x2d30
movq %rax, %rcx
movq -0x900(%rbp), %rax
cmpq %rcx, %rax
setne %al
movb %al, -0x8d9(%rbp)
movb -0x8d9(%rbp), %al
testb $0x1, %al
jne 0x8197
jmp 0x81bc
movq 0x10e42(%rip), %rax     # 0x18fe0
movq (%rax), %rdi
movl -0x64(%rbp), %edx
leaq 0x818d(%rip), %rsi      # 0x10338
movb $0x0, %al
callq 0x2280
movl $0x1, %edi
callq 0x2220
movq -0x7c0(%rbp), %rdi
addq $0x70, %rdi
leaq -0x38(%rbp), %rsi
callq 0x9790
movq %rax, -0x908(%rbp)
jmp 0x81d9
movq -0x7c0(%rbp), %rdi
movq -0x908(%rbp), %rax
movq %rax, -0x3d0(%rbp)
addq $0x70, %rdi
callq 0x97f0
movq %rax, -0x3d8(%rbp)
leaq -0x3d0(%rbp), %rdi
leaq -0x3d8(%rbp), %rsi
callq 0x97c0
testb $0x1, %al
jne 0x821a
jmp 0x82fa
movq -0x7c0(%rbp), %rax
addq $0x70, %rax
movq %rax, -0x918(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x430(%rbp)
movq $0x0, -0x420(%rbp)
leaq -0x430(%rbp), %rdi
movq %rdi, -0x910(%rbp)
callq 0x3d50
movq -0x910(%rbp), %rdx
leaq -0x410(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x9990
jmp 0x826d
movq -0x918(%rbp), %rdi
leaq -0x410(%rbp), %rsi
callq 0x9950
movb %dl, -0x921(%rbp)
movq %rax, -0x920(%rbp)
jmp 0x828f
movb -0x921(%rbp), %al
movq -0x920(%rbp), %rcx
movq %rcx, -0x440(%rbp)
movb %al, -0x438(%rbp)
leaq -0x410(%rbp), %rdi
callq 0x99f0
leaq -0x430(%rbp), %rdi
callq 0x3e70
jmp 0x82fa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x82e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x410(%rbp), %rdi
callq 0x99f0
leaq -0x430(%rbp), %rdi
callq 0x3e70
jmp 0x8ddc
movq -0x7c0(%rbp), %rdi
addq $0x70, %rdi
leaq -0x38(%rbp), %rsi
callq 0x9790
movq %rax, -0x930(%rbp)
jmp 0x8317
movq -0x930(%rbp), %rax
movq %rax, -0x448(%rbp)
leaq -0x448(%rbp), %rdi
callq 0x9820
addq $0x20, %rax
movq %rax, -0x940(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x80(%rbp), %rdi
callq 0x96c0
movq %rax, -0x938(%rbp)
jmp 0x8352
movq -0x938(%rbp), %rsi
movq -0x940(%rbp), %rdi
callq 0x2710
jmp 0x8367
jmp 0x8398
cmpl $0x3, -0x14(%rbp)
jne 0x8371
jmp 0x8396
movq 0x10c68(%rip), %rax     # 0x18fe0
movq (%rax), %rdi
movl -0x64(%rbp), %edx
leaq 0x7fd8(%rip), %rsi      # 0x1035d
movb $0x0, %al
callq 0x2280
movl $0x1, %edi
callq 0x2220
jmp 0x8398
jmp 0x8dce
cmpl $0x1, -0x14(%rbp)
jne 0x8782
movq -0x7c0(%rbp), %rdi
addq $0x70, %rdi
leaq -0x38(%rbp), %rsi
callq 0x9790
movq %rax, -0x948(%rbp)
jmp 0x83c4
movq -0x7c0(%rbp), %rdi
movq -0x948(%rbp), %rax
movq %rax, -0x450(%rbp)
addq $0x70, %rdi
callq 0x97f0
movq %rax, -0x458(%rbp)
leaq -0x450(%rbp), %rdi
leaq -0x458(%rbp), %rsi
callq 0x97c0
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x949(%rbp)
jne 0x8599
movq -0x7c0(%rbp), %rdi
addq $0x70, %rdi
leaq -0x38(%rbp), %rsi
callq 0x9790
movq %rax, -0x958(%rbp)
jmp 0x842c
movq -0x7c0(%rbp), %rdi
movq -0x958(%rbp), %rax
movq %rax, -0x460(%rbp)
addq $0x70, %rdi
callq 0x97f0
movq %rax, -0x468(%rbp)
leaq -0x460(%rbp), %rdi
leaq -0x468(%rbp), %rsi
callq 0x9920
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x959(%rbp)
jne 0x8478
jmp 0x858d
movq -0x7c0(%rbp), %rdi
addq $0xa8, %rdi
leaq -0x38(%rbp), %rsi
callq 0x9790
movq %rax, -0x968(%rbp)
jmp 0x8498
movq -0x7c0(%rbp), %rdi
movq -0x968(%rbp), %rax
movq %rax, -0x470(%rbp)
addq $0xa8, %rdi
callq 0x97f0
movq %rax, -0x478(%rbp)
leaq -0x470(%rbp), %rdi
leaq -0x478(%rbp), %rsi
callq 0x9920
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x959(%rbp)
jne 0x84e7
jmp 0x858d
movq -0x7c0(%rbp), %rdi
addq $0x70, %rdi
leaq -0x38(%rbp), %rsi
callq 0x9790
movq %rax, -0x970(%rbp)
jmp 0x8504
movq -0x970(%rbp), %rax
movq %rax, -0x480(%rbp)
leaq -0x480(%rbp), %rdi
callq 0x9820
movq %rax, %rdi
addq $0x20, %rdi
callq 0x2d30
movq -0x7c0(%rbp), %rdi
movq %rax, -0x980(%rbp)
addq $0xa8, %rdi
leaq -0x38(%rbp), %rsi
callq 0x9790
movq %rax, -0x978(%rbp)
jmp 0x8551
movq -0x978(%rbp), %rax
movq %rax, -0x488(%rbp)
leaq -0x488(%rbp), %rdi
callq 0x9820
movq %rax, %rdi
addq $0x20, %rdi
callq 0x2d30
movq %rax, %rcx
movq -0x980(%rbp), %rax
cmpq %rcx, %rax
sete %al
movb %al, -0x959(%rbp)
movb -0x959(%rbp), %al
movb %al, -0x949(%rbp)
movb -0x949(%rbp), %al
testb $0x1, %al
jne 0x85a5
jmp 0x85ca
movq 0x10a34(%rip), %rax     # 0x18fe0
movq (%rax), %rdi
movl -0x64(%rbp), %edx
leaq 0x7dc8(%rip), %rsi      # 0x10381
movb $0x0, %al
callq 0x2280
movl $0x1, %edi
callq 0x2220
movq -0x7c0(%rbp), %rdi
addq $0xa8, %rdi
leaq -0x38(%rbp), %rsi
callq 0x9790
movq %rax, -0x988(%rbp)
jmp 0x85ea
movq -0x7c0(%rbp), %rdi
movq -0x988(%rbp), %rax
movq %rax, -0x490(%rbp)
addq $0xa8, %rdi
callq 0x97f0
movq %rax, -0x498(%rbp)
leaq -0x490(%rbp), %rdi
leaq -0x498(%rbp), %rsi
callq 0x97c0
testb $0x1, %al
jne 0x862e
jmp 0x8710
movq -0x7c0(%rbp), %rax
addq $0xa8, %rax
movq %rax, -0x998(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x4f0(%rbp)
movq $0x0, -0x4e0(%rbp)
leaq -0x4f0(%rbp), %rdi
movq %rdi, -0x990(%rbp)
callq 0x3d50
movq -0x990(%rbp), %rdx
leaq -0x4d0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x9990
jmp 0x8683
movq -0x998(%rbp), %rdi
leaq -0x4d0(%rbp), %rsi
callq 0x9950
movb %dl, -0x9a1(%rbp)
movq %rax, -0x9a0(%rbp)
jmp 0x86a5
movb -0x9a1(%rbp), %al
movq -0x9a0(%rbp), %rcx
movq %rcx, -0x500(%rbp)
movb %al, -0x4f8(%rbp)
leaq -0x4d0(%rbp), %rdi
callq 0x99f0
leaq -0x4f0(%rbp), %rdi
callq 0x3e70
jmp 0x8710
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x86ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x4d0(%rbp), %rdi
callq 0x99f0
leaq -0x4f0(%rbp), %rdi
callq 0x3e70
jmp 0x8ddc
movq -0x7c0(%rbp), %rdi
addq $0xa8, %rdi
leaq -0x38(%rbp), %rsi
callq 0x9790
movq %rax, -0x9b0(%rbp)
jmp 0x8730
movq -0x9b0(%rbp), %rax
movq %rax, -0x508(%rbp)
leaq -0x508(%rbp), %rdi
callq 0x9820
addq $0x20, %rax
movq %rax, -0x9c0(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x80(%rbp), %rdi
callq 0x96c0
movq %rax, -0x9b8(%rbp)
jmp 0x876b
movq -0x9b8(%rbp), %rsi
movq -0x9c0(%rbp), %rdi
callq 0x2710
jmp 0x8780
jmp 0x87b1
cmpl $0x3, -0x14(%rbp)
jne 0x878a
jmp 0x87af
movq 0x1084f(%rip), %rax     # 0x18fe0
movq (%rax), %rdi
movl -0x64(%rbp), %edx
leaq 0x7c0b(%rip), %rsi      # 0x103a9
movb $0x0, %al
callq 0x2280
movl $0x1, %edi
callq 0x2220
jmp 0x87b1
jmp 0x8dce
cmpl $0x1, -0x14(%rbp)
jne 0x8b4b
leaq -0x80(%rbp), %rdi
callq 0x2d30
cmpq $0x2, %rax
jbe 0x87fb
movq 0x1080a(%rip), %rax     # 0x18fe0
movq (%rax), %rdi
movl -0x64(%rbp), %edx
leaq 0x7bea(%rip), %rsi      # 0x103cd
leaq 0x7c04(%rip), %rcx      # 0x103ee
movb $0x0, %al
callq 0x2280
movl $0x1, %edi
callq 0x2220
xorl %eax, %eax
movl %eax, %esi
leaq -0x80(%rbp), %rdi
callq 0x96c0
movq %rax, -0x9c8(%rbp)
jmp 0x8811
movq -0x9c8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2040
movl %eax, -0x9cc(%rbp)
jmp 0x8829
movl -0x9cc(%rbp), %eax
cmpl $0x0, %eax
jne 0x885d
movq 0x107a5(%rip), %rax     # 0x18fe0
movq (%rax), %rdi
movl -0x64(%rbp), %edx
movq -0x60(%rbp), %rcx
leaq 0x7bbf(%rip), %rsi      # 0x1040b
movb $0x0, %al
callq 0x2280
movl $0x1, %edi
callq 0x2220
movq -0x7c0(%rbp), %rdi
addq $0x38, %rdi
leaq -0x38(%rbp), %rsi
callq 0x9a50
movq %rax, -0x9d8(%rbp)
jmp 0x887a
movq -0x7c0(%rbp), %rdi
movq -0x9d8(%rbp), %rax
movq %rax, -0x510(%rbp)
addq $0x38, %rdi
callq 0x9a80
movq %rax, -0x518(%rbp)
leaq -0x510(%rbp), %rdi
leaq -0x518(%rbp), %rsi
callq 0x9a20
testb $0x1, %al
jne 0x88bb
jmp 0x899b
movq -0x7c0(%rbp), %rax
addq $0x38, %rax
movq %rax, -0x9e8(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x570(%rbp)
movq $0x0, -0x560(%rbp)
leaq -0x570(%rbp), %rdi
movq %rdi, -0x9e0(%rbp)
callq 0x9af0
movq -0x9e0(%rbp), %rdx
leaq -0x550(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x9b10
jmp 0x890e
movq -0x9e8(%rbp), %rdi
leaq -0x550(%rbp), %rsi
callq 0x9ab0
movb %dl, -0x9f1(%rbp)
movq %rax, -0x9f0(%rbp)
jmp 0x8930
movb -0x9f1(%rbp), %al
movq -0x9f0(%rbp), %rcx
movq %rcx, -0x580(%rbp)
movb %al, -0x578(%rbp)
leaq -0x550(%rbp), %rdi
callq 0x9b70
leaq -0x570(%rbp), %rdi
callq 0x9ba0
jmp 0x899b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x898a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x550(%rbp), %rdi
callq 0x9b70
leaq -0x570(%rbp), %rdi
callq 0x9ba0
jmp 0x8ddc
leaq -0x80(%rbp), %rdi
callq 0x2d30
cmpq $0x1, %rax
jne 0x8a63
movq -0x7c0(%rbp), %rdi
addq $0x38, %rdi
leaq -0x38(%rbp), %rsi
callq 0x9a50
movq %rax, -0xa00(%rbp)
jmp 0x89cb
movq -0xa00(%rbp), %rax
movq %rax, -0x588(%rbp)
leaq -0x588(%rbp), %rdi
callq 0x9c00
addq $0x20, %rax
movq %rax, -0xa10(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x80(%rbp), %rdi
callq 0x96c0
movq %rax, -0xa08(%rbp)
jmp 0x8a06
leaq -0x5a8(%rbp), %rdi
movl $0x64, %esi
callq 0x9cb0
jmp 0x8a19
movq -0xa08(%rbp), %rsi
movq -0xa10(%rbp), %rdi
leaq -0x5a8(%rbp), %rdx
callq 0x9c30
jmp 0x8a35
leaq -0x5a8(%rbp), %rdi
callq 0x2150
jmp 0x8b49
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x5a8(%rbp), %rdi
callq 0x2150
jmp 0x8ddc
leaq -0x80(%rbp), %rdi
movl $0x1, %esi
callq 0x96c0
movq %rax, -0xa18(%rbp)
jmp 0x8a7a
movq -0xa18(%rbp), %rdi
leaq 0x79ad(%rip), %rsi      # 0x10435
xorl %eax, %eax
movl %eax, %edx
callq 0x2130
cmpq $-0x1, %rax
je 0x8abc
movq 0x10542(%rip), %rax     # 0x18fe0
movq (%rax), %rdi
movl -0x64(%rbp), %edx
leaq 0x7995(%rip), %rsi      # 0x10440
movb $0x0, %al
callq 0x2280
movl $0x1, %edi
callq 0x2220
movq -0x7c0(%rbp), %rdi
addq $0x38, %rdi
leaq -0x38(%rbp), %rsi
callq 0x9a50
movq %rax, -0xa20(%rbp)
jmp 0x8ad9
movq -0xa20(%rbp), %rax
movq %rax, -0x5b0(%rbp)
leaq -0x5b0(%rbp), %rdi
callq 0x9c00
addq $0x20, %rax
movq %rax, -0xa30(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x80(%rbp), %rdi
callq 0x96c0
movq %rax, -0xa28(%rbp)
jmp 0x8b14
leaq -0x80(%rbp), %rdi
movl $0x1, %esi
callq 0x96c0
movq %rax, -0xa38(%rbp)
jmp 0x8b2b
movq -0xa38(%rbp), %rdx
movq -0xa28(%rbp), %rsi
movq -0xa30(%rbp), %rdi
callq 0x9dd0
jmp 0x8b47
jmp 0x8b49
jmp 0x8b70
movq 0x1048e(%rip), %rax     # 0x18fe0
movq (%rax), %rdi
movl -0x64(%rbp), %edx
leaq 0x7907(%rip), %rsi      # 0x10466
movb $0x0, %al
callq 0x2280
movl $0x1, %edi
callq 0x2220
jmp 0x8dce
jmp 0x8dce
jmp 0x8dce
movl $0x3, -0x14(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x2d30
cmpq $0x1, %rax
je 0x8bba
movq 0x10444(%rip), %rax     # 0x18fe0
movq (%rax), %rdi
movl -0x64(%rbp), %edx
leaq 0x78e1(%rip), %rsi      # 0x1048a
movb $0x0, %al
callq 0x2280
movl $0x1, %edi
callq 0x2220
xorl %eax, %eax
movl %eax, %esi
leaq -0x80(%rbp), %rdi
callq 0x96c0
movq %rax, -0xa40(%rbp)
jmp 0x8bd0
movq -0xa40(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x2050
jmp 0x8be2
movq -0x7c0(%rbp), %rdi
addq $0xe0, %rdi
leaq -0x38(%rbp), %rsi
callq 0x4130
movq %rax, -0xa48(%rbp)
jmp 0x8c02
movq -0x7c0(%rbp), %rdi
movq -0xa48(%rbp), %rax
movq %rax, -0x5b8(%rbp)
addq $0xe0, %rdi
callq 0x4160
movq %rax, -0x5c0(%rbp)
leaq -0x5b8(%rbp), %rdi
leaq -0x5c0(%rbp), %rsi
callq 0x9700
testb $0x1, %al
jne 0x8c43
jmp 0x8c68
movq 0x10396(%rip), %rax     # 0x18fe0
movq (%rax), %rdi
movl -0x64(%rbp), %edx
leaq 0x7855(%rip), %rsi      # 0x104ac
movb $0x0, %al
callq 0x2280
movl $0x1, %edi
callq 0x2220
movq -0x7c0(%rbp), %rax
addq $0xe0, %rax
movq %rax, -0xa58(%rbp)
leaq -0x621(%rbp), %rdi
movq %rdi, -0xa50(%rbp)
callq 0x2310
movq -0xa50(%rbp), %rdx
leaq 0x7676(%rip), %rsi      # 0x10313
leaq -0x620(%rbp), %rdi
callq 0x2260
jmp 0x8cab
leaq -0x600(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x620(%rbp), %rdx
callq 0x9750
jmp 0x8cc4
movq -0xa58(%rbp), %rdi
leaq -0x600(%rbp), %rsi
callq 0x4030
movb %dl, -0xa61(%rbp)
movq %rax, -0xa60(%rbp)
jmp 0x8ce6
movb -0xa61(%rbp), %al
movq -0xa60(%rbp), %rcx
movq %rcx, -0x638(%rbp)
movb %al, -0x630(%rbp)
leaq -0x600(%rbp), %rdi
callq 0x40d0
leaq -0x620(%rbp), %rdi
callq 0x2150
leaq -0x621(%rbp), %rdi
callq 0x21f0
jmp 0x8dce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x8d69
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x8d5d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x600(%rbp), %rdi
callq 0x40d0
leaq -0x620(%rbp), %rdi
callq 0x2150
leaq -0x621(%rbp), %rdi
callq 0x21f0
jmp 0x8ddc
cmpl $0x3, -0x14(%rbp)
jne 0x8d7f
jmp 0x8da4
movq 0x1025a(%rip), %rax     # 0x18fe0
movq (%rax), %rdi
movl -0x64(%rbp), %edx
leaq 0x7743(%rip), %rsi      # 0x104d6
movb $0x0, %al
callq 0x2280
movl $0x1, %edi
callq 0x2220
jmp 0x8dce
jmp 0x8dce
movq 0x10231(%rip), %rax     # 0x18fe0
movq (%rax), %rdi
movsbl -0x65(%rbp), %edx
leaq 0x773d(%rip), %rsi      # 0x104fa
movb $0x0, %al
callq 0x2280
movl $0x1, %edi
callq 0x2220
leaq -0x80(%rbp), %rdi
callq 0x3e70
jmp 0x737f
leaq -0x80(%rbp), %rdi
callq 0x3e70
jmp 0x9581
movq -0x7c0(%rbp), %rdi
callq 0x9e50
movq %rax, -0x640(%rbp)
movl $0x1, -0x644(%rbp)
movq 0x101ba(%rip), %rax     # 0x18fc8
movq (%rax), %rdi
leaq 0x76fe(%rip), %rsi      # 0x10516
movb $0x0, %al
callq 0x2280
movq -0x7c0(%rbp), %rdi
callq 0x4160
movq %rax, -0x650(%rbp)
leaq -0x640(%rbp), %rdi
leaq -0x650(%rbp), %rsi
callq 0x9700
testb $0x1, %al
jne 0x8e4e
jmp 0x93c4
leaq -0x640(%rbp), %rdi
callq 0x7210
movq %rax, %rsi
leaq -0x670(%rbp), %rdi
callq 0x20d0
jmp 0x8e6b
leaq -0x640(%rbp), %rdi
callq 0x7210
movq %rax, %rsi
addq $0x20, %rsi
leaq -0x690(%rbp), %rdi
callq 0x20d0
jmp 0x8e8c
leaq -0x640(%rbp), %rdi
xorl %esi, %esi
movl %esi, -0xa94(%rbp)
callq 0x9e80
movq %rax, -0x698(%rbp)
movq 0x1011a(%rip), %rax     # 0x18fc8
movq %rax, -0xa90(%rbp)
movq (%rax), %rax
movq %rax, -0xaa0(%rbp)
movl -0x644(%rbp), %eax
movl %eax, -0xa98(%rbp)
incl %eax
movl %eax, -0x644(%rbp)
leaq -0x670(%rbp), %rdi
movq %rdi, -0xa78(%rbp)
callq 0x20c0
movq -0xaa0(%rbp), %rdi
movl -0xa98(%rbp), %edx
movq %rax, %rcx
movl -0xa94(%rbp), %eax
leaq 0x7621(%rip), %rsi      # 0x10524
movb %al, -0xa79(%rbp)
callq 0x2280
movq -0xa90(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xa88(%rbp)
leaq -0x690(%rbp), %rdi
callq 0x20c0
movq -0xa88(%rbp), %rdi
movq %rax, %rdx
movb -0xa79(%rbp), %al
leaq 0x74a9(%rip), %rsi      # 0x103eb
callq 0x2280
movq -0x7c0(%rbp), %rdi
movq -0xa78(%rbp), %rsi
addq $0x38, %rdi
callq 0x9a50
movq %rax, -0xa70(%rbp)
jmp 0x8f67
movq -0x7c0(%rbp), %rdi
movq -0xa70(%rbp), %rax
movq %rax, -0x6a0(%rbp)
addq $0x38, %rdi
callq 0x9a80
movq %rax, -0x6a8(%rbp)
leaq -0x6a0(%rbp), %rdi
leaq -0x6a8(%rbp), %rsi
callq 0x9eb0
testb $0x1, %al
jne 0x8fa8
jmp 0x9140
movq 0x10019(%rip), %rax     # 0x18fc8
movq (%rax), %rdi
leaq 0x7573(%rip), %rsi      # 0x1052c
xorl %eax, %eax
callq 0x2280
movq -0x7c0(%rbp), %rdi
addq $0x38, %rdi
leaq -0x670(%rbp), %rsi
callq 0x9a50
movq %rax, -0xaa8(%rbp)
jmp 0x8fe0
movq -0xaa8(%rbp), %rax
movq %rax, -0x6c8(%rbp)
leaq -0x6c8(%rbp), %rdi
callq 0x9c00
movq %rax, %rsi
addq $0x20, %rsi
leaq -0x6c0(%rbp), %rdi
callq 0x9ee0
jmp 0x900f
movq $0x0, -0x6d0(%rbp)
movq -0x6d0(%rbp), %rax
movq %rax, -0xab0(%rbp)
leaq -0x6c0(%rbp), %rdi
callq 0x9fd0
movq %rax, %rcx
movq -0xab0(%rbp), %rax
cmpq %rcx, %rax
jae 0x9134
movq 0xff7a(%rip), %rax      # 0x18fc8
movq (%rax), %rax
movq %rax, -0xac0(%rbp)
movq -0x6d0(%rbp), %rsi
leaq -0x6c0(%rbp), %rdi
callq 0xa010
movq %rax, -0xab8(%rbp)
jmp 0x9074
movq -0xab8(%rbp), %rdi
callq 0x9ff0
movq %rax, %rdi
callq 0x20c0
movq %rax, -0xad0(%rbp)
movq -0x6d0(%rbp), %rsi
leaq -0x6c0(%rbp), %rdi
callq 0xa010
movq %rax, -0xac8(%rbp)
jmp 0x90ab
movq -0xac8(%rbp), %rdi
callq 0xa050
movq %rax, %rdi
callq 0x20c0
movq -0xac0(%rbp), %rdi
movq -0xad0(%rbp), %rdx
movq %rax, %rcx
leaq 0x7464(%rip), %rsi      # 0x1053b
movb $0x0, %al
callq 0x2280
movq -0x6d0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x6d0(%rbp)
jmp 0x901a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x93b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x93a7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x6c0(%rbp), %rdi
callq 0x9ba0
jmp 0x93a7
leaq -0x6c0(%rbp), %rdi
callq 0x9ba0
movq -0x7c0(%rbp), %rdi
addq $0x70, %rdi
leaq -0x670(%rbp), %rsi
callq 0x9790
movq %rax, -0xad8(%rbp)
jmp 0x9160
movq -0x7c0(%rbp), %rdi
movq -0xad8(%rbp), %rax
movq %rax, -0x6d8(%rbp)
addq $0x70, %rdi
callq 0x97f0
movq %rax, -0x6e0(%rbp)
leaq -0x6d8(%rbp), %rdi
leaq -0x6e0(%rbp), %rsi
callq 0x97c0
testb $0x1, %al
jne 0x919e
jmp 0x91ad
movl $0x5, -0x6e4(%rbp)
jmp 0x936d
movq 0xfe14(%rip), %rax      # 0x18fc8
movq (%rax), %rdi
leaq 0x7390(%rip), %rsi      # 0x1054e
xorl %eax, %eax
callq 0x2280
movq -0x7c0(%rbp), %rdi
addq $0x70, %rdi
leaq -0x670(%rbp), %rsi
callq 0xa070
movq %rax, -0xae0(%rbp)
jmp 0x91e5
movq -0xae0(%rbp), %rsi
leaq -0x700(%rbp), %rdi
callq 0xa0a0
jmp 0x91fa
movq -0x7c0(%rbp), %rdi
addq $0xa8, %rdi
leaq -0x670(%rbp), %rsi
callq 0xa070
movq %rax, -0xae8(%rbp)
jmp 0x921d
movq -0xae8(%rbp), %rsi
leaq -0x718(%rbp), %rdi
callq 0xa0a0
jmp 0x9232
movq $0x0, -0x720(%rbp)
movq -0x720(%rbp), %rax
movq %rax, -0xaf0(%rbp)
leaq -0x700(%rbp), %rdi
callq 0x2d30
movq %rax, %rcx
movq -0xaf0(%rbp), %rax
cmpq %rcx, %rax
jae 0x934b
movq 0xfd57(%rip), %rax      # 0x18fc8
movq (%rax), %rax
movq %rax, -0xb00(%rbp)
movq -0x720(%rbp), %rsi
leaq -0x700(%rbp), %rdi
callq 0x96c0
movq %rax, -0xaf8(%rbp)
jmp 0x9297
movq -0xaf8(%rbp), %rdi
callq 0x20c0
movq -0xb00(%rbp), %rdi
movq %rax, %rdx
leaq 0x72b2(%rip), %rsi      # 0x10566
xorl %eax, %eax
callq 0x2280
movq 0xfd06(%rip), %rax      # 0x18fc8
movq (%rax), %rax
movq %rax, -0xb10(%rbp)
movq -0x720(%rbp), %rsi
leaq -0x718(%rbp), %rdi
callq 0x96c0
movq %rax, -0xb08(%rbp)
jmp 0x92e8
movq -0xb08(%rbp), %rdi
callq 0x20c0
movq -0xb10(%rbp), %rdi
movq %rax, %rdx
leaq 0x726f(%rip), %rsi      # 0x10574
movb $0x0, %al
callq 0x2280
movq -0x720(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x720(%rbp)
jmp 0x923d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x939b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x718(%rbp), %rdi
callq 0x3e70
jmp 0x939b
leaq -0x718(%rbp), %rdi
callq 0x3e70
leaq -0x700(%rbp), %rdi
callq 0x3e70
movl $0x0, -0x6e4(%rbp)
leaq -0x690(%rbp), %rdi
callq 0x2150
leaq -0x670(%rbp), %rdi
callq 0x2150
movl -0x6e4(%rbp), %eax
testl %eax, %eax
je 0x9396
jmp 0x9391
jmp 0x8e1f
jmp 0x8e1f
leaq -0x700(%rbp), %rdi
callq 0x3e70
leaq -0x690(%rbp), %rdi
callq 0x2150
leaq -0x670(%rbp), %rdi
callq 0x2150
jmp 0x9581
movq 0xfbfd(%rip), %rax      # 0x18fc8
movq (%rax), %rdi
leaq 0x71ab(%rip), %rsi      # 0x10580
movb $0x0, %al
callq 0x2280
movq -0x7c0(%rbp), %rdi
addq $0xe0, %rdi
callq 0x9e50
movq %rax, -0x728(%rbp)
movl $0x1, -0x72c(%rbp)
movq -0x7c0(%rbp), %rdi
addq $0xe0, %rdi
callq 0x4160
movq %rax, -0x738(%rbp)
leaq -0x728(%rbp), %rdi
leaq -0x738(%rbp), %rsi
callq 0x9700
testb $0x1, %al
jne 0x9436
jmp 0x9545
leaq -0x728(%rbp), %rdi
callq 0x7210
movq %rax, %rsi
leaq -0x758(%rbp), %rdi
callq 0x20d0
jmp 0x9453
leaq -0x728(%rbp), %rdi
callq 0x7210
movq %rax, %rsi
addq $0x20, %rsi
leaq -0x778(%rbp), %rdi
callq 0x20d0
jmp 0x9474
leaq -0x728(%rbp), %rdi
xorl %esi, %esi
callq 0x9e80
movq %rax, -0x780(%rbp)
movq 0xfb38(%rip), %rax      # 0x18fc8
movq (%rax), %rax
movq %rax, -0xb28(%rbp)
movl -0x72c(%rbp), %eax
movl %eax, -0xb1c(%rbp)
addl $0x1, %eax
movl %eax, -0x72c(%rbp)
leaq -0x758(%rbp), %rdi
callq 0x20c0
movq -0xb28(%rbp), %rdi
movl -0xb1c(%rbp), %edx
movq %rax, %rcx
leaq 0x7052(%rip), %rsi      # 0x10524
movb $0x0, %al
callq 0x2280
movq 0xfae8(%rip), %rax      # 0x18fc8
movq (%rax), %rax
movq %rax, -0xb18(%rbp)
leaq -0x778(%rbp), %rdi
callq 0x20c0
movq -0xb18(%rbp), %rdi
movq %rax, %rdx
leaq 0x6ee4(%rip), %rsi      # 0x103eb
movb $0x0, %al
callq 0x2280
leaq -0x778(%rbp), %rdi
callq 0x2150
leaq -0x758(%rbp), %rdi
callq 0x2150
jmp 0x9400
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x758(%rbp), %rdi
callq 0x2150
jmp 0x9581
movq 0xfa7c(%rip), %rax      # 0x18fc8
movq (%rax), %rdi
leaq 0x7037(%rip), %rsi      # 0x1058d
movb $0x0, %al
callq 0x2280
movq -0x58(%rbp), %rdi
callq 0x2210
movq -0x60(%rbp), %rdi
callq 0x2210
leaq -0x38(%rbp), %rdi
callq 0x2150
addq $0xb30, %rsp            # imm = 0xB30
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x2150
movq -0x7b0(%rbp), %rdi
callq 0xa190
movq -0x7b8(%rbp), %rdi
callq 0x3ed0
movq -0x790(%rbp), %rdi
callq 0xa1b0
movq -0x798(%rbp), %rdi
callq 0xa1b0
movq -0x7a0(%rbp), %rdi
callq 0xa1d0
movq -0x7a8(%rbp), %rdi
callq 0x3ed0
movq -0x48(%rbp), %rdi
callq 0x2300
nopl (%rax,%rax)