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

```asm
<time_string_to_seconds>:
  endbr64
  push   %r14
  mov    %rdx,%r14
  push   %r13
  mov    %rsi,%r13
  lea    D12(%rip),%rsi
  push   %r12
  mov    %rdi,%r12
  mov    %r13,%rdi
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L139
  movsbl (%r12),%edi
  mov    %eax,%ebp
  mov    %r12,%rbx
  test   %dil,%dil
  jne    L236
  jmp    L130
  nopl   0x0(%rax)
L191:
  movsbl 0x1(%rbx),%edi
  add    $0x1,%rbx
  test   %dil,%dil
  je     L130
L236:
  call   <isspace@plt>
  test   %rax,%rax
  je     L191
  jmp    L164
  nopl   0x0(%rax)
L169:
  add    $0x1,%rbx
L164:
  movsbl (%rbx),%edi
  test   %dil,%dil
  je     L130
  call   <isspace@plt>
  test   %rax,%rax
  jne    L169
  movzbl (%rbx),%eax
  test   %al,%al
  je     L130
  cmp    $0x2f,%al
  jne    L91
  jmp    L149
  nopl   0x0(%rax,%rax,1)
L117:
  cmp    $0x2f,%al
  je     L57
L91:
  movzbl 0x1(%rbx),%eax
  add    $0x1,%rbx
  test   %al,%al
  jne    L117
L130:
  lea    D14(%rip),%rax
  mov    %rax,(%r14)
  xor    %eax,%eax
L52:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L109
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   (%rax)
L57:
  test   %al,%al
  je     L130
L149:
  movzbl 0x1(%rbx),%eax
  lea    0x1(%rbx),%rdx
  test   %al,%al
  jne    L251
  jmp    L130
  nopw   0x0(%rax,%rax,1)
L247:
  movzbl 0x1(%rdx),%eax
  add    $0x1,%rdx
  test   %al,%al
  je     L130
L251:
  cmp    $0x2f,%al
  jne    L247
  test   %al,%al
  je     L130
  movsbl 0x1(%rdx),%edi
  lea    0x1(%rdx),%rbx
  test   %dil,%dil
  jne    L250
  jmp    L139
  nopl   0x0(%rax,%rax,1)
L24:
  movsbl 0x1(%rbx),%edi
  add    $0x1,%rbx
  add    $0x1,%ebp
  test   %dil,%dil
  je     L4
L250:
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L24
L4:
  cmp    $0x4,%ebp
  lea    D4(%rip),%rax
  cmove  %rax,%r13
L139:
  lea    0x4(%rsp),%rbp
  mov    %r13,%rsi
  mov    %r12,%rdi
  mov    %rbp,%rdx
  call   <strptime@plt>
  test   %eax,%eax
  je     L130
  mov    %rbp,%rdi
  call   <mktime@plt>
  jmp    L52
L109:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D12
data_type: string
name: retrieve_data
arguments: label: D14
data_type: string
name: retrieve_data
arguments: label: D4
data_type: string

tool: D12: %T%t%D

tool: D14: Time string does not match expected format.

tool: D4: %T%t%m/%d/%Y

assistant: ```c
time_t time_string_to_seconds(char *string, const char *format, const char **error) {
  struct tm otm;
  if (!strcmp(format, "%T%t%D")) {
    char *finder;
    int year_digits = 0;
    for (finder = string; *finder != '\0' && !isspace(*finder); finder++)
      ;
    if (*finder == '\0') {
      goto timeformat_err;
    }
    for (; *finder != '\0' && isspace(*finder); finder++)
      ;
    if (*finder == '\0') {
      goto timeformat_err;
    }
    for (; *finder != '\0' && *finder != '/'; finder++)
      ;
    if (*finder == '\0') {
      goto timeformat_err;
    }
    finder++;
    for (; *finder != '\0' && *finder != '/'; finder++)
      ;
    if (*finder == '\0') {
      goto timeformat_err;
    }
    finder++;
    for (; *finder != '\0' && isdigit(*finder); finder++, year_digits++)
      ;
    if (year_digits == 4) {
      format = "%T%t%m/%d/%Y";
    }
  }
  if (!strptime(string, format, &otm))
    goto timeformat_err;
  return mktime(&otm);
timeformat_err:
  *error = "Time string does not match expected format.";
  return 0;
}
```