static long rdg_bio_ctrl(BIO* bio, int cmd, long arg1, void* arg2)
{
	long status = -1;
	rdpRdg* rdg = (rdpRdg*)BIO_get_data(bio);
	rdpTls* tlsOut = rdg->tlsOut;
	rdpTls* tlsIn = rdg->tlsIn;

	if (cmd == BIO_CTRL_FLUSH)
	{
		(void)BIO_flush(tlsOut->bio);
		(void)BIO_flush(tlsIn->bio);
		status = 1;
	}
	else if (cmd == BIO_C_SET_NONBLOCK)
	{
		status = 1;
	}
	else if (cmd == BIO_C_READ_BLOCKED)
	{
		BIO* bio = tlsOut->bio;
		status = BIO_read_blocked(bio);
	}
	else if (cmd == BIO_C_WRITE_BLOCKED)
	{
		BIO* bio = tlsIn->bio;
		status = BIO_write_blocked(bio);
	}
	else if (cmd == BIO_C_WAIT_READ)
	{
		int timeout = (int)arg1;
		BIO* bio = tlsOut->bio;

		if (BIO_read_blocked(bio))
			return BIO_wait_read(bio, timeout);
		else if (BIO_write_blocked(bio))
			return BIO_wait_write(bio, timeout);
		else
			status = 1;
	}
	else if (cmd == BIO_C_WAIT_WRITE)
	{
		int timeout = (int)arg1;
		BIO* bio = tlsIn->bio;

		if (BIO_write_blocked(bio))
			status = BIO_wait_write(bio, timeout);
		else if (BIO_read_blocked(bio))
			status = BIO_wait_read(bio, timeout);
		else
			status = 1;
	}
	else if (cmd == BIO_C_GET_EVENT || cmd == BIO_C_GET_FD)
	{
		/*
		 * A note about BIO_C_GET_FD:
		 * Even if two FDs are part of RDG, only one FD can be returned here.
		 *
		 * In FreeRDP, BIO FDs are only used for polling, so it is safe to use the outgoing FD only
		 *
		 * See issue #3602
		 */
		status = BIO_ctrl(tlsOut->bio, cmd, arg1, arg2);
	}

	return status;
}


static struct task_struct *dup_task_struct(struct task_struct *orig)
{
	struct task_struct *tsk;
	struct thread_info *ti;
	int err;

	prepare_to_copy(orig);

	tsk = alloc_task_struct();
	if (!tsk)
		return NULL;

	ti = alloc_thread_info(tsk);
	if (!ti) {
		free_task_struct(tsk);
		return NULL;
	}

 	err = arch_dup_task_struct(tsk, orig);
	if (err)
		goto out;

	tsk->stack = ti;

	err = prop_local_init_single(&tsk->dirties);
	if (err)
		goto out;

	setup_thread_stack(tsk, orig);

#ifdef CONFIG_CC_STACKPROTECTOR
	tsk->stack_canary = get_random_int();
#endif

	/* One for us, one for whoever does the "release_task()" (usually parent) */
	atomic_set(&tsk->usage,2);
	atomic_set(&tsk->fs_excl, 0);
#ifdef CONFIG_BLK_DEV_IO_TRACE
	tsk->btrace_seq = 0;
#endif
	tsk->splice_pipe = NULL;
	return tsk;

out:
	free_thread_info(ti);
	free_task_struct(tsk);
	return NULL;
}


bool BrowserView::GetSavedWindowPlacement(
    const views::Widget* widget,
    gfx::Rect* bounds,
    ui::WindowShowState* show_state) const {
  chrome::GetSavedWindowBoundsAndShowState(browser_.get(), bounds, show_state);

  if (chrome::SavedBoundsAreContentBounds(browser_.get())) {
    if (IsToolbarVisible()) {
      bounds->set_height(
          bounds->height() + toolbar_->GetPreferredSize().height());
    }

    gfx::Rect window_rect = frame_->non_client_view()->
        GetWindowBoundsForClientBounds(*bounds);
    window_rect.set_origin(bounds->origin());

    if (window_rect.x() == 0 && window_rect.y() == 0) {
      gfx::Size size = window_rect.size();
      window_rect.set_origin(WindowSizer::GetDefaultPopupOrigin(size));
    }

    *bounds = window_rect;
    *show_state = ui::SHOW_STATE_NORMAL;
  }

  return true;
}


DNSRequest::~DNSRequest()
{
	delete[] res;
}


static int fz_cmp_link_key ( fz_context * ctx , void * k0_ , void * k1_ ) {
 fz_link_key * k0 = ( fz_link_key * ) k0_ ;
 fz_link_key * k1 = ( fz_link_key * ) k1_ ;
 return k0 -> proof == k1 -> proof && k0 -> src_extras == k1 -> src_extras && k0 -> dst_extras == k1 -> dst_extras && k0 -> copy_spots == k1 -> copy_spots && k0 -> depth == k1 -> depth && k0 -> rend . bp == k1 -> rend . bp && k0 -> rend . ri == k1 -> rend . ri && memcmp ( k0 -> dst_md5 , k1 -> dst_md5 , 16 ) == 0 && memcmp ( k0 -> src_md5 , k1 -> src_md5 , 16 ) ;
 }


void jpc_pchglist_destroy(jpc_pchglist_t *pchglist)
{
	int pchgno;
	if (pchglist->pchgs) {
		for (pchgno = 0; pchgno < pchglist->numpchgs; ++pchgno) {
			jpc_pchg_destroy(pchglist->pchgs[pchgno]);
		}
		jas_free(pchglist->pchgs);
	}
	jas_free(pchglist);
}


server_request_session(void)
{
	Channel *c;

	debug("input_session_request");
	packet_check_eom();

	if (no_more_sessions) {
		packet_disconnect("Possible attack: attempt to open a session "
		    "after additional sessions disabled");
	}

	/*
	 * A server session has no fd to read or write until a
	 * CHANNEL_REQUEST for a shell is made, so we set the type to
	 * SSH_CHANNEL_LARVAL.  Additionally, a callback for handling all
	 * CHANNEL_REQUEST messages is registered.
	 */
	c = channel_new("session", SSH_CHANNEL_LARVAL,
	    -1, -1, -1, /*window size*/0, CHAN_SES_PACKET_DEFAULT,
	    0, "server-session", 1);
	if (session_open(the_authctxt, c->self) != 1) {
		debug("session open failed, free channel %d", c->self);
		channel_free(c);
		return NULL;
	}
	channel_register_cleanup(c->self, session_close_by_channel, 0);
	return c;
}


static wifi_error wifi_stop_rssi_monitoring(wifi_request_id id, wifi_interface_handle iface)
{
    ALOGD("Stopping RSSI monitor");

 if(id == -1) {
        wifi_rssi_event_handler handler;
        s8 max_rssi = 0, min_rssi = 0;
        wifi_handle handle = getWifiHandle(iface);
        memset(&handler, 0, sizeof(handler));
 SetRSSIMonitorCommand *cmd = new SetRSSIMonitorCommand(id, iface,
                                                    max_rssi, min_rssi, handler);
        cmd->cancel();
        cmd->releaseRef();
 return WIFI_SUCCESS;
 }
 return wifi_cancel_cmd(id, iface);
}


  void ClearDisposableWallpaperCache() {
    WallpaperManager::Get()->ClearDisposableWallpaperCache();
  }


static void pdf_run_Tw ( fz_context * ctx , pdf_processor * proc , float wordspace ) {
 pdf_run_processor * pr = ( pdf_run_processor * ) proc ;
 pdf_gstate * gstate = pr -> gstate + pr -> gtop ;
 gstate -> text . word_space = wordspace ;
 }


static int manage_rcvq(struct hfi1_ctxtdata *uctxt, unsigned subctxt,
		       int start_stop)
{
	struct hfi1_devdata *dd = uctxt->dd;
	unsigned int rcvctrl_op;

	if (subctxt)
		goto bail;
	/* atomically clear receive enable ctxt. */
	if (start_stop) {
		/*
		 * On enable, force in-memory copy of the tail register to
		 * 0, so that protocol code doesn't have to worry about
		 * whether or not the chip has yet updated the in-memory
		 * copy or not on return from the system call. The chip
		 * always resets it's tail register back to 0 on a
		 * transition from disabled to enabled.
		 */
		if (uctxt->rcvhdrtail_kvaddr)
			clear_rcvhdrtail(uctxt);
		rcvctrl_op = HFI1_RCVCTRL_CTXT_ENB;
	} else {
		rcvctrl_op = HFI1_RCVCTRL_CTXT_DIS;
	}
	hfi1_rcvctrl(dd, rcvctrl_op, uctxt->ctxt);
	/* always; new head should be equal to new tail; see above */
bail:
	return 0;
}


