nodes: 0, module; 1, function_definition; 2, function_name:_job_sorting_key; 3, parameters; 4, block; 5, identifier:self; 6, identifier:job; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, try_statement; 11, try_statement; 12, return_statement; 13, comment:"""
          Get the sorting key of a VFGJob instance.
  
          :param VFGJob job: the VFGJob object.
          :return: An integer that determines the order of this job in the queue.
          :rtype: int
          """; 14, assignment; 15, assignment; 16, block; 17, except_clause; 18, block; 19, except_clause; 20, binary_operator:block_in_function_pos + MAX_BLOCKS_PER_FUNCTION * function_pos; 21, identifier:MAX_BLOCKS_PER_FUNCTION; 22, integer:1000000; 23, identifier:task_functions; 24, call; 25, expression_statement; 26, identifier:ValueError; 27, comment:# not in the list; 28, comment:# it might be because we followed the wrong path, or there is a bug in the traversal algorithm; 29, comment:# anyways, do it first; 30, block; 31, expression_statement; 32, identifier:ValueError; 33, comment:# block not found. what?; 34, block; 35, identifier:block_in_function_pos; 36, binary_operator:MAX_BLOCKS_PER_FUNCTION * function_pos; 37, identifier:list; 38, argument_list; 39, assignment; 40, expression_statement; 41, return_statement; 42, assignment; 43, expression_statement; 44, identifier:MAX_BLOCKS_PER_FUNCTION; 45, identifier:function_pos; 46, call; 47, identifier:function_pos; 48, call; 49, call; 50, integer:0; 51, identifier:block_in_function_pos; 52, call; 53, assignment; 54, identifier:reversed; 55, argument_list; 56, attribute; 57, argument_list; 58, attribute; 59, argument_list; 60, attribute; 61, argument_list; 62, identifier:block_in_function_pos; 63, call; 64, call; 65, identifier:task_functions; 66, identifier:index; 67, attribute; 68, identifier:l; 69, identifier:warning; 70, string; 71, attribute; 72, call; 73, identifier:index; 74, attribute; 75, identifier:min; 76, argument_list; 77, identifier:list; 78, generator_expression; 79, identifier:job; 80, identifier:func_addr; 81, string_content:Function address %#x is not found in task stack.; 82, identifier:job; 83, identifier:func_addr; 84, attribute; 85, argument_list; 86, identifier:job; 87, identifier:addr; 88, binary_operator:job.addr - job.func_addr; 89, binary_operator:MAX_BLOCKS_PER_FUNCTION - 1; 90, attribute; 91, for_in_clause; 92, if_clause; 93, identifier:self; 94, identifier:_ordered_node_addrs; 95, attribute; 96, attribute; 97, attribute; 98, identifier:MAX_BLOCKS_PER_FUNCTION; 99, integer:1; 100, identifier:task; 101, identifier:function_address; 102, identifier:task; 103, attribute; 104, call; 105, identifier:job; 106, identifier:func_addr; 107, identifier:job; 108, identifier:addr; 109, identifier:job; 110, identifier:func_addr; 111, identifier:self; 112, identifier:_task_stack; 113, identifier:isinstance; 114, argument_list; 115, identifier:task; 116, identifier:FunctionAnalysis
code: def _job_sorting_key(self, job):
          """
          Get the sorting key of a VFGJob instance.
  
          :param VFGJob job: the VFGJob object.
          :return: An integer that determines the order of this job in the queue.
          :rtype: int
          """
  
          MAX_BLOCKS_PER_FUNCTION = 1000000
  
          task_functions = list(reversed(
              list(task.function_address for task in self._task_stack if isinstance(task, FunctionAnalysis))
              ))
          try:
              function_pos = task_functions.index(job.func_addr)
          except ValueError:
              # not in the list
              # it might be because we followed the wrong path, or there is a bug in the traversal algorithm
              # anyways, do it first
              l.warning('Function address %#x is not found in task stack.', job.func_addr)
              return 0
  
          try:
              block_in_function_pos = self._ordered_node_addrs(job.func_addr).index(job.addr)
          except ValueError:
              # block not found. what?
              block_in_function_pos = min(job.addr - job.func_addr, MAX_BLOCKS_PER_FUNCTION - 1)
  
          return block_in_function_pos + MAX_BLOCKS_PER_FUNCTION * function_pos