user: 请将以下的汇编代码转换成C语言代码：

```asm
<__format_uint>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x44(%rbp)
  mov    %esi,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D38(%rip),%rax
  mov    %rax,-0x30(%rbp)
  lea    D52(%rip),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x48(%rbp),%eax
  and    $0x20,%eax
  test   %eax,%eax
  je     L125
  movl   $0x8,-0x3c(%rbp)
  jmp    L95
L125:
  mov    -0x48(%rbp),%eax
  and    $0x40,%eax
  test   %eax,%eax
  je     L128
  movl   $0x10,-0x3c(%rbp)
  jmp    L95
L128:
  movl   $0xa,-0x3c(%rbp)
L95:
  cmpl   $0x0,-0x44(%rbp)
  jne    L88
  lea    D58(%rip),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  jmp    L189
L88:
  mov    -0x48(%rbp),%eax
  and    $0x10,%eax
  test   %eax,%eax
  je     L68
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  jmp    L0
L68:
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x38(%rbp)
L0:
  movb   $0x0,-0x11(%rbp)
  movl   $0xe,-0x40(%rbp)
  jmp    L51
L53:
  cmpl   $0x0,-0x44(%rbp)
  je     L3
  mov    -0x3c(%rbp),%ecx
  mov    -0x44(%rbp),%eax
  mov    $0x0,%edx
  div    %ecx
  mov    %edx,%eax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x40(%rbp),%eax
  cltq
  mov    %dl,-0x20(%rbp,%rax,1)
  mov    -0x3c(%rbp),%esi
  mov    -0x44(%rbp),%eax
  mov    $0x0,%edx
  div    %esi
  mov    %eax,-0x44(%rbp)
  subl   $0x1,-0x40(%rbp)
L51:
  cmpl   $0x0,-0x40(%rbp)
  jns    L53
  jmp    L15
L3:
  nop
L15:
  mov    -0x48(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L118
  mov    -0x40(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x40(%rbp)
  cltq
  movb   $0x2b,-0x20(%rbp,%rax,1)
L118:
  addl   $0x1,-0x40(%rbp)
  mov    -0x48(%rbp),%eax
  and    $0x4,%eax
  test   %eax,%eax
  je     L5
  mov    -0x48(%rbp),%eax
  and    $0x20,%eax
  test   %eax,%eax
  je     L155
  lea    -0x20(%rbp),%rdx
  mov    -0x40(%rbp),%eax
  cltq
  add    %rdx,%rax
  mov    $0x0,%edx
  mov    %rax,%rsi
  lea    D58(%rip),%rax
  mov    %rax,%rdi
  call   <strvcat@plt>
  jmp    L189
L155:
  mov    -0x48(%rbp),%eax
  and    $0x40,%eax
  test   %eax,%eax
  je     L5
  lea    -0x20(%rbp),%rdx
  mov    -0x40(%rbp),%eax
  cltq
  lea    (%rdx,%rax,1),%rcx
  mov    -0x48(%rbp),%eax
  and    $0x10,%eax
  test   %eax,%eax
  je     L157
  lea    D11(%rip),%rax
  jmp    L86
L157:
  lea    D51(%rip),%rax
L86:
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strvcat@plt>
  jmp    L189
L5:
  lea    -0x20(%rbp),%rdx
  mov    -0x40(%rbp),%eax
  cltq
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <strdup@plt>
L189:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L82
  call   <__stack_chk_fail@plt>
L82:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D38
datatype: string
name: unpack_data
arguments: data_label: D52
datatype: string
name: unpack_data
arguments: data_label: D58
datatype: string
name: unpack_data
arguments: data_label: D11
datatype: string
name: unpack_data
arguments: data_label: D51
datatype: string

tool: D38: 0123456789abcdef

tool: D52: 0123456789ABCDEF

tool: D58: 0

tool: D11: 0X

tool: D51: 0x

assistant: ```c
char *__format_uint(unsigned int value, int flags) {
  char buffer[16];
  int i;
  int base;
  const char *digits_lower = "0123456789abcdef";
  const char *digits_upper = "0123456789ABCDEF";
  const char *digits;
  if (flags & 0x20)
    base = 8;
  else if (flags & 0x40)
    base = 16;
  else
    base = 10;
  if (value == 0) {
    return strdup("0");
  }
  if (flags & 0x10) {
    digits = digits_upper;
  } else {
    digits = digits_lower;
  }
  buffer[15] = '\0';
  for (i = 14; i >= 0; i--) {
    if (!value)
      break;
    buffer[i] = digits[value % base];
    value /= base;
  }
  if (flags & 0x01) {
    buffer[i--] = '+';
  }
  i++;
  if (flags & 0x04) {
    if (flags & 0x20) {
      return strvcat("0", &buffer[i], NULL);
    }
    if (flags & 0x40) {
      return strvcat((flags & 0x10) ? "0X" : "0x", &buffer[i], NULL);
    }
  }
  return strdup(&buffer[i]);
}
```