user: Translate the below assembly code into C programming language:

```asm
<sec2str>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x1,-0x3c(%rbp)
  lea    D81(%rip),%rax
  mov    %rax,-0x20(%rbp)
  lea    D86(%rip),%rax
  mov    %rax,-0x18(%rbp)
  lea    -0x10(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <gettimeofday@plt>
  mov    -0x48(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x38(%rbp)
  mov    -0x48(%rbp),%rax
  mov    0x4(%rax),%eax
  movslq %eax,%rdx
  imul   $0x431bde83,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x12,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  add    %eax,-0x38(%rbp)
  mov    -0x10(%rbp),%eax
  sub    %eax,-0x38(%rbp)
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x431bde83,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x12,%edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  add    %eax,-0x38(%rbp)
  mov    -0x38(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffffc22e4507,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x10,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x38(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffff91a2b3c5,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0xb,%edx
  sar    $0x1f,%eax
  sub    %eax,%edx
  movslq %edx,%rax
  imul   $0x2aaaaaab,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  mov    %eax,-0x30(%rbp)
  mov    -0x30(%rbp),%ecx
  mov    %ecx,%eax
  add    %eax,%eax
  add    %ecx,%eax
  shl    $0x3,%eax
  sub    %eax,%edx
  mov    %edx,-0x30(%rbp)
  mov    -0x38(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x5,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x5,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  mov    %edx,-0x2c(%rbp)
  mov    -0x2c(%rbp),%edx
  imul   $0x3c,%edx,%edx
  sub    %edx,%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x38(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x5,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x3c,%edx,%edx
  sub    %edx,%eax
  mov    %eax,-0x28(%rbp)
  cmpl   $0x0,-0x34(%rbp)
  je     L55
  movl   $0x0,-0x3c(%rbp)
  mov    -0x18(%rbp),%rax
  sub    -0x20(%rbp),%rax
  mov    %eax,%esi
  mov    -0x34(%rbp),%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,%ecx
  lea    D68(%rip),%rdx
  mov    %rax,%rdi
  call   <snprintf@plt>
  mov    %eax,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  js     L123
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  sub    -0x20(%rbp),%rax
  cmp    %rax,%rdx
  jl     L129
L123:
  lea    D26(%rip),%rax
  jmp    L22
L129:
  mov    -0x24(%rbp),%eax
  cltq
  add    %rax,-0x20(%rbp)
L55:
  cmpl   $0x0,-0x3c(%rbp)
  je     L38
  cmpl   $0x0,-0x30(%rbp)
  je     L72
L38:
  movl   $0x0,-0x3c(%rbp)
  mov    -0x18(%rbp),%rax
  sub    -0x20(%rbp),%rax
  mov    %eax,%esi
  mov    -0x30(%rbp),%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,%ecx
  lea    D65(%rip),%rdx
  mov    %rax,%rdi
  call   <snprintf@plt>
  mov    %eax,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  js     L91
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  sub    -0x20(%rbp),%rax
  cmp    %rax,%rdx
  jl     L13
L91:
  lea    D26(%rip),%rax
  jmp    L22
L13:
  mov    -0x24(%rbp),%eax
  cltq
  add    %rax,-0x20(%rbp)
L72:
  cmpl   $0x0,-0x3c(%rbp)
  je     L93
  cmpl   $0x0,-0x2c(%rbp)
  je     L120
L93:
  movl   $0x0,-0x3c(%rbp)
  mov    -0x18(%rbp),%rax
  sub    -0x20(%rbp),%rax
  mov    %eax,%esi
  mov    -0x2c(%rbp),%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,%ecx
  lea    D61(%rip),%rdx
  mov    %rax,%rdi
  call   <snprintf@plt>
  mov    %eax,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  js     L90
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  sub    -0x20(%rbp),%rax
  cmp    %rax,%rdx
  jl     L34
L90:
  lea    D26(%rip),%rax
  jmp    L22
L34:
  mov    -0x24(%rbp),%eax
  cltq
  add    %rax,-0x20(%rbp)
L120:
  mov    -0x18(%rbp),%rax
  sub    -0x20(%rbp),%rax
  mov    %eax,%esi
  mov    -0x28(%rbp),%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,%ecx
  lea    D78(%rip),%rdx
  mov    %rax,%rdi
  call   <snprintf@plt>
  lea    D81(%rip),%rax
L22:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L60
  call   <__stack_chk_fail@plt>
L60:
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D68
type: string
name: parse_data
arguments: tag: D26
type: string
name: parse_data
arguments: tag: D65
type: string
name: parse_data
arguments: tag: D61
type: string
name: parse_data
arguments: tag: D78
type: string

tool: D68: %dd

tool: D26: ?

tool: D65: %dh

tool: D61: %dm

tool: D78: %ds

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);
}
```