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

```asm
<crank>:
  endbr64
  mov    %rsi,%rcx
  mov    $0x1,%edx
  cmp    $0x1,%rdi
  jbe    L209
  movsd  D6(%rip),%xmm2
  jmp    L116
L130:
  pxor   %xmm0,%xmm0
  cvtsi2ss %rdx,%xmm0
L242:
  movss  %xmm0,(%rsi)
  mov    %rax,%rdx
L44:
  cmp    %rdi,%rdx
  jae    L209
L116:
  lea    (%rcx,%rdx,4),%rsi
  lea    0x1(%rdx),%rax
  movss  (%rsi),%xmm0
  ucomiss 0x4(%rcx,%rdx,4),%xmm0
  jp     L5
  je     L18
L5:
  test   %rdx,%rdx
  jns    L130
  mov    %rdx,%r8
  and    $0x1,%edx
  pxor   %xmm0,%xmm0
  shr    %r8
  or     %rdx,%r8
  cvtsi2ss %r8,%xmm0
  addss  %xmm0,%xmm0
  jmp    L242
  xchg   %ax,%ax
L18:
  cmp    %rdi,%rax
  ja     L197
  nopl   0x0(%rax)
L235:
  mov    %rax,%r8
  add    $0x1,%rax
  cmp    %rax,%rdi
  jb     L83
  ucomiss (%rcx,%rax,4),%xmm0
  jp     L83
  je     L235
L83:
  lea    -0x1(%rdx,%rax,1),%rax
  test   %rax,%rax
  js     L96
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
L139:
  mulsd  %xmm2,%xmm0
  cvtsd2ss %xmm0,%xmm0
  cmp    %r8,%rdx
  ja     L44
L110:
  mov    %r8,%r10
  sub    %rdx,%r10
  cmp    $0xffffffffffffffff,%r8
  je     L6
  cmp    $0x4,%r10
  jbe    L6
  add    $0x1,%r10
  movaps %xmm0,%xmm1
  xor    %eax,%eax
  mov    %r10,%r11
  shufps $0x0,%xmm1,%xmm1
  shr    $0x2,%r11
  nopw   0x0(%rax,%rax,1)
L69:
  mov    %rax,%r9
  add    $0x1,%rax
  shl    $0x4,%r9
  movups %xmm1,(%rsi,%r9,1)
  cmp    %rax,%r11
  ja     L69
  mov    %r10,%rsi
  and    $0xfffffffffffffffc,%rsi
  lea    (%rsi,%rdx,1),%rax
  cmp    %r10,%rsi
  je     L44
  lea    0x1(%rax),%r9
  lea    0x0(,%rax,4),%rsi
  movss  %xmm0,(%rcx,%rax,4)
  cmp    %r9,%r8
  jb     L44
  add    $0x2,%rax
  movss  %xmm0,0x4(%rcx,%rsi,1)
  cmp    %rax,%r8
  jb     L44
  movss  %xmm0,0x8(%rcx,%rsi,1)
  cmp    %rdi,%rdx
  jb     L116
  nopl   (%rax)
L209:
  cmp    %rdx,%rdi
  je     L37
  ret
  xchg   %ax,%ax
L96:
  mov    %rax,%r9
  and    $0x1,%eax
  pxor   %xmm0,%xmm0
  shr    %r9
  or     %rax,%r9
  cvtsi2sd %r9,%xmm0
  addsd  %xmm0,%xmm0
  jmp    L139
  xchg   %ax,%ax
L6:
  mov    %rdx,%rax
  nopl   0x0(%rax,%rax,1)
L274:
  movss  %xmm0,(%rcx,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%r8
  jae    L274
  jmp    L44
  nopl   0x0(%rax,%rax,1)
L37:
  test   %rdi,%rdi
  js     L220
  pxor   %xmm0,%xmm0
  cvtsi2ss %rdi,%xmm0
  movss  %xmm0,(%rcx,%rdi,4)
  ret
L220:
  mov    %rdi,%rax
  mov    %rdi,%rdx
  pxor   %xmm0,%xmm0
  shr    %rax
  and    $0x1,%edx
  or     %rdx,%rax
  cvtsi2ss %rax,%xmm0
  addss  %xmm0,%xmm0
  movss  %xmm0,(%rcx,%rdi,4)
  ret
L197:
  lea    -0x1(%rdx,%rax,1),%rax
  test   %rax,%rax
  js     L137
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
L80:
  mulsd  %xmm2,%xmm0
  mov    %rdx,%r8
  cvtsd2ss %xmm0,%xmm0
  jmp    L110
L137:
  mov    %rax,%r8
  and    $0x1,%eax
  pxor   %xmm0,%xmm0
  shr    %r8
  or     %rax,%r8
  cvtsi2sd %r8,%xmm0
  addsd  %xmm0,%xmm0
  jmp    L80
```

tool_calls: name: parse_data
arguments: data_tag: D6
datatype: f64

tool: D6: 0.5

assistant: ```c
void crank(unsigned long n, float w[]) {
  unsigned long j = 1, ji, jt;
  float rank;
  while (j < n) {
    if (w[j + 1] != w[j]) {
      w[j] = j;
      ++j;
    } else {
      for (jt = j + 1; jt <= n && w[jt] == w[j]; jt++)
        ;
      rank = 0.5 * (j + jt - 1);
      for (ji = j; ji <= (jt - 1); ji++)
        w[ji] = rank;
    }
  }
  if (j == n)
    w[n] = n;
}
```