fix ast ffi for cases