#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ fabs(double const);
scalar_t__ floor(int /*<<< orphan*/);
int /*<<< orphan*/ log10(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ qd_abs(double const *, double *);
int /*<<< orphan*/ qd_div(double *, double *, double *);
int /*<<< orphan*/ qd_div_qd_d(double *, double, double *);
int qd_geq_qd_d(double *, double);
int qd_gt_qd_d(double *, double);
int /*<<< orphan*/ qd_ldexp(double *, int);
int qd_lt_qd_d(double *, double);
int /*<<< orphan*/ qd_mul(double *, double *, double *);
int /*<<< orphan*/ qd_mul_d(double *, double, double *);
int /*<<< orphan*/ qd_npwr(double *, int, double *);
int /*<<< orphan*/ qd_real(double, double *);
int /*<<< orphan*/ qd_sub_qd_d(double *, double, double *);
void qd_to_digits(const double *a, char *s, int *expn, int precision) {
  int D = precision + 1;
  double acc[4];
  double tmp[4];
  int i, d, e;
  qd_abs(a, acc);
  if (a[0] == 0.0) {
    expn = 0;
    for (i = 0; i < precision; i++)
      s[i] = '0';
    return;
  }
  e = (int)(floor(log10(fabs(a[0]))));
  if (e < -300) {
    qd_real(10.0, tmp);
    qd_npwr(tmp, 300, tmp);
    qd_mul(acc, tmp, acc);
    qd_real(10.0, tmp);
    qd_npwr(tmp, e + 300, tmp);
    qd_div(acc, tmp, acc);
  } else if (e > 300) {
    qd_ldexp(acc, -53);
    qd_real(10.0, tmp);
    qd_npwr(tmp, e, tmp);
    qd_div(acc, tmp, acc);
    qd_ldexp(acc, 53);
  } else {
    qd_real(10.0, tmp);
    qd_npwr(tmp, e, tmp);
    qd_div(acc, tmp, acc);
  }
  if (qd_gt_qd_d(acc, 10.0) == 1) {
    qd_div_qd_d(acc, 10.0, acc);
    e++;
  } else if (qd_lt_qd_d(acc, 1.0) == 1) {
    qd_mul_d(acc, 10.0, acc);
    e--;
  }
  if ((qd_geq_qd_d(acc, 10.0) == 1) || (qd_lt_qd_d(acc, 1.0) == 1)) {
    printf("qd_to_digits: cannot compute exponent");
    return;
  }
  for (i = 0; i < D; i++) {
    d = ((int)acc[0]);
    qd_sub_qd_d(acc, (double)d, acc);
    qd_mul_d(acc, 10.0, acc);
    s[i] = ((char)(d + '0'));
  }
  for (i = D - 1; i > 0; i--) {
    if (s[i] < '0') {
      s[i - 1]--;
      s[i] += 10;
    } else if (s[i] > '9') {
      s[i - 1]++;
      s[i] -= 10;
    }
  }
  if (s[0] <= '0') {
    printf("qd_to_digits: nonpositive leading digit");
    return;
  }
  if (s[D - 1] >= '5') {
    s[D - 2]++;
    i = D - 2;
    while (i > 0 && s[i] > '9') {
      s[i] -= 10;
      s[--i]++;
    }
  }
  if (s[0] > '9') {
    e++;
    for (i = precision; i >= 2; i--)
      s[i] = s[i - 1];
    s[0] = '1';
    s[1] = '0';
  }
  s[precision] = 0;
  *expn = e;
}


x86 assembly (clang, -O0):
<qd_to_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1040 <qd_abs@plt>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1282 <qd_to_digits+0x82>
jp     1282 <qd_to_digits+0x82>
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    127d <qd_to_digits+0x7d>
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movb   $0x30,(%rax,%rcx,1)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1257 <qd_to_digits+0x57>
jmp    16ba <qd_to_digits+0x4ba>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1070 <fabs@plt>
mov    %eax,%edi
call   10e0 <log10@plt>
mov    %eax,%edi
call   1110 <floor@plt>
mov    %eax,-0x6c(%rbp)
cmpl   $0xfffffed4,-0x6c(%rbp)
jge    131e <qd_to_digits+0x11e>
lea    -0x60(%rbp),%rdi
movsd  0xd47(%rip),%xmm0
call   10d0 <qd_real@plt>
lea    -0x60(%rbp),%rdi
lea    -0x60(%rbp),%rdx
mov    $0x12c,%esi
call   1090 <qd_npwr@plt>
lea    -0x40(%rbp),%rdi
lea    -0x60(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   10c0 <qd_mul@plt>
lea    -0x60(%rbp),%rdi
movsd  0xd13(%rip),%xmm0
call   10d0 <qd_real@plt>
lea    -0x60(%rbp),%rdi
mov    -0x6c(%rbp),%esi
add    $0x12c,%esi
lea    -0x60(%rbp),%rdx
call   1090 <qd_npwr@plt>
lea    -0x40(%rbp),%rdi
lea    -0x60(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   10f0 <qd_div@plt>
jmp    13b5 <qd_to_digits+0x1b5>
cmpl   $0x12c,-0x6c(%rbp)
jle    137e <qd_to_digits+0x17e>
lea    -0x40(%rbp),%rdi
mov    $0xffffffcb,%esi
call   1030 <qd_ldexp@plt>
lea    -0x60(%rbp),%rdi
movsd  0xcbb(%rip),%xmm0
call   10d0 <qd_real@plt>
lea    -0x60(%rbp),%rdi
mov    -0x6c(%rbp),%esi
lea    -0x60(%rbp),%rdx
call   1090 <qd_npwr@plt>
lea    -0x40(%rbp),%rdi
lea    -0x60(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   10f0 <qd_div@plt>
lea    -0x40(%rbp),%rdi
mov    $0x35,%esi
call   1030 <qd_ldexp@plt>
jmp    13b0 <qd_to_digits+0x1b0>
lea    -0x60(%rbp),%rdi
movsd  0xc76(%rip),%xmm0
call   10d0 <qd_real@plt>
lea    -0x60(%rbp),%rdi
mov    -0x6c(%rbp),%esi
lea    -0x60(%rbp),%rdx
call   1090 <qd_npwr@plt>
lea    -0x40(%rbp),%rdi
lea    -0x60(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   10f0 <qd_div@plt>
jmp    13b5 <qd_to_digits+0x1b5>
lea    -0x40(%rbp),%rdi
movsd  0xc3f(%rip),%xmm0
call   1100 <qd_gt_qd_d@plt>
cmp    $0x1,%eax
jne    13f2 <qd_to_digits+0x1f2>
lea    -0x40(%rbp),%rdi
lea    -0x40(%rbp),%rsi
movsd  0xc21(%rip),%xmm0
call   10a0 <qd_div_qd_d@plt>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    142f <qd_to_digits+0x22f>
lea    -0x40(%rbp),%rdi
movsd  0xc0a(%rip),%xmm0
call   1120 <qd_lt_qd_d@plt>
cmp    $0x1,%eax
jne    142a <qd_to_digits+0x22a>
lea    -0x40(%rbp),%rdi
lea    -0x40(%rbp),%rsi
movsd  0xbe4(%rip),%xmm0
call   10b0 <qd_mul_d@plt>
mov    -0x6c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x6c(%rbp)
jmp    142f <qd_to_digits+0x22f>
lea    -0x40(%rbp),%rdi
movsd  0xbc5(%rip),%xmm0
call   1060 <qd_geq_qd_d@plt>
cmp    $0x1,%eax
je     1463 <qd_to_digits+0x263>
lea    -0x40(%rbp),%rdi
movsd  0xbb3(%rip),%xmm0
call   1120 <qd_lt_qd_d@plt>
cmp    $0x1,%eax
jne    1474 <qd_to_digits+0x274>
lea    0xba6(%rip),%rdi
call   1050 <printf@plt>
jmp    16ba <qd_to_digits+0x4ba>
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    14d7 <qd_to_digits+0x2d7>
cvttsd2si -0x40(%rbp),%eax
mov    %eax,-0x68(%rbp)
lea    -0x40(%rbp),%rdi
cvtsi2sdl -0x68(%rbp),%xmm0
lea    -0x40(%rbp),%rsi
call   1080 <qd_sub_qd_d@plt>
lea    -0x40(%rbp),%rdi
lea    -0x40(%rbp),%rsi
movsd  0xb4f(%rip),%xmm0
call   10b0 <qd_mul_d@plt>
mov    -0x68(%rbp),%eax
add    $0x30,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    147b <qd_to_digits+0x27b>
mov    -0x20(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x64(%rbp)
cmpl   $0x0,-0x64(%rbp)
jle    1581 <qd_to_digits+0x381>
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jge    152c <qd_to_digits+0x32c>
mov    -0x10(%rbp),%rax
mov    -0x64(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
add    $0xff,%dl
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
add    $0xa,%edx
mov    %dl,(%rax,%rcx,1)
jmp    156e <qd_to_digits+0x36e>
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
jle    1569 <qd_to_digits+0x369>
mov    -0x10(%rbp),%rax
mov    -0x64(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
add    $0x1,%dl
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
sub    $0xa,%edx
mov    %dl,(%rax,%rcx,1)
jmp    156e <qd_to_digits+0x36e>
jmp    1573 <qd_to_digits+0x373>
mov    -0x64(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x64(%rbp)
jmp    14e0 <qd_to_digits+0x2e0>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jg     15a2 <qd_to_digits+0x3a2>
lea    0xa9e(%rip),%rdi
call   1050 <printf@plt>
jmp    16ba <qd_to_digits+0x4ba>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x35,%eax
jl     1644 <qd_to_digits+0x444>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
add    $0x1,%dl
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x64(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x64(%rbp)
mov    %al,-0x6d(%rbp)
jle    15ff <qd_to_digits+0x3ff>
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
setg   %al
mov    %al,-0x6d(%rbp)
mov    -0x6d(%rbp),%al
test   $0x1,%al
jne    160f <qd_to_digits+0x40f>
jmp    163f <qd_to_digits+0x43f>
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
sub    $0xa,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    -0x64(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x64(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
add    $0x1,%dl
mov    %dl,(%rax,%rcx,1)
jmp    15db <qd_to_digits+0x3db>
jmp    1644 <qd_to_digits+0x444>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jle    16a5 <qd_to_digits+0x4a5>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x64(%rbp)
cmpl   $0x2,-0x64(%rbp)
jl     1696 <qd_to_digits+0x496>
mov    -0x10(%rbp),%rax
mov    -0x64(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x64(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x64(%rbp)
jmp    1663 <qd_to_digits+0x463>
mov    -0x10(%rbp),%rax
movb   $0x31,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x30,0x1(%rax)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x6c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qd_to_digits>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %ecx,%r12d
mov    %rdx,%r15
mov    %rsi,%r13
mov    %rdi,%rbx
lea    0x10(%rsp),%rsi
call   1040 <qd_abs@plt>
movsd  (%rbx),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1262 <qd_to_digits+0x52>
jp     1262 <qd_to_digits+0x52>
test   %r12d,%r12d
jle    1413 <qd_to_digits+0x203>
mov    %r12d,%edx
mov    %r13,%rdi
mov    $0x30,%esi
call   1070 <memset@plt>
jmp    1413 <qd_to_digits+0x203>
call   1080 <fabs@plt>
mov    %eax,%edi
call   10f0 <log10@plt>
mov    %eax,%edi
call   1120 <floor@plt>
mov    %rax,%r14
cmp    $0xfffffed3,%r14d
jg     12e9 <qd_to_digits+0xd9>
movsd  0xd77(%rip),%xmm0
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
call   10e0 <qd_real@plt>
mov    %rbx,%rdi
mov    $0x12c,%esi
mov    %rbx,%rdx
call   10a0 <qd_npwr@plt>
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   10d0 <qd_mul@plt>
movsd  0xd3f(%rip),%xmm0
mov    %rbx,%rdi
call   10e0 <qd_real@plt>
lea    0x12c(%r14),%esi
mov    %rbx,%rdi
mov    %rbx,%rdx
call   10a0 <qd_npwr@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
jmp    1372 <qd_to_digits+0x162>
cmp    $0x12d,%r14d
jl     1344 <qd_to_digits+0x134>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xffffffcb,%esi
call   1030 <qd_ldexp@plt>
movsd  0xcf4(%rip),%xmm0
lea    0x30(%rsp),%rbp
mov    %rbp,%rdi
call   10e0 <qd_real@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %rbp,%rdx
call   10a0 <qd_npwr@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
call   1100 <qd_div@plt>
mov    %rbx,%rdi
mov    $0x35,%esi
call   1030 <qd_ldexp@plt>
jmp    1377 <qd_to_digits+0x167>
movsd  0xcb4(%rip),%xmm0
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
call   10e0 <qd_real@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
call   10a0 <qd_npwr@plt>
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
mov    %rdi,%rdx
call   1100 <qd_div@plt>
lea    0x10(%rsp),%rdi
movsd  0xc7c(%rip),%xmm0
call   1110 <qd_gt_qd_d@plt>
cmp    $0x1,%eax
jne    13a9 <qd_to_digits+0x199>
movsd  0xc6a(%rip),%xmm0
lea    0x10(%rsp),%rdi
mov    %rdi,%rsi
call   10b0 <qd_div_qd_d@plt>
add    $0x1,%r14d
jmp    13d9 <qd_to_digits+0x1c9>
lea    0x10(%rsp),%rdi
movsd  0xc52(%rip),%xmm0
call   1130 <qd_lt_qd_d@plt>
cmp    $0x1,%eax
jne    13d9 <qd_to_digits+0x1c9>
movsd  0xc38(%rip),%xmm0
lea    0x10(%rsp),%rdi
mov    %rdi,%rsi
call   10c0 <qd_mul_d@plt>
add    $0xffffffff,%r14d
lea    0x10(%rsp),%rdi
movsd  0xc1a(%rip),%xmm0
call   1060 <qd_geq_qd_d@plt>
cmp    $0x1,%eax
je     1407 <qd_to_digits+0x1f7>
lea    0x10(%rsp),%rdi
movsd  0xc0b(%rip),%xmm0
call   1130 <qd_lt_qd_d@plt>
cmp    $0x1,%eax
jne    1422 <qd_to_digits+0x212>
lea    0xc02(%rip),%rdi
call   1050 <printf@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
test   %r12d,%r12d
js     14e4 <qd_to_digits+0x2d4>
mov    %r14,0x8(%rsp)
mov    %r15,(%rsp)
lea    0x1(%r12),%ebp
xor    %r14d,%r14d
lea    0x10(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  0x10(%rsp),%xmm0
cvttsd2si %xmm0,%r15d
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1090 <qd_sub_qd_d@plt>
mov    %rbx,%rdi
movsd  0xb87(%rip),%xmm0
mov    %rbx,%rsi
call   10c0 <qd_mul_d@plt>
add    $0x30,%r15b
mov    %r15b,0x0(%r13,%r14,1)
add    $0x1,%r14
cmp    %r14,%rbp
jne    1450 <qd_to_digits+0x240>
test   %r12d,%r12d
mov    (%rsp),%r15
mov    0x8(%rsp),%r14
jle    14e4 <qd_to_digits+0x2d4>
mov    $0xffffffff,%eax
mov    %r12d,%ecx
jmp    14ce <qd_to_digits+0x2be>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%dl
mov    $0xff,%bl
lea    (%rcx,%rax,1),%esi
add    %bl,0x0(%r13,%rsi,1)
add    %dl,0x0(%r13,%rcx,1)
lea    -0x1(%rcx),%rdx
cmp    $0x1,%rcx
mov    %rdx,%rcx
jle    14e4 <qd_to_digits+0x2d4>
movzbl 0x0(%r13,%rcx,1),%edx
cmp    $0x30,%dl
jl     14b0 <qd_to_digits+0x2a0>
cmp    $0x3a,%dl
jb     14c1 <qd_to_digits+0x2b1>
mov    $0xf6,%dl
mov    $0x1,%bl
jmp    14b4 <qd_to_digits+0x2a4>
cmpb   $0x30,0x0(%r13)
jg     14f7 <qd_to_digits+0x2e7>
lea    0xb44(%rip),%rdi
jmp    140e <qd_to_digits+0x1fe>
movslq %r12d,%rax
cmpb   $0x35,0x0(%r13,%rax,1)
jl     154b <qd_to_digits+0x33b>
addb   $0x1,-0x1(%r13,%rax,1)
cmp    $0x2,%r12d
jl     154b <qd_to_digits+0x33b>
lea    -0x1(%rax),%rcx
mov    %ecx,%edx
lea    (%rdx,%r13,1),%rcx
mov    0x0(%r13,%rdx,1),%dl
mov    %r12d,%esi
lea    -0x2(%r12),%edi
add    %r13,%rdi
xor    %ebp,%ebp
cmp    $0x3a,%dl
jl     154b <qd_to_digits+0x33b>
add    $0xf6,%dl
mov    %dl,(%rcx,%rbp,1)
movzbl (%rdi,%rbp,1),%edx
add    $0x1,%dl
mov    %dl,(%rdi,%rbp,1)
add    $0xffffffffffffffff,%rbp
lea    (%rsi,%rbp,1),%ebx
cmp    $0x1,%ebx
jg     152a <qd_to_digits+0x31a>
cmpb   $0x3a,0x0(%r13)
jl     15b8 <qd_to_digits+0x3a8>
mov    %r14,0x8(%rsp)
cmp    $0x2,%r12d
jl     15a8 <qd_to_digits+0x398>
mov    %r12d,%r14d
xor    %edx,%edx
mov    %r14,%rsi
sub    $0x2,%rsi
mov    $0x0,%ecx
cmovae %rsi,%rcx
add    $0x1,%rcx
cmp    $0x4,%rcx
jae    15c6 <qd_to_digits+0x3b6>
mov    %r14,%rdx
add    $0x1,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x2(%rdx),%ecx
movzbl 0x0(%r13,%rcx,1),%ecx
mov    %cl,-0x1(%r13,%rdx,1)
add    $0xffffffffffffffff,%rdx
cmp    $0x2,%rdx
ja     1590 <qd_to_digits+0x380>
mov    0x8(%rsp),%r14
add    $0x1,%r14d
movw   $0x3031,0x0(%r13)
movb   $0x0,0x0(%r13,%rax,1)
mov    %r14d,(%r15)
jmp    1413 <qd_to_digits+0x203>
mov    %r14d,%esi
sub    $0x2,%esi
cmovb  %edx,%esi
mov    %r14,%rdi
sub    $0x2,%rdi
cmovae %rdi,%rdx
add    $0xffffffff,%r12d
cmp    %esi,%r12d
jb     157c <qd_to_digits+0x36c>
mov    %rdx,%rsi
shr    $0x20,%rsi
jne    157c <qd_to_digits+0x36c>
lea    (%r14,%r13,1),%rsi
mov    %rsi,%rdi
sub    %rdx,%rdi
cmp    %rsi,%rdi
ja     157c <qd_to_digits+0x36c>
lea    (%r12,%r13,1),%rsi
mov    %rsi,%rdi
sub    %rdx,%rdi
cmp    %rsi,%rdi
ja     157c <qd_to_digits+0x36c>
cmp    $0x2,%r14
mov    $0x2,%edx
cmovb  %r14,%rdx
lea    (%rdx,%r13,1),%rsi
lea    (%r12,%r13,1),%rdi
add    $0x1,%rdi
cmp    %rdi,%rsi
jae    1646 <qd_to_digits+0x436>
lea    (%r14,%r13,1),%rsi
add    $0x1,%rsi
add    %r12,%rdx
sub    %r14,%rdx
add    %r13,%rdx
cmp    %rsi,%rdx
jb     157c <qd_to_digits+0x36c>
mov    $0xffffffff,%r9d
cmp    $0x10,%rcx
jae    1659 <qd_to_digits+0x449>
xor    %edi,%edi
jmp    1741 <qd_to_digits+0x531>
mov    %rcx,%rdi
and    $0xfffffffffffffff0,%rdi
lea    -0x10(%rdi),%rdx
mov    %rdx,%rbp
shr    $0x4,%rbp
add    $0x1,%rbp
mov    %ebp,%r8d
and    $0x3,%r8d
cmp    $0x30,%rdx
jae    1680 <qd_to_digits+0x470>
xor    %edx,%edx
jmp    16f9 <qd_to_digits+0x4e9>
mov    %r8,(%rsp)
and    $0xfffffffffffffffc,%rbp
lea    (%r14,%r13,1),%rsi
add    $0xfffffffffffffff1,%rsi
lea    -0x20(%r14,%r9,1),%r10
lea    (%r14,%r9,1),%r11
add    $0xfffffffffffffff0,%r11
lea    (%r14,%r9,1),%r12
add    $0xffffffffffffffd0,%r12
lea    (%r14,%r9,1),%r8
xor    %edx,%edx
lea    (%r8,%rdx,1),%ebx
movups -0xf(%r13,%rbx,1),%xmm0
movups %xmm0,(%rsi,%rdx,1)
lea    (%r11,%rdx,1),%ebx
movups -0xf(%r13,%rbx,1),%xmm0
movups %xmm0,-0x10(%rsi,%rdx,1)
lea    (%r10,%rdx,1),%ebx
movups -0xf(%r13,%rbx,1),%xmm0
movups %xmm0,-0x20(%rsi,%rdx,1)
lea    (%r12,%rdx,1),%ebx
movupd -0xf(%r13,%rbx,1),%xmm0
movupd %xmm0,-0x30(%rsi,%rdx,1)
add    $0xffffffffffffffc0,%rdx
add    $0xfffffffffffffffc,%rbp
jne    16ab <qd_to_digits+0x49b>
neg    %rdx
mov    (%rsp),%r8
test   %r8,%r8
je     1733 <qd_to_digits+0x523>
mov    %r14,%rsi
sub    %rdx,%rsi
add    %r13,%rsi
add    $0xfffffffffffffff1,%rsi
lea    (%r14,%r9,1),%rbp
sub    %rdx,%rbp
shl    $0x4,%r8
xor    %edx,%edx
lea    (%rdx,%rbp,1),%ebx
movupd -0xf(%r13,%rbx,1),%xmm0
movupd %xmm0,(%rsi,%rdx,1)
add    $0xfffffffffffffff0,%rdx
mov    %r8,%rbx
add    %rdx,%rbx
jne    1718 <qd_to_digits+0x508>
cmp    %rdi,%rcx
je     15a8 <qd_to_digits+0x398>
test   $0xc,%cl
je     1798 <qd_to_digits+0x588>
xor    %esi,%esi
mov    %r14,%rdx
sub    $0x2,%rdx
cmovae %rdx,%rsi
add    $0x1,%rsi
mov    %rsi,%r8
and    $0xfffffffffffffffc,%r8
mov    %r14,%rdx
sub    %r8,%rdx
and    $0xfffffffffffffffc,%rcx
neg    %rcx
neg    %rdi
lea    (%r14,%r13,1),%rbp
add    $0xfffffffffffffffd,%rbp
add    %r14,%r9
lea    (%r9,%rdi,1),%ebx
mov    -0x3(%r13,%rbx,1),%ebx
mov    %ebx,0x0(%rbp,%rdi,1)
add    $0xfffffffffffffffc,%rdi
cmp    %rdi,%rcx
jne    1774 <qd_to_digits+0x564>
cmp    %r8,%rsi
jne    157f <qd_to_digits+0x36f>
jmp    15a8 <qd_to_digits+0x398>
sub    %rdi,%r14
jmp    157c <qd_to_digits+0x36c>

LLVM IR (-O0):
@.str = [38 x i8] c"qd_to_digits: cannot compute exponent\00"
@.str.1 = [40 x i8] c"qd_to_digits: nonpositive leading digit\00"
define void @qd_to_digits(double* %0, i8* %1, i32* %2, i32 %3) {
%5 = alloca double*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca [4 x double]
%11 = alloca [4 x double]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store double* %0, double** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%15 = load i32, i32* %8
%16 = add nsw i32 %15, 1
store i32 %16, i32* %9
%17 = load double*, double** %5
%18 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%19 = call i32 @qd_abs(double* %17, double* %18)
%20 = load double*, double** %5
%21 = getelementptr inbounds double, double* %20, i64 0
%22 = load double, double* %21
%23 = fcmp oeq double %22, 0.000000e+00
br i1 %23, label %24, label %38
24: ; preds = %4
store i32* null, i32** %7
store i32 0, i32* %12
br label %25
25: ; preds = %34, %24
%26 = load i32, i32* %12
%27 = load i32, i32* %8
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %37
29: ; preds = %25
%30 = load i8*, i8** %6
%31 = load i32, i32* %12
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %30, i64 %32
store i8 48, i8* %33
br label %34
34: ; preds = %29
%35 = load i32, i32* %12
%36 = add nsw i32 %35, 1
store i32 %36, i32* %12
br label %25
37: ; preds = %25
br label %312
38: ; preds = %4
%39 = load double*, double** %5
%40 = getelementptr inbounds double, double* %39, i64 0
%41 = load double, double* %40
%42 = call i32 @fabs(double %41)
%43 = call i32 @log10(i32 %42)
%44 = call i64 @floor(i32 %43)
%45 = trunc i64 %44 to i32
store i32 %45, i32* %14
%46 = load i32, i32* %14
%47 = icmp slt i32 %46, -300
br i1 %47, label %48, label %69
48: ; preds = %38
%49 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%50 = call i32 @qd_real(double 1.000000e+01, double* %49)
%51 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%52 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%53 = call i32 @qd_npwr(double* %51, i32 300, double* %52)
%54 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%55 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%56 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%57 = call i32 @qd_mul(double* %54, double* %55, double* %56)
%58 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%59 = call i32 @qd_real(double 1.000000e+01, double* %58)
%60 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%61 = load i32, i32* %14
%62 = add nsw i32 %61, 300
%63 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%64 = call i32 @qd_npwr(double* %60, i32 %62, double* %63)
%65 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%66 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%67 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%68 = call i32 @qd_div(double* %65, double* %66, double* %67)
br label %99
69: ; preds = %38
%70 = load i32, i32* %14
%71 = icmp sgt i32 %70, 300
br i1 %71, label %72, label %87
72: ; preds = %69
%73 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%74 = call i32 @qd_ldexp(double* %73, i32 -53)
%75 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%76 = call i32 @qd_real(double 1.000000e+01, double* %75)
%77 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%78 = load i32, i32* %14
%79 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%80 = call i32 @qd_npwr(double* %77, i32 %78, double* %79)
%81 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%82 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%83 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%84 = call i32 @qd_div(double* %81, double* %82, double* %83)
%85 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%86 = call i32 @qd_ldexp(double* %85, i32 53)
br label %98
87: ; preds = %69
%88 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%89 = call i32 @qd_real(double 1.000000e+01, double* %88)
%90 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%91 = load i32, i32* %14
%92 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%93 = call i32 @qd_npwr(double* %90, i32 %91, double* %92)
%94 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%95 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%96 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%97 = call i32 @qd_div(double* %94, double* %95, double* %96)
br label %98
98: ; preds = %87, %72
br label %99
99: ; preds = %98, %48
%100 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%101 = call i32 @qd_gt_qd_d(double* %100, double 1.000000e+01)
%102 = icmp eq i32 %101, 1
br i1 %102, label %103, label %109
103: ; preds = %99
%104 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%105 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%106 = call i32 @qd_div_qd_d(double* %104, double 1.000000e+01, double* %105)
%107 = load i32, i32* %14
%108 = add nsw i32 %107, 1
store i32 %108, i32* %14
br label %120
109: ; preds = %99
%110 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%111 = call i32 @qd_lt_qd_d(double* %110, double 1.000000e+00)
%112 = icmp eq i32 %111, 1
br i1 %112, label %113, label %119
113: ; preds = %109
%114 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%115 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%116 = call i32 @qd_mul_d(double* %114, double 1.000000e+01, double* %115)
%117 = load i32, i32* %14
%118 = add nsw i32 %117, -1
store i32 %118, i32* %14
br label %119
119: ; preds = %113, %109
br label %120
120: ; preds = %119, %103
%121 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%122 = call i32 @qd_geq_qd_d(double* %121, double 1.000000e+01)
%123 = icmp eq i32 %122, 1
br i1 %123, label %128, label %124
124: ; preds = %120
%125 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%126 = call i32 @qd_lt_qd_d(double* %125, double 1.000000e+00)
%127 = icmp eq i32 %126, 1
br i1 %127, label %128, label %130
128: ; preds = %124, %120
%129 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %312
130: ; preds = %124
store i32 0, i32* %12
br label %131
131: ; preds = %154, %130
%132 = load i32, i32* %12
%133 = load i32, i32* %9
%134 = icmp slt i32 %132, %133
br i1 %134, label %135, label %157
135: ; preds = %131
%136 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%137 = load double, double* %136
%138 = fptosi double %137 to i32
store i32 %138, i32* %13
%139 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%140 = load i32, i32* %13
%141 = sitofp i32 %140 to double
%142 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%143 = call i32 @qd_sub_qd_d(double* %139, double %141, double* %142)
%144 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%145 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%146 = call i32 @qd_mul_d(double* %144, double 1.000000e+01, double* %145)
%147 = load i32, i32* %13
%148 = add nsw i32 %147, 48
%149 = trunc i32 %148 to i8
%150 = load i8*, i8** %6
%151 = load i32, i32* %12
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds i8, i8* %150, i64 %152
store i8 %149, i8* %153
br label %154
154: ; preds = %135
%155 = load i32, i32* %12
%156 = add nsw i32 %155, 1
store i32 %156, i32* %12
br label %131
157: ; preds = %131
%158 = load i32, i32* %9
%159 = sub nsw i32 %158, 1
store i32 %159, i32* %12
br label %160
160: ; preds = %213, %157
%161 = load i32, i32* %12
%162 = icmp sgt i32 %161, 0
br i1 %162, label %163, label %216
163: ; preds = %160
%164 = load i8*, i8** %6
%165 = load i32, i32* %12
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds i8, i8* %164, i64 %166
%168 = load i8, i8* %167
%169 = sext i8 %168 to i32
%170 = icmp slt i32 %169, 48
br i1 %170, label %171, label %187
171: ; preds = %163
%172 = load i8*, i8** %6
%173 = load i32, i32* %12
%174 = sub nsw i32 %173, 1
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds i8, i8* %172, i64 %175
%177 = load i8, i8* %176
%178 = add i8 %177, -1
store i8 %178, i8* %176
%179 = load i8*, i8** %6
%180 = load i32, i32* %12
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds i8, i8* %179, i64 %181
%183 = load i8, i8* %182
%184 = sext i8 %183 to i32
%185 = add nsw i32 %184, 10
%186 = trunc i32 %185 to i8
store i8 %186, i8* %182
br label %212
187: ; preds = %163
%188 = load i8*, i8** %6
%189 = load i32, i32* %12
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds i8, i8* %188, i64 %190
%192 = load i8, i8* %191
%193 = sext i8 %192 to i32
%194 = icmp sgt i32 %193, 57
br i1 %194, label %195, label %211
195: ; preds = %187
%196 = load i8*, i8** %6
%197 = load i32, i32* %12
%198 = sub nsw i32 %197, 1
%199 = sext i32 %198 to i64
%200 = getelementptr inbounds i8, i8* %196, i64 %199
%201 = load i8, i8* %200
%202 = add i8 %201, 1
store i8 %202, i8* %200
%203 = load i8*, i8** %6
%204 = load i32, i32* %12
%205 = sext i32 %204 to i64
%206 = getelementptr inbounds i8, i8* %203, i64 %205
%207 = load i8, i8* %206
%208 = sext i8 %207 to i32
%209 = sub nsw i32 %208, 10
%210 = trunc i32 %209 to i8
store i8 %210, i8* %206
br label %211
211: ; preds = %195, %187
br label %212
212: ; preds = %211, %171
br label %213
213: ; preds = %212
%214 = load i32, i32* %12
%215 = add nsw i32 %214, -1
store i32 %215, i32* %12
br label %160
216: ; preds = %160
%217 = load i8*, i8** %6
%218 = getelementptr inbounds i8, i8* %217, i64 0
%219 = load i8, i8* %218
%220 = sext i8 %219 to i32
%221 = icmp sle i32 %220, 48
br i1 %221, label %222, label %224
222: ; preds = %216
%223 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %312
224: ; preds = %216
%225 = load i8*, i8** %6
%226 = load i32, i32* %9
%227 = sub nsw i32 %226, 1
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds i8, i8* %225, i64 %228
%230 = load i8, i8* %229
%231 = sext i8 %230 to i32
%232 = icmp sge i32 %231, 53
br i1 %232, label %233, label %273
233: ; preds = %224
%234 = load i8*, i8** %6
%235 = load i32, i32* %9
%236 = sub nsw i32 %235, 2
%237 = sext i32 %236 to i64
%238 = getelementptr inbounds i8, i8* %234, i64 %237
%239 = load i8, i8* %238
%240 = add i8 %239, 1
store i8 %240, i8* %238
%241 = load i32, i32* %9
%242 = sub nsw i32 %241, 2
store i32 %242, i32* %12
br label %243
243: ; preds = %256, %233
%244 = load i32, i32* %12
%245 = icmp sgt i32 %244, 0
br i1 %245, label %246, label %254
246: ; preds = %243
%247 = load i8*, i8** %6
%248 = load i32, i32* %12
%249 = sext i32 %248 to i64
%250 = getelementptr inbounds i8, i8* %247, i64 %249
%251 = load i8, i8* %250
%252 = sext i8 %251 to i32
%253 = icmp sgt i32 %252, 57
br label %254
254: ; preds = %246, %243
%255 = phi i1 [ false, %243 ], [ %253, %246 ]
br i1 %255, label %256, label %272
256: ; preds = %254
%257 = load i8*, i8** %6
%258 = load i32, i32* %12
%259 = sext i32 %258 to i64
%260 = getelementptr inbounds i8, i8* %257, i64 %259
%261 = load i8, i8* %260
%262 = sext i8 %261 to i32
%263 = sub nsw i32 %262, 10
%264 = trunc i32 %263 to i8
store i8 %264, i8* %260
%265 = load i8*, i8** %6
%266 = load i32, i32* %12
%267 = add nsw i32 %266, -1
store i32 %267, i32* %12
%268 = sext i32 %267 to i64
%269 = getelementptr inbounds i8, i8* %265, i64 %268
%270 = load i8, i8* %269
%271 = add i8 %270, 1
store i8 %271, i8* %269
br label %243
272: ; preds = %254
br label %273
273: ; preds = %272, %224
%274 = load i8*, i8** %6
%275 = getelementptr inbounds i8, i8* %274, i64 0
%276 = load i8, i8* %275
%277 = sext i8 %276 to i32
%278 = icmp sgt i32 %277, 57
br i1 %278, label %279, label %305
279: ; preds = %273
%280 = load i32, i32* %14
%281 = add nsw i32 %280, 1
store i32 %281, i32* %14
%282 = load i32, i32* %8
store i32 %282, i32* %12
br label %283
283: ; preds = %297, %279
%284 = load i32, i32* %12
%285 = icmp sge i32 %284, 2
br i1 %285, label %286, label %300
286: ; preds = %283
%287 = load i8*, i8** %6
%288 = load i32, i32* %12
%289 = sub nsw i32 %288, 1
%290 = sext i32 %289 to i64
%291 = getelementptr inbounds i8, i8* %287, i64 %290
%292 = load i8, i8* %291
%293 = load i8*, i8** %6
%294 = load i32, i32* %12
%295 = sext i32 %294 to i64
%296 = getelementptr inbounds i8, i8* %293, i64 %295
store i8 %292, i8* %296
br label %297
297: ; preds = %286
%298 = load i32, i32* %12
%299 = add nsw i32 %298, -1
store i32 %299, i32* %12
br label %283
300: ; preds = %283
%301 = load i8*, i8** %6
%302 = getelementptr inbounds i8, i8* %301, i64 0
store i8 49, i8* %302
%303 = load i8*, i8** %6
%304 = getelementptr inbounds i8, i8* %303, i64 1
store i8 48, i8* %304
br label %305
305: ; preds = %300, %273
%306 = load i8*, i8** %6
%307 = load i32, i32* %8
%308 = sext i32 %307 to i64
%309 = getelementptr inbounds i8, i8* %306, i64 %308
store i8 0, i8* %309
%310 = load i32, i32* %14
%311 = load i32*, i32** %7
store i32 %310, i32* %311
br label %312
312: ; preds = %305, %222, %128, %37
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"qd_to_digits: cannot compute exponent\00"
@.str.1 = [40 x i8] c"qd_to_digits: nonpositive leading digit\00"
define void @qd_to_digits(double* %0, i8* nocapture %1, i32* nocapture writeonly %2, i32 %3) {
%5 = alloca [4 x double]
%6 = alloca [4 x double]
%7 = bitcast [4 x double]* %5 to i8*
%8 = bitcast [4 x double]* %6 to i8*
%9 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%10 = call i32 @qd_abs(double* %0, double* %9)
%11 = load double, double* %0
%12 = fcmp oeq double %11, 0.000000e+00
br i1 %12, label %13, label %17
13: ; preds = %4
%14 = icmp sgt i32 %3, 0
br i1 %14, label %15, label %312
15: ; preds = %13
%16 = zext i32 %3 to i64
br label %312
17: ; preds = %4
%18 = call i32 @fabs(double %11)
%19 = call i32 @log10(i32 %18)
%20 = call i64 @floor(i32 %19)
%21 = trunc i64 %20 to i32
%22 = icmp slt i32 %21, -300
br i1 %22, label %23, label %32
23: ; preds = %17
%24 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 0
%25 = call i32 @qd_real(double 1.000000e+01, double* %24)
%26 = call i32 @qd_npwr(double* %24, i32 300, double* %24)
%27 = call i32 @qd_mul(double* %9, double* %24, double* %9)
%28 = call i32 @qd_real(double 1.000000e+01, double* %24)
%29 = add nuw nsw i32 %21, 300
%30 = call i32 @qd_npwr(double* %24, i32 %29, double* %24)
%31 = call i32 @qd_div(double* %9, double* %24, double* %9)
br label %46
32: ; preds = %17
%33 = icmp sgt i32 %21, 300
br i1 %33, label %34, label %41
34: ; preds = %32
%35 = call i32 @qd_ldexp(double* %9, i32 -53)
%36 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 0
%37 = call i32 @qd_real(double 1.000000e+01, double* %36)
%38 = call i32 @qd_npwr(double* %36, i32 %21, double* %36)
%39 = call i32 @qd_div(double* %9, double* %36, double* %9)
%40 = call i32 @qd_ldexp(double* %9, i32 53)
br label %46
41: ; preds = %32
%42 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 0
%43 = call i32 @qd_real(double 1.000000e+01, double* %42)
%44 = call i32 @qd_npwr(double* %42, i32 %21, double* %42)
%45 = call i32 @qd_div(double* %9, double* %42, double* %9)
br label %46
46: ; preds = %34, %41, %23
%47 = call i32 @qd_gt_qd_d(double* %9, double 1.000000e+01)
%48 = icmp eq i32 %47, 1
br i1 %48, label %49, label %52
49: ; preds = %46
%50 = call i32 @qd_div_qd_d(double* %9, double 1.000000e+01, double* %9)
%51 = add nsw i32 %21, 1
br label %58
52: ; preds = %46
%53 = call i32 @qd_lt_qd_d(double* %9, double 1.000000e+00)
%54 = icmp eq i32 %53, 1
br i1 %54, label %55, label %58
55: ; preds = %52
%56 = call i32 @qd_mul_d(double* %9, double 1.000000e+01, double* %9)
%57 = add nsw i32 %21, -1
br label %58
58: ; preds = %52, %55, %49
%59 = phi i32 [ %51, %49 ], [ %57, %55 ], [ %21, %52 ]
%60 = call i32 @qd_geq_qd_d(double* %9, double 1.000000e+01)
%61 = icmp eq i32 %60, 1
br i1 %61, label %70, label %62
62: ; preds = %58
%63 = call i32 @qd_lt_qd_d(double* %9, double 1.000000e+00)
%64 = icmp eq i32 %63, 1
br i1 %64, label %70, label %65
65: ; preds = %62
%66 = icmp slt i32 %3, 0
br i1 %66, label %108, label %67
67: ; preds = %65
%68 = add nuw i32 %3, 1
%69 = zext i32 %68 to i64
br label %76
70: ; preds = %62, %58
%71 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %312
72: ; preds = %76
%73 = icmp sgt i32 %3, 0
br i1 %73, label %74, label %108
74: ; preds = %72
%75 = zext i32 %3 to i64
br label %88
76: ; preds = %67, %76
%77 = phi i64 [ 0, %67 ], [ %86, %76 ]
%78 = load double, double* %9
%79 = fptosi double %78 to i32
%80 = sitofp i32 %79 to double
%81 = call i32 @qd_sub_qd_d(double* %9, double %80, double* %9)
%82 = call i32 @qd_mul_d(double* %9, double 1.000000e+01, double* %9)
%83 = trunc i32 %79 to i8
%84 = add i8 %83, 48
%85 = getelementptr inbounds i8, i8* %1, i64 %77
store i8 %84, i8* %85
%86 = add nuw nsw i64 %77, 1
%87 = icmp eq i64 %86, %69
br i1 %87, label %72, label %76
88: ; preds = %74, %105
%89 = phi i64 [ %75, %74 ], [ %106, %105 ]
%90 = getelementptr inbounds i8, i8* %1, i64 %89
%91 = load i8, i8* %90
%92 = icmp slt i8 %91, 48
br i1 %92, label %95, label %93
93: ; preds = %88
%94 = icmp ugt i8 %91, 57
br i1 %94, label %95, label %105
95: ; preds = %93, %88
%96 = phi i8 [ -1, %88 ], [ 1, %93 ]
%97 = phi i8 [ 10, %88 ], [ -10, %93 ]
%98 = add nuw i64 %89, 4294967295
%99 = and i64 %98, 4294967295
%100 = getelementptr inbounds i8, i8* %1, i64 %99
%101 = load i8, i8* %100
%102 = add i8 %101, %96
store i8 %102, i8* %100
%103 = load i8, i8* %90
%104 = add i8 %103, %97
store i8 %104, i8* %90
br label %105
105: ; preds = %95, %93
%106 = add nsw i64 %89, -1
%107 = icmp sgt i64 %89, 1
br i1 %107, label %88, label %108
108: ; preds = %105, %65, %72
%109 = load i8, i8* %1
%110 = icmp slt i8 %109, 49
br i1 %110, label %111, label %113
111: ; preds = %108
%112 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %312
113: ; preds = %108
%114 = sext i32 %3 to i64
%115 = getelementptr inbounds i8, i8* %1, i64 %114
%116 = load i8, i8* %115
%117 = icmp sgt i8 %116, 52
br i1 %117, label %118, label %143
118: ; preds = %113
%119 = add nsw i32 %3, -1
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds i8, i8* %1, i64 %120
%122 = load i8, i8* %121
%123 = add i8 %122, 1
store i8 %123, i8* %121
%124 = icmp sgt i32 %3, 1
br i1 %124, label %125, label %143
125: ; preds = %118
%126 = zext i32 %119 to i64
%127 = getelementptr inbounds i8, i8* %1, i64 %126
%128 = load i8, i8* %127
br label %129
129: ; preds = %125, %133
%130 = phi i8 [ %141, %133 ], [ %128, %125 ]
%131 = phi i32 [ %137, %133 ], [ %119, %125 ]
%132 = icmp sgt i8 %130, 57
br i1 %132, label %133, label %143
133: ; preds = %129
%134 = zext i32 %131 to i64
%135 = getelementptr inbounds i8, i8* %1, i64 %134
%136 = add nsw i8 %130, -10
store i8 %136, i8* %135
%137 = add nsw i32 %131, -1
%138 = zext i32 %137 to i64
%139 = getelementptr inbounds i8, i8* %1, i64 %138
%140 = load i8, i8* %139
%141 = add i8 %140, 1
store i8 %141, i8* %139
%142 = icmp sgt i32 %131, 1
br i1 %142, label %129, label %143
143: ; preds = %133, %129, %118, %113
%144 = load i8, i8* %1
%145 = icmp sgt i8 %144, 57
br i1 %145, label %146, label %310
146: ; preds = %143
%147 = add nsw i32 %59, 1
%148 = icmp sgt i32 %3, 1
br i1 %148, label %149, label %308
149: ; preds = %146
%150 = zext i32 %3 to i64
%151 = add nuw nsw i64 %150, 1
%152 = call i64 @llvm.umin.i64(i64 %150, i64 2)
%153 = sub nsw i64 %151, %152
%154 = icmp ult i64 %153, 4
br i1 %154, label %298, label %155
155: ; preds = %149
%156 = call i64 @llvm.umin.i64(i64 %150, i64 2)
%157 = sub nsw i64 %150, %156
%158 = add i32 %3, -1
%159 = trunc i64 %157 to i32
%160 = icmp ult i32 %158, %159
%161 = icmp ugt i64 %157, 4294967295
%162 = or i1 %160, %161
%163 = getelementptr i8, i8* %1, i64 %150
%164 = sub nsw i64 0, %157
%165 = getelementptr i8, i8* %163, i64 %164
%166 = icmp ugt i8* %165, %163
%167 = zext i32 %158 to i64
%168 = getelementptr i8, i8* %1, i64 %167
%169 = sub nsw i64 0, %157
%170 = getelementptr i8, i8* %168, i64 %169
%171 = icmp ugt i8* %170, %168
%172 = or i1 %162, %166
%173 = or i1 %172, %171
br i1 %173, label %298, label %174
174: ; preds = %155
%175 = call i64 @llvm.umin.i64(i64 %150, i64 2)
%176 = getelementptr i8, i8* %1, i64 %175
%177 = add nuw nsw i64 %150, 1
%178 = getelementptr i8, i8* %1, i64 %177
%179 = add i32 %3, -1
%180 = zext i32 %179 to i64
%181 = add nuw nsw i64 %175, %180
%182 = sub nsw i64 %181, %150
%183 = getelementptr i8, i8* %1, i64 %182
%184 = add nuw nsw i64 %180, 1
%185 = getelementptr i8, i8* %1, i64 %184
%186 = icmp ult i8* %176, %185
%187 = icmp ult i8* %183, %178
%188 = and i1 %186, %187
br i1 %188, label %298, label %189
189: ; preds = %174
%190 = icmp ult i64 %153, 16
br i1 %190, label %275, label %191
191: ; preds = %189
%192 = and i64 %153, -16
%193 = add nsw i64 %192, -16
%194 = lshr exact i64 %193, 4
%195 = add nuw nsw i64 %194, 1
%196 = and i64 %195, 3
%197 = icmp ult i64 %193, 48
br i1 %197, label %249, label %198
198: ; preds = %191
%199 = and i64 %195, 2305843009213693948
%200 = getelementptr inbounds i8, i8* %1, i64 -15
%201 = getelementptr inbounds i8, i8* %1, i64 -15
%202 = getelementptr inbounds i8, i8* %1, i64 -15
%203 = getelementptr inbounds i8, i8* %1, i64 -15
%204 = getelementptr inbounds i8, i8* %1, i64 -15
%205 = getelementptr inbounds i8, i8* %1, i64 -15
%206 = getelementptr inbounds i8, i8* %1, i64 -15
%207 = getelementptr inbounds i8, i8* %1, i64 -15
br label %208
208: ; preds = %208, %198
%209 = phi i64 [ 0, %198 ], [ %246, %208 ]
%210 = phi i64 [ 0, %198 ], [ %247, %208 ]
%211 = sub i64 %150, %209
%212 = add i64 %211, 4294967295
%213 = and i64 %212, 4294967295
%214 = getelementptr inbounds i8, i8* %200, i64 %213
%215 = bitcast i8* %214 to <16 x i8>*
%216 = load <16 x i8>, <16 x i8>* %215
%217 = getelementptr inbounds i8, i8* %201, i64 %211
%218 = bitcast i8* %217 to <16 x i8>*
store <16 x i8> %216, <16 x i8>* %218
%219 = or i64 %209, 16
%220 = sub i64 %150, %219
%221 = add i64 %220, 4294967295
%222 = and i64 %221, 4294967295
%223 = getelementptr inbounds i8, i8* %202, i64 %222
%224 = bitcast i8* %223 to <16 x i8>*
%225 = load <16 x i8>, <16 x i8>* %224
%226 = getelementptr inbounds i8, i8* %203, i64 %220
%227 = bitcast i8* %226 to <16 x i8>*
store <16 x i8> %225, <16 x i8>* %227
%228 = or i64 %209, 32
%229 = sub i64 %150, %228
%230 = add i64 %229, 4294967295
%231 = and i64 %230, 4294967295
%232 = getelementptr inbounds i8, i8* %204, i64 %231
%233 = bitcast i8* %232 to <16 x i8>*
%234 = load <16 x i8>, <16 x i8>* %233
%235 = getelementptr inbounds i8, i8* %205, i64 %229
%236 = bitcast i8* %235 to <16 x i8>*
store <16 x i8> %234, <16 x i8>* %236
%237 = or i64 %209, 48
%238 = sub i64 %150, %237
%239 = add i64 %238, 4294967295
%240 = and i64 %239, 4294967295
%241 = getelementptr inbounds i8, i8* %206, i64 %240
%242 = bitcast i8* %241 to <16 x i8>*
%243 = load <16 x i8>, <16 x i8>* %242
%244 = getelementptr inbounds i8, i8* %207, i64 %238
%245 = bitcast i8* %244 to <16 x i8>*
store <16 x i8> %243, <16 x i8>* %245
%246 = add nuw i64 %209, 64
%247 = add i64 %210, 4
%248 = icmp eq i64 %247, %199
br i1 %248, label %249, label %208
249: ; preds = %208, %191
%250 = phi i64 [ 0, %191 ], [ %246, %208 ]
%251 = icmp eq i64 %196, 0
br i1 %251, label %269, label %252
252: ; preds = %249
%253 = getelementptr inbounds i8, i8* %1, i64 -15
%254 = getelementptr inbounds i8, i8* %1, i64 -15
br label %255
255: ; preds = %255, %252
%256 = phi i64 [ %250, %252 ], [ %266, %255 ]
%257 = phi i64 [ 0, %252 ], [ %267, %255 ]
%258 = sub i64 %150, %256
%259 = add i64 %258, 4294967295
%260 = and i64 %259, 4294967295
%261 = getelementptr inbounds i8, i8* %253, i64 %260
%262 = bitcast i8* %261 to <16 x i8>*
%263 = load <16 x i8>, <16 x i8>* %262
%264 = getelementptr inbounds i8, i8* %254, i64 %258
%265 = bitcast i8* %264 to <16 x i8>*
store <16 x i8> %263, <16 x i8>* %265
%266 = add nuw i64 %256, 16
%267 = add i64 %257, 1
%268 = icmp eq i64 %267, %196
br i1 %268, label %269, label %255
269: ; preds = %255, %249
%270 = icmp eq i64 %153, %192
br i1 %270, label %308, label %271
271: ; preds = %269
%272 = sub nsw i64 %150, %192
%273 = and i64 %153, 12
%274 = icmp eq i64 %273, 0
br i1 %274, label %298, label %275
275: ; preds = %189, %271
%276 = phi i64 [ %192, %271 ], [ 0, %189 ]
%277 = add nuw nsw i64 %150, 1
%278 = call i64 @llvm.umin.i64(i64 %150, i64 2)
%279 = sub nsw i64 %277, %278
%280 = and i64 %279, -4
%281 = sub nsw i64 %150, %280
%282 = getelementptr inbounds i8, i8* %1, i64 -3
%283 = getelementptr inbounds i8, i8* %1, i64 -3
br label %284
284: ; preds = %284, %275
%285 = phi i64 [ %276, %275 ], [ %294, %284 ]
%286 = sub i64 %150, %285
%287 = add i64 %286, 4294967295
%288 = and i64 %287, 4294967295
%289 = getelementptr inbounds i8, i8* %282, i64 %288
%290 = bitcast i8* %289 to <4 x i8>*
%291 = load <4 x i8>, <4 x i8>* %290
%292 = getelementptr inbounds i8, i8* %283, i64 %286
%293 = bitcast i8* %292 to <4 x i8>*
store <4 x i8> %291, <4 x i8>* %293
%294 = add nuw i64 %285, 4
%295 = icmp eq i64 %294, %280
br i1 %295, label %296, label %284
296: ; preds = %284
%297 = icmp eq i64 %279, %280
br i1 %297, label %308, label %298
298: ; preds = %174, %155, %149, %271, %296
%299 = phi i64 [ %150, %149 ], [ %150, %174 ], [ %150, %155 ], [ %272, %271 ], [ %281, %296 ]
br label %300
300: ; preds = %298, %300
%301 = phi i64 [ %302, %300 ], [ %299, %298 ]
%302 = add nsw i64 %301, -1
%303 = and i64 %302, 4294967295
%304 = getelementptr inbounds i8, i8* %1, i64 %303
%305 = load i8, i8* %304
%306 = getelementptr inbounds i8, i8* %1, i64 %301
store i8 %305, i8* %306
%307 = icmp ugt i64 %301, 2
br i1 %307, label %300, label %308
308: ; preds = %300, %269, %296, %146
store i8 49, i8* %1
%309 = getelementptr inbounds i8, i8* %1, i64 1
store i8 48, i8* %309
br label %310
310: ; preds = %308, %143
%311 = phi i32 [ %147, %308 ], [ %59, %143 ]
store i8 0, i8* %115
store i32 %311, i32* %2
br label %312
312: ; preds = %15, %13, %310, %111, %70
ret void
}