user: What would the C source look like for the assembly code provided here?

```asm
<permut_genes_among_indiv_within_pop>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %edx,-0x2c(%rbp)
  mov    %rcx,-0x38(%rbp)
  mov    %r8,-0x40(%rbp)
  mov    %r9d,-0x30(%rbp)
  mov    -0x24(%rbp),%eax
  imul   -0x2c(%rbp),%eax
  mov    %eax,%esi
  mov    $0x0,%edi
  call   <ivector@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x1,-0x18(%rbp)
  jmp    L109
L97:
  movl   $0x1,-0xc(%rbp)
  jmp    L141
L0:
  movl   $0x0,-0x10(%rbp)
  movl   $0x1,-0x1c(%rbp)
  jmp    L78
L70:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0xc(%rbp)
  jne    L53
  movl   $0x0,-0x14(%rbp)
  jmp    L169
L61:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L37
  addl   $0x1,-0x10(%rbp)
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    -0x10(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
L37:
  addl   $0x1,-0x14(%rbp)
L169:
  mov    -0x14(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L61
L53:
  addl   $0x1,-0x1c(%rbp)
L78:
  mov    -0x1c(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jle    L70
  mov    0x20(%rbp),%rcx
  mov    -0x10(%rbp),%edx
  mov    -0x8(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <resample_shuffle@plt>
  movl   $0x0,-0x10(%rbp)
  movl   $0x1,-0x1c(%rbp)
  jmp    L3
L154:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0xc(%rbp)
  jne    L102
  movl   $0x0,-0x14(%rbp)
  jmp    L99
L46:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L94
  addl   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x1c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    0x18(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x18(%rbp),%edx
  movslq %edx,%rdx
  shl    $0x3,%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  jmp    L23
L94:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
L23:
  addl   $0x1,-0x14(%rbp)
L99:
  mov    -0x14(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L46
L102:
  addl   $0x1,-0x1c(%rbp)
L3:
  mov    -0x1c(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jle    L154
  addl   $0x1,-0xc(%rbp)
L141:
  mov    -0xc(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jle    L0
  addl   $0x1,-0x18(%rbp)
L109:
  mov    -0x18(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jle    L97
  mov    -0x24(%rbp),%eax
  imul   -0x2c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <free_ivector@plt>
  nop
  leave
  ret
```

assistant: ```c
void permut_genes_among_indiv_within_pop(int n, int m, int ploidy, int *ploidyi, int *popi, int Npop, int ***gilc, int ***gilcmix, long *seed) {
  int i, l, c, Nvalidgene, p;
  int *gene;
  gene = ivector(0, n * ploidy);
  for (l = 1; l <= m; l++) {
    for (p = 1; p <= Npop; p++) {
      Nvalidgene = 0;
      for (i = 1; i <= n; i++)
        if (popi[i] == p) {
          for (c = 0; c < ploidy; c++)
            if (gilc[i][l][c]) {
              Nvalidgene++;
              gene[Nvalidgene] = gilc[i][l][c];
            }
        }
      resample_shuffle(gene, 1, Nvalidgene, seed);
      Nvalidgene = 0;
      for (i = 1; i <= n; i++)
        if (popi[i] == p) {
          for (c = 0; c < ploidy; c++) {
            if (gilc[i][l][c]) {
              Nvalidgene++;
              gilcmix[i][l][c] = gene[Nvalidgene];
            } else
              gilcmix[i][l][c] = 0;
          }
        }
    }
  }
  free_ivector(gene, 0, n * ploidy);
}
```