#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 */
typedef int uint8_t;

/* Variables and functions */
double INFINITY;
void double_to_bit_array_diy_big(double f, uint8_t *bit_array) {
  int top;
  if (f == 0) {
    for (top = 1; top < 64; top++)
      bit_array[top] = 0;
    bit_array[0] = 1 / f > 0 ? 0 : 1;
  } else if (f == INFINITY) {
    bit_array[0] = 0;
    for (top = 1; top < 12; top++)
      bit_array[top] = 1;
    for (top = 12; top < 64; top++)
      bit_array[top] = 0;
  } else if (f == -INFINITY) {
    for (top = 0; top < 12; top++)
      bit_array[top] = 1;
    for (top = 12; top < 64; top++)
      bit_array[top] = 0;
  } else if (f != f) {
    for (top = 0; top < 64; top++)
      bit_array[top] = 1;
  } else {
    if (f < 0) {
      f = -f;
      bit_array[0] = 1;
    } else {
      bit_array[0] = 0;
    }
    int tmp = 1023;
    double subn_thres = 2;
    while (tmp--)
      subn_thres /= 2;
    if (f < subn_thres) {
      tmp = 1022;
      while (tmp--)
        f *= 2;
      for (top = 1; top < 12; top++)
        bit_array[top] = 0;
      for (top = 12; top < 64; top++) {
        bit_array[top] = f * 2 >= 1 ? 1 : 0;
        f *= 2;
        if (f >= 1)
          f -= 1;
      }
      return;
    }
    int e = 0;
    while (f >= 2) {
      f /= 2;
      e++;
    }
    while (f < 1) {
      f *= 2;
      e--;
    }
    e += 1023;
    for (top = 11; top > 0; top--) {
      bit_array[top] = e & 1;
      e >>= 1;
    }
    f -= 1;
    for (top = 12; top < 64; top++) {
      bit_array[top] = f * 2 >= 1 ? 1 : 0;
      f *= 2;
      if (f >= 1)
        f -= 1;
    }
  }
}


