// File: /workspace/github_cpp_makefile_star2_O3/biotomas[P]ipasir/app/ipasir-check-satunsat/ipasir-check-satunsat.cc
// Function: main
int main(int argc, char* argv[])
{
  std::cout << "Norbert Manthey -- IPASIR iterative satunsat checker" << std::endl;
  std::cout << "  add formula that has sub formulas of blocks" << std::endl
            << "  use almost full stack of assumptions, except last variable for each block" << std::endl
            << "  and modify last polarities per call" << std::endl;
  if(argc < 3) {
    std::cout << "usage: " << argv[0] << " X Y Z ... with 2 < X < 2^30, 1 < Y < 10, 1 < Z" << std::endl;
    return 1;
  }
  
  int X = atoi(argv[1]);
  int Y = atoi(argv[2]);
  int Z = atoi(argv[3]);
  
  if(X<3) {
    std::cout << "error: given first number " << X << " is not in limits" << std::endl;
    return 1;
  }
  
  if(Y<1 || Y>9) {
    std::cout << "error: given second number " << Y << " is not in limits" << std::endl;
    return 1;
  }
  
  if(Z < 2)  {
    std::cout << "error: given third number " << Z << " is not in limits" << std::endl;
    return 1;
  }

  SATSolver solver;
  
  const int periodsize = (1 << Y);
  vector<int> clause(Y,0);
  int index = 0;
  int clauses = 0;
  int maxvar = 0;
  for(int i = 1 ; i < periodsize; ++i) {
    index = i;
    int sum = 0;
    for(int j = 0 ; j < Y; ++j) {
      clause[j] = ((index & 1) == 0) ? j+1 : -j-1;
      sum += clause[j] > 0 ? 1 : -1;
      index = index >> 1;
    }
    assert(sum < (int)clause.size() && "clause with positive literals only should not be created");
    
    for(int j = 0; j < Z; ++ j) {
      if(j>0) {
	for(int k=0; k < Y; ++k) {
	  clause[k] = clause[k] > 0 ? clause[k] + Y : clause[k] - Y;
	  maxvar = maxvar > clause[k] ? maxvar : clause[k];
	}
      }
      solver.addClause(clause);
      clauses ++;
    }
  }
  
  std::cout << "created formula with " << clauses << " clauses, and maxvar " << maxvar << std::endl;
  
  vector<int> assumptions;
  std::vector<int> model;
  std::vector<int> conflict;
  
  for(int i = 1 ; i <= maxvar; ++i) 
  {
    // do not add last variable per block
    if((i % periodsize) != 0 ) assumptions.push_back(-i);
  }

  // create a map with pointers to the assumption vector
  int *map[maxvar + 1];
  int fakeentry = 0;
  int pointat = 0;
  for(int i = 1; i <= maxvar; ++i)
  {
    if((i % periodsize) != 0 ) {
      map[i] = &(assumptions[pointat]);
      pointat++;
    } else {
      map[i] = &fakeentry;
    }
  }

  int ret = solver.solve(assumptions, model, conflict);
  std::cout << "initial call returned with " << ret << std::endl;
  if(ret != 10)
  {
    std::cout << "error: first call did not result in model, but " << ret << ", abort" << std::endl;
    return 1;
  }
  
  double runtime = cpuTime();
  int call = 0, satresults = 0, unsatresults = 0;
  for(int i = 2; i <= X; ++ i)
  {
    // modify last bits of assumptions
    int mask = call;
    int index = 1;
    bool expectUNSAT = false;
    while(mask > 0 && index <= maxvar) {
      if((mask & 1)==1) {
        *(map[maxvar - index]) = -(*(map[maxvar - index]));
        if(map[maxvar - index] != &fakeentry && !expectUNSAT) {
          expectUNSAT = true;
        }
      }
      mask = mask >> 1;
      index ++;
    }
    conflict.clear();
    int ret = solver.solve(assumptions, model, conflict);
    call ++;
    if(i % 256 == 0) std::cout << "  after " << i << " calls: " << (double)X / (cpuTime()-runtime) << " calls per second" << std::endl;
    if (ret==20) {
      ++ unsatresults;
      solver.addClause(conflict);
    } else {
      ++ satresults;
    }

    if(expectUNSAT && ret != 20 && call!=1) {
      std::cout << "error: in call " << call << ", did not detect conflict (but " << ret << ") on unsatisfiable input, abort" << std::endl;
      std::cout << "used assumptions: " << assumptions << std::endl;
      return 1;
    } else if (!expectUNSAT && ret != 10) {
      std::cout << "error: in call " << call << ", did not detect model (but " << ret << ") on satisfiable input, abort" << std::endl;
      std::cout << "used assumptions: " << assumptions << std::endl;
      return 1;
    }

    // modify last bits of assumptions back to negative
    mask = call;
    index = 1;
    while(mask > 0 && index <= maxvar) {
      if(*(map[maxvar - index]) > 0) {
        *(map[maxvar - index]) = -(*(map[maxvar - index]));
      }
      mask = mask >> 1;
      index ++;
    }
  }
  runtime = cpuTime() - runtime;
  std::cout << "performed " << (double)X / runtime << " calls per second, " 
            << satresults << " SAT, " << unsatresults << " UNSAT"
            << std::endl;
  
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rsi, %r14
movl %edi, %ebx
movq 0x167ac(%rip), %r15     # 0x18fc8
leaq 0xf81d(%rip), %rsi      # 0x12040
movl $0x34, %edx
movq %r15, %rdi
callq 0x21b0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq 0xf817(%rip), %rsi      # 0x12075
movl $0x2d, %edx
movq %r15, %rdi
callq 0x21b0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq %rax, %r15
leaq 0xf807(%rip), %rsi      # 0x120a3
movl $0x4b, %edx
movq %rax, %rdi
callq 0x21b0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq %rax, %r15
leaq 0xf815(%rip), %rsi      # 0x120ef
movl $0x25, %edx
movq %rax, %rdi
callq 0x21b0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
cmpl $0x2, %ebx
jg 0x2959
movq 0x166ae(%rip), %rbx     # 0x18fc8
leaq 0xf7f4(%rip), %rsi      # 0x12115
movl $0x7, %edx
movq %rbx, %rdi
callq 0x21b0
movq (%r14), %r14
testq %r14, %r14
je 0x29d8
movq %r14, %rdi
callq 0x2080
movq 0x1667f(%rip), %rdi     # 0x18fc8
movq %r14, %rsi
movq %rax, %rdx
callq 0x21b0
jmp 0x29ef
movq 0x8(%r14), %rdi
callq 0x2250
movl %eax, %r13d
movq 0x10(%r14), %rdi
callq 0x2250
movl %eax, %ebx
movq 0x18(%r14), %rdi
callq 0x2250
cmpl $0x2, %r13d
jg 0x29a5
movq 0x16642(%rip), %rbx     # 0x18fc8
leaq 0xf7c0(%rip), %rsi      # 0x1214d
movl $0x1a, %edx
movq %rbx, %rdi
callq 0x21b0
movq %rbx, %rdi
movl %r13d, %esi
jmp 0x2a27
movl %eax, %r15d
movl %ebx, %r12d
leal -0xa(%r12), %eax
cmpl $-0xa, %eax
ja 0x2a00
movq 0x1660c(%rip), %rbx     # 0x18fc8
leaq 0xf7b7(%rip), %rsi      # 0x1217a
movl $0x1b, %edx
movq %rbx, %rdi
callq 0x21b0
movq %rbx, %rdi
movl %r12d, %esi
jmp 0x2a27
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2290
leaq 0xf727(%rip), %rsi      # 0x1211d
movl $0x2f, %edx
movq %rbx, %rdi
jmp 0x2a3e
cmpl $0x1, %r15d
jg 0x2a80
movq 0x165bb(%rip), %rbx     # 0x18fc8
leaq 0xf782(%rip), %rsi      # 0x12196
movl $0x1a, %edx
movq %rbx, %rdi
callq 0x21b0
movq %rbx, %rdi
movl %r15d, %esi
callq 0x22a0
movq %rax, %rbx
leaq 0xf732(%rip), %rsi      # 0x12168
movl $0x11, %edx
movq %rax, %rdi
callq 0x21b0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movl $0x1, %ebx
movl %ebx, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r13d, -0x5c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x3464
movl $0x1, %ebx
movl %r12d, %ecx
shll %cl, %ebx
leaq -0x180(%rbp), %rdx
movl $0x0, (%rdx)
leaq -0xd0(%rbp), %rdi
leaq -0x50(%rbp), %rcx
movq %r12, %rsi
callq 0x353c
movl %r12d, %r13d
negl %r13d
leal -0x1(%rbx), %eax
movl %r15d, %ecx
movl %eax, -0x70(%rbp)
imull %eax, %ecx
movl %ecx, -0x2c(%rbp)
xorl %r14d, %r14d
movl $0x1, %esi
movq %rbx, -0x68(%rbp)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq -0xd0(%rbp), %rax
xorl %edi, %edi
xorl %ecx, %ecx
movl %esi, -0x58(%rbp)
leaq 0x1(%rdi), %r8
testb $0x1, %sil
movl %r8d, %r9d
cmovnel %edx, %r9d
movl %r9d, (%rax,%rdi,4)
xorl %edi, %edi
testl %r9d, %r9d
setg %dil
leal (%rcx,%rdi,2), %ecx
decl %ecx
shrl %esi
decl %edx
movq %r8, %rdi
cmpq %r8, %r12
jne 0x2aee
movq -0xc8(%rbp), %rdx
subq %rax, %rdx
shrq $0x2, %rdx
cmpl %edx, %ecx
jge 0x33b2
xorl %ebx, %ebx
testl %ebx, %ebx
je 0x2b60
movq -0xd0(%rbp), %rax
xorl %ecx, %ecx
movl (%rax,%rcx,4), %edx
testl %edx, %edx
movl %r13d, %esi
cmovgl %r12d, %esi
addl %edx, %esi
movl %esi, (%rax,%rcx,4)
cmpl %esi, %r14d
cmovlel %esi, %r14d
incq %rcx
cmpq %rcx, %r12
jne 0x2b40
leaq -0xa0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x36b8
incl %ebx
cmpl %r15d, %ebx
jne 0x2b33
movl -0x58(%rbp), %esi
incl %esi
movq -0x68(%rbp), %rbx
cmpl %ebx, %esi
jne 0x2adb
movq 0x16436(%rip), %rdi     # 0x18fc8
leaq 0xf69f(%rip), %rsi      # 0x12238
movl $0x15, %edx
callq 0x21b0
movq 0x1641e(%rip), %rdi     # 0x18fc8
movl -0x2c(%rbp), %esi
callq 0x22a0
movq %rax, %rbx
leaq 0xf692(%rip), %rsi      # 0x1224e
movl $0x15, %edx
movq %rax, %rdi
callq 0x21b0
movq %rbx, %rdi
movl %r14d, %esi
callq 0x22a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
xorpd %xmm0, %xmm0
movapd %xmm0, -0x50(%rbp)
xorl %eax, %eax
movq %rax, -0x40(%rbp)
movq %rax, -0xe0(%rbp)
movapd %xmm0, -0xf0(%rbp)
movq %rax, -0x80(%rbp)
movapd %xmm0, -0x90(%rbp)
movl %r14d, %r13d
testl %r14d, %r14d
jle 0x2cfa
movl %r14d, %r12d
negl %r12d
movl $0x1, %r15d
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %r15d, -0x70(%rbp)
je 0x2c77
movl %ebx, -0x180(%rbp)
movq -0x48(%rbp), %rsi
cmpq -0x40(%rbp), %rsi
je 0x2c67
movl %ebx, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x48(%rbp)
jmp 0x2c77
leaq -0x50(%rbp), %rdi
leaq -0x180(%rbp), %rdx
callq 0x3bb4
leal (%r12,%r15), %eax
incl %eax
movl %r15d, %ecx
incl %ecx
decl %ebx
movl %ecx, %r15d
cmpl $0x1, %eax
jne 0x2c45
movq %rsp, -0xa8(%rbp)
leaq 0x17(,%r13,8), %rax
movabsq $0xffffffff0, %rcx      # imm = 0xFFFFFFFF0
andq %rax, %rcx
movq %rsp, %r12
subq %rcx, %r12
movq %r12, %rsp
movl $0x0, -0x60(%rbp)
testl %r14d, %r14d
jle 0x2d1d
leaq 0x1(%r13), %rax
xorl %ecx, %ecx
movl $0x1, %edx
movq -0x50(%rbp), %rsi
leaq -0x60(%rbp), %rdi
movl -0x70(%rbp), %r10d
xorl %r8d, %r8d
testl %edx, %r10d
setne %r8b
movl %ecx, %r9d
leaq (%rsi,%r9,4), %r9
cmoveq %rdi, %r9
addl %r8d, %ecx
movq %r9, (%r12,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x2cd4
jmp 0x2d1d
movq %rsp, -0xa8(%rbp)
movq %rsp, %r12
leaq 0x17(,%r13,8), %rax
andq $-0x10, %rax
subq %rax, %r12
movq %r12, %rsp
movl $0x0, -0x60(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
leaq -0x90(%rbp), %rcx
callq 0x371e
movl %eax, %ebx
movq 0x16284(%rip), %rdi     # 0x18fc8
leaq 0xf519(%rip), %rsi      # 0x12264
movl $0x1b, %edx
callq 0x21b0
movq 0x1626c(%rip), %rdi     # 0x18fc8
movl %ebx, %esi
callq 0x22a0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
cmpl $0xa, %ebx
jne 0x30b2
movl $0x0, -0x2c(%rbp)
leaq -0x180(%rbp), %rbx
xorl %edi, %edi
movq %rbx, %rsi
callq 0x20d0
xorps %xmm0, %xmm0
cvtsi2sdq (%rbx), %xmm0
cvtsi2sdq 0x8(%rbx), %xmm1
divsd 0xf244(%rip), %xmm1     # 0x12008
addsd %xmm0, %xmm1
movsd %xmm1, -0xb0(%rbp)
movl -0x5c(%rbp), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0xb8(%rbp)
addl $-0x2, %eax
movl %eax, -0x5c(%rbp)
leaq (%r12,%r13,8), %rax
addq $-0x8, %rax
movq %rax, -0x70(%rbp)
movl $0x2, %r15d
movl $0x0, -0x74(%rbp)
xorl %ebx, %ebx
movl %ebx, %eax
xorl %r12d, %r12d
movq %rax, -0x58(%rbp)
testl %eax, %eax
je 0x2e60
testl %r14d, %r14d
jle 0x2e60
movl $0x1, %eax
xorl %r12d, %r12d
movq -0x70(%rbp), %rcx
movq -0x58(%rbp), %rdx
testb $0x1, %dl
je 0x2e49
movq (%rcx), %rsi
negl (%rsi)
leaq -0x60(%rbp), %rdi
cmpq %rdi, %rsi
je 0x2e49
movzbl %r12b, %r12d
testb $0x1, %r12b
movl $0x1, %esi
cmovel %esi, %r12d
cmpl $0x2, %edx
jb 0x2e60
shrl %edx
leaq 0x1(%rax), %rsi
addq $-0x8, %rcx
cmpq %r13, %rax
movq %rsi, %rax
jb 0x2e25
movq -0x90(%rbp), %rax
cmpq %rax, -0x88(%rbp)
je 0x2e77
movq %rax, -0x88(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
leaq -0x90(%rbp), %rcx
callq 0x371e
movl %eax, -0x68(%rbp)
testb %r15b, %r15b
jne 0x2f6b
movl $0x8, %edx
movq 0x1611b(%rip), %rdi     # 0x18fc8
leaq 0xf3fc(%rip), %rsi      # 0x122b0
callq 0x21b0
movq 0x16108(%rip), %rdi     # 0x18fc8
movl %r15d, %esi
callq 0x22a0
movq %rax, %rbx
movl $0x8, %edx
movq %rax, %rdi
leaq 0xf3df(%rip), %rsi      # 0x122b9
callq 0x21b0
xorl %edi, %edi
leaq -0x180(%rbp), %rsi
callq 0x20d0
xorps %xmm0, %xmm0
cvtsi2sdq -0x180(%rbp), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdq -0x178(%rbp), %xmm1
divsd 0xf0fb(%rip), %xmm1     # 0x12008
addsd %xmm0, %xmm1
subsd -0xb0(%rbp), %xmm1
movsd -0xb8(%rbp), %xmm0
divsd %xmm1, %xmm0
movq %rbx, %rdi
callq 0x2260
movq %rax, %rbx
movl $0x11, %edx
movq %rax, %rdi
leaq 0xf383(%rip), %rsi      # 0x122c2
callq 0x21b0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq -0x58(%rbp), %rax
leal 0x1(%rax), %ebx
cmpl $0x14, -0x68(%rbp)
jne 0x2f90
leaq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x36b8
incl -0x2c(%rbp)
jmp 0x2fa8
testl %eax, %eax
sete %al
movl %r12d, %ecx
notb %cl
orb %al, %cl
testb $0x1, %cl
je 0x3216
incl -0x74(%rbp)
cmpl $0xa, -0x68(%rbp)
setne %al
xorb $0x1, %r12b
testb %r12b, %al
jne 0x3120
testl %r14d, %r14d
movq -0x58(%rbp), %r8
jle 0x2ff4
movl $0x1, %ecx
movq -0x70(%rbp), %rax
movl %ebx, %edx
movq (%rax), %rsi
movl (%rsi), %edi
testl %edi, %edi
jle 0x2fdd
negl %edi
movl %edi, (%rsi)
cmpl $0x2, %edx
jb 0x2ff4
shrl %edx
leaq 0x1(%rcx), %rsi
addq $-0x8, %rax
cmpq %r13, %rcx
movq %rsi, %rcx
jb 0x2fd0
incl %r15d
cmpl -0x5c(%rbp), %r8d
jne 0x2e03
callq 0x38e8
movsd %xmm0, -0x58(%rbp)
movq 0x15fb6(%rip), %rdi     # 0x18fc8
leaq 0xf359(%rip), %rsi      # 0x12372
movl $0xa, %edx
callq 0x21b0
movsd -0x58(%rbp), %xmm1
subsd -0xb0(%rbp), %xmm1
movsd -0xb8(%rbp), %xmm0
divsd %xmm1, %xmm0
movq 0x15f85(%rip), %rdi     # 0x18fc8
callq 0x2260
movq %rax, %rbx
leaq 0xf32b(%rip), %rsi      # 0x1237d
movl $0x13, %edx
movq %rax, %rdi
callq 0x21b0
movq %rbx, %rdi
movl -0x74(%rbp), %esi
callq 0x22a0
movq %rax, %rbx
leaq 0xf31d(%rip), %rsi      # 0x12391
movl $0x6, %edx
movq %rax, %rdi
callq 0x21b0
movq %rbx, %rdi
movl -0x2c(%rbp), %esi
callq 0x22a0
movq %rax, %r14
leaq 0xf302(%rip), %rsi      # 0x12398
movl $0x6, %edx
movq %rax, %rdi
callq 0x21b0
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x2090
jmp 0x3337
movq 0x15f0f(%rip), %rdi     # 0x18fc8
leaq 0xf1c0(%rip), %rsi      # 0x12280
movl $0x2f, %edx
callq 0x21b0
movq 0x15ef7(%rip), %rdi     # 0x18fc8
movl %ebx, %esi
callq 0x22a0
movq %rax, %rbx
leaq 0xf288(%rip), %rsi      # 0x1236a
movl $0x7, %edx
movq %rax, %rdi
callq 0x21b0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movl $0x1, %ebx
movq %rax, %rdi
callq 0x20f0
jmp 0x3337
movq 0x15ea1(%rip), %rdi     # 0x18fc8
leaq 0xf1a6(%rip), %rsi      # 0x122d4
movl $0xf, %edx
callq 0x21b0
movq 0x15e89(%rip), %rdi     # 0x18fc8
movl %ebx, %esi
callq 0x22a0
movq %rax, %rbx
leaq 0xf1e7(%rip), %rsi      # 0x12337
movl $0x1c, %edx
movq %rax, %rdi
callq 0x21b0
movq %rbx, %rdi
movl -0x68(%rbp), %esi
callq 0x22a0
movq %rax, %rbx
leaq 0xf1e2(%rip), %rsi      # 0x12354
movl $0x1d, %edx
movq %rax, %rdi
callq 0x21b0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq 0x15e1b(%rip), %rdi     # 0x18fc8
leaq 0xf170(%rip), %rsi      # 0x12324
movl $0x12, %edx
callq 0x21b0
movq -0x48(%rbp), %rax
cmpq -0x50(%rbp), %rax
je 0x3303
xorl %r15d, %r15d
movq 0x15df2(%rip), %rbx     # 0x18fc8
leaq 0xf1b9(%rip), %r14      # 0x12396
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21b0
movq -0x50(%rbp), %rax
movl (%rax,%r15,4), %esi
movq %rbx, %rdi
callq 0x22a0
incq %r15
movq -0x48(%rbp), %rax
subq -0x50(%rbp), %rax
sarq $0x2, %rax
cmpq %r15, %rax
ja 0x31dd
jmp 0x3303
movq 0x15dab(%rip), %rdi     # 0x18fc8
leaq 0xf0b0(%rip), %rsi      # 0x122d4
movl $0xf, %edx
callq 0x21b0
movq 0x15d93(%rip), %rdi     # 0x18fc8
movl %ebx, %esi
callq 0x22a0
movq %rax, %rbx
leaq 0xf09e(%rip), %rsi      # 0x122e4
movl $0x1f, %edx
movq %rax, %rdi
callq 0x21b0
movq %rbx, %rdi
movl -0x68(%rbp), %esi
callq 0x22a0
movq %rax, %rbx
leaq 0xf09c(%rip), %rsi      # 0x12304
movl $0x1f, %edx
movq %rax, %rdi
callq 0x21b0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq 0x15d25(%rip), %rdi     # 0x18fc8
leaq 0xf07a(%rip), %rsi      # 0x12324
movl $0x12, %edx
callq 0x21b0
movq -0x48(%rbp), %rax
cmpq -0x50(%rbp), %rax
je 0x3303
xorl %r15d, %r15d
movq 0x15d00(%rip), %rbx     # 0x18fc8
leaq 0xf0c7(%rip), %r14      # 0x12396
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21b0
movq -0x50(%rbp), %rax
movl (%rax,%r15,4), %esi
movq %rbx, %rdi
callq 0x22a0
incq %r15
movq -0x48(%rbp), %rax
subq -0x50(%rbp), %rax
sarq $0x2, %rax
cmpq %r15, %rax
ja 0x32cf
movq 0x15cbe(%rip), %rdi     # 0x18fc8
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq 0x15ca3(%rip), %rdi     # 0x18fc8
callq 0x2030
movl $0x1, %ebx
movq %rax, %rdi
callq 0x20f0
movq -0xa8(%rbp), %rsp
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x3356
movq -0x80(%rbp), %rsi
subq %rdi, %rsi
callq 0x2180
movq -0xf0(%rbp), %rdi
testq %rdi, %rdi
je 0x3371
movq -0xe0(%rbp), %rsi
subq %rdi, %rsi
callq 0x2180
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x3386
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x2180
movq -0xd0(%rbp), %rdi
testq %rdi, %rdi
je 0x33a1
movq -0xc0(%rbp), %rsi
subq %rdi, %rsi
callq 0x2180
leaq -0xa0(%rbp), %rdi
callq 0x391e
jmp 0x2a6f
leaq 0xedf8(%rip), %rdi      # 0x121b1
leaq 0xee48(%rip), %rsi      # 0x12208
leaq 0xee5a(%rip), %rcx      # 0x12221
movl $0x47, %edx
callq 0x20e0
movq %rax, %rbx
jmp 0x344f
jmp 0x33e4
jmp 0x33e4
jmp 0x33e4
jmp 0x33e4
jmp 0x3431
jmp 0x33e4
jmp 0x33e4
movq %rax, %rbx
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x33ff
movq -0x80(%rbp), %rsi
subq %rdi, %rsi
callq 0x2180
movq -0xf0(%rbp), %rdi
testq %rdi, %rdi
je 0x341a
movq -0xe0(%rbp), %rsi
subq %rdi, %rsi
callq 0x2180
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x3434
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x2180
jmp 0x3434
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
testq %rdi, %rdi
je 0x344f
movq -0xc0(%rbp), %rsi
subq %rdi, %rsi
callq 0x2180
leaq -0xa0(%rbp), %rdi
callq 0x391e
movq %rbx, %rdi
callq 0x22b0
nop