user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<format_seconds>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %esi,-0xc(%rbp)
  mov    %rdx,-0x18(%rbp)
  cmpq   $0x1517f,-0x18(%rbp)
  jle    L35
  mov    -0x18(%rbp),%rcx
  movabs $0x8888888888888889,%rdx
  mov    %rcx,%rax
  imul   %rdx
  lea    (%rdx,%rcx,1),%rax
  sar    $0x5,%rax
  sar    $0x3f,%rcx
  mov    %rcx,%rdx
  sub    %rdx,%rax
  mov    %rax,%rcx
  movabs $0x8888888888888889,%rdx
  mov    %rcx,%rax
  imul   %rdx
  lea    (%rdx,%rcx,1),%rax
  sar    $0x5,%rax
  mov    %rcx,%rdx
  sar    $0x3f,%rdx
  sub    %rdx,%rax
  mov    %rax,%rsi
  mov    %rsi,%rax
  shl    $0x4,%rax
  sub    %rsi,%rax
  shl    $0x2,%rax
  mov    %rcx,%rsi
  sub    %rax,%rsi
  mov    -0x18(%rbp),%rcx
  movabs $0x48d159e26af37c05,%rdx
  mov    %rcx,%rax
  imul   %rdx
  mov    %rdx,%rax
  sar    $0xa,%rax
  sar    $0x3f,%rcx
  mov    %rcx,%rdx
  sub    %rdx,%rax
  mov    %rax,%rdi
  movabs $0x2aaaaaaaaaaaaaab,%rdx
  mov    %rdi,%rax
  imul   %rdx
  mov    %rdx,%rax
  sar    $0x2,%rax
  mov    %rdi,%rdx
  sar    $0x3f,%rdx
  sub    %rdx,%rax
  mov    %rax,%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  shl    $0x3,%rax
  sub    %rax,%rdi
  mov    %rdi,%rcx
  mov    -0x18(%rbp),%rdi
  movabs $0x1845c8a0ce512957,%rdx
  mov    %rdi,%rax
  imul   %rdx
  mov    %rdx,%rax
  sar    $0xd,%rax
  sar    $0x3f,%rdi
  sub    %rdi,%rax
  mov    %rax,%rdx
  mov    -0xc(%rbp),%edi
  mov    -0x8(%rbp),%rax
  mov    %rsi,%r9
  mov    %rcx,%r8
  mov    %rdx,%rcx
  lea    D22(%rip),%rdx
  mov    %edi,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  jmp    L37
L35:
  cmpq   $0xe0f,-0x18(%rbp)
  jle    L20
  mov    -0x18(%rbp),%rcx
  movabs $0x8888888888888889,%rdx
  mov    %rcx,%rax
  imul   %rdx
  lea    (%rdx,%rcx,1),%rax
  sar    $0x5,%rax
  sar    $0x3f,%rcx
  mov    %rcx,%rdx
  sub    %rdx,%rax
  mov    %rax,%rcx
  movabs $0x8888888888888889,%rdx
  mov    %rcx,%rax
  imul   %rdx
  lea    (%rdx,%rcx,1),%rax
  sar    $0x5,%rax
  mov    %rcx,%rdx
  sar    $0x3f,%rdx
  sub    %rdx,%rax
  mov    %rax,%rsi
  mov    %rsi,%rax
  shl    $0x4,%rax
  sub    %rsi,%rax
  shl    $0x2,%rax
  mov    %rcx,%rsi
  sub    %rax,%rsi
  mov    -0x18(%rbp),%rcx
  movabs $0x48d159e26af37c05,%rdx
  mov    %rcx,%rax
  imul   %rdx
  mov    %rdx,%rax
  sar    $0xa,%rax
  sar    $0x3f,%rcx
  mov    %rcx,%rdx
  sub    %rdx,%rax
  mov    %rax,%rcx
  movabs $0x2aaaaaaaaaaaaaab,%rdx
  mov    %rcx,%rax
  imul   %rdx
  mov    %rdx,%rax
  sar    $0x2,%rax
  mov    %rcx,%rdi
  sar    $0x3f,%rdi
  sub    %rdi,%rax
  mov    %rax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  sub    %rax,%rcx
  mov    %rcx,%rdx
  mov    -0xc(%rbp),%edi
  mov    -0x8(%rbp),%rax
  mov    %rsi,%r8
  mov    %rdx,%rcx
  lea    D11(%rip),%rdx
  mov    %edi,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  jmp    L37
L20:
  mov    -0x18(%rbp),%rcx
  movabs $0x8888888888888889,%rdx
  mov    %rcx,%rax
  imul   %rdx
  lea    (%rdx,%rcx,1),%rax
  sar    $0x5,%rax
  mov    %rcx,%rdx
  sar    $0x3f,%rdx
  sub    %rdx,%rax
  mov    %rax,%rsi
  mov    %rsi,%rax
  shl    $0x4,%rax
  sub    %rsi,%rax
  shl    $0x2,%rax
  mov    %rcx,%rsi
  sub    %rax,%rsi
  mov    -0x18(%rbp),%rcx
  movabs $0x8888888888888889,%rdx
  mov    %rcx,%rax
  imul   %rdx
  lea    (%rdx,%rcx,1),%rax
  sar    $0x5,%rax
  sar    $0x3f,%rcx
  sub    %rcx,%rax
  mov    %rax,%rdx
  mov    -0xc(%rbp),%edi
  mov    -0x8(%rbp),%rax
  mov    %rsi,%r8
  mov    %rdx,%rcx
  lea    D20(%rip),%rdx
  mov    %edi,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
L37:
  nop
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D22
type: string
name: parse_data
arguments: label: D11
type: string
name: parse_data
arguments: label: D20
type: string

tool: D22: %ldd %ldh %ldm

tool: D11: %ldh %ldm

tool: D20: %ldm %lds

assistant: ```c
void format_seconds(char *buf, unsigned int n, long t) {
  if (t >= 24 * 60 * 60)
    snprintf(buf, n, "%ldd %ldh %ldm", t / 60 / 60 / 24, (t / 60 / 60) % 24, (t / 60) % 60);
  else if (t >= 60 * 60)
    snprintf(buf, n, "%ldh %ldm", (t / 60 / 60) % 24, (t / 60) % 60);
  else
    snprintf(buf, n, "%ldm %lds", t / 60, t % 60);
}
```