// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/deps/jemalloc/src/ctl.c
// Function: arena_i_chunk_hooks_ctl
static int
arena_i_chunk_hooks_ctl(const size_t *mib, size_t miblen, void *oldp,
    size_t *oldlenp, void *newp, size_t newlen)
{
	int ret;
	unsigned arena_ind = mib[1];
	arena_t *arena;

	malloc_mutex_lock(&ctl_mtx);
	if (arena_ind < narenas_total_get() && (arena =
	    arena_get(tsd_fetch(), arena_ind, false, true)) != NULL) {
		if (newp != NULL) {
			chunk_hooks_t old_chunk_hooks, new_chunk_hooks;
			WRITE(new_chunk_hooks, chunk_hooks_t);
			old_chunk_hooks = chunk_hooks_set(arena,
			    &new_chunk_hooks);
			READ(old_chunk_hooks, chunk_hooks_t);
		} else {
			chunk_hooks_t old_chunk_hooks = chunk_hooks_get(arena);
			READ(old_chunk_hooks, chunk_hooks_t);
		}
	} else {
		ret = EFAULT;
		goto label_return;
	}
	ret = 0;
label_return:
	malloc_mutex_unlock(&ctl_mtx);
	return (ret);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x20(%rbp)
movq %rsi, -0x28(%rbp)
movq %rdx, -0x30(%rbp)
movq %rcx, -0x38(%rbp)
movq %r8, -0x40(%rbp)
movq %r9, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, -0x50(%rbp)
leaq 0x4aff3(%rip), %rdi     # 0xa2788
callq 0x53170
movl -0x50(%rbp), %eax
movl %eax, -0x14c(%rbp)
callq 0x25f90
movl %eax, %ecx
movl -0x14c(%rbp), %eax
cmpl %ecx, %eax
jae 0x57aad
movq 0x47829(%rip), %rcx     # 0x9efe8
movq %fs:0x0, %rax
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x1, (%rax)
setne %al
testb $0x1, %al
jne 0x577e2
jmp 0x578f1
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x57868
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
movq 0x477e4(%rip), %rax     # 0x9efe8
movq %fs:0x0, %rdi
addq %rax, %rdi
movq -0x10(%rbp), %rsi
movl $0x50, %edx
callq 0x103b0
leaq 0x4b6ef(%rip), %rax     # 0xa2f14
movl (%rax), %edi
movq 0x477ba(%rip), %rax     # 0x9efe8
movq %fs:0x0, %rsi
addq %rax, %rsi
callq 0x106d0
cmpl $0x0, %eax
je 0x57863
leaq 0x377ee(%rip), %rdi     # 0x8f039
callq 0x7c0e0
leaq 0x49e49(%rip), %rax     # 0xa16a0
testb $0x1, (%rax)
je 0x57861
callq 0x10070
jmp 0x57863
jmp 0x578ef
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x578eb
movq -0x18(%rbp), %rax
movl $0x3, (%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq 0x4775e(%rip), %rax     # 0x9efe8
movq %fs:0x0, %rdi
addq %rax, %rdi
movq -0x8(%rbp), %rsi
movl $0x50, %edx
callq 0x103b0
leaq 0x4b669(%rip), %rax     # 0xa2f14
movl (%rax), %edi
movq 0x47734(%rip), %rax     # 0x9efe8
movq %fs:0x0, %rsi
addq %rax, %rsi
callq 0x106d0
cmpl $0x0, %eax
je 0x578e9
leaq 0x37768(%rip), %rdi     # 0x8f039
callq 0x7c0e0
leaq 0x49dc3(%rip), %rax     # 0xa16a0
testb $0x1, (%rax)
je 0x578e7
callq 0x10070
jmp 0x578e9
jmp 0x578ed
jmp 0x578ed
jmp 0x578ef
jmp 0x578f1
movq -0x18(%rbp), %rdi
movl -0x50(%rbp), %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x537c0
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
je 0x57aad
cmpq $0x0, -0x40(%rbp)
je 0x57a12
jmp 0x5791f
cmpq $0x0, -0x40(%rbp)
je 0x5794e
cmpq $0x38, -0x48(%rbp)
je 0x57939
movl $0x16, -0x4c(%rbp)
jmp 0x57abd
movq -0x40(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
movl $0x38, %edx
callq 0x103b0
jmp 0x57950
movq -0x58(%rbp), %rsi
leaq -0x100(%rbp), %rdi
leaq -0xc8(%rbp), %rdx
callq 0x500f0
leaq -0x90(%rbp), %rdi
leaq -0x100(%rbp), %rsi
movl $0x38, %edx
callq 0x103b0
cmpq $0x0, -0x30(%rbp)
je 0x57a0b
cmpq $0x0, -0x38(%rbp)
je 0x57a0b
movq -0x38(%rbp), %rax
cmpq $0x38, (%rax)
je 0x579f6
movq -0x38(%rbp), %rcx
movl $0x38, %eax
cmpq (%rcx), %rax
ja 0x579b7
movl $0x38, %eax
movq %rax, -0x158(%rbp)
jmp 0x579c5
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x158(%rbp)
movq -0x158(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x30(%rbp), %rdi
movq -0x108(%rbp), %rdx
leaq -0x90(%rbp), %rsi
callq 0x103b0
movl $0x16, -0x4c(%rbp)
jmp 0x57abd
movq -0x30(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movl $0x38, %edx
callq 0x103b0
jmp 0x57a0d
jmp 0x57aab
movq -0x58(%rbp), %rsi
leaq -0x140(%rbp), %rdi
callq 0x50010
cmpq $0x0, -0x30(%rbp)
je 0x57aa7
cmpq $0x0, -0x38(%rbp)
je 0x57aa7
movq -0x38(%rbp), %rax
cmpq $0x38, (%rax)
je 0x57a92
movq -0x38(%rbp), %rcx
movl $0x38, %eax
cmpq (%rcx), %rax
ja 0x57a56
movl $0x38, %eax
movq %rax, -0x160(%rbp)
jmp 0x57a64
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x160(%rbp)
movq -0x160(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x30(%rbp), %rdi
movq -0x148(%rbp), %rdx
leaq -0x140(%rbp), %rsi
callq 0x103b0
movl $0x16, -0x4c(%rbp)
jmp 0x57abd
movq -0x30(%rbp), %rdi
leaq -0x140(%rbp), %rsi
movl $0x38, %edx
callq 0x103b0
jmp 0x57aa9
jmp 0x57aab
jmp 0x57ab6
movl $0xe, -0x4c(%rbp)
jmp 0x57abd
movl $0x0, -0x4c(%rbp)
leaq 0x4acc4(%rip), %rdi     # 0xa2788
callq 0x536b0
movl -0x4c(%rbp), %eax
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
nopw %cs:(%rax,%rax)