// File: /workspace/github_c_makefile_star2_O0/chbarts[P]aa-tree/aa-tree.c
// Function: delete
static struct node *delete(struct node *t, void *data, ftype dup,
                           ftype comp, void (*del) (void *), jmp_buf env)
{
    void *l;

    if (t == NULL) {
        return NULL;
    } else if (comp(data, t->data) == -1) {
        t->left = delete(t->left, data, dup, comp, del, env);
    } else if (comp(data, t->data) == 1) {
        t->right = delete(t->right, data, dup, comp, del, env);
    } else if (dup != NULL) {
        if (dup(t->data, data) == 0) {
            return t;
        } else {
            longjmp(env, 4);
        }

    } else {
        if ((t->left == NULL) && (t->right == NULL)) {
            if (del)
                del(t->data);

            free(t);
            return NULL;
        } else if (t->left == NULL) {
            l = successor(t);
            t->right = delete(t->right, l, dup, comp, del, env);
            if (del)
                del(t->data);

            t->data = l;
        } else {
            l = predecessor(t);
            t->left = delete(t->left, l, dup, comp, del, env);
            if (del)
                del(t->data);

            t->data = l;
        }
    }

    t = decrease_level(t);
    t = skew(t);
    t->right = skew(t->right);
    t->right->right = skew(t->right->right);
    t = split(t);
    t->right = split(t->right);
    return t;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x17a4
movq $0x0, -0x8(%rbp)
jmp 0x19f8
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rsi
callq *%rax
cmpl $-0x1, %eax
jne 0x17ec
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movq -0x38(%rbp), %r9
callq 0x1770
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x1977
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rsi
callq *%rax
cmpl $0x1, %eax
jne 0x1834
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movq -0x38(%rbp), %r9
callq 0x1770
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x1975
cmpq $0x0, -0x20(%rbp)
je 0x186d
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rdi
movq -0x18(%rbp), %rsi
callq *%rax
cmpl $0x0, %eax
jne 0x185f
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x19f8
movq -0x38(%rbp), %rdi
movl $0x4, %esi
callq 0x1140
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x18ae
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x18ae
cmpq $0x0, -0x30(%rbp)
je 0x1898
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rdi
callq *%rax
movq -0x10(%rbp), %rdi
callq 0x1030
movq $0x0, -0x8(%rbp)
jmp 0x19f8
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x1915
movq -0x10(%rbp), %rdi
callq 0x2370
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x40(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movq -0x38(%rbp), %r9
callq 0x1770
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
cmpq $0x0, -0x30(%rbp)
je 0x1907
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rdi
callq *%rax
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x196f
movq -0x10(%rbp), %rdi
callq 0x23b0
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x40(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movq -0x38(%rbp), %r9
callq 0x1770
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
cmpq $0x0, -0x30(%rbp)
je 0x1963
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rdi
callq *%rax
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x1971
jmp 0x1973
jmp 0x1975
jmp 0x1977
jmp 0x1979
movq -0x10(%rbp), %rdi
callq 0x23f0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2250
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2250
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rdi
callq 0x2250
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rdi
callq 0x22d0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x22d0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)