// File: /workspace/github_c_makefile_star2_O2/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:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x1ac78(%rip), %r14     # 0x373b8
cmpq %r14, %rdi
je 0x1c88d
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x38(%rdi), %rsi
movq %r12, %rdi
callq 0x32f0
testl %eax, %eax
jns 0x1c778
movq (%rbx), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x1c731
movq %rax, (%rbx)
jmp 0x1c817
je 0x1c78e
movq 0x8(%rbx), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x1c731
jmp 0x1c813
movq %rbx, (%r15)
movq (%rbx), %rdi
leaq 0x1ac1d(%rip), %r14     # 0x373b8
cmpq %r14, %rdi
je 0x1c7d0
movq %rdi, %rax
movq %rax, %rsi
movq 0x8(%rax), %rax
cmpq %r14, %rax
jne 0x1c7a3
addq $0x38, %rsi
movq %rsp, %r14
movq %r14, %rdx
callq 0x1c731
movl 0x10(%rbx), %ecx
movq (%r14), %rdx
movl %ecx, 0x10(%rdx)
movq %rax, (%rdx)
movq 0x8(%rbx), %rax
jmp 0x1c810
movq 0x8(%rbx), %rdi
cmpq %r14, %rdi
je 0x1c88d
leaq 0x1abd4(%rip), %rax     # 0x373b8
movq %rdi, %rcx
movq %rcx, %rsi
movq (%rcx), %rcx
cmpq %rax, %rcx
jne 0x1c7e7
addq $0x38, %rsi
movq %rsp, %r14
movq %r14, %rdx
callq 0x1c731
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), %rsi
movq 0x8(%rbx), %rax
movl 0x10(%rbx), %edx
leal -0x1(%rdx), %ecx
cmpl %ecx, 0x10(%rsi)
setl %dil
movl 0x10(%rax), %esi
cmpl %ecx, %esi
setl %r8b
orb %dil, %r8b
cmpb $0x1, %r8b
jne 0x1c88a
movl %ecx, 0x10(%rbx)
cmpl %edx, %esi
jl 0x1c847
movl %ecx, 0x10(%rax)
movq %rbx, %rdi
callq 0x1c6f4
movq %rax, %rbx
movq 0x8(%rax), %rdi
callq 0x1c6f4
movq %rax, 0x8(%rbx)
movq 0x8(%rax), %rdi
callq 0x1c6f4
movq 0x8(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq %rbx, %rdi
callq 0x1c70f
movq %rax, %r14
movq 0x8(%rax), %rdi
callq 0x1c70f
movq %rax, 0x8(%r14)
jmp 0x1c88d
movq %rbx, %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq