user: 请将以下的汇编代码转换成C语言代码:

```asm
<CreateSRandomInterleaver>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%r12d
  mov    %esi,%ebx
  mov    %rdx,%r13
  lea    (%rdi,%rdi,4),%r14d
  add    %r14d,%r14d
  call   <sqrt@plt>
  mov    %eax,%edi
  call   <floor@plt>
  test   %r12d,%r12d
  jle    L3
  mov    %r13,%rcx
  lea    -0x1(%r12),%edx
  lea    0x0(%r13,%rdx,4),%r9
  mov    $0x0,%edi
  mov    $0x0,%esi
  jmp    L16
L116:
  add    $0x4,%rcx
L16:
  mov    %esi,%edx
  imul   %eax,%edx
  lea    (%rdx,%rdi,1),%r8d
  mov    %r8d,(%rcx)
  add    $0x1,%esi
  cmp    %r9,%rcx
  je     L3
  add    %eax,%edx
  add    %edi,%edx
  cmp    %edx,%r12d
  jg     L116
  add    $0x1,%edi
  mov    $0x0,%esi
  jmp    L116
L3:
  test   %r14d,%r14d
  jle    L137
  mov    $0x0,%r15d
  jmp    L143
L39:
  mov    %edi,(%r10)
  mov    %ecx,(%r8)
  add    $0x1,%r15d
L159:
  cmp    %r14d,%r15d
  jge    L137
L143:
  mov    $0x0,%eax
  call   <genrand@plt>
  imul   %r12d,%eax
  mov    %eax,%edi
  call   <floor@plt>
  mov    %eax,%ebp
  mov    $0x0,%eax
  call   <genrand@plt>
  imul   %r12d,%eax
  mov    %eax,%edi
  call   <floor@plt>
  mov    %eax,%esi
  cmp    %eax,%ebp
  je     L159
  cltq
  lea    0x0(%r13,%rax,4),%r8
  mov    (%r8),%edi
  mov    %ebp,%edx
  sub    %ebx,%edx
  cmp    %ebx,%ebp
  mov    $0x0,%eax
  cmovl  %eax,%edx
  mov    %r12d,%r9d
  sub    %ebx,%r9d
  lea    0x0(%rbp,%rbx,1),%eax
  cmp    %ebp,%r9d
  cmovle %r12d,%eax
  cmp    %eax,%edx
  jge    L40
  movslq %edx,%r10
  lea    0x0(%r13,%r10,4),%rcx
  sub    %edx,%eax
  lea    -0x1(%rax),%eax
  add    %r10,%rax
  lea    0x4(%r13,%rax,4),%r10
L102:
  mov    %edi,%edx
  sub    (%rcx),%edx
  mov    %edx,%eax
  neg    %eax
  cmovs  %edx,%eax
  cmp    %ebx,%eax
  jl     L159
  add    $0x4,%rcx
  cmp    %r10,%rcx
  jne    L102
L40:
  movslq %ebp,%rbp
  lea    0x0(%r13,%rbp,4),%r10
  mov    (%r10),%ecx
  mov    %esi,%edx
  sub    %ebx,%edx
  cmp    %ebx,%esi
  mov    $0x0,%eax
  cmovl  %eax,%edx
  lea    (%rsi,%rbx,1),%eax
  cmp    %esi,%r9d
  cmovle %r12d,%eax
  cmp    %eax,%edx
  jge    L39
  movslq %edx,%r9
  lea    0x0(%r13,%r9,4),%rsi
  sub    %edx,%eax
  lea    -0x1(%rax),%eax
  add    %r9,%rax
  lea    0x4(%r13,%rax,4),%r9
L114:
  mov    %ecx,%edx
  sub    (%rsi),%edx
  mov    %edx,%eax
  neg    %eax
  cmovs  %edx,%eax
  cmp    %ebx,%eax
  jl     L159
  add    $0x4,%rsi
  cmp    %r9,%rsi
  jne    L114
  jmp    L39
L137:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void CreateSRandomInterleaver(int N, int S, int *alpha) {
  int spacing, i, offset, index, block;
  int max_swaps, num_swaps;
  int index_1, index_2, value_1, value_2, test, start, stop;
  max_swaps = 10 * N;
  num_swaps = 0;
  spacing = floor(sqrt(N));
  offset = 0;
  block = 0;
  for (i = 0; i < N; i++) {
    index = spacing * offset + block;
    if (index >= N) {
      offset = 0;
      block++;
    }
    alpha[i] = spacing * offset + block;
    offset++;
  }
  while (num_swaps < max_swaps) {
    index_1 = (int)floor(N * genrand());
    index_2 = (int)floor(N * genrand());
    if (index_1 != index_2) {
      test = 1;
      value_1 = alpha[index_2];
      if (index_1 < S)
        start = 0;
      else
        start = index_1 - S;
      if (index_1 >= N - S)
        stop = N;
      else
        stop = index_1 + S;
      for (i = start; i < stop; i++) {
        if (abs(value_1 - alpha[i]) < S) {
          test = 0;
          break;
        }
      }
      if (test) {
        value_2 = alpha[index_1];
        if (index_2 < S)
          start = 0;
        else
          start = index_2 - S;
        if (index_2 >= N - S)
          stop = N;
        else
          stop = index_2 + S;
        for (i = start; i < stop; i++) {
          if (abs(value_2 - alpha[i]) < S) {
            test = 0;
            break;
          }
        }
        if (test) {
          alpha[index_1] = value_1;
          alpha[index_2] = value_2;
          num_swaps++;
        }
      }
    }
  }
}
```