user: What is the c source code of the assembly code below?

```asm
<printi>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %edx,-0x40(%rbp)
  mov    %ecx,-0x44(%rbp)
  mov    %r8d,-0x48(%rbp)
  mov    %r9d,-0x4c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x2c(%rbp)
  movl   $0x0,-0x28(%rbp)
  mov    -0x3c(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  cmpl   $0x0,-0x48(%rbp)
  js     L310
  andl   $0xfffffffd,-0x4c(%rbp)
L310:
  mov    -0x4c(%rbp),%eax
  and    $0x4,%eax
  test   %eax,%eax
  je     L243
  cmpl   $0x0,-0x3c(%rbp)
  jns    L295
  mov    -0x3c(%rbp),%eax
  neg    %eax
  mov    %eax,-0x24(%rbp)
  mov    -0x28(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x28(%rbp)
  cltq
  movb   $0x2d,-0x16(%rbp,%rax,1)
  jmp    L243
L295:
  mov    -0x4c(%rbp),%eax
  and    $0x18,%eax
  test   %eax,%eax
  je     L243
  mov    -0x4c(%rbp),%eax
  and    $0x8,%eax
  test   %eax,%eax
  je     L84
  mov    $0x2b,%ecx
  jmp    L179
L84:
  mov    $0x20,%ecx
L179:
  mov    -0x28(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x28(%rbp)
  cltq
  mov    %cl,-0x16(%rbp,%rax,1)
L243:
  cmpl   $0x0,-0x3c(%rbp)
  je     L105
  mov    -0x4c(%rbp),%eax
  and    $0x40,%eax
  test   %eax,%eax
  je     L105
  mov    -0x28(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x28(%rbp)
  cltq
  movb   $0x30,-0x16(%rbp,%rax,1)
  mov    -0x4c(%rbp),%eax
  and    $0x80,%eax
  test   %eax,%eax
  je     L218
  mov    $0x58,%ecx
  jmp    L247
L218:
  mov    $0x78,%ecx
L247:
  mov    -0x28(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x28(%rbp)
  cltq
  mov    %cl,-0x16(%rbp,%rax,1)
  jmp    L105
L281:
  mov    -0x40(%rbp),%ecx
  mov    -0x24(%rbp),%eax
  mov    $0x0,%edx
  div    %ecx
  mov    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x9,-0x1c(%rbp)
  jg     L349
  mov    -0x1c(%rbp),%eax
  add    $0x30,%eax
  mov    %eax,%ecx
  jmp    L73
L349:
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4c(%rbp),%eax
  and    $0x80,%eax
  test   %eax,%eax
  je     L253
  mov    $0x41,%eax
  jmp    L316
L253:
  mov    $0x61,%eax
L316:
  add    %edx,%eax
  sub    $0xa,%eax
  mov    %eax,%ecx
L73:
  mov    -0x2c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x2c(%rbp)
  cltq
  mov    %cl,-0x14(%rbp,%rax,1)
  mov    -0x40(%rbp),%esi
  mov    -0x24(%rbp),%eax
  mov    $0x0,%edx
  div    %esi
  mov    %eax,-0x24(%rbp)
L105:
  cmpl   $0x0,-0x24(%rbp)
  jne    L281
  cmpl   $0x0,-0x3c(%rbp)
  je     L336
  mov    -0x4c(%rbp),%eax
  and    $0x20,%eax
  test   %eax,%eax
  je     L215
L336:
  mov    -0x2c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x2c(%rbp)
  cltq
  movb   $0x30,-0x14(%rbp,%rax,1)
L215:
  mov    -0x48(%rbp),%edx
  mov    -0x2c(%rbp),%eax
  cmp    %eax,%edx
  cmovl  %eax,%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x4c(%rbp),%eax
  and    $0x3,%eax
  test   %eax,%eax
  jne    L325
  movl   $0x0,-0x30(%rbp)
  jmp    L313
L24:
  mov    -0x38(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  call   <putc@plt>
  addl   $0x1,-0x30(%rbp)
L313:
  mov    -0x44(%rbp),%eax
  sub    -0x20(%rbp),%eax
  cmp    %eax,-0x30(%rbp)
  jl     L24
L325:
  movl   $0x0,-0x30(%rbp)
  jmp    L330
L321:
  mov    -0x30(%rbp),%eax
  cltq
  movzbl -0x16(%rbp,%rax,1),%eax
  movsbl %al,%eax
  mov    -0x38(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <putc@plt>
  addl   $0x1,-0x30(%rbp)
L330:
  mov    -0x30(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L321
  mov    -0x4c(%rbp),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L275
  movl   $0x0,-0x30(%rbp)
  jmp    L266
L136:
  mov    -0x38(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x30,%edi
  call   <putc@plt>
  addl   $0x1,-0x30(%rbp)
L266:
  mov    -0x44(%rbp),%eax
  sub    -0x20(%rbp),%eax
  cmp    %eax,-0x30(%rbp)
  jl     L136
L275:
  movl   $0x0,-0x30(%rbp)
  jmp    L188
L98:
  mov    -0x38(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x30,%edi
  call   <putc@plt>
  addl   $0x1,-0x30(%rbp)
L188:
  mov    -0x48(%rbp),%eax
  sub    -0x2c(%rbp),%eax
  cmp    %eax,-0x30(%rbp)
  jl     L98
  mov    -0x2c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x30(%rbp)
  jmp    L322
L9:
  mov    -0x30(%rbp),%eax
  cltq
  movzbl -0x14(%rbp,%rax,1),%eax
  movsbl %al,%eax
  mov    -0x38(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <putc@plt>
  subl   $0x1,-0x30(%rbp)
L322:
  cmpl   $0x0,-0x30(%rbp)
  jns    L9
  mov    -0x4c(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L164
  movl   $0x0,-0x30(%rbp)
  jmp    L250
L62:
  mov    -0x38(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x20,%edi
  call   <putc@plt>
  addl   $0x1,-0x30(%rbp)
L250:
  mov    -0x44(%rbp),%eax
  sub    -0x20(%rbp),%eax
  cmp    %eax,-0x30(%rbp)
  jl     L62
L164:
  mov    -0x20(%rbp),%edx
  mov    -0x44(%rbp),%eax
  cmp    %eax,%edx
  cmovge %edx,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L160
  call   <__stack_chk_fail@plt>
L160:
  leave
  ret
```

