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

```asm
<random_sample_index>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdx,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  cmp    %esi,%edi
  jg     L149
  mov    %edi,%r12d
  test   %edi,%edi
  jle    L149
  mov    %esi,%ebx
  cmp    %esi,%edi
  je     L183
  movslq %edi,%rax
  mov    %rsp,%rcx
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L47
L190:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L190
L47:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L123
L137:
  test   %r12d,%r12d
  mov    $0x1,%ecx
  mov    %rsp,%r13
  cmovg  %r12d,%ecx
  cmp    $0x3,%r12d
  jle    L216
  mov    %ecx,%edx
  movd   %ebx,%xmm3
  mov    %r13,%rax
  shr    $0x2,%edx
  pshufd $0x0,%xmm3,%xmm0
  shl    $0x4,%rdx
  add    %r13,%rdx
L134:
  movups %xmm0,(%rax)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L134
  mov    %ecx,%eax
  and    $0xfffffffc,%eax
  and    $0x3,%ecx
  je     L51
L213:
  movslq %eax,%rdx
  lea    0x1(%rax),%ecx
  lea    0x0(%r13,%rdx,4),%rdx
  mov    %ebx,(%rdx)
  cmp    %ecx,%r12d
  jle    L51
  add    $0x2,%eax
  mov    %ebx,0x4(%rdx)
  cmp    %eax,%r12d
  jle    L51
  mov    %ebx,0x8(%rdx)
L51:
  xor    %edi,%edi
  xor    %r15d,%r15d
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  mov    %r12d,%eax
  mov    %rax,-0x50(%rbp)
  xchg   %ax,%ax
L170:
  xor    %eax,%eax
  call   <rand@plt>
  mov    %r13,%rsi
  cltd
  idiv   %ebx
  mov    %edx,%r14d
  mov    %r12d,%edx
  mov    %r14d,%edi
  call   <in_int_array@plt>
  cmp    $0x1,%eax
  je     L170
  mov    -0x48(%rbp),%rax
  mov    %r14d,0x0(%r13,%r15,4)
  mov    %r14d,(%rax,%r15,4)
  add    $0x1,%r15
  cmp    -0x50(%rbp),%r15
  jne    L170
L230:
  xor    %eax,%eax
L52:
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L204
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L123:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L137
  nopl   0x0(%rax,%rax,1)
L183:
  lea    D5(%rip),%rdi
  call   <printf@plt>
  test   %ebx,%ebx
  mov    $0x1,%ecx
  cmovg  %ebx,%ecx
  cmp    $0x3,%ebx
  jle    L184
  mov    %ecx,%edx
  mov    -0x48(%rbp),%rsi
  movdqa D37(%rip),%xmm0
  shr    $0x2,%edx
  movdqa D0(%rip),%xmm2
  sub    $0x1,%edx
  mov    %rsi,%rax
  shl    $0x4,%rdx
  lea    0x10(%rsi,%rdx,1),%rdx
  nopw   0x0(%rax,%rax,1)
L227:
  movdqa %xmm0,%xmm1
  add    $0x10,%rax
  paddd  %xmm2,%xmm0
  movups %xmm1,-0x10(%rax)
  cmp    %rdx,%rax
  jne    L227
  mov    %ecx,%eax
  and    $0xfffffffc,%eax
  and    $0x3,%ecx
  je     L230
L139:
  mov    -0x48(%rbp),%rsi
  movslq %eax,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    %eax,(%rsi,%rdx,4)
  lea    0x1(%rax),%edx
  cmp    %edx,%ebx
  jle    L230
  add    $0x2,%eax
  mov    %edx,0x4(%rsi,%rcx,1)
  cmp    %eax,%ebx
  jle    L230
  mov    %eax,0x8(%rsi,%rcx,1)
  jmp    L230
L216:
  xor    %eax,%eax
  jmp    L213
L184:
  xor    %eax,%eax
  jmp    L139
L149:
  lea    D12(%rip),%rdi
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L52
L204:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D5
datatype: string
name: unpack_data
arguments: label: D37
datatype: byte[16]
name: unpack_data
arguments: label: D0
datatype: byte[16]
name: unpack_data
arguments: label: D12
datatype: string

tool: D5: INFO: k == arr_len, COPYING ORIGINAL ARRAY


tool: {"D37": [0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x03,0x00,0x00,0x00]}

tool: {"D0": [0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

tool: D12: ERROR: k > arr_len || k < 1, ABORTING


assistant: ```c
int random_sample_index(int k, int arr_len, int *buf) {
  if (k > arr_len || k < 1) {
    printf("ERROR: k > arr_len || k < 1, ABORTING\n");
    return -1;
  }
  if (k == arr_len) {
    printf("INFO: k == arr_len, COPYING ORIGINAL ARRAY\n");
    for (int i = 0; i < arr_len; i++) {
      *(buf + i) = i;
    }
    return 0;
  }
  int used_indexes[k];
  int random_index;
  for (int i = 0; i < k; i++) {
    used_indexes[i] = arr_len;
  }
  srand((unsigned)time(NULL));
  int i = 0;
  while (i < k) {
    random_index = rand() % arr_len;
    if (in_int_array(random_index, used_indexes, k) == 1) {
      continue;
    }
    *(used_indexes + i) = random_index;
    *(buf + i) = random_index;
    i++;
  }
  return 0;
}
```