// File: /workspace/github_c_makefile_star2_O3/JesseBuesking[P]omnomnum/grisu2/grisu2.c
// Function: grisu2
void grisu2(double v, char* buffer, int* length, int* K) {
  diy_fp_t w_m, w_p;
  int q = 64, alpha = -59, gamma = -56; int pos;
  normalized_boundaries(v, &w_m, &w_p);
  diy_fp_t w = normalize_diy_fp(double2diy_fp(v));
  int mk = k_comp(w_p.e + q, alpha, gamma);
  diy_fp_t c_mk = cached_power(mk);
  diy_fp_t W  = multiply(w,   c_mk);
  diy_fp_t Wp = multiply(w_p, c_mk);
  diy_fp_t Wm = multiply(w_m, c_mk);
  Wm.f++; Wp.f--;
  diy_fp_t delta = minus(Wp, Wm);
  *K = -mk;
  digit_gen(W, Wp, delta, buffer, length, K);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r9
movq %rdi, %rax
movq %xmm0, %rcx
movabsq $0x10000000000000, %rdi # imm = 0x10000000000000
leaq -0x1(%rdi), %r15
andq %rcx, %r15
shrq $0x34, %rcx
andl $0x7ff, %ecx            # imm = 0x7FF
movq %r15, %r14
btsq $0x34, %r14
testl %ecx, %ecx
movq %r14, %rbx
cmoveq %r15, %rbx
leal -0x433(%rcx), %edx
movl $0xfffffbce, %r10d      # imm = 0xFFFFFBCE
cmovnel %edx, %r10d
leaq (%rbx,%rbx), %r12
leal -0x1(%r10), %edx
leaq 0x1(,%rbx,2), %r11
testl %ecx, %ecx
je 0x864a
movl %edx, %r8d
jmp 0x8680
movabsq $0x1fffffffffffff, %rcx # imm = 0x1FFFFFFFFFFFFF
andq %r11, %rcx
bsrq %rcx, %rcx
movl %ecx, %r8d
xorl $-0x40, %r8d
notb %cl
addb $0x36, %cl
shlq %cl, %r11
addl $0xfffffbd8, %r8d       # imm = 0xFFFFFBD8
bsrq %r15, %rcx
notb %cl
addb $0x35, %cl
shlq %cl, %r15
movq %r15, %r14
decq %r12
addl $-0x2, %r10d
cmpq %rdi, %rbx
movabsq $0x3fffffffffffff, %rbx # imm = 0x3FFFFFFFFFFFFF
cmovneq %r12, %rbx
cmovel %r10d, %edx
subl %r8d, %edx
addb $0xa, %dl
movl %edx, %ecx
shlq %cl, %rbx
shlq $0xa, %r11
movl $0xffffffce, %ecx       # imm = 0xFFFFFFCE
subl %r8d, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
mulsd 0x4756(%rip), %xmm0     # 0xce18
shlq $0xb, %r14
roundsd $0xa, %xmm0, %xmm0
cvttsd2si %xmm0, %ecx
movslq %ecx, %r10
leaq 0x4746(%rip), %rcx      # 0xce20
movq 0xab8(%rcx,%r10,8), %rdx
leaq 0x5cb7(%rip), %rcx      # 0xe3a0
movl 0x55c(%rcx,%r10,4), %ecx
movq %r14, %r15
shrq $0x20, %r15
movl %r14d, %edi
movl %edx, %r14d
shrq $0x20, %rdx
movq %rdx, %r13
imulq %r15, %r13
movq %rdx, %r12
imulq %rdi, %r12
imulq %r14, %r15
imulq %r14, %rdi
shrq $0x20, %rdi
movl %r15d, %ebp
addq %rdi, %rbp
movl %r12d, %edi
addq %rbp, %rdi
subq $-0x80000000, %rdi      # imm = 0x80000000
shrq $0x20, %r15
addq %r13, %r15
shrq $0x20, %r12
addq %r15, %r12
shrq $0x20, %rdi
addq %r12, %rdi
movq %r11, %r15
shrq $0x20, %r15
movl %r11d, %r12d
movq %rdx, %r13
imulq %r15, %r13
movq %rdx, %r11
imulq %r12, %r11
imulq %r14, %r15
imulq %r14, %r12
shrq $0x20, %r12
movl %r15d, %ebp
addq %r12, %rbp
movl %r11d, %r12d
addq %rbp, %r12
subq $-0x80000000, %r12      # imm = 0x80000000
shrq $0x20, %r15
addq %r13, %r15
shrq $0x20, %r11
shrq $0x20, %r12
addl %r8d, %ecx
addl $0x36, %ecx
movl %ebx, %r8d
shrq $0x20, %rbx
movq %rdx, %r13
imulq %rbx, %r13
imulq %r8, %rdx
imulq %r14, %rbx
imulq %r8, %r14
shrq $0x20, %r14
movl %ebx, %r8d
addq %r14, %r8
movl %edx, %r14d
addq %r8, %r14
subq $-0x80000000, %r14      # imm = 0x80000000
shrq $0x20, %rbx
addq %r13, %rbx
shrq $0x20, %rdx
addq %rbx, %rdx
shrq $0x20, %r14
addq %rdx, %r14
notq %r14
addq %r15, %r11
leaq (%r11,%r12), %r8
leaq (%r12,%r11), %rdx
decq %rdx
addq %r14, %r8
decq %r8
negl %r10d
movl %r10d, (%r9)
subq $0x8, %rsp
pushq %r9
pushq %rsi
pushq %rax
callq 0x8864
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq