// File: /workspace/github_cpp_makefile_star2_O1/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 0x1880b
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
movq (%rdi), %rdx
testq %rax, %rax
je 0x187b1
cmpq %rsi, %rdx
je 0x188a3
cmpq %rsi, 0x8(%rax)
jne 0x188ef
movq %rcx, 0x8(%rax)
movq $0x0, (%rsi)
jmp 0x187bd
cmpq %rsi, %rdx
jne 0x189d3
movq %rcx, (%rdi)
movq 0x8(%rdi), %rdx
testq %rcx, %rcx
je 0x187e5
cmpq %rsi, %rdx
je 0x1893b
cmpq %rsi, (%rcx)
jne 0x18987
movq %rax, (%rcx)
movq $0x0, 0x8(%rsi)
jmp 0x187f2
cmpq %rsi, %rdx
jne 0x18a1c
movq %rax, 0x8(%rdi)
cmpq $0x0, (%rdi)
sete %al
cmpq $0x0, 0x8(%rdi)
setne %cl
xorb %al, %cl
je 0x18857
addq $0x20, %rsp
popq %rbx
retq
leaq 0xb67f2(%rip), %rsi     # 0xcf004
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x28, %edx
movl $0x3, %ecx
callq 0x2019c
movq 0x18(%rbx), %rdi
leaq 0xb6825(%rip), %rsi     # 0xcf057
movl $0x4, %edx
callq 0x8bab0
movq 0x18(%rsp), %rdi
leaq 0xbbac3(%rip), %rsi     # 0xd430b
movl $0x2, %edx
callq 0x8bab0
jmp 0x18a73
leaq 0xb67a6(%rip), %rsi     # 0xcf004
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x3d, %edx
movl $0x3, %ecx
callq 0x2019c
movq 0x18(%rbx), %rdi
leaq 0xb6830(%rip), %rsi     # 0xcf0ae
movl $0x10, %edx
callq 0x8bab0
movq 0x18(%rsp), %rdi
leaq 0xbba77(%rip), %rsi     # 0xd430b
movl $0x2, %edx
callq 0x8bab0
jmp 0x18a73
leaq 0xb675a(%rip), %rsi     # 0xcf004
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x2c, %edx
movl $0x3, %ecx
callq 0x2019c
movq 0x18(%rbx), %rdi
leaq 0xb6784(%rip), %rsi     # 0xcf04e
movl $0xd, %edx
callq 0x8bab0
movq 0x18(%rsp), %rdi
leaq 0xbba2b(%rip), %rsi     # 0xd430b
movl $0x2, %edx
callq 0x8bab0
jmp 0x18a73
leaq 0xb670e(%rip), %rsi     # 0xcf004
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x2d, %edx
movl $0x3, %ecx
callq 0x2019c
movq 0x18(%rbx), %rdi
leaq 0xb6746(%rip), %rsi     # 0xcf05c
movl $0x13, %edx
callq 0x8bab0
movq 0x18(%rsp), %rdi
leaq 0xbb9df(%rip), %rsi     # 0xd430b
movl $0x2, %edx
callq 0x8bab0
jmp 0x18a73
leaq 0xb66c2(%rip), %rsi     # 0xcf004
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x35, %edx
movl $0x3, %ecx
callq 0x2019c
movq 0x18(%rbx), %rdi
leaq 0xb671c(%rip), %rsi     # 0xcf07e
movl $0xd, %edx
callq 0x8bab0
movq 0x18(%rsp), %rdi
leaq 0xbb993(%rip), %rsi     # 0xd430b
movl $0x2, %edx
callq 0x8bab0
jmp 0x18a73
leaq 0xb6676(%rip), %rsi     # 0xcf004
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x36, %edx
movl $0x3, %ecx
callq 0x2019c
movq 0x18(%rbx), %rdi
leaq 0xb66de(%rip), %rsi     # 0xcf08c
movl $0x13, %edx
callq 0x8bab0
movq 0x18(%rsp), %rdi
leaq 0xbb947(%rip), %rsi     # 0xd430b
movl $0x2, %edx
callq 0x8bab0
jmp 0x18a73
leaq 0xb662a(%rip), %rsi     # 0xcf004
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x31, %edx
movl $0x3, %ecx
callq 0x2019c
movq 0x18(%rbx), %rdi
leaq 0xb6676(%rip), %rsi     # 0xcf070
movl $0xd, %edx
callq 0x8bab0
movq 0x18(%rsp), %rdi
leaq 0xbb8fb(%rip), %rsi     # 0xd430b
movl $0x2, %edx
callq 0x8bab0
jmp 0x18a73
leaq 0xb65e1(%rip), %rsi     # 0xcf004
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x3a, %edx
movl $0x3, %ecx
callq 0x2019c
movq 0x18(%rbx), %rdi
leaq 0xb665d(%rip), %rsi     # 0xcf0a0
movl $0xd, %edx
callq 0x8bab0
movq 0x18(%rsp), %rdi
leaq 0xbb8b2(%rip), %rsi     # 0xd430b
movl $0x2, %edx
callq 0x8bab0
jmp 0x18a73
jmp 0x18a73
jmp 0x18a73
jmp 0x18a73
jmp 0x18a73
jmp 0x18a73
jmp 0x18a73
jmp 0x18a73
movq %rsp, %rdi
callq 0x18aaa