// File: /workspace/github_cpp_makefile_star2_O3/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, %r15
movq %rsi, 0x18(%rsp)
movq %rdi, 0x20(%rsp)
xorl %eax, %eax
cmpb $0x2d, (%rcx)
sete %dl
movl $0x2d, %r14d
je 0x3374b
movl 0x2c(%r15), %r14d
movb %dl, %al
leaq (%rcx,%rax), %rbx
testb %r14b, %r14b
setne 0xf(%rsp)
cmpb $0x30, (%rcx,%rax)
jne 0x33768
cmpl $0x1, 0x1c(%r15)
adcq $0x0, %rbx
movq %rbx, %rdi
callq 0x6120
movq %rax, %r13
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x6100
movl 0x20(%r15), %edx
movq $0x0, 0x10(%rsp)
cmpl $0x2, %edx
movq %rbx, 0x50(%rsp)
jne 0x337a6
xorl %esi, %esi
movq $0x0, 0x28(%rsp)
xorl %ebp, %ebp
jmp 0x3381a
movl (%r15), %ecx
cmpl $-0x10, %ecx
je 0x337d4
cmpl $0x8, %ecx
je 0x337c6
cmpl $0x10, %ecx
jne 0x337e7
movl $0x2, %ebp
leaq 0x70aa(%rip), %rcx      # 0x3a86e
jmp 0x337e0
movl $0x1, %ebp
leaq 0x6791(%rip), %rcx      # 0x39f63
jmp 0x337e0
movl $0x2, %ebp
leaq 0x7091(%rip), %rcx      # 0x3a871
movq %rcx, 0x28(%rsp)
jmp 0x337f2
movq $0x0, 0x28(%rsp)
xorl %ebp, %ebp
testq %rax, %rax
je 0x33807
cmpl $0x3, %edx
jne 0x33818
xorl %esi, %esi
cmpb $0x30, 0x1(%rax)
cmovnel %ebp, %esi
jmp 0x3380e
xorl %esi, %esi
cmpl $0x3, %edx
jne 0x3381a
xorl %ecx, %ecx
cmpb $0x30, (%rbx)
cmovel %ecx, %ebp
jmp 0x3381a
movl %ebp, %esi
movq %rax, 0x38(%rsp)
movl 0x1c(%r15), %r12d
subl %r13d, %r12d
testl %r12d, %r12d
movq %r13, %rcx
movl $0x0, %r13d
cmovgl %r12d, %r13d
movl %r14d, %eax
negb %al
movl $0x0, %ebx
sbbl %ebx, %ebx
movq %rcx, 0x40(%rsp)
subl %ecx, %ebx
movq %rsi, 0x48(%rsp)
leal (%rsi,%rbp), %eax
addl 0x30(%r15), %ebx
addl %r13d, %eax
subl %eax, %ebx
movl $0x0, %eax
testl %ebx, %ebx
jle 0x33867
movl 0x18(%r15), %eax
movl %eax, 0x34(%rsp)
cmpl $0x2, %eax
jne 0x33892
movsbl 0x14(%r15), %esi
movq 0x18(%rsp), %rdi
movl %ebx, %edx
movq 0x20(%rsp), %rax
callq *0x10(%rax)
movq %rax, 0x10(%rsp)
cmpl $-0x1, %eax
je 0x33a0d
testb %r14b, %r14b
je 0x338c2
movsbl %r14b, %esi
xorl %edx, %edx
movb 0xf(%rsp), %al
movb %al, %dl
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rax
callq *0x10(%rax)
cmpl $-0x1, %eax
je 0x33a0d
addl 0x10(%rsp), %eax
movq %rax, 0x10(%rsp)
movl %ebp, %edx
testq %rdx, %rdx
je 0x338ed
movq 0x18(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rax
callq *0x8(%rax)
cmpl $-0x1, %eax
je 0x33a0d
addl 0x10(%rsp), %eax
movq %rax, 0x10(%rsp)
testl %r12d, %r12d
jle 0x33919
movq 0x18(%rsp), %rdi
movl $0x30, %esi
movl %r13d, %edx
movq 0x20(%rsp), %rax
callq *0x10(%rax)
cmpl $-0x1, %eax
je 0x33a0d
addl 0x10(%rsp), %eax
movq %rax, 0x10(%rsp)
cmpl $0x3, 0x34(%rsp)
jne 0x33946
movsbl 0x14(%r15), %esi
movq 0x18(%rsp), %rdi
movl %ebx, %edx
movq 0x20(%rsp), %rax
callq *0x10(%rax)
cmpl $-0x1, %eax
je 0x33a0d
addl 0x10(%rsp), %eax
movq %rax, 0x10(%rsp)
movq 0x48(%rsp), %rax
movl %eax, %r13d
testq %r13, %r13
movq 0x50(%rsp), %rsi
je 0x339c6
movq 0x38(%rsp), %rax
subq %rsi, %rax
incq %rax
movq %rax, 0x38(%rsp)
movslq %eax, %rdx
movq 0x18(%rsp), %rdi
movq %rsi, %r12
movq %rdx, %rbp
movq 0x20(%rsp), %rax
callq *0x8(%rax)
cmpl $-0x1, %eax
je 0x33a0d
movl %eax, %r14d
movq 0x18(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %r13, %rdx
movq 0x20(%rsp), %rax
callq *0x8(%rax)
cmpl $-0x1, %eax
je 0x33a0d
addl 0x10(%rsp), %r14d
movq 0x40(%rsp), %rcx
subq 0x38(%rsp), %rcx
movq %r12, %rsi
addq %rbp, %rsi
addl %eax, %r14d
movl %r14d, %eax
movq %rax, 0x10(%rsp)
jmp 0x339cb
movq 0x40(%rsp), %rcx
movslq %ecx, %rdx
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rax
callq *0x8(%rax)
cmpl $-0x1, %eax
je 0x33a0d
movl %eax, %r14d
addl 0x10(%rsp), %r14d
cmpl $0x1, 0x34(%rsp)
jne 0x33a13
movsbl 0x14(%r15), %esi
movq 0x18(%rsp), %rdi
movl %ebx, %edx
movq 0x20(%rsp), %rax
callq *0x10(%rax)
cmpl $-0x1, %eax
je 0x33a0d
addl %eax, %r14d
jmp 0x33a13
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)