x86 assembly (clang, -O0):
<double_to_bit_array_diy_big>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    117c <double_to_bit_array_diy_big+0x7c>
jp     117c <double_to_bit_array_diy_big+0x7c>
movl   $0x1,-0x14(%rbp)
cmpl   $0x40,-0x14(%rbp)
jge    1153 <double_to_bit_array_diy_big+0x53>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112c <double_to_bit_array_diy_big+0x2c>
movsd  0xead(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
mov    $0x1,%ecx
xor    %eax,%eax
ucomisd %xmm1,%xmm0
cmova  %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    15f7 <double_to_bit_array_diy_big+0x4f7>
movsd  -0x8(%rbp),%xmm0
mov    0x2e60(%rip),%rax
ucomisd (%rax),%xmm0
jne    1203 <double_to_bit_array_diy_big+0x103>
jp     1203 <double_to_bit_array_diy_big+0x103>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x1,-0x14(%rbp)
cmpl   $0xc,-0x14(%rbp)
jge    11d0 <double_to_bit_array_diy_big+0xd0>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11a9 <double_to_bit_array_diy_big+0xa9>
movl   $0xc,-0x14(%rbp)
cmpl   $0x40,-0x14(%rbp)
jge    11fe <double_to_bit_array_diy_big+0xfe>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11d7 <double_to_bit_array_diy_big+0xd7>
jmp    15f2 <double_to_bit_array_diy_big+0x4f2>
movsd  -0x8(%rbp),%xmm0
mov    0x2dd9(%rip),%rax
movsd  (%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
ucomisd %xmm1,%xmm0
jne    129b <double_to_bit_array_diy_big+0x19b>
jp     129b <double_to_bit_array_diy_big+0x19b>
movl   $0x0,-0x14(%rbp)
cmpl   $0xc,-0x14(%rbp)
jge    1268 <double_to_bit_array_diy_big+0x168>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1241 <double_to_bit_array_diy_big+0x141>
movl   $0xc,-0x14(%rbp)
cmpl   $0x40,-0x14(%rbp)
jge    1296 <double_to_bit_array_diy_big+0x196>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    126f <double_to_bit_array_diy_big+0x16f>
jmp    15ed <double_to_bit_array_diy_big+0x4ed>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jne    12b6 <double_to_bit_array_diy_big+0x1b6>
jp     12b6 <double_to_bit_array_diy_big+0x1b6>
jmp    12e9 <double_to_bit_array_diy_big+0x1e9>
movl   $0x0,-0x14(%rbp)
cmpl   $0x40,-0x14(%rbp)
jge    12e4 <double_to_bit_array_diy_big+0x1e4>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12bd <double_to_bit_array_diy_big+0x1bd>
jmp    15e8 <double_to_bit_array_diy_big+0x4e8>
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1327 <double_to_bit_array_diy_big+0x227>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
jmp    1331 <double_to_bit_array_diy_big+0x231>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x3ff,-0x18(%rbp)
movsd  0xcc0(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0x0,%eax
je     1374 <double_to_bit_array_diy_big+0x274>
movsd  -0x20(%rbp),%xmm0
movsd  0xc9a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1345 <double_to_bit_array_diy_big+0x245>
movsd  -0x8(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    147e <double_to_bit_array_diy_big+0x37e>
movl   $0x3fe,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0x0,%eax
je     13ba <double_to_bit_array_diy_big+0x2ba>
movsd  0xc55(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    138f <double_to_bit_array_diy_big+0x28f>
movl   $0x1,-0x14(%rbp)
cmpl   $0xc,-0x14(%rbp)
jge    13e8 <double_to_bit_array_diy_big+0x2e8>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13c1 <double_to_bit_array_diy_big+0x2c1>
movl   $0xc,-0x14(%rbp)
cmpl   $0x40,-0x14(%rbp)
jge    1479 <double_to_bit_array_diy_big+0x379>
movsd  0xbff(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xbfa(%rip),%xmm1
xor    %edx,%edx
mov    $0x1,%eax
ucomisd %xmm1,%xmm0
cmovae %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
movsd  0xbd1(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xbc2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1466 <double_to_bit_array_diy_big+0x366>
movsd  -0x8(%rbp),%xmm0
movsd  0xbab(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    146b <double_to_bit_array_diy_big+0x36b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13ef <double_to_bit_array_diy_big+0x2ef>
jmp    15f7 <double_to_bit_array_diy_big+0x4f7>
movl   $0x0,-0x24(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xb6e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     14c0 <double_to_bit_array_diy_big+0x3c0>
movsd  -0x8(%rbp),%xmm0
movsd  0xb57(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1485 <double_to_bit_array_diy_big+0x385>
jmp    14c5 <double_to_bit_array_diy_big+0x3c5>
movsd  0xb3b(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    14f8 <double_to_bit_array_diy_big+0x3f8>
movsd  0xb20(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    14c5 <double_to_bit_array_diy_big+0x3c5>
mov    -0x24(%rbp),%eax
add    $0x3ff,%eax
mov    %eax,-0x24(%rbp)
movl   $0xb,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    153c <double_to_bit_array_diy_big+0x43c>
mov    -0x24(%rbp),%edx
and    $0x1,%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    150a <double_to_bit_array_diy_big+0x40a>
movsd  -0x8(%rbp),%xmm0
movsd  0xabf(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movl   $0xc,-0x14(%rbp)
cmpl   $0x40,-0x14(%rbp)
jge    15e3 <double_to_bit_array_diy_big+0x4e3>
movsd  0xa95(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xa90(%rip),%xmm1
xor    %edx,%edx
mov    $0x1,%eax
ucomisd %xmm1,%xmm0
cmovae %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
movsd  0xa67(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xa58(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     15d0 <double_to_bit_array_diy_big+0x4d0>
movsd  -0x8(%rbp),%xmm0
movsd  0xa41(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    15d5 <double_to_bit_array_diy_big+0x4d5>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1559 <double_to_bit_array_diy_big+0x459>
jmp    15e8 <double_to_bit_array_diy_big+0x4e8>
jmp    15ed <double_to_bit_array_diy_big+0x4ed>
jmp    15f2 <double_to_bit_array_diy_big+0x4f2>
jmp    15f7 <double_to_bit_array_diy_big+0x4f7>
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_to_bit_array_diy_big>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1198 <double_to_bit_array_diy_big+0x98>
jp     1198 <double_to_bit_array_diy_big+0x98>
movsd  0xf24(%rip),%xmm2
divsd  %xmm0,%xmm2
xorpd  %xmm0,%xmm0
movupd %xmm0,0xf0(%rdi)
movupd %xmm0,0xe4(%rdi)
movupd %xmm0,0xd4(%rdi)
movupd %xmm0,0xc4(%rdi)
movupd %xmm0,0xb4(%rdi)
movupd %xmm0,0xa4(%rdi)
movupd %xmm0,0x94(%rdi)
movupd %xmm0,0x84(%rdi)
movupd %xmm0,0x74(%rdi)
movupd %xmm0,0x64(%rdi)
movupd %xmm0,0x54(%rdi)
movupd %xmm0,0x44(%rdi)
movupd %xmm0,0x34(%rdi)
movupd %xmm0,0x24(%rdi)
movupd %xmm0,0x14(%rdi)
xor    %eax,%eax
ucomisd %xmm1,%xmm2
movupd %xmm0,0x4(%rdi)
setbe  %al
mov    %eax,(%rdi)
ret
mov    0x2e49(%rip),%rax
movsd  (%rax),%xmm1
ucomisd %xmm0,%xmm1
jne    11be <double_to_bit_array_diy_big+0xbe>
jp     11be <double_to_bit_array_diy_big+0xbe>
movaps 0xe6e(%rip),%xmm0
movups %xmm0,(%rdi)
movaps 0xe54(%rip),%xmm0
jmp    11d8 <double_to_bit_array_diy_big+0xd8>
xorpd  0xe3a(%rip),%xmm1
ucomisd %xmm0,%xmm1
jne    1230 <double_to_bit_array_diy_big+0x130>
jp     1230 <double_to_bit_array_diy_big+0x130>
movaps 0xe3b(%rip),%xmm0
movups %xmm0,(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,0x20(%rdi)
xorps  %xmm0,%xmm0
movups %xmm0,0x30(%rdi)
movups %xmm0,0x40(%rdi)
movups %xmm0,0x50(%rdi)
movups %xmm0,0x60(%rdi)
movups %xmm0,0x70(%rdi)
movups %xmm0,0x80(%rdi)
movups %xmm0,0x90(%rdi)
movups %xmm0,0xa0(%rdi)
movups %xmm0,0xb0(%rdi)
movups %xmm0,0xc0(%rdi)
movups %xmm0,0xd0(%rdi)
movups %xmm0,0xe0(%rdi)
movups %xmm0,0xf0(%rdi)
ret
ucomisd %xmm0,%xmm0
jp     147b <double_to_bit_array_diy_big+0x37b>
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
mov    %eax,(%rdi)
movsd  0xddf(%rip),%xmm3
mov    $0xfffffc01,%eax
movsd  0xdda(%rip),%xmm2
xchg   %ax,%ax
mulsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm3
add    $0xb,%eax
jne    1260 <double_to_bit_array_diy_big+0x160>
movapd 0xd67(%rip),%xmm4
xorpd  %xmm0,%xmm4
xorpd  %xmm5,%xmm5
movapd %xmm0,%xmm1
cmpltsd %xmm5,%xmm1
andpd  %xmm1,%xmm4
andnpd %xmm0,%xmm1
orpd   %xmm4,%xmm1
ucomisd %xmm1,%xmm3
jbe    135e <double_to_bit_array_diy_big+0x25e>
mov    $0xfffffc02,%eax
cs nopw 0x0(%rax,%rax,1)
nop
addsd  %xmm1,%xmm1
addsd  %xmm1,%xmm1
addsd  %xmm1,%xmm1
addsd  %xmm1,%xmm1
addsd  %xmm1,%xmm1
addsd  %xmm1,%xmm1
addsd  %xmm1,%xmm1
add    $0x7,%eax
jne    12d0 <double_to_bit_array_diy_big+0x1d0>
xorpd  %xmm0,%xmm0
movupd %xmm0,0x20(%rdi)
movupd %xmm0,0x14(%rdi)
movupd %xmm0,0x4(%rdi)
xor    %eax,%eax
movsd  0xd32(%rip),%xmm0
movsd  0xd32(%rip),%xmm2
jmp    132e <double_to_bit_array_diy_big+0x22e>
nopl   0x0(%rax,%rax,1)
add    $0x2,%rax
cmp    $0x34,%rax
je     147a <double_to_bit_array_diy_big+0x37a>
addsd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
setae  %cl
mov    %ecx,0x30(%rdi,%rax,4)
jb     1345 <double_to_bit_array_diy_big+0x245>
addsd  %xmm2,%xmm1
addsd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
setae  %cl
mov    %ecx,0x34(%rdi,%rax,4)
jb     1320 <double_to_bit_array_diy_big+0x220>
addsd  %xmm2,%xmm1
jmp    1320 <double_to_bit_array_diy_big+0x220>
xor    %eax,%eax
ucomisd 0xcc8(%rip),%xmm1
jb     138d <double_to_bit_array_diy_big+0x28d>
xor    %eax,%eax
movsd  0xcbc(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mulsd  %xmm2,%xmm1
add    $0x1,%eax
ucomisd %xmm0,%xmm1
jae    1380 <double_to_bit_array_diy_big+0x280>
movsd  0xcab(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    13ad <double_to_bit_array_diy_big+0x2ad>
nopl   0x0(%rax,%rax,1)
addsd  %xmm1,%xmm1
add    $0xffffffff,%eax
ucomisd %xmm1,%xmm0
ja     13a0 <double_to_bit_array_diy_big+0x2a0>
add    $0x3ff,%eax
mov    %eax,%ecx
and    $0x1,%ecx
mov    %ecx,0x2c(%rdi)
mov    %eax,%ecx
shr    %ecx
and    $0x1,%ecx
mov    %ecx,0x28(%rdi)
mov    %eax,%ecx
shr    $0x2,%ecx
and    $0x1,%ecx
mov    %ecx,0x24(%rdi)
mov    %eax,%ecx
shr    $0x3,%ecx
and    $0x1,%ecx
mov    %ecx,0x20(%rdi)
mov    %eax,%ecx
shr    $0x4,%ecx
and    $0x1,%ecx
mov    %ecx,0x1c(%rdi)
mov    %eax,%ecx
shr    $0x5,%ecx
and    $0x1,%ecx
mov    %ecx,0x18(%rdi)
mov    %eax,%ecx
shr    $0x6,%ecx
and    $0x1,%ecx
mov    %ecx,0x14(%rdi)
mov    %eax,%ecx
shr    $0x7,%ecx
and    $0x1,%ecx
mov    %ecx,0x10(%rdi)
mov    %eax,%ecx
shr    $0x8,%ecx
and    $0x1,%ecx
mov    %ecx,0xc(%rdi)
mov    %eax,%ecx
shr    $0x9,%ecx
and    $0x1,%ecx
mov    %ecx,0x8(%rdi)
shr    $0xa,%eax
and    $0x1,%eax
mov    %eax,0x4(%rdi)
addsd  0xc1b(%rip),%xmm1
xor    %eax,%eax
movsd  0xc11(%rip),%xmm2
jmp    144a <double_to_bit_array_diy_big+0x34a>
nopl   0x0(%rax)
add    $0x2,%rax
cmp    $0x34,%rax
je     147a <double_to_bit_array_diy_big+0x37a>
addsd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
setae  %cl
mov    %ecx,0x30(%rdi,%rax,4)
jb     1461 <double_to_bit_array_diy_big+0x361>
addsd  %xmm2,%xmm1
addsd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
setae  %cl
mov    %ecx,0x34(%rdi,%rax,4)
jb     1440 <double_to_bit_array_diy_big+0x340>
addsd  %xmm2,%xmm1
jmp    1440 <double_to_bit_array_diy_big+0x340>
ret
movaps 0xb8e(%rip),%xmm0
movups %xmm0,(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,0x20(%rdi)
jmp    11e3 <double_to_bit_array_diy_big+0xe3>

LLVM IR (-O0):
@INFINITY = global double 0.000000e+00
define void @double_to_bit_array_diy_big(double %0, i32* %1) {
%3 = alloca double
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca i32
store double %0, double* %3
store i32* %1, i32** %4
%9 = load double, double* %3
%10 = fcmp oeq double %9, 0.000000e+00
br i1 %10, label %11, label %31
11: ; preds = %2
store i32 1, i32* %5
br label %12
12: ; preds = %20, %11
%13 = load i32, i32* %5
%14 = icmp slt i32 %13, 64
br i1 %14, label %15, label %23
15: ; preds = %12
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
store i32 0, i32* %19
br label %20
20: ; preds = %15
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %12
23: ; preds = %12
%24 = load double, double* %3
%25 = fdiv double 1.000000e+00, %24
%26 = fcmp ogt double %25, 0.000000e+00
%27 = zext i1 %26 to i64
%28 = select i1 %26, i32 0, i32 1
%29 = load i32*, i32** %4
%30 = getelementptr inbounds i32, i32* %29, i64 0
store i32 %28, i32* %30
br label %245
31: ; preds = %2
%32 = load double, double* %3
%33 = load double, double* @INFINITY
%34 = fcmp oeq double %32, %33
br i1 %34, label %35, label %62
35: ; preds = %31
%36 = load i32*, i32** %4
%37 = getelementptr inbounds i32, i32* %36, i64 0
store i32 0, i32* %37
store i32 1, i32* %5
br label %38
38: ; preds = %46, %35
%39 = load i32, i32* %5
%40 = icmp slt i32 %39, 12
br i1 %40, label %41, label %49
41: ; preds = %38
%42 = load i32*, i32** %4
%43 = load i32, i32* %5
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i32, i32* %42, i64 %44
store i32 1, i32* %45
br label %46
46: ; preds = %41
%47 = load i32, i32* %5
%48 = add nsw i32 %47, 1
store i32 %48, i32* %5
br label %38
49: ; preds = %38
store i32 12, i32* %5
br label %50
50: ; preds = %58, %49
%51 = load i32, i32* %5
%52 = icmp slt i32 %51, 64
br i1 %52, label %53, label %61
53: ; preds = %50
%54 = load i32*, i32** %4
%55 = load i32, i32* %5
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i32, i32* %54, i64 %56
store i32 0, i32* %57
br label %58
58: ; preds = %53
%59 = load i32, i32* %5
%60 = add nsw i32 %59, 1
store i32 %60, i32* %5
br label %50
61: ; preds = %50
br label %244
62: ; preds = %31
%63 = load double, double* %3
%64 = load double, double* @INFINITY
%65 = fneg double %64
%66 = fcmp oeq double %63, %65
br i1 %66, label %67, label %92
67: ; preds = %62
store i32 0, i32* %5
br label %68
68: ; preds = %76, %67
%69 = load i32, i32* %5
%70 = icmp slt i32 %69, 12
br i1 %70, label %71, label %79
71: ; preds = %68
%72 = load i32*, i32** %4
%73 = load i32, i32* %5
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i32, i32* %72, i64 %74
store i32 1, i32* %75
br label %76
76: ; preds = %71
%77 = load i32, i32* %5
%78 = add nsw i32 %77, 1
store i32 %78, i32* %5
br label %68
79: ; preds = %68
store i32 12, i32* %5
br label %80
80: ; preds = %88, %79
%81 = load i32, i32* %5
%82 = icmp slt i32 %81, 64
br i1 %82, label %83, label %91
83: ; preds = %80
%84 = load i32*, i32** %4
%85 = load i32, i32* %5
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds i32, i32* %84, i64 %86
store i32 0, i32* %87
br label %88
88: ; preds = %83
%89 = load i32, i32* %5
%90 = add nsw i32 %89, 1
store i32 %90, i32* %5
br label %80
91: ; preds = %80
br label %243
92: ; preds = %62
%93 = load double, double* %3
%94 = load double, double* %3
%95 = fcmp une double %93, %94
br i1 %95, label %96, label %109
96: ; preds = %92
store i32 0, i32* %5
br label %97
97: ; preds = %105, %96
%98 = load i32, i32* %5
%99 = icmp slt i32 %98, 64
br i1 %99, label %100, label %108
100: ; preds = %97
%101 = load i32*, i32** %4
%102 = load i32, i32* %5
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i32, i32* %101, i64 %103
store i32 1, i32* %104
br label %105
105: ; preds = %100
%106 = load i32, i32* %5
%107 = add nsw i32 %106, 1
store i32 %107, i32* %5
br label %97
108: ; preds = %97
br label %242
109: ; preds = %92
%110 = load double, double* %3
%111 = fcmp olt double %110, 0.000000e+00
br i1 %111, label %112, label %117
112: ; preds = %109
%113 = load double, double* %3
%114 = fneg double %113
store double %114, double* %3
%115 = load i32*, i32** %4
%116 = getelementptr inbounds i32, i32* %115, i64 0
store i32 1, i32* %116
br label %120
117: ; preds = %109
%118 = load i32*, i32** %4
%119 = getelementptr inbounds i32, i32* %118, i64 0
store i32 0, i32* %119
br label %120
120: ; preds = %117, %112
store i32 1023, i32* %6
store double 2.000000e+00, double* %7
br label %121
121: ; preds = %125, %120
%122 = load i32, i32* %6
%123 = add nsw i32 %122, -1
store i32 %123, i32* %6
%124 = icmp ne i32 %122, 0
br i1 %124, label %125, label %128
125: ; preds = %121
%126 = load double, double* %7
%127 = fdiv double %126, 2.000000e+00
store double %127, double* %7
br label %121
128: ; preds = %121
%129 = load double, double* %3
%130 = load double, double* %7
%131 = fcmp olt double %129, %130
br i1 %131, label %132, label %178
132: ; preds = %128
store i32 1022, i32* %6
br label %133
133: ; preds = %137, %132
%134 = load i32, i32* %6
%135 = add nsw i32 %134, -1
store i32 %135, i32* %6
%136 = icmp ne i32 %134, 0
br i1 %136, label %137, label %140
137: ; preds = %133
%138 = load double, double* %3
%139 = fmul double %138, 2.000000e+00
store double %139, double* %3
br label %133
140: ; preds = %133
store i32 1, i32* %5
br label %141
141: ; preds = %149, %140
%142 = load i32, i32* %5
%143 = icmp slt i32 %142, 12
br i1 %143, label %144, label %152
144: ; preds = %141
%145 = load i32*, i32** %4
%146 = load i32, i32* %5
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds i32, i32* %145, i64 %147
store i32 0, i32* %148
br label %149
149: ; preds = %144
%150 = load i32, i32* %5
%151 = add nsw i32 %150, 1
store i32 %151, i32* %5
br label %141
152: ; preds = %141
store i32 12, i32* %5
br label %153
153: ; preds = %174, %152
%154 = load i32, i32* %5
%155 = icmp slt i32 %154, 64
br i1 %155, label %156, label %177
156: ; preds = %153
%157 = load double, double* %3
%158 = fmul double %157, 2.000000e+00
%159 = fcmp oge double %158, 1.000000e+00
%160 = zext i1 %159 to i64
%161 = select i1 %159, i32 1, i32 0
%162 = load i32*, i32** %4
%163 = load i32, i32* %5
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds i32, i32* %162, i64 %164
store i32 %161, i32* %165
%166 = load double, double* %3
%167 = fmul double %166, 2.000000e+00
store double %167, double* %3
%168 = load double, double* %3
%169 = fcmp oge double %168, 1.000000e+00
br i1 %169, label %170, label %173
170: ; preds = %156
%171 = load double, double* %3
%172 = fsub double %171, 1.000000e+00
store double %172, double* %3
br label %173
173: ; preds = %170, %156
br label %174
174: ; preds = %173
%175 = load i32, i32* %5
%176 = add nsw i32 %175, 1
store i32 %176, i32* %5
br label %153
177: ; preds = %153
br label %245
178: ; preds = %128
store i32 0, i32* %8
br label %179
179: ; preds = %182, %178
%180 = load double, double* %3
%181 = fcmp oge double %180, 2.000000e+00
br i1 %181, label %182, label %187
182: ; preds = %179
%183 = load double, double* %3
%184 = fdiv double %183, 2.000000e+00
store double %184, double* %3
%185 = load i32, i32* %8
%186 = add nsw i32 %185, 1
store i32 %186, i32* %8
br label %179
187: ; preds = %179
br label %188
188: ; preds = %191, %187
%189 = load double, double* %3
%190 = fcmp olt double %189, 1.000000e+00
br i1 %190, label %191, label %196
191: ; preds = %188
%192 = load double, double* %3
%193 = fmul double %192, 2.000000e+00
store double %193, double* %3
%194 = load i32, i32* %8
%195 = add nsw i32 %194, -1
store i32 %195, i32* %8
br label %188
196: ; preds = %188
%197 = load i32, i32* %8
%198 = add nsw i32 %197, 1023
store i32 %198, i32* %8
store i32 11, i32* %5
br label %199
199: ; preds = %211, %196
%200 = load i32, i32* %5
%201 = icmp sgt i32 %200, 0
br i1 %201, label %202, label %214
202: ; preds = %199
%203 = load i32, i32* %8
%204 = and i32 %203, 1
%205 = load i32*, i32** %4
%206 = load i32, i32* %5
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds i32, i32* %205, i64 %207
store i32 %204, i32* %208
%209 = load i32, i32* %8
%210 = ashr i32 %209, 1
store i32 %210, i32* %8
br label %211
211: ; preds = %202
%212 = load i32, i32* %5
%213 = add nsw i32 %212, -1
store i32 %213, i32* %5
br label %199
214: ; preds = %199
%215 = load double, double* %3
%216 = fsub double %215, 1.000000e+00
store double %216, double* %3
store i32 12, i32* %5
br label %217
217: ; preds = %238, %214
%218 = load i32, i32* %5
%219 = icmp slt i32 %218, 64
br i1 %219, label %220, label %241
220: ; preds = %217
%221 = load double, double* %3
%222 = fmul double %221, 2.000000e+00
%223 = fcmp oge double %222, 1.000000e+00
%224 = zext i1 %223 to i64
%225 = select i1 %223, i32 1, i32 0
%226 = load i32*, i32** %4
%227 = load i32, i32* %5
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds i32, i32* %226, i64 %228
store i32 %225, i32* %229
%230 = load double, double* %3
%231 = fmul double %230, 2.000000e+00
store double %231, double* %3
%232 = load double, double* %3
%233 = fcmp oge double %232, 1.000000e+00
br i1 %233, label %234, label %237
234: ; preds = %220
%235 = load double, double* %3
%236 = fsub double %235, 1.000000e+00
store double %236, double* %3
br label %237
237: ; preds = %234, %220
br label %238
238: ; preds = %237
%239 = load i32, i32* %5
%240 = add nsw i32 %239, 1
store i32 %240, i32* %5
br label %217
241: ; preds = %217
br label %242
242: ; preds = %241, %108
br label %243
243: ; preds = %242, %91
br label %244
244: ; preds = %243, %61
br label %245
245: ; preds = %177, %244, %23
ret void
}

LLVM IR (-O2):
@INFINITY = global double 0.000000e+00
define void @double_to_bit_array_diy_big(double %0, i32* nocapture writeonly %1) {
%3 = fcmp oeq double %0, 0.000000e+00
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr i32, i32* %1, i64 1
%6 = bitcast i32* %5 to i8*
%7 = fdiv double 1.000000e+00, %0
%8 = fcmp ule double %7, 0.000000e+00
%9 = zext i1 %8 to i32
store i32 %9, i32* %1
br label %195
10: ; preds = %2
%11 = load double, double* @INFINITY
%12 = fcmp oeq double %11, %0
br i1 %12, label %13, label %21
13: ; preds = %10
%14 = bitcast i32* %1 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 1, i32 1>, <4 x i32>* %14
%15 = getelementptr inbounds i32, i32* %1, i64 4
%16 = bitcast i32* %15 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %16
%17 = getelementptr inbounds i32, i32* %1, i64 8
%18 = bitcast i32* %17 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %18
%19 = getelementptr i32, i32* %1, i64 12
%20 = bitcast i32* %19 to i8*
br label %195
21: ; preds = %10
%22 = fneg double %11
%23 = fcmp oeq double %22, %0
br i1 %23, label %24, label %32
24: ; preds = %21
%25 = bitcast i32* %1 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %25
%26 = getelementptr inbounds i32, i32* %1, i64 4
%27 = bitcast i32* %26 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %27
%28 = getelementptr inbounds i32, i32* %1, i64 8
%29 = bitcast i32* %28 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %29
%30 = getelementptr i32, i32* %1, i64 12
%31 = bitcast i32* %30 to i8*
br label %195
32: ; preds = %21
%33 = fcmp uno double %0, 0.000000e+00
br i1 %33, label %34, label %66
34: ; preds = %32
%35 = bitcast i32* %1 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %35
%36 = getelementptr inbounds i32, i32* %1, i64 4
%37 = bitcast i32* %36 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %37
%38 = getelementptr inbounds i32, i32* %1, i64 8
%39 = bitcast i32* %38 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %39
%40 = getelementptr inbounds i32, i32* %1, i64 12
%41 = bitcast i32* %40 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %41
%42 = getelementptr inbounds i32, i32* %1, i64 16
%43 = bitcast i32* %42 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %43
%44 = getelementptr inbounds i32, i32* %1, i64 20
%45 = bitcast i32* %44 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %45
%46 = getelementptr inbounds i32, i32* %1, i64 24
%47 = bitcast i32* %46 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %47
%48 = getelementptr inbounds i32, i32* %1, i64 28
%49 = bitcast i32* %48 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %49
%50 = getelementptr inbounds i32, i32* %1, i64 32
%51 = bitcast i32* %50 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %51
%52 = getelementptr inbounds i32, i32* %1, i64 36
%53 = bitcast i32* %52 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %53
%54 = getelementptr inbounds i32, i32* %1, i64 40
%55 = bitcast i32* %54 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %55
%56 = getelementptr inbounds i32, i32* %1, i64 44
%57 = bitcast i32* %56 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %57
%58 = getelementptr inbounds i32, i32* %1, i64 48
%59 = bitcast i32* %58 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %59
%60 = getelementptr inbounds i32, i32* %1, i64 52
%61 = bitcast i32* %60 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %61
%62 = getelementptr inbounds i32, i32* %1, i64 56
%63 = bitcast i32* %62 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %63
%64 = getelementptr inbounds i32, i32* %1, i64 60
%65 = bitcast i32* %64 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %65
br label %195
66: ; preds = %32
%67 = fcmp olt double %0, 0.000000e+00
%68 = zext i1 %67 to i32
store i32 %68, i32* %1
br label %69
69: ; preds = %69, %66
%70 = phi double [ 2.000000e+00, %66 ], [ %83, %69 ]
%71 = phi i32 [ 1023, %66 ], [ %82, %69 ]
%72 = fmul double %70, 5.000000e-01
%73 = fmul double %72, 5.000000e-01
%74 = fmul double %73, 5.000000e-01
%75 = fmul double %74, 5.000000e-01
%76 = fmul double %75, 5.000000e-01
%77 = fmul double %76, 5.000000e-01
%78 = fmul double %77, 5.000000e-01
%79 = fmul double %78, 5.000000e-01
%80 = fmul double %79, 5.000000e-01
%81 = fmul double %80, 5.000000e-01
%82 = add nsw i32 %71, -11
%83 = fmul double %81, 5.000000e-01
%84 = icmp eq i32 %82, 0
br i1 %84, label %85, label %69
85: ; preds = %69
%86 = fneg double %0
%87 = select i1 %67, double %86, double %0
%88 = fcmp olt double %87, %83
br i1 %88, label %94, label %89
89: ; preds = %85
%90 = fcmp ult double %87, 2.000000e+00
br i1 %90, label %124, label %128
91: ; preds = %94
%92 = getelementptr i32, i32* %1, i64 1
%93 = bitcast i32* %92 to i8*
br label %106
94: ; preds = %85, %94
%95 = phi i32 [ %103, %94 ], [ 1022, %85 ]
%96 = phi double [ %104, %94 ], [ %87, %85 ]
%97 = fmul double %96, 2.000000e+00
%98 = fmul double %97, 2.000000e+00
%99 = fmul double %98, 2.000000e+00
%100 = fmul double %99, 2.000000e+00
%101 = fmul double %100, 2.000000e+00
%102 = fmul double %101, 2.000000e+00
%103 = add nsw i32 %95, -7
%104 = fmul double %102, 2.000000e+00
%105 = icmp eq i32 %103, 0
br i1 %105, label %91, label %94
106: ; preds = %106, %91
%107 = phi i64 [ 12, %91 ], [ %122, %106 ]
%108 = phi double [ %104, %91 ], [ %121, %106 ]
%109 = fmul double %108, 2.000000e+00
%110 = fcmp oge double %109, 1.000000e+00
%111 = zext i1 %110 to i32
%112 = getelementptr inbounds i32, i32* %1, i64 %107
store i32 %111, i32* %112
%113 = fadd double %109, -1.000000e+00
%114 = select i1 %110, double %113, double %109
%115 = or i64 %107, 1
%116 = fmul double %114, 2.000000e+00
%117 = fcmp oge double %116, 1.000000e+00
%118 = zext i1 %117 to i32
%119 = getelementptr inbounds i32, i32* %1, i64 %115
store i32 %118, i32* %119
%120 = fadd double %116, -1.000000e+00
%121 = select i1 %117, double %120, double %116
%122 = add nuw nsw i64 %107, 2
%123 = icmp eq i64 %122, 64
br i1 %123, label %195, label %106
124: ; preds = %128, %89
%125 = phi double [ %87, %89 ], [ %131, %128 ]
%126 = phi i32 [ 0, %89 ], [ %132, %128 ]
%127 = fcmp olt double %125, 1.000000e+00
br i1 %127, label %134, label %140
128: ; preds = %89, %128
%129 = phi i32 [ %132, %128 ], [ 0, %89 ]
%130 = phi double [ %131, %128 ], [ %87, %89 ]
%131 = fmul double %130, 5.000000e-01
%132 = add nuw nsw i32 %129, 1
%133 = fcmp ult double %131, 2.000000e+00
br i1 %133, label %124, label %128
134: ; preds = %124, %134
%135 = phi i32 [ %138, %134 ], [ %126, %124 ]
%136 = phi double [ %137, %134 ], [ %125, %124 ]
%137 = fmul double %136, 2.000000e+00
%138 = add nsw i32 %135, -1
%139 = fcmp olt double %137, 1.000000e+00
br i1 %139, label %134, label %140
140: ; preds = %134, %124
%141 = phi double [ %125, %124 ], [ %137, %134 ]
%142 = phi i32 [ %126, %124 ], [ %138, %134 ]
%143 = add nsw i32 %142, 1023
%144 = and i32 %143, 1
%145 = getelementptr inbounds i32, i32* %1, i64 11
store i32 %144, i32* %145
%146 = lshr i32 %143, 1
%147 = and i32 %146, 1
%148 = getelementptr inbounds i32, i32* %1, i64 10
store i32 %147, i32* %148
%149 = lshr i32 %143, 2
%150 = and i32 %149, 1
%151 = getelementptr inbounds i32, i32* %1, i64 9
store i32 %150, i32* %151
%152 = lshr i32 %143, 3
%153 = and i32 %152, 1
%154 = getelementptr inbounds i32, i32* %1, i64 8
store i32 %153, i32* %154
%155 = lshr i32 %143, 4
%156 = and i32 %155, 1
%157 = getelementptr inbounds i32, i32* %1, i64 7
store i32 %156, i32* %157
%158 = lshr i32 %143, 5
%159 = and i32 %158, 1
%160 = getelementptr inbounds i32, i32* %1, i64 6
store i32 %159, i32* %160
%161 = lshr i32 %143, 6
%162 = and i32 %161, 1
%163 = getelementptr inbounds i32, i32* %1, i64 5
store i32 %162, i32* %163
%164 = lshr i32 %143, 7
%165 = and i32 %164, 1
%166 = getelementptr inbounds i32, i32* %1, i64 4
store i32 %165, i32* %166
%167 = lshr i32 %143, 8
%168 = and i32 %167, 1
%169 = getelementptr inbounds i32, i32* %1, i64 3
store i32 %168, i32* %169
%170 = lshr i32 %143, 9
%171 = and i32 %170, 1
%172 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %171, i32* %172
%173 = lshr i32 %143, 10
%174 = and i32 %173, 1
%175 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %174, i32* %175
%176 = fadd double %141, -1.000000e+00
br label %177
177: ; preds = %177, %140
%178 = phi i64 [ 12, %140 ], [ %193, %177 ]
%179 = phi double [ %176, %140 ], [ %192, %177 ]
%180 = fmul double %179, 2.000000e+00
%181 = fcmp oge double %180, 1.000000e+00
%182 = zext i1 %181 to i32
%183 = getelementptr inbounds i32, i32* %1, i64 %178
store i32 %182, i32* %183
%184 = fadd double %180, -1.000000e+00
%185 = select i1 %181, double %184, double %180
%186 = or i64 %178, 1
%187 = fmul double %185, 2.000000e+00
%188 = fcmp oge double %187, 1.000000e+00
%189 = zext i1 %188 to i32
%190 = getelementptr inbounds i32, i32* %1, i64 %186
store i32 %189, i32* %190
%191 = fadd double %187, -1.000000e+00
%192 = select i1 %188, double %191, double %187
%193 = add nuw nsw i64 %178, 2
%194 = icmp eq i64 %193, 64
br i1 %194, label %195, label %177
195: ; preds = %177, %106, %34, %24, %13, %4
ret void
}