user: Demonstrate the C code that generates the assembly output below:

```asm
<spctrn>:
  endbr64
  push   %r14
  mov    %rsi,%r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x50,%rsp
  lea    0x2c(%rsp),%r13
  movsd  %xmm1,0x18(%rsp)
  lea    0x2a(%rsp),%rdx
  movapd %xmm2,%xmm1
  lea    0x28(%rsp),%rsi
  movapd %xmm3,%xmm2
  lea    0x40(%rsp),%r9
  mov    %r13,%rcx
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  lea    0x30(%rsp),%r8
  movsd  %xmm3,0x10(%rsp)
  movsd  %xmm1,0x8(%rsp)
  call   <spcspx@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  jne    L8
  cmpb   $0x0,(%r14)
  movb   $0x0,0x8(%r14)
  mov    %r14,%rdi
  movsd  0x8(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm2
  je     L159
  nopl   0x0(%rax)
L41:
  add    $0x1,%rdi
  cmpb   $0x0,(%rdi)
  jne    L41
L159:
  lea    0x8(%r14),%rdx
  cmp    %rdx,%rdi
  jae    L55
  sub    %rdi,%rdx
  mov    $0x20,%esi
  movsd  %xmm2,0x10(%rsp)
  movsd  %xmm1,0x8(%rsp)
  call   <memset@plt>
  movsd  0x10(%rsp),%xmm2
  movsd  0x8(%rsp),%xmm1
L55:
  lea    0x5(%r14),%r12
  mov    $0x3,%edx
  lea    D21(%rip),%rsi
  movsd  %xmm2,0x10(%rsp)
  mov    %r12,%rdi
  movsd  %xmm1,0x8(%rsp)
  call   <strncmp@plt>
  movsd  0x8(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm2
  test   %rax,%rax
  jne    L129
  movzbl 0x2a(%rsp),%eax
  cmp    $0x77,%al
  je     L3
  cmp    $0x61,%al
  je     L74
  mov    %al,0x5(%r14)
  movb   $0x32,0x6(%r14)
L129:
  movsd  0x30(%rsp),%xmm0
  mov    %rbx,%r8
  mov    %r13,%rcx
  mov    %r14,%rdi
  lea    0x2b(%rsp),%rdx
  lea    0x29(%rsp),%rsi
  lea    0x38(%rsp),%r9
  call   <spcxps@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  jne    L8
  movzbl 0x2b(%rsp),%eax
  cmp    0x2a(%rsp),%al
  jne    L30
  cmpb   $0x3f,0x7(%r14)
  je     L62
L112:
  movsd  0x38(%rsp),%xmm0
  mulsd  0x40(%rsp),%xmm0
  mulsd  0x18(%rsp),%xmm0
  movsd  %xmm0,0x0(%rbp)
L8:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L157
  add    $0x50,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L62:
  movzbl 0x29(%rsp),%edx
  cmp    %dl,%al
  je     L97
  mov    %dl,0x7(%r14)
  jmp    L112
  nopw   0x0(%rax,%rax,1)
L30:
  mov    $0x2,%r12d
  jmp    L8
  nopl   0x0(%rax,%rax,1)
L3:
  lea    D2(%rip),%rsi
  mov    %r12,%rdi
  call   <strcpy@plt>
  movsd  0x8(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm2
  jmp    L129
L74:
  lea    D0(%rip),%rsi
  mov    %r12,%rdi
  movsd  %xmm2,0x10(%rsp)
  movsd  %xmm1,0x8(%rsp)
  call   <strcpy@plt>
  movsd  0x8(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm2
  jmp    L129
L97:
  lea    0x4(%r14),%rdi
  lea    D3(%rip),%rsi
  call   <strcpy@plt>
  jmp    L112
L157:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D21
type: string
name: retrieve_data
arguments: label: D2
type: string
name: retrieve_data
arguments: label: D0
type: string
name: retrieve_data
arguments: label: D3
type: string

tool: D21: ???

tool: D2: GRI

tool: D0: GRA

tool: D3:     

assistant: ```c
int spctrn(const char ctypeS1[9], double crvalS1, double cdeltS1, double restfrq, double restwav, char ctypeS2[9], double *crvalS2, double *cdeltS2) {
  char *cp, ptype1, ptype2, xtype1, xtype2;
  int restreq, status;
  double crvalX, dS2dX, dXdS1;
  if ((status = spcspx(ctypeS1, crvalS1, restfrq, restwav, &ptype1, &xtype1, &restreq, &crvalX, &dXdS1))) {
    return status;
  }
  ctypeS2[8] = '\0';
  for (cp = ctypeS2; *cp; cp++)
    ;
  while (cp < ctypeS2 + 8)
    *(cp++) = ' ';
  if (strncmp(ctypeS2 + 5, "???", 3) == 0) {
    if (xtype1 == 'w') {
      strcpy(ctypeS2 + 5, "GRI");
    } else if (xtype1 == 'a') {
      strcpy(ctypeS2 + 5, "GRA");
    } else {
      ctypeS2[5] = xtype1;
      ctypeS2[6] = '2';
    }
  }
  if ((status = spcxps(ctypeS2, crvalX, restfrq, restwav, &ptype2, &xtype2, &restreq, crvalS2, &dS2dX))) {
    return status;
  }
  if (xtype2 != xtype1) {
    return 2;
  }
  if (ctypeS2[7] == '?') {
    if (ptype2 == xtype2) {
      strcpy(ctypeS2 + 4, "    ");
    } else {
      ctypeS2[7] = ptype2;
    }
  }
  *cdeltS2 = dS2dX * dXdS1 * cdeltS1;
  return 0;
}
```