user: 请从给定的汇编指令推导出C源代码:

```asm
<format_unsigned>:
  endbr64
  push   %r12
  mov    %edx,%eax
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rdx
  mov    %rdx,0x18(%rsp)
  xor    %edx,%edx
  test   %eax,%eax
  je     L141
  mov    %eax,%edx
  mov    $0xcccccccd,%esi
  mov    %eax,%r8d
  imul   %rsi,%rdx
  shr    $0x23,%rdx
  lea    (%rdx,%rdx,4),%ecx
  add    %ecx,%ecx
  sub    %ecx,%r8d
  add    $0x30,%r8d
  cmp    $0x9,%eax
  jbe    L94
  mov    %edx,%ecx
  imul   %rsi,%rcx
  shr    $0x23,%rcx
  lea    (%rcx,%rcx,4),%r9d
  add    %r9d,%r9d
  sub    %r9d,%edx
  add    $0x30,%edx
  mov    %dl,0x1(%rsp)
  cmp    $0x63,%eax
  jbe    L162
  mov    %ecx,%edx
  imul   %rsi,%rdx
  shr    $0x23,%rdx
  lea    (%rdx,%rdx,4),%r9d
  add    %r9d,%r9d
  sub    %r9d,%ecx
  add    $0x30,%ecx
  mov    %cl,0x2(%rsp)
  cmp    $0x3e7,%eax
  jbe    L122
  mov    %edx,%ecx
  imul   %rsi,%rcx
  shr    $0x23,%rcx
  lea    (%rcx,%rcx,4),%r9d
  add    %r9d,%r9d
  sub    %r9d,%edx
  add    $0x30,%edx
  mov    %dl,0x3(%rsp)
  cmp    $0x270f,%eax
  jbe    L48
  mov    %ecx,%edx
  imul   %rsi,%rdx
  shr    $0x23,%rdx
  lea    (%rdx,%rdx,4),%r9d
  add    %r9d,%r9d
  sub    %r9d,%ecx
  add    $0x30,%ecx
  mov    %cl,0x4(%rsp)
  cmp    $0x1869f,%eax
  jbe    L13
  mov    %edx,%ecx
  imul   %rsi,%rcx
  shr    $0x23,%rcx
  lea    (%rcx,%rcx,4),%r9d
  add    %r9d,%r9d
  sub    %r9d,%edx
  add    $0x30,%edx
  mov    %dl,0x5(%rsp)
  cmp    $0xf423f,%eax
  jbe    L145
  mov    %ecx,%edx
  imul   %rsi,%rdx
  shr    $0x23,%rdx
  lea    (%rdx,%rdx,4),%r9d
  add    %r9d,%r9d
  sub    %r9d,%ecx
  add    $0x30,%ecx
  mov    %cl,0x6(%rsp)
  cmp    $0x98967f,%eax
  jbe    L27
  mov    %edx,%ecx
  imul   %rsi,%rcx
  shr    $0x23,%rcx
  lea    (%rcx,%rcx,4),%r9d
  add    %r9d,%r9d
  sub    %r9d,%edx
  add    $0x30,%edx
  mov    %dl,0x7(%rsp)
  cmp    $0x5f5e0ff,%eax
  jbe    L156
  mov    %ecx,%edx
  imul   %rsi,%rdx
  shr    $0x23,%rdx
  lea    (%rdx,%rdx,4),%esi
  add    %esi,%esi
  sub    %esi,%ecx
  add    $0x30,%ecx
  mov    %cl,0x8(%rsp)
  cmp    $0x3b9ac9ff,%eax
  jbe    L181
  add    $0x30,%edx
  mov    $0xa,%ebx
  mov    %dl,0x9(%rsp)
L110:
  mov    %r8b,(%rsp)
  lea    -0x1(%rsp),%r12
L193:
  movsbl (%r12,%rbx,1),%edx
  mov    %rbp,%rsi
  sub    $0x1,%rbx
  call   <format_char@plt>
  mov    %rax,%rdi
  test   %ebx,%ebx
  jne    L193
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L115
  add    $0x20,%rsp
  mov    %rdi,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L141:
  mov    $0x30,%r8d
L94:
  mov    $0x1,%ebx
  jmp    L110
L13:
  mov    $0x5,%ebx
  jmp    L110
L162:
  mov    $0x2,%ebx
  jmp    L110
L122:
  mov    $0x3,%ebx
  jmp    L110
L48:
  mov    $0x4,%ebx
  jmp    L110
L145:
  mov    $0x6,%ebx
  jmp    L110
L27:
  mov    $0x7,%ebx
  jmp    L110
L156:
  mov    $0x8,%ebx
  jmp    L110
L181:
  mov    $0x9,%ebx
  jmp    L110
L115:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char *format_unsigned(char *buf, char *end, unsigned val) {
  char temp[16];
  int nn;
  for (nn = 0; val != 0; nn++) {
    int rem = val % 10;
    temp[nn] = '0' + rem;
    val /= 10;
  }
  if (nn == 0)
    temp[nn++] = '0';
  while (nn > 0)
    buf = format_char(buf, end, temp[--nn]);
  return buf;
}
```