const base::Time& BaseNode::GetModificationTime() const {
int64 BaseNode::GetModificationTime() const {
   return GetEntry()->Get(syncable::MTIME);
 }


void xps_parse_path ( xps_document * doc , const fz_matrix * ctm , char * base_uri , xps_resource * dict , fz_xml * root ) {
 fz_xml * node ;
 char * fill_uri ;
 char * stroke_uri ;
 char * opacity_mask_uri ;
 char * transform_att ;
 char * clip_att ;
 char * data_att ;
 char * fill_att ;
 char * stroke_att ;
 char * opacity_att ;
 char * opacity_mask_att ;
 fz_xml * transform_tag = NULL ;
 fz_xml * clip_tag = NULL ;
 fz_xml * data_tag = NULL ;
 fz_xml * fill_tag = NULL ;
 fz_xml * stroke_tag = NULL ;
 fz_xml * opacity_mask_tag = NULL ;
 char * fill_opacity_att = NULL ;
 char * stroke_opacity_att = NULL ;
 char * stroke_dash_array_att ;
 char * stroke_dash_cap_att ;
 char * stroke_dash_offset_att ;
 char * stroke_end_line_cap_att ;
 char * stroke_start_line_cap_att ;
 char * stroke_line_join_att ;
 char * stroke_miter_limit_att ;
 char * stroke_thickness_att ;
 char * navigate_uri_att ;
 fz_stroke_state * stroke = NULL ;
 fz_matrix transform ;
 float samples [ FZ_MAX_COLORS ] ;
 fz_colorspace * colorspace ;
 fz_path * path = NULL ;
 fz_path * stroke_path = NULL ;
 fz_rect area ;
 int fill_rule ;
 int dash_len = 0 ;
 fz_matrix local_ctm ;
 transform_att = fz_xml_att ( root , "RenderTransform" ) ;
 clip_att = fz_xml_att ( root , "Clip" ) ;
 data_att = fz_xml_att ( root , "Data" ) ;
 fill_att = fz_xml_att ( root , "Fill" ) ;
 stroke_att = fz_xml_att ( root , "Stroke" ) ;
 opacity_att = fz_xml_att ( root , "Opacity" ) ;
 opacity_mask_att = fz_xml_att ( root , "OpacityMask" ) ;
 stroke_dash_array_att = fz_xml_att ( root , "StrokeDashArray" ) ;
 stroke_dash_cap_att = fz_xml_att ( root , "StrokeDashCap" ) ;
 stroke_dash_offset_att = fz_xml_att ( root , "StrokeDashOffset" ) ;
 stroke_end_line_cap_att = fz_xml_att ( root , "StrokeEndLineCap" ) ;
 stroke_start_line_cap_att = fz_xml_att ( root , "StrokeStartLineCap" ) ;
 stroke_line_join_att = fz_xml_att ( root , "StrokeLineJoin" ) ;
 stroke_miter_limit_att = fz_xml_att ( root , "StrokeMiterLimit" ) ;
 stroke_thickness_att = fz_xml_att ( root , "StrokeThickness" ) ;
 navigate_uri_att = fz_xml_att ( root , "FixedPage.NavigateUri" ) ;
 for ( node = fz_xml_down ( root ) ;
 node ;
 node = fz_xml_next ( node ) ) {
 if ( ! strcmp ( fz_xml_tag ( node ) , "Path.RenderTransform" ) ) transform_tag = fz_xml_down ( node ) ;
 if ( ! strcmp ( fz_xml_tag ( node ) , "Path.OpacityMask" ) ) opacity_mask_tag = fz_xml_down ( node ) ;
 if ( ! strcmp ( fz_xml_tag ( node ) , "Path.Clip" ) ) clip_tag = fz_xml_down ( node ) ;
 if ( ! strcmp ( fz_xml_tag ( node ) , "Path.Fill" ) ) fill_tag = fz_xml_down ( node ) ;
 if ( ! strcmp ( fz_xml_tag ( node ) , "Path.Stroke" ) ) stroke_tag = fz_xml_down ( node ) ;
 if ( ! strcmp ( fz_xml_tag ( node ) , "Path.Data" ) ) data_tag = fz_xml_down ( node ) ;
 }
 fill_uri = base_uri ;
 stroke_uri = base_uri ;
 opacity_mask_uri = base_uri ;
 xps_resolve_resource_reference ( doc , dict , & data_att , & data_tag , NULL ) ;
 xps_resolve_resource_reference ( doc , dict , & clip_att , & clip_tag , NULL ) ;
 xps_resolve_resource_reference ( doc , dict , & transform_att , & transform_tag , NULL ) ;
 xps_resolve_resource_reference ( doc , dict , & fill_att , & fill_tag , & fill_uri ) ;
 xps_resolve_resource_reference ( doc , dict , & stroke_att , & stroke_tag , & stroke_uri ) ;
 xps_resolve_resource_reference ( doc , dict , & opacity_mask_att , & opacity_mask_tag , & opacity_mask_uri ) ;
 if ( ! data_att && ! data_tag ) return ;
 if ( fill_tag && ! strcmp ( fz_xml_tag ( fill_tag ) , "SolidColorBrush" ) ) {
 fill_opacity_att = fz_xml_att ( fill_tag , "Opacity" ) ;
 fill_att = fz_xml_att ( fill_tag , "Color" ) ;
 fill_tag = NULL ;
 }
 if ( stroke_tag && ! strcmp ( fz_xml_tag ( stroke_tag ) , "SolidColorBrush" ) ) {
 stroke_opacity_att = fz_xml_att ( stroke_tag , "Opacity" ) ;
 stroke_att = fz_xml_att ( stroke_tag , "Color" ) ;
 stroke_tag = NULL ;
 }
 if ( stroke_att || stroke_tag ) {
 if ( stroke_dash_array_att ) {
 char * s = stroke_dash_array_att ;
 while ( * s ) {
 while ( * s == ' ' ) s ++ ;
 if ( * s ) dash_len ++ ;
 while ( * s && * s != ' ' ) s ++ ;
 }
 }
 stroke = fz_new_stroke_state_with_dash_len ( doc -> ctx , dash_len ) ;
 stroke -> start_cap = xps_parse_line_cap ( stroke_start_line_cap_att ) ;
 stroke -> dash_cap = xps_parse_line_cap ( stroke_dash_cap_att ) ;
 stroke -> end_cap = xps_parse_line_cap ( stroke_end_line_cap_att ) ;
 stroke -> linejoin = FZ_LINEJOIN_MITER_XPS ;
 if ( stroke_line_join_att ) {
 if ( ! strcmp ( stroke_line_join_att , "Miter" ) ) stroke -> linejoin = FZ_LINEJOIN_MITER_XPS ;
 if ( ! strcmp ( stroke_line_join_att , "Round" ) ) stroke -> linejoin = FZ_LINEJOIN_ROUND ;
 if ( ! strcmp ( stroke_line_join_att , "Bevel" ) ) stroke -> linejoin = FZ_LINEJOIN_BEVEL ;
 }
 stroke -> miterlimit = 10 ;
 if ( stroke_miter_limit_att ) stroke -> miterlimit = fz_atof ( stroke_miter_limit_att ) ;
 stroke -> linewidth = 1 ;
 if ( stroke_thickness_att ) stroke -> linewidth = fz_atof ( stroke_thickness_att ) ;
 stroke -> dash_phase = 0 ;
 stroke -> dash_len = 0 ;
 if ( stroke_dash_array_att ) {
 char * s = stroke_dash_array_att ;
 if ( stroke_dash_offset_att ) stroke -> dash_phase = fz_atof ( stroke_dash_offset_att ) * stroke -> linewidth ;
 while ( * s ) {
 while ( * s == ' ' ) s ++ ;
 if ( * s ) stroke -> dash_list [ stroke -> dash_len ++ ] = fz_atof ( s ) * stroke -> linewidth ;
 while ( * s && * s != ' ' ) s ++ ;
 }
 stroke -> dash_len = dash_len ;
 }
 }
 transform = fz_identity ;
 if ( transform_att ) xps_parse_render_transform ( doc , transform_att , & transform ) ;
 if ( transform_tag ) xps_parse_matrix_transform ( doc , transform_tag , & transform ) ;
 fz_concat ( & local_ctm , & transform , ctm ) ;
 if ( clip_att || clip_tag ) xps_clip ( doc , & local_ctm , dict , clip_att , clip_tag ) ;
 fill_rule = 0 ;
 if ( data_att ) path = xps_parse_abbreviated_geometry ( doc , data_att , & fill_rule ) ;
 else if ( data_tag ) {
 path = xps_parse_path_geometry ( doc , dict , data_tag , 0 , & fill_rule ) ;
 if ( stroke_att || stroke_tag ) stroke_path = xps_parse_path_geometry ( doc , dict , data_tag , 1 , & fill_rule ) ;
 }
 if ( ! stroke_path ) stroke_path = path ;
 if ( stroke_att || stroke_tag ) {
 fz_bound_path ( doc -> ctx , stroke_path , stroke , & local_ctm , & area ) ;
 if ( stroke_path != path && ( fill_att || fill_tag ) ) {
 fz_rect bounds ;
 fz_bound_path ( doc -> ctx , path , NULL , & local_ctm , & bounds ) ;
 fz_union_rect ( & area , & bounds ) ;
 }
 }
 else fz_bound_path ( doc -> ctx , path , NULL , & local_ctm , & area ) ;
 if ( navigate_uri_att ) xps_add_link ( doc , & area , base_uri , navigate_uri_att ) ;
 xps_begin_opacity ( doc , & local_ctm , & area , opacity_mask_uri , dict , opacity_att , opacity_mask_tag ) ;
 if ( fill_att ) {
 xps_parse_color ( doc , base_uri , fill_att , & colorspace , samples ) ;
 if ( fill_opacity_att ) samples [ 0 ] *= fz_atof ( fill_opacity_att ) ;
 xps_set_color ( doc , colorspace , samples ) ;
 fz_fill_path ( doc -> dev , path , fill_rule == 0 , & local_ctm , doc -> colorspace , doc -> color , doc -> alpha ) ;
 }
 if ( fill_tag ) {
 fz_clip_path ( doc -> dev , path , & area , fill_rule == 0 , & local_ctm ) ;
 xps_parse_brush ( doc , & local_ctm , & area , fill_uri , dict , fill_tag ) ;
 fz_pop_clip ( doc -> dev ) ;
 }
 if ( stroke_att ) {
 xps_parse_color ( doc , base_uri , stroke_att , & colorspace , samples ) ;
 if ( stroke_opacity_att ) samples [ 0 ] *= fz_atof ( stroke_opacity_att ) ;
 xps_set_color ( doc , colorspace , samples ) ;
 fz_stroke_path ( doc -> dev , stroke_path , stroke , & local_ctm , doc -> colorspace , doc -> color , doc -> alpha ) ;
 }
 if ( stroke_tag ) {
 fz_clip_stroke_path ( doc -> dev , stroke_path , & area , stroke , & local_ctm ) ;
 xps_parse_brush ( doc , & local_ctm , & area , stroke_uri , dict , stroke_tag ) ;
 fz_pop_clip ( doc -> dev ) ;
 }
 xps_end_opacity ( doc , opacity_mask_uri , dict , opacity_att , opacity_mask_tag ) ;
 if ( stroke_path != path ) fz_free_path ( doc -> ctx , stroke_path ) ;
 fz_free_path ( doc -> ctx , path ) ;
 path = NULL ;
 fz_drop_stroke_state ( doc -> ctx , stroke ) ;
 if ( clip_att || clip_tag ) fz_pop_clip ( doc -> dev ) ;
 }


static ssize_t sock_splice_read(struct file *file, loff_t *ppos,
				struct pipe_inode_info *pipe, size_t len,
				unsigned int flags)
{
	struct socket *sock = file->private_data;

	if (unlikely(!sock->ops->splice_read))
		return -EINVAL;

	return sock->ops->splice_read(sock, ppos, pipe, len, flags);
}


static void * counter_func ( void * arg ) {
 {
 set_pid_priority ( 0 , SCHED_FIFO , sched_get_priority_min ( SCHED_FIFO ) , "Unable to set SCHED_FIFO for %d (\"%s\"). (%s)" , "the counter_func" ) ;
 }
 for ( ;
 ;
 ) {
 counter ++ ;
 if ( verbose ) print_error ( stderr , "counter set to %d" , counter ) ;
 sleep ( increasetime ) ;
 }
 return NULL ;
 }


void FrameSelection::DidSetSelectionDeprecated(
    const SetSelectionOptions& options) {
  const Document& current_document = GetDocument();
  if (!GetSelectionInDOMTree().IsNone() && !options.DoNotSetFocus()) {
    SetFocusedNodeIfNeeded();
    if (!IsAvailable() || GetDocument() != current_document) {
      NOTREACHED();
      return;
    }
  }

  frame_caret_->StopCaretBlinkTimer();
  UpdateAppearance();

  x_pos_for_vertical_arrow_navigation_ = NoXPosForVerticalArrowNavigation();

  if (!options.DoNotSetFocus()) {
    SelectFrameElementInParentIfFullySelected();
    if (!IsAvailable() || GetDocument() != current_document) {
      return;
    }
  }
  const SetSelectionBy set_selection_by = options.GetSetSelectionBy();
  NotifyTextControlOfSelectionChange(set_selection_by);
  if (set_selection_by == SetSelectionBy::kUser) {
    const CursorAlignOnScroll align = options.GetCursorAlignOnScroll();
    ScrollAlignment alignment;

    if (frame_->GetEditor()
            .Behavior()
            .ShouldCenterAlignWhenSelectionIsRevealed())
      alignment = (align == CursorAlignOnScroll::kAlways)
                      ? ScrollAlignment::kAlignCenterAlways
                      : ScrollAlignment::kAlignCenterIfNeeded;
    else
      alignment = (align == CursorAlignOnScroll::kAlways)
                      ? ScrollAlignment::kAlignTopAlways
                      : ScrollAlignment::kAlignToEdgeIfNeeded;

    RevealSelection(alignment, kRevealExtent);
  }

  NotifyAccessibilityForSelectionChange();
  NotifyCompositorForSelectionChange();
  NotifyEventHandlerForSelectionChange();
  frame_->DomWindow()->EnqueueDocumentEvent(
      Event::Create(EventTypeNames::selectionchange));
}


io_get_open_fptr(mrb_state *mrb, mrb_value self)
{
  struct mrb_io *fptr;

  fptr = (struct mrb_io *)mrb_get_datatype(mrb, self, &mrb_io_type);
  if (fptr->fd < 0) {
    mrb_raise(mrb, E_IO_ERROR, "closed stream.");
  }
  return fptr;
}


	CommandPing(Module* parent)
		: SplitCommand(parent, "PING", 1)
	{
		syntax = "<cookie> [<servername>]";
	}


QPDFWriter::popPipelineStack(PointerHolder<Buffer>* bp)
{
    assert(this->pipeline_stack.size() >= 2);
    this->pipeline->finish();
    assert(dynamic_cast<Pl_Count*>(this->pipeline_stack.back()) ==
	   this->pipeline);
    delete this->pipeline_stack.back();
    this->pipeline_stack.pop_back();
    while (dynamic_cast<Pl_Count*>(this->pipeline_stack.back()) == 0)
    {
	Pipeline* p = this->pipeline_stack.back();
        if (dynamic_cast<Pl_MD5*>(p) == this->md5_pipeline)
        {
            this->md5_pipeline = 0;
        }
	this->pipeline_stack.pop_back();
	Pl_Buffer* buf = dynamic_cast<Pl_Buffer*>(p);
	if (bp && buf)
	{
	    *bp = buf->getBuffer();
	}
	delete p;
    }
    this->pipeline = dynamic_cast<Pl_Count*>(this->pipeline_stack.back());
}


LUALIB_API int luaopen_cmsgpack(lua_State *L) {
    luaopen_create(L);

#if LUA_VERSION_NUM < 502
    /* Register name globally for 5.1 */
    lua_pushvalue(L, -1);
    lua_setglobal(L, LUACMSGPACK_NAME);
#endif

    return 1;
}


void btm_sec_link_key_notification (UINT8 *p_bda, UINT8 *p_link_key, UINT8 key_type)
{
    tBTM_SEC_DEV_REC *p_dev_rec = btm_find_or_alloc_dev (p_bda);
    BOOLEAN          we_are_bonding = FALSE;

    BTM_TRACE_EVENT ("btm_sec_link_key_notification()  BDA:%04x%08x, TYPE: %d",
 (p_bda[0]<<8)+p_bda[1], (p_bda[2]<<24)+(p_bda[3]<<16)+(p_bda[4]<<8)+p_bda[5],
                      key_type);

 /* If connection was made to do bonding restore link security if changed */
    btm_restore_mode();

 /* Override the key type if version is pre-1.1 */
 if (btm_cb.devcb.local_version.hci_version < HCI_VERSION_1_1)
        p_dev_rec->link_key_type = BTM_LKEY_TYPE_IGNORE;
 if (key_type != BTM_LKEY_TYPE_CHANGED_COMB)
        p_dev_rec->link_key_type = key_type;

    p_dev_rec->sec_flags |= BTM_SEC_LINK_KEY_KNOWN;
#if (BLE_INCLUDED == TRUE)
 /* BR/EDR connection, update the encryption key size to be 16 as always */
    p_dev_rec->enc_key_size = 16;
#endif
    memcpy (p_dev_rec->link_key, p_link_key, LINK_KEY_LEN);

 if ( (btm_cb.pairing_state != BTM_PAIR_STATE_IDLE)
 && (memcmp (btm_cb.pairing_bda, p_bda, BD_ADDR_LEN) == 0) )
 {
 if (btm_cb.pairing_flags & BTM_PAIR_FLAGS_WE_STARTED_DD)
            we_are_bonding = TRUE;
 else
            btm_sec_change_pairing_state (BTM_PAIR_STATE_IDLE);
 }

 /* If name is not known at this point delay calling callback until the name is   */
 /* resolved. Unless it is a HID Device and we really need to send all link keys. */
 if ((!(p_dev_rec->sec_flags & BTM_SEC_NAME_KNOWN)
 && ((p_dev_rec->dev_class[1] & BTM_COD_MAJOR_CLASS_MASK) != BTM_COD_MAJOR_PERIPHERAL)) )
 {
        BTM_TRACE_EVENT ("btm_sec_link_key_notification()  Delayed BDA: %08x%04x Type:%d",
 (p_bda[0]<<24) + (p_bda[1]<<16) + (p_bda[2]<<8) + p_bda[3], (p_bda[4] << 8) + p_bda[5], key_type);

        p_dev_rec->link_key_not_sent = TRUE;

 /* If it is for bonding nothing else will follow, so we need to start name resolution */
 if (we_are_bonding)
 {
 if (!(btsnd_hcic_rmt_name_req (p_bda, HCI_PAGE_SCAN_REP_MODE_R1, HCI_MANDATARY_PAGE_SCAN_MODE, 0)))
                btm_inq_rmt_name_failed();
 }

        BTM_TRACE_EVENT ("rmt_io_caps:%d, sec_flags:x%x, dev_class[1]:x%02x", p_dev_rec->rmt_io_caps, p_dev_rec->sec_flags, p_dev_rec->dev_class[1])
 return;
 }

 /* If its not us who perform authentication, we should tell stackserver */
 /* that some authentication has been completed                          */
 /* This is required when different entities receive link notification and auth complete */
 if (!(p_dev_rec->security_required & BTM_SEC_OUT_AUTHENTICATE))
 {
 if (btm_cb.api.p_auth_complete_callback)
 (*btm_cb.api.p_auth_complete_callback) (p_dev_rec->bd_addr, p_dev_rec->dev_class,
                                                    p_dev_rec->sec_bd_name, HCI_SUCCESS);
 }

 /* We will save link key only if the user authorized it - BTE report link key in all cases */
#ifdef BRCM_NONE_BTE
 if (p_dev_rec->sec_flags & BTM_SEC_LINK_KEY_AUTHED)
#endif
 {
 if (btm_cb.api.p_link_key_callback)
 {
 (*btm_cb.api.p_link_key_callback) (p_bda, p_dev_rec->dev_class,  p_dev_rec->sec_bd_name,
                                               p_link_key, p_dev_rec->link_key_type);
 }
 }
}


void vp9_set_contexts ( const MACROBLOCKD * xd , struct macroblockd_plane * pd , BLOCK_SIZE plane_bsize , TX_SIZE tx_size , int has_eob , int aoff , int loff ) {
 ENTROPY_CONTEXT * const a = pd -> above_context + aoff ;
 ENTROPY_CONTEXT * const l = pd -> left_context + loff ;
 const int tx_size_in_blocks = 1 << tx_size ;
 if ( has_eob && xd -> mb_to_right_edge < 0 ) {
 int i ;
 const int blocks_wide = num_4x4_blocks_wide_lookup [ plane_bsize ] + ( xd -> mb_to_right_edge >> ( 5 + pd -> subsampling_x ) ) ;
 int above_contexts = tx_size_in_blocks ;
 if ( above_contexts + aoff > blocks_wide ) above_contexts = blocks_wide - aoff ;
 for ( i = 0 ;
 i < above_contexts ;
 ++ i ) a [ i ] = has_eob ;
 for ( i = above_contexts ;
 i < tx_size_in_blocks ;
 ++ i ) a [ i ] = 0 ;
 }
 else {
 vpx_memset ( a , has_eob , sizeof ( ENTROPY_CONTEXT ) * tx_size_in_blocks ) ;
 }
 if ( has_eob && xd -> mb_to_bottom_edge < 0 ) {
 int i ;
 const int blocks_high = num_4x4_blocks_high_lookup [ plane_bsize ] + ( xd -> mb_to_bottom_edge >> ( 5 + pd -> subsampling_y ) ) ;
 int left_contexts = tx_size_in_blocks ;
 if ( left_contexts + loff > blocks_high ) left_contexts = blocks_high - loff ;
 for ( i = 0 ;
 i < left_contexts ;
 ++ i ) l [ i ] = has_eob ;
 for ( i = left_contexts ;
 i < tx_size_in_blocks ;
 ++ i ) l [ i ] = 0 ;
 }
 else {
 vpx_memset ( l , has_eob , sizeof ( ENTROPY_CONTEXT ) * tx_size_in_blocks ) ;
 }
 }


static void sched_rt_do_global(void)
{
	def_rt_bandwidth.rt_runtime = global_rt_runtime();
	def_rt_bandwidth.rt_period = ns_to_ktime(global_rt_period());
}


static void TestFramePrinting ( WebLocalFrameImpl * frame ) {
 WebPrintParams print_params ;
 WebSize page_size ( 500 , 500 ) ;
 print_params . print_content_area . width = page_size . width ;
 print_params . print_content_area . height = page_size . height ;
 EXPECT_EQ ( 1 , frame -> PrintBegin ( print_params , WebNode ( ) ) ) ;
 PaintRecorder recorder ;
 frame -> PrintPagesForTesting ( recorder . beginRecording ( IntRect ( ) ) , page_size ) ;
 frame -> PrintEnd ( ) ;
 }


static int f2fs_get_context(struct inode *inode, void *ctx, size_t len)
{
	return f2fs_getxattr(inode, F2FS_XATTR_INDEX_ENCRYPTION,
				F2FS_XATTR_NAME_ENCRYPTION_CONTEXT,
				ctx, len, NULL);
}


R_API int r_core_bin_set_cur(RCore *core, RBinFile *binfile) {
	if (!core->bin) {
		return false;
	}
	if (!binfile) {
		// Find first available binfile
		ut32 fd = r_core_file_cur_fd (core);
		binfile = fd != (ut32)-1
				  ? r_bin_file_find_by_fd (core->bin, fd)
				  : NULL;
		if (!binfile) {
			return false;
		}
	}
	r_bin_file_set_cur_binfile (core->bin, binfile);
	return true;
}


void PrintDialogGtk::OnJobCompletedThunk(GtkPrintJob* print_job,
                                         gpointer user_data,
                                         GError* error) {
  static_cast<PrintDialogGtk*>(user_data)->OnJobCompleted(print_job, error);
}


void ChromeContentBrowserClient::DidCreatePpapiPlugin(
    content::BrowserPpapiHost* browser_host) {
#if defined(ENABLE_PLUGINS)
  browser_host->GetPpapiHost()->AddHostFactoryFilter(
      scoped_ptr<ppapi::host::HostFactory>(
          new ChromeBrowserPepperHostFactory(browser_host)));
#endif
}


VirtualKeyboardController::VirtualKeyboardController()
    : has_external_keyboard_(false),
      has_internal_keyboard_(false),
      has_touchscreen_(false),
      ignore_external_keyboard_(false) {
  Shell::GetInstance()->AddShellObserver(this);
  ui::DeviceDataManager::GetInstance()->AddObserver(this);
  UpdateDevices();
}


void reset_files_struct(struct files_struct *files)
{
	struct task_struct *tsk = current;
	struct files_struct *old;

	old = tsk->files;
	task_lock(tsk);
	tsk->files = files;
	task_unlock(tsk);
	put_files_struct(old);
}


int dtls1_listen(SSL *s, struct sockaddr *client)
 {
     int ret;

     SSL_set_options(s, SSL_OP_COOKIE_EXCHANGE);
     s->d1->listen = 1;

    (void)BIO_dgram_get_peer(SSL_get_rbio(s), client);
    return 1;
}


 bool AXLayoutObject::supportsARIADropping() const {
  const AtomicString& dropEffect = getAttribute(aria_dropeffectAttr);
  return !dropEffect.isEmpty();
}


void bson_builder_error( bson *b ) {
    if( err_handler )
        err_handler( "BSON error." );
}


 set_store_for_read(png_store *ps, png_infopp ppi, png_uint_32 id,
   const char *name)
 {
    /* Set the name for png_error */
    safecat(ps->test, sizeof ps->test, 0, name);

 if (ps->pread != NULL)
      png_error(ps->pread, "read store already in use");

   store_read_reset(ps);

 /* Both the create APIs can return NULL if used in their default mode
    * (because there is no other way of handling an error because the jmp_buf
    * by default is stored in png_struct and that has not been allocated!)
    * However, given that store_error works correctly in these circumstances
    * we don't ever expect NULL in this program.
    */
#  ifdef PNG_USER_MEM_SUPPORTED
 if (!ps->speed)
         ps->pread = png_create_read_struct_2(PNG_LIBPNG_VER_STRING, ps,
             store_error, store_warning, &ps->read_memory_pool, store_malloc,
             store_free);

 else
#  endif
   ps->pread = png_create_read_struct(PNG_LIBPNG_VER_STRING, ps, store_error,
      store_warning);

 if (ps->pread == NULL)
 {
 struct exception_context *the_exception_context = &ps->exception_context;

      store_log(ps, NULL, "png_create_read_struct returned NULL (unexpected)",
 1 /*error*/);

 Throw ps;
 }

#  ifdef PNG_SET_OPTION_SUPPORTED
 {
 int opt;
 for (opt=0; opt<ps->noptions; ++opt)
 if (png_set_option(ps->pread, ps->options[opt].option,
               ps->options[opt].setting) == PNG_OPTION_INVALID)
                  png_error(ps->pread, "png option invalid");
 }
#  endif

   store_read_set(ps, id);

 if (ppi != NULL)
 *ppi = ps->piread = png_create_info_struct(ps->pread);

 return ps->pread;
}


SProcScreenSaverSuspend(ClientPtr client)
{
    REQUEST(xScreenSaverSuspendReq);

    swaps(&stuff->length);
    REQUEST_SIZE_MATCH(xScreenSaverSuspendReq);
    return ProcScreenSaverSuspend(client);
}


inline static void gdImageSetAAPixelColor(gdImagePtr im, int x, int y, int color, int t)
{
	int dr,dg,db,p,r,g,b;
	dr = gdTrueColorGetRed(color);
	dg = gdTrueColorGetGreen(color);
	db = gdTrueColorGetBlue(color);

	p = gdImageGetPixel(im,x,y);
	r = gdTrueColorGetRed(p);
	g = gdTrueColorGetGreen(p);
	b = gdTrueColorGetBlue(p);

	BLEND_COLOR(t, dr, r, dr);
	BLEND_COLOR(t, dg, g, dg);
	BLEND_COLOR(t, db, b, db);
	im->tpixels[y][x]=gdTrueColorAlpha(dr, dg, db,  gdAlphaOpaque);
}


static int crypto_report_ahash(struct sk_buff *skb, struct crypto_alg *alg)
{
	struct crypto_stat_hash rhash;

	memset(&rhash, 0, sizeof(rhash));

	strscpy(rhash.type, "ahash", sizeof(rhash.type));

	rhash.stat_hash_cnt = atomic64_read(&alg->stats.hash.hash_cnt);
	rhash.stat_hash_tlen = atomic64_read(&alg->stats.hash.hash_tlen);
	rhash.stat_err_cnt = atomic64_read(&alg->stats.hash.err_cnt);

	return nla_put(skb, CRYPTOCFGA_STAT_HASH, sizeof(rhash), &rhash);
}


static req_fun_t *makefun(const void *fun, int type, apr_pool_t *pool)
{
    req_fun_t *rft = apr_palloc(pool, sizeof(req_fun_t));
    rft->fun = fun;
    rft->type = type;
    return rft;
}


  explicit HistoryObserver(Profile* profile) : profile_(profile) {
    DownloadCoreServiceFactory::GetForBrowserContext(profile_)
        ->GetDownloadHistory()
        ->AddObserver(this);
  }


static void NamedPropertySetter(
    const AtomicString& name,
    v8::Local<v8::Value> v8_value,
    const v8::PropertyCallbackInfo<v8::Value>& info) {
  ScriptState* script_state = ScriptState::ForRelevantRealm(info);

  TestObject* impl = V8TestObject::ToImpl(info.Holder());
  V8StringResource<> property_value = v8_value;
  if (!property_value.Prepare())
    return;

  bool result = impl->AnonymousNamedSetter(script_state, name, property_value);
  if (!result)
    return;
  V8SetReturnValue(info, v8_value);
}


catenate_stringinfo_string(StringInfo buffer, const char *addon)
{
	/* custom version of cstring_to_text_with_len */
	int			buflen = buffer->len;
	int			addlen = strlen(addon);
	text	   *result = (text *) palloc(buflen + addlen + VARHDRSZ);

	SET_VARSIZE(result, buflen + addlen + VARHDRSZ);
	memcpy(VARDATA(result), buffer->data, buflen);
	memcpy(VARDATA(result) + buflen, addon, addlen);

	return result;
}


static inline bool ipv6_addr_orchid ( const struct in6_addr * a ) {
 return ( a -> s6_addr32 [ 0 ] & htonl ( 0xfffffff0 ) ) == htonl ( 0x20010010 ) ;
 }


static void pvpanic_fw_cfg(ISADevice *dev, FWCfgState *fw_cfg)

{

    PVPanicState *s = ISA_PVPANIC_DEVICE(dev);

    fw_cfg_add_file(fw_cfg, "etc/pvpanic-port",

                    g_memdup(&s->ioport, sizeof(s->ioport)),

                    sizeof(s->ioport));

}


static int dissect_h245_T_distribution ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
 offset = dissect_per_choice ( tvb , offset , actx , tree , hf_index , ett_h245_T_distribution , T_distribution_choice , NULL ) ;
 return offset ;
 }


