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

```asm
<hex_to_dec>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  movl   $0x1,-0x8(%rbp)
  lea    D29(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x4(%rbp)
  jmp    L37
L126:
  movl   $0x0,-0xc(%rbp)
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x60,%al
  jle    L13
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x7a,%al
  jg     L13
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x57,%eax
  add    %eax,-0xc(%rbp)
  jmp    L36
L13:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L36
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jg     L36
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  add    %eax,-0xc(%rbp)
L36:
  shll   $0x4,-0xc(%rbp)
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x60,%al
  jle    L12
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x7a,%al
  jg     L12
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x57,%eax
  add    %eax,-0xc(%rbp)
  jmp    L30
L12:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L30
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jg     L30
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  add    %eax,-0xc(%rbp)
L30:
  cmpl   $0x2,-0x4(%rbp)
  je     L106
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L58
L106:
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L58:
  addl   $0x1,-0x4(%rbp)
  addl   $0x2,-0x8(%rbp)
L37:
  cmpl   $0x2,-0x4(%rbp)
  jle    L126
  nop
  nop
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_label: D29
datatype: string
name: parse_data
arguments: data_label: D12
datatype: string
name: parse_data
arguments: data_label: D15
datatype: string

tool: D29: rgb(

tool: D12: %d, 

tool: D15: %d)

assistant: ```c
void hex_to_dec(char *colour) {
  int number, j = 1;
  printf("rgb(");
  for (int i = 0; i < 3; i++, j = j + 2) {
    number = 0;
    if (colour[j] >= 'a' && colour[j] <= 'z')
      number = number + (colour[j] - 87);
    else if (colour[j] >= '0' && colour[j] <= '9')
      number = number + (colour[j] - '0');
    number = number * 16;
    if (colour[j + 1] >= 'a' && colour[j + 1] <= 'z')
      number = number + (colour[j + 1] - 87);
    else if (colour[j + 1] >= '0' && colour[j + 1] <= '9')
      number = number + (colour[j + 1] - '0');
    if (i != 2)
      printf("%d, ", number);
    else
      printf("%d)", number);
  }
}
```