// File: /workspace/github_cpp_makefile_star2_O1/redpony[P]cpyp/crp_test.cc
// Function: test_mh2()
void test_mh2() {
  cpyp::MT19937 eng;
  cpyp::crp<int> a(0.5, 1.0);
  cpyp::crp<int> b(0.5, 1.0);
  vector<int> hist_a(16, 0);
  vector<int> hist_b(16, 0);
  vector<double> ref_a = {3.70004e-06, 0.0144611, 0.0614236, 0.138702, 0.211308, 0.231733, 0.183865, 0.103685, 0.0409419, 0.0114253, 0.00214592, 0.000281003, 2.33002e-05, 7.00007e-07, 2.12303e-07, 0};
  vector<double> ref_b = {2.90003e-06, 0.00876079, 0.0471061, 0.115841, 0.187615, 0.221488, 0.196102, 0.130352, 0.063905, 0.0224984, 0.00542085, 0.000828908, 7.53008e-05, 4.90005e-06, 1.00001e-07, 0};
  double ref_t0b = 1.53498;

  vector<bool> z(15);
  double c = 0;
  double ac = 0;
  double tmh = 0;
  double zz = 0;
  double t0b = 0;
  for (int s = 0; s < 200000; ++s) {
    for (int i = 0; i < 15; ++i) {
      const unsigned int y_i = i % 3;
      const bool old_z = z[i];
      cpyp::crp<int> old_a = a;
      cpyp::crp<int> old_b = b;
      double lp_old = llh(a, p0_a) + llh(b, p0_b);

      double lq_old = 0;
      double lq_new = 0;
      if (s > 0) (z[i] ? b : a).decrement(y_i, eng, &lq_old);

      double aa = 0.5;  // these can be better estimates
      double bb = 0.5;
      z[i] = cpyp::sample_bernoulli(aa, bb, eng);
      (z[i] ? b : a).increment_no_base(y_i, eng, &lq_new);
      lq_new += log((z[i] ? bb : aa) / (aa + bb));
      lq_old += log((old_z ? bb : aa) / (aa + bb));

      if (s > 0) { 
        double lp_new = llh(a, p0_a) + llh(b, p0_b);
        double acc = exp(lp_new - lp_old + lq_old - lq_new);
        ++tmh;
        if (acc >= 1.0 || cpyp::sample_uniform01<double>(eng) < acc) { // mh accept
          ++ac;
        } else { // mh reject
          std::swap(a, old_a);
          std::swap(b, old_b);
          z[i] = old_z;
        }
      }
    }
    // record sample
    if (s> 200 && s % 10 == 9) {
      assert(a.num_tables() < hist_a.size());
      assert(b.num_tables() < hist_b.size());
      hist_a[a.num_tables()]++; hist_b[b.num_tables()]++; ++c;
      for (int i = 0; i < 15; ++i) {
        unsigned int y_i = i % 3;
        if (!z[i]) { t0b += y_i; ++zz; }
      }
    }
  }
  ac /= tmh;
  cerr << "ACCEPTANCE: " << ac << endl;
  int j =0;
  double te = 0;
  double me = 0;
  for (int i = 0; i < 15; ++i) {
    double a = hist_a[i];
    double b = hist_b[i];
    double err_a = (a / c - ref_a[j]);
    double err_b = (b / c - ref_b[j++]);
    cerr << err_a << "\t" << err_b << endl;
    te += fabs(err_a) + fabs(err_b);
    if (fabs(err_a) > me) { me = fabs(err_a); }
    if (fabs(err_b) > me) { me = fabs(err_b); }
  }
  te /= 30;
  cerr << "t0b = " << (t0b / zz) << endl;
  double ee = fabs((t0b / zz) - ref_t0b);
  cerr << "err t0b = " << ee;
  if (ee > 0.01) { cerr << "  ** TOO HIGH **"; }
  cerr << endl;
  cerr << "Average error: " << te;
  if (te > 0.01) { cerr << "  ** TOO HIGH **"; }
  cerr << endl << "    Max error: " << me;
  if (me > 0.01) { cerr << "  ** TOO HIGH **"; }
  cerr << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1708, %rsp           # imm = 0x1708
leaq 0x380(%rsp), %rdi
callq 0x4c22
leaq 0x290(%rsp), %rdi
movsd 0x6db8(%rip), %xmm0     # 0xa008
movsd 0x6db8(%rip), %xmm1     # 0xa010
callq 0x4cde
leaq 0x198(%rsp), %rdi
movsd 0x6d9b(%rip), %xmm0     # 0xa008
movsd 0x6d9b(%rip), %xmm1     # 0xa010
callq 0x4cde
movl $0x40, %edi
callq 0x21b0
movq %rax, %r13
xorpd %xmm0, %xmm0
movupd %xmm0, 0x30(%rax)
movupd %xmm0, 0x20(%rax)
movupd %xmm0, 0x10(%rax)
movupd %xmm0, (%rax)
movl $0x40, %edi
callq 0x21b0
movq %rax, %rbp
xorpd %xmm0, %xmm0
movupd %xmm0, 0x30(%rax)
movupd %xmm0, 0x20(%rax)
movupd %xmm0, 0x10(%rax)
movupd %xmm0, (%rax)
leaq 0x6f27(%rip), %rsi      # 0xa1f0
leaq 0x210(%rsp), %rax
movl $0x10, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x108(%rsp), %rdi
leaq 0x120(%rsp), %rcx
movl $0x10, %edx
movq %rax, %rsi
callq 0x4ca0
leaq 0x6f70(%rip), %rsi      # 0xa270
leaq 0x210(%rsp), %rax
movl $0x10, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xf0(%rsp), %rdi
leaq 0x120(%rsp), %rcx
movl $0x10, %edx
movq %rax, %rsi
callq 0x4ca0
movq %rbp, (%rsp)
movq %r13, 0x8(%rsp)
leaq 0x210(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x58(%rsp), %rdi
leaq 0x120(%rsp), %rcx
movl $0xf, %esi
callq 0x7bc6
leaq 0x128(%rsp), %rbp
leaq 0x298(%rsp), %r12
xorl %r14d, %r14d
xorpd %xmm0, %xmm0
movapd %xmm0, 0x80(%rsp)
movapd %xmm0, 0xb0(%rsp)
movapd %xmm0, 0xc0(%rsp)
movapd %xmm0, 0xa0(%rsp)
movapd %xmm0, 0x30(%rsp)
movl $0x0, 0x10(%rsp)
xorl %ecx, %ecx
movq 0x58(%rsp), %rax
movl $0x1, %ebx
movq %rcx, 0x90(%rsp)
shlq %cl, %rbx
movq (%rax), %r13
movq 0x290(%rsp), %rax
movq 0x2a0(%rsp), %rcx
movq %rax, 0x120(%rsp)
movq %r14, 0x128(%rsp)
movq %rcx, 0x130(%rsp)
movq %r14, 0x138(%rsp)
movq 0x2b0(%rsp), %rax
movq %rax, 0x140(%rsp)
movups 0x20(%r12), %xmm0
movups %xmm0, 0x20(%rbp)
movq %r14, 0x158(%rsp)
movq %rbp, 0x210(%rsp)
movq %rbp, %rdi
movq %r12, %rsi
leaq 0x210(%rsp), %r15
movq %r15, %rdx
callq 0x5b0e
movq %r13, 0xd8(%rsp)
movq 0x68(%r12), %rax
movq %rax, 0x68(%rbp)
movups 0x38(%r12), %xmm0
movupd 0x48(%r12), %xmm1
movupd 0x58(%r12), %xmm2
movupd %xmm2, 0x58(%rbp)
movupd %xmm1, 0x48(%rbp)
movups %xmm0, 0x38(%rbp)
movq 0x198(%rsp), %rax
movq 0x1a8(%rsp), %rcx
movq %rax, 0x308(%rsp)
movq %r14, 0x310(%rsp)
movq %rcx, 0x318(%rsp)
movq %r14, 0x320(%rsp)
movq 0x1b8(%rsp), %rax
movq %rax, 0x328(%rsp)
xorl %eax, %eax
leaq 0x1a0(%rsp), %r14
movupd 0x20(%r14), %xmm0
leaq 0x310(%rsp), %r13
movupd %xmm0, 0x20(%r13)
movq %rax, 0x340(%rsp)
movq %r13, 0x210(%rsp)
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x5b0e
movq %r15, %rbp
movq 0x68(%r14), %rax
movq %rax, 0x68(%r13)
movupd 0x38(%r14), %xmm0
movupd 0x48(%r14), %xmm1
movupd 0x58(%r14), %xmm2
movupd %xmm2, 0x58(%r13)
movupd %xmm1, 0x48(%r13)
movupd %xmm0, 0x38(%r13)
leaq 0x290(%rsp), %rdi
leaq 0x6dd5(%rip), %rsi      # 0xa2f0
callq 0x24b1
movsd %xmm0, 0x40(%rsp)
leaq 0x198(%rsp), %rdi
leaq 0x6ddb(%rip), %rsi      # 0xa310
callq 0x24b1
movsd %xmm0, 0xe8(%rsp)
movq %r12, %r13
movq 0x90(%rsp), %rdx
movl %edx, %eax
movl $0xaaaaaaab, %ecx       # imm = 0xAAAAAAAB
imulq %rcx, %rax
shrq $0x21, %rax
leal (%rax,%rax,2), %eax
movl %edx, %r12d
subl %eax, %r12d
xorl %r14d, %r14d
movq %r14, 0x28(%rsp)
movq %r14, 0x20(%rsp)
cmpl $0x0, 0x10(%rsp)
leaq 0x380(%rsp), %r15
je 0x35b6
movq 0x58(%rsp), %rax
testq %rbx, (%rax)
leaq 0x198(%rsp), %rdi
leaq 0x290(%rsp), %rax
cmoveq %rax, %rdi
movl %r12d, 0x210(%rsp)
movq %rbp, %rsi
movq %r15, %rdx
leaq 0x28(%rsp), %rcx
callq 0x4d48
movq %r15, %rdi
callq 0x78bf
ucomisd 0x6a42(%rip), %xmm0     # 0xa008
movq 0x58(%rsp), %rax
jbe 0x35d5
movq (%rax), %rcx
orq %rbx, %rcx
jmp 0x35de
movq %rbx, %rcx
notq %rcx
andq (%rax), %rcx
movq %rcx, (%rax)
testq %rbx, %rcx
leaq 0x198(%rsp), %rdi
leaq 0x290(%rsp), %rax
cmoveq %rax, %rdi
movl %r12d, 0x210(%rsp)
movq %rbp, %rsi
movq %r15, %rdx
leaq 0x20(%rsp), %rcx
callq 0x5034
movsd 0x20(%rsp), %xmm0
movsd 0x6a0a(%rip), %xmm1     # 0xa028
addsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x28(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rsp)
cmpl $0x0, 0x10(%rsp)
je 0x370d
leaq 0x290(%rsp), %rdi
leaq 0x6c9e(%rip), %rsi      # 0xa2f0
callq 0x24b1
movsd %xmm0, 0xe0(%rsp)
movq %r13, %r12
leaq 0x198(%rsp), %rdi
leaq 0x6c9e(%rip), %rsi      # 0xa310
callq 0x24b1
movsd 0x40(%rsp), %xmm1
addsd 0xe8(%rsp), %xmm1
movsd 0xe0(%rsp), %xmm2
addsd %xmm0, %xmm2
subsd %xmm1, %xmm2
addsd 0x28(%rsp), %xmm2
subsd 0x20(%rsp), %xmm2
movapd %xmm2, %xmm0
callq 0x2280
movapd %xmm0, %xmm2
movsd 0x6958(%rip), %xmm0     # 0xa010
movapd 0xc0(%rsp), %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, 0xc0(%rsp)
movsd %xmm2, 0x40(%rsp)
ucomisd %xmm0, %xmm2
jae 0x36ee
movq %r15, %rdi
callq 0x78bf
movsd 0x40(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x3715
movapd 0xb0(%rsp), %xmm0
addsd 0x6911(%rip), %xmm0     # 0xa010
movapd %xmm0, 0xb0(%rsp)
jmp 0x3900
movq %r13, %r12
jmp 0x3900
movq 0x290(%rsp), %rax
movq %rax, 0x210(%rsp)
leaq 0x218(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
movq %r12, %rdx
callq 0x7b4c
movq 0x68(%r12), %rax
movq %rax, 0x68(%rbp)
movups 0x38(%r12), %xmm0
movups 0x48(%r12), %xmm1
movups 0x58(%r12), %xmm2
movups %xmm2, 0x58(%rbp)
movups %xmm1, 0x48(%rbp)
movups %xmm0, 0x38(%rbp)
movq 0x120(%rsp), %rax
movq %rax, 0x290(%rsp)
movq %r12, %rdi
leaq 0x128(%rsp), %r13
movq %r13, %rsi
callq 0x22c0
movq 0x68(%r13), %rax
movq %rax, 0x68(%r12)
movups 0x38(%r13), %xmm0
movups 0x48(%r13), %xmm1
movups 0x58(%r13), %xmm2
movups %xmm2, 0x58(%r12)
movups %xmm1, 0x48(%r12)
movups %xmm0, 0x38(%r12)
movq 0x210(%rsp), %rax
movq %rax, 0x120(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x22c0
movq 0x68(%rbp), %rax
movq %rax, 0x68(%r13)
movups 0x38(%rbp), %xmm0
movups 0x48(%rbp), %xmm1
movups 0x58(%rbp), %xmm2
movups %xmm2, 0x58(%r13)
movups %xmm1, 0x48(%r13)
movups %xmm0, 0x38(%r13)
movq %rbp, %rdi
callq 0x5d20
movq 0x198(%rsp), %rax
movq %rax, 0x210(%rsp)
leaq 0x218(%rsp), %r15
movq %r15, %rdi
leaq 0x1a0(%rsp), %r14
movq %r14, %rsi
movq %r14, %rdx
callq 0x7b4c
movq 0x68(%r14), %rax
movq %rax, 0x68(%rbp)
movups 0x38(%r14), %xmm0
movups 0x48(%r14), %xmm1
movups 0x58(%r14), %xmm2
movups %xmm2, 0x58(%rbp)
movups %xmm1, 0x48(%rbp)
movups %xmm0, 0x38(%rbp)
movq 0x308(%rsp), %rax
movq %rax, 0x198(%rsp)
movq %r14, %rdi
leaq 0x310(%rsp), %r13
movq %r13, %rsi
callq 0x22c0
movq 0x68(%r13), %rax
movq %rax, 0x68(%r14)
movups 0x38(%r13), %xmm0
movups 0x48(%r13), %xmm1
movups 0x58(%r13), %xmm2
movups %xmm2, 0x58(%r14)
movups %xmm1, 0x48(%r14)
movups %xmm0, 0x38(%r14)
movq 0x210(%rsp), %rax
movq %rax, 0x308(%rsp)
movq %r13, %rdi
movq %r15, %rsi
callq 0x22c0
leaq 0x218(%rsp), %rcx
movq 0x68(%rcx), %rax
movq %rax, 0x68(%r13)
movupd 0x38(%rcx), %xmm0
movupd 0x48(%rcx), %xmm1
movupd 0x58(%rcx), %xmm2
movupd %xmm2, 0x58(%r13)
movupd %xmm1, 0x48(%r13)
movupd %xmm0, 0x38(%r13)
movq %r15, %rdi
callq 0x5d20
movq 0x58(%rsp), %rax
testq %rbx, 0xd8(%rsp)
je 0x38f7
orq %rbx, (%rax)
jmp 0x38fd
notq %rbx
andq %rbx, (%rax)
xorl %r14d, %r14d
leaq 0x310(%rsp), %rdi
callq 0x5d20
leaq 0x128(%rsp), %rbp
movq %rbp, %rdi
callq 0x5d20
movq 0x90(%rsp), %rcx
incq %rcx
cmpq $0xf, %rcx
jne 0x33a6
movl 0x10(%rsp), %edx
cmpl $0xc9, %edx
jb 0x3a0e
movl %edx, %eax
movl $0xcccccccd, %ecx       # imm = 0xCCCCCCCD
imulq %rcx, %rax
shrq $0x23, %rax
addl %eax, %eax
leal (%rax,%rax,4), %eax
movl %edx, %ecx
subl %eax, %ecx
cmpl $0x9, %ecx
jne 0x3a0e
movl 0x290(%rsp), %eax
cmpq $0x10, %rax
jae 0x3e3e
movl 0x198(%rsp), %ecx
cmpq $0x10, %rcx
jae 0x3e5d
movq 0x8(%rsp), %rdx
incl (%rdx,%rax,4)
movq (%rsp), %rax
incl (%rax,%rcx,4)
movq 0x58(%rsp), %rax
movq (%rax), %rax
xorl %ecx, %ecx
btq %rcx, %rax
movapd 0xa0(%rsp), %xmm0
addsd 0x665d(%rip), %xmm0     # 0xa010
jb 0x39eb
movl %ecx, %edx
movl $0xaaaaaaab, %esi       # imm = 0xAAAAAAAB
imulq %rsi, %rdx
shrq $0x21, %rdx
leal (%rdx,%rdx,2), %edx
movl %ecx, %esi
subl %edx, %esi
xorps %xmm1, %xmm1
cvtsi2sd %esi, %xmm1
movapd 0x30(%rsp), %xmm2
addsd %xmm1, %xmm2
movapd %xmm2, 0x30(%rsp)
movapd %xmm0, 0xa0(%rsp)
incq %rcx
cmpq $0xf, %rcx
jne 0x399e
movapd 0x80(%rsp), %xmm0
addsd 0x660b(%rip), %xmm0     # 0xa010
movapd %xmm0, 0x80(%rsp)
movl 0x10(%rsp), %eax
incl %eax
movl %eax, 0x10(%rsp)
cmpl $0x30d40, %eax          # imm = 0x30D40
jne 0x33a4
movq 0xa5c6(%rip), %rdi      # 0xdff0
leaq 0x69a7(%rip), %rsi      # 0xa3d8
movl $0xc, %edx
callq 0x21c0
movapd 0xb0(%rsp), %xmm0
divsd 0xc0(%rsp), %xmm0
movq 0xa59c(%rip), %rdi      # 0xdff0
callq 0x2230
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movapd 0x80(%rsp), %xmm0
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
movapd %xmm0, 0x80(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x40(%rsp)
xorl %r12d, %r12d
movq 0xa543(%rip), %rbx      # 0xdff0
leaq 0x6931(%rip), %r14      # 0xa3e5
movapd %xmm0, 0x10(%rsp)
movq 0x8(%rsp), %r13
movq (%rsp), %rbp
movq 0x108(%rsp), %rax
movq 0xf0(%rsp), %rcx
movss (%rbp,%r12,4), %xmm0
movss (%r13,%r12,4), %xmm1
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
cvtdq2pd %xmm1, %xmm0
divpd 0x80(%rsp), %xmm0
movsd (%rax,%r12,8), %xmm1
movhpd (%rcx,%r12,8), %xmm1    # xmm1 = xmm1[0],mem[0]
subpd %xmm1, %xmm0
movq %rbx, %rdi
movapd %xmm0, 0x90(%rsp)
callq 0x2230
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x21c0
movapd 0x90(%rsp), %xmm0
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
movq %r15, %rdi
callq 0x2230
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
incq %r12
movdqa 0x90(%rsp), %xmm3
pand 0x6528(%rip), %xmm3     # 0xa0a0
pshufd $0xee, %xmm3, %xmm0     # xmm0 = xmm3[2,3,2,3]
movdqa %xmm3, %xmm1
addsd %xmm0, %xmm1
movapd 0x10(%rsp), %xmm2
addsd %xmm1, %xmm2
movapd %xmm2, 0x10(%rsp)
maxsd 0x40(%rsp), %xmm3
maxsd %xmm3, %xmm0
movapd %xmm0, 0x40(%rsp)
cmpq $0xf, %r12
jne 0x3ac3
movq 0xa43a(%rip), %rdi      # 0xdff0
leaq 0x68b9(%rip), %rsi      # 0xa476
movl $0x6, %edx
callq 0x21c0
movapd 0x30(%rsp), %xmm0
divsd 0xa0(%rsp), %xmm0
movq 0xa413(%rip), %rdi      # 0xdff0
movapd %xmm0, 0x30(%rsp)
callq 0x2230
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq 0xa3d7(%rip), %rdi      # 0xdff0
leaq 0x6852(%rip), %rsi      # 0xa472
movl $0xa, %edx
callq 0x21c0
movapd 0x30(%rsp), %xmm0
addsd 0x6400(%rip), %xmm0     # 0xa038
andpd 0x6460(%rip), %xmm0     # 0xa0a0
movapd %xmm0, 0x30(%rsp)
movq 0xa3a3(%rip), %rbx      # 0xdff0
movq %rbx, %rdi
movaps 0x30(%rsp), %xmm0
callq 0x2230
movapd 0x30(%rsp), %xmm0
ucomisd 0x63b8(%rip), %xmm0     # 0xa020
jbe 0x3c82
movq 0xa37f(%rip), %rdi      # 0xdff0
leaq 0x677f(%rip), %rsi      # 0xa3f7
movl $0x10, %edx
callq 0x21c0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0xa350(%rip), %rdi      # 0xdff0
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq 0xa33c(%rip), %rdi      # 0xdff0
leaq 0x672c(%rip), %rsi      # 0xa3e7
movl $0xf, %edx
callq 0x21c0
movapd 0x10(%rsp), %xmm0
divsd 0x635d(%rip), %xmm0     # 0xa030
movq 0xa316(%rip), %rbx      # 0xdff0
movq %rbx, %rdi
movapd %xmm0, 0x10(%rsp)
callq 0x2230
movapd 0x10(%rsp), %xmm0
ucomisd 0x632a(%rip), %xmm0     # 0xa020
jbe 0x3d10
movq 0xa2f1(%rip), %rdi      # 0xdff0
leaq 0x66f1(%rip), %rsi      # 0xa3f7
movl $0x10, %edx
callq 0x21c0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0xa2c2(%rip), %rbx      # 0xdff0
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq %rax, %r14
leaq 0x66c0(%rip), %rsi      # 0xa408
movl $0xf, %edx
movq %rax, %rdi
callq 0x21c0
movq %r14, %rdi
movapd 0x40(%rsp), %xmm0
callq 0x2230
movapd 0x40(%rsp), %xmm0
ucomisd 0x62af(%rip), %xmm0     # 0xa020
jbe 0x3d8b
movq 0xa276(%rip), %rdi      # 0xdff0
leaq 0x6676(%rip), %rsi      # 0xa3f7
movl $0x10, %edx
callq 0x21c0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0xa247(%rip), %rdi      # 0xdff0
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x3dde
callq 0x2180
xorl %eax, %eax
movq %rax, 0x58(%rsp)
movl %eax, 0x60(%rsp)
movq %rax, 0x68(%rsp)
movl %eax, 0x70(%rsp)
movq %rax, 0x78(%rsp)
movq 0xf0(%rsp), %rdi
testq %rdi, %rdi
je 0x3df0
callq 0x2180
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
je 0x3e02
callq 0x2180
movq %rbp, %rdi
callq 0x2180
movq %r13, %rdi
callq 0x2180
leaq 0x1a0(%rsp), %rdi
callq 0x5d20
leaq 0x298(%rsp), %rdi
callq 0x5d20
addq $0x1708, %rsp           # imm = 0x1708
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x65d3(%rip), %rdi      # 0xa418
leaq 0x65eb(%rip), %rsi      # 0xa437
leaq 0x65f0(%rip), %rcx      # 0xa443
movl $0xb7, %edx
callq 0x20e0
leaq 0x65ef(%rip), %rdi      # 0xa453
leaq 0x65cc(%rip), %rsi      # 0xa437
leaq 0x65d1(%rip), %rcx      # 0xa443
movl $0xb8, %edx
callq 0x20e0
movq %rax, %rbx
movq 0x8(%rsp), %r13
movq (%rsp), %rbp
jmp 0x3f30
movq %rax, %rbx
jmp 0x3f42
movq %rax, %rbx
jmp 0x3f54
movq %rax, %rbx
jmp 0x3f5c
movq %rax, %rbx
jmp 0x3f64
movq %rax, %rbx
jmp 0x3f71
jmp 0x3ec9
jmp 0x3edb
jmp 0x3ec9
jmp 0x3ec1
jmp 0x3ec1
jmp 0x3ec1
movq %rax, %rdi
callq 0x59a4
movq %rax, %rbx
jmp 0x3f08
jmp 0x3ee2
jmp 0x3ee2
jmp 0x3ee2
jmp 0x3ee2
movq %rax, %rbx
jmp 0x3ef2
movq %rax, %rbx
jmp 0x3eff
jmp 0x3ee2
movq %rax, %rbx
leaq 0x310(%rsp), %rdi
callq 0x5d20
leaq 0x128(%rsp), %rdi
callq 0x5d20
movq 0x8(%rsp), %r13
movq (%rsp), %rbp
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x3f30
callq 0x2180
xorl %eax, %eax
movq %rax, 0x58(%rsp)
movl %eax, 0x60(%rsp)
movq %rax, 0x68(%rsp)
movl %eax, 0x70(%rsp)
movq %rax, 0x78(%rsp)
movq 0xf0(%rsp), %rdi
testq %rdi, %rdi
je 0x3f42
callq 0x2180
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
je 0x3f54
callq 0x2180
movq %rbp, %rdi
callq 0x2180
movq %r13, %rdi
callq 0x2180
leaq 0x1a0(%rsp), %rdi
callq 0x5d20
leaq 0x298(%rsp), %rdi
callq 0x5d20
movq %rbx, %rdi
callq 0x2270