// File: /workspace/github_cpp_makefile_star2_O3/romkatv[P]hcproxy/src/list.cc
// Function: hcproxy::List::Erase(hcproxy::Node*)
void List::Erase(Node* node) {
  CHECK(node);
  Node* const prev = node->prev_;
  Node* const next = node->next_;
  if (prev) {
    CHECK(head_ != node);
    CHECK(prev->next_ == node);
    prev->next_ = next;
    node->prev_ = nullptr;
  } else {
    CHECK(head_ == node);
    head_ = next;
  }
  if (next) {
    CHECK(tail_ != node);
    CHECK(next->prev_ == node);
    next->prev_ = prev;
    node->next_ = nullptr;
  } else {
    CHECK(tail_ == node);
    tail_ = prev;
  }
  CHECK(!head_ == !tail_);
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
testq %rsi, %rsi
je 0x187b4
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
movq (%rdi), %rcx
testq %rax, %rax
je 0x18757
cmpq %rsi, %rcx
je 0x1884c
cmpq %rsi, 0x8(%rax)
jne 0x18898
movq %rdx, 0x8(%rax)
movq $0x0, (%rsi)
jmp 0x18766
cmpq %rsi, %rcx
jne 0x1897c
movq %rdx, (%rdi)
movq %rdx, %rcx
movq 0x8(%rdi), %r8
testq %rdx, %rdx
je 0x1878e
cmpq %rsi, %r8
je 0x188e4
cmpq %rsi, (%rdx)
jne 0x18930
movq %rax, (%rdx)
movq $0x0, 0x8(%rsi)
jmp 0x1879e
cmpq %rsi, %r8
jne 0x189c5
movq %rax, 0x8(%rdi)
movq %rax, %r8
testq %rcx, %rcx
sete %al
testq %r8, %r8
setne %cl
xorb %al, %cl
je 0x18800
addq $0x20, %rsp
popq %rbx
retq
leaq 0xb6849(%rip), %rsi     # 0xcf004
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x28, %edx
movl $0x3, %ecx
callq 0x2003c
movq 0x18(%rbx), %rdi
leaq 0xb686d(%rip), %rsi     # 0xcf048
movl $0x4, %edx
callq 0x8b8f0
movq 0x18(%rsp), %rdi
leaq 0xbbada(%rip), %rsi     # 0xd42cb
movl $0x2, %edx
callq 0x8b8f0
jmp 0x18a1c
leaq 0xb67fd(%rip), %rsi     # 0xcf004
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x3d, %edx
movl $0x3, %ecx
callq 0x2003c
movq 0x18(%rbx), %rdi
leaq 0xb6878(%rip), %rsi     # 0xcf09f
movl $0x10, %edx
callq 0x8b8f0
movq 0x18(%rsp), %rdi
leaq 0xbba8e(%rip), %rsi     # 0xd42cb
movl $0x2, %edx
callq 0x8b8f0
jmp 0x18a1c
leaq 0xb67b1(%rip), %rsi     # 0xcf004
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x2c, %edx
movl $0x3, %ecx
callq 0x2003c
movq 0x18(%rbx), %rdi
leaq 0xb67cc(%rip), %rsi     # 0xcf03f
movl $0xd, %edx
callq 0x8b8f0
movq 0x18(%rsp), %rdi
leaq 0xbba42(%rip), %rsi     # 0xd42cb
movl $0x2, %edx
callq 0x8b8f0
jmp 0x18a1c
leaq 0xb6765(%rip), %rsi     # 0xcf004
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x2d, %edx
movl $0x3, %ecx
callq 0x2003c
movq 0x18(%rbx), %rdi
leaq 0xb678e(%rip), %rsi     # 0xcf04d
movl $0x13, %edx
callq 0x8b8f0
movq 0x18(%rsp), %rdi
leaq 0xbb9f6(%rip), %rsi     # 0xd42cb
movl $0x2, %edx
callq 0x8b8f0
jmp 0x18a1c
leaq 0xb6719(%rip), %rsi     # 0xcf004
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x35, %edx
movl $0x3, %ecx
callq 0x2003c
movq 0x18(%rbx), %rdi
leaq 0xb6764(%rip), %rsi     # 0xcf06f
movl $0xd, %edx
callq 0x8b8f0
movq 0x18(%rsp), %rdi
leaq 0xbb9aa(%rip), %rsi     # 0xd42cb
movl $0x2, %edx
callq 0x8b8f0
jmp 0x18a1c
leaq 0xb66cd(%rip), %rsi     # 0xcf004
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x36, %edx
movl $0x3, %ecx
callq 0x2003c
movq 0x18(%rbx), %rdi
leaq 0xb6726(%rip), %rsi     # 0xcf07d
movl $0x13, %edx
callq 0x8b8f0
movq 0x18(%rsp), %rdi
leaq 0xbb95e(%rip), %rsi     # 0xd42cb
movl $0x2, %edx
callq 0x8b8f0
jmp 0x18a1c
leaq 0xb6681(%rip), %rsi     # 0xcf004
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x31, %edx
movl $0x3, %ecx
callq 0x2003c
movq 0x18(%rbx), %rdi
leaq 0xb66be(%rip), %rsi     # 0xcf061
movl $0xd, %edx
callq 0x8b8f0
movq 0x18(%rsp), %rdi
leaq 0xbb912(%rip), %rsi     # 0xd42cb
movl $0x2, %edx
callq 0x8b8f0
jmp 0x18a1c
leaq 0xb6638(%rip), %rsi     # 0xcf004
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x3a, %edx
movl $0x3, %ecx
callq 0x2003c
movq 0x18(%rbx), %rdi
leaq 0xb66a5(%rip), %rsi     # 0xcf091
movl $0xd, %edx
callq 0x8b8f0
movq 0x18(%rsp), %rdi
leaq 0xbb8c9(%rip), %rsi     # 0xd42cb
movl $0x2, %edx
callq 0x8b8f0
jmp 0x18a1c
jmp 0x18a1c
jmp 0x18a1c
jmp 0x18a1c
jmp 0x18a1c
jmp 0x18a1c
jmp 0x18a1c
jmp 0x18a1c
movq %rsp, %rdi
callq 0x18a24