user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<sec2str>:
  endbr64
  push   %r15
  xor    %esi,%esi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <gettimeofday@plt>
  movslq 0x4(%rbx),%rax
  mov    %rax,%rdx
  imul   $0x431bde83,%rax,%rax
  sar    $0x1f,%edx
  sar    $0x32,%rax
  sub    %edx,%eax
  movslq 0x4(%rsp),%rdx
  add    (%rbx),%eax
  sub    (%rsp),%eax
  mov    %rdx,%rbx
  imul   $0x431bde83,%rdx,%rdx
  sar    $0x1f,%ebx
  sar    $0x32,%rdx
  sub    %edx,%ebx
  add    %eax,%ebx
  movslq %ebx,%rbp
  mov    %ebx,%edx
  imul   $0xffffffff91a2b3c5,%rbp,%rax
  sar    $0x1f,%edx
  imul   $0xffffffffc22e4507,%rbp,%rcx
  shr    $0x20,%rax
  add    %ebx,%eax
  shr    $0x20,%rcx
  sar    $0xb,%eax
  add    %ebx,%ecx
  sub    %edx,%eax
  sar    $0x10,%ecx
  movslq %eax,%r13
  mov    %eax,%esi
  imul   $0x2aaaaaab,%r13,%r13
  sar    $0x1f,%esi
  sar    $0x22,%r13
  sub    %esi,%r13d
  lea    0x0(%r13,%r13,2),%esi
  shl    $0x3,%esi
  sub    %esi,%eax
  mov    %eax,%r13d
  imul   $0xffffffff88888889,%rbp,%rax
  shr    $0x20,%rax
  add    %ebx,%eax
  sar    $0x5,%eax
  sub    %edx,%eax
  movslq %eax,%r12
  mov    %eax,%esi
  imul   $0xffffffff88888889,%r12,%r12
  sar    $0x1f,%esi
  shr    $0x20,%r12
  add    %eax,%r12d
  sar    $0x5,%r12d
  sub    %esi,%r12d
  imul   $0x3c,%r12d,%esi
  sub    %esi,%eax
  mov    %eax,%r12d
  sub    %edx,%ecx
  jne    L70
  mov    $0x100,%esi
  test   %r13d,%r13d
  jne    L114
  lea    D114(%rip),%rdi
  test   %eax,%eax
  jne    L47
L2:
  imul   $0xffffffff88888889,%rbp,%rax
  mov    %ebx,%edx
  mov    %ebx,%ecx
  sar    $0x1f,%edx
  shr    $0x20,%rax
  add    %ebx,%eax
  sar    $0x5,%eax
  sub    %edx,%eax
  lea    D46(%rip),%rdx
  imul   $0x3c,%eax,%eax
  sub    %eax,%ecx
  call   <snprintf@plt>
  lea    D114(%rip),%rax
L105:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L88
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L47:
  mov    $0x100,%r13d
  mov    %rdi,%r15
L73:
  mov    %r12d,%ecx
  lea    D62(%rip),%rdx
  mov    %r15,%rdi
  call   <snprintf@plt>
  test   %eax,%eax
  js     L60
  cltq
  cmp    %r13,%rax
  jge    L60
  lea    (%r15,%rax,1),%rdi
  lea    D98(%rip),%rsi
  sub    %edi,%esi
  jmp    L2
  nopl   0x0(%rax,%rax,1)
L70:
  lea    D114(%rip),%r15
  lea    D63(%rip),%rdx
  mov    $0x100,%esi
  mov    %r15,%rdi
  call   <snprintf@plt>
  cmp    $0xff,%eax
  jbe    L83
L60:
  lea    D12(%rip),%rax
  jmp    L105
  xchg   %ax,%ax
L83:
  cltq
  lea    D98(%rip),%r14
  add    %rax,%r15
  sub    %r15,%r14
  mov    %r14d,%esi
L44:
  mov    %r13d,%ecx
  lea    D109(%rip),%rdx
  mov    %r15,%rdi
  call   <snprintf@plt>
  test   %eax,%eax
  js     L60
  cltq
  cmp    %rax,%r14
  jle    L60
  add    %rax,%r15
  lea    D98(%rip),%r13
  sub    %r15,%r13
  mov    %r13d,%esi
  jmp    L73
  nopl   0x0(%rax)
L114:
  mov    $0x100,%r14d
  lea    D114(%rip),%r15
  jmp    L44
L88:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D46
type: string
name: unpack_data
arguments: data_label: D62
type: string
name: unpack_data
arguments: data_label: D63
type: string
name: unpack_data
arguments: data_label: D12
type: string
name: unpack_data
arguments: data_label: D109
type: string

tool: D46: %ds

tool: D62: %dm

tool: D63: %dd

tool: D12: ?

tool: D109: %dh

assistant: ```c
const char *sec2str(const struct timeval *total) {
  static char result[256];
  int days, hours, mins, secs;
  int first = 1;
  char *p = result;
  char *ep = &result[sizeof(result)];
  int n;
  struct timeval now;
  time_t tsec;
  gettimeofday(&now, NULL);
  tsec = total->tv_sec;
  tsec += total->tv_usec / 1000000;
  tsec -= now.tv_sec;
  tsec -= now.tv_usec / 1000000;
  days = tsec / 3600 / 24;
  hours = (tsec / 3600) % 24;
  mins = (tsec / 60) % 60;
  secs = tsec % 60;
  if (days) {
    first = 0;
    n = snprintf(p, ep - p, "%dd", days);
    if (n < 0 || n >= ep - p)
      return "?";
    p += n;
  }
  if (!first || hours) {
    first = 0;
    n = snprintf(p, ep - p, "%dh", hours);
    if (n < 0 || n >= ep - p)
      return "?";
    p += n;
  }
  if (!first || mins) {
    first = 0;
    n = snprintf(p, ep - p, "%dm", mins);
    if (n < 0 || n >= ep - p)
      return "?";
    p += n;
  }
  snprintf(p, ep - p, "%ds", secs);
  return (result);
}
```