user: What is the c source code of the assembly code below?

```asm
<glob_to_regex>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  lea    D26(%rip),%rdi
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <strdup@plt>
  movsbl (%rbx),%esi
  movq   $0x1,0x20(%rsp)
  mov    %rax,0x18(%rsp)
  test   %sil,%sil
  je     L239
  lea    D8(%rip),%r13
  lea    0x20(%rsp),%r12
  lea    0x18(%rsp),%rbp
  lea    D34(%rip),%r14
  lea    D24(%rip),%r15
  jmp    L11
  nopl   0x0(%rax)
L89:
  cmp    $0x5e,%dl
  jne    L213
  mov    0x18(%rsp),%rcx
  mov    0x20(%rsp),%rax
  cmpb   $0x5b,-0x1(%rcx,%rax,1)
  je     L163
L213:
  mov    $0x5c,%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strappendch@plt>
  test   %rax,%rax
  jne    L226
  movsbl (%rbx),%edx
L163:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  add    $0x1,%rbx
  call   <strappendch@plt>
  test   %rax,%rax
  jne    L226
L107:
  movsbl (%rbx),%esi
  test   %sil,%sil
  je     L87
L11:
  mov    %r13,%rdi
  call   <char_is_one_of@plt>
  movsbl (%rbx),%edx
  test   %rax,%rax
  jne    L89
  cmp    $0x21,%dl
  je     L170
  cmp    $0x5c,%dl
  je     L235
  cmp    $0x3f,%dl
  je     L74
  cmp    $0x2a,%dl
  jne    L163
  cmpq   $0x1,0x20(%rsp)
  mov    %r14,%rdx
  je     L131
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strappend@plt>
  test   %rax,%rax
  je     L181
L226:
  cmpb   $0x0,(%rbx)
  jne    L166
L87:
  mov    $0x24,%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strappendch@plt>
  test   %rax,%rax
  jne    L166
  mov    0x18(%rsp),%rax
L160:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L272
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L170:
  mov    0x18(%rsp),%rcx
  mov    0x20(%rsp),%rax
  cmpb   $0x5b,-0x1(%rcx,%rax,1)
  jne    L163
  mov    $0x5e,%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strappendch@plt>
  test   %rax,%rax
  je     L107
  cmpb   $0x0,(%rbx)
  je     L87
  nopl   0x0(%rax,%rax,1)
L166:
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  xor    %eax,%eax
  jmp    L160
  cs nopw 0x0(%rax,%rax,1)
L235:
  lea    0x1(%rbx),%rax
  mov    $0x5c,%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    %rax,0x8(%rsp)
  call   <strappendch@plt>
  test   %rax,%rax
  jne    L273
  movsbl 0x1(%rbx),%edx
  mov    0x8(%rsp),%rbx
  jmp    L163
  nopl   0x0(%rax)
L74:
  mov    $0x2e,%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strappendch@plt>
  test   %rax,%rax
  jne    L226
L181:
  add    $0x1,%rbx
  jmp    L107
  nopw   0x0(%rax,%rax,1)
L131:
  mov    %r15,%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strappend@plt>
  test   %rax,%rax
  jne    L226
  jmp    L181
L273:
  mov    0x8(%rsp),%rbx
  jmp    L226
L239:
  lea    0x20(%rsp),%r12
  lea    0x18(%rsp),%rbp
  jmp    L87
L272:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D26
type_infered: string
name: read_data
arguments: data_tag: D8
type_infered: string
name: read_data
arguments: data_tag: D34
type_infered: string
name: read_data
arguments: data_tag: D24
type_infered: string

tool: D26: ^$

tool: D8: ^.$()|+{

tool: D34: .*

tool: D24: [^.].*

assistant: ```c
char *glob_to_regex(const char glob[]) {
  static const char CHARS_TO_ESCAPE[] = "^.$()|+{";
  char *result = strdup("^$");
  size_t result_len = 1;
  while (*glob != '\0') {
    if (char_is_one_of(CHARS_TO_ESCAPE, *glob)) {
      if (*glob != '^' || result[result_len - 1] != '[') {
        if (strappendch(&result, &result_len, '\\') != 0) {
          break;
        }
      }
    } else if (*glob == '!' && result[result_len - 1] == '[') {
      if (strappendch(&result, &result_len, '^') != 0) {
        break;
      }
      continue;
    } else if (*glob == '\\') {
      if (strappendch(&result, &result_len, *glob++) != 0) {
        break;
      }
    } else if (*glob == '?') {
      if (strappendch(&result, &result_len, '.') != 0) {
        break;
      }
      ++glob;
      continue;
    } else if (*glob == '*') {
      if (result_len == 1) {
        if (strappend(&result, &result_len, "[^.].*") != 0) {
          break;
        }
      } else {
        if (strappend(&result, &result_len, ".*") != 0) {
          break;
        }
      }
      ++glob;
      continue;
    }
    if (strappendch(&result, &result_len, *glob++) != 0) {
      break;
    }
  }
  if (*glob != '\0' || strappendch(&result, &result_len, '$') != 0) {
    free(result);
    return NULL;
  }
  return result;
}
```