user: What would the C source look like for the assembly code provided here:

```asm
<Search>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %edx,%ebx
  sub    $0x38,%rsp
  mov    %edi,0x28(%rsp)
  shl    $0x3,%edi
  mov    %rsi,0x20(%rsp)
  call   <malloc@plt>
  movsd  0x0(%rbp),%xmm0
  pxor   %xmm7,%xmm7
  mov    %rax,%r13
  comisd %xmm7,%xmm0
  jbe    L424
  comisd 0x8(%rbp),%xmm0
  jbe    L424
  movl   $0x0,0x0(%r13)
  mov    $0x1,%r12d
L200:
  lea    -0x1(%rbx),%edi
  cmp    $0x1,%edi
  jg     L177
  nopl   0x0(%rax,%rax,1)
L50:
  movslq %edi,%rax
  pxor   %xmm6,%xmm6
  movsd  0x0(%rbp,%rax,8),%xmm0
  lea    0x0(,%rax,8),%rdx
  comisd %xmm6,%xmm0
  jbe    L418
  comisd -0x8(%rbp,%rdx,1),%xmm0
  jbe    L418
  movslq %r12d,%rax
  add    $0x1,%r12d
  mov    %edi,0x0(%r13,%rax,4)
L36:
  mov    0x28(%rsp),%eax
  add    $0x1,%eax
  mov    %eax,%esi
  mov    %eax,0x2c(%rsp)
  mov    %r12d,%eax
  sub    %esi,%eax
  mov    %eax,0x14(%rsp)
  test   %eax,%eax
  jle    L94
  movslq %r12d,%rax
  lea    -0x4(%r13,%rax,4),%rax
  mov    %rax,0x18(%rsp)
  jmp    L362
  nopl   0x0(%rax)
L32:
  pxor   %xmm3,%xmm3
  comisd %xmm0,%xmm3
  ja     L361
L288:
  lea    -0x1(%r12),%ebx
  cmp    %r12d,%r15d
  jge    L410
L6:
  lea    -0x1(%r12),%ebx
  movslq %r15d,%rdi
  mov    %ebx,%eax
  shl    $0x2,%rdi
  sub    %r15d,%eax
  cmp    %r12d,%r15d
  lea    0x4(%r13,%rdi,1),%rsi
  lea    0x4(,%rax,4),%rdx
  mov    $0x4,%eax
  cmovge %rax,%rdx
  add    %r13,%rdi
  call   <memmove@plt>
L410:
  subq   $0x4,0x18(%rsp)
  mov    %ebx,%r12d
  subl   $0x1,0x14(%rsp)
  je     L94
L362:
  movslq 0x0(%r13),%rax
  pxor   %xmm4,%xmm4
  xor    %edi,%edi
  movsd  0x0(%rbp,%rax,8),%xmm0
  comisd %xmm4,%xmm0
  seta   %dil
  cmp    $0x1,%r12d
  jle    L119
  lea    0x4(%r13),%rbx
  xor    %r15d,%r15d
  mov    $0x1,%r14d
  nopl   (%rax)
L160:
  movslq (%rbx),%rax
  mov    %edi,0x10(%rsp)
  movsd  0x0(%rbp,%rax,8),%xmm0
  call   <fabs@plt>
  mov    %rax,0x8(%rsp)
  movslq %r15d,%rax
  movslq 0x0(%r13,%rax,4),%rax
  movsd  0x0(%rbp,%rax,8),%xmm0
  call   <fabs@plt>
  mov    0x10(%rsp),%edi
  cmp    %rax,0x8(%rsp)
  movslq (%rbx),%rax
  cmovl  %r14d,%r15d
  movsd  0x0(%rbp,%rax,8),%xmm0
  test   %edi,%edi
  jne    L32
  pxor   %xmm2,%xmm2
  comisd %xmm2,%xmm0
  jbe    L288
  mov    $0x1,%edi
L343:
  add    $0x1,%r14d
  add    $0x4,%rbx
  cmp    %r12d,%r14d
  jne    L160
L175:
  cmpl   $0x1,0x14(%rsp)
  jne    L288
  mov    0x18(%rsp),%r14
  movslq (%r14),%rax
  movsd  0x0(%rbp,%rax,8),%xmm0
  call   <fabs@plt>
  mov    %rax,%rbx
  movslq 0x0(%r13),%rax
  movsd  0x0(%rbp,%rax,8),%xmm0
  call   <fabs@plt>
  cmp    %rax,%rbx
  mov    %r14,%rax
  cmovge %r13,%rax
  mov    (%rax),%r15d
  cmp    %r12d,%r15d
  jl     L6
L94:
  mov    0x28(%rsp),%eax
  test   %eax,%eax
  js     L257
  mov    0x20(%rsp),%rsi
  lea    0x4(%r13),%rdx
  mov    %rsi,%rax
  sub    %rdx,%rax
  cmp    $0x8,%rax
  jbe    L409
  cmpl   $0x2,0x28(%rsp)
  jbe    L409
  mov    0x2c(%rsp),%edx
  sub    %r13,%rsi
  mov    %r13,%rax
  mov    %rsi,%rcx
  shr    $0x2,%edx
  shl    $0x4,%rdx
  add    %r13,%rdx
  nopl   (%rax)
L156:
  movdqu (%rax),%xmm5
  movups %xmm5,(%rcx,%rax,1)
  add    $0x10,%rax
  cmp    %rax,%rdx
  jne    L156
  mov    0x2c(%rsp),%esi
  mov    %esi,%eax
  and    $0xfffffffc,%eax
  and    $0x3,%esi
  je     L257
  movslq %eax,%rcx
  mov    0x20(%rsp),%rbx
  mov    0x28(%rsp),%edi
  mov    0x0(%r13,%rcx,4),%esi
  lea    0x0(,%rcx,4),%rdx
  mov    %esi,(%rbx,%rcx,4)
  lea    0x1(%rax),%ecx
  cmp    %ecx,%edi
  jl     L257
  mov    0x4(%r13,%rdx,1),%ecx
  add    $0x2,%eax
  mov    %ecx,0x4(%rbx,%rdx,1)
  cmp    %eax,%edi
  jl     L257
  mov    0x8(%r13,%rdx,1),%eax
  mov    %eax,0x8(%rbx,%rdx,1)
L257:
  add    $0x38,%rsp
  mov    %r13,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <free@plt>
L424:
  pxor   %xmm7,%xmm7
  comisd %xmm0,%xmm7
  ja     L98
L274:
  lea    -0x1(%rbx),%edi
  xor    %r12d,%r12d
  cmp    $0x1,%edi
  jle    L50
L177:
  lea    -0x3(%rbx),%edx
  mov    $0x1,%eax
  add    $0x2,%rdx
  jmp    L340
  nopl   0x0(%rax)
L117:
  comisd 0x8(%rbp,%rax,8),%xmm0
  jbe    L370
  pxor   %xmm6,%xmm6
  comisd %xmm6,%xmm0
  jbe    L370
L263:
  movslq %r12d,%rsi
  add    $0x1,%r12d
  mov    %ecx,0x0(%r13,%rsi,4)
L264:
  add    $0x1,%rax
  cmp    %rax,%rdx
  je     L50
L340:
  movsd  0x0(%rbp,%rax,8),%xmm0
  movsd  -0x8(%rbp,%rax,8),%xmm1
  mov    %eax,%ecx
  comisd %xmm1,%xmm0
  jae    L117
L370:
  comisd %xmm0,%xmm1
  jb     L264
  movsd  0x8(%rbp,%rax,8),%xmm1
  comisd %xmm0,%xmm1
  jbe    L264
  pxor   %xmm7,%xmm7
  comisd %xmm0,%xmm7
  jbe    L264
  jmp    L263
L418:
  pxor   %xmm6,%xmm6
  comisd %xmm0,%xmm6
  jbe    L36
  movsd  -0x8(%rbp,%rdx,1),%xmm1
  comisd %xmm0,%xmm1
  jbe    L36
  movslq %r12d,%rax
  add    $0x1,%r12d
  mov    %edi,0x0(%r13,%rax,4)
  jmp    L36
  nopl   0x0(%rax)
L361:
  xor    %edi,%edi
  jmp    L343
L98:
  movsd  0x8(%rbp),%xmm1
  comisd %xmm0,%xmm1
  jbe    L274
  movl   $0x0,0x0(%r13)
  mov    $0x1,%r12d
  jmp    L200
L119:
  xor    %r15d,%r15d
  jmp    L175
L409:
  movslq 0x28(%rsp),%rax
  mov    0x20(%rsp),%rdx
  lea    0x4(%r13,%rax,4),%rsi
  sub    %r13,%rdx
  mov    %r13,%rax
  xchg   %ax,%ax
L140:
  mov    (%rax),%ecx
  mov    %ecx,(%rdx,%rax,1)
  add    $0x4,%rax
  cmp    %rsi,%rax
  jne    L140
  jmp    L257
```

