user: Converte this assembly snippet into its equivalent C code:

```asm
<secondsToHuman>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x20(%rbp),%rcx
  movabs $0x1845c8a0ce512957,%rdx
  mov    %rcx,%rax
  imul   %rdx
  mov    %rdx,%rax
  sar    $0xd,%rax
  sar    $0x3f,%rcx
  mov    %rcx,%rdx
  sub    %rdx,%rax
  mov    %eax,-0x10(%rbp)
  mov    -0x20(%rbp),%rcx
  movabs $0x1845c8a0ce512957,%rdx
  mov    %rcx,%rax
  imul   %rdx
  mov    %rdx,%rax
  sar    $0xd,%rax
  mov    %rcx,%rdx
  sar    $0x3f,%rdx
  sub    %rdx,%rax
  imul   $0x15180,%rax,%rdx
  mov    %rcx,%rax
  sub    %rdx,%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x20(%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    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rcx
  movabs $0x48d159e26af37c05,%rdx
  mov    %rcx,%rax
  imul   %rdx
  mov    %rdx,%rax
  sar    $0xa,%rax
  mov    %rcx,%rdx
  sar    $0x3f,%rdx
  sub    %rdx,%rax
  imul   $0xe10,%rax,%rdx
  mov    %rcx,%rax
  sub    %rdx,%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x20(%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    %eax,-0x8(%rbp)
  mov    -0x20(%rbp),%rcx
  movabs $0x8888888888888889,%rdx
  mov    %rcx,%rax
  imul   %rdx
  lea    (%rdx,%rcx,1),%rax
  sar    $0x5,%rax
  mov    %rcx,%rsi
  sar    $0x3f,%rsi
  sub    %rsi,%rax
  mov    %rax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  sub    %rax,%rcx
  mov    %rcx,%rdx
  mov    %edx,-0x4(%rbp)
  cmpl   $0x0,-0x10(%rbp)
  jle    L31
  mov    -0x4(%rbp),%edi
  mov    -0x8(%rbp),%esi
  mov    -0xc(%rbp),%ecx
  mov    -0x10(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %edi,%r9d
  mov    %esi,%r8d
  lea    D1(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L11
L31:
  cmpl   $0x0,-0xc(%rbp)
  jle    L58
  mov    -0x4(%rbp),%esi
  mov    -0x8(%rbp),%ecx
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %esi,%r8d
  lea    D10(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L11
L58:
  cmpl   $0x0,-0x8(%rbp)
  jle    L12
  mov    -0x4(%rbp),%ecx
  mov    -0x8(%rbp),%edx
  mov    -0x18(%rbp),%rax
  lea    D33(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L11
L12:
  mov    -0x4(%rbp),%edx
  mov    -0x18(%rbp),%rax
  lea    D32(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L11:
  nop
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D1
data_type: string
name: extract_symbolic_data
arguments: tag: D10
data_type: string
name: extract_symbolic_data
arguments: tag: D33
data_type: string
name: extract_symbolic_data
arguments: tag: D32
data_type: string

tool: D1: %02dd%02dh%02dm%02ds

tool: D10:    %02dh%02dm%02ds

tool: D33:       %02dm%02ds

tool: D32:          %02ds

assistant: ```c
void secondsToHuman(char *buffer, long elapsed) {
  int days;
  int hours;
  int minutes;
  int seconds;
  days = elapsed / 86400;
  elapsed = elapsed % 86400;
  hours = elapsed / 3600;
  elapsed = elapsed % 3600;
  minutes = elapsed / 60;
  seconds = elapsed % 60;
  if (days > 0) {
    sprintf(buffer, "%02dd%02dh%02dm%02ds", days, hours, minutes, seconds);
  } else if (hours > 0) {
    sprintf(buffer, "   %02dh%02dm%02ds", hours, minutes, seconds);
  } else if (minutes > 0) {
    sprintf(buffer, "      %02dm%02ds", minutes, seconds);
  } else {
    sprintf(buffer, "         %02ds", seconds);
  }
}
```