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

```asm
<bitset>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x838,%rsp
  mov    (%rsi),%ebx
  mov    %rcx,0x18(%rsp)
  mov    %r8d,0x4(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x828(%rsp)
  xor    %eax,%eax
  cmp    $0x1,%edx
  jle    L129
  lea    -0x2(%r12),%eax
  lea    0x4(%rsi),%rdx
  mov    %ebx,%r10d
  lea    0x8(%rsi,%rax,4),%rcx
  nopw   0x0(%rax,%rax,1)
L55:
  mov    (%rdx),%eax
  cmp    %eax,%ebx
  cmovl  %eax,%ebx
  cmp    %eax,%r10d
  cmovg  %eax,%r10d
  add    $0x4,%rdx
  cmp    %rcx,%rdx
  jne    L55
  cmp    %r10d,%ebx
  jge    L116
  mov    %r10d,%eax
  mov    %ebx,%r10d
  mov    %eax,%ebx
L116:
  xor    %eax,%eax
  test   %r10d,%r10d
  cmovns %r10d,%eax
  cmp    %r9d,%ebx
  mov    %eax,%r15d
  lea    -0x1(%r9),%eax
  cmovge %eax,%ebx
  cmp    %r15d,%ebx
  jl     L146
  mov    0x4(%rsp),%eax
  mov    %ebx,0x14(%rsp)
  mov    %r15d,%r14d
  imul   %r15d,%eax
  mov    %eax,0x10(%rsp)
  lea    0x20(%rsp),%rax
  mov    %rax,0x8(%rsp)
  jmp    L102
  nopw   0x0(%rax,%rax,1)
L136:
  mov    0x4(%rsp),%esi
  add    $0x1,%r14d
  add    %esi,0x10(%rsp)
  cmp    %r14d,0x14(%rsp)
  jl     L146
L102:
  mov    0x8(%rsp),%r8
  xor    %eax,%eax
  mov    %r14d,%ecx
  mov    %r12d,%edx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <xxsect@plt>
  cmp    $0x1,%eax
  jle    L136
  sub    $0x2,%eax
  mov    0x8(%rsp),%r15
  lea    0x24(%rsp,%rax,4),%rbx
  jmp    L113
  nopl   0x0(%rax,%rax,1)
L88:
  add    $0x4,%r15
  cmp    %rbx,%r15
  je     L136
L113:
  mov    0x4(%r15),%eax
  add    (%r15),%eax
  mov    %r14d,%r8d
  mov    %r12d,%edx
  mov    %eax,%ecx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  shr    $0x1f,%ecx
  add    %eax,%ecx
  xor    %eax,%eax
  sar    %ecx
  call   <inside@plt>
  test   %eax,%eax
  je     L88
  mov    (%r15),%ecx
  mov    0x4(%r15),%edx
  xor    %eax,%eax
  mov    0x4(%rsp),%edi
  test   %ecx,%ecx
  cmovs  %eax,%ecx
  lea    -0x1(%rdi),%eax
  cmp    %edi,%edx
  cmovge %eax,%edx
  cmp    %ecx,%edx
  jl     L88
  movslq 0x10(%rsp),%rax
  movslq %ecx,%rsi
  mov    0x18(%rsp),%rdi
  sub    %ecx,%edx
  add    %rax,%rsi
  add    %rsi,%rdx
  lea    (%rdi,%rsi,4),%rax
  lea    0x4(%rdi,%rdx,4),%rdx
  nopl   0x0(%rax)
L7:
  movl   $0x3f800000,(%rax)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L7
  jmp    L88
  nopl   0x0(%rax)
L146:
  mov    0x828(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L92
  add    $0x838,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L129:
  mov    %ebx,%r10d
  jmp    L116
L92:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void bitset(xverts, yverts, nverts, mask, npix, nrast) float mask[];
int xverts[], yverts[], nverts;
int npix, nrast;
{
  int xsects[512];
  int ifrast, ilrast;
  int ifpix, ilpix;
  int nxsect = 0;
  int i, j, k, n, ix, itemp;
  ifrast = ilrast = yverts[0];
  for (i = 1; i < nverts; i++) {
    ilrast = ((yverts[i]) > (ilrast) ? (yverts[i]) : (ilrast));
    ifrast = ((yverts[i]) < (ifrast) ? (yverts[i]) : (ifrast));
  }
  if (ilrast < ifrast)
    (itemp = (ifrast), (ifrast) = (ilrast), (ilrast) = itemp);
  ifrast = ((0) > (ifrast) ? (0) : (ifrast));
  ilrast = (((nrast - 1)) < (ilrast) ? ((nrast - 1)) : (ilrast));
  for (j = ifrast; j <= ilrast; j++)
    if ((nxsect = xxsect(xverts, yverts, nverts, j, xsects)) > 1)
      for (i = 1; i < nxsect; i++) {
        n = (j * npix);
        ix = (xsects[i - 1] + xsects[i]) / 2;
        if (inside(xverts, yverts, nverts, ix, j)) {
          ifpix = ((0) > (xsects[i - 1]) ? (0) : (xsects[i - 1]));
          ilpix = (((npix - 1)) < (xsects[i]) ? ((npix - 1)) : (xsects[i]));
          for (k = ifpix; k <= ilpix; k++)
            mask[n + k] = 1.0;
        }
      }
}
```