user: What would the C source look like for the assembly code provided here?

```asm
<por_write_double_to_buffer>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  movsd  %xmm0,-0x58(%rbp)
  mov    %rdx,-0x60(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x3c(%rbp)
  mov    -0x58(%rbp),%rax
  movq   %rax,%xmm0
  call   <isnan@plt>
  test   %rax,%rax
  je     L214
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2a,(%rax)
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2e,(%rax)
  jmp    L46
L214:
  mov    -0x58(%rbp),%rax
  movq   %rax,%xmm0
  call   <isinf@plt>
  test   %rax,%rax
  je     L118
  pxor   %xmm0,%xmm0
  comisd -0x58(%rbp),%xmm0
  jbe    L127
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2d,(%rax)
L127:
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movb   $0x31,(%rax)
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2b,(%rax)
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movb   $0x54,(%rax)
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movb   $0x54,(%rax)
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2f,(%rax)
  jmp    L46
L118:
  movq   $0x0,-0x28(%rbp)
  movsd  -0x58(%rbp),%xmm0
  movq   D3(%rip),%xmm1
  andpd  %xmm1,%xmm0
  movq   %xmm0,%rax
  lea    -0x30(%rbp),%rdx
  mov    %rdx,%rdi
  movq   %rax,%xmm0
  call   <modf@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x20(%rbp)
  movsd  -0x30(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x38(%rbp)
  movl   $0x0,-0x34(%rbp)
  pxor   %xmm0,%xmm0
  comisd -0x58(%rbp),%xmm0
  jbe    L114
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2d,(%rax)
L114:
  cmpl   $0x0,-0x38(%rbp)
  jne    L33
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movb   $0x30,(%rax)
  jmp    L111
L55:
  mov    -0x38(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x4,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x38(%rbp)
  addl   $0x1,-0x34(%rbp)
L33:
  pxor   %xmm0,%xmm0
  ucomisd -0x20(%rbp),%xmm0
  jp     L187
  pxor   %xmm0,%xmm0
  ucomisd -0x20(%rbp),%xmm0
  jne    L187
  cmpl   $0x0,-0x38(%rbp)
  je     L187
  mov    -0x38(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x4,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x1e,%edx,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  test   %edx,%edx
  je     L55
L187:
  mov    -0x3c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x50(%rbp),%rax
  sub    %rdx,%rax
  mov    %rax,%rsi
  mov    -0x3c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x38(%rbp),%eax
  mov    %eax,%edx
  mov    %rcx,%rdi
  call   <por_write_base30_integer@plt>
  cltq
  mov    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %eax,%edx
  mov    -0x3c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x3c(%rbp)
L111:
  pxor   %xmm0,%xmm0
  ucomisd -0x20(%rbp),%xmm0
  jp     L178
  pxor   %xmm0,%xmm0
  ucomisd -0x20(%rbp),%xmm0
  je     L24
L178:
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2e,(%rax)
  jmp    L24
L59:
  movsd  -0x20(%rbp),%xmm1
  movsd  D17(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  lea    -0x30(%rbp),%rdx
  mov    %rdx,%rdi
  movq   %rax,%xmm0
  call   <modf@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x20(%rbp)
  movsd  -0x30(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x38(%rbp)
  cmpl   $0x0,-0x38(%rbp)
  jns    L206
  mov    $0xffffffff,%eax
  jmp    L93
L206:
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    -0x38(%rbp),%eax
  mov    %eax,%edi
  call   <por_encode_base30_digit@plt>
  mov    %al,(%rbx)
  addq   $0x1,-0x28(%rbp)
L24:
  pxor   %xmm0,%xmm0
  ucomisd -0x20(%rbp),%xmm0
  jp     L35
  pxor   %xmm0,%xmm0
  ucomisd -0x20(%rbp),%xmm0
  je     L162
L35:
  mov    -0x28(%rbp),%rax
  cmp    -0x60(%rbp),%rax
  jl     L59
L162:
  cmpl   $0x0,-0x34(%rbp)
  je     L63
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2b,(%rax)
  mov    -0x3c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x50(%rbp),%rax
  sub    %rdx,%rax
  mov    %rax,%rsi
  mov    -0x3c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x34(%rbp),%eax
  mov    %eax,%edx
  mov    %rcx,%rdi
  call   <por_write_base30_integer@plt>
  add    %eax,-0x3c(%rbp)
L63:
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2f,(%rax)
L46:
  mov    -0x3c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x3c(%rbp),%eax
L93:
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L79
  call   <__stack_chk_fail@plt>
L79:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D3
type_guessed: qword
name: read_data
arguments: data_label: D17
type_guessed: f32[2]

tool: D3: 9223372036854775807

tool: {"D17": [0.0,2.96875]}

assistant: ```c
ssize_t por_write_double_to_buffer(char *string, size_t buffer_len, double value, long precision) {
  int offset = 0;
  if (isnan(value)) {
    string[offset++] = '*';
    string[offset++] = '.';
  } else if (isinf(value)) {
    if (value < 0.0) {
      string[offset++] = '-';
    }
    string[offset++] = '1';
    string[offset++] = '+';
    string[offset++] = 'T';
    string[offset++] = 'T';
    string[offset++] = '/';
  } else {
    long integers_printed = 0;
    double integer_part;
    double fraction = modf(fabs(value), &integer_part);
    int64_t integer = integer_part;
    int64_t exponent = 0;
    if (value < 0.0) {
      string[offset++] = '-';
    }
    if (integer == 0) {
      string[offset++] = '0';
    } else {
      while (fraction == 0 && integer != 0 && (integer % 30) == 0) {
        integer /= 30;
        exponent++;
      }
      integers_printed = por_write_base30_integer(&string[offset], buffer_len - offset, integer);
      offset += integers_printed;
    }
    if (fraction) {
      string[offset++] = '.';
    }
    while (fraction && integers_printed < precision) {
      fraction = modf(fraction * 30, &integer_part);
      integer = integer_part;
      if (integer < 0) {
        return -1;
      } else {
        string[offset++] = por_encode_base30_digit(integer);
      }
      integers_printed++;
    }
    if (exponent) {
      string[offset++] = '+';
      offset += por_write_base30_integer(&string[offset], buffer_len - offset, exponent);
    }
    string[offset++] = '/';
  }
  string[offset] = '\0';
  return offset;
}
```