// File: /workspace/github_c_makefile_star2_O1/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, %r15
movabsq $0x10000000000000, %r10 # imm = 0x10000000000000
leaq -0x1(%r10), %rbx
andq %r15, %rbx
shrq $0x34, %r15
andl $0x7ff, %r15d           # imm = 0x7FF
movq %rbx, %rdi
btsq $0x34, %rdi
testl %r15d, %r15d
movq %rdi, %r12
cmoveq %rbx, %r12
leal -0x433(%r15), %ecx
movl $0xfffffbce, %r14d      # imm = 0xFFFFFBCE
cmovnel %ecx, %r14d
leaq (%r12,%r12), %r13
leal -0x1(%r14), %edx
leaq 0x1(,%r12,2), %r11
testl %r15d, %r15d
je 0x8672
movl %edx, %r8d
jmp 0x869a
movabsq $0x1fffffffffffff, %rcx # imm = 0x1FFFFFFFFFFFFF
andq %r11, %rcx
bsrq %rcx, %rcx
movl %ecx, %ebp
notb %cl
addb $0x36, %cl
shlq %cl, %r11
xorl $0x3f, %ebp
movl %r14d, %r8d
subl %ebp, %r8d
addl $0x9, %r8d
bsrq %rbx, %rcx
notb %cl
addb $0x35, %cl
shlq %cl, %rbx
testl %r15d, %r15d
cmoveq %rbx, %rdi
decq %r13
addl $-0x2, %r14d
cmpq %r10, %r12
movabsq $0x3fffffffffffff, %rbx # imm = 0x3FFFFFFFFFFFFF
cmovneq %r13, %rbx
cmovel %r14d, %edx
subl %r8d, %edx
addb $0xa, %dl
movl %edx, %ecx
shlq %cl, %rbx
shlq $0xa, %r11
movl $0xffffffce, %ecx       # imm = 0xFFFFFFCE
subl %r8d, %ecx
cvtsi2sd %ecx, %xmm0
mulsd 0x48cc(%rip), %xmm0     # 0xcfb8
shlq $0xb, %rdi
roundsd $0xa, %xmm0, %xmm0
cvttsd2si %xmm0, %ecx
movslq %ecx, %r10
leaq 0x48bc(%rip), %rcx      # 0xcfc0
movq 0xab8(%rcx,%r10,8), %rdx
leaq 0x5e2d(%rip), %rcx      # 0xe540
movl 0x55c(%rcx,%r10,4), %ecx
movq %rdi, %r15
shrq $0x20, %r15
movl %edi, %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 0x888d
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq