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

```asm
<nthSuperUglyNumber>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x38(%rbp)
  cmpl   $0x0,-0x34(%rbp)
  jne    L101
  mov    $0x0,%eax
  jmp    L97
L101:
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x10(%rbp),%rax
  movl   $0x1,(%rax)
  movl   $0xffffffff,-0x28(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x1,-0x24(%rbp)
  jmp    L87
L59:
  movl   $0xffffffff,-0x28(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L79
L60:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x8(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x10(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  imul   %edx,%eax
  mov    %eax,-0x18(%rbp)
  cmpl   $0xffffffff,-0x28(%rbp)
  je     L67
  mov    -0x28(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jle    L17
L67:
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x28(%rbp)
L17:
  addl   $0x1,-0x20(%rbp)
L79:
  mov    -0x20(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L60
  movl   $0x0,-0x1c(%rbp)
  jmp    L78
L12:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x8(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x10(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  imul   %edx,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jne    L82
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  add    $0x1,%edx
  mov    %edx,(%rax)
L82:
  addl   $0x1,-0x1c(%rbp)
L78:
  mov    -0x1c(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L12
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rax,%rdx
  mov    -0x28(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x24(%rbp)
L87:
  mov    -0x24(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L59
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x14(%rbp),%eax
L97:
  leave
  ret
```

assistant: ```c
int nthSuperUglyNumber(int n, int *primes, int primesSize) {
  if (n == 0)
    return 0;
  int *res = (int *)malloc(n * sizeof(int));
  int *idx = (int *)malloc(primesSize * sizeof(int));
  memset(idx, 0, primesSize * sizeof(int));
  res[0] = 1;
  int min = -1;
  int tmp = 0;
  for (int i = 1; i < n; i++) {
    min = -1;
    for (int j = 0; j < primesSize; j++) {
      tmp = primes[j] * res[idx[j]];
      if (min == -1 || min > tmp)
        min = tmp;
    }
    for (int j = 0; j < primesSize; j++) {
      tmp = primes[j] * res[idx[j]];
      if (tmp == min)
        idx[j]++;
    }
    res[i] = min;
  }
  int ret = res[n - 1];
  free(res);
  free(idx);
  return ret;
}
```