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

```asm
<xdl_recmatch>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %r8,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,0x10(%rsp)
  mov    %rsi,0x8(%rsp)
  mov    %rdx,0x18(%rsp)
  mov    %rcx,0x20(%rsp)
  cmp    %rcx,%rsi
  je     L148
L281:
  test   $0x1c,%bpl
  je     L332
  mov    %rbp,%r13
  and    $0x4,%r13d
  jne    L344
  test   $0x8,%bpl
  je     L204
  cmpq   $0x0,0x8(%rsp)
  jle    L182
  cmpq   $0x0,0x20(%rsp)
  jle    L286
  xor    %ebx,%ebx
  xor    %r12d,%r12d
  jmp    L140
  nopw   0x0(%rax,%rax,1)
L301:
  movzbl (%rdx),%eax
  add    $0x1,%r12d
  add    $0x1,%ebx
  cmp    %al,(%r14)
  jne    L332
  movslq %r12d,%rbp
L402:
  movslq %ebx,%r13
L49:
  cmp    %rbp,0x8(%rsp)
  jle    L97
  cmp    %r13,0x20(%rsp)
  jle    L384
L140:
  mov    0x10(%rsp),%rax
  movslq %r12d,%rbp
  movslq %ebx,%r13
  lea    (%rax,%rbp,1),%r14
  movzbl (%r14),%edi
  call   <isspace@plt>
  mov    0x18(%rsp),%rcx
  lea    (%rcx,%r13,1),%rdx
  test   %rax,%rax
  je     L301
  movzbl (%rdx),%edi
  mov    %rdx,0x28(%rsp)
  call   <isspace@plt>
  mov    0x28(%rsp),%rdx
  test   %rax,%rax
  je     L301
  cmp    %rbp,0x8(%rsp)
  jle    L471
  lea    0x1(%r12),%ebp
  movslq %ebp,%rbp
  jmp    L18
  nopl   (%rax)
L79:
  mov    %ebp,%r12d
  lea    0x1(%rbp),%rax
  cmp    %rbp,0x8(%rsp)
  je     L471
  mov    %rax,%rbp
L18:
  mov    0x10(%rsp),%rax
  lea    -0x1(%rbp),%r12d
  movzbl -0x1(%rax,%rbp,1),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L79
  movslq %r12d,%rbp
L471:
  cmp    %r13,0x20(%rsp)
  jle    L364
  lea    0x1(%rbx),%r13d
  movslq %r13d,%r13
  jmp    L75
  nopl   0x0(%rax,%rax,1)
L176:
  mov    %r13d,%ebx
  lea    0x1(%r13),%rax
  cmp    %r13,0x20(%rsp)
  je     L49
  mov    %rax,%r13
L75:
  mov    0x18(%rsp),%rax
  lea    -0x1(%r13),%ebx
  movzbl -0x1(%rax,%r13,1),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L176
  jmp    L402
  nopl   0x0(%rax,%rax,1)
L204:
  and    $0x10,%ebp
  jne    L4
  xor    %ebx,%ebx
  xor    %r12d,%r12d
  cs nopw 0x0(%rax,%rax,1)
L409:
  cmp    %rbp,0x8(%rsp)
  jle    L74
L384:
  movslq %r12d,%r12
  jmp    L91
L76:
  add    $0x1,%r12
  mov    %r12,%rbp
  cmp    %r12,0x8(%rsp)
  jle    L213
L91:
  mov    0x10(%rsp),%rax
  movzbl (%rax,%r12,1),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L76
L213:
  cmp    %rbp,0x8(%rsp)
  je     L74
L332:
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L344:
  xor    %r14d,%r14d
  mov    0x18(%rsp),%r13
  xor    %ebx,%ebx
  add    0x20(%rsp),%r13
  mov    %r14d,%r12d
  mov    %r14,%rbp
  cmp    0x8(%rsp),%r14
  jl     L443
  nopl   0x0(%rax)
L362:
  movslq %ebx,%rdx
  cmp    0x20(%rsp),%rdx
  jge    L409
  mov    0x18(%rsp),%rax
  lea    (%rax,%rdx,1),%r15
  jmp    L408
  nopl   (%rax)
L506:
  add    $0x1,%r15
  add    $0x1,%ebx
  cmp    %r15,%r13
  je     L409
L408:
  movzbl (%r15),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L506
  cmp    0x8(%rsp),%r14
  jge    L74
  mov    0x10(%rsp),%rax
  movzbl (%r15),%esi
  add    $0x1,%ebx
  cmp    %sil,(%rax,%r14,1)
  jne    L332
L22:
  add    $0x1,%r14
  mov    %r14d,%r12d
  mov    %r14,%rbp
  cmp    0x8(%rsp),%r14
  jge    L362
L443:
  mov    0x10(%rsp),%rax
  movzbl (%rax,%r14,1),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L22
  jmp    L362
  nopw   0x0(%rax,%rax,1)
L74:
  movslq %ebx,%r13
L97:
  movslq %ebx,%rbx
  cmp    %r13,0x20(%rsp)
  jg     L453
L101:
  add    $0x38,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L238:
  add    $0x1,%rbx
  mov    %rbx,%r13
  cmp    %rbx,0x20(%rsp)
  jle    L15
L453:
  mov    0x18(%rsp),%rax
  movzbl (%rax,%rbx,1),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L238
L15:
  xor    %eax,%eax
  cmp    %r13,0x20(%rsp)
  sete   %al
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L148:
  mov    %rsi,%rdx
  mov    0x18(%rsp),%rsi
  call   <memcmp@plt>
  test   %eax,%eax
  jne    L281
  jmp    L101
L4:
  mov    0x8(%rsp),%rax
  mov    0x20(%rsp),%rcx
  cmp    %rcx,%rax
  cmovle %rax,%rcx
  xor    %eax,%eax
  jmp    L481
  nopl   0x0(%rax)
L45:
  mov    0x10(%rsp),%rsi
  lea    0x1(%rax),%r12d
  movzbl (%rsi,%rax,1),%edx
  mov    0x18(%rsp),%rsi
  lea    0x1(%rbp),%rax
  cmp    (%rsi,%rbp,1),%dl
  jne    L178
L481:
  mov    %rax,%rbp
  mov    %eax,%r12d
  cmp    %rcx,%rbp
  jl     L45
  mov    %eax,%ebx
  jmp    L409
L182:
  xor    %ebx,%ebx
  jmp    L97
L178:
  movslq %r12d,%rbp
  mov    %r12d,%ebx
  jmp    L409
L286:
  xor    %ebp,%ebp
  xor    %ebx,%ebx
  xor    %r12d,%r12d
  jmp    L384
L364:
  cmp    %rbp,0x8(%rsp)
  jg     L384
  jmp    L97
```

