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

```asm
<expandNewpop2D>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    %ecx,-0x28(%rbp)
  mov    %r8d,-0x2c(%rbp)
  mov    %r9d,-0x30(%rbp)
  mov    -0x24(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%esi
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movl   $0x0,-0x10(%rbp)
  jmp    L33
L57:
  movl   $0x0,-0xc(%rbp)
  jmp    L100
L90:
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L63
L79:
  mov    $0x0,%eax
  call   <drand@plt>
  mov    -0x24(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x2c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  imul   -0x28(%rbp),%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  comisd %xmm0,%xmm1
  jbe    L9
  addl   $0x1,-0x4(%rbp)
L9:
  addl   $0x1,-0x8(%rbp)
L63:
  mov    -0x8(%rbp),%eax
  cmp    0x18(%rbp),%eax
  jl     L79
  cmpl   $0x0,0x20(%rbp)
  je     L23
  mov    0x18(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  jmp    L104
L51:
  mov    $0x0,%eax
  call   <drand@plt>
  mov    -0x24(%rbp),%eax
  imul   -0x2c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  imul   -0x28(%rbp),%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  comisd %xmm0,%xmm1
  jbe    L53
  addl   $0x1,-0x4(%rbp)
L53:
  addl   $0x1,-0x8(%rbp)
L104:
  mov    -0x8(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jl     L51
L23:
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x4(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdl 0x18(%rbp),%xmm1
  mov    -0x24(%rbp),%eax
  imul   -0x2c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  imul   -0x28(%rbp),%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  cmpl   $0x0,0x20(%rbp)
  je     L113
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x4(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdl 0x10(%rbp),%xmm1
  mov    -0x24(%rbp),%eax
  imul   -0x2c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  imul   -0x28(%rbp),%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
L113:
  addl   $0x1,-0xc(%rbp)
L100:
  mov    -0xc(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L90
  addl   $0x1,-0x10(%rbp)
L33:
  mov    -0x10(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L57
  nop
  nop
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_label: D6
data_type: string

tool: D6: Expand new pops in row: %i


assistant: ```c
void expandNewpop2D(double *Pops, double *AF, int pop, int nSNP, int n1, int n2, int Ne, int ke, int admixture) {
  int p1, l, i, count;
  printf("Expand new pops in row: %i\n", pop + 1);
  for (p1 = 0; p1 < n1; p1++) {
    for (l = 0; l < nSNP; l++) {
      count = 0;
      for (i = 0; i < ke; i++)
        if (drand() < Pops[nSNP * ((pop - 1) * n1 + p1) + l])
          count++;
      if (admixture) {
        for (i = ke; i < Ne; i++)
          if (drand() < Pops[nSNP * (pop * n1 + p1) + l])
            count++;
      }
      Pops[nSNP * (pop * n1 + p1) + l] = (double)count / ke;
      if (admixture)
        Pops[nSNP * (pop * n1 + p1) + l] = (double)count / Ne;
    }
  }
}
```