// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %rbx
movq %rsi, 0x10(%rsp)
movq %rdi, 0x18(%rsp)
xorl %eax, %eax
cmpb $0x2d, (%rcx)
sete %dl
movl $0x2d, %ebp
je 0x33bf5
movl 0x2c(%rbx), %ebp
movb %dl, %al
leaq (%rcx,%rax), %r14
testb %bpl, %bpl
setne 0xf(%rsp)
cmpb $0x30, (%rcx,%rax)
jne 0x33c11
cmpl $0x1, 0x1c(%rbx)
adcq $0x0, %r14
movq %r14, %rdi
callq 0x6120
movq %rax, %r13
movq %r14, %rdi
movl $0x2f, %esi
callq 0x6100
movl 0x20(%rbx), %edx
cmpl $0x2, %edx
jne 0x33c3f
movq $0x0, 0x20(%rsp)
xorl %r12d, %r12d
jmp 0x33c80
movl (%rbx), %ecx
cmpl $-0x10, %ecx
je 0x33c6e
cmpl $0x8, %ecx
je 0x33c5f
cmpl $0x10, %ecx
jne 0x33c31
movl $0x2, %r12d
leaq 0x7c21(%rip), %rcx      # 0x3b87e
jmp 0x33c7b
movl $0x1, %r12d
leaq 0x7307(%rip), %rcx      # 0x3af73
jmp 0x33c7b
movl $0x2, %r12d
leaq 0x7c06(%rip), %rcx      # 0x3b881
movq %rcx, 0x20(%rsp)
testq %rax, %rax
je 0x33c96
movl %r12d, %esi
cmpl $0x3, %edx
jne 0x33c98
cmpb $0x30, 0x1(%rax)
movl %r12d, %esi
jne 0x33c98
xorl %esi, %esi
cmpl $0x3, %edx
movq %r14, 0x50(%rsp)
jne 0x33cac
xorl %ecx, %ecx
cmpb $0x30, (%r14)
cmovel %ecx, %r12d
movq %rax, 0x48(%rsp)
movl 0x1c(%rbx), %r15d
subl %r13d, %r15d
xorl %r14d, %r14d
testl %r15d, %r15d
movq %r13, %rdx
movl $0x0, %r13d
cmovgl %r15d, %r13d
movl %ebp, %eax
negb %al
movq %rbx, %rcx
movl $0x0, %ebx
sbbl %ebx, %ebx
movq %rdx, 0x40(%rsp)
subl %edx, %ebx
movq %rsi, 0x38(%rsp)
leal (%rsi,%r12), %eax
movq %rcx, 0x30(%rsp)
addl 0x30(%rcx), %ebx
addl %r13d, %eax
subl %eax, %ebx
movl $0x0, %eax
testl %ebx, %ebx
jle 0x33d07
movq 0x30(%rsp), %rax
movl 0x18(%rax), %eax
movl %eax, 0x2c(%rsp)
cmpl $0x2, %eax
jne 0x33d38
movq 0x30(%rsp), %rax
movsbl 0x14(%rax), %esi
movq 0x10(%rsp), %rdi
movl %ebx, %edx
movq 0x18(%rsp), %rax
callq *0x10(%rax)
xorl %r14d, %r14d
cmpl $-0x1, %eax
cmovnel %eax, %r14d
je 0x33eb3
testb %bpl, %bpl
je 0x33d67
movsbl %bpl, %esi
xorl %edx, %edx
movb 0xf(%rsp), %al
movb %al, %dl
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rax
callq *0x10(%rax)
xorl %ecx, %ecx
cmpl $-0x1, %eax
cmovnel %eax, %ecx
je 0x33eb3
addl %ecx, %r14d
movl %r12d, %edx
testq %rdx, %rdx
je 0x33d92
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rax
callq *0x8(%rax)
xorl %ecx, %ecx
cmpl $-0x1, %eax
cmovnel %eax, %ecx
je 0x33eb3
addl %ecx, %r14d
testl %r15d, %r15d
jle 0x33dbd
movq 0x10(%rsp), %rdi
movl $0x30, %esi
movl %r13d, %edx
movq 0x18(%rsp), %rax
callq *0x10(%rax)
xorl %ecx, %ecx
cmpl $-0x1, %eax
cmovnel %eax, %ecx
je 0x33eb3
addl %ecx, %r14d
cmpl $0x3, 0x2c(%rsp)
jne 0x33ded
movq 0x30(%rsp), %rax
movsbl 0x14(%rax), %esi
movq 0x10(%rsp), %rdi
movl %ebx, %edx
movq 0x18(%rsp), %rax
callq *0x10(%rax)
xorl %ecx, %ecx
cmpl $-0x1, %eax
cmovnel %eax, %ecx
je 0x33eb3
addl %ecx, %r14d
movq 0x38(%rsp), %rax
testl %eax, %eax
movq 0x50(%rsp), %rsi
je 0x33e64
movq 0x48(%rsp), %rax
subq %rsi, %rax
incq %rax
movq %rax, %r12
movslq %eax, %rbp
movq 0x10(%rsp), %rdi
movq %rsi, %r15
movq %rbp, %rdx
movq 0x18(%rsp), %rax
callq *0x8(%rax)
cmpl $-0x1, %eax
je 0x33eb3
movl %eax, %r13d
movl 0x38(%rsp), %edx
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rax
callq *0x8(%rax)
xorl %ecx, %ecx
cmpl $-0x1, %eax
cmovnel %eax, %ecx
je 0x33eb3
addl %r14d, %r13d
addl %ecx, %r13d
movq 0x40(%rsp), %rax
subq %r12, %rax
movq %r15, %rsi
addq %rbp, %rsi
movl %r13d, %r14d
jmp 0x33e69
movq 0x40(%rsp), %rax
movslq %eax, %rdx
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rax
callq *0x8(%rax)
xorl %ebp, %ebp
cmpl $-0x1, %eax
cmovnel %eax, %ebp
je 0x33eb3
addl %r14d, %ebp
cmpl $0x1, 0x2c(%rsp)
jne 0x33eb8
movq 0x30(%rsp), %rax
movsbl 0x14(%rax), %esi
movq 0x10(%rsp), %rdi
movl %ebx, %edx
movq 0x18(%rsp), %rax
callq *0x10(%rax)
xorl %ecx, %ecx
cmpl $-0x1, %eax
cmovnel %eax, %ecx
je 0x33eb3
addl %ecx, %ebp
jmp 0x33eb8
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)