static void __init enable_swap_cgroup(void)
{
}


static void tcg_out_movcond32(TCGContext *s, TCGCond cond, TCGArg dest,

                              TCGArg c1, TCGArg c2, int const_c2,

                              TCGArg v1)

{

    tcg_out_cmp(s, c1, c2, const_c2, 0);

    if (have_cmov) {

        tcg_out_modrm(s, OPC_CMOVCC | tcg_cond_to_jcc[cond], dest, v1);

    } else {

        int over = gen_new_label();

        tcg_out_jxx(s, tcg_cond_to_jcc[tcg_invert_cond(cond)], over, 1);

        tcg_out_mov(s, TCG_TYPE_I32, dest, v1);

        tcg_out_label(s, over, s->code_ptr);

    }

}


MD5Init(struct MD5Context *ctx) {
  ctx->buf[0] = 0x67452301;
  ctx->buf[1] = 0xefcdab89;
  ctx->buf[2] = 0x98badcfe;
  ctx->buf[3] = 0x10325476;

  ctx->bytes[0] = 0;
  ctx->bytes[1] = 0;
}


std::unique_ptr<BlobDataHandle> BlobStorageContext::AddFinishedBlob(
    const BlobDataBuilder* builder) {
  DCHECK(builder);
  return AddFinishedBlob(*builder);
}


void vp8_decoder_create_threads(VP8D_COMP *pbi)
{
 int core_count = 0;
 unsigned int ithread;

    pbi->b_multithreaded_rd = 0;
    pbi->allocated_decoding_thread_count = 0;

 /* limit decoding threads to the max number of token partitions */
    core_count = (pbi->max_threads > 8) ? 8 : pbi->max_threads;

 /* limit decoding threads to the available cores */
 if (core_count > pbi->common.processor_core_count)
        core_count = pbi->common.processor_core_count;

 if (core_count > 1)
 {
        pbi->b_multithreaded_rd = 1;
        pbi->decoding_thread_count = core_count - 1;

        CALLOC_ARRAY(pbi->h_decoding_thread, pbi->decoding_thread_count);
        CALLOC_ARRAY(pbi->h_event_start_decoding, pbi->decoding_thread_count);
        CALLOC_ARRAY_ALIGNED(pbi->mb_row_di, pbi->decoding_thread_count, 32);
        CALLOC_ARRAY(pbi->de_thread_data, pbi->decoding_thread_count);

 for (ithread = 0; ithread < pbi->decoding_thread_count; ithread++)
 {
            sem_init(&pbi->h_event_start_decoding[ithread], 0, 0);

            vp8_setup_block_dptrs(&pbi->mb_row_di[ithread].mbd);

            pbi->de_thread_data[ithread].ithread  = ithread;
            pbi->de_thread_data[ithread].ptr1     = (void *)pbi;
            pbi->de_thread_data[ithread].ptr2     = (void *) &pbi->mb_row_di[ithread];

            pthread_create(&pbi->h_decoding_thread[ithread], 0, thread_decoding_proc, (&pbi->de_thread_data[ithread]));
 }

        sem_init(&pbi->h_event_end_decoding, 0, 0);

        pbi->allocated_decoding_thread_count = pbi->decoding_thread_count;
 }

 }


QBool *qbool_from_bool(bool value)

{

    QBool *qb;

    qb = g_malloc(sizeof(*qb));

    qb->value = value;

    QOBJECT_INIT(qb, &qbool_type);

    return qb;

}


HostCache::Entry::Entry(const HostCache::Entry& entry,
                        base::TimeTicks now,
                        base::TimeDelta ttl,
                        int network_changes)
    : error_(entry.error()),
      addresses_(entry.addresses()),
      ttl_(entry.ttl()),
      expires_(now + ttl),
      network_changes_(network_changes),
      total_hits_(0),
      stale_hits_(0) {}


static inline pgprot_t vm_get_page_prot(unsigned long vm_flags)
{
	return __pgprot(0);
}


__perf_event_exit_task(struct perf_event *child_event,
			 struct perf_event_context *child_ctx,
			 struct task_struct *child)
{
	if (child_event->parent) {
		raw_spin_lock_irq(&child_ctx->lock);
		perf_group_detach(child_event);
		raw_spin_unlock_irq(&child_ctx->lock);
	}

	perf_remove_from_context(child_event);

	/*
	 * It can happen that the parent exits first, and has events
	 * that are still around due to the child reference. These
	 * events need to be zapped.
	 */
	if (child_event->parent) {
		sync_child_event(child_event, child);
		free_event(child_event);
	}
}


static int nfs4_handle_exception(struct nfs_server *server, int errorcode, struct nfs4_exception *exception)
{
	struct nfs_client *clp = server->nfs_client;
	struct nfs4_state *state = exception->state;
	struct inode *inode = exception->inode;
	int ret = errorcode;

	exception->retry = 0;
	switch(errorcode) {
		case 0:
			return 0;
		case -NFS4ERR_OPENMODE:
			if (nfs_have_delegation(inode, FMODE_READ)) {
				nfs_inode_return_delegation(inode);
				exception->retry = 1;
				return 0;
			}
			if (state == NULL)
				break;
			nfs4_schedule_stateid_recovery(server, state);
			goto wait_on_recovery;
		case -NFS4ERR_DELEG_REVOKED:
		case -NFS4ERR_ADMIN_REVOKED:
		case -NFS4ERR_BAD_STATEID:
			if (state != NULL)
				nfs_remove_bad_delegation(state->inode);
			if (state == NULL)
				break;
			nfs4_schedule_stateid_recovery(server, state);
			goto wait_on_recovery;
		case -NFS4ERR_EXPIRED:
			if (state != NULL)
				nfs4_schedule_stateid_recovery(server, state);
		case -NFS4ERR_STALE_STATEID:
		case -NFS4ERR_STALE_CLIENTID:
			nfs4_schedule_lease_recovery(clp);
			goto wait_on_recovery;
#if defined(CONFIG_NFS_V4_1)
		case -NFS4ERR_BADSESSION:
		case -NFS4ERR_BADSLOT:
		case -NFS4ERR_BAD_HIGH_SLOT:
		case -NFS4ERR_CONN_NOT_BOUND_TO_SESSION:
		case -NFS4ERR_DEADSESSION:
		case -NFS4ERR_SEQ_FALSE_RETRY:
		case -NFS4ERR_SEQ_MISORDERED:
			dprintk("%s ERROR: %d Reset session\n", __func__,
				errorcode);
			nfs4_schedule_session_recovery(clp->cl_session);
			exception->retry = 1;
			break;
#endif /* defined(CONFIG_NFS_V4_1) */
		case -NFS4ERR_FILE_OPEN:
			if (exception->timeout > HZ) {
				/* We have retried a decent amount, time to
				 * fail
				 */
				ret = -EBUSY;
				break;
			}
		case -NFS4ERR_GRACE:
		case -NFS4ERR_DELAY:
		case -EKEYEXPIRED:
			ret = nfs4_delay(server->client, &exception->timeout);
			if (ret != 0)
				break;
		case -NFS4ERR_RETRY_UNCACHED_REP:
		case -NFS4ERR_OLD_STATEID:
			exception->retry = 1;
			break;
		case -NFS4ERR_BADOWNER:
			/* The following works around a Linux server bug! */
		case -NFS4ERR_BADNAME:
			if (server->caps & NFS_CAP_UIDGID_NOMAP) {
				server->caps &= ~NFS_CAP_UIDGID_NOMAP;
				exception->retry = 1;
				printk(KERN_WARNING "NFS: v4 server %s "
						"does not accept raw "
						"uid/gids. "
						"Reenabling the idmapper.\n",
						server->nfs_client->cl_hostname);
			}
	}
	/* We failed to handle the error */
	return nfs4_map_errors(ret);
wait_on_recovery:
	ret = nfs4_wait_clnt_recover(clp);
	if (ret == 0)
		exception->retry = 1;
	return ret;
}


