if(!not_transparent) { *src = 0; src[1] = 0; src[2] = 0; }
il_alpha_mask(    PRUint8 *src,                 /* RGBa, input data */    int src_len,                /* Number of pixels in source row */    int x_offset,               /* Destination offset from left edge */    PRUint8 XP_HUGE *maskp,       /* Output pointer, left-justified bitmask */    int mask_len,               /* Number of pixels in output row */    il_draw_mode draw_mode)     /* ilOverlay or ilErase */{    int not_transparent,n =0;    int output_bits_remaining = mask_len;    PRUint32 bgmask32 = 0;        /* 32-bit temporary mask accumulators */    PRUint32 fgmask32 = 0;    int mask_bit;               /* next bit to write in setmask32 */        PRUint32 *m = ((PRUint32*)maskp) + (x_offset >> 5);    mask_bit = ~x_offset & 0x1f;    PR_ASSERT(mask_len);   // mask_len = (int)mask_len;    /* Handle case in which we have a mask for a non-transparent       image.  This can happen when we have a LOSRC that is a transparent       GIF and a SRC that is a JPEG.  For now, we avoid crashing.  Later       we should fix that case so it does the right thing and gets rid       of the mask. */    if (!src)        return;    /* Scaling down  (or source and dest same size) ... */       if (src_len >= mask_len)    {              while (output_bits_remaining ) {	        int tmprand=0;	        tmprand = 1+(int)(200.0*rand()/(RAND_MAX+1.0));            not_transparent = (*(src+3) > tmprand);	             SHIFT_IMAGE_MASK(not_transparent);            n += src_len;            while ( n >= mask_len){                src += 4;                n -= mask_len;            }        }    }    else      /* Scaling up */    {        while (output_bits_remaining) {	        int tmprand=0;            n += mask_len;            while (n >= src_len) {               tmprand = 1+(int)(200.0*rand()/(RAND_MAX+1.0));               not_transparent = (*(src+3) > tmprand);                SHIFT_IMAGE_MASK(not_transparent);                n -= src_len;            }            src +=4;        }    }        /* End of scan line. Write out any remaining mask bits. */     if (mask_bit < 31) {        PRUint32 mtmp = *m;        mtmp |= fgmask32;        if (draw_mode == ilErase)            mtmp &= ~bgmask32;         *m = mtmp;     }  }