user: 请从给定的汇编指令推导出C源代码:

```asm
<hpmpc_d_ip_ocp_hard_tv_work_space_size_bytes>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x78,%rsp
  mov    %edi,-0x64(%rbp)
  mov    %rsi,-0x70(%rbp)
  mov    %rdx,-0x78(%rbp)
  mov    %rcx,-0x80(%rbp)
  mov    %r8,-0x90(%rbp)
  mov    %r9,-0x88(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  test   %edi,%edi
  jle    L83
  mov    %edi,%eax
  mov    %rcx,-0x58(%rbp)
  mov    %rsi,%r15
  mov    %rdx,%r13
  sub    $0x1,%eax
  mov    %r9,%r14
  xor    %ebx,%ebx
  lea    0x4(%rsi,%rax,4),%rax
  mov    %rax,-0x60(%rbp)
  cs nopw 0x0(%rax,%rax,1)
L78:
  mov    0x4(%r15),%esi
  mov    (%r15),%edi
  add    $0x4,%r13
  add    $0x4,%r15
  add    -0x4(%r13),%edi
  add    $0x4,%r14
  add    $0x1,%edi
  call   <d_size_strmat@plt>
  mov    -0x4(%r15),%esi
  add    -0x4(%r13),%esi
  lea    0x1(%rsi),%edi
  mov    %rax,%r12
  call   <d_size_strmat@plt>
  mov    -0x4(%r14),%esi
  mov    -0x4(%r15),%edi
  add    -0x4(%r13),%edi
  add    %eax,%r12d
  add    $0x1,%edi
  add    %ebx,%r12d
  call   <d_size_strmat@plt>
  mov    -0x4(%r15),%edi
  add    %eax,%r12d
  call   <d_size_strvec@plt>
  mov    -0x4(%r15),%edi
  add    -0x4(%r13),%edi
  lea    (%rax,%rax,2),%ebx
  call   <d_size_strvec@plt>
  add    %r12d,%ebx
  mov    -0x4(%r14),%edi
  lea    (%rax,%rax,2),%r12d
  mov    -0x58(%rbp),%rax
  add    %ebx,%r12d
  add    (%rax),%edi
  add    %edi,%edi
  call   <d_size_strvec@plt>
  addq   $0x4,-0x58(%rbp)
  lea    (%rax,%rax,4),%ebx
  add    %r12d,%ebx
  cmp    -0x60(%rbp),%r15
  jne    L78
  mov    %ebx,-0x58(%rbp)
L110:
  movslq -0x64(%rbp),%r15
  mov    -0x78(%rbp),%rdx
  mov    -0x70(%rbp),%rcx
  lea    0x0(,%r15,4),%r13
  lea    (%rdx,%r13,1),%rbx
  lea    (%rcx,%r13,1),%r14
  mov    (%r14),%esi
  add    (%rbx),%esi
  lea    0x1(%rsi),%edi
  call   <d_size_strmat@plt>
  add    -0x88(%rbp),%r13
  mov    (%r14),%edi
  mov    0x0(%r13),%esi
  add    (%rbx),%edi
  mov    %rax,%r12
  add    $0x1,%edi
  call   <d_size_strmat@plt>
  mov    (%r14),%edi
  add    %eax,%r12d
  add    -0x58(%rbp),%r12d
  call   <d_size_strvec@plt>
  mov    (%r14),%edi
  add    (%rbx),%edi
  lea    (%rax,%rax,2),%eax
  add    %eax,%r12d
  call   <d_size_strvec@plt>
  mov    -0x80(%rbp),%rdx
  mov    0x0(%r13),%edi
  lea    (%rax,%rax,2),%ebx
  add    (%rdx,%r15,4),%edi
  add    %r12d,%ebx
  add    %edi,%edi
  call   <d_size_strvec@plt>
  lea    (%rax,%rax,4),%r12d
  mov    -0x64(%rbp),%eax
  add    %ebx,%r12d
  cmp    0x10(%rbp),%eax
  jle    L144
  mov    0x10(%rbp),%eax
  mov    %rsp,%rcx
  mov    %rsp,-0x98(%rbp)
  add    $0x1,%eax
  cltq
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rsi
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rsi
  and    $0xfffffffffffffff0,%rdx
  sub    %rsi,%rcx
  cmp    %rcx,%rsp
  je     L5
L88:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L88
L5:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L3
  orq    $0x0,-0x8(%rsp,%rdx,1)
L3:
  mov    %rax,%rsi
  mov    %rsp,%rcx
  mov    %rax,%rdx
  mov    %rsp,%r15
  and    $0xfffffffffffff000,%rsi
  and    $0xfffffffffffffff0,%rdx
  sub    %rsi,%rcx
  cmp    %rcx,%rsp
  je     L109
L154:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L154
L109:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L24
  orq    $0x0,-0x8(%rsp,%rdx,1)
L24:
  mov    %rax,%rsi
  mov    %rsp,%rcx
  mov    %rax,%rdx
  mov    %rsp,%r14
  and    $0xfffffffffffff000,%rsi
  and    $0xfffffffffffffff0,%rdx
  sub    %rsi,%rcx
  cmp    %rcx,%rsp
  je     L98
L181:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L181
L98:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L162
  orq    $0x0,-0x8(%rsp,%rdx,1)
L162:
  mov    %rax,%rdx
  mov    %rsp,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,-0x60(%rbp)
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L20
L69:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L69
L20:
  mov    %rdx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L175
  orq    $0x0,-0x8(%rsp,%rax,1)
L175:
  mov    -0x60(%rbp),%rbx
  mov    0x10(%rbp),%eax
  mov    %rsp,%r13
  sub    $0x8,%rsp
  mov    -0x88(%rbp),%r9
  mov    -0x90(%rbp),%r8
  push   %r13
  mov    -0x80(%rbp),%rcx
  mov    -0x78(%rbp),%rdx
  push   %rbx
  mov    -0x70(%rbp),%rsi
  mov    -0x64(%rbp),%edi
  push   %r14
  push   %r15
  push   %rax
  call   <d_part_cond_compute_problem_size_libstr@plt>
  mov    %r13,%rsp
  lea    -0x50(%rbp),%rax
  mov    -0x80(%rbp),%rcx
  mov    -0x88(%rbp),%r9
  mov    -0x90(%rbp),%r8
  push   %rax
  mov    0x10(%rbp),%eax
  mov    -0x78(%rbp),%rdx
  push   %r13
  mov    -0x70(%rbp),%rsi
  mov    -0x64(%rbp),%edi
  mov    %rbx,-0x60(%rbp)
  push   %rbx
  push   %r14
  push   %r15
  push   %rax
  call   <d_part_cond_work_space_size_bytes_libstr@plt>
  add    $0x28,%rsp
  mov    -0x80(%rbp),%rcx
  mov    -0x64(%rbp),%edi
  mov    %rax,%rbx
  mov    0x10(%rbp),%eax
  mov    -0x88(%rbp),%r9
  push   %r13
  mov    -0x90(%rbp),%r8
  mov    -0x78(%rbp),%rdx
  push   -0x60(%rbp)
  mov    -0x70(%rbp),%rsi
  push   %r14
  push   %r15
  push   %rax
  call   <d_part_cond_memory_space_size_bytes_libstr@plt>
  mov    -0x60(%rbp),%rcx
  mov    0x10(%rbp),%edi
  mov    %r13,%rsp
  add    %eax,%ebx
  mov    %r13,%r8
  mov    %r14,%rdx
  mov    %r15,%rsi
  call   <d_ip2_res_mpc_hard_work_space_size_bytes_libstr@plt>
  add    %r12d,%ebx
  add    %eax,%ebx
  mov    0x10(%rbp),%eax
  test   %eax,%eax
  js     L114
  movslq 0x10(%rbp),%rax
  xor    %r12d,%r12d
  lea    0x4(,%rax,4),%rax
  mov    %rax,-0x58(%rbp)
  mov    %r13,%rax
  mov    %r15,%r13
  mov    %rax,%r15
  cs nopw 0x0(%rax,%rax,1)
L155:
  mov    0x0(%r13,%r12,1),%edi
  call   <d_size_strvec@plt>
  mov    0x0(%r13,%r12,1),%edi
  add    (%r14,%r12,1),%edi
  add    %eax,%ebx
  call   <d_size_strvec@plt>
  mov    (%r15,%r12,1),%edi
  add    %eax,%ebx
  mov    -0x60(%rbp),%rax
  add    (%rax,%r12,1),%edi
  add    $0x4,%r12
  add    %edi,%edi
  call   <d_size_strvec@plt>
  lea    (%rbx,%rax,2),%ebx
  cmp    %r12,-0x58(%rbp)
  jne    L155
L114:
  sub    $0xffffff80,%ebx
  mov    -0x98(%rbp),%rsp
  jmp    L120
  nopl   0x0(%rax,%rax,1)
L144:
  mov    -0x88(%rbp),%r8
  mov    -0x80(%rbp),%rcx
  mov    %eax,%edi
  mov    -0x78(%rbp),%rdx
  mov    -0x70(%rbp),%rsi
  call   <d_ip2_res_mpc_hard_work_space_size_bytes_libstr@plt>
  lea    0x80(%r12,%rax,1),%ebx
L120:
  mov    -0x88(%rbp),%r8
  mov    -0x80(%rbp),%rcx
  mov    -0x78(%rbp),%rdx
  mov    -0x70(%rbp),%rsi
  mov    -0x64(%rbp),%edi
  call   <d_res_res_mpc_hard_work_space_size_bytes_libstr@plt>
  add    %ebx,%eax
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L27
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopl   (%rax)
L83:
  movl   $0x0,-0x58(%rbp)
  jmp    L110
L27:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int hpmpc_d_ip_ocp_hard_tv_work_space_size_bytes(int N, int *nx, int *nu, int *nb, int **hidxb, int *ng, int N2) {
  int ii;
  int size = 0;
  for (ii = 0; ii < N; ii++) {
    size += d_size_strmat(nu[ii] + nx[ii] + 1, nx[ii + 1]);
    size += d_size_strmat(nu[ii] + nx[ii] + 1, nu[ii] + nx[ii]);
    size += d_size_strmat(nu[ii] + nx[ii] + 1, ng[ii]);
    size += 3 * d_size_strvec(nx[ii]);
    size += 3 * d_size_strvec(nu[ii] + nx[ii]);
    size += 5 * d_size_strvec(2 * nb[ii] + 2 * ng[ii]);
  }
  ii = N;
  size += d_size_strmat(nu[ii] + nx[ii] + 1, nu[ii] + nx[ii]);
  size += d_size_strmat(nu[ii] + nx[ii] + 1, ng[ii]);
  size += 3 * d_size_strvec(nx[ii]);
  size += 3 * d_size_strvec(nu[ii] + nx[ii]);
  size += 5 * d_size_strvec(2 * nb[ii] + 2 * ng[ii]);
  if (N2 < N) {
    int nx2[N2 + 1];
    int nu2[N2 + 1];
    int nb2[N2 + 1];
    int ng2[N2 + 1];
    int work_space_sizes[4];
    d_part_cond_compute_problem_size_libstr(N, nx, nu, nb, hidxb, ng, N2, nx2, nu2, nb2, ng2);
    size += d_part_cond_work_space_size_bytes_libstr(N, nx, nu, nb, hidxb, ng, N2, nx2, nu2, nb2, ng2, work_space_sizes);
    size += d_part_cond_memory_space_size_bytes_libstr(N, nx, nu, nb, hidxb, ng, N2, nx2, nu2, nb2, ng2);
    size += d_ip2_res_mpc_hard_work_space_size_bytes_libstr(N2, nx2, nu2, nb2, ng2);
    for (ii = 0; ii <= N2; ii++) {
      size += 1 * d_size_strvec(nx2[ii]);
      size += 1 * d_size_strvec(nu2[ii] + nx2[ii]);
      size += 2 * d_size_strvec(2 * nb2[ii] + 2 * ng2[ii]);
    }
    size += 2 * 64;
  } else {
    size += d_ip2_res_mpc_hard_work_space_size_bytes_libstr(N, nx, nu, nb, ng);
    size += 2 * 64;
  }
  size += d_res_res_mpc_hard_work_space_size_bytes_libstr(N, nx, nu, nb, ng);
  return size;
}
```