user: Converte this assembly snippet into its equivalent C code:

```asm
<sprint_hinted_integer>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x150,%rsp
  mov    %rdi,-0x138(%rbp)
  mov    %rsi,-0x140(%rbp)
  mov    %rdx,-0x148(%rbp)
  mov    %rcx,-0x150(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x148(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x125(%rbp)
  mov    -0x148(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L115
  mov    -0x148(%rbp),%rax
  add    $0x2,%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x124(%rbp)
  jmp    L35
L115:
  movl   $0x0,-0x124(%rbp)
L35:
  movb   $0x25,-0x11a(%rbp)
  movb   $0x6c,-0x119(%rbp)
  movzbl -0x125(%rbp),%eax
  mov    %al,-0x118(%rbp)
  movb   $0x0,-0x117(%rbp)
  mov    -0x140(%rbp),%rdx
  lea    -0x11a(%rbp),%rcx
  lea    -0x110(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  cmpl   $0x0,-0x124(%rbp)
  je     L32
  lea    -0x110(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x120(%rbp)
  mov    -0x124(%rbp),%eax
  cmp    -0x120(%rbp),%eax
  jg     L104
  mov    -0x120(%rbp),%eax
  add    $0x1,%eax
  cltq
  movb   $0x0,-0x110(%rbp,%rax,1)
  jmp    L110
L92:
  mov    -0x120(%rbp),%eax
  sub    $0x1,%eax
  cltq
  movzbl -0x110(%rbp,%rax,1),%edx
  mov    -0x120(%rbp),%eax
  cltq
  mov    %dl,-0x110(%rbp,%rax,1)
  subl   $0x1,-0x120(%rbp)
L110:
  mov    -0x124(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x124(%rbp)
  test   %eax,%eax
  jne    L92
  mov    -0x120(%rbp),%eax
  cltq
  movb   $0x2e,-0x110(%rbp,%rax,1)
  jmp    L32
L104:
  mov    -0x124(%rbp),%eax
  add    $0x1,%eax
  cltq
  movb   $0x0,-0x110(%rbp,%rax,1)
  jmp    L14
L47:
  mov    -0x120(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x120(%rbp)
  test   %eax,%eax
  jle    L12
  mov    -0x120(%rbp),%eax
  cltq
  movzbl -0x110(%rbp,%rax,1),%edx
  mov    -0x124(%rbp),%eax
  cltq
  mov    %dl,-0x110(%rbp,%rax,1)
  jmp    L84
L12:
  mov    -0x124(%rbp),%eax
  cltq
  movb   $0x30,-0x110(%rbp,%rax,1)
L84:
  subl   $0x1,-0x124(%rbp)
L14:
  cmpl   $0x0,-0x124(%rbp)
  jne    L47
  movb   $0x2e,-0x110(%rbp)
L32:
  lea    -0x110(%rbp),%rdx
  mov    -0x138(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L10
  call   <__stack_chk_fail@plt>
L10:
  leave
  ret
```

assistant: ```c
void sprint_hinted_integer(char *buf, long val, const char *hint, const char *units) {
  char code;
  int shift, len;
  char tmp[256];
  char fmt[10];
  code = hint[0];
  if (hint[1] == '-') {
    shift = atoi(hint + 2);
  } else
    shift = 0;
  fmt[0] = '%';
  fmt[1] = 'l';
  fmt[2] = code;
  fmt[3] = 0;
  sprintf(tmp, fmt, val);
  if (shift != 0) {
    len = strlen(tmp);
    if (shift <= len) {
      tmp[len + 1] = 0;
      while (shift--) {
        tmp[len] = tmp[len - 1];
        len--;
      }
      tmp[len] = '.';
    } else {
      tmp[shift + 1] = 0;
      while (shift) {
        if (len-- > 0)
          tmp[shift] = tmp[len];
        else
          tmp[shift] = '0';
        shift--;
      }
      tmp[0] = '.';
    }
  }
  strcpy(buf, tmp);
}
```