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

```asm
<solve_congruence>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %edi,-0x44(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <prime_factors@plt>
  cltq
  mov    %rax,-0x38(%rbp)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x38(%rbp),%rax
  add    $0x8,%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x30(%rbp),%rax
  mov    $0x8,%esi
  mov    %rax,%rdi
  call   <calloc@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x30(%rbp),%rax
  mov    $0x8,%esi
  mov    %rax,%rdi
  call   <calloc@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x30(%rbp),%rax
  mov    $0x8,%esi
  mov    %rax,%rdi
  call   <calloc@plt>
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x3c(%rbp)
  jmp    L23
L4:
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x3c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  movl   $0x1,-0x40(%rbp)
  jmp    L16
L55:
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rcx
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x3c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rsi
  mov    -0x18(%rbp),%rdx
  add    %rsi,%rdx
  imul   %rcx,%rax
  mov    %rax,(%rdx)
  addl   $0x1,-0x40(%rbp)
L16:
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  mov    %rdx,%rcx
  imul   %rax,%rcx
  mov    -0x58(%rbp),%rax
  cqto
  idiv   %rcx
  mov    %rdx,%rax
  test   %rax,%rax
  je     L55
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x40(%rbp),%ecx
  mov    -0x50(%rbp),%rsi
  mov    -0x44(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <solve_prime_power_congruence@plt>
  movslq %eax,%rdx
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  mov    %rdx,(%rax)
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    (%rdx),%rax
  lea    0x8(%rax),%rcx
  mov    %rcx,(%rdx)
  mov    (%rax),%rdx
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x10(%rbp),%rax
  add    %rcx,%rax
  mov    %edx,(%rax)
  addl   $0x1,-0x3c(%rbp)
L23:
  mov    -0x3c(%rbp),%eax
  cltq
  cmp    %rax,-0x30(%rbp)
  jg     L4
  mov    -0x18(%rbp),%rcx
  mov    -0x20(%rbp),%rdx
  mov    -0x10(%rbp),%rsi
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <solve_system_of_order_1_congruence_sets@plt>
  cltq
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x3c(%rbp)
  jmp    L2
L24:
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  sub    $0x8,%rax
  mov    %rax,%rdi
  call   <free@plt>
  addl   $0x1,-0x3c(%rbp)
L2:
  mov    -0x3c(%rbp),%eax
  cltq
  cmp    %rax,-0x30(%rbp)
  jg     L24
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
long *solve_congruence(int funcDegree, long funcCoeffs[], long mod) {
  long *solutionList;
  long *modFactorList = prime_factors(mod);
  long numOfModFactors = *modFactorList;
  long *modFactors = modFactorList + 1;
  long **primePowerSolutions = calloc(numOfModFactors, sizeof(long *));
  long *primePowers = calloc(numOfModFactors, sizeof(long));
  int *primePowerSolutionLengths = calloc(numOfModFactors, sizeof(int *));
  int power;
  int i, j, k;
  for (i = 0; i < numOfModFactors; i++) {
    primePowers[i] = modFactors[i];
    power = 1;
    while (mod % (primePowers[i] * modFactors[i]) == 0) {
      primePowers[i] *= modFactors[i];
      power++;
    }
    primePowerSolutions[i] = solve_prime_power_congruence(funcDegree, funcCoeffs, modFactors[i], power);
    primePowerSolutionLengths[i] = *(primePowerSolutions[i]++);
  }
  solutionList = solve_system_of_order_1_congruence_sets(numOfModFactors, primePowerSolutionLengths, primePowerSolutions, primePowers);
  for (i = 0; i < numOfModFactors; i++) {
    free(primePowerSolutions[i] - 1);
  }
  free(primePowerSolutionLengths);
  free(primePowerSolutions);
  free(primePowers);
  free(modFactorList);
  return solutionList;
}
```