user: What is the c source code of the assembly code below?

```asm
<random_sample_index>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %edi,-0x44(%rbp)
  mov    %esi,-0x48(%rbp)
  mov    %rdx,-0x50(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    -0x44(%rbp),%eax
  cmp    -0x48(%rbp),%eax
  jg     L141
  cmpl   $0x0,-0x44(%rbp)
  jg     L47
L141:
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L45
L47:
  mov    -0x44(%rbp),%eax
  cmp    -0x48(%rbp),%eax
  jne    L106
  lea    D14(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movl   $0x0,-0x38(%rbp)
  jmp    L115
L56:
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x50(%rbp),%rax
  add    %rax,%rdx
  mov    -0x38(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x38(%rbp)
L115:
  mov    -0x38(%rbp),%eax
  cmp    -0x48(%rbp),%eax
  jl     L56
  mov    $0x0,%eax
  jmp    L45
L106:
  mov    -0x44(%rbp),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x28(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r10
  mov    $0x0,%r11d
  movslq %eax,%rdx
  mov    %rdx,%r8
  mov    $0x0,%r9d
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L167:
  cmp    %rdx,%rsp
  je     L132
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L167
L132:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L30
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L30:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x20(%rbp)
  movl   $0x0,-0x34(%rbp)
  jmp    L101
L117:
  mov    -0x20(%rbp),%rax
  mov    -0x34(%rbp),%edx
  movslq %edx,%rdx
  mov    -0x48(%rbp),%ecx
  mov    %ecx,(%rax,%rdx,4)
  addl   $0x1,-0x34(%rbp)
L101:
  mov    -0x34(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jl     L117
  mov    $0x0,%edi
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  movl   $0x0,-0x30(%rbp)
  jmp    L64
L2:
  mov    $0x0,%eax
  call   <rand@plt>
  cltd
  idivl  -0x48(%rbp)
  mov    %edx,-0x2c(%rbp)
  mov    -0x44(%rbp),%edx
  mov    -0x20(%rbp),%rcx
  mov    -0x2c(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <in_int_array@plt>
  cmp    $0x1,%eax
  jne    L136
  jmp    L64
L136:
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0x2c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x50(%rbp),%rax
  add    %rax,%rdx
  mov    -0x2c(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x30(%rbp)
L64:
  mov    -0x30(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jl     L2
  mov    $0x0,%eax
L45:
  mov    %rbx,%rsp
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L112
  call   <__stack_chk_fail@plt>
L112:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D1
type_infered: string
name: parse_data
arguments: label: D14
type_infered: string

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


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


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;
}
```