user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<matGetNextVariable_int_array_w_sz>:
  endbr64
  push   %r15
  mov    %rcx,%rdx
  movslq %r8d,%r15
  push   %r14
  mov    %rsi,%r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %r15,%rbp
  shl    $0x2,%r15
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x48,%rsp
  mov    %rdi,0x10(%rsp)
  lea    0x2c(%rsp),%rsi
  lea    0x28(%rsp),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  call   <matGetNextVariable__read_tag@plt>
  mov    0x28(%rsp),%esi
  mov    %eax,0x18(%rsp)
  mov    0x2c(%rsp),%eax
  cmp    $0x9,%esi
  je     L19
  xor    %edx,%edx
  mov    %ebp,%ecx
  lea    D1(%rip),%rdi
  div    %ebp
  mov    %eax,%edx
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r15,%rdi
  call   <malloc@plt>
  mov    %rax,(%r14)
  mov    %rax,%rcx
  test   %ebp,%ebp
  jle    L60
  mov    %rax,%r14
  lea    -0x1(%rbp),%eax
  mov    0x18(%rsp),%r13d
  mov    %r12d,%r15d
  lea    0x4(%rcx,%rax,4),%rax
  lea    0x30(%rsp),%rdi
  mov    %rax,0x8(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L8:
  mov    %r13d,%esi
  mov    %r15,%rdx
  add    %r12d,%r13d
  add    $0x4,%r14
  add    %rbx,%rsi
  movl   $0x0,0x30(%rsp)
  call   <memcpy@plt>
  mov    %rax,%rdi
  mov    0x30(%rsp),%eax
  mov    %eax,-0x4(%r14)
  cmp    %r14,0x8(%rsp)
  jne    L8
L60:
  mov    0x10(%rsp),%rax
  mov    %ebp,(%rax)
  mov    0x18(%rsp),%eax
  add    0x2c(%rsp),%eax
L55:
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L48
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L19:
  xor    %edx,%edx
  mov    %eax,0x1c(%rsp)
  mov    %r15,%rdi
  div    %ebp
  mov    %eax,%r12d
  call   <malloc@plt>
  mov    %rax,(%r14)
  mov    %rax,%rcx
  test   %ebp,%ebp
  jle    L12
  mov    %rax,%r14
  lea    -0x1(%rbp),%eax
  mov    0x18(%rsp),%r13d
  mov    %r12d,%r15d
  lea    0x4(%rcx,%rax,4),%rax
  lea    0x30(%rsp),%rdi
  mov    %rax,0x8(%rsp)
  nopw   0x0(%rax,%rax,1)
L66:
  mov    %r13d,%esi
  mov    %r15,%rdx
  add    %r12d,%r13d
  add    $0x4,%r14
  add    %rbx,%rsi
  call   <memcpy@plt>
  mov    %rax,%rdi
  cvttsd2si 0x30(%rsp),%eax
  mov    %eax,-0x4(%r14)
  cmp    %r14,0x8(%rsp)
  jne    L66
L12:
  mov    0x10(%rsp),%rax
  mov    %ebp,(%rax)
  mov    0x1c(%rsp),%eax
  add    0x18(%rsp),%eax
  jmp    L55
L48:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D1
type_guessed: string

tool: D1: dtype=%i tsize=%i nvals=%i


assistant: ```c
int matGetNextVariable_int_array_w_sz(int *outsz, int **out, int dsz, unsigned char *data_ptr, int nvals) {
  unsigned int dtype, dsize, tsize;
  int itmp;
  int *out2;
  double dtmp;
  int i, offset;
  offset = matGetNextVariable__read_tag(&dtype, &dsize, data_ptr);
  if (dtype == 9) {
    tsize = dsize / nvals;
    *out = (int *)malloc(nvals * sizeof(int));
    out2 = *out;
    for (i = 0; i < nvals; i++) {
      memcpy(&dtmp, &data_ptr[offset + i * tsize], tsize * sizeof(char));
      out2[i] = (int)dtmp;
    }
    *outsz = nvals;
    return offset + dsize;
  } else {
    tsize = dsize / nvals;
    printf("dtype=%i tsize=%i nvals=%i\n", dtype, tsize, nvals);
    *out = (int *)malloc(nvals * sizeof(int));
    out2 = *out;
    for (i = 0; i < nvals; i++) {
      itmp = 0;
      memcpy(&itmp, &data_ptr[offset + i * tsize], tsize * sizeof(char));
      out2[i] = itmp;
    }
    *outsz = nvals;
    return offset + dsize;
  }
}
```