// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/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 $0x88, %rsp
movq %r9, %r12
movq %r8, %r15
movq %rcx, %r14
movq %rdx, %rbx
movq 0x8(%rdi), %r13
leaq 0x40c78(%rip), %rdi     # 0x846f8
callq 0x12960
callq 0x34820
movl $0xe, %ebp
cmpl %r13d, %eax
jbe 0x43c0e
movq %r14, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq 0x2a53f(%rip), %r14     # 0x6dfe8
movq %fs:0x0, %rbx
addq %r14, %rbx
movl %fs:(%r14), %eax
testl %eax, %eax
je 0x43c43
cmpl $0x2, %eax
je 0x43c4d
movq %fs:0x30(%r14), %rax
testq %rax, %rax
je 0x43c2e
cmpl %r13d, %fs:0x38(%r14)
jbe 0x43c2e
movl %r13d, %ecx
movq (%rax,%rcx,8), %rsi
testq %rsi, %rsi
je 0x43c2e
testq %rsi, %rsi
je 0x43c0e
testq %r15, %r15
je 0x43b8f
cmpq $0x38, %r12
movq 0x10(%rsp), %rbx
movq 0x8(%rsp), %r14
jne 0x43c09
movq 0x30(%r15), %rax
leaq 0x50(%rsp), %rdx
movq %rax, 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 0x18(%rsp), %rdi
callq 0x4044c
testq %rbx, %rbx
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
jne 0x43bdf
movq (%r14), %rax
cmpq $0x38, %rax
jne 0x43bf3
movq 0x48(%rsp), %rax
movq %rax, 0x30(%rbx)
movups 0x18(%rsp), %xmm0
movups 0x28(%rsp), %xmm1
movups 0x38(%rsp), %xmm2
movups %xmm2, 0x20(%rbx)
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
jmp 0x43bdf
leaq 0x18(%rsp), %rdi
callq 0x403f3
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
sete %al
movq 0x8(%rsp), %rdx
testq %rdx, %rdx
sete %cl
orb %al, %cl
jne 0x43bdf
movq (%rdx), %rax
cmpq $0x38, %rax
jne 0x43be3
movq 0x48(%rsp), %rax
movq %rax, 0x30(%rdi)
movups 0x18(%rsp), %xmm0
movups 0x28(%rsp), %xmm1
movups 0x38(%rsp), %xmm2
movups %xmm2, 0x20(%rdi)
movups %xmm1, 0x10(%rdi)
movups %xmm0, (%rdi)
xorl %ebp, %ebp
jmp 0x43c0e
movl $0x38, %edx
cmovbq %rax, %rdx
leaq 0x18(%rsp), %rsi
jmp 0x43c04
movl $0x38, %edx
cmovbq %rax, %rdx
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x12520
movl $0x16, %ebp
leaq 0x40ae3(%rip), %rdi     # 0x846f8
callq 0x125c0
movl %ebp, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x348cd
movq %rax, %rsi
jmp 0x43af3
movl $0x1, %fs:(%r14)
jmp 0x43c55
movl $0x3, %fs:(%r14)
leaq 0x411a8(%rip), %rax     # 0x84e04
movl (%rax), %edi
movq %rbx, %rsi
callq 0x12990
testl %eax, %eax
je 0x43aca
leaq 0x15f3f(%rip), %rdi     # 0x59bb4
callq 0x4f37c
leaq 0x3faaf(%rip), %rax     # 0x83730
cmpb $0x1, (%rax)
jne 0x43aca
callq 0x120c0