void nl80211_send_disconnected(struct cfg80211_registered_device *rdev,
			       struct net_device *netdev, u16 reason,
			       const u8 *ie, size_t ie_len, bool from_ap)
{
	struct sk_buff *msg;
	void *hdr;

	msg = nlmsg_new(100 + ie_len, GFP_KERNEL);
	if (!msg)
		return;

	hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_DISCONNECT);
	if (!hdr) {
		nlmsg_free(msg);
		return;
	}

	if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
	    nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) ||
	    (reason &&
	     nla_put_u16(msg, NL80211_ATTR_REASON_CODE, reason)) ||
	    (from_ap &&
	     nla_put_flag(msg, NL80211_ATTR_DISCONNECTED_BY_AP)) ||
	    (ie && nla_put(msg, NL80211_ATTR_IE, ie_len, ie)))
		goto nla_put_failure;

	genlmsg_end(msg, hdr);

	genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
				NL80211_MCGRP_MLME, GFP_KERNEL);
	return;

 nla_put_failure:
	nlmsg_free(msg);
}


status_t SampleTable::setSyncSampleParams(off64_t data_offset, size_t data_size) {
 if (mSyncSampleOffset >= 0 || data_size < 8) {
 return ERROR_MALFORMED;
 }

    mSyncSampleOffset = data_offset;

 uint8_t header[8];
 if (mDataSource->readAt(
                data_offset, header, sizeof(header)) < (ssize_t)sizeof(header)) {
 return ERROR_IO;
 }

 if (U32_AT(header) != 0) {
 return ERROR_MALFORMED;
 }

    mNumSyncSamples = U32_AT(&header[4]);

 if (mNumSyncSamples < 2) {
        ALOGV("Table of sync samples is empty or has only a single entry!");
 }

 uint64_t allocSize = mNumSyncSamples * (uint64_t)sizeof(uint32_t);
 if (allocSize > SIZE_MAX) {
 return ERROR_OUT_OF_RANGE;
 }

    mSyncSamples = new (std::nothrow) uint32_t[mNumSyncSamples];
 if (!mSyncSamples)
 return ERROR_OUT_OF_RANGE;

 size_t size = mNumSyncSamples * sizeof(uint32_t);
 if (mDataSource->readAt(mSyncSampleOffset + 8, mSyncSamples, size)
 != (ssize_t)size) {
 return ERROR_IO;
 }

 for (size_t i = 0; i < mNumSyncSamples; ++i) {
        mSyncSamples[i] = ntohl(mSyncSamples[i]) - 1;
 }

 return OK;
}


     PaintPropertyTreeBuilderFragmentContext()
    : current_effect(&EffectPaintPropertyNode::Root()) {
   current.clip = absolute_position.clip = fixed_position.clip =
      &ClipPaintPropertyNode::Root();
   current.transform = absolute_position.transform = fixed_position.transform =
      &TransformPaintPropertyNode::Root();
   current.scroll = absolute_position.scroll = fixed_position.scroll =
      &ScrollPaintPropertyNode::Root();
 }


ftp_nlist(ftpbuf_t *ftp, const char *path TSRMLS_DC)
{
	return ftp_genlist(ftp, "NLST", path TSRMLS_CC);
}


void Document::RemoveTitle(Element* title_element) {
  if (title_element_ != title_element)
    return;

  title_element_ = nullptr;

  if (IsHTMLDocument() || IsXHTMLDocument()) {
    if (HTMLTitleElement* title =
            Traversal<HTMLTitleElement>::FirstWithin(*this))
      SetTitleElement(title);
  } else if (IsSVGDocument()) {
    if (SVGTitleElement* title = Traversal<SVGTitleElement>::FirstWithin(*this))
      SetTitleElement(title);
  }

  if (!title_element_)
    UpdateTitle(String());
}


void coroutine_fn co_aio_sleep_ns(AioContext *ctx, QEMUClockType type,
                                  int64_t ns)
{
    CoSleepCB sleep_cb = {
        .co = qemu_coroutine_self(),
    };
    sleep_cb.ts = aio_timer_new(ctx, type, SCALE_NS, co_sleep_cb, &sleep_cb);
    timer_mod(sleep_cb.ts, qemu_clock_get_ns(type) + ns);
    qemu_coroutine_yield();
    timer_del(sleep_cb.ts);
    timer_free(sleep_cb.ts);


HTTPSession::newPushedTransaction(
  HTTPCodec::StreamID assocStreamId,
  HTTPTransaction::PushHandler* handler) noexcept {
  if (!codec_->supportsPushTransactions()) {
    return nullptr;
  }
  CHECK(isDownstream());
  CHECK_NOTNULL(handler);
  if (draining_ || (outgoingStreams_ >= maxConcurrentOutgoingStreamsRemote_)) {
    // This session doesn't support any more push transactions
    // This could be an actual problem - since a single downstream SPDY session
    // might be connected to N upstream hosts, each of which send M pushes,
    // which exceeds the limit.
    // should we queue?
    return nullptr;
  }

  HTTPTransaction* txn = createTransaction(codec_->createStream(),
                                           assocStreamId,
                                           HTTPCodec::NoExAttributes);
  if (!txn) {
    return nullptr;
  }

  DestructorGuard dg(this);
  auto txnID = txn->getID();
  txn->setHandler(handler);
  setNewTransactionPauseState(txnID);
  return txn;
}


onig_init_for_match_at(regex_t* reg)
{
  return match_at(reg, (const UChar* )NULL, (const UChar* )NULL,
                  (const UChar* )NULL, (const UChar* )NULL, (UChar* )NULL,
                  (MatchArg* )NULL);
}


uint64_t helper_cmpbge(uint64_t op1, uint64_t op2)

{

#if defined(__SSE2__)

    uint64_t r;

    /* The cmpbge instruction is heavily used in the implementation of

       every string function on Alpha.  We can do much better than either

       the default loop below, or even an unrolled version by using the

       native vector support.  */

    {

        typedef uint64_t Q __attribute__((vector_size(16)));

        typedef uint8_t B __attribute__((vector_size(16)));

        Q q1 = (Q){ op1, 0 };

        Q q2 = (Q){ op2, 0 };

        q1 = (Q)((B)q1 >= (B)q2);

        r = q1[0];

    }

    /* Select only one bit from each byte.  */

    r &= 0x0101010101010101;

    /* Collect the bits into the bottom byte.  */

    /* .......A.......B.......C.......D.......E.......F.......G.......H */

    r |= r >> (8 - 1);

    /* .......A......AB......BC......CD......DE......EF......FG......GH */

    r |= r >> (16 - 2);

    /* .......A......AB.....ABC....ABCD....BCDE....CDEF....DEFG....EFGH */

    r |= r >> (32 - 4);

    /* .......A......AB.....ABC....ABCD...ABCDE..ABCDEF.ABCDEFGABCDEFGH */

    /* Return only the low 8 bits.  */

    return r & 0xff;

#else

    uint8_t opa, opb, res;

    int i;

    res = 0;

    for (i = 0; i < 8; i++) {

        opa = op1 >> (i * 8);

        opb = op2 >> (i * 8);

        if (opa >= opb) {

            res |= 1 << i;

        }

    }

    return res;

#endif

}


Status RunRestore(const RunOptions& run_options, const string& export_dir,
                  const StringPiece restore_op_name,
                  const StringPiece variable_filename_const_op_name,
                  const std::vector<AssetFileDef>& asset_file_defs,
                  Session* session) {
  LOG(INFO) << "Restoring SavedModel bundle.";
  // Find path to variables to be restored in export directory.
  const string variables_directory =
      io::JoinPath(export_dir, kSavedModelVariablesDirectory);
  // Check for saver checkpoints in v2 format. Models exported in the checkpoint
  // v2 format will have a variables.index file. The corresponding
  // variables are stored in the variables.data-?????-of-????? files.
  const string variables_index_path = io::JoinPath(
      variables_directory, MetaFilename(kSavedModelVariablesFilename));
  if (!Env::Default()->FileExists(variables_index_path).ok()) {
    LOG(INFO) << "The specified SavedModel has no variables; no checkpoints "
                 "were restored. File does not exist: "
              << variables_index_path;
    return Status::OK();
  }
  const string variables_path =
      io::JoinPath(variables_directory, kSavedModelVariablesFilename);

  // Add variables to the graph.
  Tensor variables_path_tensor(DT_STRING, TensorShape({}));
  variables_path_tensor.scalar<tstring>()() = variables_path;

  std::vector<std::pair<string, Tensor>> inputs = {
      {string(variable_filename_const_op_name), variables_path_tensor}};

  AddAssetsTensorsToInputs(export_dir, asset_file_defs, &inputs);

  RunMetadata run_metadata;
  return RunOnce(run_options, inputs, {}, {string(restore_op_name)},
                 nullptr /* outputs */, &run_metadata, session);
}


R_API char *r_bin_java_print_invokedynamic_cp_stringify(RBinJavaCPTypeObj *obj) {
	ut32 size = 255, consumed = 0;
	char *value = malloc (size);
	if (value) {
		memset (value, 0, size);
		consumed = snprintf (value, size, "%d.0x%04"PFMT64x ".%s.%d.%d",
			obj->metas->ord, obj->file_offset + obj->loadaddr, ((RBinJavaCPTypeMetas *) obj->metas->type_info)->name,
			obj->info.cp_invoke_dynamic.bootstrap_method_attr_index,
			obj->info.cp_invoke_dynamic.name_and_type_index);
		if (consumed >= size - 1) {
			free (value);
			size += size >> 1;
			value = malloc (size);
			if (value) {
				memset (value, 0, size);
				(void)snprintf (value, size, "%d.0x%04"PFMT64x ".%s.%d.%d",
					obj->metas->ord, obj->file_offset + obj->loadaddr, ((RBinJavaCPTypeMetas *) obj->metas->type_info)->name,
					obj->info.cp_invoke_dynamic.bootstrap_method_attr_index,
					obj->info.cp_invoke_dynamic.name_and_type_index);
			}
		}
	}
	return value;
}


  DataReductionProxyInterceptorTest()
      : scoped_task_environment_(
            base::test::ScopedTaskEnvironment::MainThreadType::IO) {
    test_context_ =
        DataReductionProxyTestContext::Builder()
            .Build();
    default_context_.reset(new TestURLRequestContextWithDataReductionProxy(
        test_context_->config()
            ->test_params()
            ->proxies_for_http()
            .front()
            .proxy_server(),
        &default_network_delegate_));
    default_context_->set_network_delegate(&default_network_delegate_);
    test_context_->config()->test_params()->UseNonSecureProxiesForHttp();
  }


static void search_for_ms(AACEncContext *s, ChannelElement *cpe,

                          const float lambda)

{

    int start = 0, i, w, w2, g;

    float M[128], S[128];

    float *L34 = s->scoefs, *R34 = s->scoefs + 128, *M34 = s->scoefs + 128*2, *S34 = s->scoefs + 128*3;

    SingleChannelElement *sce0 = &cpe->ch[0];

    SingleChannelElement *sce1 = &cpe->ch[1];

    if (!cpe->common_window)

        return;

    for (w = 0; w < sce0->ics.num_windows; w += sce0->ics.group_len[w]) {

        for (g = 0;  g < sce0->ics.num_swb; g++) {

            if (!cpe->ch[0].zeroes[w*16+g] && !cpe->ch[1].zeroes[w*16+g]) {

                float dist1 = 0.0f, dist2 = 0.0f;

                for (w2 = 0; w2 < sce0->ics.group_len[w]; w2++) {

                    FFPsyBand *band0 = &s->psy.ch[s->cur_channel+0].psy_bands[(w+w2)*16+g];

                    FFPsyBand *band1 = &s->psy.ch[s->cur_channel+1].psy_bands[(w+w2)*16+g];

                    float minthr = FFMIN(band0->threshold, band1->threshold);

                    float maxthr = FFMAX(band0->threshold, band1->threshold);

                    for (i = 0; i < sce0->ics.swb_sizes[g]; i++) {

                        M[i] = (sce0->coeffs[start+w2*128+i]

                              + sce1->coeffs[start+w2*128+i]) * 0.5;

                        S[i] =  M[i]

                              - sce1->coeffs[start+w2*128+i];

                    }

                    abs_pow34_v(L34, sce0->coeffs+start+w2*128, sce0->ics.swb_sizes[g]);

                    abs_pow34_v(R34, sce1->coeffs+start+w2*128, sce0->ics.swb_sizes[g]);

                    abs_pow34_v(M34, M,                         sce0->ics.swb_sizes[g]);

                    abs_pow34_v(S34, S,                         sce0->ics.swb_sizes[g]);

                    dist1 += quantize_band_cost(s, sce0->coeffs + start + w2*128,

                                                L34,

                                                sce0->ics.swb_sizes[g],

                                                sce0->sf_idx[(w+w2)*16+g],

                                                sce0->band_type[(w+w2)*16+g],

                                                lambda / band0->threshold, INFINITY, NULL);

                    dist1 += quantize_band_cost(s, sce1->coeffs + start + w2*128,

                                                R34,

                                                sce1->ics.swb_sizes[g],

                                                sce1->sf_idx[(w+w2)*16+g],

                                                sce1->band_type[(w+w2)*16+g],

                                                lambda / band1->threshold, INFINITY, NULL);

                    dist2 += quantize_band_cost(s, M,

                                                M34,

                                                sce0->ics.swb_sizes[g],

                                                sce0->sf_idx[(w+w2)*16+g],

                                                sce0->band_type[(w+w2)*16+g],

                                                lambda / maxthr, INFINITY, NULL);

                    dist2 += quantize_band_cost(s, S,

                                                S34,

                                                sce1->ics.swb_sizes[g],

                                                sce1->sf_idx[(w+w2)*16+g],

                                                sce1->band_type[(w+w2)*16+g],

                                                lambda / minthr, INFINITY, NULL);

                }

                cpe->ms_mask[w*16+g] = dist2 < dist1;

            }

            start += sce0->ics.swb_sizes[g];

        }

    }

}


const IniSection& s () const { return _s; }


static void conditionalOrLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
    TestObjectPythonV8Internal::conditionalOrLongAttributeAttributeGetter(info);
    TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}


  explicit UnicodeTranscodeOp(OpKernelConstruction* ctx) : OpKernel(ctx) {
    OP_REQUIRES_OK(ctx, GetErrorOptions(ctx, &error_options_));

    string output_encoding;
    OP_REQUIRES_OK(ctx, ctx->GetAttr("output_encoding", &output_encoding));
    OP_REQUIRES_OK(ctx,
                   ParseUnicodeEncoding(output_encoding, &output_encoding_));

    OP_REQUIRES_OK(ctx, ctx->GetAttr("input_encoding", &input_encoding_));
    // Make a temporary UConverter to ensure it will create without error
    // at execution time (and to warm any data caches the converter needs).
    // This instance is not used.
    std::unique_ptr<WrappedConverter> input_encoder =
        absl::make_unique<WrappedConverter>();
    input_encoder->init(input_encoding_);
    OP_REQUIRES(ctx, input_encoder->converter_,
                errors::InvalidArgument(
                    "Could not create converter for input encoding: " +
                    input_encoding_));
  }


