// File: /workspace/github_cpp_makefile_star2_O1/macfergus[P]baduk/cppsrc/baduk/board.cpp
// Function: baduk::Board::remove(int)
void Board::remove(StringIdx old_string_idx) {
    const GoString& old_string = strings_[old_string_idx];
    for (auto const& point : old_string.stones()) {
        std::vector<StringIdx> strings_to_update;
        for (Point neighbor : neighbors_->get(point)) {
            auto neighbor_string_idx = grid_[index(neighbor)];
            if (neighbor_string_idx == EMPTY) {
                continue;
            }
            if (contains(strings_to_update, neighbor_string_idx)) {
                continue;
            }
            if (neighbor_string_idx != old_string_idx) {
                strings_to_update.push_back(neighbor_string_idx);
            }
        }
        for (auto string_to_update : strings_to_update) {
            strings_[string_to_update].addLiberty(point);
        }

        hashcode_ ^= zobrist_.getStone(old_string.color(), point);
        hashcode_ ^= zobrist_.getEmpty(point);

        grid_[index(point)] = EMPTY;
    }
    recycle(old_string_idx);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdi, %r14
movl %esi, 0x30(%rsp)
movslq %esi, %rax
movq %rax, 0x50(%rsp)
imulq $0x78, %rax, %r12
movq 0x600(%rdi,%r12), %rax
leaq 0x80(%rsp), %rbx
movq %rax, 0x30(%rbx)
movups 0x5d0(%rdi,%r12), %xmm0
movups 0x5e0(%rdi,%r12), %xmm1
movups 0x5f0(%rdi,%r12), %xmm2
movaps %xmm2, 0x20(%rbx)
movaps %xmm1, 0x10(%rbx)
movaps %xmm0, (%rbx)
movq %rbx, %rdi
callq 0x4f10
leaq 0x60(%rsp), %r15
movq %rax, (%r15)
movl %edx, 0x8(%r15)
movq %rbx, %rdi
callq 0x4f56
leaq 0x70(%rsp), %rsi
movq %rax, (%rsi)
movl %edx, 0x8(%rsi)
movq %r15, %rdi
callq 0x4d56
testb %al, %al
je 0x10559
leaq 0x5c8(%r14), %rbx
leaq (%r14,%r12), %rax
addq $0x5c8, %rax            # imm = 0x5C8
movq %rax, 0x58(%rsp)
leaq 0x60(%rsp), %r15
leaq 0x8(%rsp), %r13
movq %r15, %rdi
callq 0x4d2a
movq %rax, 0x8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x10(%r14), %rdi
movq %r13, %rsi
callq 0x7244
movq (%rax), %r15
movq 0x8(%rax), %r13
cmpq %r13, %r15
je 0x104af
movq (%r15), %rax
movl 0xc(%r14), %ecx
imull %eax, %ecx
shrq $0x20, %rax
addl %eax, %ecx
movl 0x20(%r14,%rcx,4), %eax
movl %eax, 0x4(%rsp)
cmpl $-0x1, %eax
je 0x104a6
leaq 0x38(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x110a0
movl 0x4(%rsp), %eax
movl %eax, 0x34(%rsp)
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rsi
leaq 0x34(%rsp), %rdx
callq 0x111bd
movq %rax, %r12
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rbp
testq %rdi, %rdi
je 0x10469
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x3180
cmpq %rbp, %r12
setne %cl
movl 0x4(%rsp), %eax
cmpl 0x30(%rsp), %eax
sete %dl
orb %cl, %dl
jne 0x104a6
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x10497
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x104a6
leaq 0x10(%rsp), %rdi
leaq 0x4(%rsp), %rdx
callq 0x11272
addq $0x8, %r15
jmp 0x103f4
movq 0x10(%rsp), %r15
movq 0x18(%rsp), %r12
cmpq %r12, %r15
leaq 0x8(%rsp), %r13
je 0x104e0
movslq (%r15), %rax
imulq $0x78, %rax, %rdi
addq %rbx, %rdi
movq 0x8(%rsp), %rsi
callq 0x4ba0
addq $0x4, %r15
cmpq %r12, %r15
jne 0x104c3
movq (%r14), %rdi
movq 0x58(%rsp), %rax
movl (%rax), %esi
movq %r13, %rdx
callq 0xfc7e
xorq %rax, 0x18(%r14)
movq (%r14), %rdi
movq %r13, %rsi
callq 0xfc48
xorq %rax, 0x18(%r14)
movq 0x8(%rsp), %rax
movl 0xc(%r14), %ecx
imull %eax, %ecx
shrq $0x20, %rax
addl %eax, %ecx
movl $0xffffffff, 0x20(%r14,%rcx,4) # imm = 0xFFFFFFFF
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
leaq 0x60(%rsp), %r15
je 0x1053c
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x3180
movq %r15, %rdi
callq 0x4cda
movq %r15, %rdi
leaq 0x70(%rsp), %rsi
callq 0x4d56
testb %al, %al
jne 0x103c3
addq $0x5b18, %r14           # imm = 0x5B18
movq %r14, %rdi
movq 0x50(%rsp), %rsi
callq 0x11120
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x105a1
jmp 0x105a1
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x105a4
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x3180
jmp 0x105a4
jmp 0x105a1
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x105bb
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x3180
movq %rbx, %rdi
callq 0x32b0
nop