// File: /workspace/github_c_makefile_star2_O0/theck01[P]offbrand_lib/src/classes/obdeque.c
// Function: obdeque_remove_at_iterator
void obdeque_remove_at_iterator(obdeque *deque, obdeque_iterator *it){

  obdeque_node *temp_node;

  assert(deque);
  assert(it);
  assert(deque == it->deque); /* ensure that iterator is associated with given
                                 deque */
  if(!it->node) return; /* if iterator points to no node (an empty deque)
                           do nothing */

  if(it->node == deque->head) deque->head = it->node->next;
  if(it->node == deque->tail) deque->tail = it->node->prev;
  if(it->node->prev) it->node->prev->next = it->node->next;
  if(it->node->next) it->node->next->prev = it->node->prev;

  deque->length--;

  temp_node = it->node;

  /* advance iterator to next valid node */
  if(!obdeque_iterate_next(deque, it) && !obdeque_iterate_prev(deque, it))
    it->node = NULL;

  /* set temp_node next and prev to null, to separate the node completely from
   * the deque if it lives on through a reference in an iterator */
  temp_node->next = NULL;
  temp_node->prev = NULL;

  ob_release((obj *)temp_node); /* ob_release reference that deque holds on node */

  return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x3079
jmp 0x3098
leaq 0x26d5(%rip), %rdi      # 0x5755
leaq 0x257a(%rip), %rsi      # 0x5601
movl $0x16b, %edx            # imm = 0x16B
leaq 0x29b1(%rip), %rcx      # 0x5a44
callq 0x1050
cmpq $0x0, -0x10(%rbp)
je 0x30a1
jmp 0x30c0
leaq 0x269d(%rip), %rdi      # 0x5745
leaq 0x2552(%rip), %rsi      # 0x5601
movl $0x16c, %edx            # imm = 0x16C
leaq 0x2989(%rip), %rcx      # 0x5a44
callq 0x1050
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x30d0
jmp 0x30ef
leaq 0x29ac(%rip), %rdi      # 0x5a83
leaq 0x2523(%rip), %rsi      # 0x5601
movl $0x16d, %edx            # imm = 0x16D
leaq 0x295a(%rip), %rcx      # 0x5a44
callq 0x1050
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x30ff
jmp 0x320c
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x3125
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x314b
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
cmpq $0x0, 0x18(%rax)
je 0x3176
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
cmpq $0x0, 0x10(%rax)
je 0x31a1
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x2040
cmpb $0x0, %al
jne 0x31eb
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x2310
cmpb $0x0, %al
jne 0x31eb
movq -0x10(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x18(%rbp), %rdi
callq 0x3ef0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)