user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<ui32tostr>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r12
  mov    %rsi,%rbp
  mov    %edx,%ebx
  mov    %ecx,%r13d
  cmp    $0x3b9aca00,%edx
  seta   %dil
  movzbl %dil,%edi
  mov    $0x0,%esi
  call   <__builtin_expect@plt>
  mov    %rax,%rdx
  mov    $0x0,%eax
  test   %rdx,%rdx
  jne    L23
  movslq %r13d,%rax
  cmp    %rbp,%rax
  cmovbe %rax,%rbp
  cmp    $0x9,%rbp
  ja     L3
  lea    D9(%rip),%rcx
  movslq (%rcx,%rbp,4),%rdx
  add    %rcx,%rdx
  notrack jmp *%rdx
  mov    %ebx,%edx
  imul   $0x55e63b89,%rdx,%rcx
  shr    $0x39,%rcx
  mov    %ecx,%edi
  mov    $0xcccccccd,%esi
  imul   %rsi,%rdi
  shr    $0x23,%rdi
  lea    (%rdi,%rdi,4),%edi
  add    %edi,%edi
  sub    %edi,%ecx
  xor    $0x30,%ecx
  mov    %cl,-0x9(%r12,%rax,1)
  imul   $0x6b5fca6b,%rdx,%rcx
  shr    $0x36,%rcx
  mov    %ecx,%edi
  imul   %rsi,%rdi
  shr    $0x23,%rdi
  lea    (%rdi,%rdi,4),%edi
  add    %edi,%edi
  sub    %edi,%ecx
  xor    $0x30,%ecx
  mov    %cl,-0x8(%r12,%rax,1)
  imul   $0x431bde83,%rdx,%rdx
  shr    $0x32,%rdx
  mov    %edx,%ecx
  imul   %rsi,%rcx
  shr    $0x23,%rcx
  lea    (%rcx,%rcx,4),%ecx
  add    %ecx,%ecx
  sub    %ecx,%edx
  xor    $0x30,%edx
  mov    %dl,-0x7(%r12,%rax,1)
  mov    %ebx,%edx
  shr    $0x5,%edx
  mov    %edx,%edx
  imul   $0xa7c5ac5,%rdx,%rdx
  shr    $0x27,%rdx
  mov    %edx,%ecx
  mov    $0xcccccccd,%esi
  imul   %rsi,%rcx
  shr    $0x23,%rcx
  lea    (%rcx,%rcx,4),%ecx
  add    %ecx,%ecx
  sub    %ecx,%edx
  xor    $0x30,%edx
  mov    %dl,-0x6(%r12,%rax,1)
  mov    %ebx,%edx
  mov    $0xd1b71759,%ecx
  imul   %rcx,%rdx
  shr    $0x2d,%rdx
  mov    %edx,%ecx
  imul   %rsi,%rcx
  shr    $0x23,%rcx
  lea    (%rcx,%rcx,4),%ecx
  add    %ecx,%ecx
  sub    %ecx,%edx
  xor    $0x30,%edx
  mov    %dl,-0x5(%r12,%rax,1)
  mov    %ebx,%edx
  imul   $0x10624dd3,%rdx,%rdx
  shr    $0x26,%rdx
  mov    %edx,%ecx
  mov    $0xcccccccd,%esi
  imul   %rsi,%rcx
  shr    $0x23,%rcx
  lea    (%rcx,%rcx,4),%ecx
  add    %ecx,%ecx
  sub    %ecx,%edx
  xor    $0x30,%edx
  mov    %dl,-0x4(%r12,%rax,1)
  mov    %ebx,%edx
  imul   $0x51eb851f,%rdx,%rdx
  shr    $0x25,%rdx
  mov    %edx,%ecx
  mov    $0xcccccccd,%esi
  imul   %rsi,%rcx
  shr    $0x23,%rcx
  lea    (%rcx,%rcx,4),%ecx
  add    %ecx,%ecx
  sub    %ecx,%edx
  xor    $0x30,%edx
  mov    %dl,-0x3(%r12,%rax,1)
  mov    %ebx,%edx
  mov    $0xcccccccd,%esi
  imul   %rsi,%rdx
  shr    $0x23,%rdx
  mov    %edx,%ecx
  imul   %rsi,%rcx
  shr    $0x23,%rcx
  lea    (%rcx,%rcx,4),%ecx
  add    %ecx,%ecx
  sub    %ecx,%edx
  xor    $0x30,%edx
  mov    %dl,-0x2(%r12,%rax,1)
  mov    %ebx,%edx
  mov    $0xcccccccd,%ecx
  imul   %rcx,%rdx
  shr    $0x23,%rdx
  lea    (%rdx,%rdx,4),%edx
  add    %edx,%edx
  sub    %edx,%ebx
  xor    $0x30,%ebx
  mov    %bl,-0x1(%r12,%rax,1)
L23:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L3:
  mov    $0x0,%eax
  jmp    L23
```

assistant: ```c
size_t ui32tostr(char *restrict buf, size_t bsz, uint32_t d, int width) {
  size_t res;
  if (__builtin_expect((d > 1000000000U), 0)) {
    return 0U;
  }
  switch ((res = (size_t)width) < bsz ? res : bsz) {
  case 9:
    buf[width - 9] = (char)(((d) / (100000000) % 10) ^ '0');
    buf[width - 8] = (char)(((d) / (10000000) % 10) ^ '0');
    buf[width - 7] = (char)(((d) / (1000000) % 10) ^ '0');
  case 6:
    buf[width - 6] = (char)(((d) / (100000) % 10) ^ '0');
    buf[width - 5] = (char)(((d) / (10000) % 10) ^ '0');
  case 4:
    buf[width - 4] = (char)(((d) / (1000) % 10) ^ '0');
  case 3:
    buf[width - 3] = (char)(((d) / (100) % 10) ^ '0');
  case 2:
    buf[width - 2] = (char)(((d) / (10) % 10) ^ '0');
  case 1:
    buf[width - 1] = (char)(((d) / (1) % 10) ^ '0');
    break;
  default:
  case 0:
    res = 0U;
    break;
  }
  return res;
}
```