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    L137
  mov    %rsi,%rbx
  mov    %rdx,%r13
  mov    %r9,%r14
  mov    %rcx,%r15
  lea    -0x1(%rdi),%eax
  lea    0x4(%rsi,%rax,4),%rax
  mov    %rax,-0x60(%rbp)
  mov    $0x0,%r12d
L12:
  mov    0x4(%rbx),%esi
  mov    (%rbx),%edi
  add    0x0(%r13),%edi
  add    $0x1,%edi
  call   <d_size_strmat@plt>
  mov    %rax,-0x58(%rbp)
  mov    (%rbx),%esi
  add    0x0(%r13),%esi
  lea    0x1(%rsi),%edi
  call   <d_size_strmat@plt>
  add    -0x58(%rbp),%eax
  add    %eax,%r12d
  mov    (%rbx),%edi
  add    0x0(%r13),%edi
  add    $0x1,%edi
  mov    (%r14),%esi
  call   <d_size_strmat@plt>
  add    %eax,%r12d
  mov    (%rbx),%edi
  call   <d_size_strvec@plt>
  lea    (%rax,%rax,2),%eax
  add    %eax,%r12d
  mov    (%rbx),%edi
  add    0x0(%r13),%edi
  call   <d_size_strvec@plt>
  lea    (%rax,%rax,2),%eax
  add    %eax,%r12d
  mov    (%r14),%edi
  add    (%r15),%edi
  add    %edi,%edi
  call   <d_size_strvec@plt>
  lea    (%rax,%rax,4),%eax
  add    %eax,%r12d
  add    $0x4,%rbx
  add    $0x4,%r13
  add    $0x4,%r14
  add    $0x4,%r15
  cmp    -0x60(%rbp),%rbx
  jne    L12
  mov    %r12d,%r15d
