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

```asm
<matexp>:
  endbr64
  push   %r15
  mov    %esi,%r15d
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x38,%rsp
  mov    %edx,0x8(%rsp)
  movsd  %xmm0,(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    -0x2(%rdx),%eax
  cmp    $0x1d,%eax
  ja     L155
L34:
  mov    %r15d,%eax
  mov    %rbx,0x10(%rsp)
  imul   %r15d,%eax
  mov    %rbp,0x18(%rsp)
  mov    %eax,0xc(%rsp)
  test   %eax,%eax
  je     L48
  mov    0x8(%rsp),%r14d
  lea    -0x1(%rax),%edx
  mov    %rbx,%r12
  lea    0x8(%rbx,%rdx,8),%r13
  neg    %r14d
L93:
  movsd  (%rsp),%xmm0
  mulsd  (%r12),%xmm0
  mov    %r14d,%edi
  add    $0x8,%r12
  call   <ldexp@plt>
  movsd  %xmm0,-0x8(%r12)
  cmp    %r12,%r13
  jne    L93
  mov    %rbp,%rdx
  mov    %r15d,%r9d
  mov    %r15d,%r8d
  mov    %r15d,%ecx
  mov    %rbx,%rsi
  mov    %rbx,%rdi
  call   <matby@plt>
  mov    0xc(%rsp),%edx
  movsd  D2(%rip),%xmm1
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L71:
  movsd  0x0(%rbp,%rax,8),%xmm0
  mulsd  %xmm1,%xmm0
  addsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L71
L82:
  test   %r15d,%r15d
  jle    L24
  movslq %r15d,%rax
  movsd  D3(%rip),%xmm1
  xor    %edx,%edx
  lea    0x8(,%rax,8),%rcx
  mov    %rbx,%rax
  nopw   0x0(%rax,%rax,1)
L152:
  movsd  (%rax),%xmm0
  add    $0x1,%edx
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  add    %rcx,%rax
  cmp    %edx,%r15d
  jne    L152
L24:
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  jle    L76
  mov    %rbx,%rdi
  mov    %rbp,%rdx
  xor    %r12d,%r12d
  xor    %r14d,%r14d
  jmp    L21
  nopl   (%rax)
L136:
  movslq %r14d,%rax
  mov    0x10(%rsp,%rax,8),%rdx
  mov    $0x1,%eax
  sub    %r14d,%eax
  mov    %r13d,%r14d
  cltq
  mov    0x10(%rsp,%rax,8),%rdi
L21:
  mov    %r14d,%r13d
  mov    %r15d,%r9d
  mov    %r15d,%r8d
  mov    %r15d,%ecx
  mov    %rdi,%rsi
  xor    $0x1,%r13d
  add    $0x1,%r12d
  call   <matby@plt>
  cmp    %r12d,0x8(%rsp)
  jne    L136
  test   %r14d,%r14d
  je     L159
L76:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L66
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L159:
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  je     L76
  movslq %eax,%r15
  xor    %eax,%eax
  nopl   (%rax)
L88:
  movsd  0x0(%rbp,%rax,8),%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%r15
  jne    L88
  jmp    L76
  xchg   %ax,%ax
L155:
  lea    D21(%rip),%rdi
  call   <error2@plt>
  jmp    L34
  nopl   0x0(%rax)
L48:
  mov    %r15d,%r9d
  mov    %r15d,%r8d
  mov    %r15d,%ecx
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    %rbx,%rdi
  call   <matby@plt>
  jmp    L82
L66:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D2
type: byte[8]
name: retrieve_data
arguments: tag: D3
type: byte[8]
name: retrieve_data
arguments: tag: D21
type: string

tool: {"D2": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f]}

tool: {"D3": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

tool: D21: TimeSquare not good

assistant: ```c
int matexp(double Q[], double t, int n, int TimeSquare, double space[]) {
  int it, i;
  double *T[2];
  if (TimeSquare < 2 || TimeSquare > 31)
    error2("TimeSquare not good");
  T[0] = Q;
  T[1] = space;
  for (i = 0; i < n * n; i++)
    T[0][i] = ldexp(Q[i] * t, -TimeSquare);
  matby(T[0], T[0], T[1], n, n, n);
  for (i = 0; i < n * n; i++)
    T[0][i] += T[1][i] / 2;
  for (i = 0; i < n; i++)
    T[0][i * n + i]++;
  for (i = 0, it = 0; i < TimeSquare; i++) {
    it = !it;
    matby(T[1 - it], T[1 - it], T[it], n, n, n);
  }
  if (it == 1)
    for (i = 0; i < n * n; i++)
      Q[i] = T[1][i];
  return (0);
}
```