user: Please show me the C implementation that matches the assembly code listed below:

```asm
<sum>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  movslq %edx,%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  cmp    %r13d,%esi
  je     L537
  lea    (%rsi,%r13,1),%eax
  mov    %eax,%ebx
  shr    $0x1f,%ebx
  add    %eax,%ebx
  sar    %ebx
  cmp    %ebx,%esi
  je     L72
  lea    (%rsi,%rbx,1),%eax
  mov    %eax,%ebp
  shr    $0x1f,%ebp
  add    %eax,%ebp
  sar    %ebp
  cmp    %ebp,%esi
  je     L383
  lea    (%rsi,%rbp,1),%eax
  mov    %eax,%r12d
  shr    $0x1f,%r12d
  add    %eax,%r12d
  sar    %r12d
  cmp    %r12d,%esi
  je     L68
  lea    (%rsi,%r12,1),%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  cmp    %eax,%esi
  je     L301
  lea    (%rsi,%rax,1),%edx
  mov    %eax,0x10(%rsp)
  mov    %edx,%r15d
  shr    $0x1f,%r15d
  add    %edx,%r15d
  sar    %r15d
  mov    %r15d,%edx
  call   <sum>
  mov    0x10(%rsp),%edx
  lea    0x1(%r15),%esi
  mov    %r14,%rdi
  movsd  %xmm0,0x8(%rsp)
  call   <sum>
  movsd  0x8(%rsp),%xmm2
  mov    0x10(%rsp),%eax
  addsd  %xmm0,%xmm2
L379:
  lea    0x1(%rax),%esi
  cmp    %esi,%r12d
  je     L127
  lea    (%r12,%rsi,1),%eax
  mov    %r14,%rdi
  movsd  %xmm2,0x10(%rsp)
  mov    %eax,%r15d
  shr    $0x1f,%r15d
  add    %eax,%r15d
  sar    %r15d
  mov    %r15d,%edx
  call   <sum>
  lea    0x1(%r15),%esi
  mov    %r12d,%edx
  mov    %r14,%rdi
  movsd  %xmm0,0x8(%rsp)
  call   <sum>
  movsd  0x8(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm2
  addsd  %xmm0,%xmm1
L177:
  addsd  %xmm2,%xmm1
L496:
  lea    0x1(%r12),%esi
  cmp    %esi,%ebp
  je     L121
  lea    0x0(%rbp,%rsi,1),%eax
  mov    %eax,%r12d
  shr    $0x1f,%r12d
  add    %eax,%r12d
  sar    %r12d
  cmp    %r12d,%esi
  je     L478
  lea    (%rsi,%r12,1),%eax
  mov    %r14,%rdi
  movsd  %xmm1,0x10(%rsp)
  mov    %eax,%r15d
  shr    $0x1f,%r15d
  add    %eax,%r15d
  sar    %r15d
  mov    %r15d,%edx
  call   <sum>
  lea    0x1(%r15),%esi
  mov    %r12d,%edx
  mov    %r14,%rdi
  movsd  %xmm0,0x8(%rsp)
  call   <sum>
  movsd  0x8(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm1
  addsd  %xmm0,%xmm2
L515:
  lea    0x1(%r12),%esi
  cmp    %esi,%ebp
  je     L189
  lea    0x0(%rbp,%rsi,1),%eax
  mov    %r14,%rdi
  movsd  %xmm2,0x18(%rsp)
  mov    %eax,%r12d
  movsd  %xmm1,0x10(%rsp)
  shr    $0x1f,%r12d
  add    %eax,%r12d
  sar    %r12d
  mov    %r12d,%edx
  call   <sum>
  lea    0x1(%r12),%esi
  mov    %ebp,%edx
  mov    %r14,%rdi
  movsd  %xmm0,0x8(%rsp)
  call   <sum>
  addsd  0x8(%rsp),%xmm0
  movsd  0x18(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm1
L406:
  addsd  %xmm2,%xmm0
L237:
  addsd  %xmm1,%xmm0
  lea    0x1(%rbp),%r8d
  movsd  %xmm0,0x8(%rsp)
  cmp    %r8d,%ebx
  je     L521
L66:
  lea    (%rbx,%r8,1),%eax
  mov    %eax,%esi
  shr    $0x1f,%esi
  add    %eax,%esi
  sar    %esi
  mov    %esi,%r15d
  cmp    %esi,%r8d
  je     L161
  lea    (%r8,%rsi,1),%eax
  mov    %eax,%r12d
  shr    $0x1f,%r12d
  add    %eax,%r12d
  sar    %r12d
  cmp    %r12d,%r8d
  je     L151
  lea    (%r8,%r12,1),%eax
  mov    %r14,%rdi
  mov    %eax,%esi
  shr    $0x1f,%esi
  lea    (%rsi,%rax,1),%ebp
  mov    %r8d,%esi
  sar    %ebp
  mov    %ebp,%edx
  call   <sum>
  lea    0x1(%rbp),%esi
  mov    %r12d,%edx
  mov    %r14,%rdi
  movsd  %xmm0,0x10(%rsp)
  call   <sum>
  movsd  0x10(%rsp),%xmm2
  addsd  %xmm0,%xmm2
L11:
  lea    0x1(%r12),%esi
  cmp    %esi,%r15d
  je     L451
  lea    (%r15,%rsi,1),%eax
  mov    %r14,%rdi
  movsd  %xmm2,0x18(%rsp)
  mov    %eax,%ebp
  shr    $0x1f,%ebp
  add    %eax,%ebp
  sar    %ebp
  mov    %ebp,%edx
  call   <sum>
  lea    0x1(%rbp),%esi
  mov    %r15d,%edx
  mov    %r14,%rdi
  movsd  %xmm0,0x10(%rsp)
  call   <sum>
  movsd  0x10(%rsp),%xmm1
  movsd  0x18(%rsp),%xmm2
  addsd  %xmm0,%xmm1
L312:
  addsd  %xmm2,%xmm1
L296:
  lea    0x1(%r15),%esi
  cmp    %esi,%ebx
  je     L2
  lea    (%rbx,%rsi,1),%eax
  mov    %eax,%ebp
  shr    $0x1f,%ebp
  add    %eax,%ebp
  sar    %ebp
  cmp    %ebp,%esi
  je     L356
  lea    (%rsi,%rbp,1),%eax
  mov    %r14,%rdi
  movsd  %xmm1,0x18(%rsp)
  mov    %eax,%r12d
  shr    $0x1f,%r12d
  add    %eax,%r12d
  sar    %r12d
  mov    %r12d,%edx
  call   <sum>
  lea    0x1(%r12),%esi
  mov    %ebp,%edx
  mov    %r14,%rdi
  movsd  %xmm0,0x10(%rsp)
  call   <sum>
  movsd  0x10(%rsp),%xmm2
  movsd  0x18(%rsp),%xmm1
  addsd  %xmm0,%xmm2
L344:
  lea    0x1(%rbp),%esi
  cmp    %esi,%ebx
  je     L489
  lea    (%rbx,%rsi,1),%eax
  mov    %r14,%rdi
  movsd  %xmm2,0x20(%rsp)
  mov    %eax,%ebp
  movsd  %xmm1,0x18(%rsp)
  shr    $0x1f,%ebp
  add    %eax,%ebp
  sar    %ebp
  mov    %ebp,%edx
  call   <sum>
  lea    0x1(%rbp),%esi
  mov    %ebx,%edx
  mov    %r14,%rdi
  movsd  %xmm0,0x10(%rsp)
  call   <sum>
  addsd  0x10(%rsp),%xmm0
  movsd  0x20(%rsp),%xmm2
  movsd  0x18(%rsp),%xmm1
L424:
  addsd  %xmm2,%xmm0
L229:
  addsd  %xmm1,%xmm0
L128:
  addsd  0x8(%rsp),%xmm0
  lea    0x1(%rbx),%esi
  movsd  %xmm0,0x8(%rsp)
  cmp    %r13d,%esi
  jne    L554
L136:
  movsd  (%r14,%r13,8),%xmm0
L32:
  addsd  0x8(%rsp),%xmm0
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L72:
  movslq %ebx,%rax
  lea    0x1(%rbx),%esi
  movsd  (%rdi,%rax,8),%xmm6
  movsd  %xmm6,0x8(%rsp)
  cmp    %r13d,%esi
  je     L136
L554:
  lea    (%rsi,%r13,1),%eax
  mov    %eax,%ebp
  shr    $0x1f,%ebp
  add    %eax,%ebp
  sar    %ebp
  cmp    %ebp,%esi
  je     L316
  lea    (%rsi,%rbp,1),%eax
  mov    %eax,%r12d
  shr    $0x1f,%r12d
  add    %eax,%r12d
  sar    %r12d
  cmp    %r12d,%esi
  je     L408
  lea    (%rsi,%r12,1),%eax
  mov    %eax,%ebx
  shr    $0x1f,%ebx
  add    %eax,%ebx
  sar    %ebx
  cmp    %ebx,%esi
  je     L444
  lea    (%rsi,%rbx,1),%eax
  mov    %r14,%rdi
  mov    %eax,%r15d
  shr    $0x1f,%r15d
  add    %eax,%r15d
  sar    %r15d
  mov    %r15d,%edx
  call   <sum>
  lea    0x1(%r15),%esi
  mov    %ebx,%edx
  mov    %r14,%rdi
  movsd  %xmm0,0x10(%rsp)
  call   <sum>
  movsd  0x10(%rsp),%xmm2
  addsd  %xmm0,%xmm2
L314:
  lea    0x1(%rbx),%esi
  cmp    %esi,%r12d
  je     L131
  lea    (%r12,%rsi,1),%eax
  mov    %r14,%rdi
  movsd  %xmm2,0x18(%rsp)
  mov    %eax,%ebx
  shr    $0x1f,%ebx
  add    %eax,%ebx
  sar    %ebx
  mov    %ebx,%edx
  call   <sum>
  lea    0x1(%rbx),%esi
  mov    %r12d,%edx
  mov    %r14,%rdi
  movsd  %xmm0,0x10(%rsp)
  call   <sum>
  movsd  0x10(%rsp),%xmm1
  movsd  0x18(%rsp),%xmm2
  addsd  %xmm0,%xmm1
L563:
  addsd  %xmm2,%xmm1
L458:
  lea    0x1(%r12),%esi
  cmp    %esi,%ebp
  je     L464
  lea    0x0(%rbp,%rsi,1),%eax
  mov    %eax,%ebx
  shr    $0x1f,%ebx
  add    %eax,%ebx
  sar    %ebx
  cmp    %ebx,%esi
  je     L115
  lea    (%rsi,%rbx,1),%eax
  mov    %r14,%rdi
  movsd  %xmm1,0x18(%rsp)
  mov    %eax,%r12d
  shr    $0x1f,%r12d
  add    %eax,%r12d
  sar    %r12d
  mov    %r12d,%edx
  call   <sum>
  lea    0x1(%r12),%esi
  mov    %ebx,%edx
  mov    %r14,%rdi
  movsd  %xmm0,0x10(%rsp)
  call   <sum>
  movsd  0x10(%rsp),%xmm2
  movsd  0x18(%rsp),%xmm1
  addsd  %xmm0,%xmm2
L324:
  lea    0x1(%rbx),%esi
  cmp    %esi,%ebp
  je     L412
  lea    0x0(%rbp,%rsi,1),%eax
  mov    %r14,%rdi
  movsd  %xmm2,0x20(%rsp)
  mov    %eax,%ebx
  movsd  %xmm1,0x18(%rsp)
  shr    $0x1f,%ebx
  add    %eax,%ebx
  sar    %ebx
  mov    %ebx,%edx
  call   <sum>
  lea    0x1(%rbx),%esi
  mov    %ebp,%edx
  mov    %r14,%rdi
  movsd  %xmm0,0x10(%rsp)
  call   <sum>
  addsd  0x10(%rsp),%xmm0
  movsd  0x20(%rsp),%xmm2
  movsd  0x18(%rsp),%xmm1
L84:
  addsd  %xmm2,%xmm0
L470:
  addsd  %xmm1,%xmm0
  add    $0x1,%ebp
  movsd  %xmm0,0x10(%rsp)
  cmp    %ebp,%r13d
  je     L551
L543:
  lea    0x0(%r13,%rbp,1),%eax
  mov    %eax,%esi
  shr    $0x1f,%esi
  add    %eax,%esi
  sar    %esi
  mov    %esi,%r12d
  cmp    %esi,%ebp
  je     L221
  lea    0x0(%rbp,%rsi,1),%eax
  mov    %eax,%ebx
  shr    $0x1f,%ebx
  add    %eax,%ebx
  sar    %ebx
  cmp    %ebx,%ebp
  je     L562
  lea    0x0(%rbp,%rbx,1),%eax
  mov    %ebp,%esi
  mov    %r14,%rdi
  mov    %eax,%r15d
  shr    $0x1f,%r15d
  add    %eax,%r15d
  sar    %r15d
  mov    %r15d,%edx
  call   <sum>
  lea    0x1(%r15),%esi
  mov    %ebx,%edx
  mov    %r14,%rdi
  movsd  %xmm0,0x18(%rsp)
  call   <sum>
  movsd  0x18(%rsp),%xmm2
  addsd  %xmm0,%xmm2
L400:
  lea    0x1(%rbx),%esi
  cmp    %esi,%r12d
  je     L382
  lea    (%r12,%rsi,1),%eax
  mov    %r14,%rdi
  movsd  %xmm2,0x20(%rsp)
  mov    %eax,%ebx
  shr    $0x1f,%ebx
  add    %eax,%ebx
  sar    %ebx
  mov    %ebx,%edx
  call   <sum>
  lea    0x1(%rbx),%esi
  mov    %r12d,%edx
  mov    %r14,%rdi
  movsd  %xmm0,0x18(%rsp)
  call   <sum>
  movsd  0x18(%rsp),%xmm1
  movsd  0x20(%rsp),%xmm2
  addsd  %xmm0,%xmm1
L577:
  addsd  %xmm2,%xmm1
L55:
  lea    0x1(%r12),%esi
  cmp    %esi,%r13d
  je     L578
  lea    0x0(%r13,%rsi,1),%eax
  mov    %eax,%ebx
  shr    $0x1f,%ebx
  add    %eax,%ebx
  sar    %ebx
  cmp    %ebx,%esi
  je     L113
  lea    (%rsi,%rbx,1),%eax
  mov    %r14,%rdi
  movsd  %xmm1,0x20(%rsp)
  mov    %eax,%ebp
  shr    $0x1f,%ebp
  add    %eax,%ebp
  sar    %ebp
  mov    %ebp,%edx
  call   <sum>
  lea    0x1(%rbp),%esi
  mov    %ebx,%edx
  mov    %r14,%rdi
  movsd  %xmm0,0x18(%rsp)
  call   <sum>
  movsd  0x18(%rsp),%xmm2
  movsd  0x20(%rsp),%xmm1
  addsd  %xmm0,%xmm2
L512:
  lea    0x1(%rbx),%esi
  cmp    %esi,%r13d
  je     L236
  lea    0x0(%r13,%rsi,1),%eax
  mov    %r14,%rdi
  movsd  %xmm2,0x28(%rsp)
  mov    %eax,%ebx
  movsd  %xmm1,0x20(%rsp)
  shr    $0x1f,%ebx
  add    %eax,%ebx
  sar    %ebx
  mov    %ebx,%edx
  call   <sum>
  lea    0x1(%rbx),%esi
  mov    %r13d,%edx
  mov    %r14,%rdi
  movsd  %xmm0,0x18(%rsp)
  call   <sum>
  addsd  0x18(%rsp),%xmm0
  movsd  0x28(%rsp),%xmm2
  movsd  0x20(%rsp),%xmm1
L276:
  addsd  %xmm2,%xmm0
L415:
  addsd  %xmm1,%xmm0
L273:
  addsd  0x10(%rsp),%xmm0
  jmp    L32
  nopw   0x0(%rax,%rax,1)
L537:
  movslq %esi,%rsi
  movsd  (%rdi,%rsi,8),%xmm0
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L408:
  movslq %r12d,%rax
  movsd  (%r14,%rax,8),%xmm1
  jmp    L458
  xchg   %ax,%ax
L68:
  movslq %r12d,%rax
  movsd  (%rdi,%rax,8),%xmm1
  jmp    L496
  nopl   (%rax)
L316:
  movslq %ebp,%rax
  add    $0x1,%ebp
  movsd  (%r14,%rax,8),%xmm7
  movsd  %xmm7,0x10(%rsp)
  cmp    %ebp,%r13d
  jne    L543
L551:
  movsd  (%r14,%r13,8),%xmm0
  jmp    L273
  nopl   0x0(%rax,%rax,1)
L383:
  movslq %ebp,%rax
  lea    0x1(%rbp),%r8d
  movsd  (%rdi,%rax,8),%xmm7
  movsd  %xmm7,0x8(%rsp)
  cmp    %r8d,%ebx
  jne    L66
L521:
  movslq %ebx,%rax
  movsd  (%r14,%rax,8),%xmm0
  jmp    L128
  nopl   0x0(%rax)
L221:
  movslq %esi,%rax
  movsd  (%r14,%rax,8),%xmm1
  jmp    L55
  cs nopw 0x0(%rax,%rax,1)
L464:
  movslq %ebp,%rax
  movsd  (%r14,%rax,8),%xmm0
  jmp    L470
  xchg   %ax,%ax
L161:
  movslq %esi,%rax
  movsd  (%r14,%rax,8),%xmm1
  jmp    L296
  xchg   %ax,%ax
L121:
  movslq %ebp,%rax
  movsd  (%r14,%rax,8),%xmm0
  jmp    L237
  xchg   %ax,%ax
L578:
  movsd  (%r14,%r13,8),%xmm0
  jmp    L415
  nopl   0x0(%rax,%rax,1)
L2:
  movslq %ebx,%rax
  movsd  (%r14,%rax,8),%xmm0
  jmp    L229
  xchg   %ax,%ax
L382:
  movslq %r12d,%rax
  movsd  (%r14,%rax,8),%xmm1
  jmp    L577
  xchg   %ax,%ax
L451:
  movslq %r15d,%rax
  movsd  (%r14,%rax,8),%xmm1
  jmp    L312
  xchg   %ax,%ax
L489:
  movslq %ebx,%rax
  movsd  (%r14,%rax,8),%xmm0
  jmp    L424
  xchg   %ax,%ax
L356:
  movslq %ebp,%rax
  movsd  (%r14,%rax,8),%xmm2
  jmp    L344
  xchg   %ax,%ax
L412:
  movslq %ebp,%rax
  movsd  (%r14,%rax,8),%xmm0
  jmp    L84
  xchg   %ax,%ax
L189:
  movslq %ebp,%rax
  movsd  (%r14,%rax,8),%xmm0
  jmp    L406
  xchg   %ax,%ax
L236:
  movsd  (%r14,%r13,8),%xmm0
  jmp    L276
  nopl   0x0(%rax,%rax,1)
L113:
  movslq %ebx,%rax
  movsd  (%r14,%rax,8),%xmm2
  jmp    L512
  xchg   %ax,%ax
L151:
  movslq %r12d,%rax
  movsd  (%r14,%rax,8),%xmm2
  jmp    L11
  xchg   %ax,%ax
L478:
  movslq %r12d,%rax
  movsd  (%r14,%rax,8),%xmm2
  jmp    L515
  xchg   %ax,%ax
L127:
  movslq %r12d,%rax
  movsd  (%r14,%rax,8),%xmm1
  jmp    L177
  xchg   %ax,%ax
L301:
  movslq %eax,%rdx
  movsd  (%rdi,%rdx,8),%xmm2
  jmp    L379
  nopl   (%rax)
L562:
  movslq %ebx,%rax
  movsd  (%r14,%rax,8),%xmm2
  jmp    L400
  xchg   %ax,%ax
L115:
  movslq %ebx,%rax
  movsd  (%r14,%rax,8),%xmm2
  jmp    L324
  xchg   %ax,%ax
L131:
  movslq %r12d,%rax
  movsd  (%r14,%rax,8),%xmm1
  jmp    L563
  xchg   %ax,%ax
L444:
  movslq %ebx,%rax
  movsd  (%r14,%rax,8),%xmm2
  jmp    L314
```

assistant: ```c
double sum(double *v, int low, int high) {
  if (low == high)
    return v[low];
  int mid = (low + high) / 2;
  return sum(v, low, mid) + sum(v, mid + 1, high);
}
```