user: Converte this assembly snippet into its equivalent C code:

```asm
<parse_browser>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%r14
  movslq %edx,%rdx
  lea    (%rcx,%rdx,8),%r15
  mov    (%r15),%rax
  mov    $0x20,%esi
  mov    (%rax),%rdi
  call   <count_matches@plt>
  test   %rbp,%rbp
  je     L85
  mov    %rax,%r13
  test   %rax,%rax
  je     L85
  mov    %rbp,%rbx
  mov    $0x0,%r12d
L117:
  mov    $0x20,%esi
  mov    %rbx,%rdi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L45
  add    $0x1,%rbx
  add    $0x1,%r12
  cmp    %r13,%r12
  jb     L117
  jmp    L45
L85:
  mov    %rbp,%rbx
L45:
  mov    (%r15),%rax
  mov    0x8(%rax),%rsi
  mov    $0xd,%edx
  mov    %r14,%rdi
  call   <xstrncpy@plt>
  lea    D50(%rip),%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L125
  lea    D3(%rip),%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L1
L125:
  lea    D59(%rip),%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L32
  mov    $0x2f,%esi
  mov    %rbp,%rdi
  call   <strrchr@plt>
  test   %rax,%rax
  jne    L108
L32:
  lea    D25(%rip),%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L41
  mov    $0x2f,%esi
  mov    %rbp,%rdi
  call   <strrchr@plt>
  mov    %rax,%r12
  cmp    %rax,%rbp
  jae    L41
  test   %rax,%rax
  jne    L174
L41:
  lea    D74(%rip),%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L48
  lea    D23(%rip),%rsi
  mov    %rbp,%rdi
  call   <strpbrk@plt>
  test   %rax,%rax
  je     L188
  movb   $0x0,(%rax)
L188:
  mov    $0x2f,%edx
  mov    $0x20,%esi
  mov    %rbp,%rdi
  call   <char_replace@plt>
  mov    %rax,%rbp
L22:
  mov    %rbp,%rdi
  call   <alloc_string@plt>
L147:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L1:
  lea    D44(%rip),%rdi
  call   <alloc_string@plt>
  jmp    L147
L108:
  mov    %rax,%rdi
  call   <parse_opera@plt>
  jmp    L147
L174:
  mov    %rax,%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%rdx
  lea    0x5(%rbp),%rdi
  mov    %r12,%rsi
  call   <memmove@plt>
  jmp    L41
L48:
  test   %rbx,%rbx
  cmove  %rbp,%rbx
  lea    D63(%rip),%rsi
  mov    %rbx,%rdi
  call   <strpbrk@plt>
  test   %rax,%rax
  je     L22
  movb   $0x0,(%rax)
  jmp    L22
```

tool_calls: name: read_data
arguments: label: D50
datatype: string
name: read_data
arguments: label: D3
datatype: string
name: read_data
arguments: label: D59
datatype: string
name: read_data
arguments: label: D25
datatype: string
name: read_data
arguments: label: D74
datatype: string
name: read_data
arguments: label: D23
datatype: string
name: read_data
arguments: label: D44
datatype: string
name: read_data
arguments: label: D63
datatype: string

tool: D50: rv:11

tool: D3: Trident/7.0

tool: D59: OPR

tool: D25: Opera

tool: D74: MSIE

tool: D23: ;)-

tool: D44: MSIE/11.0

tool: D63: ;) 

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