user: Translate the below assembly code into C programming language:

```asm
<smart_ulltoa4>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  movl   $0x0,-0x10(%rbp)
  cmpq   $0x270f,-0x28(%rbp)
  jbe    L57
  mov    -0x28(%rbp),%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  add    %rax,%rax
  mov    %rax,-0x28(%rbp)
L49:
  mov    -0x28(%rbp),%rax
  shr    $0xa,%rax
  mov    %rax,-0x28(%rbp)
  addl   $0x1,-0x10(%rbp)
  cmpq   $0x270f,-0x28(%rbp)
  ja     L49
L57:
  mov    -0x28(%rbp),%rax
  mov    %eax,-0x14(%rbp)
  lea    D80(%rip),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  shr    $0x3,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x14(%rbp),%edx
  mov    %edx,%ecx
  mov    $0xcccccccd,%eax
  imul   %rcx,%rax
  shr    $0x20,%rax
  mov    %eax,%ecx
  shr    $0x3,%ecx
  mov    %ecx,%eax
  shl    $0x2,%eax
  add    %ecx,%eax
  add    %eax,%eax
  sub    %eax,%edx
  mov    %edx,-0x14(%rbp)
  cmpl   $0x0,-0x10(%rbp)
  jne    L28
  mov    -0xc(%rbp),%eax
  mov    %eax,%eax
  imul   $0x51eb851f,%rax,%rax
  shr    $0x20,%rax
  shr    $0x5,%eax
  mov    %eax,%edx
  lea    D80(%rip),%rax
  movzbl (%rdx,%rax,1),%edx
  mov    -0x30(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x15(%rbp)
  cmpb   $0x20,-0x15(%rbp)
  je     L41
  lea    D1(%rip),%rax
  mov    %rax,-0x8(%rbp)
L41:
  mov    -0xc(%rbp),%eax
  mov    %eax,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  mov    %eax,%ecx
  shr    $0x3,%ecx
  mov    %ecx,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  mov    %eax,%edx
  shr    $0x3,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  mov    %edx,%edx
  mov    -0x8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  movzbl (%rax),%eax
  mov    %al,-0x15(%rbp)
  cmpb   $0x20,-0x15(%rbp)
  je     L2
  lea    D1(%rip),%rax
  mov    %rax,-0x8(%rbp)
L2:
  mov    -0xc(%rbp),%ecx
  mov    %ecx,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  mov    %eax,%edx
  shr    $0x3,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  mov    %edx,%edx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x30(%rbp),%rdx
  add    $0x2,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  mov    -0x30(%rbp),%rax
  lea    0x3(%rax),%rdx
  mov    -0x14(%rbp),%eax
  lea    D1(%rip),%rcx
  movzbl (%rax,%rcx,1),%eax
  mov    %al,(%rdx)
  jmp    L75
L28:
  cmpl   $0x9,-0xc(%rbp)
  jbe    L66
  mov    -0xc(%rbp),%eax
  mov    %eax,%eax
  imul   $0x51eb851f,%rax,%rax
  shr    $0x20,%rax
  shr    $0x5,%eax
  mov    %eax,%edx
  lea    D80(%rip),%rax
  movzbl (%rdx,%rax,1),%edx
  mov    -0x30(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x15(%rbp)
  cmpb   $0x20,-0x15(%rbp)
  je     L82
  lea    D1(%rip),%rax
  mov    %rax,-0x8(%rbp)
L82:
  mov    -0xc(%rbp),%edx
  mov    %edx,%ecx
  mov    $0xcccccccd,%eax
  imul   %rcx,%rax
  shr    $0x20,%rax
  mov    %eax,%ecx
  shr    $0x3,%ecx
  mov    %ecx,%eax
  shl    $0x2,%eax
  add    %ecx,%eax
  add    %eax,%eax
  sub    %eax,%edx
  mov    %edx,-0x14(%rbp)
  mov    -0xc(%rbp),%eax
  mov    %eax,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  shr    $0x3,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%ecx
  mov    %ecx,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  mov    %eax,%edx
  shr    $0x3,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  mov    %edx,%edx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x30(%rbp),%rdx
  add    $0x1,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  jmp    L42
L66:
  mov    -0xc(%rbp),%eax
  lea    D1(%rip),%rdx
  movzbl (%rax,%rdx,1),%edx
  mov    -0x30(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  movb   $0x2e,(%rax)
L42:
  mov    -0x30(%rbp),%rax
  lea    0x2(%rax),%rdx
  mov    -0x14(%rbp),%eax
  lea    D1(%rip),%rcx
  movzbl (%rax,%rcx,1),%eax
  mov    %al,(%rdx)
  mov    -0x10(%rbp),%edx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    -0x30(%rbp),%rdx
  add    $0x3,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
L75:
  mov    -0x30(%rbp),%rax
  add    $0x4,%rax
  pop    %rbp
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D80
type_guessed: string
name: retrieve_data
arguments: tag: D1
type_guessed: string

tool: D80:  123456789

tool: D1: 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;
}
```