user: 下面的汇编指令对应的C源代码是什么：

```asm
<decimal_to_hex>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdx,%rbp
  test   %rdx,%rdx
  sete   %al
  cmp    $0x4,%rcx
  setbe  %dl
  or     %dl,%al
  jne    L149
  mov    %rdi,%r9
  mov    %rsi,%r11
  mov    %rcx,%r13
  test   %rdi,%rdi
  je     L149
  movb   $0x30,0x0(%rbp)
  movb   $0x78,0x1(%rbp)
  lea    0x2(%rbp),%r12
  lea    -0x3(%rcx),%rbx
  mov    $0x0,%eax
L115:
  movb   $0x0,0x2(%rbp,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rbx
  ja     L115
  mov    %r9,%rdi
  add    %r11,%r9
  lea    -0x2(%r13),%r10
  lea    0x0(%rbp,%r10,1),%rsi
  lea    -0x4(%r12,%r13,1),%r8
  test   %r11,%r11
  jne    L118
L156:
  mov    $0x0,%r14d
L146:
  movsbl 0x2(%rbp,%r14,1),%edi
  call   <nibble_to_hex@plt>
  mov    %al,0x2(%rbp,%r14,1)
  add    $0x1,%r14
  cmp    %r14,%rbx
  ja     L146
  mov    $0x0,%r14d
L23:
  cmpb   $0x30,0x2(%rbp,%r14,1)
  jne    L151
  add    $0x1,%r14
  cmp    %r14,%rbx
  ja     L23
L151:
  mov    %r14,%rax
  and    $0x1,%eax
  cmp    $0x1,%rax
  sbb    $0x0,%r14
  lea    0x1(%r14),%rax
  cmp    %rbx,%rax
  jb     L190
L59:
  sub    %r14,%rbx
  je     L102
  lea    0x2(%rbp,%rbx,1),%rdx
L107:
  movzbl (%r12,%r14,1),%eax
  mov    %al,(%r12)
  add    $0x1,%r12
  cmp    %rdx,%r12
  jne    L107
L102:
  sub    $0x1,%r13
  sub    %r14,%r13
  movb   $0x0,0x0(%rbp,%r13,1)
  mov    %rbp,%rax
L161:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L42:
  movb   $0x0,0x0(%rbp)
  mov    $0x0,%eax
  jmp    L161
L73:
  sub    $0x1,%rdx
  mov    %rsi,%rax
  sub    %rdx,%rax
  cmp    %rbx,%rax
  jae    L41
L144:
  movzbl (%rdx),%eax
  cmp    $0xf,%al
  jbe    L73
  mov    %eax,%ecx
  shr    $0x4,%cl
  add    %cl,-0x1(%rdx)
  and    $0xf,%eax
  mov    %al,(%rdx)
  jmp    L73
L41:
  add    $0x1,%rdi
  cmp    %r9,%rdi
  je     L156
L118:
  mov    %rdi,%r11
  movzbl (%rdi),%eax
  test   %al,%al
  je     L156
  sub    $0x30,%eax
  cmp    $0x9,%al
  ja     L42
  lea    0x0(%rbp,%r10,1),%rdx
  mov    %rdx,%rcx
L162:
  movzbl (%rcx),%eax
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  mov    %al,(%rcx)
  sub    $0x1,%rcx
  mov    %rsi,%rax
  sub    %rcx,%rax
  cmp    %rax,%rbx
  ja     L162
  movzbl (%r8),%eax
  movzbl (%r11),%ecx
  lea    -0x30(%rax,%rcx,1),%eax
  mov    %al,(%r8)
  jmp    L144
L190:
  movzbl 0x2(%rbp,%r14,1),%edi
  call   <hex_to_nibble@plt>
  shl    $0x4,%eax
  mov    %eax,%r15d
  movzbl 0x1(%r12,%r14,1),%edi
  call   <hex_to_nibble@plt>
  lea    -0x2(%r14),%rdx
  add    %r15b,%al
  cmovs  %rdx,%r14
  jmp    L59
L149:
  mov    $0x0,%eax
  jmp    L161
```

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;
}
```