user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<dec_to_hex>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  test   %edi,%edi
  jne    L112
  mov    $0x3030,%eax
  mov    $0x1,%ebx
  mov    %ax,(%rsp)
L102:
  movslq %ebx,%rbx
  mov    %rsp,%r12
  lea    D2(%rip),%rbp
  nopl   0x0(%rax,%rax,1)
L60:
  movsbl (%r12,%rbx,1),%esi
  mov    %rbp,%rdi
  sub    $0x1,%rbx
  call   <printf@plt>
  cmp    $0xffffffff,%ebx
  jne    L60
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L118
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L112:
  mov    %edi,%edx
  sar    $0x1f,%edx
  shr    $0x1c,%edx
  lea    (%rdi,%rdx,1),%eax
  and    $0xf,%eax
  sub    %edx,%eax
  lea    0x57(%rax),%ecx
  cmp    $0xa,%eax
  lea    0x30(%rax),%edx
  mov    %ecx,%eax
  cmovl  %edx,%eax
  test   %edi,%edi
  mov    %al,(%rsp)
  lea    0xf(%rdi),%eax
  cmovns %edi,%eax
  mov    %eax,%ebx
  sar    $0x4,%ebx
  je     L102
  sar    $0x1f,%eax
  shr    $0x1c,%eax
  lea    (%rbx,%rax,1),%edx
  and    $0xf,%edx
  sub    %eax,%edx
  lea    0x57(%rdx),%ecx
  cmp    $0xa,%edx
  lea    0x30(%rdx),%eax
  cmovge %ecx,%eax
  test   %ebx,%ebx
  mov    %al,0x1(%rsp)
  lea    0xf(%rbx),%eax
  cmovns %ebx,%eax
  mov    %eax,%ecx
  sar    $0x4,%ecx
  je     L123
  sar    $0x1f,%eax
  shr    $0x1c,%eax
  lea    (%rcx,%rax,1),%edx
  and    $0xf,%edx
  sub    %eax,%edx
  cmp    $0xa,%edx
  lea    0x57(%rdx),%esi
  lea    0x30(%rdx),%eax
  cmovge %esi,%eax
  test   %ecx,%ecx
  mov    %al,0x2(%rsp)
  lea    0xf(%rcx),%eax
  cmovns %ecx,%eax
  mov    %eax,%ecx
  sar    $0x4,%ecx
  je     L39
  sar    $0x1f,%eax
  shr    $0x1c,%eax
  lea    (%rcx,%rax,1),%edx
  and    $0xf,%edx
  sub    %eax,%edx
  cmp    $0xa,%edx
  lea    0x57(%rdx),%esi
  lea    0x30(%rdx),%eax
  cmovge %esi,%eax
  test   %ecx,%ecx
  mov    %al,0x3(%rsp)
  lea    0xf(%rcx),%eax
  cmovns %ecx,%eax
  mov    %eax,%ecx
  sar    $0x4,%ecx
  je     L58
  sar    $0x1f,%eax
  shr    $0x1c,%eax
  lea    (%rcx,%rax,1),%edx
  and    $0xf,%edx
  sub    %eax,%edx
  cmp    $0xa,%edx
  lea    0x57(%rdx),%esi
  lea    0x30(%rdx),%eax
  cmovge %esi,%eax
  test   %ecx,%ecx
  mov    %al,0x4(%rsp)
  lea    0xf(%rcx),%eax
  cmovns %ecx,%eax
  mov    %eax,%ecx
  sar    $0x4,%ecx
  je     L142
  sar    $0x1f,%eax
  shr    $0x1c,%eax
  lea    (%rcx,%rax,1),%edx
  and    $0xf,%edx
  sub    %eax,%edx
  cmp    $0xa,%edx
  lea    0x57(%rdx),%esi
  lea    0x30(%rdx),%eax
  cmovge %esi,%eax
  test   %ecx,%ecx
  mov    %al,0x5(%rsp)
  lea    0xf(%rcx),%eax
  cmovns %ecx,%eax
  mov    %eax,%edx
  sar    $0x4,%edx
  je     L105
  sar    $0x1f,%eax
  mov    $0x6,%ebx
  shr    $0x1c,%eax
  add    %eax,%edx
  and    $0xf,%edx
  sub    %eax,%edx
  lea    0x30(%rdx),%ecx
  lea    0x57(%rdx),%eax
  cmp    $0x9,%edx
  cmovle %ecx,%eax
  mov    %al,0x6(%rsp)
  jmp    L102
L123:
  mov    $0x1,%ebx
  jmp    L102
L39:
  mov    $0x2,%ebx
  jmp    L102
L105:
  mov    $0x5,%ebx
  jmp    L102
L58:
  mov    $0x3,%ebx
  jmp    L102
L142:
  mov    $0x4,%ebx
  jmp    L102
L118:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D2
type_guessed: string

tool: D2: %c

assistant: ```c
void dec_to_hex(int color) {
  char output[7];
  int temp, count, i;
  count = 0;
  if (color == 0) {
    for (count = 0; count < 2; count++)
      output[count] = '0';
  } else
    while (color != 0) {
      temp = color % 16;
      if (temp < 10) {
        temp += '0';
      } else {
        temp += 87;
      }
      output[count] = temp;
      color /= 16;
      count++;
    }
  for (i = count - 1; i >= 0; i--) {
    printf("%c", output[i]);
  }
}
```