user: Please show me the C implementation that matches the assembly code listed below:

```asm
<convert_time_to_standard>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x458,%rsp
  mov    %rdi,-0x448(%rbp)
  mov    %rsi,-0x450(%rbp)
  mov    %rdx,-0x458(%rbp)
  mov    %rcx,-0x460(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x434(%rbp)
  movl   $0x0,-0x430(%rbp)
  movl   $0x0,-0x42c(%rbp)
  movl   $0x0,-0x428(%rbp)
  movl   $0x0,-0x424(%rbp)
  mov    -0x448(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L138
  mov    -0x450(%rbp),%rax
  movb   $0x0,(%rax)
  jmp    L50
L138:
  movl   $0x0,-0x438(%rbp)
  jmp    L313
L101:
  mov    -0x438(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x448(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    -0x438(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x448(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %al,(%rbx)
  addl   $0x1,-0x438(%rbp)
L313:
  mov    -0x448(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,-0x438(%rbp)
  jl     L101
  movl   $0x0,-0x438(%rbp)
  jmp    L125
L122:
  mov    -0x438(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x448(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x458(%rbp),%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  je     L20
  mov    -0x438(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x448(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x460(%rbp),%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L83
L20:
  mov    -0x434(%rbp),%eax
  cltq
  movb   $0x0,-0x420(%rbp,%rax,1)
  cmpl   $0x2,-0x430(%rbp)
  je     L17
  cmpl   $0x2,-0x430(%rbp)
  jg     L16
  cmpl   $0x0,-0x430(%rbp)
  je     L321
  cmpl   $0x1,-0x430(%rbp)
  je     L326
  jmp    L16
L321:
  lea    -0x420(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x42c(%rbp)
  mov    -0x438(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x448(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x460(%rbp),%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L111
  cmpl   $0xb,-0x42c(%rbp)
  jg     L111
  addl   $0xc,-0x42c(%rbp)
  jmp    L111
L326:
  lea    -0x420(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x428(%rbp)
  jmp    L160
L17:
  lea    -0x420(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x424(%rbp)
  jmp    L160
L111:
  nop
L160:
  jmp    L16
L83:
  mov    -0x438(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x448(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3a,%al
  je     L42
  mov    -0x438(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x448(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L42
  mov    -0x448(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  cmp    %eax,-0x438(%rbp)
  jne    L213
L42:
  mov    -0x448(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  cmp    %eax,-0x438(%rbp)
  jne    L69
  mov    -0x438(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x448(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x434(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x434(%rbp)
  movzbl (%rcx),%edx
  cltq
  mov    %dl,-0x420(%rbp,%rax,1)
L69:
  mov    -0x434(%rbp),%eax
  cltq
  movb   $0x0,-0x420(%rbp,%rax,1)
  cmpl   $0x2,-0x430(%rbp)
  je     L148
  cmpl   $0x2,-0x430(%rbp)
  jg     L291
  cmpl   $0x0,-0x430(%rbp)
  je     L153
  cmpl   $0x1,-0x430(%rbp)
  je     L254
  jmp    L291
L153:
  lea    -0x420(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x42c(%rbp)
  jmp    L291
L254:
  lea    -0x420(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x428(%rbp)
  jmp    L291
L148:
  lea    -0x420(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x424(%rbp)
  nop
L291:
  movl   $0x0,-0x434(%rbp)
  addl   $0x1,-0x430(%rbp)
  jmp    L64
L213:
  mov    -0x438(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x448(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x434(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x434(%rbp)
  movzbl (%rcx),%edx
  cltq
  mov    %dl,-0x420(%rbp,%rax,1)
L64:
  addl   $0x1,-0x438(%rbp)
L125:
  mov    -0x448(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,-0x438(%rbp)
  jl     L122
  jmp    L308
L16:
  nop
L308:
  mov    -0x424(%rbp),%esi
  mov    -0x428(%rbp),%ecx
  mov    -0x42c(%rbp),%edx
  mov    -0x450(%rbp),%rax
  mov    %esi,%r8d
  lea    D9(%rip),%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
L50:
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L246
  call   <__stack_chk_fail@plt>
L246:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D9
type_infered: string

tool: D9: %02d:%02d:%02d

assistant: ```c
void convert_time_to_standard(char timestr[], char converted[], char am[], char pm[]) {
  int i, ctr = 0, state = 0;
  int hr = 0, min = 0, sec = 0;
  char str[1024];
  if (timestr[0] == 0) {
    converted[0] = 0;
    return;
  }
  for (i = 0; i < strlen(timestr); i++)
    timestr[i] = tolower(timestr[i]);
  for (i = 0; i < strlen(timestr); i++) {
    if ((timestr[i] == am[0]) || (timestr[i] == pm[0])) {
      str[ctr] = 0;
      switch (state) {
      case 0: {
        hr = atoi(str);
        if (timestr[i] == pm[0])
          if (hr < 12)
            hr += 12;
        break;
      }
      case 1: {
        min = atoi(str);
        break;
      }
      case 2: {
        sec = atoi(str);
        break;
      }
      }
      break;
    }
    if ((timestr[i] == ':') || (timestr[i] == '.') || (i == strlen(timestr) - 1)) {
      if (i == strlen(timestr) - 1)
        str[ctr++] = timestr[i];
      str[ctr] = 0;
      switch (state) {
      case 0: {
        hr = atoi(str);
        break;
      }
      case 1: {
        min = atoi(str);
        break;
      }
      case 2: {
        sec = atoi(str);
        break;
      }
      }
      ctr = 0;
      state++;
    } else
      str[ctr++] = timestr[i];
  }
  sprintf(converted, "%02d:%02d:%02d", hr, min, sec);
}
```