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

```asm
<fs_sexa>:
  endbr64
  push   %r13
  pxor   %xmm2,%xmm2
  movslq %edx,%rcx
  pxor   %xmm1,%xmm1
  push   %r12
  cvtsi2sd %ecx,%xmm1
  mov    %rdi,%r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  sub    $0x8,%rsp
  comisd %xmm0,%xmm2
  ja     L94
  mulsd  %xmm0,%xmm1
  movsd  D105(%rip),%xmm0
  addsd  D63(%rip),%xmm1
  comisd %xmm0,%xmm1
  jae    L157
  cvttsd2si %xmm1,%rax
L41:
  xor    %edx,%edx
  div    %rcx
  mov    %rax,%rcx
  mov    %edx,%r13d
  jmp    L87
  nopl   0x0(%rax)
L94:
  mulsd  %xmm1,%xmm0
  movsd  D63(%rip),%xmm1
  subsd  %xmm0,%xmm1
  movsd  D105(%rip),%xmm0
  comisd %xmm0,%xmm1
  jae    L74
  cvttsd2si %xmm1,%rax
L57:
  xor    %edx,%edx
  div    %rcx
  mov    %edx,%r13d
  test   %eax,%eax
  jne    L92
  lea    -0x2(%rsi),%edx
  lea    D126(%rip),%rcx
  mov    %r12,%rdi
  lea    D115(%rip),%rsi
  call   <sprintf@plt>
  movslq %eax,%rbx
  add    %r12,%rbx
  cmp    $0xe10,%ebp
  je     L25
L109:
  jg     L90
  cmp    $0x3c,%ebp
  jne    L36
  mov    %r13d,%edx
  mov    %rbx,%rdi
  lea    D57(%rip),%rsi
  xor    %eax,%eax
  call   <sprintf@plt>
  add    $0x8,%rsp
  cltq
  add    %rbx,%rax
  pop    %rbx
  pop    %rbp
  sub    %r12d,%eax
  pop    %r12
  pop    %r13
  ret
L36:
  cmp    $0x258,%ebp
  jne    L60
  movslq %r13d,%rdx
  mov    %r13d,%eax
  mov    %r13d,%ecx
  mov    %rbx,%rdi
  imul   $0x66666667,%rdx,%rdx
  sar    $0x1f,%eax
  lea    D51(%rip),%rsi
  sar    $0x22,%rdx
  sub    %eax,%edx
  lea    (%rdx,%rdx,4),%eax
  add    %eax,%eax
  sub    %eax,%ecx
  xor    %eax,%eax
  call   <sprintf@plt>
  cltq
  add    %rbx,%rax
L38:
  add    $0x8,%rsp
  sub    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L90:
  cmp    $0x8ca0,%ebp
  jne    L111
  movslq %r13d,%rdx
  mov    %r13d,%esi
  mov    %rbx,%rdi
  imul   $0x1b4e81b5,%rdx,%rdx
  sar    $0x1f,%esi
  sar    $0x26,%rdx
  mov    %edx,%r8d
  sub    %esi,%edx
  sub    %esi,%r8d
  lea    D29(%rip),%rsi
  imul   $0x258,%r8d,%eax
  mov    %r13d,%r8d
  sub    %eax,%r8d
  movslq %r8d,%rcx
  mov    %r8d,%eax
  imul   $0x66666667,%rcx,%rcx
  sar    $0x1f,%eax
  sar    $0x22,%rcx
  sub    %eax,%ecx
  lea    (%rcx,%rcx,4),%eax
  add    %eax,%eax
  sub    %eax,%r8d
  xor    %eax,%eax
  call   <sprintf@plt>
  cltq
  add    %rbx,%rax
L14:
  add    $0x8,%rsp
  sub    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L111:
  cmp    $0x57e40,%ebp
  jne    L60
  movslq %r13d,%rdx
  mov    %r13d,%eax
  mov    %rbx,%rdi
  imul   $0x57619f1,%rdx,%rdx
  sar    $0x1f,%eax
  sar    $0x27,%rdx
  mov    %edx,%r8d
  sub    %eax,%edx
  sub    %eax,%r8d
  xor    %eax,%eax
  imul   $0x1770,%r8d,%ecx
  mov    %r13d,%r8d
  sub    %ecx,%r8d
  movslq %r8d,%rcx
  mov    %r8d,%esi
  imul   $0x51eb851f,%rcx,%rcx
  sar    $0x1f,%esi
  sar    $0x25,%rcx
  sub    %esi,%ecx
  imul   $0x64,%ecx,%esi
  sub    %esi,%r8d
  lea    D38(%rip),%rsi
  call   <sprintf@plt>
  cltq
  add    %rbx,%rax
  jmp    L14
  nopl   0x0(%rax)
L92:
  mov    %eax,%ecx
  neg    %ecx
L87:
  mov    %esi,%edx
  mov    %r12,%rdi
  lea    D25(%rip),%rsi
  xor    %eax,%eax
  call   <sprintf@plt>
  movslq %eax,%rbx
  add    %r12,%rbx
  cmp    $0xe10,%ebp
  jne    L109
L25:
  movslq %r13d,%rdx
  mov    %r13d,%eax
  mov    %r13d,%ecx
  mov    %rbx,%rdi
  imul   $0xffffffff88888889,%rdx,%rdx
  sar    $0x1f,%eax
  lea    D102(%rip),%rsi
  shr    $0x20,%rdx
  add    %r13d,%edx
  sar    $0x5,%edx
  sub    %eax,%edx
  imul   $0x3c,%edx,%eax
  sub    %eax,%ecx
  xor    %eax,%eax
  call   <sprintf@plt>
  cltq
  add    %rbx,%rax
  jmp    L38
L74:
  subsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%rax
  btc    $0x3f,%rax
  jmp    L57
  nopl   0x0(%rax,%rax,1)
L157:
  subsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%rax
  btc    $0x3f,%rax
  jmp    L41
L60:
  lea    D58(%rip),%rdi
  mov    %ebp,%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
```

