How to create a sub memref descriptor from a multi-dimensional memref?

Hello everyone, I’m new to LLVM and MLIR. I encountered a question while trying to write a simple compiler: How to create a memref, for example, memref<10xi32> without metadata from memref<5x10xi32>?

To be more specific, what i want to describe is the following operations in C:

int arr[5][10];

// pass one line to a function
int func(int []);
func(arr[0]);

My previous try was something like this:

    // %5 is an i32 value from runtime
    %6 = arith.index_cast %5 : i32 to index
    %7 = memref.get_global @n : memref<5x10xi32>
    %subview = memref.subview %7[%6, 0] [1, 10] [1, 1] : memref<5x10xi32> to memref<10xi32, strided<[1], offset: ?>>
    %cast = memref.cast %subview : memref<10xi32, strided<[1], offset: ?>> to memref<10xi32>
    %8 = memref.load %alloca_0[] : memref<i32>
    %cast_4 = memref.cast %cast : memref<10xi32> to memref<?xi32>
    call @func(%cast_4, %8) : (memref<?xi32>, i32) -> ()

Sadly it does not work. And after lowering the code above to LLVM IR, I find it confusing:

  ; %8 is an i32 value from runtime
  %9 = sext i32 %8 to i64
  %10 = mul i64 %9, 10
  %11 = load i32, ptr %1, align 4
  call void @func(ptr inttoptr (i64 3735928559 to ptr), ptr @n, i64 %10, i64 10, i64 1, i32 %11)

I’ve no idea where the i64 value 3735928559 (hex 0xdeadbeef) comes from and why the function func accepts 5 arguments instead of one single pointer (maybe because of the additional metadata from memref dialect?).

I’d really appreciate any advice or suggestions.Thank you so much for taking the time to read this.