L42:
  movslq -0x64(%rbp),%r14
  lea    0x0(,%r14,4),%rbx
  mov    -0x78(%rbp),%rcx
  lea    (%rcx,%rbx,1),%r13
  mov    -0x70(%rbp),%rcx
  lea    (%rcx,%rbx,1),%r12
  mov    (%r12),%esi
  add    0x0(%r13),%esi
  lea    0x1(%rsi),%edi
  call   <d_size_strmat@plt>
  add    %eax,%r15d
  add    -0x88(%rbp),%rbx
  mov    (%r12),%edi
  add    0x0(%r13),%edi
  add    $0x1,%edi
  mov    (%rbx),%esi
  call   <d_size_strmat@plt>
  add    %eax,%r15d
  mov    (%r12),%edi
  call   <d_size_strvec@plt>
  lea    (%rax,%rax,2),%eax
  add    %eax,%r15d
  mov    (%r12),%edi
  add    0x0(%r13),%edi
  call   <d_size_strvec@plt>
  lea    (%rax,%rax,2),%r12d
  add    %r15d,%r12d
  mov    (%rbx),%edi
  mov    -0x80(%rbp),%rdx
  add    (%rdx,%r14,4),%edi
  add    %edi,%edi
  call   <d_size_strvec@plt>
  lea    (%rax,%rax,4),%eax
  add    %eax,%r12d
  mov    -0x64(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jle    L49
  mov    %rsp,-0x98(%rbp)
  mov    0x10(%rbp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x2,%rax
  lea    0xf(%rax),%rdx
  mov    %rdx,%rsi
  and    $0xfffffffffffffff0,%rsi
  and    $0xfffffffffffff000,%rdx
  mov    %rsp,%rcx
  sub    %rdx,%rcx
L146:
  cmp    %rcx,%rsp
  je     L91
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L146
L137:
  mov    $0x0,%r15d
  jmp    L42
L91:
  mov    %rsi,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L101
  orq    $0x0,-0x8(%rsp,%rdx,1)
L101:
  mov    %rsp,%r13
  lea    0xf(%rax),%rdx
  mov    %rdx,%rsi
  and    $0xfffffffffffffff0,%rsi
  and    $0xfffffffffffff000,%rdx
  mov    %rsp,%rcx
  sub    %rdx,%rcx
L185:
  cmp    %rcx,%rsp
  je     L6
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L185
L6:
  mov    %rsi,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L14
  orq    $0x0,-0x8(%rsp,%rdx,1)
L14:
  mov    %rsp,%r14
  lea    0xf(%rax),%rdx
  mov    %rdx,%rsi
  and    $0xfffffffffffffff0,%rsi
  and    $0xfffffffffffff000,%rdx
  mov    %rsp,%rcx
  sub    %rdx,%rcx
L59:
  cmp    %rcx,%rsp
  je     L150
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L59
L150:
  mov    %rsi,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L187
  orq    $0x0,-0x8(%rsp,%rdx,1)
L187:
  mov    %rsp,-0x60(%rbp)
  add    $0xf,%rax
  mov    %rax,%rdx
  and    $0xfffffffffffffff0,%rdx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rcx
  sub    %rax,%rcx
L176:
  cmp    %rcx,%rsp
  je     L5
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L176
L5:
  mov    %rdx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L114
  orq    $0x0,-0x8(%rsp,%rax,1)
L114:
  mov    %rsp,%r15
  sub    $0x8,%rsp
  push   %r15
  mov    -0x60(%rbp),%rbx
  push   %rbx
  push   %r14
  push   %r13
  mov    0x10(%rbp),%eax
  push   %rax
  mov    -0x88(%rbp),%r9
  mov    -0x90(%rbp),%r8
  mov    -0x80(%rbp),%rcx
  mov    -0x78(%rbp),%rdx
  mov    -0x70(%rbp),%rsi
  mov    -0x64(%rbp),%edi
  call   <d_part_cond_compute_problem_size_libstr@plt>
  mov    %r15,%rsp
  lea    -0x50(%rbp),%rax
  push   %rax
  push   %r15
  mov    %rbx,-0x60(%rbp)
  push   %rbx
  push   %r14
  push   %r13
  mov    0x10(%rbp),%eax
  push   %rax
  mov    -0x88(%rbp),%r9
  mov    -0x90(%rbp),%r8
  mov    -0x80(%rbp),%rcx
  mov    -0x78(%rbp),%rdx
  mov    -0x70(%rbp),%rsi
  mov    -0x64(%rbp),%edi
  call   <d_part_cond_work_space_size_bytes_libstr@plt>
  mov    %rax,%rbx
  add    $0x28,%rsp
  push   %r15
  push   -0x60(%rbp)
  push   %r14
  push   %r13
  mov    0x10(%rbp),%eax
  push   %rax
  mov    -0x88(%rbp),%r9
  mov    -0x90(%rbp),%r8
  mov    -0x80(%rbp),%rcx
  mov    -0x78(%rbp),%rdx
  mov    -0x70(%rbp),%rsi
  mov    -0x64(%rbp),%edi
  call   <d_part_cond_memory_space_size_bytes_libstr@plt>
  add    %ebx,%eax
  add    %eax,%r12d
  mov    %r15,%rsp
  mov    %r15,%r8
  mov    -0x60(%rbp),%rcx
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    0x10(%rbp),%edi
  call   <d_ip2_res_mpc_hard_work_space_size_bytes_libstr@plt>
  add    %eax,%r12d
  cmpl   $0x0,0x10(%rbp)
  js     L112
  mov    0x10(%rbp),%eax
  lea    0x4(,%rax,4),%rax
  mov    %rax,-0x58(%rbp)
  mov    $0x0,%ebx
L148:
  mov    0x0(%r13,%rbx,1),%edi
  call   <d_size_strvec@plt>
  add    %eax,%r12d
  mov    0x0(%r13,%rbx,1),%edi
  add    (%r14,%rbx,1),%edi
  call   <d_size_strvec@plt>
  add    %eax,%r12d
  mov    (%r15,%rbx,1),%edi
  mov    -0x60(%rbp),%rax
  add    (%rax,%rbx,1),%edi
  add    %edi,%edi
  call   <d_size_strvec@plt>
  lea    (%r12,%rax,2),%r12d
  add    $0x4,%rbx
  cmp    %rbx,-0x58(%rbp)
  jne    L148
L112:
  sub    $0xffffff80,%r12d
  mov    -0x98(%rbp),%rsp
L37:
  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    %r12d,%eax
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L131
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L49:
  mov    -0x88(%rbp),%r8
  mov    -0x80(%rbp),%rcx
  mov    -0x78(%rbp),%rdx
  mov    -0x70(%rbp),%rsi
  mov    -0x64(%rbp),%edi
  call   <d_ip2_res_mpc_hard_work_space_size_bytes_libstr@plt>
  lea    0x80(%r12,%rax,1),%r12d
  jmp    L37
L131:
  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;
}
```