user: 请将以下的汇编代码转换成C语言代码:

```asm
<header_name_match>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x44(%rbp)
  movl   $0xffffffff,-0x2c(%rbp)
  mov    -0x38(%rbp),%rax
  mov    $0x3a,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L20
  mov    -0x2c(%rbp),%eax
  jmp    L31
L20:
  mov    -0x18(%rbp),%rax
  sub    -0x38(%rbp),%rax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L38
  mov    $0xffffff9c,%eax
  jmp    L31
L38:
  mov    -0x18(%rbp),%rax
  sub    -0x38(%rbp),%rax
  add    $0x1,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x18(%rbp),%rax
  sub    -0x38(%rbp),%rax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rcx
  mov    -0x10(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L88
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0xffffff9c,%eax
  jmp    L31
L88:
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  mov    $0x3a,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x20(%rbp)
  jmp    L57
L106:
  mov    -0x20(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x10(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L50
  movl   $0x0,-0x2c(%rbp)
  cmpl   $0x0,-0x44(%rbp)
  je     L48
  mov    -0x28(%rbp),%rax
  sub    -0x8(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movb   $0x5f,(%rax)
  jmp    L48
L50:
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  mov    $0x3a,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x20(%rbp)
L57:
  cmpq   $0x0,-0x20(%rbp)
  jne    L106
  mov    -0x10(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L108
  movl   $0x0,-0x2c(%rbp)
  cmpl   $0x0,-0x44(%rbp)
  je     L108
  mov    -0x28(%rbp),%rax
  sub    -0x8(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movb   $0x5f,(%rax)
  jmp    L11
L48:
  nop
  jmp    L11
L108:
  nop
L11:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x2c(%rbp),%eax
L31:
  leave
  ret
```

assistant: ```c
int header_name_match(char *header, char *tick, int do_tick) {
  char *hname;
  char *lcopy;
  char *p;
  char *q;
  int rc = -1;
  char *hcolon = strchr(header, ':');
  if (hcolon == NULL)
    return rc;
  hname = malloc((hcolon - header) + 1);
  if (hname == NULL)
    return -100;
  memset(hname, 0, (hcolon - header) + 1);
  strncpy(hname, header, (hcolon - header));
  lcopy = strdup(tick);
  if (lcopy == NULL) {
    free(hname);
    return -100;
  }
  p = lcopy;
  q = strchr(p, ':');
  while (q != NULL) {
    *q = '\0';
    if (strcasecmp(p, hname) == 0) {
      rc = 0;
      if (do_tick)
        tick[p - lcopy] = '_';
      goto BAIL;
    }
    p = q + 1;
    q = strchr(p, ':');
  }
  if (strcasecmp(p, hname) == 0) {
    rc = 0;
    if (do_tick)
      tick[p - lcopy] = '_';
  }
BAIL:
  free(hname);
  free(lcopy);
  return rc;
}
```