rem: int extra_height;
context: smartPlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,                 unsigned int width, unsigned int height,		 WArea usableArea){    WScreen *scr = wwin->screen_ptr;    int test_x = 0, test_y = Y_ORIGIN(scr);    int from_x, to_x, from_y, to_y;    int sx;    int min_isect, min_isect_x, min_isect_y;    int sum_isect;    int extra_height;    if (wwin->frame)	extra_height = wwin->frame->top_width + wwin->frame->bottom_width;    else        extra_height = 24; /* random value */    sx = X_ORIGIN(scr);    min_isect = INT_MAX;    min_isect_x = sx;    min_isect_y = test_y;        height += extra_height;    while (((test_y + height) < usableArea.y2)) {	test_x = sx;	while ((test_x + width) < usableArea.x2) {            sum_isect = calcSumOfCoveredAreas(wwin, test_x, test_y,                                              width, height);	    if (sum_isect < min_isect) {	        min_isect = sum_isect;	        min_isect_x = test_x;	        min_isect_y = test_y;	    }	    	    test_x += PLACETEST_HSTEP;	}	test_y += PLACETEST_VSTEP;    }    from_x = min_isect_x - PLACETEST_HSTEP + 1;    from_x = WMAX(from_x, X_ORIGIN(scr));    to_x = min_isect_x + PLACETEST_HSTEP;    if (to_x + width > usableArea.x2)        to_x = usableArea.x2 - width;    from_y = min_isect_y - PLACETEST_VSTEP + 1;    from_y = WMAX(from_y, Y_ORIGIN(scr));    to_y = min_isect_y + PLACETEST_VSTEP;    if (to_y + height > usableArea.y2)        to_y = usableArea.y2 - height;    for (test_x = from_x; test_x < to_x; test_x++) {        for (test_y = from_y; test_y < to_y; test_y++) {            sum_isect = calcSumOfCoveredAreas(wwin, test_x, test_y,                                              width, height);	    if (sum_isect < min_isect) {	        min_isect = sum_isect;	        min_isect_x = test_x;	        min_isect_y = test_y;	    }        }    }    *x_ret = min_isect_x;    *y_ret = min_isect_y;}