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    D14(%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     L45
  lea    D34(%rip),%r13
  lea    0x20(%rsp),%r12
  lea    0x18(%rsp),%rbp
  lea    D8(%rip),%r14
  lea    D28(%rip),%r15
  jmp    L267
  nopl   0x0(%rax)
L167:
  cmp    $0x5e,%dl
  jne    L155
  mov    0x18(%rsp),%rcx
  mov    0x20(%rsp),%rax
  cmpb   $0x5b,-0x1(%rcx,%rax,1)
  je     L241
L155:
  mov    $0x5c,%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strappendch@plt>
  test   %rax,%rax
  jne    L151
  movsbl (%rbx),%edx
L241:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  add    $0x1,%rbx
  call   <strappendch@plt>
  test   %rax,%rax
  jne    L151
L82:
  movsbl (%rbx),%esi
  test   %sil,%sil
  je     L250
L267:
  mov    %r13,%rdi
  call   <char_is_one_of@plt>
  movsbl (%rbx),%edx
  test   %rax,%rax
  jne    L167
  cmp    $0x21,%dl
  je     L0
  cmp    $0x5c,%dl
  je     L289
  cmp    $0x3f,%dl
  je     L181
  cmp    $0x2a,%dl
  jne    L241
  cmpq   $0x1,0x20(%rsp)
  mov    %r14,%rdx
  je     L133
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strappend@plt>
  test   %rax,%rax
  je     L24
L151:
  cmpb   $0x0,(%rbx)
  jne    L161
L250:
  mov    $0x24,%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strappendch@plt>
  test   %rax,%rax
  jne    L161
  mov    0x18(%rsp),%rax
L86:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L105
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L0:
  mov    0x18(%rsp),%rcx
  mov    0x20(%rsp),%rax
  cmpb   $0x5b,-0x1(%rcx,%rax,1)
  jne    L241
  mov    $0x5e,%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strappendch@plt>
  test   %rax,%rax
  je     L82
  cmpb   $0x0,(%rbx)
  je     L250
  nopl   0x0(%rax,%rax,1)
L161:
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  xor    %eax,%eax
  jmp    L86
  cs nopw 0x0(%rax,%rax,1)
L289:
  lea    0x1(%rbx),%rax
  mov    $0x5c,%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    %rax,0x8(%rsp)
  call   <strappendch@plt>
  test   %rax,%rax
  jne    L23
  movsbl 0x1(%rbx),%edx
  mov    0x8(%rsp),%rbx
  jmp    L241
  nopl   0x0(%rax)
L181:
  mov    $0x2e,%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strappendch@plt>
  test   %rax,%rax
  jne    L151
L24:
  add    $0x1,%rbx
  jmp    L82
  nopw   0x0(%rax,%rax,1)
L133:
  mov    %r15,%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strappend@plt>
  test   %rax,%rax
  jne    L151
  jmp    L24
L23:
  mov    0x8(%rsp),%rbx
  jmp    L151
L45:
  lea    0x20(%rsp),%r12
  lea    0x18(%rsp),%rbp
  jmp    L250
L105:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D14
data_type: string
name: extract_symbolic_data
arguments: tag: D34
data_type: string
name: extract_symbolic_data
arguments: tag: D8
data_type: string
name: extract_symbolic_data
arguments: tag: D28
data_type: string

tool: D14: ^$

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

tool: D8: .*

tool: D28: [^.].*

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;
}
```