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

```asm
<freecell_solver_merge_large_and_small_sorted_arrays>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %ecx,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  mov    %r8,%rbx
  mov    %r9,%r8
  sub    $0x48,%rsp
  mov    %rsi,0x10(%rsp)
  mov    0x80(%rsp),%r9
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  sub    $0x1,%ecx
  js     L11
  movslq %ecx,%rcx
  lea    0x34(%rsp),%rax
  mov    %ebx,0x1c(%rsp)
  mov    %rdi,%rbp
  imul   %rbx,%rcx
  mov    %rax,0x20(%rsp)
  mov    0x10(%rsp),%r14d
  xor    %r12d,%r12d
  mov    %r8,0x28(%rsp)
  lea    (%rdx,%rcx,1),%r15
  nopw   0x0(%rax,%rax,1)
L6:
  mov    0x10(%rsp),%rdx
  sub    $0x8,%rsp
  movslq %r12d,%rax
  mov    %rbx,%rcx
  push   0x28(%rsp)
  mov    0x38(%rsp),%r8
  mov    %r15,%rdi
  mov    %rbp,%rsi
  sub    %rax,%rdx
  mov    %r9,0x18(%rsp)
  call   <freecell_solver_bsearch@plt>
  xor    %edx,%edx
  lea    0x0(%r13,%r14,1),%r11d
  sub    %rbp,%rax
  sub    %r12d,%r11d
  div    %rbx
  mov    %r12d,%edx
  sub    %r14d,%edx
  lea    (%r11,%rax,1),%r8d
  movslq %eax,%rsi
  add    %edx,%r8d
  mov    %rsi,%rax
  mov    0x2c(%rsp),%edx
  sub    %r8d,%r11d
  imul   %rbx,%rax
  movslq %r8d,%r8
  imul   %rbx,%r8
  mov    %r11d,0x28(%rsp)
  imul   %r11d,%edx
  lea    0x0(%rbp,%rax,1),%rsi
  lea    0x0(%rbp,%r8,1),%rdi
  mov    %r8,0x10(%rsp)
  call   <memmove@plt>
  mov    0x10(%rsp),%r8
  mov    %rbx,%rdx
  mov    %r15,%rsi
  sub    %rbx,%r15
  sub    %rbx,%r8
  lea    0x0(%rbp,%r8,1),%rdi
  call   <memcpy@plt>
  mov    0x28(%rsp),%r11d
  mov    %r13d,%eax
  pop    %rdx
  sub    $0x1,%r13d
  pop    %rcx
  mov    0x8(%rsp),%r9
  add    %r11d,%r12d
  sub    $0x2,%eax
  jns    L6
L11:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L19
  add    $0x48,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L19:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int freecell_solver_merge_large_and_small_sorted_arrays(void *void_big_array, size_t size_big_array, void *void_small_array, size_t size_small_array, size_t width, int (*compare)(const void *, const void *, void *), void *context) {
  int item_to_move, num_big_items_moved, pos;
  char *pos_ptr;
  char *big_array;
  char *small_array;
  int found;
  int start_offset, end_offset;
  big_array = (char *)void_big_array;
  small_array = (char *)void_small_array;
  num_big_items_moved = 0;
  for (item_to_move = size_small_array - 1; item_to_move >= 0; item_to_move--) {
    pos_ptr = freecell_solver_bsearch(small_array + item_to_move * width, big_array, size_big_array - num_big_items_moved, width, compare, context, &found);
    pos = (pos_ptr - big_array) / width;
    end_offset = size_big_array + size_small_array - num_big_items_moved - (size_small_array - item_to_move - 1);
    start_offset = end_offset + pos - (size_big_array - num_big_items_moved);
    memmove(big_array + start_offset * width, big_array + pos * width, (end_offset - start_offset) * width);
    memcpy(big_array + (start_offset - 1) * width, small_array + item_to_move * width, width);
    num_big_items_moved += (end_offset - start_offset);
  }
  return 1;
}
```