user: What would the C source look like for the assembly code provided here:

```asm
<decimal_to_hex>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %rcx,-0x60(%rbp)
  cmpq   $0x0,-0x48(%rbp)
  je     L228
  cmpq   $0x0,-0x58(%rbp)
  je     L228
  cmpq   $0x4,-0x60(%rbp)
  ja     L99
L228:
  mov    $0x0,%eax
  jmp    L258
L99:
  mov    -0x58(%rbp),%rax
  movb   $0x30,(%rax)
  mov    -0x58(%rbp),%rax
  add    $0x1,%rax
  movb   $0x78,(%rax)
  mov    -0x58(%rbp),%rax
  add    $0x2,%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x60(%rbp),%rax
  sub    $0x3,%rax
  mov    %rax,-0x20(%rbp)
  movq   $0x0,-0x38(%rbp)
  jmp    L82
L60:
  mov    -0x28(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  addq   $0x1,-0x38(%rbp)
L82:
  mov    -0x38(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  jb     L60
  movq   $0x0,-0x38(%rbp)
  jmp    L153
L162:
  mov    -0x48(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L201
  mov    -0x48(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L193
L201:
  mov    -0x58(%rbp),%rax
  movb   $0x0,(%rax)
  mov    $0x0,%eax
  jmp    L258
L193:
  movq   $0x0,-0x30(%rbp)
  jmp    L140
L136:
  mov    -0x20(%rbp),%rax
  sub    -0x30(%rbp),%rax
  sub    $0x1,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x28(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%ecx
  mov    -0x28(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    %ecx,%eax
  shl    $0x2,%eax
  add    %ecx,%eax
  add    %eax,%eax
  mov    %al,(%rdx)
  addq   $0x1,-0x30(%rbp)
L140:
  mov    -0x30(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  jb     L136
  mov    -0x20(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x48(%rbp),%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  add    %eax,%edx
  mov    -0x20(%rbp),%rax
  lea    -0x1(%rax),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  sub    $0x30,%edx
  mov    %dl,(%rax)
  movq   $0x0,-0x30(%rbp)
  jmp    L22
L196:
  mov    -0x20(%rbp),%rax
  sub    -0x30(%rbp),%rax
  sub    $0x1,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x28(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xf,%al
  jbe    L105
  mov    -0x18(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x28(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  shr    $0x4,%al
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    -0x1(%rax),%rsi
  mov    -0x28(%rbp),%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x28(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x28(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  and    $0xf,%edx
  mov    %dl,(%rax)
L105:
  addq   $0x1,-0x30(%rbp)
L22:
  mov    -0x30(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  jb     L196
  addq   $0x1,-0x38(%rbp)
L153:
  mov    -0x38(%rbp),%rax
  cmp    -0x50(%rbp),%rax
  jae    L78
  mov    -0x48(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L162
L78:
  movq   $0x0,-0x30(%rbp)
  jmp    L56
L11:
  mov    -0x30(%rbp),%rax
  lea    0x2(%rax),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    -0x28(%rbp),%rcx
  mov    -0x30(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    %eax,%edi
  call   <nibble_to_hex@plt>
  mov    %al,(%rbx)
  addq   $0x1,-0x30(%rbp)
L56:
  mov    -0x30(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  jb     L11
  movq   $0x0,-0x30(%rbp)
  jmp    L55
L167:
  addq   $0x1,-0x30(%rbp)
L55:
  mov    -0x30(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  jae    L69
  mov    -0x28(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  je     L167
L69:
  mov    -0x30(%rbp),%rax
  and    $0x1,%eax
  test   %rax,%rax
  jne    L116
  subq   $0x1,-0x30(%rbp)
L116:
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  cmp    %rax,-0x20(%rbp)
  jbe    L267
  movb   $0x0,-0x39(%rbp)
  mov    -0x28(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <hex_to_nibble@plt>
  shl    $0x4,%eax
  mov    %al,-0x39(%rbp)
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <hex_to_nibble@plt>
  add    %al,-0x39(%rbp)
  movzbl -0x39(%rbp),%eax
  test   %al,%al
  jns    L267
  subq   $0x2,-0x30(%rbp)
L267:
  movq   $0x0,-0x38(%rbp)
  jmp    L0
L249:
  mov    -0x38(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x28(%rbp),%rcx
  mov    -0x38(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addq   $0x1,-0x38(%rbp)
L0:
  mov    -0x20(%rbp),%rax
  sub    -0x30(%rbp),%rax
  cmp    %rax,-0x38(%rbp)
  jb     L249
  mov    -0x60(%rbp),%rax
  sub    -0x30(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x58(%rbp),%rax
L258:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
char *decimal_to_hex(const char *dec_str, size_t dec_len, char *buf, size_t buf_len) {
  size_t i, j, k, hex_len;
  unsigned char *hex_buf, byte;
  if (dec_str == 0 || buf == 0 || buf_len < 5) {
    return NULL;
  }
  buf[0] = '0';
  buf[1] = 'x';
  hex_buf = (unsigned char *)buf + 2;
  hex_len = buf_len - 3;
  for (i = 0; i < hex_len; ++i) {
    hex_buf[i] = '\0';
  }
  for (i = 0; i < dec_len && dec_str[i] != '\0'; ++i) {
    if (dec_str[i] < '0' || dec_str[i] > '9') {
      buf[0] = '\0';
      return NULL;
    }
    for (j = 0; j < hex_len; ++j) {
      k = hex_len - 1 - j;
      hex_buf[k] *= 10;
    }
    hex_buf[hex_len - 1] += (dec_str[i] - '0');
    for (j = 0; j < hex_len; ++j) {
      k = hex_len - 1 - j;
      if (hex_buf[k] >= 16) {
        hex_buf[k - 1] += (hex_buf[k] / 16);
        hex_buf[k] = (hex_buf[k] % 16);
      }
    }
  }
  for (j = 0; j < hex_len; ++j) {
    hex_buf[j] = nibble_to_hex(buf[2 + j]);
  }
  for (j = 0; j < hex_len && hex_buf[j] == '0'; ++j) {
    ;
  }
  if (j % 2 == 0) {
    j -= 1;
  }
  if (j + 1 < hex_len) {
    byte = 0;
    byte = hex_to_nibble(hex_buf[j]) << 4;
    byte += hex_to_nibble(hex_buf[j + 1]);
    if (byte > 0x7F) {
      j -= 2;
    }
  }
  for (i = 0; i < (hex_len - j); ++i) {
    hex_buf[i] = hex_buf[i + j];
  }
  buf[buf_len - 1 - j] = '\0';
  return buf;
}
```