user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<parse_browser>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x44(%rbp)
  mov    %rcx,-0x50(%rbp)
  movq   $0x0,-0x28(%rbp)
  movq   $0x0,-0x18(%rbp)
  movq   $0x0,-0x10(%rbp)
  movq   $0x0,-0x8(%rbp)
  movq   $0x0,-0x20(%rbp)
  mov    -0x44(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    (%rax),%rax
  mov    $0x20,%esi
  mov    %rax,%rdi
  call   <count_matches@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L90
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  je     L90
  jmp    L197
L198:
  addq   $0x1,-0x28(%rbp)
L197:
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  cmp    %rax,-0x8(%rbp)
  jbe    L23
  mov    -0x28(%rbp),%rax
  mov    $0x20,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x28(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  jne    L198
  jmp    L23
L90:
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  jmp    L135
L23:
  nop
L135:
  mov    -0x44(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  add    $0x8,%rax
  mov    (%rax),%rcx
  mov    -0x40(%rbp),%rax
  mov    $0xd,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <xstrncpy@plt>
  mov    -0x38(%rbp),%rax
  lea    D4(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L32
  mov    -0x38(%rbp),%rax
  lea    D21(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L32
  lea    D49(%rip),%rax
  mov    %rax,%rdi
  call   <alloc_string@plt>
  jmp    L200
L32:
  mov    -0x38(%rbp),%rax
  lea    D44(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L174
  mov    -0x38(%rbp),%rax
  mov    $0x2f,%esi
  mov    %rax,%rdi
  call   <strrchr@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L174
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <parse_opera@plt>
  jmp    L200
L174:
  mov    -0x38(%rbp),%rax
  lea    D67(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L18
  mov    -0x38(%rbp),%rax
  mov    $0x2f,%esi
  mov    %rax,%rdi
  call   <strrchr@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L18
  mov    -0x38(%rbp),%rax
  cmp    -0x10(%rbp),%rax
  jae    L18
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  lea    0x5(%rax),%rcx
  mov    -0x10(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memmove@plt>
L18:
  mov    -0x38(%rbp),%rax
  lea    D41(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L185
  mov    -0x38(%rbp),%rax
  lea    D66(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strpbrk@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L179
  mov    -0x18(%rbp),%rax
  movb   $0x0,(%rax)
L179:
  mov    -0x38(%rbp),%rax
  mov    $0x2f,%edx
  mov    $0x20,%esi
  mov    %rax,%rdi
  call   <char_replace@plt>
  mov    %rax,-0x38(%rbp)
  jmp    L120
L185:
  cmpq   $0x0,-0x28(%rbp)
  je     L158
  mov    -0x28(%rbp),%rax
  jmp    L46
L158:
  mov    -0x38(%rbp),%rax
L46:
  lea    D54(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strpbrk@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L120
  mov    -0x18(%rbp),%rax
  movb   $0x0,(%rax)
L120:
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <alloc_string@plt>
L200:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D4
type: string
name: retrieve_data
arguments: data_label: D21
type: string
name: retrieve_data
arguments: data_label: D49
type: string
name: retrieve_data
arguments: data_label: D44
type: string
name: retrieve_data
arguments: data_label: D67
type: string
name: retrieve_data
arguments: data_label: D41
type: string
name: retrieve_data
arguments: data_label: D66
type: string
name: retrieve_data
arguments: data_label: D54
type: string

tool: D4: rv:11

tool: D21: Trident/7.0

tool: D49: MSIE/11.0

tool: D44: OPR

tool: D67: Opera

tool: D41: MSIE

tool: D66: ;)-

tool: D54: ;) 

assistant: ```c
char *parse_browser(char *match, char *type, int i, char ***hash) {
  char *b = NULL, *ptr = NULL, *slh = NULL;
  size_t cnt = 0, space = 0;
  if ((cnt = count_matches(hash[i][0], ' ')) && (b = match)) {
    while (space++ < cnt && (b = strchr(b, ' ')))
      b++;
  } else
    b = match;
  xstrncpy(type, hash[i][1], 13);
  if (strstr(match, "rv:11") && strstr(match, "Trident/7.0")) {
    return alloc_string("MSIE/11.0");
  }
  if (strstr(match, "OPR") != NULL && (slh = strrchr(match, '/'))) {
    return parse_opera(slh);
  }
  if (strstr(match, "Opera") && (slh = strrchr(match, '/')) && match < slh) {
    memmove(match + 5, slh, strlen(slh) + 1);
  }
  if (strstr(match, "MSIE") != NULL) {
    if ((ptr = strpbrk(match, ";)-")) != NULL)
      *ptr = '\0';
    match = char_replace(match, ' ', '/');
  } else if ((ptr = strpbrk(b ? b : match, ";) ")) != NULL) {
    *ptr = '\0';
  }
  return alloc_string(match);
}
```