user: Translate the below assembly code into C programming language:

```asm
<integerprint>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  mov    %r9d,%r14d
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  mov    %ecx,%ebp
  push   %rbx
  mov    %edx,%ebx
  sub    $0x58,%rsp
  mov    %r8d,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  lea    -0x2(%rdx),%eax
  cmp    $0x21,%eax
  ja     L0
L2:
  mov    $0x20,%eax
  cmp    %eax,%ebp
  cmovle %ebp,%eax
  mov    %eax,0x14(%rsp)
  test   %r13d,%r13d
  je     L8
  movl   $0x0,0x1c(%rsp)
  js     L120
L28:
  lea    0x20(%rsp),%rax
  mov    $0x1f,%ebp
  mov    %rax,0x8(%rsp)
  nopl   0x0(%rax)
L109:
  mov    %r13d,%eax
  xor    %edx,%edx
  mov    %r14d,%esi
  mov    %ebp,0x10(%rsp)
  div    %ebx
  mov    %r13d,%r12d
  mov    %edx,%edi
  mov    %eax,%r13d
  call   <digittoascii@plt>
  mov    0x8(%rsp),%rcx
  mov    %al,(%rcx,%rbp,1)
  sub    $0x1,%rbp
  cmp    %ebx,%r12d
  jae    L109
  mov    $0x20,%ebx
  sub    0x14(%rsp),%ebx
  cmp    0x10(%rsp),%ebx
  jge    L48
  movslq 0x10(%rsp),%rdi
  mov    %edi,%eax
  sub    %ebx,%eax
  sub    $0x1,%eax
  cmpl   $0x1,0x18(%rsp)
  sbb    %esi,%esi
  sub    $0x1,%rdi
  lea    0x1(%rax),%rdx
  and    $0xfffffff0,%esi
  sub    %rax,%rdi
  add    0x8(%rsp),%rdi
  add    $0x30,%esi
  movsbl %sil,%esi
  call   <memset@plt>
L22:
  mov    0x8(%rsp),%rsi
  mov    $0x20,%edx
  mov    %r15,%rdi
  sub    %ebx,%edx
  movslq %ebx,%rbx
  add    %rbx,%rsi
  call   <mcharprint@plt>
  add    0x1c(%rsp),%eax
L34:
  mov    0x48(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L23
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L8:
  cmp    $0x1,%ebp
  jle    L6
  cmpl   $0x1,0x18(%rsp)
  mov    $0x1,%ebp
  sbb    %r12d,%r12d
  and    $0xfffffff0,%r12d
  add    $0x30,%r12d
  xchg   %ax,%ax
L11:
  mov    %r12d,%esi
  mov    %r15,%rdi
  add    $0x1,%ebp
  call   <charprint@plt>
  lea    0x0(%r13,%rax,1),%ebx
  mov    %ebx,%r13d
  cmp    %ebp,0x14(%rsp)
  jg     L11
L126:
  mov    $0x30,%esi
  mov    %r15,%rdi
  call   <charprint@plt>
  add    %ebx,%eax
  jmp    L34
  nopl   (%rax)
L0:
  mov    $0x20,%esi
  lea    D2(%rip),%rdi
  call   <__assert@plt>
  jmp    L2
  cs nopw 0x0(%rax,%rax,1)
L120:
  mov    $0x2d,%esi
  mov    %r15,%rdi
  neg    %r13d
  call   <charprint@plt>
  mov    %eax,0x1c(%rsp)
  jmp    L28
  nopl   0x0(%rax)
L48:
  mov    0x10(%rsp),%ebx
  jmp    L22
L6:
  xor    %ebx,%ebx
  jmp    L126
L23:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D2
type: string

tool: D2: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Touhid18/Nachos/refs/heads/master/bin/nachos/test/printf.c

assistant: ```c
int integerprint(char **s, int n, unsigned base, int min, int zpad, int upper) {
  char buf[32];
  int i = 32, digit, len = 0;
  ((base >= 2 && base < 36) ? (void)0 : __assert("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Touhid18/Nachos/refs/heads/master/bin/nachos/test/printf.c", 32));
  if (min > 32)
    min = 32;
  if (n == 0) {
    for (i = 1; i < min; i++)
      len += charprint(s, zpad ? '0' : ' ');
    len += charprint(s, '0');
    return len;
  }
  if (n < 0) {
    len += charprint(s, '-');
    n *= -1;
  }
  while (n != 0) {
    digit = n % base;
    n /= base;
    if (digit < 0)
      digit *= -1;
    buf[--i] = digittoascii(digit, upper);
  }
  while (i > 32 - min)
    buf[--i] = zpad ? '0' : ' ';
  len += mcharprint(s, &buf[i], 32 - i);
  return len;
}
```