// File: /workspace/github_c_makefile_star2_O0/JesseBuesking[P]omnomnum/grisu2/grisu2.c
// Function: digit_gen
void digit_gen(diy_fp_t W, diy_fp_t Mp, diy_fp_t delta,
	       char* buffer, int* len, int* K) {
  uint32_t div; int d,kappa; diy_fp_t one, wp_w;
  wp_w = minus(Mp, W);
  one.f = ((uint64_t) 1) << -Mp.e; one.e = Mp.e;
  uint32_t p1 = Mp.f >> -one.e; /// Mp_cut
  uint64_t p2 = Mp.f & (one.f - 1);
  *len = 0; kappa = 10; div = TEN9;
  while (kappa > 0) {
    d = p1 / div;
    if (d || *len) buffer[(*len)++] = '0' + d; /// Mp_inv1
    p1 %= div; kappa--;
    uint64_t tmp = (((uint64_t)p1)<<-one.e)+p2;
    if (tmp <= delta.f) { /// Mp_delta
      *K += kappa;
      grisu_round(buffer, *len, delta.f, tmp, ((uint64_t)div) << -one.e, wp_w.f);
      return;
    }
    div /= 10;
  }
  uint64_t unit = 1;
  while (1) {
    p2 *= 10; delta.f *= 10; unit *= 10;
    d = p2 >> -one.e;
    if (d || *len) buffer[(*len)++] = '0' + d;
    p2 &= one.f - 1; kappa--;
    if (p2 < delta.f) {
      *K += kappa;
      grisu_round(buffer, *len, delta.f, p2, one.f, wp_w.f*unit);
      return;
    }
  }
}

// Assembly:
subq $0x98, %rsp
movq 0xb0(%rsp), %rax
movq 0xa8(%rsp), %rax
movq 0xa0(%rsp), %rax
movq %rdi, 0x88(%rsp)
movl %esi, 0x90(%rsp)
movq %rdx, 0x78(%rsp)
movl %ecx, 0x80(%rsp)
movq %r8, 0x68(%rsp)
movl %r9d, 0x70(%rsp)
movq 0x78(%rsp), %rdi
movl 0x80(%rsp), %esi
movq 0x88(%rsp), %rdx
movl 0x90(%rsp), %ecx
callq 0x15860
movq %rax, 0x28(%rsp)
movl %edx, 0x30(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x40(%rsp)
xorl %eax, %eax
subl 0x80(%rsp), %eax
movl %eax, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, 0x48(%rsp)
movl 0x80(%rsp), %eax
movl %eax, 0x50(%rsp)
movq 0x78(%rsp), %rax
xorl %ecx, %ecx
subl 0x50(%rsp), %ecx
movl %ecx, %ecx
shrq %cl, %rax
movl %eax, 0x24(%rsp)
movq 0x78(%rsp), %rax
movq 0x48(%rsp), %rcx
subq $0x1, %rcx
andq %rcx, %rax
movq %rax, 0x18(%rsp)
movq 0xa8(%rsp), %rax
movl $0x0, (%rax)
movl $0xa, 0x5c(%rsp)
movl $0x3b9aca00, 0x64(%rsp) # imm = 0x3B9ACA00
cmpl $0x0, 0x5c(%rsp)
jle 0x15760
movl 0x24(%rsp), %eax
xorl %edx, %edx
divl 0x64(%rsp)
movl %eax, 0x60(%rsp)
cmpl $0x0, 0x60(%rsp)
jne 0x1568b
movq 0xa8(%rsp), %rax
cmpl $0x0, (%rax)
je 0x156b3
movl 0x60(%rsp), %eax
addl $0x30, %eax
movb %al, %dl
movq 0xa0(%rsp), %rax
movq 0xa8(%rsp), %rsi
movl (%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, (%rsi)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl 0x64(%rsp), %ecx
movl 0x24(%rsp), %eax
xorl %edx, %edx
divl %ecx
movl %edx, 0x24(%rsp)
movl 0x5c(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x5c(%rsp)
movl 0x24(%rsp), %eax
xorl %ecx, %ecx
subl 0x50(%rsp), %ecx
movl %ecx, %ecx
shlq %cl, %rax
addq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x68(%rsp), %rax
ja 0x1574a
movl 0x5c(%rsp), %ecx
movq 0xb0(%rsp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
movq 0xa0(%rsp), %rdi
movq 0xa8(%rsp), %rax
movl (%rax), %esi
movq 0x68(%rsp), %rdx
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movl 0x64(%rsp), %eax
movl %eax, %r8d
xorl %eax, %eax
subl 0x50(%rsp), %eax
movl %eax, %eax
movl %eax, %ecx
shlq %cl, %r8
movq (%rsp), %rcx
movq 0x38(%rsp), %r9
callq 0x154b0
jmp 0x1584c
movl 0x64(%rsp), %eax
movl $0xa, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, 0x64(%rsp)
jmp 0x1565e
movq $0x1, 0x8(%rsp)
imulq $0xa, 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
imulq $0xa, 0x68(%rsp), %rax
movq %rax, 0x68(%rsp)
imulq $0xa, 0x8(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
xorl %ecx, %ecx
subl 0x50(%rsp), %ecx
movl %ecx, %ecx
shrq %cl, %rax
movl %eax, 0x60(%rsp)
cmpl $0x0, 0x60(%rsp)
jne 0x157b2
movq 0xa8(%rsp), %rax
cmpl $0x0, (%rax)
je 0x157da
movl 0x60(%rsp), %eax
addl $0x30, %eax
movb %al, %dl
movq 0xa0(%rsp), %rax
movq 0xa8(%rsp), %rsi
movl (%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, (%rsi)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq 0x48(%rsp), %rax
subq $0x1, %rax
andq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
movl 0x5c(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x5c(%rsp)
movq 0x18(%rsp), %rax
cmpq 0x68(%rsp), %rax
jae 0x15847
movl 0x5c(%rsp), %ecx
movq 0xb0(%rsp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
movq 0xa0(%rsp), %rdi
movq 0xa8(%rsp), %rax
movl (%rax), %esi
movq 0x68(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq 0x48(%rsp), %r8
movq 0x38(%rsp), %r9
imulq 0x8(%rsp), %r9
callq 0x154b0
jmp 0x1584c
jmp 0x15769
addq $0x98, %rsp
retq
nopw %cs:(%rax,%rax)