static int mp3_read_header(AVFormatContext *s,

                           AVFormatParameters *ap)

{

    AVStream *st;

    int64_t off;

    st = av_new_stream(s, 0);

    if (!st)

        return AVERROR(ENOMEM);

    st->codec->codec_type = CODEC_TYPE_AUDIO;

    st->codec->codec_id = CODEC_ID_MP3;

    st->need_parsing = AVSTREAM_PARSE_FULL;

    st->start_time = 0;

    ff_id3v1_read(s);

    ff_id3v2_read(s);

    off = url_ftell(s->pb);

    if (mp3_parse_vbr_tags(s, st, off) < 0)

        url_fseek(s->pb, off, SEEK_SET);

    /* the parameters will be extracted from the compressed bitstream */

    return 0;

}


FLAC__StreamDecoderWriteStatus FLACParser::write_callback(
 const FLAC__StreamDecoder * /* decoder */, const FLAC__Frame *frame,
 const FLAC__int32 * const buffer[], void *client_data)
{
 return ((FLACParser *) client_data)->writeCallback(frame, buffer);
}


outputBits (int nBits, Int64 bits, Int64 &c, int &lc, char *&out)
{
    c <<= nBits;
    lc += nBits;

    c |= bits;

    while (lc >= 8)
	*out++ = (c >> (lc -= 8));
}


win_close_buffer(win_T *win, int action, int abort_if_last)
{
#ifdef FEAT_SYN_HL
    // Free independent synblock before the buffer is freed.
    if (win->w_buffer != NULL)
	reset_synblock(win);
#endif

#ifdef FEAT_QUICKFIX
    // When a quickfix/location list window is closed and the buffer is
    // displayed in only one window, then unlist the buffer.
    if (win->w_buffer != NULL && bt_quickfix(win->w_buffer)
					&& win->w_buffer->b_nwindows == 1)
	win->w_buffer->b_p_bl = FALSE;
#endif

    // Close the link to the buffer.
    if (win->w_buffer != NULL)
    {
	bufref_T    bufref;

	set_bufref(&bufref, curbuf);
	win->w_closing = TRUE;
	close_buffer(win, win->w_buffer, action, abort_if_last, FALSE);
	if (win_valid_any_tab(win))
	    win->w_closing = FALSE;
	// Make sure curbuf is valid. It can become invalid if 'bufhidden' is
	// "wipe".
	if (!bufref_valid(&bufref))
	    curbuf = firstbuf;
    }
}


void RenderFrameHostImpl::DidChangeName(const std::string& name,
                                        const std::string& unique_name) {
  if (GetParent() != nullptr) {
    DCHECK(!unique_name.empty());
  }
  TRACE_EVENT2("navigation", "RenderFrameHostImpl::OnDidChangeName",
               "frame_tree_node", frame_tree_node_->frame_tree_node_id(),
               "name length", name.length());

  std::string old_name = frame_tree_node()->frame_name();
  frame_tree_node()->SetFrameName(name, unique_name);
  if (old_name.empty() && !name.empty())
    frame_tree_node_->render_manager()->CreateProxiesForNewNamedFrame();
  delegate_->DidChangeName(this, name);
}


WebContents* DevToolsWindow::OpenURLFromTab(
    WebContents* source,
    const content::OpenURLParams& params) {
   DCHECK(source == main_web_contents_);
   if (!params.url.SchemeIs(content::kChromeDevToolsScheme)) {
     WebContents* inspected_web_contents = GetInspectedWebContents();
    if (!inspected_web_contents)
      return nullptr;
    content::OpenURLParams modified = params;
    modified.referrer = content::Referrer();
    return inspected_web_contents->OpenURL(modified);
   }
   bindings_->Reload();
   return main_web_contents_;
}


 allocate(struct file *file, int allocate_idat)
 {
   struct control *control = png_voidcast(struct control*, file->alloc_ptr);

    if (allocate_idat)
    {
      assert(file->idat == NULL);
      IDAT_init(&control->idat, file);
 }

 else /* chunk */
 {
      assert(file->chunk == NULL);
      chunk_init(&control->chunk, file);
 }
}


static int regex_match_glob(char *str, struct regex *r, int len __maybe_unused)
{
	if (glob_match(r->pattern, str))
		return 1;
	return 0;
}


static int get_physical_address_data(CPUState *env,

                                     target_phys_addr_t *physical, int *prot,

                                     target_ulong address, int rw, int is_user)

{

    target_ulong mask;

    unsigned int i;

    if ((env->lsu & DMMU_E) == 0) { /* DMMU disabled */

        *physical = address;

        *prot = PAGE_READ | PAGE_WRITE;

        return 0;

    }

    for (i = 0; i < 64; i++) {

        switch ((env->dtlb_tte[i] >> 61) & 3) {

        default:

        case 0x0: // 8k

            mask = 0xffffffffffffe000ULL;

            break;

        case 0x1: // 64k

            mask = 0xffffffffffff0000ULL;

            break;

        case 0x2: // 512k

            mask = 0xfffffffffff80000ULL;

            break;

        case 0x3: // 4M

            mask = 0xffffffffffc00000ULL;

            break;

        }

        // ctx match, vaddr match, valid?

        if (env->dmmuregs[1] == (env->dtlb_tag[i] & 0x1fff) &&

            (address & mask) == (env->dtlb_tag[i] & mask) &&

            (env->dtlb_tte[i] & 0x8000000000000000ULL)) {

            // access ok?

            if (((env->dtlb_tte[i] & 0x4) && is_user) ||

                (!(env->dtlb_tte[i] & 0x2) && (rw == 1))) {

                if (env->dmmuregs[3]) /* Fault status register */

                    env->dmmuregs[3] = 2; /* overflow (not read before

                                             another fault) */

                env->dmmuregs[3] |= (is_user << 3) | ((rw == 1) << 2) | 1;

                env->dmmuregs[4] = address; /* Fault address register */

                env->exception_index = TT_DFAULT;

#ifdef DEBUG_MMU

                printf("DFAULT at 0x%" PRIx64 "\n", address);

#endif

                return 1;

            }

            *physical = ((env->dtlb_tte[i] & mask) | (address & ~mask)) &

                        0x1ffffffe000ULL;

            *prot = PAGE_READ;

            if (env->dtlb_tte[i] & 0x2)

                *prot |= PAGE_WRITE;

            return 0;

        }

    }

#ifdef DEBUG_MMU

    printf("DMISS at 0x%" PRIx64 "\n", address);

#endif

    env->dmmuregs[6] = (address & ~0x1fffULL) | (env->dmmuregs[1] & 0x1fff);

    env->exception_index = TT_DMISS;

    return 1;

}


brcmf_cfg80211_escan(struct wiphy *wiphy, struct brcmf_cfg80211_vif *vif,
		     struct cfg80211_scan_request *request,
		     struct cfg80211_ssid *this_ssid)
{
	struct brcmf_if *ifp = vif->ifp;
	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
	struct cfg80211_ssid *ssids;
	u32 passive_scan;
	bool escan_req;
	bool spec_scan;
	s32 err;
	struct brcmf_ssid_le ssid_le;
	u32 SSID_len;

	brcmf_dbg(SCAN, "START ESCAN\n");

	if (test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) {
		brcmf_err("Scanning already: status (%lu)\n", cfg->scan_status);
		return -EAGAIN;
	}
	if (test_bit(BRCMF_SCAN_STATUS_ABORT, &cfg->scan_status)) {
		brcmf_err("Scanning being aborted: status (%lu)\n",
			  cfg->scan_status);
		return -EAGAIN;
	}
	if (test_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status)) {
		brcmf_err("Scanning suppressed: status (%lu)\n",
			  cfg->scan_status);
		return -EAGAIN;
	}
	if (test_bit(BRCMF_VIF_STATUS_CONNECTING, &ifp->vif->sme_state)) {
		brcmf_err("Connecting: status (%lu)\n", ifp->vif->sme_state);
		return -EAGAIN;
	}

	/* If scan req comes for p2p0, send it over primary I/F */
	if (vif == cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif)
		vif = cfg->p2p.bss_idx[P2PAPI_BSSCFG_PRIMARY].vif;

	escan_req = false;
	if (request) {
		/* scan bss */
		ssids = request->ssids;
		escan_req = true;
	} else {
		/* scan in ibss */
		/* we don't do escan in ibss */
		ssids = this_ssid;
	}

	cfg->scan_request = request;
	set_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status);
	if (escan_req) {
		cfg->escan_info.run = brcmf_run_escan;
		err = brcmf_p2p_scan_prep(wiphy, request, vif);
		if (err)
			goto scan_out;

		err = brcmf_do_escan(vif->ifp, request);
		if (err)
			goto scan_out;
	} else {
		brcmf_dbg(SCAN, "ssid \"%s\", ssid_len (%d)\n",
			  ssids->ssid, ssids->ssid_len);
		memset(&ssid_le, 0, sizeof(ssid_le));
		SSID_len = min_t(u8, sizeof(ssid_le.SSID), ssids->ssid_len);
		ssid_le.SSID_len = cpu_to_le32(0);
		spec_scan = false;
		if (SSID_len) {
			memcpy(ssid_le.SSID, ssids->ssid, SSID_len);
			ssid_le.SSID_len = cpu_to_le32(SSID_len);
			spec_scan = true;
		} else
			brcmf_dbg(SCAN, "Broadcast scan\n");

		passive_scan = cfg->active_scan ? 0 : 1;
		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PASSIVE_SCAN,
					    passive_scan);
		if (err) {
			brcmf_err("WLC_SET_PASSIVE_SCAN error (%d)\n", err);
			goto scan_out;
		}
		brcmf_scan_config_mpc(ifp, 0);
		err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCAN, &ssid_le,
					     sizeof(ssid_le));
		if (err) {
			if (err == -EBUSY)
				brcmf_dbg(INFO, "BUSY: scan for \"%s\" canceled\n",
					  ssid_le.SSID);
			else
				brcmf_err("WLC_SCAN error (%d)\n", err);

			brcmf_scan_config_mpc(ifp, 1);
			goto scan_out;
		}
	}

	/* Arm scan timeout timer */
	mod_timer(&cfg->escan_timeout, jiffies +
			BRCMF_ESCAN_TIMER_INTERVAL_MS * HZ / 1000);

	return 0;

scan_out:
	clear_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status);
	cfg->scan_request = NULL;
	return err;
}


CModule::EModRet CModule::OnBroadcast(CString& sMessage) { return CONTINUE; }


void CL_UpdateInfoPacket( netadr_t from ) {

	if ( cls.autoupdateServer.type == NA_BAD ) {
		Com_DPrintf( "CL_UpdateInfoPacket:  Auto-Updater has bad address\n" );
		return;
	}

	Com_DPrintf( "Auto-Updater resolved to %i.%i.%i.%i:%i\n",
				 cls.autoupdateServer.ip[0], cls.autoupdateServer.ip[1],
				 cls.autoupdateServer.ip[2], cls.autoupdateServer.ip[3],
				 BigShort( cls.autoupdateServer.port ) );

	if ( !NET_CompareAdr( from, cls.autoupdateServer ) ) {
		Com_DPrintf( "CL_UpdateInfoPacket:  Received packet from %i.%i.%i.%i:%i\n",
					 from.ip[0], from.ip[1], from.ip[2], from.ip[3],
					 BigShort( from.port ) );
		return;
	}

	Cvar_Set( "cl_updateavailable", Cmd_Argv( 1 ) );

	if ( !Q_stricmp( cl_updateavailable->string, "1" ) ) {
		Cvar_Set( "cl_updatefiles", Cmd_Argv( 2 ) );
		VM_Call( uivm, UI_SET_ACTIVE_MENU, UIMENU_WM_AUTOUPDATE );
	}
}


static void __f2fs_submit_merged_write(struct f2fs_sb_info *sbi,
				enum page_type type, enum temp_type temp)
{
	enum page_type btype = PAGE_TYPE_OF_BIO(type);
	struct f2fs_bio_info *io = sbi->write_io[btype] + temp;

	down_write(&io->io_rwsem);

	/* change META to META_FLUSH in the checkpoint procedure */
	if (type >= META_FLUSH) {
		io->fio.type = META_FLUSH;
		io->fio.op = REQ_OP_WRITE;
		io->fio.op_flags = REQ_META | REQ_PRIO | REQ_SYNC;
		if (!test_opt(sbi, NOBARRIER))
			io->fio.op_flags |= REQ_PREFLUSH | REQ_FUA;
	}
	__submit_merged_bio(io);
	up_write(&io->io_rwsem);
}


poppler_page_get_link_mapping (PopplerPage *page)
{
  GList *map_list = NULL;
  gint i;
  Links *links;
  Object obj;
  double width, height;

  g_return_val_if_fail (POPPLER_IS_PAGE (page), NULL);

  links = new Links (page->page->getAnnots (&obj),
		     page->document->doc->getCatalog ()->getBaseURI ());
  obj.free ();

  if (links == NULL)
    return NULL;

  poppler_page_get_size (page, &width, &height);

  for (i = 0; i < links->getNumLinks (); i++)
    {
      PopplerLinkMapping *mapping;
      PopplerRectangle rect;
      LinkAction *link_action;
      Link *link;

      link = links->getLink (i);
      link_action = link->getAction ();

      /* Create the mapping */
      mapping = g_new (PopplerLinkMapping, 1);
      mapping->action = _poppler_action_new (page->document, link_action, NULL);

      link->getRect (&rect.x1, &rect.y1, &rect.x2, &rect.y2);

      switch (page->page->getRotate ())
        {
        case 90:
	  mapping->area.x1 = rect.y1;
	  mapping->area.y1 = height - rect.x2;
	  mapping->area.x2 = mapping->area.x1 + (rect.y2 - rect.y1);
	  mapping->area.y2 = mapping->area.y1 + (rect.x2 - rect.x1);

	  break;
	case 180:
	  mapping->area.x1 = width - rect.x2;
	  mapping->area.y1 = height - rect.y2;
	  mapping->area.x2 = mapping->area.x1 + (rect.x2 - rect.x1);
	  mapping->area.y2 = mapping->area.y1 + (rect.y2 - rect.y1);

	  break;
	case 270:
	  mapping->area.x1 = width - rect.y2;
	  mapping->area.y1 = rect.x1;
	  mapping->area.x2 = mapping->area.x1 + (rect.y2 - rect.y1);
	  mapping->area.y2 = mapping->area.y1 + (rect.x2 - rect.x1);

	  break;
	default:
	  mapping->area.x1 = rect.x1;
	  mapping->area.y1 = rect.y1;
	  mapping->area.x2 = rect.x2;
	  mapping->area.y2 = rect.y2;
	}

      mapping->area.x1 -= page->page->getCropBox()->x1;
      mapping->area.x2 -= page->page->getCropBox()->x1;
      mapping->area.y1 -= page->page->getCropBox()->y1;
      mapping->area.y2 -= page->page->getCropBox()->y1;

      map_list = g_list_prepend (map_list, mapping);
    }

  delete links;

  return map_list;
}


