user: Translate the below assembly code into C programming language:

```asm
<stripped_core>:
  endbr64
  push   %r15
  mov    %r8d,%r9d
  mov    %rdx,%r15
  push   %r14
  and    $0x4,%r9d
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  cmp    %rsi,%rdi
  jae    L311
  mov    %r8d,%ebx
  mov    %rdi,%rax
  mov    %rsi,%r12
  mov    %r8d,%edi
  shr    $0x5,%ebx
  mov    %r8d,%esi
  and    $0x10,%edi
  mov    %r8d,%r11d
  xor    $0x1,%ebx
  and    $0x2,%esi
  mov    %r8d,%r10d
  mov    %edi,0x4(%rsp)
  mov    %ebx,%ebp
  mov    %esi,(%rsp)
  and    $0x8,%r11d
  and    $0x1,%r10d
  and    $0x1,%ebp
  xor    %edx,%edx
  xor    %esi,%esi
  xor    %edi,%edi
  mov    %bpl,0x1b(%rsp)
  mov    %ebx,%ebp
  xor    %r13d,%r13d
  xor    %r14d,%r14d
  and    $0x1,%ebp
  mov    $0x1,%r8d
  mov    %rbp,0x8(%rsp)
  jmp    L3
  nopl   (%rax)
L172:
  cmp    $0x27,%bl
  je     L183
  cmp    $0x3e,%bl
  je     L213
L452:
  cmp    $0x22,%bl
  je     L183
L292:
  cmp    %rbp,%r12
  jbe    L405
L254:
  mov    %rbp,%rax
L3:
  movzbl (%rax),%ebx
  lea    0x1(%rax),%rbp
  test   %edx,%edx
  jne    L172
  test   %r14d,%r14d
  je     L462
  cmp    $0x27,%bl
  je     L183
  cmp    $0x7d,%bl
  jne    L452
  test   %r13b,%r13b
  jne    L292
  cmp    %rbp,%r12
  jbe    L405
  xor    %r14d,%r14d
  cmpb   $0x3b,0x1(%rax)
  jne    L254
  lea    0x2(%rax),%rbp
  jmp    L292
  xchg   %ax,%ax
L183:
  test   %r13b,%r13b
  je     L92
  movsbl %r13b,%eax
  cmp    %eax,%ebx
  mov    $0x0,%eax
  cmove  %eax,%r13d
  cmp    %rbp,%r12
  ja     L254
  nopl   (%rax)
L405:
  test   %r9d,%r9d
  je     L30
  mov    (%r15),%r8
  movslq %edi,%rbx
  lea    (%r8,%rbx,1),%rax
  cmp    %rax,%rcx
  jns    L325
L346:
  mov    %rax,(%r15)
L30:
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L462:
  cmp    $0x3c,%bl
  je     L431
  cmp    $0x26,%bl
  je     L180
  cmp    $0x6,%bl
  ja     L268
  test   %r10d,%r10d
  je     L500
L332:
  mov    $0x1,%esi
  jmp    L292
  nopw   0x0(%rax,%rax,1)
L213:
  xor    %edx,%edx
  test   %r13b,%r13b
  setne  %dl
  jmp    L292
  nopl   (%rax)
L92:
  mov    %ebx,%r13d
  jmp    L292
L431:
  mov    $0x1,%edx
  mov    $0x1,%esi
  jmp    L292
  nop
L268:
  test   %bl,%bl
  jns    L347
  mov    (%rsp),%eax
  test   %eax,%eax
  jne    L332
L347:
  cmp    $0x22,%bl
  je     L20
  cmp    $0x27,%bl
  je     L20
  cmp    $0x5c,%bl
  je     L156
  cmp    $0x3e,%bl
  jne    L115
L318:
  xor    %edx,%edx
L307:
  mov    $0x1,%esi
  jmp    L292
  nopl   0x0(%rax,%rax,1)
L20:
  test   %r11d,%r11d
  je     L318
L500:
  test   %r8d,%r8d
  jne    L380
  test   %edi,%edi
  jne    L128
  test   %esi,%esi
  je     L128
  movzbl 0x1b(%rsp),%edi
  mov    0x8(%rsp),%r8
L14:
  mov    (%r15),%rax
  mov    %r8,0x10(%rsp)
  lea    (%rax,%r8,1),%rdx
  cmp    %rdx,%rcx
  js     L99
  mov    %edi,%edx
  mov    $0x20,%esi
  mov    %rax,%rdi
  mov    %rcx,0x28(%rsp)
  mov    %r9d,0x24(%rsp)
  mov    %r11d,0x20(%rsp)
  mov    %r10d,0x1c(%rsp)
  call   <memset@plt>
  mov    0x28(%rsp),%rcx
  mov    0x24(%rsp),%r9d
  mov    0x20(%rsp),%r11d
  mov    0x1c(%rsp),%r10d
  mov    0x10(%rsp),%rdx
  add    (%r15),%rdx
L99:
  lea    0x1(%rdx),%rax
  mov    %rdx,(%r15)
  cmp    %rax,%rcx
  js     L366
  mov    %bl,(%rdx)
  mov    (%r15),%rax
  add    $0x1,%rax
L366:
  mov    %rax,(%r15)
  xor    %edx,%edx
  xor    %esi,%esi
  xor    %edi,%edi
  xor    %r8d,%r8d
  jmp    L292
  cs nopw 0x0(%rax,%rax,1)
L325:
  mov    %edi,%edx
  mov    $0x20,%esi
  mov    %r8,%rdi
  call   <memset@plt>
  mov    (%r15),%rax
  add    %rbx,%rax
  jmp    L346
  nopw   0x0(%rax,%rax,1)
L180:
  cmp    %rbp,%r12
  jbe    L500
  cmpb   $0x7b,0x1(%rax)
  jne    L500
  lea    0x2(%rax),%rbp
  mov    $0x1,%esi
  mov    $0x1,%r14d
  jmp    L292
  nopw   0x0(%rax,%rax,1)
L115:
  cmp    $0x20,%bl
  jne    L500
  add    $0x1,%edi
  xor    %edx,%edx
  jmp    L292
  nopl   0x0(%rax,%rax,1)
L380:
  test   %r9d,%r9d
  jne    L128
  xor    %edi,%edi
  xor    %r8d,%r8d
  jmp    L14
  nopw   0x0(%rax,%rax,1)
L156:
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  jne    L500
  xor    %edx,%edx
  jmp    L307
  nopl   0x0(%rax,%rax,1)
L311:
  xor    %edi,%edi
  jmp    L405
L128:
  movslq %edi,%r8
  jmp    L14
```

