// File: marxn[P]pupp/3rdparty/gmp/printf/doprnti.c
// Function: _gmp_doprnt_integer
int
__gmp_doprnt_integer (const struct doprnt_funs_t *funs,
		      void *data,
		      const struct doprnt_params_t *p,
		      const char *s)
{
  int         retval = 0;
  int         slen, justlen, showbaselen, sign, signlen, slashlen, zeros;
  int         justify, den_showbaselen;
  const char  *slash, *showbase;

  /* '+' or ' ' if wanted, and don't already have '-' */
  sign = p->sign;
  if (s[0] == '-')
    {
      sign = s[0];
      s++;
    }
  signlen = (sign != '\0');

  /* if the precision was explicitly 0, print nothing for a 0 value */
  if (*s == '0' && p->prec == 0)
    s++;

  slen = strlen (s);
  slash = strchr (s, '/');

  showbase = NULL;
  showbaselen = 0;

  if (p->showbase != DOPRNT_SHOWBASE_NO)
    {
      switch (p->base) {
      case 16:  showbase = "0x"; showbaselen = 2; break;
      case -16: showbase = "0X"; showbaselen = 2; break;
      case 8:   showbase = "0";  showbaselen = 1; break;
      }
    }

  den_showbaselen = showbaselen;
  if (slash == NULL
      || (p->showbase == DOPRNT_SHOWBASE_NONZERO && slash[1] == '0'))
    den_showbaselen = 0;

  if (p->showbase == DOPRNT_SHOWBASE_NONZERO && s[0] == '0')
    showbaselen = 0;

  /* the influence of p->prec on mpq is currently undefined */
  zeros = MAX (0, p->prec - slen);

  /* space left over after actual output length */
  justlen = p->width
    - (strlen(s) + signlen + showbaselen + den_showbaselen + zeros);

  justify = p->justify;
  if (justlen <= 0) /* no justifying if exceed width */
    justify = DOPRNT_JUSTIFY_NONE;

  if (justify == DOPRNT_JUSTIFY_RIGHT)             /* pad right */
    DOPRNT_REPS (p->fill, justlen);

  DOPRNT_REPS_MAYBE (sign, signlen);               /* sign */

  DOPRNT_MEMORY_MAYBE (showbase, showbaselen);     /* base */

  DOPRNT_REPS_MAYBE ('0', zeros);                  /* zeros */

  if (justify == DOPRNT_JUSTIFY_INTERNAL)          /* pad internal */
    DOPRNT_REPS (p->fill, justlen);

  /* if there's a showbase on the denominator, then print the numerator
     separately so it can be inserted */
  if (den_showbaselen != 0)
    {
      ASSERT (slash != NULL);
      slashlen = slash+1 - s;
      DOPRNT_MEMORY (s, slashlen);                 /* numerator and slash */
      slen -= slashlen;
      s += slashlen;
      DOPRNT_MEMORY (showbase, den_showbaselen);
    }

  DOPRNT_MEMORY (s, slen);                         /* number, or denominator */

  if (justify == DOPRNT_JUSTIFY_LEFT)              /* pad left */
    DOPRNT_REPS (p->fill, justlen);

 done:
  return retval;

 error:
  retval = -1;
  goto done;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x18(%rbp), %rax
movsbl 0x2c(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x5c05f
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
cmpl $0x0, -0x34(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jne 0x5c090
movq -0x18(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
jne 0x5c090
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x6170
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movl $0x2f, %esi
callq 0x6130
movq %rax, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x2, 0x20(%rax)
je 0x5c127
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x80(%rbp)
subl $-0x10, %eax
je 0x5c0ff
jmp 0x5c0d7
movl -0x80(%rbp), %eax
subl $0x8, %eax
je 0x5c113
jmp 0x5c0e1
movl -0x80(%rbp), %eax
subl $0x10, %eax
jne 0x5c125
jmp 0x5c0eb
leaq 0x8afc(%rip), %rax      # 0x64bee
movq %rax, -0x58(%rbp)
movl $0x2, -0x30(%rbp)
jmp 0x5c125
leaq 0x8aeb(%rip), %rax      # 0x64bf1
movq %rax, -0x58(%rbp)
movl $0x2, -0x30(%rbp)
jmp 0x5c125
leaq 0x7f89(%rip), %rax      # 0x640a3
movq %rax, -0x58(%rbp)
movl $0x1, -0x30(%rbp)
jmp 0x5c127
movl -0x30(%rbp), %eax
movl %eax, -0x48(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x5c14b
movq -0x18(%rbp), %rax
cmpl $0x3, 0x20(%rax)
jne 0x5c152
movq -0x50(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x30, %eax
jne 0x5c152
movl $0x0, -0x48(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x3, 0x20(%rax)
jne 0x5c16f
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jne 0x5c16f
movl $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
movl 0x1c(%rax), %ecx
subl -0x28(%rbp), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jle 0x5c189
xorl %eax, %eax
movl %eax, -0x84(%rbp)
jmp 0x5c199
movq -0x18(%rbp), %rax
movl 0x1c(%rax), %eax
subl -0x28(%rbp), %eax
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %eax
movl %eax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movslq 0x30(%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x20(%rbp), %rdi
callq 0x6170
movq %rax, %rcx
movq -0x90(%rbp), %rax
movslq -0x38(%rbp), %rdx
addq %rdx, %rcx
movslq -0x30(%rbp), %rdx
addq %rdx, %rcx
movslq -0x48(%rbp), %rdx
addq %rdx, %rcx
movslq -0x40(%rbp), %rdx
addq %rdx, %rcx
subq %rcx, %rax
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x2c(%rbp)
jg 0x5c1fd
movl $0x0, -0x44(%rbp)
cmpl $0x2, -0x44(%rbp)
jne 0x5c23f
jmp 0x5c205
jmp 0x5c207
jmp 0x5c209
jmp 0x5c20b
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rcx
movsbl 0x14(%rcx), %esi
movl -0x2c(%rbp), %edx
callq *%rax
movl %eax, -0x5c(%rbp)
cmpl $-0x1, -0x5c(%rbp)
jne 0x5c232
jmp 0x5c471
movl -0x5c(%rbp), %eax
addl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x5c23d
jmp 0x5c23f
jmp 0x5c241
cmpl $0x0, -0x38(%rbp)
je 0x5c27e
jmp 0x5c249
jmp 0x5c24b
jmp 0x5c24d
jmp 0x5c24f
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdi
movl -0x34(%rbp), %esi
movl -0x38(%rbp), %edx
callq *%rax
movl %eax, -0x60(%rbp)
cmpl $-0x1, -0x60(%rbp)
jne 0x5c271
jmp 0x5c471
movl -0x60(%rbp), %eax
addl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x5c27c
jmp 0x5c27e
jmp 0x5c280
jmp 0x5c282
cmpl $0x0, -0x30(%rbp)
je 0x5c2c1
jmp 0x5c28a
jmp 0x5c28c
jmp 0x5c28e
jmp 0x5c290
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x58(%rbp), %rsi
movslq -0x30(%rbp), %rdx
callq *%rax
movl %eax, -0x64(%rbp)
cmpl $-0x1, -0x64(%rbp)
jne 0x5c2b4
jmp 0x5c471
movl -0x64(%rbp), %eax
addl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x5c2bf
jmp 0x5c2c1
jmp 0x5c2c3
jmp 0x5c2c5
cmpl $0x0, -0x40(%rbp)
je 0x5c304
jmp 0x5c2cd
jmp 0x5c2cf
jmp 0x5c2d1
jmp 0x5c2d3
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdi
movl -0x40(%rbp), %edx
movl $0x30, %esi
callq *%rax
movl %eax, -0x68(%rbp)
cmpl $-0x1, -0x68(%rbp)
jne 0x5c2f7
jmp 0x5c471
movl -0x68(%rbp), %eax
addl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x5c302
jmp 0x5c304
jmp 0x5c306
cmpl $0x3, -0x44(%rbp)
jne 0x5c348
jmp 0x5c30e
jmp 0x5c310
jmp 0x5c312
jmp 0x5c314
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rcx
movsbl 0x14(%rcx), %esi
movl -0x2c(%rbp), %edx
callq *%rax
movl %eax, -0x6c(%rbp)
cmpl $-0x1, -0x6c(%rbp)
jne 0x5c33b
jmp 0x5c471
movl -0x6c(%rbp), %eax
addl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x5c346
jmp 0x5c348
cmpl $0x0, -0x48(%rbp)
je 0x5c3f0
jmp 0x5c354
jmp 0x5c356
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x3c(%rbp)
jmp 0x5c36a
jmp 0x5c36c
jmp 0x5c36e
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movslq -0x3c(%rbp), %rdx
callq *%rax
movl %eax, -0x70(%rbp)
cmpl $-0x1, -0x70(%rbp)
jne 0x5c392
jmp 0x5c471
movl -0x70(%rbp), %eax
addl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x5c39d
movl -0x3c(%rbp), %ecx
movl -0x28(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x28(%rbp)
movl -0x3c(%rbp), %ecx
movq -0x20(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
jmp 0x5c3bb
jmp 0x5c3bd
jmp 0x5c3bf
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x58(%rbp), %rsi
movslq -0x48(%rbp), %rdx
callq *%rax
movl %eax, -0x74(%rbp)
cmpl $-0x1, -0x74(%rbp)
jne 0x5c3e3
jmp 0x5c471
movl -0x74(%rbp), %eax
addl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x5c3ee
jmp 0x5c3f0
jmp 0x5c3f2
jmp 0x5c3f4
jmp 0x5c3f6
jmp 0x5c3f8
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movslq -0x28(%rbp), %rdx
callq *%rax
movl %eax, -0x78(%rbp)
cmpl $-0x1, -0x78(%rbp)
jne 0x5c419
jmp 0x5c471
movl -0x78(%rbp), %eax
addl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x5c424
cmpl $0x1, -0x44(%rbp)
jne 0x5c463
jmp 0x5c42c
jmp 0x5c42e
jmp 0x5c430
jmp 0x5c432
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rcx
movsbl 0x14(%rcx), %esi
movl -0x2c(%rbp), %edx
callq *%rax
movl %eax, -0x7c(%rbp)
cmpl $-0x1, -0x7c(%rbp)
jne 0x5c456
jmp 0x5c471
movl -0x7c(%rbp), %eax
addl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x5c461
jmp 0x5c463
jmp 0x5c465
movl -0x24(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
jmp 0x5c465
nopw (%rax,%rax)