user: Demonstrate the C code that generates the assembly output below:

```asm
<_to_hex>:
  endbr64
  mov    %edx,%r9d
  test   %ecx,%ecx
  mov    %ecx,%edx
  mov    $0x1,%eax
  cmovs  %eax,%edx
  test   %r9d,%r9d
  jne    L231
  movb   $0x0,(%rdi)
  mov    %rdi,%rax
  mov    %esi,%ecx
  cmp    $0x58,%r8d
  je     L28
L387:
  shr    $0x1c,%ecx
  jne    L11
  cmp    $0x7,%edx
  jg     L11
  mov    %esi,%ecx
  sar    $0x18,%ecx
  and    $0xf,%ecx
  cmp    $0x6,%edx
  jg     L298
  test   %ecx,%ecx
  jne    L298
  mov    %esi,%ecx
  sar    $0x14,%ecx
  and    $0xf,%ecx
  cmp    $0x5,%edx
  jg     L196
  test   %ecx,%ecx
  jne    L196
  mov    %esi,%ecx
  sar    $0x10,%ecx
  and    $0xf,%ecx
  cmp    $0x4,%edx
  jg     L148
  test   %ecx,%ecx
  jne    L148
  mov    %esi,%ecx
  sar    $0xc,%ecx
  and    $0xf,%ecx
  cmp    $0x3,%edx
  jg     L178
  test   %ecx,%ecx
  jne    L178
  mov    %esi,%ecx
  sar    $0x8,%ecx
  and    $0xf,%ecx
  cmp    $0x2,%edx
  jg     L424
  test   %ecx,%ecx
  jne    L424
  mov    %esi,%ecx
  sar    $0x4,%ecx
  and    $0xf,%ecx
  cmp    $0x1,%edx
  jg     L353
  test   %ecx,%ecx
  jne    L353
  and    $0xf,%esi
  jne    L317
  test   %edx,%edx
  jg     L317
L252:
  movb   $0x0,(%rax)
  sub    %edi,%eax
  ret
  nopl   (%rax)
L231:
  mov    $0x78,%ecx
  cmp    $0x58,%r8d
  mov    $0x58,%eax
  movb   $0x30,(%rdi)
  cmovne %ecx,%eax
  mov    %esi,%ecx
  mov    %al,0x1(%rdi)
  lea    0x2(%rdi),%rax
  cmp    $0x58,%r8d
  jne    L387
L28:
  shr    $0x1c,%ecx
  cmp    $0x7,%edx
  jg     L67
  test   %ecx,%ecx
  jne    L67
  mov    %esi,%ecx
  sar    $0x18,%ecx
  and    $0xf,%ecx
  cmp    $0x6,%edx
  jg     L128
  test   %ecx,%ecx
  jne    L128
  mov    %esi,%ecx
  sar    $0x14,%ecx
  and    $0xf,%ecx
  cmp    $0x5,%edx
  jg     L87
  test   %ecx,%ecx
  jne    L87
  mov    %esi,%ecx
  sar    $0x10,%ecx
  and    $0xf,%ecx
  cmp    $0x4,%edx
  jg     L346
  test   %ecx,%ecx
  jne    L346
  mov    %esi,%ecx
  sar    $0xc,%ecx
  and    $0xf,%ecx
  cmp    $0x3,%edx
  jg     L320
  test   %ecx,%ecx
  jne    L320
  mov    %esi,%ecx
  sar    $0x8,%ecx
  and    $0xf,%ecx
  cmp    $0x2,%edx
  jg     L384
  test   %ecx,%ecx
  jne    L384
  mov    %esi,%ecx
  sar    $0x4,%ecx
  and    $0xf,%ecx
  cmp    $0x1,%edx
  jg     L243
  test   %ecx,%ecx
  jne    L243
  and    $0xf,%esi
  test   %edx,%edx
  jg     L277
  test   %esi,%esi
  je     L252
L277:
  mov    %rax,%r8
  jmp    L74
  nopl   0x0(%rax,%rax,1)
L11:
  cmp    $0x9,%ecx
  lea    0x30(%rcx),%r9d
  lea    0x57(%rcx),%edx
  mov    %esi,%ecx
  cmovle %r9d,%edx
  sar    $0x18,%ecx
  lea    0x1(%rax),%r8
  and    $0xf,%ecx
  mov    %dl,(%rax)
L172:
  cmp    $0x9,%ecx
  lea    0x30(%rcx),%r9d
  lea    0x57(%rcx),%edx
  mov    %esi,%ecx
  cmovle %r9d,%edx
  sar    $0x14,%ecx
  lea    0x1(%r8),%rax
  and    $0xf,%ecx
  mov    %dl,(%r8)
L196:
  cmp    $0x9,%ecx
  lea    0x30(%rcx),%r9d
  lea    0x57(%rcx),%edx
  mov    %esi,%ecx
  cmovle %r9d,%edx
  sar    $0x10,%ecx
  lea    0x1(%rax),%r8
  and    $0xf,%ecx
  mov    %dl,(%rax)
L217:
  cmp    $0x9,%ecx
  lea    0x30(%rcx),%r9d
  lea    0x57(%rcx),%edx
  mov    %esi,%ecx
  cmovle %r9d,%edx
  sar    $0xc,%ecx
  lea    0x1(%r8),%rax
  and    $0xf,%ecx
  mov    %dl,(%r8)
L178:
  cmp    $0x9,%ecx
  lea    0x30(%rcx),%r9d
  lea    0x57(%rcx),%edx
  mov    %esi,%ecx
  cmovle %r9d,%edx
  sar    $0x8,%ecx
  lea    0x1(%rax),%r8
  and    $0xf,%ecx
  mov    %dl,(%rax)
L146:
  cmp    $0x9,%ecx
  lea    0x30(%rcx),%r9d
  lea    0x57(%rcx),%edx
  mov    %esi,%ecx
  cmovle %r9d,%edx
  sar    $0x4,%ecx
  lea    0x1(%r8),%rax
  and    $0xf,%ecx
  mov    %dl,(%r8)
L353:
  cmp    $0x9,%ecx
  lea    0x30(%rcx),%r9d
  lea    0x57(%rcx),%edx
  cmovle %r9d,%edx
  lea    0x1(%rax),%r8
  and    $0xf,%esi
  mov    %dl,(%rax)
L311:
  cmp    $0x9,%esi
  lea    0x30(%rsi),%ecx
  lea    0x57(%rsi),%edx
  cmovle %ecx,%edx
  lea    0x1(%r8),%rax
  mov    %dl,(%r8)
  movb   $0x0,(%rax)
  sub    %edi,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L67:
  cmp    $0x9,%ecx
  lea    0x30(%rcx),%r9d
  lea    0x37(%rcx),%edx
  mov    %esi,%ecx
  cmovle %r9d,%edx
  sar    $0x18,%ecx
  lea    0x1(%rax),%r8
  and    $0xf,%ecx
  mov    %dl,(%rax)
L190:
  cmp    $0x9,%ecx
  lea    0x30(%rcx),%r9d
  lea    0x37(%rcx),%edx
  mov    %esi,%ecx
  cmovle %r9d,%edx
  sar    $0x14,%ecx
  lea    0x1(%r8),%rax
  and    $0xf,%ecx
  mov    %dl,(%r8)
L87:
  cmp    $0x9,%ecx
  lea    0x30(%rcx),%r9d
  lea    0x37(%rcx),%edx
  mov    %esi,%ecx
  cmovle %r9d,%edx
  sar    $0x10,%ecx
  lea    0x1(%rax),%r8
  and    $0xf,%ecx
  mov    %dl,(%rax)
L174:
  cmp    $0x9,%ecx
  lea    0x30(%rcx),%r9d
  lea    0x37(%rcx),%edx
  mov    %esi,%ecx
  cmovle %r9d,%edx
  sar    $0xc,%ecx
  lea    0x1(%r8),%rax
  and    $0xf,%ecx
  mov    %dl,(%r8)
L320:
  cmp    $0x9,%ecx
  lea    0x30(%rcx),%r9d
  lea    0x37(%rcx),%edx
  mov    %esi,%ecx
  cmovle %r9d,%edx
  sar    $0x8,%ecx
  lea    0x1(%rax),%r8
  and    $0xf,%ecx
  mov    %dl,(%rax)
L203:
  cmp    $0x9,%ecx
  lea    0x30(%rcx),%r9d
  lea    0x37(%rcx),%edx
  mov    %esi,%ecx
  cmovle %r9d,%edx
  sar    $0x4,%ecx
  lea    0x1(%r8),%rax
  and    $0xf,%ecx
  mov    %dl,(%r8)
L243:
  cmp    $0x9,%ecx
  lea    0x30(%rcx),%r9d
  lea    0x37(%rcx),%edx
  cmovle %r9d,%edx
  lea    0x1(%rax),%r8
  and    $0xf,%esi
  mov    %dl,(%rax)
L74:
  cmp    $0xa,%esi
  lea    0x37(%rsi),%ecx
  lea    0x30(%rsi),%edx
  cmovge %ecx,%edx
  lea    0x1(%r8),%rax
  mov    %dl,(%r8)
  movb   $0x0,(%rax)
  sub    %edi,%eax
  ret
L128:
  mov    %rax,%r8
  jmp    L190
L384:
  mov    %rax,%r8
  jmp    L203
L346:
  mov    %rax,%r8
  jmp    L174
L317:
  mov    %rax,%r8
  jmp    L311
L424:
  mov    %rax,%r8
  jmp    L146
L148:
  mov    %rax,%r8
  jmp    L217
L298:
  mov    %rax,%r8
  jmp    L172
```

assistant: ```c
int _to_hex(char *buf, uint32_t value, int alt_form, int precision, int prefix) {
  register int i;
  register int temp;
  char *start = buf;
  if (precision < 0)
    precision = 1;
  *buf = '\0';
  if (alt_form) {
    buf[0] = '0';
    buf[1] = (prefix == 'X') ? 'X' : 'x';
    buf += 2;
  }
  for (i = 7; i >= 0; i--) {
    temp = (value >> (i * 4)) & 0xF;
    if ((precision > i) || (temp != 0)) {
      precision = i;
      if (temp < 10)
        *buf++ = (char)(temp + '0');
      else {
        if (prefix == 'X')
          *buf++ = (char)(temp - 10 + 'A');
        else
          *buf++ = (char)(temp - 10 + 'a');
      }
    }
  }
  *buf = 0;
  return buf - start;
}
```