// File: ynilu[P]elastic/auxiliary.cpp
// Function: Aux_link::~Aux_link()
Aux_link::~Aux_link()
{
    Aux_link *prev;
    Aux_link *next;

    // maintain same_from list
    prev = this -> prev_same_from;
    next = this -> next_same_from;

    if(prev == NULL && next == NULL) // link is the only element in same_from list
    {
        from -> first_out = NULL;
        from -> last_out = NULL;
    }
    else if(prev == NULL) // link is the first in same_from list
    {
        from -> first_out = next;
        next -> prev_same_from = NULL;
    }
    else if(next == NULL) // link is the last in same_from list
    {
        from -> last_out = prev;
        prev -> next_same_from = NULL;
    }
    else
    {
        prev -> next_same_from = next;
        next -> prev_same_from = prev;
    }

    // maintain same_to list
    prev = this -> prev_same_to;
    next = this -> next_same_to;

    if(prev == NULL && next == NULL) // link is the only element in same_to list
    {
        to -> first_in = NULL;
        to -> last_in = NULL;
    }
    else if(prev == NULL) // link is the first in same_to list
    {
        to -> first_in = next;
        next -> prev_same_to = NULL;
    }
    else if(next == NULL) // link is the last in same_to list
    {
        to -> last_in = prev;
        prev -> next_same_to = NULL;
    }
    else
    {
        prev -> next_same_to = next;
        next -> prev_same_to = prev;
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0x18091(%rip), %rcx     # 0x42cd8
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x30(%rax), %rcx
movq %rcx, -0x10(%rbp)
movq 0x38(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x2ac8a
cmpq $0x0, -0x18(%rbp)
jne 0x2ac8a
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rcx
movq $0x0, 0x20(%rcx)
movq 0x20(%rax), %rax
movq $0x0, 0x28(%rax)
jmp 0x2acf0
cmpq $0x0, -0x10(%rbp)
jne 0x2acaf
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x20(%rax), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x30(%rax)
jmp 0x2acee
cmpq $0x0, -0x18(%rbp)
jne 0x2acd4
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x20(%rax), %rax
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x38(%rax)
jmp 0x2acec
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0x2acee
jmp 0x2acf0
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rcx
movq %rcx, -0x10(%rbp)
movq 0x48(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x2ad30
cmpq $0x0, -0x18(%rbp)
jne 0x2ad30
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rcx
movq $0x0, 0x10(%rcx)
movq 0x28(%rax), %rax
movq $0x0, 0x18(%rax)
jmp 0x2ad96
cmpq $0x0, -0x10(%rbp)
jne 0x2ad55
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x28(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x40(%rax)
jmp 0x2ad94
cmpq $0x0, -0x18(%rbp)
jne 0x2ad7a
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x28(%rax), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x48(%rax)
jmp 0x2ad92
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x40(%rax)
jmp 0x2ad94
jmp 0x2ad96
popq %rbp
retq
nopl (%rax,%rax)