// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r9, %r12
movq %r8, %r15
movq %rcx, %r14
movq %rdx, %rbx
movl 0x8(%rdi), %r13d
leaq 0x2b679(%rip), %rdi     # 0x57708
callq 0x106d0
callq 0x1c653
pushq $0xe
popq %rbp
cmpl %r13d, %eax
jbe 0x2c1eb
movq %rbx, (%rsp)
movq 0x27f40(%rip), %rax     # 0x53ff0
movq %fs:0x0, %rbx
addq %rax, %rbx
movl %fs:(%rax), %ecx
testl %ecx, %ecx
je 0x2c208
cmpl $0x2, %ecx
je 0x2c211
pushq $0x1
popq %rcx
movq %rbx, %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x2a9a9
testq %rax, %rax
je 0x2c1eb
testq %r15, %r15
je 0x2c175
cmpq $0x38, %r12
movq (%rsp), %rbx
jne 0x2c1e8
movq 0x30(%r15), %rcx
leaq 0x40(%rsp), %rdx
movq %rcx, 0x30(%rdx)
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movaps %xmm2, 0x20(%rdx)
movaps %xmm1, 0x10(%rdx)
movaps %xmm0, (%rdx)
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x28dd6
testq %rbx, %rbx
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
jne 0x2c1c2
movq (%r14), %rax
cmpq $0x38, %rax
jne 0x2c1d4
movq 0x38(%rsp), %rax
movq %rax, 0x30(%rbx)
movups 0x8(%rsp), %xmm0
movups 0x18(%rsp), %xmm1
movups 0x28(%rsp), %xmm2
movups %xmm2, 0x20(%rbx)
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
jmp 0x2c1c2
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x28d7d
movq (%rsp), %rdi
testq %rdi, %rdi
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
jne 0x2c1c2
movq (%r14), %rax
cmpq $0x38, %rax
jne 0x2c1c6
movq 0x38(%rsp), %rax
movq %rax, 0x30(%rdi)
movups 0x8(%rsp), %xmm0
movups 0x18(%rsp), %xmm1
movups 0x28(%rsp), %xmm2
movups %xmm2, 0x20(%rdi)
movups %xmm1, 0x10(%rdi)
movups %xmm0, (%rdi)
xorl %ebp, %ebp
jmp 0x2c1eb
pushq $0x38
popq %rdx
cmovbq %rax, %rdx
leaq 0x8(%rsp), %rsi
jmp 0x2c1e3
pushq $0x38
popq %rdx
cmovbq %rax, %rdx
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x10400
pushq $0x16
popq %rbp
leaq 0x2b516(%rip), %rdi     # 0x57708
callq 0x10440
movl %ebp, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %fs:(%rax)
jmp 0x2c218
movl $0x3, %fs:(%rax)
leaq 0x2bbf5(%rip), %rax     # 0x57e14
movl (%rax), %edi
movq %rbx, %rsi
callq 0x106f0
testl %eax, %eax
je 0x2c0d0
leaq 0x16c81(%rip), %rdi     # 0x42eb9
callq 0x37d1c
leaq 0x2a3dc(%rip), %rax     # 0x56620
cmpb $0x1, (%rax)
jne 0x2c0d0
callq 0x10090