// File: /workspace/github_c_makefile_star2_O0/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/jemalloc.c
// Function: je_arena_tdata_get_hard
arena_tdata_t *
arena_tdata_get_hard(tsd_t *tsd, unsigned ind)
{
	arena_tdata_t *tdata, *arenas_tdata_old;
	arena_tdata_t *arenas_tdata = tsd_arenas_tdata_get(tsd);
	unsigned narenas_tdata_old, i;
	unsigned narenas_tdata = tsd_narenas_tdata_get(tsd);
	unsigned narenas_actual = narenas_total_get();

	/*
	 * Dissociate old tdata array (and set up for deallocation upon return)
	 * if it's too small.
	 */
	if (arenas_tdata != NULL && narenas_tdata < narenas_actual) {
		arenas_tdata_old = arenas_tdata;
		narenas_tdata_old = narenas_tdata;
		arenas_tdata = NULL;
		narenas_tdata = 0;
		tsd_arenas_tdata_set(tsd, arenas_tdata);
		tsd_narenas_tdata_set(tsd, narenas_tdata);
	} else {
		arenas_tdata_old = NULL;
		narenas_tdata_old = 0;
	}

	/* Allocate tdata array if it's missing. */
	if (arenas_tdata == NULL) {
		bool *arenas_tdata_bypassp = tsd_arenas_tdata_bypassp_get(tsd);
		narenas_tdata = (ind < narenas_actual) ? narenas_actual : ind+1;

		if (tsd_nominal(tsd) && !*arenas_tdata_bypassp) {
			*arenas_tdata_bypassp = true;
			arenas_tdata = (arena_tdata_t *)a0malloc(
			    sizeof(arena_tdata_t) * narenas_tdata);
			*arenas_tdata_bypassp = false;
		}
		if (arenas_tdata == NULL) {
			tdata = NULL;
			goto label_return;
		}
		assert(tsd_nominal(tsd) && !*arenas_tdata_bypassp);
		tsd_arenas_tdata_set(tsd, arenas_tdata);
		tsd_narenas_tdata_set(tsd, narenas_tdata);
	}

	/*
	 * Copy to tdata array.  It's possible that the actual number of arenas
	 * has increased since narenas_total_get() was called above, but that
	 * causes no correctness issues unless two threads concurrently execute
	 * the arenas.extend mallctl, which we trust mallctl synchronization to
	 * prevent.
	 */

	/* Copy/initialize tickers. */
	for (i = 0; i < narenas_actual; i++) {
		if (i < narenas_tdata_old) {
			ticker_copy(&arenas_tdata[i].decay_ticker,
			    &arenas_tdata_old[i].decay_ticker);
		} else {
			ticker_init(&arenas_tdata[i].decay_ticker,
			    DECAY_NTICKS_PER_UPDATE);
		}
	}
	if (narenas_tdata > narenas_actual) {
		memset(&arenas_tdata[narenas_actual], 0, sizeof(arena_tdata_t)
		    * (narenas_tdata - narenas_actual));
	}

	/* Read the refreshed tdata array. */
	tdata = &arenas_tdata[ind];
label_return:
	if (arenas_tdata_old != NULL)
		a0dalloc(arenas_tdata_old);
	return (tdata);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x70(%rbp)
movl %esi, -0x74(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x40(%rax), %eax
movl %eax, -0x9c(%rbp)
callq 0x19e40
movl %eax, -0xa0(%rbp)
cmpq $0x0, -0x90(%rbp)
je 0x1a1fc
movl -0x9c(%rbp), %eax
cmpl -0xa0(%rbp), %eax
jae 0x1a1fc
movq -0x90(%rbp), %rax
movq %rax, -0x88(%rbp)
movl -0x9c(%rbp), %eax
movl %eax, -0x94(%rbp)
movq $0x0, -0x90(%rbp)
movl $0x0, -0x9c(%rbp)
movq -0x70(%rbp), %rcx
movq -0x90(%rbp), %rax
movq %rcx, -0x40(%rbp)
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x70(%rbp), %rcx
movl -0x9c(%rbp), %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x40(%rax)
jmp 0x1a211
movq $0x0, -0x88(%rbp)
movl $0x0, -0x94(%rbp)
cmpq $0x0, -0x90(%rbp)
jne 0x1a303
movq -0x70(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x44, %rax
movq %rax, -0xa8(%rbp)
movl -0x74(%rbp), %eax
cmpl -0xa0(%rbp), %eax
jae 0x1a24f
movl -0xa0(%rbp), %eax
movl %eax, -0xac(%rbp)
jmp 0x1a25b
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xac(%rbp)
movl -0xac(%rbp), %eax
movl %eax, -0x9c(%rbp)
movq -0x70(%rbp), %rdi
callq 0x1a400
testb $0x1, %al
jne 0x1a276
jmp 0x1a2ae
movq -0xa8(%rbp), %rax
testb $0x1, (%rax)
jne 0x1a2ae
movq -0xa8(%rbp), %rax
movb $0x1, (%rax)
movl -0x9c(%rbp), %eax
movl %eax, %edi
shlq $0x3, %rdi
callq 0x18520
movq %rax, -0x90(%rbp)
movq -0xa8(%rbp), %rax
movb $0x0, (%rax)
cmpq $0x0, -0x90(%rbp)
jne 0x1a2c5
movq $0x0, -0x80(%rbp)
jmp 0x1a3db
jmp 0x1a2c7
jmp 0x1a2c9
movq -0x70(%rbp), %rcx
movq -0x90(%rbp), %rax
movq %rcx, -0x50(%rbp)
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x70(%rbp), %rcx
movl -0x9c(%rbp), %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x40(%rax)
movl $0x0, -0x98(%rbp)
movl -0x98(%rbp), %eax
cmpl -0xa0(%rbp), %eax
jae 0x1a389
movl -0x98(%rbp), %eax
cmpl -0x94(%rbp), %eax
jae 0x1a358
movq -0x90(%rbp), %rdi
movl -0x98(%rbp), %eax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x88(%rbp), %rsi
movl -0x98(%rbp), %eax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x1a420
jmp 0x1a376
movq -0x90(%rbp), %rdi
movl -0x98(%rbp), %eax
shlq $0x3, %rax
addq %rax, %rdi
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x1a440
jmp 0x1a378
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
jmp 0x1a30d
movl -0x9c(%rbp), %eax
cmpl -0xa0(%rbp), %eax
jbe 0x1a3c6
movq -0x90(%rbp), %rdi
movl -0xa0(%rbp), %eax
shlq $0x3, %rax
addq %rax, %rdi
movl -0x9c(%rbp), %eax
subl -0xa0(%rbp), %eax
movl %eax, %eax
movl %eax, %edx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0xb210
movq -0x90(%rbp), %rax
movl -0x74(%rbp), %ecx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0x1a3f1
movq -0x88(%rbp), %rdi
callq 0x19280
movq -0x80(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
nop