assistant: ```c
int xdl_recmatch(const char *l1, long s1, const char *l2, long s2, long flags) {
  int i1, i2;
  if (s1 == s2 && !memcmp(l1, l2, s1))
    return 1;
  if (!(flags & ((1 << 2) | (1 << 3) | (1 << 4))))
    return 0;
  i1 = 0;
  i2 = 0;
  if (flags & (1 << 2)) {
    goto skip_ws;
    while (i1 < s1 && i2 < s2) {
      if (l1[i1++] != l2[i2++])
        return 0;
    skip_ws:
      while (i1 < s1 && (isspace((unsigned char)(l1[i1]))))
        i1++;
      while (i2 < s2 && (isspace((unsigned char)(l2[i2]))))
        i2++;
    }
  } else if (flags & (1 << 3)) {
    while (i1 < s1 && i2 < s2) {
      if ((isspace((unsigned char)(l1[i1]))) && (isspace((unsigned char)(l2[i2])))) {
        while (i1 < s1 && (isspace((unsigned char)(l1[i1]))))
          i1++;
        while (i2 < s2 && (isspace((unsigned char)(l2[i2]))))
          i2++;
        continue;
      }
      if (l1[i1++] != l2[i2++])
        return 0;
    }
  } else if (flags & (1 << 4)) {
    while (i1 < s1 && i2 < s2 && l1[i1++] == l2[i2++])
      ;
  }
  if (i1 < s1) {
    while (i1 < s1 && (isspace((unsigned char)(l1[i1]))))
      i1++;
    if (s1 != i1)
      return 0;
  }
  if (i2 < s2) {
    while (i2 < s2 && (isspace((unsigned char)(l2[i2]))))
      i2++;
    return (s2 == i2);
  }
  return 1;
}
```