tool_calls: name: parse_data
arguments: tag: D105
datatype: byte[8]
name: parse_data
arguments: tag: D63
datatype: f64
name: parse_data
arguments: tag: D126
datatype: string
name: parse_data
arguments: tag: D115
datatype: string
name: parse_data
arguments: tag: D57
datatype: string
name: parse_data
arguments: tag: D51
datatype: string
name: parse_data
arguments: tag: D29
datatype: string
name: parse_data
arguments: tag: D38
datatype: string
name: parse_data
arguments: tag: D25
datatype: string
name: parse_data
arguments: tag: D102
datatype: string
name: parse_data
arguments: tag: D58
datatype: string

tool: {"D105": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x43]}

tool: D63: 0.5

tool: 

tool: D115: %*s-0

tool: D57: :%02d

tool: D51: :%02d.%1d

tool: D29: :%02d:%02d.%1d

tool: D38: :%02d:%02d.%02d

tool: D25: %*d

tool: D102: :%02d:%02d

tool: D58: fs_sexa: unknown fracbase: %d


assistant: ```c
int fs_sexa(char *out, double a, int w, int fracbase) {
  char *out0 = out;
  unsigned long n;
  int d;
  int f;
  int m;
  int s;
  int isneg;
  isneg = (a < 0);
  if (isneg)
    a = -a;
  n = (unsigned long)(a * fracbase + 0.5);
  d = n / fracbase;
  f = n % fracbase;
  if (isneg && d == 0)
    out += sprintf(out, "%*s-0", w - 2, "");
  else
    out += sprintf(out, "%*d", w, isneg ? -d : d);
  switch (fracbase) {
  case 60:
    m = f / (fracbase / 60);
    out += sprintf(out, ":%02d", m);
    break;
  case 600:
    out += sprintf(out, ":%02d.%1d", f / 10, f % 10);
    break;
  case 3600:
    m = f / (fracbase / 60);
    s = f % (fracbase / 60);
    out += sprintf(out, ":%02d:%02d", m, s);
    break;
  case 36000:
    m = f / (fracbase / 60);
    s = f % (fracbase / 60);
    out += sprintf(out, ":%02d:%02d.%1d", m, s / 10, s % 10);
    break;
  case 360000:
    m = f / (fracbase / 60);
    s = f % (fracbase / 60);
    out += sprintf(out, ":%02d:%02d.%02d", m, s / 100, s % 100);
    break;
  default:
    printf("fs_sexa: unknown fracbase: %d\n", fracbase);
    exit(1);
  }
  return (out - out0);
}
```