// File: /workspace/github_cpp_makefile_star2_O2/biotomas[P]ipasir/app/ipasir-check-conflict/ipasir-check-conflict.cc
// Function: main
int main(int argc, char* argv[])
{
  std::cout << "Norbert Manthey -- IPASIR conflict checker" << std::endl;
  std::cout << "  reserve max len for conflict of size X and try force a conflict clause of size Y" << std::endl
            << "  and a full stack of assumption literals" << std::endl;
  if(argc < 3) {
    std::cout << "usage: " << argv[0] << " X Y ... with 0 < X < Y < 2^30" << std::endl;
    return 1;
  }
  int X = atoi(argv[1]);
  int Y = atoi(argv[2]);
  if(X<1) {
    std::cout << "error: given first number " << X << " is not in limits" << std::endl;
    return 1;
  }
  if(Y<1) {
    std::cout << "error: given second number " << Y << " is not in limits" << std::endl;
    return 1;
  }
  
  vector<int> assumptions;
  vector<int> positive, negative;
  
  std::vector<int> model;
  std::vector<int> conflict;
  
  SATSolver solver;
  solver.addLearnStatHook(X, learnhook);
  
  double runtime = cpuTime();
  for(int i = 1; i < Y; ++ i)
  {
    assumptions.push_back(-i);
    positive.push_back(i);
    negative.push_back(i);
  }
  positive.push_back(Y);
  negative.push_back(-Y);
  
  solver.addClause(positive);
  std::cout << "add clause " << positive << std::endl;
  solver.addClause(negative);
  std::cout << "add clause " << negative << std::endl;
  
  std::cout << "solve with assumptions " << assumptions << std::endl;
  int ret = solver.solve(assumptions, model, conflict);
  if(ret!=20) {
    std::cout << "error: solver fails learning a huge clause with status " << ret << std::endl;
    return 1;
  }
  
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, %rbx
movl %edi, %ebp
movq 0x14b94(%rip), %r14     # 0x16fc8
leaq 0xdbef(%rip), %rsi      # 0x1002a
movq %r14, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x2090
leaq 0xdc03(%rip), %rsi      # 0x10055
movq %r14, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x2090
leaq 0xdc3f(%rip), %rsi      # 0x100a8
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x2090
cmpl $0x2, %ebp
jg 0x24a8
movq 0x14b43(%rip), %rdi     # 0x16fc8
leaq 0xdc46(%rip), %rsi      # 0x100d2
callq 0x2150
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x2150
leaq 0xdc37(%rip), %rsi      # 0x100da
jmp 0x271f
movq 0x8(%rbx), %rdi
callq 0x2240
movl %eax, %ebp
movq 0x10(%rbx), %rdi
callq 0x2240
movl %eax, 0x8(%rsp)
testl %ebp, %ebp
jle 0x26e1
movl %eax, %ebx
testl %eax, %eax
jle 0x26fb
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
andq $0x0, 0x70(%rsp)
movaps %xmm0, 0x40(%rsp)
andq $0x0, 0x50(%rsp)
movaps %xmm0, 0x20(%rsp)
andq $0x0, 0x30(%rsp)
movaps %xmm0, 0xa0(%rsp)
andq $0x0, 0xb0(%rsp)
movaps %xmm0, 0x80(%rsp)
andq $0x0, 0x90(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x27a2
leaq -0x14d(%rip), %rdx      # 0x23dc
leaq 0x10(%rsp), %rdi
movl %ebp, %esi
callq 0x2826
pushq $0x1
popq %r14
callq 0x283b
leaq 0xc(%rsp), %r15
leaq 0x40(%rsp), %r12
leaq 0x4(%rsp), %r13
leaq 0x20(%rsp), %rbp
movl %r14d, 0x4(%rsp)
cmpl %ebx, %r14d
jge 0x2591
negl %r14d
movl %r14d, 0xc(%rsp)
leaq 0x60(%rsp), %rdi
movq %r15, %rsi
callq 0x2dce
movq %r12, %rdi
movq %r13, %rsi
callq 0x2870
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2870
movl 0x4(%rsp), %r14d
incl %r14d
jmp 0x2552
leaq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2870
xorl %eax, %eax
subl 0x8(%rsp), %eax
leaq 0x4(%rsp), %rsi
movl %eax, (%rsi)
leaq 0x20(%rsp), %rdi
callq 0x2dce
leaq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x288e
movq 0x149fb(%rip), %rdi     # 0x16fc8
leaq 0xdb6e(%rip), %rsi      # 0x10142
callq 0x2150
leaq 0x40(%rsp), %rsi
movq %rax, %rdi
callq 0x28ef
movq %rax, %rdi
callq 0x2090
leaq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x288e
movq 0x149c4(%rip), %rdi     # 0x16fc8
leaq 0xdb37(%rip), %rsi      # 0x10142
callq 0x2150
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x28ef
movq %rax, %rdi
callq 0x2090
movq 0x1499c(%rip), %rdi     # 0x16fc8
leaq 0xdb1b(%rip), %rsi      # 0x1014e
callq 0x2150
leaq 0x60(%rsp), %rsi
movq %rax, %rdi
callq 0x28ef
movq %rax, %rdi
callq 0x2090
leaq 0x10(%rsp), %rdi
leaq 0x60(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
leaq 0x80(%rsp), %rcx
callq 0x2946
movl %eax, %ebp
xorl %ebx, %ebx
cmpl $0x14, %eax
je 0x269d
movq 0x1494c(%rip), %rdi     # 0x16fc8
leaq 0xdae3(%rip), %rsi      # 0x10166
callq 0x2150
movq %rax, %rdi
movl %ebp, %esi
callq 0x2280
movq %rax, %rdi
callq 0x2090
pushq $0x1
popq %rbx
leaq 0x10(%rsp), %rdi
callq 0x2ada
leaq 0x80(%rsp), %rdi
callq 0x2ec4
leaq 0xa0(%rsp), %rdi
callq 0x2ec4
leaq 0x20(%rsp), %rdi
callq 0x2ec4
leaq 0x40(%rsp), %rdi
callq 0x2ec4
leaq 0x60(%rsp), %rdi
callq 0x2ec4
jmp 0x2732
movq 0x148e0(%rip), %rdi     # 0x16fc8
leaq 0xda0a(%rip), %rsi      # 0x100f9
callq 0x2150
movq %rax, %rdi
movl %ebp, %esi
jmp 0x2713
movq 0x148c6(%rip), %rdi     # 0x16fc8
leaq 0xda1d(%rip), %rsi      # 0x10126
callq 0x2150
movq %rax, %rdi
movl %ebx, %esi
callq 0x2280
leaq 0xd9f5(%rip), %rsi      # 0x10114
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x2090
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2755
jmp 0x2755
movq %rax, %rbx
jmp 0x2762
jmp 0x2755
jmp 0x2755
jmp 0x2755
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2ada
leaq 0x80(%rsp), %rdi
callq 0x2ec4
leaq 0xa0(%rsp), %rdi
callq 0x2ec4
leaq 0x20(%rsp), %rdi
callq 0x2ec4
leaq 0x40(%rsp), %rdi
callq 0x2ec4
leaq 0x60(%rsp), %rdi
callq 0x2ec4
movq %rbx, %rdi
callq 0x2290