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

```asm
<partition_restr_from_id>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0xa8,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %esi,-0x7c(%rbp)
  mov    %edx,-0x80(%rbp)
  mov    %ecx,-0x84(%rbp)
  mov    %r8,-0x90(%rbp)
  mov    %r9,-0x98(%rbp)
  mov    -0x7c(%rbp),%eax
  add    $0x1,%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x58(%rbp)
  movslq %eax,%rdx
  mov    %rdx,-0xc0(%rbp)
  movq   $0x0,-0xb8(%rbp)
  movslq %eax,%rdx
  lea    0x0(,%rdx,4),%rbx
  mov    -0x7c(%rbp),%edx
  add    $0x1,%edx
  movslq %edx,%rcx
  sub    $0x1,%rcx
  mov    %rcx,-0x50(%rbp)
  cltq
  mov    %rax,-0xb0(%rbp)
  movq   $0x0,-0xa8(%rbp)
  movslq %edx,%rax
  mov    %rax,%r14
  mov    $0x0,%r15d
  mov    -0xb0(%rbp),%rsi
  mov    -0xa8(%rbp),%rdi
  mov    %rdi,%rdx
  imul   %r14,%rdx
  mov    %rsi,%rax
  imul   %r15,%rax
  lea    (%rdx,%rax,1),%rcx
  mov    %rsi,%rax
  mul    %r14
  add    %rdx,%rcx
  mov    %rcx,%rdx
  mov    -0x7c(%rbp),%eax
  add    $0x1,%eax
  mov    -0x7c(%rbp),%edx
  add    $0x1,%edx
  movslq %eax,%rcx
  sub    $0x1,%rcx
  mov    %rcx,-0x48(%rbp)
  movslq %eax,%rcx
  mov    %rcx,-0xd0(%rbp)
  movq   $0x0,-0xc8(%rbp)
  movslq %edx,%rcx
  sub    $0x1,%rcx
  mov    %rcx,-0x40(%rbp)
  cltq
  mov    %rax,%r12
  mov    $0x0,%r13d
  movslq %edx,%rax
  mov    %rax,%r10
  mov    $0x0,%r11d
  mov    %r13,%rdx
  imul   %r10,%rdx
  mov    %r11,%rax
  imul   %r12,%rax
  lea    (%rdx,%rax,1),%rcx
  mov    %r12,%rax
  mul    %r10
  add    %rdx,%rcx
  mov    %rcx,%rdx
  mov    -0x78(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  cmpl   $0x0,-0x84(%rbp)
  js     L5
  mov    %rbx,%rdx
  shr    $0x2,%rdx
  mov    -0x38(%rbp),%rax
  lea    0x1(%rdx),%rcx
  mov    -0x7c(%rbp),%edx
  movslq %edx,%rdx
  imul   %rcx,%rdx
  mov    (%rax,%rdx,4),%eax
  cmp    %eax,-0x84(%rbp)
  jge    L5
  mov    $0x1,%eax
  jmp    L8
L5:
  mov    $0x0,%eax
L8:
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x7c(%rbp),%eax
  mov    %eax,-0x64(%rbp)
  mov    -0x98(%rbp),%rax
  movl   $0x0,(%rax)
  mov    %rbx,%rdx
  shr    $0x2,%rdx
  mov    -0x38(%rbp),%rax
  lea    0x1(%rdx),%rcx
  mov    -0x7c(%rbp),%edx
  movslq %edx,%rdx
  imul   %rcx,%rdx
  mov    (%rax,%rdx,4),%eax
  sub    -0x84(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x60(%rbp)
L36:
  mov    -0x98(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%edx
  mov    -0x98(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x80(%rbp),%eax
  mov    %eax,-0x5c(%rbp)
L13:
  mov    %rbx,%rcx
  shr    $0x2,%rcx
  mov    -0x38(%rbp),%rax
  mov    -0x5c(%rbp),%edx
  movslq %edx,%rsi
  mov    -0x64(%rbp),%edx
  movslq %edx,%rdx
  imul   %rcx,%rdx
  add    %rsi,%rdx
  mov    (%rax,%rdx,4),%eax
  cmp    %eax,-0x60(%rbp)
  jle    L21
  addl   $0x1,-0x5c(%rbp)
  jmp    L13
L21:
  mov    %rbx,%rcx
  shr    $0x2,%rcx
  mov    -0x38(%rbp),%rax
  mov    -0x5c(%rbp),%edx
  movslq %edx,%rsi
  mov    -0x64(%rbp),%edx
  movslq %edx,%rdx
  imul   %rcx,%rdx
  add    %rsi,%rdx
  mov    (%rax,%rdx,4),%eax
  cmp    %eax,-0x60(%rbp)
  jge    L73
  nop
  jmp    L78
L3:
  nop
L78:
  mov    -0x98(%rbp),%rax
  mov    (%rax),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x90(%rbp),%rax
  add    %rax,%rdx
  mov    -0x5c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    %rbx,%rcx
  shr    $0x2,%rcx
  mov    -0x5c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x38(%rbp),%rax
  movslq %edx,%rsi
  mov    -0x64(%rbp),%edx
  movslq %edx,%rdx
  imul   %rcx,%rdx
  add    %rsi,%rdx
  mov    (%rax,%rdx,4),%eax
  sub    %eax,-0x60(%rbp)
  mov    -0x5c(%rbp),%eax
  sub    %eax,-0x64(%rbp)
  mov    -0x64(%rbp),%eax
  cmp    -0x80(%rbp),%eax
  jl     L61
  jmp    L36
L73:
  addl   $0x1,-0x5c(%rbp)
  mov    -0x5c(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  je     L3
  jmp    L13
L61:
  nop
  add    $0xa8,%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

assistant: ```c
void partition_restr_from_id(void *p_ptr, int n, int k, int id, int *part, int *num_part) {
  int(*p)[n + 1][n + 1] = (int(*)[n + 1][n + 1]) p_ptr;
  assert(id >= 0 && id < (*p)[n][n]);
  int n_loc = n;
  *num_part = 0;
  int psn = (*p)[n][n] - id - 1;
A:
  (*num_part)++;
  int m = k;
B:
  if ((*p)[n_loc][m] < psn) {
    m++;
    goto B;
  }
  if ((*p)[n_loc][m] > psn) {
  C:
    part[*num_part - 1] = m;
    psn -= (*p)[n_loc][m - 1];
    n_loc -= m;
    if (n_loc < k) {
      return;
    } else {
      goto A;
    }
  } else {
    m++;
  }
  if (m == n_loc) {
    goto C;
  } else {
    goto B;
  }
}
```