void PrintRenderFrameHelper::PrintPreviewContext::FinalizePrintReadyDocument() {
  DCHECK(IsRendering());

  base::TimeTicks begin_time = base::TimeTicks::Now();
  metafile_->FinishDocument();

  if (print_ready_metafile_page_count_ <= 0) {
    NOTREACHED();
    return;
  }

  UMA_HISTOGRAM_MEDIUM_TIMES("PrintPreview.RenderToPDFTime",
                             document_render_time_);
  base::TimeDelta total_time =
      (base::TimeTicks::Now() - begin_time) + document_render_time_;
  UMA_HISTOGRAM_MEDIUM_TIMES("PrintPreview.RenderAndGeneratePDFTime",
                             total_time);
  UMA_HISTOGRAM_MEDIUM_TIMES("PrintPreview.RenderAndGeneratePDFTimeAvgPerPage",
                             total_time / pages_to_render_.size());
}


void check_and_dump_old_cluster ( bool live_check ) {
 if ( ! live_check ) start_postmaster ( & old_cluster , true ) ;
 get_db_and_rel_infos ( & old_cluster ) ;
 init_tablespaces ( ) ;
 get_loadable_libraries ( ) ;
 check_is_install_user ( & old_cluster ) ;
 check_proper_datallowconn ( & old_cluster ) ;
 check_for_prepared_transactions ( & old_cluster ) ;
 check_for_reg_data_type_usage ( & old_cluster ) ;
 check_for_isn_and_int8_passing_mismatch ( & old_cluster ) ;
 if ( GET_MAJOR_VERSION ( old_cluster . major_version ) <= 905 ) check_for_pg_role_prefix ( & old_cluster ) ;
 if ( GET_MAJOR_VERSION ( old_cluster . major_version ) == 904 && old_cluster . controldata . cat_ver < JSONB_FORMAT_CHANGE_CAT_VER ) check_for_jsonb_9_4_usage ( & old_cluster ) ;
 if ( GET_MAJOR_VERSION ( old_cluster . major_version ) <= 903 ) old_9_3_check_for_line_data_type_usage ( & old_cluster ) ;
 if ( GET_MAJOR_VERSION ( old_cluster . major_version ) <= 804 ) new_9_0_populate_pg_largeobject_metadata ( & old_cluster , true ) ;
 if ( ! user_opts . check ) generate_old_dump ( ) ;
 if ( ! live_check ) stop_postmaster ( false ) ;
 }


  bool has_pending_exception() {
    return !thread_local_top_.pending_exception_->IsTheHole();
  }


WebContext* WebContextGetter::GetContext() const {
  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
  return context_.get();
}


flatpak_dir_list_refs_for_name (FlatpakDir   *self,
                                FlatpakKinds kinds,
                                const char   *name,
                                GCancellable *cancellable,
                                GError      **error)
{
  g_autoptr(GPtrArray) refs = NULL;

  refs = g_ptr_array_new_with_free_func ((GDestroyNotify)flatpak_decomposed_unref);

  if ((kinds & FLATPAK_KINDS_APP) != 0)
    {
      g_autoptr(GFile) base = g_file_get_child (flatpak_dir_get_path (self), "app");

      if (!_flatpak_dir_list_refs_for_name (self, base, FLATPAK_KINDS_APP, name, refs, cancellable, error))
        return NULL;
    }

  if ((kinds & FLATPAK_KINDS_RUNTIME) != 0)
    {
      g_autoptr(GFile) base = g_file_get_child (flatpak_dir_get_path (self), "runtime");

      if (!_flatpak_dir_list_refs_for_name (self, base, FLATPAK_KINDS_RUNTIME, name, refs, cancellable, error))
        return NULL;
    }

  g_ptr_array_sort (refs, (GCompareFunc)flatpak_decomposed_strcmp_p);

  return g_steal_pointer (&refs);
}


static void gf_m2ts_process_pat(GF_M2TS_Demuxer *ts, GF_M2TS_SECTION_ES *ses, GF_List *sections, u8 table_id, u16 ex_table_id, u8 version_number, u8 last_section_number, u32 status)
{
	GF_M2TS_Program *prog;
	GF_M2TS_SECTION_ES *pmt;
	u32 i, nb_progs, evt_type;
	u32 nb_sections;
	u32 data_size;
	unsigned char *data;
	GF_M2TS_Section *section;

	/*wait for the last section */
	if (!(status&GF_M2TS_TABLE_END)) return;

	/*skip if already received*/
	if (status&GF_M2TS_TABLE_REPEAT) {
		if (ts->on_event) ts->on_event(ts, GF_M2TS_EVT_PAT_REPEAT, NULL);
		return;
	}

	nb_sections = gf_list_count(sections);
	if (nb_sections > 1) {
		GF_LOG(GF_LOG_WARNING, GF_LOG_CONTAINER, ("PAT on multiple sections not supported\n"));
	}

	section = (GF_M2TS_Section *)gf_list_get(sections, 0);
	data = section->data;
	data_size = section->data_size;

	if (!(status&GF_M2TS_TABLE_UPDATE) && gf_list_count(ts->programs)) {
		if (ts->pat->demux_restarted) {
			ts->pat->demux_restarted = 0;
		} else {
			GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("Multiple different PAT on single TS found, ignoring new PAT declaration (table id %d - extended table id %d)\n", table_id, ex_table_id));
		}
		return;
	}
	nb_progs = data_size / 4;

	for (i=0; i<nb_progs; i++) {
		u16 number, pid;
		number = (data[0]<<8) | data[1];
		pid = (data[2]&0x1f)<<8 | data[3];
		data += 4;
		if (number==0) {
			if (!ts->nit) {
				ts->nit = gf_m2ts_section_filter_new(gf_m2ts_process_nit, 0);
			}
		} else if (!pid) {
			GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("Broken PAT found reserved PID 0, ignoring\n", pid));
		} else if (! ts->ess[pid]) {
			GF_SAFEALLOC(prog, GF_M2TS_Program);
			if (!prog) {
				GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("Fail to allocate program for pid %d\n", pid));
				return;
			}
			prog->streams = gf_list_new();
			prog->pmt_pid = pid;
			prog->number = number;
			prog->ts = ts;
			gf_list_add(ts->programs, prog);
			GF_SAFEALLOC(pmt, GF_M2TS_SECTION_ES);
			if (!pmt) {
				GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("Fail to allocate pmt filter for pid %d\n", pid));
				return;
			}
			pmt->flags = GF_M2TS_ES_IS_SECTION;
			gf_list_add(prog->streams, pmt);
			pmt->pid = prog->pmt_pid;
			pmt->program = prog;
			ts->ess[pmt->pid] = (GF_M2TS_ES *)pmt;
			pmt->sec = gf_m2ts_section_filter_new(gf_m2ts_process_pmt, 0);
		}
	}

	evt_type = (status&GF_M2TS_TABLE_UPDATE) ? GF_M2TS_EVT_PAT_UPDATE : GF_M2TS_EVT_PAT_FOUND;
	if (ts->on_event) ts->on_event(ts, evt_type, NULL);
}


bool ContainerNode::appendChild(PassRefPtr<Node> newChild, ExceptionCode& ec, bool shouldLazyAttach)
{
    RefPtr<ContainerNode> protect(this);

    ASSERT(refCount() || parentOrHostNode());

    ec = 0;

    checkAddChild(newChild.get(), ec);
    if (ec)
        return false;

    if (newChild == m_lastChild) // nothing to do
        return newChild;

    NodeVector targets;
    collectChildrenAndRemoveFromOldParent(newChild.get(), targets, ec);
    if (ec)
        return false;

    if (targets.isEmpty())
        return true;

    InspectorInstrumentation::willInsertDOMNode(document(), this);

#if ENABLE(MUTATION_OBSERVERS)
    ChildListMutationScope mutation(this);
#endif

    for (NodeVector::const_iterator it = targets.begin(); it != targets.end(); ++it) {
        Node* child = it->get();

        if (child->parentNode())
            break;

        treeScope()->adoptIfNeeded(child);

        forbidEventDispatch();
        appendChildToContainer(child, this);
        allowEventDispatch();

        updateTreeAfterInsertion(this, child, shouldLazyAttach);
    }

    dispatchSubtreeModifiedEvent();
    return true;
}


QEMUClock *qemu_clock_ptr(QEMUClockType type)

{

    return &qemu_clocks[type];

}


static inline struct page *try_get_compound_head(struct page *page, int refs)
{
	struct page *head = compound_head(page);
	if (WARN_ON_ONCE(page_ref_count(head) < 0))
		return NULL;
	if (unlikely(!page_cache_add_speculative(head, refs)))
		return NULL;
	return head;
}


static void jpc_qcx_destroycompparms(jpc_qcxcp_t *compparms)
{
	if (compparms->stepsizes) {
		jas_free(compparms->stepsizes);
	}
}


static void set_default_colors(struct swaylock_colors *colors) {
	colors->background = 0xFFFFFFFF;
	colors->bs_highlight = 0xDB3300FF;
	colors->key_highlight = 0x33DB00FF;
	colors->caps_lock_bs_highlight = 0xDB3300FF;
	colors->caps_lock_key_highlight = 0x33DB00FF;
	colors->separator = 0x000000FF;
	colors->layout_background = 0x000000C0;
	colors->layout_border = 0x00000000;
	colors->layout_text = 0xFFFFFFFF;
	colors->inside = (struct swaylock_colorset){
		.input = 0x000000C0,
		.cleared = 0xE5A445C0,
		.caps_lock = 0x000000C0,
		.verifying = 0x0072FFC0,
		.wrong = 0xFA0000C0,
	};
	colors->line = (struct swaylock_colorset){
		.input = 0x000000FF,
		.cleared = 0x000000FF,
		.caps_lock = 0x000000FF,
		.verifying = 0x000000FF,
		.wrong = 0x000000FF,
	};
	colors->ring = (struct swaylock_colorset){
		.input = 0x337D00FF,
		.cleared = 0xE5A445FF,
		.caps_lock = 0xE5A445FF,
		.verifying = 0x3300FFFF,
		.wrong = 0x7D3300FF,
	};
	colors->text = (struct swaylock_colorset){
		.input = 0xE5A445FF,
		.cleared = 0x000000FF,
		.caps_lock = 0xE5A445FF,
		.verifying = 0x000000FF,
		.wrong = 0x000000FF,
	};
}


