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

```asm
<secs2hms_mask>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %esi,%ebp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  movslq %edi,%rdx
  imul   $0xffffffff91a2b3c5,%rdx,%rdx
  shr    $0x20,%rdx
  add    %edi,%edx
  sar    $0xb,%edx
  mov    %edi,%eax
  sar    $0x1f,%eax
  sub    %eax,%edx
  imul   $0xe10,%edx,%eax
  sub    %eax,%edi
  movslq %edi,%rax
  imul   $0xffffffff88888889,%rax,%rax
  shr    $0x20,%rax
  add    %edi,%eax
  sar    $0x5,%eax
  mov    %edi,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  mov    %eax,%r12d
  imul   $0x3c,%eax,%eax
  mov    %edi,%ebx
  sub    %eax,%ebx
  test   %edx,%edx
  je     L138
  test   $0x4,%sil
  je     L138
  test   $0x8,%sil
  je     L90
  mov    %rsp,%rdi
  lea    D53(%rip),%rsi
  call   <sprintf@plt>
  mov    %eax,%r13d
  test   $0x2,%bpl
  jne    L22
  test   $0x1,%bpl
  jne    L162
  jmp    L59
L90:
  mov    %rsp,%rdi
  lea    D22(%rip),%rsi
  call   <sprintf@plt>
  mov    %eax,%r13d
  test   $0x2,%bpl
  jne    L20
  test   $0x1,%bpl
  jne    L117
  jmp    L59
L138:
  mov    %ebp,%eax
  and    $0x2,%eax
  je     L155
  mov    %ebp,%r13d
  and    $0x8,%r13d
  je     L20
  mov    $0x0,%r13d
L22:
  movslq %r13d,%rax
  lea    (%rsp,%rax,1),%rdi
  mov    %r12d,%edx
  lea    D28(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%r13d
  test   $0x1,%bpl
  je     L59
L162:
  movslq %r13d,%rax
  lea    (%rsp,%rax,1),%rdi
  mov    %ebx,%edx
  lea    D6(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%r13d
L59:
  test   %r13d,%r13d
  mov    $0x0,%esi
  cmovns %r13d,%esi
  mov    %rsp,%rdi
  call   <statstr_dup@plt>
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L87
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L20:
  movslq %r13d,%rax
  lea    (%rsp,%rax,1),%rdi
  mov    %r12d,%edx
  lea    D3(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%r13d
  test   $0x1,%bpl
  je     L59
L117:
  movslq %r13d,%rax
  lea    (%rsp,%rax,1),%rdi
  mov    %ebx,%edx
  lea    D15(%rip),%rsi
  call   <sprintf@plt>
  add    %eax,%r13d
  jmp    L59
L155:
  mov    %ebp,%r13d
  and    $0x1,%r13d
  je     L59
  and    $0x8,%ebp
  mov    %ebp,%r13d
  je     L117
  mov    %eax,%r13d
  jmp    L162
L87:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D53
type_guessed: string
name: disassemble_data
arguments: tag: D22
type_guessed: string
name: disassemble_data
arguments: tag: D28
type_guessed: string
name: disassemble_data
arguments: tag: D6
type_guessed: string
name: disassemble_data
arguments: tag: D3
type_guessed: string
name: disassemble_data
arguments: tag: D15
type_guessed: string

tool: D53: %d :

tool: D22: %d:

tool: D28:  %d

tool: D6:  : %02d

tool: D3: %02d

tool: D15: :%02d

assistant: ```c
char *secs2hms_mask(int t, int mask) {
  char tstr[20], *this;
  int h, m, s;
  int pos = 0;
  h = t / 3600;
  t = t % 3600;
  m = t / 60;
  s = t % 60;
  if (h && (mask & 4)) {
    if (mask & 8)
      pos += sprintf(tstr + pos, "%d :", h);
    else
      pos += sprintf(tstr + pos, "%d:", h);
  }
  if (mask & 2) {
    if (mask & 8)
      pos += sprintf(tstr + pos, " %d", m);
    else
      pos += sprintf(tstr + pos, "%02d", m);
  }
  if (mask & 1) {
    if (mask & 8)
      pos += sprintf(tstr + pos, " : %02d", s);
    else
      pos += sprintf(tstr + pos, ":%02d", s);
  }
  if (pos < 0)
    pos = 0;
  this = statstr_dup(tstr, pos);
  return this;
}
```