user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<lhs_edge>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x28,%rsp
  mov    %edi,0x10(%rsp)
  mov    %rdx,0x8(%rsp)
  cmp    $0x1,%esi
  je     L104
  test   %edi,%edi
  jle    L143
  lea    -0x1(%rsi),%eax
  mov    %esi,%r13d
  mov    %esi,%r14d
  xor    %ebp,%ebp
  mov    %eax,0x14(%rsp)
  mov    %esi,%eax
  and    $0xfffffffc,%r13d
  xor    %r12d,%r12d
  shr    $0x2,%eax
  lea    -0x1(%rax),%ecx
  movslq %r13d,%rax
  shl    $0x2,%rax
  add    $0x1,%rcx
  mov    %rax,0x18(%rsp)
  shl    $0x4,%rcx
  mov    %rcx,%r15
  nopl   0x0(%rax)
L71:
  mov    0x8(%rsp),%rdx
  mov    %r14d,%edi
  xor    %esi,%esi
  call   <perm_uniform@plt>
  mov    %rax,%rdi
  test   %r14d,%r14d
  jle    L27
  mov    0x14(%rsp),%eax
  pxor   %xmm3,%xmm3
  cvtsi2ss %eax,%xmm3
  cvtss2sd %xmm3,%xmm3
  cmp    $0x2,%eax
  jbe    L127
  movslq %ebp,%rax
  movapd %xmm3,%xmm2
  lea    (%rbx,%rax,8),%rdx
  unpcklpd %xmm2,%xmm2
  xor    %eax,%eax
  nopl   (%rax)
L39:
  movdqu (%rdi,%rax,1),%xmm0
  cvtdq2pd %xmm0,%xmm1
  divpd  %xmm2,%xmm1
  pshufd $0xee,%xmm0,%xmm0
  cvtdq2pd %xmm0,%xmm0
  divpd  %xmm2,%xmm0
  movups %xmm1,(%rdx,%rax,2)
  movups %xmm0,0x10(%rdx,%rax,2)
  add    $0x10,%rax
  cmp    %r15,%rax
  jne    L39
  lea    0x0(%rbp,%r13,1),%eax
  cmp    %r13d,%r14d
  je     L38
  mov    0x18(%rsp),%rcx
  pxor   %xmm0,%xmm0
  cltq
  lea    0x0(,%rax,8),%rsi
  cvtsi2sdl (%rdi,%rcx,1),%xmm0
  mov    %rcx,%rdx
  divsd  %xmm3,%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  lea    0x1(%r13),%eax
  cmp    %r14d,%eax
  jge    L38
L108:
  pxor   %xmm0,%xmm0
  add    $0x1,%eax
  cvtsi2sdl 0x4(%rdi,%rdx,1),%xmm0
  divsd  %xmm3,%xmm0
  movsd  %xmm0,0x8(%rbx,%rsi,1)
  cmp    %eax,%r14d
  jle    L38
  pxor   %xmm0,%xmm0
  cvtsi2sdl 0x8(%rdi,%rdx,1),%xmm0
  divsd  %xmm3,%xmm0
  movsd  %xmm0,0x10(%rbx,%rsi,1)
L38:
  add    %r14d,%ebp
L27:
  call   <free@plt>
  add    $0x1,%r12d
  cmp    %r12d,0x10(%rsp)
  jne    L71
L143:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L127:
  pxor   %xmm0,%xmm0
  movslq %ebp,%rax
  xor    %edx,%edx
  cvtsi2sdl (%rdi),%xmm0
  lea    0x0(,%rax,8),%rsi
  divsd  %xmm3,%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  mov    $0x1,%eax
  jmp    L108
L104:
  mov    %edi,%esi
  test   %edi,%edi
  jle    L143
  cmp    $0x1,%edi
  je     L144
  shr    %esi
  movapd D16(%rip),%xmm0
  mov    %rcx,%rax
  mov    %esi,%edx
  sub    $0x1,%edx
  shl    $0x4,%rdx
  lea    0x10(%rcx,%rdx,1),%rdx
  xchg   %ax,%ax
L20:
  movups %xmm0,(%rax)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L20
  mov    0x10(%rsp),%ecx
  mov    %ecx,%eax
  and    $0xfffffffe,%eax
  and    $0x1,%ecx
  je     L143
L55:
  mov    D16(%rip),%rsi
  cltq
  mov    %rsi,(%rbx,%rax,8)
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L144:
  xor    %eax,%eax
  jmp    L55
```

tool_calls: name: disassemble_data
arguments: data_label: D16
data_type: f64[2]

tool: {"D16": [0.5,0.5]}

assistant: ```c
void lhs_edge(int nvar, int npoint, int *seed, double x[]) {
  int base = 0, i, j, k, *perm;
  if (npoint == 1)
    for (k = i = 0; i < nvar; i++)
      x[k++] = 0.5;
  else
    for (k = i = 0; i < nvar; i++) {
      perm = perm_uniform(npoint, base, seed);
      for (j = 0; j < npoint; j++)
        x[k++] = ((double)perm[j]) / ((float)(npoint - 1));
      free(perm);
    }
}
```