user: Converte this assembly snippet into its equivalent C code:

```asm
<merge>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %ecx,-0x2c(%rbp)
  mov    %r8d,-0x30(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L100
L55:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  comisd %xmm1,%xmm0
  jbe    L99
  mov    -0xc(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0xc(%rbp)
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x4(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x4(%rbp)
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rcx),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L100
L99:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  comisd %xmm1,%xmm0
  jbe    L93
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x4(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x4(%rbp)
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rcx),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L100
L93:
  addl   $0x1,-0x8(%rbp)
L100:
  mov    -0xc(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jge    L0
  mov    -0x8(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L55
  jmp    L0
L60:
  mov    -0xc(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0xc(%rbp)
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x4(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x4(%rbp)
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rcx),%xmm0
  movsd  %xmm0,(%rax)
L0:
  mov    -0xc(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L60
  jmp    L3
L58:
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x4(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x4(%rbp)
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rcx),%xmm0
  movsd  %xmm0,(%rax)
L3:
  mov    -0x8(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L58
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void merge(const double a[], const double b[], double out[], int size_a, int size_b) {
  int counter_a = 0, counter_b = 0, counter_out = 0;
  while (counter_a < size_a && counter_b < size_b)
    if (a[counter_a] < b[counter_b])
      out[counter_out++] = a[counter_a++];
    else if (a[counter_a] > b[counter_b])
      out[counter_out++] = b[counter_b++];
    else
      counter_b++;
  while (counter_a < size_a)
    out[counter_out++] = a[counter_a++];
  while (counter_b < size_b)
    out[counter_out++] = b[counter_b++];
}
```