This transmute/move_val_init look like the only unsafe portions of this function.