user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<pack_coefficients>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %edi,0xc(%rsp)
  mov    %rsi,0x18(%rsp)
  mov    %rdx,0x10(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  test   %edi,%edi
  jle    L0
  sub    $0x1,%edi
  mov    %rcx,%r14
  mov    %edi,(%rsp)
  je     L26
  lea    0x20(%rsp),%r13
  xor    %ebx,%ebx
  xor    %r15d,%r15d
  mov    %r13,%rax
  lea    D17(%rip),%rbp
  mov    %rsi,%r13
  mov    %rax,%r12
  nopl   0x0(%rax)
L110:
  movabs $0x2020202020202020,%rax
  movsd  0x0(%r13),%xmm0
  mov    %rbp,%rsi
  mov    %r12,%rdi
  movabs $0x2020202020202020,%rdx
  mov    %rax,(%r12)
  movabs $0x2020202020202020,%rax
  mov    %rdx,0x8(%r12)
  mov    $0x2020,%edx
  mov    %rax,0x10(%r12)
  movl   $0x20202020,0x18(%r12)
  mov    %dx,0x1c(%r12)
  call   <sprintf@plt>
  movslq %ebx,%rax
  mov    %r12,%rsi
  lea    0x1e(%rax),%r9
  sub    %rax,%rsi
  jmp    L8
  nopl   0x0(%rax,%rax,1)
L13:
  mov    %dl,(%r14,%rax,1)
  add    $0x1,%rax
  cmp    %r9,%rax
  je     L81
L8:
  movzbl (%rsi,%rax,1),%edx
  movslq %eax,%rcx
  lea    0x1(%rax),%r8d
  test   $0xdf,%dl
  jne    L13
L53:
  movb   $0x20,(%r14,%rcx,1)
  lea    0x1(%rcx),%ebx
  add    $0x1,%r15d
  add    $0x8,%r13
  cmp    (%rsp),%r15d
  jl     L110
  mov    %r15d,(%rsp)
  mov    %r12,%r13
  cmp    %r15d,0xc(%rsp)
  jle    L137
L124:
  movabs $0x2020202020202020,%r15
  movslq (%rsp),%r12
  mov    %rbp,(%rsp)
  mov    %r12,%rbp
  mov    0x18(%rsp),%r12
  nopw   0x0(%rax,%rax,1)
L96:
  mov    %r15,0x10(%r13)
  mov    (%rsp),%rsi
  mov    %r13,%rdi
  movabs $0x2020202020202020,%rax
  mov    %rax,0x0(%r13)
  mov    $0x2020,%eax
  movabs $0x2020202020202020,%rdx
  movsd  (%r12,%rbp,8),%xmm0
  mov    %rdx,0x8(%r13)
  movl   $0x20202020,0x18(%r13)
  mov    %ax,0x1c(%r13)
  call   <sprintf@plt>
  movslq %ebx,%rax
  mov    %r13,%rsi
  lea    0x1e(%rax),%r10
  sub    %rax,%rsi
  jmp    L159
  nopl   0x0(%rax,%rax,1)
L130:
  mov    %dl,(%r14,%rax,1)
  add    $0x1,%rax
  cmp    %r10,%rax
  je     L55
L159:
  movzbl (%rsi,%rax,1),%edx
  movslq %eax,%rcx
  lea    0x1(%rax),%r9d
  test   $0xdf,%dl
  jne    L130
L5:
  movb   $0x0,(%r14,%rcx,1)
  lea    0x1(%rcx),%ebx
  add    $0x1,%rbp
  cmp    %ebp,0xc(%rsp)
  jg     L96
L137:
  sub    $0x1,%ebx
L33:
  mov    0x10(%rsp),%rax
  mov    %ebx,(%rax)
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L150
  add    $0x58,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L55:
  movslq %r9d,%rcx
  jmp    L5
  nopl   (%rax)
L81:
  movslq %r8d,%rcx
  jmp    L53
L26:
  xor    %ebx,%ebx
  lea    0x20(%rsp),%r13
  lea    D17(%rip),%rbp
  jmp    L124
L0:
  mov    $0xffffffff,%ebx
  jmp    L33
L150:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D17
type_guessed: string

tool: D17: %.17e

assistant: ```c
int pack_coefficients(int n, double *c, int *np, char *p) {
  int i, j;
  const int size = 30;
  char buf[size];
  int index = 0;
  for (i = 0; i < n; i++) {
    for (j = 0; j < size; j++)
      buf[j] = ' ';
    sprintf(buf, "%.17e", c[i]);
    for (j = 0; j < size; j++) {
      if ((buf[j] == '\0') || (buf[j] == ' '))
        break;
      p[index++] = buf[j];
    }
    if (i < n - 1)
      p[index++] = ' ';
    else
      p[index++] = '\0';
  }
  *np = index - 1;
  return 0;
}
```