// File: /workspace/github_cpp_makefile_star2_O3/nikolausmayer[P]SimplePlot/./Sparkline.h
// Function: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> Sparkline::Sparkline<float>(float const*, unsigned long, unsigned long, unsigned long, bool, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, float, float)
std::string Sparkline( const T* const data,
                         size_t number_of_data_points,
                         size_t this_many_lines_high=1,
                         size_t this_many_characters_wide=0,
                         bool enclose_in_box=false,
                         bool print_colored=true,
                         std::string title="",
                         T minv=std::numeric_limits<T>::max(),
                         T maxv=std::numeric_limits<T>::min()
                       ) 
  {
    /// Use provided min/max values or adapt to data range
    minv = std::min(minv, std::numeric_limits<T>::max());
    maxv = std::max(maxv, std::numeric_limits<T>::min());
    if ( minv == std::numeric_limits<T>::max() and
         maxv == std::numeric_limits<T>::min() ) {
      for ( size_t i = 0; i < number_of_data_points; ++i ) {
        minv = std::min(minv, data[i]);
        maxv = std::max(maxv, data[i]);
      }
    }

    /// If the plot could spill over the terminal boundaries,
    /// then limit its width
    float w_scale = 1.f;
    {
      size_t max_width = (size_t)SparklineHelpers::TerminalWidth();
      if ( enclose_in_box ) 
        max_width -= ENCLOSURE_WIDTH;

      if ( this_many_characters_wide == 0 )
        this_many_characters_wide = number_of_data_points;

      if ( max_width < this_many_characters_wide )
        this_many_characters_wide = max_width;

      w_scale = (float)this_many_characters_wide/number_of_data_points;
    }

    /// TODO 
    if ( this_many_characters_wide > number_of_data_points ) {
      throw std::runtime_error("Woops! Not implemented..");
    }

    /// Interpolate data points
    T bins[this_many_characters_wide];
    {
      float bin_slices_indices[this_many_characters_wide+1];
      for ( size_t i = 0; i <= this_many_characters_wide; ++i ) {
        bin_slices_indices[i] = i/w_scale;
      }

      const float mass_per_bin = 1/w_scale;

      for ( size_t i = 0; i < this_many_characters_wide; ++i ) {
        bins[i] = 0;

        const float lower = bin_slices_indices[i];
        const float upper = bin_slices_indices[i+1];
        bins[i] += (1.f-(lower-(size_t)lower)) * data[(size_t)lower];
        for (size_t j = (size_t)lower+1; j < (size_t)upper; ++j) {
          bins[i] += data[j];
        }
        if ((size_t)upper < number_of_data_points) {
          bins[i] += (upper-(size_t)upper) * data[(size_t)upper];
        }

        bins[i] /= mass_per_bin;
      }
    }
         

    #ifdef WITH_TEXTDECORATOR
      TextDecorator::TextDecorator TD(print_colored);
    #endif

    /// Assemble the output in a stringstream
    std::ostringstream oss;

    /// Begin box (upper border)
    if ( enclose_in_box ) {
      if ( title.compare("") == 0 ) {
        oss << GREEN(BOX_NW_CORNER);
        for ( size_t i = 0; i < this_many_characters_wide; ++i )
          oss << GREEN(BOX_H_BORDER);
        oss << GREEN(BOX_NE_CORNER) << '\n';
      } else if ( title.size() > this_many_characters_wide ) {
        oss << GREEN(title) << '\n';
      } else {
        size_t filler = this_many_characters_wide-title.size();
        oss << GREEN(BOX_NW_CORNER);
        size_t i = 0;
        /// Ticks left of the title
        while ( i < filler/2 ) {
          oss << GREEN(BOX_H_BORDER);
          ++i;
        }
        oss << GREEN(title);
        /// Skip ticks covered by title
        i += title.length();
        /// Ticks right of the title
        while ( i < this_many_characters_wide ) {
          oss << GREEN(BOX_H_BORDER);
          ++i;
        }
        oss << GREEN(BOX_NE_CORNER) << '\n';
      }
    }


    /// A higher line count means we can display the data more
    /// finely grained!
    size_t levels = this_many_lines_high*TICKS-1;
    /// Stretch plot over multiple lines if requested
    for ( int line = (int)this_many_lines_high-1; line >= 0; --line ) {
      int this_line_min_index = line*TICKS;
      int this_line_max_index = this_line_min_index+(TICKS-1);

      /// Left box border
      if ( enclose_in_box )
        oss << GREEN(BOX_V_BORDER);

      /// Go through all data points
      for ( size_t i = 0; i < this_many_characters_wide; ++i ) {
        const T _data = std::min(maxv, std::max(minv, bins[i]));
        float fraction = (float)(_data-minv)/(float)(maxv-minv);
        int index = std::floor(fraction*levels);
        if ( index < this_line_min_index ) {
          /// Current cell is above the data line -> empty
          oss << ' '; 
        } else if ( index > this_line_max_index ) {
          /// Current cell is below the data line -> solid
          oss << BLUE(ticks[TICKS-1]);
        } else {
          oss << BLUE(ticks[index-this_line_min_index]);
        }
      }

      /// Right box border and min/max value marks
      if ( enclose_in_box ) {
        if ( this_many_lines_high == 1 )
          oss << GREEN(BOX_V_BORDER_TICK) 
              << GREEN(" min: ")
              << std::left << std::setw(PREC) << GREEN(minv) 
              << GREEN(", max: ") 
              << std::left << std::setw(PREC) << GREEN(maxv);
        else if ( line == (int)this_many_lines_high-1 )
          oss << GREEN(BOX_V_BORDER_TICK) << GREEN(" max: ") << GREEN(maxv);
        else if ( line == 0 )
          oss << GREEN(BOX_V_BORDER_TICK) << GREEN(" min: ") << GREEN(minv);
        else
          /// Show "middle" level of this line
          oss << GREEN(BOX_V_BORDER_TICK) << GREEN("      ") 
              << GREEN((line*TICKS+4) * 
                  (maxv-minv)/(this_many_lines_high*TICKS) + minv);
          //oss << GREEN(BOX_V_BORDER);
      }

      if ( line > 0 )
        oss << '\n';
    }

    /// Finish box (lower border and sample index marks)
    if ( enclose_in_box ) {
      /// Compute tick marks positions
      const size_t sep = 2;
      const size_t x_ticks_separation = 2*sep + std::ceil(log10(number_of_data_points+1));
      const size_t x_ticks_number = this_many_characters_wide / x_ticks_separation + 1;
      size_t x_ticks[x_ticks_number];
      size_t x_ticks_values[x_ticks_number];
      for ( size_t i = 0; i < x_ticks_number-1; ++i ) {
        x_ticks[i]        = i*x_ticks_separation;
        x_ticks_values[i] = i*number_of_data_points/x_ticks_number;
      }
      x_ticks[x_ticks_number-1]        = this_many_characters_wide-1;
      x_ticks_values[x_ticks_number-1] = number_of_data_points;

      size_t next_tick = 0;
      oss << '\n';

      oss << GREEN(BOX_SW_CORNER);
      for ( size_t i = 0; i < this_many_characters_wide; ++i )
        if ( i == x_ticks[next_tick] ) {
          oss << GREEN(BOX_H_BORDER_TICK);
          ++next_tick;
        } else {
          oss << GREEN(BOX_H_BORDER);
        }
      oss << GREEN(BOX_SE_CORNER);


      /// X-ticks values
      {
        oss << "\n " << GREEN(x_ticks_values[0]);

        /// Keep track of the line length
        size_t current_col = 1;
        for ( size_t i = 1; i < x_ticks_number-1; ++i ) {
          /// We somehow have to distribute the string representations
          /// of the tick numbers over the length of one line.
          /// 
          ///           x_ticks_separation
          ///      vvvvvvv       >      vvvvvvv   
          ///                    > 
          ///       tofill       >       tofill
          ///        vvvv        >        vvv
          /// ...──┬──────┬──... > ...──┬──────┬──...
          ///     998    999     >     999   1000
          ///       ^    ^^      >       ^   ^^
          ///      lw    rw      >      lw   rw

          /// Width of the current tick's number
          size_t tmp = SparklineHelpers::CharLength(x_ticks_values[i]);
          current_col += tmp;
          /// This iteration takes tmp-tmp/2 characters of the total
          /// width of the next entry. The remaining tmp-2 characters
          /// will by covered by "lw" in the next iteration.
          const size_t rw = tmp-tmp/2;
          /// Width of the previous tick's number
          tmp = SparklineHelpers::CharLength(x_ticks_values[i-1]);
          const size_t lw = tmp/2;

          /// The remaining sepration space is filled with blanks
          size_t tofill = x_ticks_separation - rw - lw;
          oss << std::setw(tofill) << std::setfill(' ') << ' ';
          oss << GREEN(x_ticks_values[i]);

          current_col += tofill;
        }

        oss << std::setw(x_ticks[x_ticks_number-1]
               - current_col
               - SparklineHelpers::CharLength(number_of_data_points)+2)
            << ' ';
        oss << GREEN(x_ticks_values[x_ticks_number-1]) 
            << std::endl;
      }
    }

    return oss.str();
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movl %r9d, -0x3c(%rbp)
movq %r8, %r13
movq %rcx, -0x58(%rbp)
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movss 0x235b(%rip), %xmm2     # 0x60c8
movaps %xmm2, %xmm4
minss %xmm0, %xmm4
movss 0x2350(%rip), %xmm0     # 0x60cc
movaps %xmm0, %xmm5
maxss %xmm1, %xmm5
movaps %xmm5, %xmm1
cmpneqps %xmm0, %xmm1
movaps %xmm4, %xmm3
cmpneqps %xmm2, %xmm3
orps %xmm1, %xmm3
movd %xmm3, %eax
testq %rdx, %rdx
sete %cl
orb %al, %cl
testb $0x1, %cl
jne 0x3dc5
xorl %eax, %eax
movss (%rbx,%rax,4), %xmm5
movaps %xmm5, %xmm4
minss %xmm2, %xmm4
maxss %xmm0, %xmm5
incq %rax
movaps %xmm4, %xmm2
movaps %xmm5, %xmm0
cmpq %rax, %r15
jne 0x3da7
movaps %xmm5, -0xb0(%rbp)
movaps %xmm4, -0x80(%rbp)
leaq -0x238(%rbp), %r12
movl $0x5413, %esi           # imm = 0x5413
movl $0x1, %edi
movq %r12, %rdx
xorl %eax, %eax
callq 0x21f0
movzwl 0x2(%r12), %eax
leaq -0x14(%rax), %rcx
cmpb $0x0, -0x3c(%rbp)
cmoveq %rax, %rcx
testq %r13, %r13
cmoveq %r15, %r13
cmpq %r13, %rcx
cmovbq %rcx, %r13
testq %r13, %r13
movq %r13, -0x38(%rbp)
js 0x3e1e
xorps %xmm0, %xmm0
cvtsi2ss %r13, %xmm0
jmp 0x3e39
movq %r13, %rax
shrq %rax
movl %r13d, %ecx
andl $0x1, %ecx
orq %rax, %rcx
xorps %xmm0, %xmm0
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
testq %r15, %r15
js 0x3e48
xorps %xmm1, %xmm1
cvtsi2ss %r15, %xmm1
jmp 0x3e63
movq %r15, %rax
shrq %rax
movl %r15d, %ecx
andl $0x1, %ecx
orq %rax, %rcx
xorps %xmm1, %xmm1
cvtsi2ss %rcx, %xmm1
addss %xmm1, %xmm1
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
ja 0x49e5
movq 0x18(%rbp), %r12
divss %xmm1, %xmm0
movq %rsp, %rcx
leaq 0xf(,%rdi,4), %rax
andq $-0x10, %rax
subq %rax, %rcx
movq %rcx, -0x48(%rbp)
movq %rcx, %rsp
movq %rsp, %rax
leaq 0x1(%rdi), %rdx
movq %rsp, %rcx
leaq 0x13(,%rdi,4), %rsi
andq $-0x10, %rsi
subq %rsi, %rcx
movq %rcx, %rsp
cmpq $0x1, %rdx
movq %rdi, %rsi
adcq $0x1, %rsi
leaq 0x1(%rsi), %rdx
andq $-0x2, %rdx
decq %rsi
movq %rsi, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
movdqa 0x215b(%rip), %xmm2     # 0x6030
xorl %esi, %esi
movdqa 0x2161(%rip), %xmm3     # 0x6040
pxor %xmm3, %xmm1
pcmpeqd %xmm4, %xmm4
movdqa 0x2161(%rip), %xmm5     # 0x6050
movdqa %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm1, %xmm7
pcmpeqd %xmm1, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %edi
notl %edi
testb $0x1, %dil
je 0x3f58
testq %rsi, %rsi
js 0x3f33
xorps %xmm7, %xmm7
cvtsi2ss %rsi, %xmm7
jmp 0x3f4f
movq %rsi, %rdi
shrq %rdi
movl %esi, %r8d
andl $0x1, %r8d
orq %rdi, %r8
xorps %xmm7, %xmm7
cvtsi2ss %r8, %xmm7
addss %xmm7, %xmm7
divss %xmm0, %xmm7
movss %xmm7, (%rcx,%rsi,4)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %edi
testb $0x1, %dil
je 0x3f9b
movq %rsi, %rdi
incq %rdi
js 0x3f79
xorps %xmm6, %xmm6
cvtsi2ss %rdi, %xmm6
jmp 0x3f91
movq %rdi, %r8
shrq %r8
andl $0x1, %edi
orq %r8, %rdi
xorps %xmm6, %xmm6
cvtsi2ss %rdi, %xmm6
addss %xmm6, %xmm6
divss %xmm0, %xmm6
movss %xmm6, 0x4(%rcx,%rsi,4)
addq $0x2, %rsi
paddq %xmm5, %xmm2
cmpq %rsi, %rdx
jne 0x3eef
cmpq $0x0, -0x38(%rbp)
je 0x40c5
movss 0x2111(%rip), %xmm1     # 0x60d0
movaps %xmm1, %xmm2
divss %xmm0, %xmm2
movss (%rcx), %xmm6
xorl %edx, %edx
movss 0x2100(%rip), %xmm0     # 0x60d4
pxor %xmm3, %xmm3
movaps %xmm6, %xmm4
subss %xmm0, %xmm4
cvttss2si %xmm4, %rdi
cvttss2si %xmm6, %r8
movq %r8, %rsi
sarq $0x3f, %rsi
andq %rdi, %rsi
orq %r8, %rsi
js 0x4002
xorps %xmm4, %xmm4
cvtsi2ss %rsi, %xmm4
jmp 0x401e
movq %rsi, %rdi
shrq %rdi
movl %esi, %r8d
andl $0x1, %r8d
orq %rdi, %r8
xorps %xmm4, %xmm4
cvtsi2ss %r8, %xmm4
addss %xmm4, %xmm4
movss 0x4(%rcx,%rdx,4), %xmm5
subss %xmm6, %xmm4
addss %xmm1, %xmm4
mulss (%rbx,%rsi,4), %xmm4
addss %xmm3, %xmm4
cvttss2si %xmm5, %r8
movq %r8, %r9
sarq $0x3f, %r9
movaps %xmm5, %xmm6
subss %xmm0, %xmm6
cvttss2si %xmm6, %rdi
andq %r9, %rdi
orq %r8, %rdi
incq %rsi
cmpq %rdi, %rsi
jae 0x4068
addss (%rbx,%rsi,4), %xmm4
incq %rsi
cmpq %rsi, %rdi
jne 0x405b
cmpq %r15, %rdi
jae 0x40a8
testq %rdi, %rdi
js 0x407c
xorps %xmm6, %xmm6
cvtsi2ss %rdi, %xmm6
jmp 0x4098
movq %rdi, %rsi
shrq %rsi
movl %edi, %r8d
andl $0x1, %r8d
orq %rsi, %r8
xorps %xmm6, %xmm6
cvtsi2ss %r8, %xmm6
addss %xmm6, %xmm6
movaps %xmm5, %xmm7
subss %xmm6, %xmm7
mulss (%rbx,%rdi,4), %xmm7
addss %xmm7, %xmm4
divss %xmm2, %xmm4
movq -0x48(%rbp), %rsi
movss %xmm4, (%rsi,%rdx,4)
incq %rdx
movaps %xmm5, %xmm6
cmpq -0x38(%rbp), %rdx
jne 0x3fd8
movq %r14, -0xb8(%rbp)
movq %rax, %rsp
leaq -0x238(%rbp), %rdi
callq 0x21d0
cmpb $0x0, -0x3c(%rbp)
movq %r15, -0x90(%rbp)
movq -0x38(%rbp), %r14
je 0x4278
leaq 0x20a8(%rip), %rsi      # 0x619f
movq %r12, %rdi
callq 0x2060
testl %eax, %eax
je 0x413d
movq 0x8(%r12), %rdx
movq %r14, %r15
subq %rdx, %r15
jae 0x41b5
movq (%r12), %rsi
leaq -0x238(%rbp), %rdi
callq 0x21b0
leaq -0x29(%rbp), %rsi
movb $0xa, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x21b0
jmp 0x4278
movq 0x514c(%rip), %rsi      # 0x9290
movq 0x514d(%rip), %rdx      # 0x9298
leaq -0x238(%rbp), %rdi
callq 0x21b0
testq %r14, %r14
je 0x4182
leaq -0x238(%rbp), %rbx
movq -0x38(%rbp), %r14
movq 0x51a2(%rip), %rsi      # 0x9310
movq 0x51a3(%rip), %rdx      # 0x9318
movq %rbx, %rdi
callq 0x21b0
decq %r14
jne 0x4167
movq 0x5127(%rip), %rsi      # 0x92b0
movq 0x5128(%rip), %rdx      # 0x92b8
leaq -0x238(%rbp), %rdi
callq 0x21b0
leaq -0x29(%rbp), %rsi
movb $0xa, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x21b0
jmp 0x4278
movq 0x50d4(%rip), %rsi      # 0x9290
movq 0x50d5(%rip), %rdx      # 0x9298
leaq -0x238(%rbp), %rdi
callq 0x21b0
cmpq $0x2, %r15
jae 0x41da
xorl %r15d, %r15d
jmp 0x4206
shrq %r15
leaq -0x238(%rbp), %rbx
movq %r15, %r14
movq 0x5122(%rip), %rsi      # 0x9310
movq 0x5123(%rip), %rdx      # 0x9318
movq %rbx, %rdi
callq 0x21b0
decq %r14
jne 0x41e7
movq -0x38(%rbp), %r14
movq (%r12), %rsi
movq 0x8(%r12), %rdx
leaq -0x238(%rbp), %rdi
callq 0x21b0
addq 0x8(%r12), %r15
cmpq %r14, %r15
jae 0x424a
leaq -0x238(%rbp), %rbx
movq 0x50dd(%rip), %rsi      # 0x9310
movq 0x50de(%rip), %rdx      # 0x9318
movq %rbx, %rdi
callq 0x21b0
incq %r15
cmpq %r14, %r15
jb 0x422c
movq 0x505f(%rip), %rsi      # 0x92b0
movq 0x5060(%rip), %rdx      # 0x92b8
leaq -0x238(%rbp), %rdi
callq 0x21b0
leaq -0x29(%rbp), %rsi
movb $0xa, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x21b0
cmpl $0x0, -0x58(%rbp)
jle 0x4599
movq -0x58(%rbp), %rcx
leaq (,%rcx,8), %rax
leaq -0x1(,%rcx,8), %rcx
testq %rcx, %rcx
js 0x42a5
xorps %xmm0, %xmm0
cvtsi2ss %rcx, %xmm0
jmp 0x42b4
shrq %rcx
xorps %xmm0, %xmm0
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
movss %xmm0, -0x68(%rbp)
movaps -0x80(%rbp), %xmm0
testq %rax, %rax
js 0x42cc
xorps %xmm1, %xmm1
cvtsi2ss %rax, %xmm1
jmp 0x42db
shrq %rax
xorps %xmm1, %xmm1
cvtsi2ss %rax, %xmm1
addss %xmm1, %xmm1
movss %xmm1, -0x4c(%rbp)
movq -0x58(%rbp), %rax
decl %eax
movaps -0xb0(%rbp), %xmm1
movaps %xmm1, %xmm2
subss %xmm0, %xmm2
movss %xmm2, -0x70(%rbp)
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x98(%rbp)
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
movsd %xmm0, -0xc0(%rbp)
leaq -0x238(%rbp), %rbx
leaq 0x4e6e(%rip), %r13      # 0x9190
movl %eax, -0x84(%rbp)
movl %eax, %r15d
cmpb $0x0, -0x3c(%rbp)
je 0x4347
movq 0x5018(%rip), %rsi      # 0x9350
movq 0x5019(%rip), %rdx      # 0x9358
movq %rbx, %rdi
callq 0x21b0
movq %r15, -0x60(%rbp)
leal (,%r15,8), %r12d
cmpq $0x0, -0x38(%rbp)
je 0x4400
movq -0x60(%rbp), %rax
leal 0x7(,%rax,8), %r15d
xorl %r14d, %r14d
movq -0x48(%rbp), %rax
movss (%rax,%r14,4), %xmm0
movaps -0x80(%rbp), %xmm1
maxss %xmm1, %xmm0
minss -0xb0(%rbp), %xmm0
subss %xmm1, %xmm0
divss -0x70(%rbp), %xmm0
mulss -0x68(%rbp), %xmm0
callq 0x2090
cvttss2si %xmm0, %eax
movl %eax, %ecx
subl %r12d, %ecx
jge 0x43bc
movb $0x20, -0x29(%rbp)
movl $0x1, %edx
movq %rbx, %rdi
leaq -0x29(%rbp), %rsi
callq 0x21b0
jmp 0x43f3
movslq %ecx, %rcx
shlq $0x5, %rcx
leaq (%rcx,%r13), %rdx
cmpl %eax, %r15d
leaq 0x8(%rcx,%r13), %rax
leaq 0x4ea2(%rip), %rcx      # 0x9278
cmovlq %rcx, %rax
leaq 0x4e8f(%rip), %rcx      # 0x9270
cmovlq %rcx, %rdx
movq (%rdx), %rsi
movq (%rax), %rdx
movq %rbx, %rdi
callq 0x21b0
incq %r14
cmpq %r14, -0x38(%rbp)
jne 0x436d
cmpb $0x0, -0x3c(%rbp)
movq -0x60(%rbp), %r15
je 0x4507
cmpq $0x1, -0x58(%rbp)
jne 0x44c1
movq 0x4f50(%rip), %rsi      # 0x9370
movq 0x4f51(%rip), %rdx      # 0x9378
movq %rbx, %rdi
callq 0x21b0
movq %rax, %r12
movl $0x6, %edx
movq %rax, %rdi
leaq 0x2096(%rip), %rsi      # 0x64d7
callq 0x21b0
movq (%r12), %rax
movq -0x18(%rax), %rcx
movl 0x18(%r12,%rcx), %edx
movl $0xffffff4f, %esi       # imm = 0xFFFFFF4F
andl %esi, %edx
orl $0x20, %edx
movl %edx, 0x18(%r12,%rcx)
movq -0x18(%rax), %rax
movq $0xc, 0x10(%r12,%rax)
movq %r12, %rdi
movsd -0x98(%rbp), %xmm0
callq 0x2240
movq %rax, %r12
movl $0x7, %edx
movq %rax, %rdi
leaq 0x204d(%rip), %rsi      # 0x64de
callq 0x21b0
movq (%r12), %rax
movq -0x18(%rax), %rcx
movl 0x18(%r12,%rcx), %edx
movl $0xffffff4f, %esi       # imm = 0xFFFFFF4F
andl %esi, %edx
orl $0x20, %edx
movl %edx, 0x18(%r12,%rcx)
movq -0x18(%rax), %rax
movq $0xc, 0x10(%r12,%rax)
jmp 0x44f7
cmpl -0x84(%rbp), %r15d
jne 0x4537
movq 0x4e9f(%rip), %rsi      # 0x9370
movq 0x4ea0(%rip), %rdx      # 0x9378
movq %rbx, %rdi
callq 0x21b0
movq %rax, %r12
movl $0x6, %edx
movq %rax, %rdi
leaq 0x1fed(%rip), %rsi      # 0x64df
callq 0x21b0
movq %r12, %rdi
movsd -0xc0(%rbp), %xmm0
callq 0x2240
testl %r15d, %r15d
je 0x4599
movb $0xa, -0x29(%rbp)
movl $0x1, %edx
movq %rbx, %rdi
leaq -0x29(%rbp), %rsi
callq 0x21b0
leal -0x1(%r15), %eax
testl %r15d, %r15d
movl %eax, %r15d
jg 0x432b
jmp 0x4599
movq 0x4e32(%rip), %rsi      # 0x9370
movq 0x4e33(%rip), %rdx      # 0x9378
testl %r15d, %r15d
je 0x49ad
movq %rbx, %rdi
callq 0x21b0
movl $0x6, %edx
movq %rax, %rdi
leaq 0x1e1b(%rip), %rsi      # 0x6380
movq %rax, %r14
callq 0x21b0
orl $0x4, %r12d
xorps %xmm0, %xmm0
cvtsi2ss %r12, %xmm0
mulss -0x70(%rbp), %xmm0
divss -0x4c(%rbp), %xmm0
addss -0x80(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movq %r14, %rdi
callq 0x2240
jmp 0x4510
cmpb $0x0, -0x3c(%rbp)
je 0x4966
movq -0x90(%rbp), %rbx
leaq 0x1(%rbx), %rax
movq %rax, %xmm1
punpckldq 0x1a55(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1a5d(%rip), %xmm1     # 0x6020
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movapd %xmm0, -0xb0(%rbp)
callq 0x20d0
callq 0x2040
movq %rsp, %r13
addsd 0x1abc(%rip), %xmm0     # 0x60a8
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x1aa0(%rip), %xmm0     # 0x60a0
cvttsd2si %xmm0, %r9
andq %rcx, %r9
orq %rax, %r9
movq -0x38(%rbp), %rcx
movq %rcx, %rax
xorl %edx, %edx
divq %r9
movq %rax, %r10
leaq 0x17(,%rax,8), %rax
andq $-0x10, %rax
movq %rsp, %r14
subq %rax, %r14
movq %r14, %rsp
movq %rsp, %r11
subq %rax, %r11
movq %r11, %rsp
cmpq %r9, %rcx
jb 0x4666
leaq 0x1(%r10), %rsi
xorl %edi, %edi
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %rdi, (%r14,%r8,8)
movq %rcx, %rax
xorl %edx, %edx
divq %rsi
movq %rax, (%r11,%r8,8)
incq %r8
addq %rbx, %rcx
addq %r9, %rdi
cmpq %r10, %r8
jb 0x4648
movq %r9, -0x70(%rbp)
movq -0x38(%rbp), %rax
decq %rax
movq %rax, -0x68(%rbp)
movq %rax, (%r14,%r10,8)
movq %r10, -0x80(%rbp)
movq %r11, -0x48(%rbp)
movq %rbx, (%r11,%r10,8)
leaq -0x29(%rbp), %rsi
movb $0xa, (%rsi)
leaq -0x238(%rbp), %rdi
movl $0x1, %edx
callq 0x21b0
movq 0x4c2c(%rip), %rsi      # 0x92d0
movq 0x4c2d(%rip), %rdx      # 0x92d8
leaq -0x238(%rbp), %rdi
callq 0x21b0
cmpq $0x0, -0x38(%rbp)
je 0x470a
xorl %ebx, %ebx
leaq -0x238(%rbp), %r12
xorl %r15d, %r15d
cmpq (%r14,%r15,8), %rbx
jne 0x46eb
movq 0x4c59(%rip), %rsi      # 0x9330
movq 0x4c5a(%rip), %rdx      # 0x9338
movq %r12, %rdi
callq 0x21b0
incq %r15
jmp 0x4701
movq 0x4c1e(%rip), %rsi      # 0x9310
movq 0x4c1f(%rip), %rdx      # 0x9318
movq %r12, %rdi
callq 0x21b0
incq %rbx
cmpq %rbx, -0x38(%rbp)
jne 0x46ca
movq 0x4bdf(%rip), %rsi      # 0x92f0
movq 0x4be0(%rip), %rdx      # 0x92f8
leaq -0x238(%rbp), %rdi
callq 0x21b0
leaq 0x1dbb(%rip), %rsi      # 0x64e6
leaq -0x238(%rbp), %rdi
movl $0x2, %edx
callq 0x21b0
movq -0x48(%rbp), %rax
movq (%rax), %rsi
leaq -0x238(%rbp), %rdi
callq 0x2110
movq %r13, -0x60(%rbp)
movl $0x1, %r15d
cmpq $0x2, -0x80(%rbp)
jb 0x48bf
movl $0x1, %r14d
movq -0x48(%rbp), %r12
movq (%r12,%r14,8), %rax
movq %rax, -0x38(%rbp)
incq %rax
movq %rax, %xmm1
movq 0x188a(%rip), %xmm0     # 0x6010
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0x188e(%rip), %xmm0     # 0x6020
subpd %xmm0, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
callq 0x20d0
callq 0x2040
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
movsd 0x18e0(%rip), %xmm1     # 0x60a0
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %r13
andq %rcx, %r13
orq %rax, %r13
movq %r13, %rbx
shrq %rbx
movq -0x8(%r12,%r14,8), %rax
incq %rax
movq %rax, %xmm1
punpckldq 0x1826(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x182e(%rip), %xmm1     # 0x6020
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
callq 0x20d0
callq 0x2040
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x1884(%rip), %xmm0     # 0x60a0
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
shrq %rdx
addq -0x70(%rbp), %rbx
addq %r13, %rdx
subq %rdx, %rbx
movq -0x238(%rbp), %rax
movq -0x18(%rax), %rcx
movslq %ebx, %rdx
movq %rdx, -0x228(%rbp,%rcx)
movq -0x18(%rax), %rax
leaq (%rax,%rbp), %r12
addq $-0x238, %r12           # imm = 0xFDC8
cmpb $0x0, 0xe1(%r12)
jne 0x487a
movq %r12, %rdi
movl $0x20, %esi
callq 0x2180
movb $0x1, 0xe1(%r12)
movb $0x20, %al
movb %al, 0xe0(%r12)
movb %al, -0x29(%rbp)
movl $0x1, %edx
leaq -0x238(%rbp), %rdi
leaq -0x29(%rbp), %rsi
callq 0x21b0
leaq -0x238(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x2110
addq %r13, %r15
addq %rbx, %r15
incq %r14
cmpq -0x80(%rbp), %r14
jb 0x476a
movapd -0xb0(%rbp), %xmm0
callq 0x20d0
callq 0x2040
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x17bb(%rip), %xmm0     # 0x60a0
cvttsd2si %xmm0, %rdx
andl %ecx, %edx
orl %edx, %eax
addl %eax, %r15d
movq -0x68(%rbp), %rcx
subl %r15d, %ecx
leaq -0x238(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addl $0x2, %ecx
movslq %ecx, %rcx
movq %rcx, -0x228(%rbp,%rax)
leaq -0x29(%rbp), %rsi
movb $0x20, (%rsi)
movl $0x1, %edx
callq 0x21b0
leaq -0x238(%rbp), %rdi
movq -0x90(%rbp), %rsi
callq 0x2110
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
movq -0x60(%rbp), %rsp
leaq -0x230(%rbp), %rsi
movq -0xb8(%rbp), %rbx
movq %rbx, %rdi
callq 0x2230
movq 0x4635(%rip), %rsi      # 0x8fb8
leaq -0x238(%rbp), %rdi
callq 0x20f0
leaq -0x1c8(%rbp), %rdi
callq 0x2070
movq %rbx, %rax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x238(%rbp), %rdi
callq 0x21b0
movq %rax, %rbx
leaq 0x1b14(%rip), %rsi      # 0x64d7
movl $0x6, %edx
movq %rax, %rdi
callq 0x21b0
movq %rbx, %rdi
movsd -0x98(%rbp), %xmm0
callq 0x2240
jmp 0x45a3
movl $0x10, %edi
callq 0x20c0
movq %rax, %r14
leaq 0x1ac5(%rip), %rsi      # 0x64be
movq %rax, %rdi
callq 0x20a0
movq 0x45e8(%rip), %rsi      # 0x8ff0
movq 0x45a1(%rip), %rdx      # 0x8fb0
movq %r14, %rdi
callq 0x2270
jmp 0x4a3e
jmp 0x4a3e
jmp 0x4a3e
movq %rax, %rbx
movq %r14, %rdi
callq 0x2140
jmp 0x4a60
jmp 0x4a3e
jmp 0x4a3e
jmp 0x4a3e
jmp 0x4a3e
jmp 0x4a3e
jmp 0x4a3e
jmp 0x4a3e
jmp 0x4a3e
jmp 0x4a3e
jmp 0x4a3e
movq %rax, %rbx
movq 0x4570(%rip), %rsi      # 0x8fb8
leaq -0x238(%rbp), %rdi
callq 0x20f0
leaq -0x1c8(%rbp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2280