assistant: ```c
void Search(int r, int Ext[], int gridsize, double E[]) {
  int i, j, k, l, extra;
  int up, alt;
  int *foundExt;
  foundExt = (int *)malloc((2 * r) * sizeof(int));
  k = 0;
  if (((E[0] > 0.0) && (E[0] > E[1])) || ((E[0] < 0.0) && (E[0] < E[1])))
    foundExt[k++] = 0;
  for (i = 1; i < gridsize - 1; i++) {
    if (((E[i] >= E[i - 1]) && (E[i] > E[i + 1]) && (E[i] > 0.0)) || ((E[i] <= E[i - 1]) && (E[i] < E[i + 1]) && (E[i] < 0.0)))
      foundExt[k++] = i;
  }
  j = gridsize - 1;
  if (((E[j] > 0.0) && (E[j] > E[j - 1])) || ((E[j] < 0.0) && (E[j] < E[j - 1])))
    foundExt[k++] = j;
  extra = k - (r + 1);
  while (extra > 0) {
    if (E[foundExt[0]] > 0.0)
      up = 1;
    else
      up = 0;
    l = 0;
    alt = 1;
    for (j = 1; j < k; j++) {
      if (fabs(E[foundExt[j]]) < fabs(E[foundExt[l]]))
        l = j;
      if ((up) && (E[foundExt[j]] < 0.0))
        up = 0;
      else if ((!up) && (E[foundExt[j]] > 0.0))
        up = 1;
      else {
        alt = 0;
        break;
      }
    }
    if ((alt) && (extra == 1)) {
      if (fabs(E[foundExt[k - 1]]) < fabs(E[foundExt[0]]))
        l = foundExt[k - 1];
      else
        l = foundExt[0];
    }
    for (j = l; j < k; j++) {
      foundExt[j] = foundExt[j + 1];
    }
    k--;
    extra--;
  }
  for (i = 0; i <= r; i++) {
    Ext[i] = foundExt[i];
  }
  free(foundExt);
}
```