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

```asm
<smart_ulltoa4>:
  endbr64
  mov    %rsi,%rax
  cmp    $0x270f,%rdi
  jbe    L16
  mov    %rdx,%r9
  lea    (%rdi,%rdi,4),%rdx
  xor    %ecx,%ecx
  add    %rdx,%rdx
L10:
  mov    %rdx,%rsi
  add    $0x1,%ecx
  shr    $0xa,%rdx
  cmp    $0x9c3fff,%rsi
  ja     L10
  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     L18
  cmp    $0x63,%edx
  jbe    L13
  imul   $0x10624dd3,%r10,%r10
  lea    D40(%rip),%rdx
  push   %rbx
  mov    $0xcccccccd,%ebx
  lea    D35(%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)
L16:
  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
L18:
  imul   $0x10624dd3,%rsi,%rsi
  lea    D40(%rip),%rdx
  mov    $0xcccccccd,%r10d
  shr    $0x26,%rsi
  movzbl (%rdx,%rsi,1),%ecx
  lea    D35(%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
L13:
  lea    D35(%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: disassemble_data
arguments: tag: D40
datatype: string
name: disassemble_data
arguments: tag: D35
datatype: string

tool: D40:  123456789

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