assistant: ```c
int printi(FILE *fp, int x, int base, int w, int prec, int flag) {
  char buf[12], pbuf[2];
  int i, n, len = 0, plen = 0;
  unsigned u = x;
  if (prec >= 0)
    flag &= ~(1 << 1);
  if (flag & (1 << 2)) {
    if (x < 0) {
      u = -x;
      pbuf[plen++] = '-';
    } else if (flag & ((1 << 3) | (1 << 4))) {
      pbuf[plen++] = flag & (1 << 3) ? '+' : ' ';
    }
  }
  if (x && flag & (1 << 6)) {
    pbuf[plen++] = '0';
    pbuf[plen++] = flag & (1 << 7) ? 'X' : 'x';
  }
  while (u > 0) {
    int t = u % base;
    buf[len++] = (t < 10) ? (t + '0') : (t - 10 + (flag & (1 << 7) ? 'A' : 'a'));
    u /= base;
  }
  if (x == 0 || flag & (1 << 5))
    buf[len++] = '0';
  n = ((len) > (prec) ? (len) : (prec)) + plen;
  if (!(flag & ((1 << 0) | (1 << 1))))
    for (i = 0; i < w - n; ++i)
      putc(' ', fp);
  for (i = 0; i < plen; ++i)
    putc(pbuf[i], fp);
  if (flag & (1 << 1))
    for (i = 0; i < w - n; ++i)
      putc('0', fp);
  for (i = 0; i < prec - len; ++i)
    putc('0', fp);
  for (i = len - 1; i >= 0; --i)
    putc(buf[i], fp);
  if (flag & (1 << 0))
    for (i = 0; i < w - n; ++i)
      putc(' ', fp);
  return ((w) > (n) ? (w) : (n));
}
```