user: 请从给定的汇编指令推导出C源代码:

```asm
<searchttl>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  call   <strlen@plt>
  add    $0x1,%eax
  cltq
  add    $0xf,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L49:
  cmp    %rdx,%rsp
  je     L150
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L49
L150:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L40
  orq    $0x0,-0x8(%rsp,%rax,1)
L40:
  mov    %rsp,%r12
  lea    D1(%rip),%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L22
  lea    0x4(%rax),%rsi
  movzbl 0x4(%rax),%edx
  test   %dl,%dl
  je     L93
  cmp    $0x3a,%dl
  je     L93
  mov    $0x1,%edx
L57:
  mov    %edx,%ebx
  movzbl 0x4(%rax,%rdx,1),%ecx
  add    $0x1,%rdx
  test   %cl,%cl
  je     L72
  cmp    $0x3a,%cl
  jne    L57
L72:
  mov    $0xa8c0,%eax
  test   %ebx,%ebx
  je     L55
  mov    %ebx,%edx
  mov    %r12,%rdi
  call   <strncpy@plt>
  movslq %ebx,%rbx
  movb   $0x0,(%r12,%rbx,1)
  mov    $0x64,%esi
  mov    %r12,%rdi
  call   <strchr@plt>
  mov    $0x0,%ebx
  test   %rax,%rax
  je     L137
  movb   $0x0,(%rax)
  lea    0x1(%rax),%r13
  mov    %r12,%rdi
  call   <atoi@plt>
  imul   $0x15180,%eax,%ebx
  mov    %r13,%r12
L137:
  mov    $0x68,%esi
  mov    %r12,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L114
  movb   $0x0,(%rax)
  lea    0x1(%rax),%r13
  mov    %r12,%rdi
  call   <atoi@plt>
  imul   $0xe10,%eax,%eax
  add    %eax,%ebx
  mov    %r13,%r12
L114:
  mov    $0x6d,%esi
  mov    %r12,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L26
  movb   $0x0,(%rax)
  lea    0x1(%rax),%r13
  mov    %r12,%rdi
  call   <atoi@plt>
  imul   $0x3c,%eax,%eax
  add    %eax,%ebx
  mov    %r13,%r12
L26:
  mov    $0x73,%esi
  mov    %r12,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L25
  movb   $0x0,(%rax)
L25:
  mov    %r12,%rdi
  call   <atoi@plt>
  add    %ebx,%eax
L55:
  mov    -0x28(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L1
  lea    -0x18(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
L22:
  mov    $0xa8c0,%eax
  jmp    L55
L93:
  mov    $0xa8c0,%eax
  jmp    L55
L1:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D1
type_infered: string

tool: D1: ttl=

assistant: ```c
uint32_t searchttl(char *str) {
  char buf[strlen(str) + 1];
  char *cptr, *dptr;
  uint32_t time;
  int i;
  dptr = strstr(str, "ttl=");
  if (dptr == NULL)
    return 43200;
  ;
  dptr += 4;
  i = 0;
  while (dptr[i] != '\0' && dptr[i] != ':')
    i++;
  if (i == 0)
    return 43200;
  strncpy(buf, dptr, i);
  buf[i] = '\0';
  time = 0;
  dptr = buf;
  cptr = strchr(dptr, 'd');
  if (cptr != NULL) {
    *cptr = '\0';
    cptr++;
    time += atoi(dptr) * 60 * 60 * 24;
    dptr = cptr;
  }
  cptr = strchr(dptr, 'h');
  if (cptr != NULL) {
    *cptr = '\0';
    cptr++;
    time += atoi(dptr) * 60 * 60;
    dptr = cptr;
  }
  cptr = strchr(dptr, 'm');
  if (cptr != NULL) {
    *cptr = '\0';
    cptr++;
    time += atoi(dptr) * 60;
    dptr = cptr;
  }
  cptr = strchr(dptr, 's');
  if (cptr != NULL)
    *cptr = '\0';
  time += atoi(dptr);
  return time;
}
```