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

```asm
<ChangeToMilisec>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  mov    -0x3c(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L1
L106:
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x68,%al
  setne  %cl
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x6d,%al
  setne  %al
  and    %ecx,%eax
  movzbl %al,%edx
  mov    -0x24(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    $0x73,%al
  setne  %al
  movzbl %al,%eax
  and    %edx,%eax
  test   %eax,%eax
  je     L45
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    -0x20(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x20(%rbp)
  jmp    L93
L45:
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x68,%al
  jne    L115
  mov    -0xc(%rbp),%eax
  imul   $0x36ee80,%eax,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L34
L115:
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x6d,%al
  jne    L78
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x73,%al
  jne    L84
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  jmp    L34
L84:
  mov    -0xc(%rbp),%eax
  imul   $0xea60,%eax,%eax
  mov    %eax,-0x18(%rbp)
  jmp    L34
L78:
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x73,%al
  jne    L34
  mov    -0x24(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x6d,%al
  je     L34
  mov    -0xc(%rbp),%eax
  imul   $0x3e8,%eax,%eax
  mov    %eax,-0x10(%rbp)
L34:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movl   $0x0,-0x20(%rbp)
L93:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0xc(%rbp)
  addl   $0x1,-0x24(%rbp)
L1:
  mov    -0x24(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L106
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  cmpl   $0x0,-0xc(%rbp)
  js     L132
  mov    -0x1c(%rbp),%edx
  mov    -0x18(%rbp),%eax
  add    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  jmp    L44
L132:
  mov    -0xc(%rbp),%eax
L44:
  leave
  ret
```

assistant: ```c
int ChangeToMilisec(char MsgRead[], int StringSize) {
  int i, Idx = 0, HourToMilisec = 0, MinToMilisec = 0, Milisec = 0, SecToMilisec = 0, Time = 0;
  char *Aux = malloc(StringSize * sizeof(char));
  for (i = 0; i < StringSize; i++) {
    if ((MsgRead[i] != 'h') & (MsgRead[i] != 'm') & (MsgRead[i] != 's')) {
      Aux[Idx] = MsgRead[i];
      Idx++;
    } else {
      if (MsgRead[i] == 'h') {
        HourToMilisec = Time * (3600000);
      } else if (MsgRead[i] == 'm') {
        if (MsgRead[i + 1] == 's')
          Milisec = Time;
        else
          MinToMilisec = Time * (60000);
      } else if (MsgRead[i] == 's') {
        if (MsgRead[i - 1] != 'm')
          SecToMilisec = Time * (1000);
      }
      memset(Aux, 0, strlen(Aux));
      Idx = 0;
    }
    Time = atoi(Aux);
  }
  free(Aux);
  if (Time >= 0)
    return (HourToMilisec + MinToMilisec + SecToMilisec + Milisec);
  else
    return Time;
}
```