// File: zvrba[P]nonogram/Solver.cpp
// Function: nonogram::ColumnAgent::clearCell(unsigned long)
void ColumnAgent::clearCell(size_t pos)
{
  using std::get;
  
  if (pos >= _lineSize)
    throw std::logic_error("ColumnAgent::clearCell: invalid pos");
  if (_blocks.empty())
    throw std::logic_error("Agent::clearCell: no blocks");
  
  auto& lastBlock = _blocks.back();
  
  if (pos != get<1>(lastBlock)-1)
    throw std::logic_error("Agent::clearCell: not last cell");
  if (get<1>(lastBlock) == get<0>(lastBlock))
    throw std::logic_error("Agent::clearCell: empty block");
  
  if (--get<1>(lastBlock) == get<0>(lastBlock))
    _blocks.pop_back();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x30(%rbp)
movq -0x10(%rbp), %rax
cmpq 0x10(%rcx), %rax
jb 0x31645
movl $0x10, %edi
callq 0x30e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
leaq 0x6e78(%rip), %rsi      # 0x38485
callq 0x3260
jmp 0x31614
movq -0x38(%rbp), %rdi
movq 0x279b1(%rip), %rsi     # 0x58fd0
movq 0x27992(%rip), %rdx     # 0x58fb8
callq 0x32e0
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x3160
jmp 0x317e7
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
callq 0x31eb0
testb $0x1, %al
jne 0x31658
jmp 0x316ab
movl $0x10, %edi
callq 0x30e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
leaq 0x6e36(%rip), %rsi      # 0x384a9
callq 0x3260
jmp 0x3167a
movq -0x40(%rbp), %rdi
movq 0x2794b(%rip), %rsi     # 0x58fd0
movq 0x2792c(%rip), %rdx     # 0x58fb8
callq 0x32e0
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x3160
jmp 0x317e7
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
callq 0x31ef0
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rdi
callq 0x31f50
movq %rax, %rcx
movq -0x48(%rbp), %rax
movq (%rcx), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
je 0x31733
movl $0x10, %edi
callq 0x30e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x50(%rbp)
leaq 0x6dca(%rip), %rsi      # 0x384c5
callq 0x3260
jmp 0x31702
movq -0x50(%rbp), %rdi
movq 0x278c3(%rip), %rsi     # 0x58fd0
movq 0x278a4(%rip), %rdx     # 0x58fb8
callq 0x32e0
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x3160
jmp 0x317e7
movq -0x28(%rbp), %rdi
callq 0x31f50
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rdi
callq 0x31f30
movq %rax, %rcx
movq -0x58(%rbp), %rax
cmpq (%rcx), %rax
jne 0x317a8
movl $0x10, %edi
callq 0x30e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x60(%rbp)
leaq 0x6d72(%rip), %rsi      # 0x384e5
callq 0x3260
jmp 0x3177a
movq -0x60(%rbp), %rdi
movq 0x2784b(%rip), %rsi     # 0x58fd0
movq 0x2782c(%rip), %rdx     # 0x58fb8
callq 0x32e0
movq -0x60(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x3160
jmp 0x317e7
movq -0x28(%rbp), %rdi
callq 0x31f50
movq (%rax), %rcx
addq $-0x1, %rcx
movq %rcx, -0x68(%rbp)
movq %rcx, (%rax)
movq -0x28(%rbp), %rdi
callq 0x31f30
movq %rax, %rcx
movq -0x68(%rbp), %rax
cmpq (%rcx), %rax
jne 0x317e1
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
callq 0x31fe0
addq $0x70, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x32f0