module BUFGCE(
  I,
  CE,
  O 
);

input  I;
input  CE;
output O;

wire clk_in;
wire external_en;

assign clk_in = I;
assign external_en = CE;

reg    clk_en_af_latch;
always @(clk_in or external_en)
begin
  if(!clk_in)
    clk_en_af_latch <= external_en;
end

reg clk_en ;
always @ (clk_en_af_latch )
begin
    clk_en <= clk_en_af_latch;
end
assign O = clk_in && clk_en ;

endmodule