assistant: ```c
int stripped_core(const char *r, const char *in_end, char **w, const char *out_end, unsigned int flags) {
  int leading = 1;
  int in_js_entity = 0;
  char in_quote_char = '\0';
  int space = 0;
  int stripped = 0;
  int in_tag = 0;
  for (; r < in_end; r++) {
    unsigned char c = *r;
    if (in_tag) {
      switch (c) {
      case '>':
        if (!in_quote_char) {
          in_tag = 0;
        }
        break;
      case '"':
      case '\'':
        if (!in_quote_char) {
          in_quote_char = c;
        } else if (in_quote_char == c) {
          in_quote_char = '\0';
        }
        break;
      default:
        break;
      }
    } else if (in_js_entity) {
      switch (c) {
      case '}':
        if (!in_quote_char) {
          in_js_entity = 0;
          if (r + 1 < in_end && *(r + 1) == ';') {
            r++;
          }
        }
        break;
      case '"':
      case '\'':
        if (!in_quote_char) {
          in_quote_char = c;
        } else if (in_quote_char == c) {
          in_quote_char = '\0';
        }
        break;
      default:
        break;
      }
    } else {
      if (c == '<') {
        in_tag = 1;
        stripped = 1;
      } else if (c == '&' && r + 1 < in_end && *(r + 1) == '{') {
        in_js_entity = 1;
        stripped = 1;
        r++;
      } else if ((c < 0x07 && (flags & 0x1)) || (c >= 0x80 && (flags & 0x2)) || (c == '"' && !(flags & 0x8)) || (c == '\'' && !(flags & 0x8)) || (c == '\\' && !(flags & 0x10)) || c == '>') {
        stripped = 1;
      } else if (c == ' ') {
        space++;
      } else {
        if (leading) {
          leading = 0;
          stripped = 0;
          if (!(flags & 0x4)) {
            space = 0;
          }
        }
        if (!space && stripped && !(flags & 0x20)) {
          space = 1;
        }
        stripped = 0;
        do {
          if (((((out_end)) - ((*(w)) + ((space)))) >= 0))
            memset(*(w), ' ', (space));
          *(w) += (space);
          (space) = 0;
        } while (0);
        do {
          if (((((out_end)) - ((*(w)) + (1))) >= 0))
            **(w) = (c);
          (*(w))++;
        } while (0);
      }
    }
  }
  if (flags & 0x4)
    do {
      if (((((out_end)) - ((*(w)) + ((space)))) >= 0))
        memset(*(w), ' ', (space));
      *(w) += (space);
      (space) = 0;
    } while (0);
  return 0;
}
```