// File: /workspace/github_c_makefile_star2_O3/ArtifexSoftware[P]mujs/./jsproperty.c
// Function: unlinkproperty
static js_Property *unlinkproperty(js_Property *node, const char *name, js_Property **garbage)
{
	js_Property *temp, *a, *b;
	if (node != &sentinel) {
		int c = strcmp(name, node->name);
		if (c < 0) {
			node->left = unlinkproperty(node->left, name, garbage);
		} else if (c > 0) {
			node->right = unlinkproperty(node->right, name, garbage);
		} else {
			*garbage = node;
			if (node->left == &sentinel && node->right == &sentinel) {
				return &sentinel;
			}
			else if (node->left == &sentinel) {
				a = node->right;
				while (a->left != &sentinel)
					a = a->left;
				b = unlinkproperty(node->right, a->name, &temp);
				temp->level = node->level;
				temp->left = node->left;
				temp->right = b;
				node = temp;
			}
			else {
				a = node->left;
				while (a->right != &sentinel)
					a = a->right;
				b = unlinkproperty(node->left, a->name, &temp);
				temp->level = node->level;
				temp->left = b;
				temp->right = node->right;
				node = temp;
			}
		}

		if (node->left->level < node->level - 1 || node->right->level < node->level - 1)
		{
			if (node->right->level > --node->level)
				node->right->level = node->level;
			node = skew(node);
			node->right = skew(node->right);
			node->right->right = skew(node->right->right);
			node = split(node);
			node->right = split(node->right);
		}
	}
	return node;
}

// Assembly:
leaq 0x19f2a(%rip), %rax     # 0x403b8
cmpq %rax, %rdi
je 0x26663
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x38(%rdi), %rsi
movq %r15, %rdi
callq 0x32f0
testl %eax, %eax
jns 0x264cf
movq (%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x26487
movq %rax, (%rbx)
jmp 0x26572
je 0x264e5
movq 0x8(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x26487
jmp 0x2656e
movq %rbx, (%r14)
movq (%rbx), %rdi
leaq 0x19ec6(%rip), %rax     # 0x403b8
cmpq %rax, %rdi
je 0x26529
movq %rdi, %rcx
movq %rcx, %rsi
movq 0x8(%rcx), %rcx
cmpq %rax, %rcx
jne 0x264fa
addq $0x38, %rsi
leaq 0x8(%rsp), %r14
movq %r14, %rdx
callq 0x26487
movl 0x10(%rbx), %ecx
movq (%r14), %rdx
movl %ecx, 0x10(%rdx)
movq %rax, (%rdx)
movq 0x8(%rbx), %rax
jmp 0x2656b
movq 0x8(%rbx), %rdi
cmpq %rax, %rdi
je 0x2665a
leaq 0x19e7b(%rip), %rax     # 0x403b8
movq %rdi, %rcx
movq %rcx, %rsi
movq (%rcx), %rcx
cmpq %rax, %rcx
jne 0x26540
addq $0x38, %rsi
leaq 0x8(%rsp), %r14
movq %r14, %rdx
callq 0x26487
movl 0x10(%rbx), %ecx
movq (%r14), %rdx
movl %ecx, 0x10(%rdx)
movq (%rbx), %rcx
movq %rcx, (%rdx)
movq (%r14), %rbx
movq %rax, 0x8(%rbx)
movq (%rbx), %rdx
movq 0x8(%rbx), %rax
movl 0x10(%rbx), %esi
leal -0x1(%rsi), %ecx
cmpl %ecx, 0x10(%rdx)
setl %r8b
movl 0x10(%rax), %edi
cmpl %ecx, %edi
setl %r9b
orb %r8b, %r9b
cmpb $0x1, %r9b
jne 0x265bd
movl %ecx, 0x10(%rbx)
cmpl %esi, %edi
jl 0x265a5
movl %ecx, 0x10(%rax)
movl 0x10(%rbx), %ecx
cmpl %ecx, 0x10(%rdx)
jne 0x265c5
movq 0x8(%rdx), %rcx
movq %rcx, (%rbx)
movq %rbx, 0x8(%rdx)
movq %rbx, %rax
movq %rdx, %rbx
jmp 0x265c8
movq %rbx, %rax
jmp 0x2665a
movq (%rax), %rcx
movl 0x10(%rcx), %edx
cmpl 0x10(%rax), %edx
jne 0x265dd
movq 0x8(%rcx), %rdx
movq %rdx, (%rax)
movq %rax, 0x8(%rcx)
jmp 0x265e0
movq %rax, %rcx
movq %rcx, 0x8(%rbx)
movq 0x8(%rcx), %rdx
movq (%rdx), %rax
movl 0x10(%rax), %esi
cmpl 0x10(%rdx), %esi
jne 0x26604
movq 0x8(%rax), %rcx
movq %rcx, (%rdx)
movq %rdx, 0x8(%rax)
movq 0x8(%rbx), %rcx
jmp 0x26607
movq %rdx, %rax
movq %rax, 0x8(%rcx)
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rcx
movl 0x10(%rcx), %edx
cmpl 0x10(%rbx), %edx
jne 0x26632
movq (%rax), %rcx
movq %rcx, 0x8(%rbx)
movq %rbx, (%rax)
incl 0x10(%rax)
movq 0x8(%rax), %rdx
movq 0x8(%rdx), %rcx
jmp 0x26638
movq %rax, %rdx
movq %rbx, %rax
movq 0x8(%rcx), %rsi
movl 0x10(%rsi), %esi
cmpl 0x10(%rdx), %esi
jne 0x26653
movq (%rcx), %rsi
movq %rsi, 0x8(%rdx)
movq %rdx, (%rcx)
incl 0x10(%rcx)
jmp 0x26656
movq %rdx, %rcx
movq %rcx, 0x8(%rax)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq