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

```asm
<expand2D>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %ecx,-0x3c(%rbp)
  mov    %r8d,-0x40(%rbp)
  mov    %r9d,-0x44(%rbp)
  movsd  %xmm0,-0x50(%rbp)
  movsd  %xmm1,-0x58(%rbp)
  movsd  %xmm2,-0x60(%rbp)
  mov    0x20(%rbp),%eax
  sub    0x28(%rbp),%eax
  sub    $0x1,%eax
  cltd
  idivl  0x50(%rbp)
  add    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  mov    0x20(%rbp),%eax
  cmp    0x28(%rbp),%eax
  jne    L167
  cmpl   $0x0,0x60(%rbp)
  jne    L167
  mov    0x40(%rbp),%r8d
  mov    0x38(%rbp),%edi
  mov    -0x40(%rbp),%ecx
  mov    -0x3c(%rbp),%edx
  mov    -0x44(%rbp),%esi
  mov    -0x28(%rbp),%rax
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <initExpansion2D@plt>
L167:
  mov    0x20(%rbp),%eax
  cmp    0x28(%rbp),%eax
  jle    L58
  movl   $0x0,-0x18(%rbp)
  jmp    L34
L28:
  mov    0x38(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L134
L46:
  movl   $0x0,-0x10(%rbp)
  jmp    L72
L102:
  mov    -0x14(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  imul   -0x44(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x8(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L123
  movsd  D4(%rip),%xmm0
  comisd -0x8(%rbp),%xmm0
  jbe    L123
  movsd  D4(%rip),%xmm0
  subsd  -0x8(%rbp),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  mov    0x10(%rbp),%eax
  add    %eax,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  divsd  %xmm1,%xmm0
  mov    -0x8(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <rand_normal@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  movsd  %xmm0,-0x8(%rbp)
L123:
  movsd  -0x8(%rbp),%xmm0
  movsd  D4(%rip),%xmm1
  comisd %xmm1,%xmm0
  jbe    L21
  movsd  D4(%rip),%xmm0
  movsd  %xmm0,-0x8(%rbp)
L21:
  pxor   %xmm0,%xmm0
  comisd -0x8(%rbp),%xmm0
  jbe    L84
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
L84:
  mov    -0x14(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  imul   -0x44(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x10(%rbp)
L72:
  mov    -0x10(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jl     L102
  addl   $0x1,-0x14(%rbp)
L134:
  mov    0x38(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x14(%rbp)
  jl     L46
  mov    0x20(%rbp),%eax
  sub    0x28(%rbp),%eax
  cltd
  idivl  0x50(%rbp)
  mov    %edx,%eax
  test   %eax,%eax
  jne    L157
  mov    0x40(%rbp),%eax
  sub    0x38(%rbp),%eax
  cmp    %eax,-0xc(%rbp)
  jg     L157
  mov    0x38(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  lea    -0x1(%rax),%edi
  mov    -0x40(%rbp),%r9d
  mov    -0x3c(%rbp),%r8d
  mov    -0x44(%rbp),%edx
  mov    -0x38(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  sub    $0x8,%rsp
  mov    0x60(%rbp),%ecx
  push   %rcx
  mov    0x58(%rbp),%ecx
  push   %rcx
  mov    0x10(%rbp),%ecx
  push   %rcx
  mov    %edx,%ecx
  mov    %edi,%edx
  mov    %rax,%rdi
  call   <expandNewpop2D@plt>
  add    $0x20,%rsp
L157:
  addl   $0x1,-0x18(%rbp)
L34:
  mov    -0x18(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L28
L58:
  cmpl   $0x1,0x38(%rbp)
  jle    L109
  mov    0x38(%rbp),%eax
  lea    -0x1(%rax),%r9d
  mov    0x38(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%ecx
  movsd  -0x60(%rbp),%xmm1
  movsd  -0x58(%rbp),%xmm0
  mov    -0x50(%rbp),%rdi
  mov    -0x3c(%rbp),%r10d
  mov    -0x38(%rbp),%rdx
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  sub    $0x8,%rsp
  mov    0x18(%rbp),%r8d
  push   %r8
  mov    0x10(%rbp),%r8d
  push   %r8
  mov    -0x44(%rbp),%r8d
  push   %r8
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rdi,%xmm0
  mov    %r10d,%r8d
  mov    %rax,%rdi
  call   <evolve2D@plt>
  add    $0x20,%rsp
L109:
  mov    0x40(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jge    L65
  mov    -0x40(%rbp),%eax
  sub    0x40(%rbp),%eax
  mov    %eax,%r9d
  mov    -0x40(%rbp),%eax
  sub    0x40(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x44(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  imul   0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rdi
  movsd  -0x60(%rbp),%xmm1
  movsd  -0x58(%rbp),%xmm0
  mov    -0x50(%rbp),%rsi
  mov    -0x3c(%rbp),%r10d
  mov    -0x38(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  sub    $0x8,%rsp
  mov    0x18(%rbp),%r8d
  push   %r8
  mov    0x10(%rbp),%r8d
  push   %r8
  mov    -0x44(%rbp),%r8d
  push   %r8
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rsi,%xmm0
  mov    %r10d,%r8d
  mov    %rax,%rsi
  call   <evolve2D@plt>
  add    $0x20,%rsp
L65:
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D4
type_guessed: byte[8]

tool: {"D4": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

assistant: ```c
void expand2D(double *Pops, double *OutsidePop, double *AF, int n1, int n2, int nSNP, double m1, double m2, double minf, int Ne, int Loss, int gen, int timeStart, int timeEnd, int popStart, int popEnd, int nSteps, int lengthSteps, int ke, int admixture) {
  int npopColonized = (int)(gen - timeStart - 1) / lengthSteps + 1;
  int p1, p2, l;
  if ((gen == timeStart) && (!admixture))
    initExpansion2D(Pops, nSNP, n1, n2, popStart, popEnd);
  if (gen > timeStart) {
    for (p1 = 0; p1 < n1; p1++) {
      for (p2 = popStart - 1; p2 < popStart - 1 + npopColonized; p2++) {
        for (l = 0; l < nSNP; l++) {
          double af = Pops[(p1 + p2 * n1) * nSNP + l];
          if ((af > 0) && (af < 1))
            af = (double)rand_normal(af, af * (1 - af) / (2 * Ne));
          if (af > 1)
            af = 1;
          if (af < 0)
            af = 0;
          Pops[(p1 + p2 * n1) * nSNP + l] = af;
        }
      }
      if (((gen - timeStart) % lengthSteps == 0) && (npopColonized < (popEnd - popStart + 1)))
        expandNewpop2D(Pops, AF, popStart + npopColonized - 1, nSNP, n1, n2, Ne, ke, admixture);
    }
  }
  if (popStart > 1)
    evolve2D(Pops, OutsidePop, AF, (popStart - 1) * n1, n1, popStart - 1, nSNP, m1, m2, minf, Ne, Loss);
  if (popEnd < n2)
    evolve2D(Pops + nSNP * n1 * popEnd, OutsidePop, AF, n1 * (n2 - popEnd), n1, n2 - popEnd, nSNP, m1, m2, minf, Ne, Loss);
}
```