// File: /workspace/github_cpp_makefile_star2_O2/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 $0xa8, %rsp
movq %rdi, %r14
leaq 0x5c8(%rdi), %r15
movl %esi, 0x4(%rsp)
movslq %esi, %rax
imulq $0x78, %rax, %rax
leaq (%rdi,%rax), %rcx
addq $0x5c8, %rcx            # imm = 0x5C8
movq 0x38(%rcx), %rax
leaq 0x70(%rsp), %r12
movq %rax, 0x30(%r12)
movups 0x8(%rcx), %xmm0
movups 0x18(%rcx), %xmm1
movq %rcx, 0x30(%rsp)
movups 0x28(%rcx), %xmm2
movaps %xmm2, 0x20(%r12)
movaps %xmm1, 0x10(%r12)
movaps %xmm0, (%r12)
movq %r12, %rdi
callq 0x4fd6
leaq 0x48(%rsp), %rbx
movq %rax, (%rbx)
movl %edx, 0x8(%rbx)
movq %r12, %rdi
callq 0x4ffe
leaq 0x38(%rsp), %rcx
movq %rax, (%rcx)
movl %edx, 0x8(%rcx)
leaq 0x8(%rsp), %rbp
leaq 0x58(%rsp), %r12
movq %rbx, %rdi
leaq 0x38(%rsp), %rsi
callq 0x4e7e
testb %al, %al
je 0xffa7
movq %rbx, %rdi
callq 0x4e6c
movq %rax, 0x8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
movq 0x10(%r14), %rdi
movq %rbp, %rsi
callq 0x7352
movq (%rax), %rbp
movq 0x8(%rax), %rbx
cmpq %rbx, %rbp
je 0xff20
movq (%rbp), %rax
movl 0xc(%r14), %ecx
imull %eax, %ecx
shrq $0x20, %rax
addl %eax, %ecx
movl 0x20(%r14,%rcx,4), %eax
movl %eax, (%rsp)
cmpl $-0x1, %eax
je 0xff1a
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x1087e
movl (%rsp), %esi
movq %r12, %rdi
callq 0x10855
movl %eax, %r13d
movq %r12, %rdi
callq 0x109f0
movl 0x4(%rsp), %eax
cmpl %eax, (%rsp)
sete %al
orb %al, %r13b
jne 0xff1a
leaq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x108cc
addq $0x8, %rbp
jmp 0xfeb8
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r13
leaq 0x8(%rsp), %rbp
cmpq %r13, %rbx
je 0xff4e
movslq (%rbx), %rax
imulq $0x78, %rax, %rdi
addq %r15, %rdi
movq 0x8(%rsp), %rsi
callq 0x4d20
addq $0x4, %rbx
jmp 0xff2f
movq (%r14), %rdi
movq 0x30(%rsp), %rax
movl (%rax), %esi
movq %rbp, %rdx
callq 0xf8ea
xorq %rax, 0x18(%r14)
movq (%r14), %rdi
movq %rbp, %rsi
callq 0xf8d2
xorq %rax, 0x18(%r14)
movq 0x8(%rsp), %rax
movl 0xc(%r14), %ecx
imull %eax, %ecx
shrq $0x20, %rax
addl %eax, %ecx
orl $-0x1, 0x20(%r14,%rcx,4)
leaq 0x10(%rsp), %rdi
callq 0x109f0
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0x4e3c
jmp 0xfe75
movq %r14, %rdi
movl 0x4(%rsp), %esi
callq 0x10108
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xffda
jmp 0xffda
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x109f0
jmp 0xffdd
jmp 0xffda
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x109f0
movq %rbx, %rdi
callq 0x32b0
nop