user: What is the c source code of the assembly code below:

```asm
<ns_format_ttl>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rsi,0x8(%rsp)
  mov    %rsi,0x18(%rsp)
  mov    %rdx,0x10(%rsp)
  movslq %edi,%rax
  imul   $0xffffffff88888889,%rax,%rax
  shr    $0x20,%rax
  add    %edi,%eax
  sar    $0x5,%eax
  mov    %edi,%edx
  sar    $0x1f,%edx
  mov    %eax,%r14d
  sub    %edx,%r14d
  imul   $0x3c,%r14d,%ecx
  sub    %ecx,%edi
  mov    %edi,%r14d
  sub    %edx,%eax
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x5,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  mov    %edx,%r15d
  sub    %ecx,%r15d
  imul   $0x3c,%r15d,%esi
  sub    %esi,%eax
  mov    %eax,%r15d
  mov    %edx,%eax
  sub    %ecx,%eax
  movslq %eax,%rbp
  imul   $0x2aaaaaab,%rbp,%rbp
  sar    $0x22,%rbp
  cltd
  sub    %edx,%ebp
  mov    %ebp,%edx
  lea    0x0(%rbp,%rbp,2),%ecx
  shl    $0x3,%ecx
  sub    %ecx,%eax
  mov    %eax,%ebp
  movslq %edx,%rbx
  imul   $0xffffffff92492493,%rbx,%rbx
  shr    $0x20,%rbx
  add    %edx,%ebx
  sar    $0x2,%ebx
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  mov    %ebx,%r12d
  sub    %ecx,%r12d
  lea    0x0(,%r12,8),%eax
  sub    %r12d,%eax
  sub    %eax,%edx
  mov    %edx,%r12d
  sub    %ecx,%ebx
  mov    %ebx,%r13d
  jne    L3
L142:
  test   %r12d,%r12d
  jne    L180
L129:
  test   %ebp,%ebp
  jne    L249
L139:
  test   %r15d,%r15d
  jne    L112
  test   %r14d,%r14d
  jne    L40
  or     %r12d,%ebp
  or     %ebx,%ebp
  jne    L144
L40:
  lea    0x10(%rsp),%rcx
  lea    0x18(%rsp),%rdx
  mov    $0x53,%esi
  mov    %r14d,%edi
  call   <fmt1@plt>
  test   %rax,%rax
  js     L16
  add    $0x1,%r13d
L144:
  cmp    $0x1,%r13d
  jle    L204
  mov    0x8(%rsp),%rbp
  movsbl 0x0(%rbp),%ebx
  test   %ebx,%ebx
  jne    L192
L204:
  mov    0x18(%rsp),%eax
  sub    0x8(%rsp),%eax
L77:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L3:
  lea    0x10(%rsp),%rcx
  lea    0x18(%rsp),%rdx
  mov    $0x57,%esi
  mov    %ebx,%edi
  call   <fmt1@plt>
  test   %rax,%rax
  js     L191
  mov    $0x1,%r13d
  jmp    L142
L180:
  lea    0x10(%rsp),%rcx
  lea    0x18(%rsp),%rdx
  mov    $0x44,%esi
  mov    %r12d,%edi
  call   <fmt1@plt>
  test   %rax,%rax
  js     L97
  add    $0x1,%r13d
  jmp    L129
L249:
  lea    0x10(%rsp),%rcx
  lea    0x18(%rsp),%rdx
  mov    $0x48,%esi
  mov    %ebp,%edi
  call   <fmt1@plt>
  test   %rax,%rax
  js     L230
  add    $0x1,%r13d
  jmp    L139
L112:
  lea    0x10(%rsp),%rcx
  lea    0x18(%rsp),%rdx
  mov    $0x4d,%esi
  mov    %r15d,%edi
  call   <fmt1@plt>
  test   %rax,%rax
  js     L156
  add    $0x1,%r13d
  test   %r14d,%r14d
  je     L144
  jmp    L40
L207:
  add    $0x1,%rbp
  movsbl 0x0(%rbp),%ebx
  test   %ebx,%ebx
  je     L204
L192:
  mov    %ebx,%edi
  call   <isascii@plt>
  test   %rax,%rax
  je     L207
  mov    %ebx,%edi
  call   <isupper@plt>
  test   %rax,%rax
  je     L207
  mov    %ebx,%edi
  call   <tolower@plt>
  mov    %al,0x0(%rbp)
  jmp    L207
L191:
  mov    $0xffffffff,%eax
  jmp    L77
L97:
  mov    $0xffffffff,%eax
  jmp    L77
L230:
  mov    $0xffffffff,%eax
  jmp    L77
L156:
  mov    $0xffffffff,%eax
  jmp    L77
L16:
  mov    $0xffffffff,%eax
  jmp    L77
```

assistant: ```c
int ns_format_ttl(u_long src, char *dst, size_t dstlen) {
  char *odst = dst;
  int secs, mins, hours, days, weeks, x;
  char *p;
  secs = (int)(src % 60);
  src /= 60;
  mins = (int)(src % 60);
  src /= 60;
  hours = (int)(src % 24);
  src /= 24;
  days = (int)(src % 7);
  src /= 7;
  weeks = (int)src;
  src = 0;
  x = 0;
  if (weeks) {
    if ((fmt1(weeks, 'W', &dst, &dstlen)) < 0)
      return (-1);
    else
      (void)NULL;
    x++;
  }
  if (days) {
    if ((fmt1(days, 'D', &dst, &dstlen)) < 0)
      return (-1);
    else
      (void)NULL;
    x++;
  }
  if (hours) {
    if ((fmt1(hours, 'H', &dst, &dstlen)) < 0)
      return (-1);
    else
      (void)NULL;
    x++;
  }
  if (mins) {
    if ((fmt1(mins, 'M', &dst, &dstlen)) < 0)
      return (-1);
    else
      (void)NULL;
    x++;
  }
  if (secs || !(weeks || days || hours || mins)) {
    if ((fmt1(secs, 'S', &dst, &dstlen)) < 0)
      return (-1);
    else
      (void)NULL;
    x++;
  }
  if (x > 1) {
    int ch;
    for (p = odst; (ch = *p) != '\0'; p++)
      if (isascii(ch) && isupper(ch))
        *p = (char)(tolower(ch));
  }
  return ((int)(dst - odst));
}
```