user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<smart_ulltoa4>:
  endbr64
  mov    %rsi,%rax
  cmp    $0x270f,%rdi
  jbe    L29
  mov    %rdx,%r9
  lea    (%rdi,%rdi,4),%rdx
  xor    %ecx,%ecx
  add    %rdx,%rdx
L1:
  mov    %rdx,%rsi
  add    $0x1,%ecx
  shr    $0xa,%rdx
  cmp    $0x9c3fff,%rsi
  ja     L1
  mov    %edx,%r10d
  mov    $0xcccccccd,%r8d
  mov    %edx,%edi
  mov    %edx,%esi
  imul   %r10,%r8
  shr    $0x23,%r8
  lea    (%r8,%r8,4),%r11d
  add    %r11d,%r11d
  sub    %r11d,%edi
  test   %ecx,%ecx
  je     L10
  cmp    $0x63,%edx
  jbe    L24
  imul   $0x10624dd3,%r10,%r10
  lea    D14(%rip),%rdx
  push   %rbx
  mov    $0xcccccccd,%ebx
  lea    D42(%rip),%rsi
  shr    $0x26,%r10
  movzbl (%rdx,%r10,1),%edi
  cmp    $0x20,%dil
  mov    %dil,(%rax)
  mov    %r8d,%edi
  cmovne %rsi,%rdx
  imul   %rbx,%rdi
  add    $0x4,%rax
  mov    %rdx,%r10
  shr    $0x23,%rdi
  mov    %edi,%edx
  lea    (%rdi,%rdi,4),%r11d
  mov    %r8d,%edi
  mov    %edx,%r8d
  add    %r11d,%r11d
  imul   %rbx,%r8
  sub    %r11d,%edi
  shr    $0x23,%r8
  lea    (%r8,%r8,4),%r8d
  add    %r8d,%r8d
  sub    %r8d,%edx
  movzbl (%r10,%rdx,1),%edx
  mov    %dl,-0x3(%rax)
  movzbl (%rsi,%rdi,1),%edx
  mov    %dl,-0x2(%rax)
  movzbl (%r9,%rcx,1),%edx
  mov    %dl,-0x1(%rax)
  pop    %rbx
  ret
  nopl   0x0(%rax)
L29:
  mov    %edi,%edx
  mov    $0xcccccccd,%ecx
  mov    %edi,%esi
  imul   %rcx,%rdx
  shr    $0x23,%rdx
  mov    %rdx,%r8
  lea    (%rdx,%rdx,4),%edx
  add    %edx,%edx
  sub    %edx,%edi
L10:
  imul   $0x10624dd3,%rsi,%rsi
  lea    D14(%rip),%rdx
  mov    $0xcccccccd,%r10d
  shr    $0x26,%rsi
  movzbl (%rdx,%rsi,1),%ecx
  lea    D42(%rip),%rsi
  cmp    $0x20,%cl
  mov    %cl,(%rax)
  mov    %r8d,%ecx
  cmovne %rsi,%rdx
  imul   %r10,%rcx
  mov    %rdx,%r9
  shr    $0x23,%rcx
  mov    %ecx,%edx
  imul   %r10,%rdx
  mov    %ecx,%r10d
  lea    (%rcx,%rcx,4),%ecx
  shr    $0x23,%rdx
  lea    (%rdx,%rdx,4),%edx
  add    %edx,%edx
  sub    %edx,%r10d
  movzbl (%r9,%r10,1),%edx
  cmp    $0x20,%dl
  mov    %dl,0x1(%rax)
  mov    %r8d,%edx
  cmovne %rsi,%r9
  add    %ecx,%ecx
  add    $0x4,%rax
  sub    %ecx,%edx
  movzbl (%r9,%rdx,1),%edx
  mov    %dl,-0x2(%rax)
  movzbl (%rsi,%rdi,1),%edx
  mov    %dl,-0x1(%rax)
  ret
  nop
L24:
  lea    D42(%rip),%rsi
  mov    %r8d,%edx
  add    $0x4,%rax
  movzbl (%rsi,%rdx,1),%edx
  mov    %dl,-0x4(%rax)
  mov    $0x2e,%edx
  mov    %dl,-0x3(%rax)
  movzbl (%rsi,%rdi,1),%edx
  mov    %dl,-0x2(%rax)
  movzbl (%r9,%rcx,1),%edx
  mov    %dl,-0x1(%rax)
  ret
```

tool_calls: name: retrieve_data
arguments: label: D14
type: string
name: retrieve_data
arguments: label: D42
type: string

tool: D14:  123456789

tool: D42: 0123456789

assistant: ```c
char *smart_ulltoa4(unsigned long long ul, char buf[4], const char *scale) {
  const char *fmt;
  char c;
  unsigned v, u, idx = 0;
  if (ul > 9999) {
    ul *= 10;
    do {
      ul /= 1024;
      idx++;
    } while (ul >= 10000);
  }
  v = ul;
  fmt = " 123456789";
  u = v / 10;
  v = v % 10;
  if (!idx) {
    c = buf[0] = " 123456789"[u / 100];
    if (c != ' ')
      fmt = "0123456789";
    c = buf[1] = fmt[u / 10 % 10];
    if (c != ' ')
      fmt = "0123456789";
    buf[2] = fmt[u % 10];
    buf[3] = "0123456789"[v];
  } else {
    if (u >= 10) {
      c = buf[0] = " 123456789"[u / 100];
      if (c != ' ')
        fmt = "0123456789";
      v = u % 10;
      u = u / 10;
      buf[1] = fmt[u % 10];
    } else {
      buf[0] = "0123456789"[u];
      buf[1] = '.';
    }
    buf[2] = "0123456789"[v];
    buf[3] = scale[idx];
  }
  return buf + 4;
}
```