user: Please show me the C implementation that matches the assembly code listed below:

```asm
<exp_str>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %edx,-0x40(%rbp)
  movsd  %xmm0,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x0,-0x3c(%rbp)
  jg     L178
  movl   $0x1,-0x3c(%rbp)
L178:
  cmpl   $0x1869f,-0x3c(%rbp)
  jle    L29
  movl   $0x1869f,-0x3c(%rbp)
L29:
  cmpl   $0x1869f,-0x40(%rbp)
  jle    L111
  movl   $0x1869f,-0x40(%rbp)
L111:
  cmpl   $0x0,-0x40(%rbp)
  jns    L12
  movl   $0x0,-0x40(%rbp)
L12:
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x3c(%rbp),%xmm1
  movq   %xmm1,%rcx
  mov    -0x40(%rbp),%edx
  lea    -0x20(%rbp),%rax
  movq   %rcx,%xmm0
  lea    D13(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <sprintf@plt>
  mov    -0x48(%rbp),%rcx
  lea    -0x20(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  movq   %rcx,%xmm0
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <sprintf@plt>
  movl   $0x0,-0x2c(%rbp)
  jmp    L49
L174:
  addl   $0x1,-0x2c(%rbp)
L49:
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x65,%al
  je     L2
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x45,%al
  je     L2
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L174
L2:
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L55
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L55
  addl   $0x2,-0x2c(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  jmp    L125
L0:
  addl   $0x1,-0x2c(%rbp)
L125:
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L81
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L0
L81:
  mov    -0x2c(%rbp),%eax
  sub    -0x28(%rbp),%eax
  cmp    $0x2,%eax
  jle    L133
  addl   $0x1,-0x3c(%rbp)
  pxor   %xmm2,%xmm2
  cvtsi2sdl -0x3c(%rbp),%xmm2
  movq   %xmm2,%rcx
  mov    -0x40(%rbp),%edx
  lea    -0x20(%rbp),%rax
  movq   %rcx,%xmm0
  lea    D13(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <sprintf@plt>
  mov    -0x48(%rbp),%rcx
  lea    -0x20(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  movq   %rcx,%xmm0
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <sprintf@plt>
  movl   $0x0,-0x2c(%rbp)
  jmp    L163
L194:
  addl   $0x1,-0x2c(%rbp)
L163:
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x65,%al
  je     L44
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x45,%al
  je     L44
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L194
L44:
  addl   $0x2,-0x2c(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  jmp    L96
L170:
  addl   $0x1,-0x2c(%rbp)
L96:
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L175
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L170
L175:
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  sete   %al
  movzbl %al,%eax
  mov    %eax,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  jne    L6
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movb   $0x39,(%rax)
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movb   $0x39,(%rax)
  jmp    L54
L6:
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    -0x28(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x38(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x2(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    -0x28(%rbp),%edx
  movslq %edx,%rdx
  lea    0x1(%rdx),%rcx
  mov    -0x38(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
L54:
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x2(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  jmp    L47
L55:
  nop
  jmp    L47
L133:
  nop
L47:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L14
  call   <__stack_chk_fail@plt>
L14:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D13
data_type: string

tool: D13: %%%d.%de

assistant: ```c
void exp_str(char *buf, int maxlen, int decimals, double value) {
  char fmt[16];
  int i, j, zero;
  if (maxlen < 1)
    maxlen = 1;
  if (maxlen > 99999)
    maxlen = 99999;
  if (decimals > 99999)
    decimals = 99999;
  if (decimals < 0)
    decimals = 0;
  sprintf(fmt, "%%%d.%de", maxlen, decimals);
  sprintf(buf, fmt, value);
  for (i = 0; buf[i] != 'e' && buf[i] != 'E' && buf[i] != '\0'; i++)
    ;
  if (buf[i] == '\0' || buf[i + 1] == '\0')
    return;
  for (i = i + 2, j = i; buf[i] >= '0' && buf[i] <= '9'; i++)
    ;
  if (i - j < 3)
    return;
  maxlen++;
  sprintf(fmt, "%%%d.%de", maxlen, decimals);
  sprintf(buf, fmt, value);
  for (i = 0; buf[i] != 'e' && buf[i] != 'E' && buf[i] != '\0'; i++)
    ;
  for (i = i + 2, j = i; buf[i] >= '0' && buf[i] <= '9'; i++)
    ;
  zero = (buf[j] == '0');
  if (!zero) {
    buf[j] = '9';
    buf[j + 1] = '9';
  } else {
    buf[j] = buf[j + 1];
    buf[j + 1] = buf[j + 2];
  }
  buf[j + 2] = '\0';
}
```