extern int as_mysql_job_start ( mysql_conn_t * mysql_conn , struct job_record * job_ptr ) {
 int rc = SLURM_SUCCESS ;
 char * nodes = NULL , * jname = NULL , * node_inx = NULL ;
 int track_steps = 0 ;
 char * block_id = NULL , * partition = NULL ;
 char temp_bit [ BUF_SIZE ] ;
 char * query = NULL ;
 int reinit = 0 ;
 time_t begin_time , check_time , start_time , submit_time ;
 uint32_t wckeyid = 0 ;
 uint32_t job_state ;
 int node_cnt = 0 ;
 uint32_t array_task_id = ( job_ptr -> array_job_id ) ? job_ptr -> array_task_id : NO_VAL ;
 uint64_t job_db_inx = job_ptr -> db_index ;
 job_array_struct_t * array_recs = job_ptr -> array_recs ;
 if ( ( ! job_ptr -> details || ! job_ptr -> details -> submit_time ) && ! job_ptr -> resize_time ) {
 error ( "as_mysql_job_start: " "Not inputing this job, it has no submit time." ) ;
 return SLURM_ERROR ;
 }
 if ( check_connection ( mysql_conn ) != SLURM_SUCCESS ) return ESLURM_DB_CONNECTION ;
 debug2 ( "as_mysql_slurmdb_job_start() called" ) ;
 job_state = job_ptr -> job_state ;
 if ( job_ptr -> resize_time ) {
 begin_time = job_ptr -> resize_time ;
 submit_time = job_ptr -> resize_time ;
 start_time = job_ptr -> resize_time ;
 }
 else {
 begin_time = job_ptr -> details -> begin_time ;
 submit_time = job_ptr -> details -> submit_time ;
 start_time = job_ptr -> start_time ;
 }
 if ( job_ptr -> state_reason == WAIT_ARRAY_TASK_LIMIT ) begin_time = INFINITE ;
 if ( IS_JOB_RESIZING ( job_ptr ) ) {
 if ( ! job_ptr -> db_index ) {
 error ( "We don't have a db_index for job %u, " "this should only happen when resizing " "jobs and the database interface was down." , job_ptr -> job_id ) ;
 job_ptr -> db_index = _get_db_index ( mysql_conn , job_ptr -> details -> submit_time , job_ptr -> job_id , job_ptr -> assoc_id ) ;
 }
 if ( job_ptr -> db_index ) as_mysql_job_complete ( mysql_conn , job_ptr ) ;
 job_state &= ( ~ JOB_RESIZING ) ;
 job_ptr -> db_index = 0 ;
 }
 job_state &= JOB_STATE_BASE ;
 if ( start_time ) check_time = start_time ;
 else if ( begin_time ) check_time = begin_time ;
 else check_time = submit_time ;
 slurm_mutex_lock ( & rollup_lock ) ;
 if ( check_time < global_last_rollup ) {
 MYSQL_RES * result = NULL ;
 MYSQL_ROW row ;
 query = xstrdup_printf ( "select job_db_inx " "from \"%s_%s\" where id_job=%u and " "time_submit=%ld and time_eligible=%ld " "and time_start=%ld;
" , mysql_conn -> cluster_name , job_table , job_ptr -> job_id , submit_time , begin_time , start_time ) ;
 if ( debug_flags & DEBUG_FLAG_DB_JOB ) DB_DEBUG ( mysql_conn -> conn , "query\n%s" , query ) ;
 if ( ! ( result = mysql_db_query_ret ( mysql_conn , query , 0 ) ) ) {
 xfree ( query ) ;
 slurm_mutex_unlock ( & rollup_lock ) ;
 return SLURM_ERROR ;
 }
 xfree ( query ) ;
 if ( ( row = mysql_fetch_row ( result ) ) ) {
 mysql_free_result ( result ) ;
 debug4 ( "revieved an update for a " "job (%u) already known about" , job_ptr -> job_id ) ;
 slurm_mutex_unlock ( & rollup_lock ) ;
 goto no_rollup_change ;
 }
 mysql_free_result ( result ) ;
 if ( job_ptr -> start_time ) debug ( "Need to reroll usage from %s Job %u " "from %s started then and we are just " "now hearing about it." , slurm_ctime2 ( & check_time ) , job_ptr -> job_id , mysql_conn -> cluster_name ) ;
 else if ( begin_time ) debug ( "Need to reroll usage from %s Job %u " "from %s became eligible then and we are just " "now hearing about it." , slurm_ctime2 ( & check_time ) , job_ptr -> job_id , mysql_conn -> cluster_name ) ;
 else debug ( "Need to reroll usage from %s Job %u " "from %s was submitted then and we are just " "now hearing about it." , slurm_ctime2 ( & check_time ) , job_ptr -> job_id , mysql_conn -> cluster_name ) ;
 global_last_rollup = check_time ;
 slurm_mutex_unlock ( & rollup_lock ) ;
 query = xstrdup_printf ( "update \"%s_%s\" set " "hourly_rollup=%ld, " "daily_rollup=%ld, monthly_rollup=%ld" , mysql_conn -> cluster_name , last_ran_table , check_time , check_time , check_time ) ;
 if ( debug_flags & DEBUG_FLAG_DB_JOB ) DB_DEBUG ( mysql_conn -> conn , "query\n%s" , query ) ;
 rc = mysql_db_query ( mysql_conn , query ) ;
 xfree ( query ) ;
 }
 else slurm_mutex_unlock ( & rollup_lock ) ;
 no_rollup_change : if ( job_ptr -> name && job_ptr -> name [ 0 ] ) jname = job_ptr -> name ;
 else {
 jname = "allocation" ;
 track_steps = 1 ;
 }
 if ( job_ptr -> nodes && job_ptr -> nodes [ 0 ] ) nodes = job_ptr -> nodes ;
 else nodes = "None assigned" ;
 if ( job_ptr -> batch_flag ) track_steps = 1 ;
 if ( slurmdbd_conf ) {
 block_id = xstrdup ( job_ptr -> comment ) ;
 node_cnt = job_ptr -> total_nodes ;
 node_inx = job_ptr -> network ;
 }
 else {
 if ( job_ptr -> node_bitmap ) {
 node_inx = bit_fmt ( temp_bit , sizeof ( temp_bit ) , job_ptr -> node_bitmap ) ;
 }
 # ifdef HAVE_BG select_g_select_jobinfo_get ( job_ptr -> select_jobinfo , SELECT_JOBDATA_BLOCK_ID , & block_id ) ;
 select_g_select_jobinfo_get ( job_ptr -> select_jobinfo , SELECT_JOBDATA_NODE_CNT , & node_cnt ) ;
 # else node_cnt = job_ptr -> total_nodes ;
 # endif }
 if ( job_ptr -> assoc_id && ( ! job_ptr -> db_index || job_ptr -> wckey ) ) wckeyid = _get_wckeyid ( mysql_conn , & job_ptr -> wckey , job_ptr -> user_id , mysql_conn -> cluster_name , job_ptr -> assoc_id ) ;
 if ( ! IS_JOB_PENDING ( job_ptr ) && job_ptr -> part_ptr ) partition = job_ptr -> part_ptr -> name ;
 else if ( job_ptr -> partition ) partition = job_ptr -> partition ;
 if ( ! job_ptr -> db_index ) {
 query = xstrdup_printf ( "insert into \"%s_%s\" " "(id_job, mod_time, id_array_job, id_array_task, " "id_assoc, id_qos, id_user, " "id_group, nodelist, id_resv, timelimit, " "time_eligible, time_submit, time_start, " "job_name, track_steps, state, priority, cpus_req, " "nodes_alloc, mem_req" , mysql_conn -> cluster_name , job_table ) ;
 if ( wckeyid ) xstrcat ( query , ", id_wckey" ) ;
 if ( job_ptr -> account ) xstrcat ( query , ", account" ) ;
 if ( partition ) xstrcat ( query , ", `partition`" ) ;
 if ( block_id ) xstrcat ( query , ", id_block" ) ;
 if ( job_ptr -> wckey ) xstrcat ( query , ", wckey" ) ;
 if ( node_inx ) xstrcat ( query , ", node_inx" ) ;
 if ( job_ptr -> gres_req ) xstrcat ( query , ", gres_req" ) ;
 if ( job_ptr -> gres_alloc ) xstrcat ( query , ", gres_alloc" ) ;
 if ( array_recs && array_recs -> task_id_str ) xstrcat ( query , ", array_task_str, array_max_tasks, " "array_task_pending" ) ;
 else xstrcat ( query , ", array_task_str, array_task_pending" ) ;
 if ( job_ptr -> tres_alloc_str ) xstrcat ( query , ", tres_alloc" ) ;
 if ( job_ptr -> tres_req_str ) xstrcat ( query , ", tres_req" ) ;
 xstrfmtcat ( query , ") values (%u, UNIX_TIMESTAMP(), " "%u, %u, %u, %u, %u, %u, " "'%s', %u, %u, %ld, %ld, %ld, " "'%s', %u, %u, %u, %u, %u, %" PRIu64 "" , job_ptr -> job_id , job_ptr -> array_job_id , array_task_id , job_ptr -> assoc_id , job_ptr -> qos_id , job_ptr -> user_id , job_ptr -> group_id , nodes , job_ptr -> resv_id , job_ptr -> time_limit , begin_time , submit_time , start_time , jname , track_steps , job_state , job_ptr -> priority , job_ptr -> details -> min_cpus , node_cnt , job_ptr -> details -> pn_min_memory ) ;
 if ( wckeyid ) xstrfmtcat ( query , ", %u" , wckeyid ) ;
 if ( job_ptr -> account ) xstrfmtcat ( query , ", '%s'" , job_ptr -> account ) ;
 if ( partition ) xstrfmtcat ( query , ", '%s'" , partition ) ;
 if ( block_id ) xstrfmtcat ( query , ", '%s'" , block_id ) ;
 if ( job_ptr -> wckey ) xstrfmtcat ( query , ", '%s'" , job_ptr -> wckey ) ;
 if ( node_inx ) xstrfmtcat ( query , ", '%s'" , node_inx ) ;
 if ( job_ptr -> gres_req ) xstrfmtcat ( query , ", '%s'" , job_ptr -> gres_req ) ;
 if ( job_ptr -> gres_alloc ) xstrfmtcat ( query , ", '%s'" , job_ptr -> gres_alloc ) ;
 if ( array_recs && array_recs -> task_id_str ) xstrfmtcat ( query , ", '%s', %u, %u" , array_recs -> task_id_str , array_recs -> max_run_tasks , array_recs -> task_cnt ) ;
 else xstrcat ( query , ", NULL, 0" ) ;
 if ( job_ptr -> tres_alloc_str ) xstrfmtcat ( query , ", '%s'" , job_ptr -> tres_alloc_str ) ;
 if ( job_ptr -> tres_req_str ) xstrfmtcat ( query , ", '%s'" , job_ptr -> tres_req_str ) ;
 xstrfmtcat ( query , ") on duplicate key update " "job_db_inx=LAST_INSERT_ID(job_db_inx), " "id_user=%u, id_group=%u, " "nodelist='%s', id_resv=%u, timelimit=%u, " "time_submit=%ld, time_eligible=%ld, " "time_start=%ld, mod_time=UNIX_TIMESTAMP(), " "job_name='%s', track_steps=%u, id_qos=%u, " "state=greatest(state, %u), priority=%u, " "cpus_req=%u, nodes_alloc=%u, " "mem_req=%" PRIu64 ", id_array_job=%u, id_array_task=%u" , job_ptr -> user_id , job_ptr -> group_id , nodes , job_ptr -> resv_id , job_ptr -> time_limit , submit_time , begin_time , start_time , jname , track_steps , job_ptr -> qos_id , job_state , job_ptr -> priority , job_ptr -> details -> min_cpus , node_cnt , job_ptr -> details -> pn_min_memory , job_ptr -> array_job_id , array_task_id ) ;
 if ( wckeyid ) xstrfmtcat ( query , ", id_wckey=%u" , wckeyid ) ;
 if ( job_ptr -> account ) xstrfmtcat ( query , ", account='%s'" , job_ptr -> account ) ;
 if ( partition ) xstrfmtcat ( query , ", `partition`='%s'" , partition ) ;
 if ( block_id ) xstrfmtcat ( query , ", id_block='%s'" , block_id ) ;
 if ( job_ptr -> wckey ) xstrfmtcat ( query , ", wckey='%s'" , job_ptr -> wckey ) ;
 if ( node_inx ) xstrfmtcat ( query , ", node_inx='%s'" , node_inx ) ;
 if ( job_ptr -> gres_req ) xstrfmtcat ( query , ", gres_req='%s'" , job_ptr -> gres_req ) ;
 if ( job_ptr -> gres_alloc ) xstrfmtcat ( query , ", gres_alloc='%s'" , job_ptr -> gres_alloc ) ;
 if ( array_recs && array_recs -> task_id_str ) xstrfmtcat ( query , ", array_task_str='%s', " "array_max_tasks=%u, array_task_pending=%u" , array_recs -> task_id_str , array_recs -> max_run_tasks , array_recs -> task_cnt ) ;
 else xstrfmtcat ( query , ", array_task_str=NULL, " "array_task_pending=0" ) ;
 if ( job_ptr -> tres_alloc_str ) xstrfmtcat ( query , ", tres_alloc='%s'" , job_ptr -> tres_alloc_str ) ;
 if ( job_ptr -> tres_req_str ) xstrfmtcat ( query , ", tres_req='%s'" , job_ptr -> tres_req_str ) ;
 if ( debug_flags & DEBUG_FLAG_DB_JOB ) DB_DEBUG ( mysql_conn -> conn , "query\n%s" , query ) ;
 try_again : if ( ! ( job_ptr -> db_index = mysql_db_insert_ret_id ( mysql_conn , query ) ) ) {
 if ( ! reinit ) {
 error ( "It looks like the storage has gone " "away trying to reconnect" ) ;
 check_connection ( mysql_conn ) ;
 reinit = 1 ;
 goto try_again ;
 }
 else rc = SLURM_ERROR ;
 }
 }
 else {
 query = xstrdup_printf ( "update \"%s_%s\" set nodelist='%s', " , mysql_conn -> cluster_name , job_table , nodes ) ;
 if ( wckeyid ) xstrfmtcat ( query , "id_wckey=%u, " , wckeyid ) ;
 if ( job_ptr -> account ) xstrfmtcat ( query , "account='%s', " , job_ptr -> account ) ;
 if ( partition ) xstrfmtcat ( query , "`partition`='%s', " , partition ) ;
 if ( block_id ) xstrfmtcat ( query , "id_block='%s', " , block_id ) ;
 if ( job_ptr -> wckey ) xstrfmtcat ( query , "wckey='%s', " , job_ptr -> wckey ) ;
 if ( node_inx ) xstrfmtcat ( query , "node_inx='%s', " , node_inx ) ;
 if ( job_ptr -> gres_req ) xstrfmtcat ( query , "gres_req='%s', " , job_ptr -> gres_req ) ;
 if ( job_ptr -> gres_alloc ) xstrfmtcat ( query , "gres_alloc='%s', " , job_ptr -> gres_alloc ) ;
 if ( array_recs && array_recs -> task_id_str ) xstrfmtcat ( query , "array_task_str='%s', " "array_max_tasks=%u, " "array_task_pending=%u, " , array_recs -> task_id_str , array_recs -> max_run_tasks , array_recs -> task_cnt ) ;
 else xstrfmtcat ( query , "array_task_str=NULL, " "array_task_pending=0, " ) ;
 if ( job_ptr -> tres_alloc_str ) xstrfmtcat ( query , "tres_alloc='%s', " , job_ptr -> tres_alloc_str ) ;
 if ( job_ptr -> tres_req_str ) xstrfmtcat ( query , "tres_req='%s', " , job_ptr -> tres_req_str ) ;
 xstrfmtcat ( query , "time_start=%ld, job_name='%s', state=%u, " "nodes_alloc=%u, id_qos=%u, " "id_assoc=%u, id_resv=%u, " "timelimit=%u, mem_req=%" PRIu64 ", " "id_array_job=%u, id_array_task=%u, " "time_eligible=%ld, mod_time=UNIX_TIMESTAMP() " "where job_db_inx=%" PRIu64 , start_time , jname , job_state , node_cnt , job_ptr -> qos_id , job_ptr -> assoc_id , job_ptr -> resv_id , job_ptr -> time_limit , job_ptr -> details -> pn_min_memory , job_ptr -> array_job_id , array_task_id , begin_time , job_ptr -> db_index ) ;
 if ( debug_flags & DEBUG_FLAG_DB_JOB ) DB_DEBUG ( mysql_conn -> conn , "query\n%s" , query ) ;
 rc = mysql_db_query ( mysql_conn , query ) ;
 }
 xfree ( block_id ) ;
 xfree ( query ) ;
 if ( IS_JOB_RESIZING ( job_ptr ) ) {
 if ( IS_JOB_SUSPENDED ( job_ptr ) ) as_mysql_suspend ( mysql_conn , job_db_inx , job_ptr ) ;
 }
 return rc ;
 }


Variant HHVM_FUNCTION(HH_last_key, const Variant& v) {
  // 1. array, vec, dict, keyset
  if (v.isArray() || v.isClsMeth()) {
    auto arr = v.toArray();
    if (arr->empty()) {
      return init_null();
    }
    return arr->getKey(arr->iter_last());
  }

  if (v.isObject()) {
    auto obj = v.asCObjRef();
    // 2. collection
    if (obj->isCollection()) {
      // Pair
      if (obj->collectionType() == CollectionType::Pair) {
        return Variant::wrap(make_tv<KindOfInt64>(1));
      }

      // Vector, Map, Set, and Imm variants
      auto arr = collections::asArray(obj.get());
      if (arr->empty()) {
        return init_null();
      }
      return arr->getKey(arr->iter_last());
    }
  }
  SystemLib::throwInvalidArgumentExceptionObject(
    "Argument 1 passed to HH\\Lib\\_Private\\Native\\last_key() "
    "must be a Container");
}


qf_alloc_stack(qfltype_T qfltype)
{
    qf_info_T *qi;

    qi = ALLOC_CLEAR_ONE_ID(qf_info_T, aid_qf_qfinfo);
    if (qi != NULL)
    {
	qi->qf_refcount++;
	qi->qfl_type = qfltype;
	qi->qf_bufnr = INVALID_QFBUFNR;
    }
    return qi;
}


PassRefPtrWillBeRawPtr<TagCollection> ContainerNode::getElementsByTagNameNS(const AtomicString& namespaceURI, const AtomicString& localName)
{
    if (localName.isNull())
        return nullptr;

    if (namespaceURI == starAtom)
        return getElementsByTagName(localName);

    return ensureCachedCollection<TagCollection>(TagCollectionType, namespaceURI.isEmpty() ? nullAtom : namespaceURI, localName);
}


static int mailimf_id_right_parse(const char * message, size_t length,
				  size_t * indx, char ** result)
{
  int r;

  r = mailimf_dot_atom_text_parse(message, length, indx, result);
  switch (r) {
  case MAILIMF_NO_ERROR:
    return MAILIMF_NO_ERROR;
  case MAILIMF_ERROR_PARSE:
    break;
  default:
    return r;
  }

  r = mailimf_no_fold_literal_parse(message, length, indx, result);
  if (r != MAILIMF_NO_ERROR)
    return r;

  return MAILIMF_NO_ERROR;
}


blk_qc_t direct_make_request(struct bio *bio)
{
	struct request_queue *q = bio->bi_disk->queue;
	bool nowait = bio->bi_opf & REQ_NOWAIT;
	blk_qc_t ret;

	if (!generic_make_request_checks(bio))
		return BLK_QC_T_NONE;

	if (unlikely(blk_queue_enter(q, nowait ? BLK_MQ_REQ_NOWAIT : 0))) {
		if (nowait && !blk_queue_dying(q))
			bio->bi_status = BLK_STS_AGAIN;
		else
			bio->bi_status = BLK_STS_IOERR;
		bio_endio(bio);
		return BLK_QC_T_NONE;
	}

	ret = q->make_request_fn(q, bio);
	blk_queue_exit(q);
	return ret;
}


ZSTD_compress_insertDictionary(ZSTD_compressedBlockState_t* bs,
                               ZSTD_matchState_t* ms,
                         const ZSTD_CCtx_params* params,
                         const void* dict, size_t dictSize,
                               ZSTD_dictContentType_e dictContentType,
                               ZSTD_dictTableLoadMethod_e dtlm,
                               void* workspace)
{
    DEBUGLOG(4, "ZSTD_compress_insertDictionary (dictSize=%u)", (U32)dictSize);
    if ((dict==NULL) || (dictSize<=8)) return 0;

    ZSTD_reset_compressedBlockState(bs);

    /* dict restricted modes */
    if (dictContentType == ZSTD_dct_rawContent)
        return ZSTD_loadDictionaryContent(ms, params, dict, dictSize, dtlm);

    if (MEM_readLE32(dict) != ZSTD_MAGIC_DICTIONARY) {
        if (dictContentType == ZSTD_dct_auto) {
            DEBUGLOG(4, "raw content dictionary detected");
            return ZSTD_loadDictionaryContent(ms, params, dict, dictSize, dtlm);
        }
        if (dictContentType == ZSTD_dct_fullDict)
            return ERROR(dictionary_wrong);
        assert(0);   /* impossible */
    }

    /* dict as full zstd dictionary */
    return ZSTD_loadZstdDictionary(bs, ms, params, dict, dictSize, dtlm, workspace);
}


static int snd_msnd_write_cfg(int cfg, int reg, int value)
{
	outb(reg, cfg);
	outb(value, cfg + 1);
	if (value != inb(cfg + 1)) {
		printk(KERN_ERR LOGNAME ": snd_msnd_write_cfg: I/O error\n");
		return -EIO;
	}
	return 0;
}


ServiceWorkerContainer* NavigatorServiceWorker::serviceWorker(Navigator& navigator, ExceptionState& exceptionState)
 {
     return NavigatorServiceWorker::from(navigator).serviceWorker(exceptionState);
 }


static int decode_user_data(Mpeg4DecContext *ctx, GetBitContext *gb)

{

    MpegEncContext *s = &ctx->m;

    char buf[256];

    int i;

    int e;

    int ver = 0, build = 0, ver2 = 0, ver3 = 0;

    char last;

    for (i = 0; i < 255 && get_bits_count(gb) < gb->size_in_bits; i++) {

        if (show_bits(gb, 23) == 0)

            break;

        buf[i] = get_bits(gb, 8);

    }

    buf[i] = 0;

    /* divx detection */

    e = sscanf(buf, "DivX%dBuild%d%c", &ver, &build, &last);

    if (e < 2)

        e = sscanf(buf, "DivX%db%d%c", &ver, &build, &last);

    if (e >= 2) {

        ctx->divx_version = ver;

        ctx->divx_build   = build;

        s->divx_packed  = e == 3 && last == 'p';

    }

    /* libavcodec detection */

    e = sscanf(buf, "FFmpe%*[^b]b%d", &build) + 3;

    if (e != 4)

        e = sscanf(buf, "FFmpeg v%d.%d.%d / libavcodec build: %d", &ver, &ver2, &ver3, &build);

    if (e != 4) {

        e = sscanf(buf, "Lavc%d.%d.%d", &ver, &ver2, &ver3) + 1;

        if (e > 1) {

            if (ver > 0xFF || ver2 > 0xFF || ver3 > 0xFF) {

                av_log(s->avctx, AV_LOG_WARNING,

                     "Unknown Lavc version string encountered, %d.%d.%d; "

                     "clamping sub-version values to 8-bits.\n",

                     ver, ver2, ver3);

            }

            build = ((ver & 0xFF) << 16) + ((ver2 & 0xFF) << 8) + (ver3 & 0xFF);

        }

    }

    if (e != 4) {

        if (strcmp(buf, "ffmpeg") == 0)

            ctx->lavc_build = 4600;

    }

    if (e == 4)

        ctx->lavc_build = build;

    /* Xvid detection */

    e = sscanf(buf, "XviD%d", &build);

    if (e == 1)

        ctx->xvid_build = build;

    return 0;

}


static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr, char* key_name TSRMLS_DC)
{
	zval**	ele_value    	= NULL;
	int 	i 		= 0;
	int 	isFirstSubtag 	= 0;
	int 	max_value 	= 0;

	/* Variant/ Extlang/Private etc. */
	if( zend_hash_find( hash_arr , key_name , strlen(key_name) + 1 ,(void **)&ele_value ) == SUCCESS ) {
		if( Z_TYPE_PP(ele_value) == IS_STRING ){
			add_prefix( loc_name , key_name);

			smart_str_appendl(loc_name, SEPARATOR , sizeof(SEPARATOR)-1);
			smart_str_appendl(loc_name, Z_STRVAL_PP(ele_value) , Z_STRLEN_PP(ele_value));
			return SUCCESS;
		} else if(Z_TYPE_PP(ele_value) == IS_ARRAY ) {
			HashPosition pos;
			HashTable *arr = HASH_OF(*ele_value);
			zval **data = NULL;

			zend_hash_internal_pointer_reset_ex(arr, &pos);
			while(zend_hash_get_current_data_ex(arr, (void **)&data, &pos) != FAILURE) {
				if(Z_TYPE_PP(data) != IS_STRING) {
					return FAILURE;
				}
				if (isFirstSubtag++ == 0){
					add_prefix(loc_name , key_name);
				}
				smart_str_appendl(loc_name, SEPARATOR , sizeof(SEPARATOR)-1);
				smart_str_appendl(loc_name, Z_STRVAL_PP(data) , Z_STRLEN_PP(data));
				zend_hash_move_forward_ex(arr, &pos);
			}
			return SUCCESS;
		} else {
			return FAILURE;
		}
	} else {
		char cur_key_name[31];
		/* Decide the max_value: the max. no. of elements allowed */
		if( strcmp(key_name , LOC_VARIANT_TAG) ==0 ){
			max_value  = MAX_NO_VARIANT;
		}
		if( strcmp(key_name , LOC_EXTLANG_TAG) ==0 ){
			max_value  = MAX_NO_EXTLANG;
		}
		if( strcmp(key_name , LOC_PRIVATE_TAG) ==0 ){
			max_value  = MAX_NO_PRIVATE;
		}

		/* Multiple variant values as variant0, variant1 ,variant2 */
		isFirstSubtag = 0;
		for( i=0 ; i< max_value; i++ ){
			snprintf( cur_key_name , 30, "%s%d", key_name , i);
			if( zend_hash_find( hash_arr , cur_key_name , strlen(cur_key_name) + 1,(void **)&ele_value ) == SUCCESS ){
				if( Z_TYPE_PP(ele_value)!= IS_STRING ){
					/* variant is not a string */
					return FAILURE;
				}
				/* Add the contents */
				if (isFirstSubtag++ == 0){
					add_prefix(loc_name , cur_key_name);
				}
				smart_str_appendl(loc_name, SEPARATOR , sizeof(SEPARATOR)-1);
				smart_str_appendl(loc_name, Z_STRVAL_PP(ele_value) , Z_STRLEN_PP(ele_value));
			}
		} /* end of for */
	} /* end of else */

	return SUCCESS;
}


int snd_sof_ipc_set_get_comp_data(struct snd_sof_ipc *ipc,
				  struct snd_sof_control *scontrol,
				  u32 ipc_cmd,
				  enum sof_ipc_ctrl_type ctrl_type,
				  enum sof_ipc_ctrl_cmd ctrl_cmd,
				  bool send)
{
	struct sof_ipc_ctrl_data *cdata = scontrol->control_data;
	struct snd_sof_dev *sdev = ipc->sdev;
	struct sof_ipc_fw_ready *ready = &sdev->fw_ready;
	struct sof_ipc_fw_version *v = &ready->version;
	struct sof_ipc_ctrl_data_params sparams;
	size_t send_bytes;
	int err;

	/* read or write firmware volume */
	if (scontrol->readback_offset != 0) {
		/* write/read value header via mmaped region */
		send_bytes = sizeof(struct sof_ipc_ctrl_value_chan) *
		cdata->num_elems;
		if (send)
			snd_sof_dsp_block_write(sdev, sdev->mmio_bar,
						scontrol->readback_offset,
						cdata->chanv, send_bytes);

		else
			snd_sof_dsp_block_read(sdev, sdev->mmio_bar,
					       scontrol->readback_offset,
					       cdata->chanv, send_bytes);
		return 0;
	}

	cdata->rhdr.hdr.cmd = SOF_IPC_GLB_COMP_MSG | ipc_cmd;
	cdata->cmd = ctrl_cmd;
	cdata->type = ctrl_type;
	cdata->comp_id = scontrol->comp_id;
	cdata->msg_index = 0;

	/* calculate header and data size */
	switch (cdata->type) {
	case SOF_CTRL_TYPE_VALUE_CHAN_GET:
	case SOF_CTRL_TYPE_VALUE_CHAN_SET:
		sparams.msg_bytes = scontrol->num_channels *
			sizeof(struct sof_ipc_ctrl_value_chan);
		sparams.hdr_bytes = sizeof(struct sof_ipc_ctrl_data);
		sparams.elems = scontrol->num_channels;
		break;
	case SOF_CTRL_TYPE_VALUE_COMP_GET:
	case SOF_CTRL_TYPE_VALUE_COMP_SET:
		sparams.msg_bytes = scontrol->num_channels *
			sizeof(struct sof_ipc_ctrl_value_comp);
		sparams.hdr_bytes = sizeof(struct sof_ipc_ctrl_data);
		sparams.elems = scontrol->num_channels;
		break;
	case SOF_CTRL_TYPE_DATA_GET:
	case SOF_CTRL_TYPE_DATA_SET:
		sparams.msg_bytes = cdata->data->size;
		sparams.hdr_bytes = sizeof(struct sof_ipc_ctrl_data) +
			sizeof(struct sof_abi_hdr);
		sparams.elems = cdata->data->size;
		break;
	default:
		return -EINVAL;
	}

	cdata->rhdr.hdr.size = sparams.msg_bytes + sparams.hdr_bytes;
	cdata->num_elems = sparams.elems;
	cdata->elems_remaining = 0;

	/* send normal size ipc in one part */
	if (cdata->rhdr.hdr.size <= SOF_IPC_MSG_MAX_SIZE) {
		err = sof_ipc_tx_message(sdev->ipc, cdata->rhdr.hdr.cmd, cdata,
					 cdata->rhdr.hdr.size, cdata,
					 cdata->rhdr.hdr.size);

		if (err < 0)
			dev_err(sdev->dev, "error: set/get ctrl ipc comp %d\n",
				cdata->comp_id);

		return err;
	}

	/* data is bigger than max ipc size, chop into smaller pieces */
	dev_dbg(sdev->dev, "large ipc size %u, control size %u\n",
		cdata->rhdr.hdr.size, scontrol->size);

	/* large messages is only supported from ABI 3.3.0 onwards */
	if (v->abi_version < SOF_ABI_VER(3, 3, 0)) {
		dev_err(sdev->dev, "error: incompatible FW ABI version\n");
		return -EINVAL;
	}

	err = sof_set_get_large_ctrl_data(sdev, cdata, &sparams, send);

	if (err < 0)
		dev_err(sdev->dev, "error: set/get large ctrl ipc comp %d\n",
			cdata->comp_id);

	return err;
}


int vhost_dev_init(struct vhost_dev *hdev, void *opaque,

                   VhostBackendType backend_type, uint32_t busyloop_timeout)

{

    uint64_t features;

    int i, r;

    hdev->migration_blocker = NULL;

    r = vhost_set_backend_type(hdev, backend_type);

    assert(r >= 0);

    r = hdev->vhost_ops->vhost_backend_init(hdev, opaque);

    if (r < 0) {

        goto fail;

    }

    if (used_memslots > hdev->vhost_ops->vhost_backend_memslots_limit(hdev)) {

        fprintf(stderr, "vhost backend memory slots limit is less"

                " than current number of present memory slots\n");

        r = -1;

        goto fail;

    }

    QLIST_INSERT_HEAD(&vhost_devices, hdev, entry);

    r = hdev->vhost_ops->vhost_set_owner(hdev);

    if (r < 0) {

        goto fail;

    }

    r = hdev->vhost_ops->vhost_get_features(hdev, &features);

    if (r < 0) {

        goto fail;

    }

    for (i = 0; i < hdev->nvqs; ++i) {

        r = vhost_virtqueue_init(hdev, hdev->vqs + i, hdev->vq_index + i);

        if (r < 0) {

            goto fail_vq;

        }

    }

    if (busyloop_timeout) {

        for (i = 0; i < hdev->nvqs; ++i) {

            r = vhost_virtqueue_set_busyloop_timeout(hdev, hdev->vq_index + i,

                                                     busyloop_timeout);

            if (r < 0) {

                goto fail_busyloop;

            }

        }

    }

    hdev->features = features;

    hdev->memory_listener = (MemoryListener) {

        .begin = vhost_begin,

        .commit = vhost_commit,

        .region_add = vhost_region_add,

        .region_del = vhost_region_del,

        .region_nop = vhost_region_nop,

        .log_start = vhost_log_start,

        .log_stop = vhost_log_stop,

        .log_sync = vhost_log_sync,

        .log_global_start = vhost_log_global_start,

        .log_global_stop = vhost_log_global_stop,

        .eventfd_add = vhost_eventfd_add,

        .eventfd_del = vhost_eventfd_del,

        .priority = 10

    };

    if (hdev->migration_blocker == NULL) {

        if (!(hdev->features & (0x1ULL << VHOST_F_LOG_ALL))) {

            error_setg(&hdev->migration_blocker,

                       "Migration disabled: vhost lacks VHOST_F_LOG_ALL feature.");

        } else if (!qemu_memfd_check()) {

            error_setg(&hdev->migration_blocker,

                       "Migration disabled: failed to allocate shared memory");

        }

    }

    if (hdev->migration_blocker != NULL) {

        migrate_add_blocker(hdev->migration_blocker);

    }

    hdev->mem = g_malloc0(offsetof(struct vhost_memory, regions));

    hdev->n_mem_sections = 0;

    hdev->mem_sections = NULL;

    hdev->log = NULL;

    hdev->log_size = 0;

    hdev->log_enabled = false;

    hdev->started = false;

    hdev->memory_changed = false;

    memory_listener_register(&hdev->memory_listener, &address_space_memory);

    return 0;

fail_busyloop:

    while (--i >= 0) {

        vhost_virtqueue_set_busyloop_timeout(hdev, hdev->vq_index + i, 0);

    }

    i = hdev->nvqs;

fail_vq:

    while (--i >= 0) {

        vhost_virtqueue_cleanup(hdev->vqs + i);

    }

fail:

    r = -errno;

    hdev->vhost_ops->vhost_backend_cleanup(hdev);

    QLIST_REMOVE(hdev, entry);

    return r;

}


lzh_decode_huffman(struct huffman *hf, unsigned rbits)
{
	int c;
	/*
	 * At first search an index table for a bit pattern.
	 * If it fails, search a huffman tree for.
	 */
	c = hf->tbl[rbits >> hf->shift_bits];
	if (c < hf->len_avail || hf->len_avail == 0)
		return (c);
	/* This bit pattern needs to be found out at a huffman tree. */
	return (lzh_decode_huffman_tree(hf, rbits, c));
}