// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/deps/jemalloc/src/ctl.c
// Function: ctl_lookup
static int
ctl_lookup(const char *name, ctl_node_t const **nodesp, size_t *mibp,
    size_t *depthp)
{
	int ret;
	const char *elm, *tdot, *dot;
	size_t elen, i, j;
	const ctl_named_node_t *node;

	elm = name;
	/* Equivalent to strchrnul(). */
	dot = ((tdot = strchr(elm, '.')) != NULL) ? tdot : strchr(elm, '\0');
	elen = (size_t)((uintptr_t)dot - (uintptr_t)elm);
	if (elen == 0) {
		ret = ENOENT;
		goto label_return;
	}
	node = super_root_node;
	for (i = 0; i < *depthp; i++) {
		assert(node);
		assert(node->nchildren > 0);
		if (ctl_named_node(node->children) != NULL) {
			const ctl_named_node_t *pnode = node;

			/* Children are named. */
			for (j = 0; j < node->nchildren; j++) {
				const ctl_named_node_t *child =
				    ctl_named_children(node, j);
				if (strlen(child->name) == elen &&
				    strncmp(elm, child->name, elen) == 0) {
					node = child;
					if (nodesp != NULL)
						nodesp[i] =
						    (const ctl_node_t *)node;
					mibp[i] = j;
					break;
				}
			}
			if (node == pnode) {
				ret = ENOENT;
				goto label_return;
			}
		} else {
			uintmax_t index;
			const ctl_indexed_node_t *inode;

			/* Children are indexed. */
			index = malloc_strtoumax(elm, NULL, 10);
			if (index == UINTMAX_MAX || index > SIZE_T_MAX) {
				ret = ENOENT;
				goto label_return;
			}

			inode = ctl_indexed_node(node->children);
			node = inode->index(mibp, *depthp, (size_t)index);
			if (node == NULL) {
				ret = ENOENT;
				goto label_return;
			}

			if (nodesp != NULL)
				nodesp[i] = (const ctl_node_t *)node;
			mibp[i] = (size_t)index;
		}

		if (node->ctl != NULL) {
			/* Terminal node. */
			if (*dot != '\0') {
				/*
				 * The name contains more elements than are
				 * in this path through the tree.
				 */
				ret = ENOENT;
				goto label_return;
			}
			/* Complete lookup successful. */
			*depthp = i + 1;
			break;
		}

		/* Update elm. */
		if (*dot == '\0') {
			/* No more elements. */
			ret = ENOENT;
			goto label_return;
		}
		elm = &dot[1];
		dot = ((tdot = strchr(elm, '.')) != NULL) ? tdot :
		    strchr(elm, '\0');
		elen = (size_t)((uintptr_t)dot - (uintptr_t)elm);
	}

	ret = 0;
label_return:
	return (ret);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movl $0x2e, %esi
callq 0x101c0
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0x52ba8
movq -0x38(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x52bba
movq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x101c0
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x52be7
movl $0x2, -0x24(%rbp)
jmp 0x52e46
leaq 0x4a892(%rip), %rax     # 0x9d480
movq %rax, -0x60(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x52e3f
jmp 0x52c0d
jmp 0x52c0f
jmp 0x52c11
jmp 0x52c13
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x52e60
cmpq $0x0, %rax
je 0x52ced
movq -0x60(%rbp), %rax
movq %rax, -0x68(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq -0x60(%rbp), %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
jae 0x52cd2
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rax
movl %eax, %esi
callq 0x53050
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x101a0
cmpq -0x48(%rbp), %rax
jne 0x52cbf
movq -0x30(%rbp), %rdi
movq -0x70(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x48(%rbp), %rdx
callq 0x100a0
cmpl $0x0, %eax
jne 0x52cbf
movq -0x70(%rbp), %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x52cad
movq -0x60(%rbp), %rdx
movq -0x10(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x58(%rbp), %rdx
movq -0x18(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x52cd2
jmp 0x52cc1
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x52c3a
movq -0x60(%rbp), %rax
cmpq -0x68(%rbp), %rax
jne 0x52ce8
movl $0x2, -0x24(%rbp)
jmp 0x52e46
jmp 0x52d85
movq -0x30(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x7c1d0
movq %rax, -0x78(%rbp)
cmpq $-0x1, -0x78(%rbp)
je 0x52d11
cmpq $-0x1, -0x78(%rbp)
jbe 0x52d1d
movl $0x2, -0x24(%rbp)
jmp 0x52e46
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x530a0
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rcx
movq (%rcx), %rsi
movq -0x78(%rbp), %rdx
callq *%rax
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x52d5e
movl $0x2, -0x24(%rbp)
jmp 0x52e46
cmpq $0x0, -0x10(%rbp)
je 0x52d75
movq -0x60(%rbp), %rdx
movq -0x10(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x78(%rbp), %rdx
movq -0x18(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x60(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x52dbc
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x52da8
movl $0x2, -0x24(%rbp)
jmp 0x52e46
movq -0x50(%rbp), %rcx
addq $0x1, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
jmp 0x52e3f
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x52dd1
movl $0x2, -0x24(%rbp)
jmp 0x52e46
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movl $0x2e, %esi
callq 0x101c0
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0x52e02
movq -0x38(%rbp), %rax
movq %rax, -0x90(%rbp)
jmp 0x52e14
movq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x101c0
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x52bfa
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)