// File: /workspace/github_cpp_makefile_star2_O3/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 $0x148, %rsp            # imm = 0x148
movq %rsi, %rbx
movl %edi, %ebp
movq 0x1574f(%rip), %r14     # 0x17fc8
leaq 0xe79e(%rip), %rsi      # 0x1101e
movl $0x2a, %edx
movq %r14, %rdi
callq 0x21b0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq 0xe78e(%rip), %rsi      # 0x11049
movl $0x52, %edx
movq %r14, %rdi
callq 0x21b0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq %rax, %r14
leaq 0xe7a3(%rip), %rsi      # 0x1109c
movl $0x29, %edx
movq %rax, %rdi
callq 0x21b0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
cmpl $0x2, %ebp
jg 0x2978
movq 0x1568f(%rip), %r14     # 0x17fc8
leaq 0xe786(%rip), %rsi      # 0x110c6
movl $0x7, %edx
movq %r14, %rdi
callq 0x21b0
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x2b0d
movq %rbx, %rdi
callq 0x2080
movq 0x15660(%rip), %rdi     # 0x17fc8
movq %rbx, %rsi
movq %rax, %rdx
callq 0x21b0
jmp 0x2b25
movq 0x8(%rbx), %rdi
callq 0x2250
movl %eax, %ebp
movq 0x10(%rbx), %rdi
callq 0x2250
movl %eax, 0xc(%rsp)
testl %ebp, %ebp
jle 0x2b55
movl %eax, %ebx
testl %eax, %eax
jle 0x2b77
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
xorl %eax, %eax
movq %rax, 0x60(%rsp)
movq %rax, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movq %rax, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq %rax, 0xb0(%rsp)
movaps %xmm0, 0xa0(%rsp)
movq %rax, 0x90(%rsp)
movaps %xmm0, 0x80(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x2fde
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x2a09
leaq -0x214(%rip), %rcx      # 0x27ec
xorl %esi, %esi
movl %ebp, %edx
callq 0x37e1
leaq 0xb8(%rsp), %rbx
xorl %edi, %edi
movq %rbx, %rsi
callq 0x20d0
movl $0x1, (%rbx)
movl 0xc(%rsp), %ecx
cmpl $0x2, %ecx
jl 0x2aed
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
leaq 0x50(%rsp), %rbx
leaq 0x6c(%rsp), %r14
leaq 0x30(%rsp), %r15
leaq 0xb8(%rsp), %r12
leaq 0x10(%rsp), %r13
movl %eax, 0x6c(%rsp)
movq 0x58(%rsp), %rsi
cmpq 0x60(%rsp), %rsi
je 0x2a6c
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x58(%rsp)
jmp 0x2a77
movq %rbx, %rdi
movq %r14, %rdx
callq 0x357c
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0x2a97
movl 0xb8(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x38(%rsp)
jmp 0x2aa2
movq %r15, %rdi
movq %r12, %rdx
callq 0x3658
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x2ac2
movl 0xb8(%rsp), %edx
movl %edx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x2ad4
movq %r13, %rdi
movq %r12, %rdx
callq 0x3658
movl 0xb8(%rsp), %edx
movl %edx, %eax
notl %eax
incl %edx
movl %edx, 0xb8(%rsp)
movl 0xc(%rsp), %ecx
cmpl %ecx, %edx
jl 0x2a4f
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0x2bf3
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x38(%rsp)
jmp 0x2c02
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x2280
leaq 0xe5a2(%rip), %rsi      # 0x110ce
movl $0x1e, %edx
movq %r14, %rdi
callq 0x21b0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r14, %rdi
jmp 0x2bcd
movq 0x1546c(%rip), %rbx     # 0x17fc8
leaq 0xe58a(%rip), %rsi      # 0x110ed
movl $0x1a, %edx
movq %rbx, %rdi
callq 0x21b0
movq %rbx, %rdi
movl %ebp, %esi
jmp 0x2b97
movq 0x1544a(%rip), %r14     # 0x17fc8
leaq 0xe595(%rip), %rsi      # 0x1111a
movl $0x1b, %edx
movq %r14, %rdi
callq 0x21b0
movq %r14, %rdi
movl %ebx, %esi
callq 0x2290
movq %rax, %rbx
leaq 0xe562(%rip), %rsi      # 0x11108
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
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x30(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x3658
xorl %eax, %eax
subl 0xc(%rsp), %eax
movl %eax, 0xb8(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x2c28
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x2c3a
leaq 0x10(%rsp), %rdi
leaq 0xb8(%rsp), %rdx
callq 0x357c
leaq 0x70(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x30b6
movq 0x15378(%rip), %rbx     # 0x17fc8
leaq 0xe4df(%rip), %rsi      # 0x11136
movl $0xb, %edx
movq %rbx, %rdi
callq 0x21b0
movq 0x38(%rsp), %rax
cmpq 0x30(%rsp), %rax
je 0x2cb8
xorl %r12d, %r12d
movq 0x1534e(%rip), %r14     # 0x17fc8
leaq 0xe58e(%rip), %r15      # 0x1120f
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x21b0
movq 0x30(%rsp), %rax
movl (%rax,%r12,4), %esi
movq %r14, %rdi
callq 0x2290
incq %r12
movq 0x38(%rsp), %rax
subq 0x30(%rsp), %rax
sarq $0x2, %rax
cmpq %r12, %rax
ja 0x2c81
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq 0x152f2(%rip), %rdi     # 0x17fc8
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq 0x70(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x30b6
movq 0x152cf(%rip), %rbx     # 0x17fc8
leaq 0xe436(%rip), %rsi      # 0x11136
movl $0xb, %edx
movq %rbx, %rdi
callq 0x21b0
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
je 0x2d61
xorl %r12d, %r12d
movq 0x152a5(%rip), %r14     # 0x17fc8
leaq 0xe4e5(%rip), %r15      # 0x1120f
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x21b0
movq 0x10(%rsp), %rax
movl (%rax,%r12,4), %esi
movq %r14, %rdi
callq 0x2290
incq %r12
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
sarq $0x2, %rax
cmpq %r12, %rax
ja 0x2d2a
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq 0x15249(%rip), %rdi     # 0x17fc8
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq 0x15235(%rip), %rbx     # 0x17fc8
leaq 0xe3a8(%rip), %rsi      # 0x11142
movl $0x17, %edx
movq %rbx, %rdi
callq 0x21b0
movq 0x58(%rsp), %rax
cmpq 0x50(%rsp), %rax
je 0x2dfb
xorl %r12d, %r12d
movq 0x1520b(%rip), %r14     # 0x17fc8
leaq 0xe44b(%rip), %r15      # 0x1120f
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x21b0
movq 0x50(%rsp), %rax
movl (%rax,%r12,4), %esi
movq %r14, %rdi
callq 0x2290
incq %r12
movq 0x58(%rsp), %rax
subq 0x50(%rsp), %rax
sarq $0x2, %rax
cmpq %r12, %rax
ja 0x2dc4
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq 0x151af(%rip), %rdi     # 0x17fc8
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
leaq 0x80(%rsp), %rcx
callq 0x311c
movl %eax, %ebp
xorl %ebx, %ebx
cmpl $0x14, %eax
je 0x2ea3
movq 0x15173(%rip), %rdi     # 0x17fc8
leaq 0xe2fe(%rip), %rsi      # 0x1115a
movl $0x37, %edx
callq 0x21b0
movq 0x1515b(%rip), %rdi     # 0x17fc8
movl %ebp, %esi
callq 0x2290
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
movl $0x1, %ebx
movq %rax, %rdi
callq 0x20f0
leaq 0x70(%rsp), %rdi
callq 0x32e6
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x2eca
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x2ee7
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2efe
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x2f15
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x2bdf
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
jmp 0x2bdf
jmp 0x2f4a
jmp 0x2f4a
movq %rax, %rbx
jmp 0x2f57
jmp 0x2f4a
jmp 0x2f4a
jmp 0x2f4a
jmp 0x2f4a
jmp 0x2f4a
jmp 0x2f4a
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x32e6
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x2f74
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x2f91
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2fa8
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x2fbf
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x2fd6
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq %rbx, %rdi
callq 0x22a0