	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function base_auto_thp_switch
_base_auto_thp_switch:                  ## @base_auto_thp_switch
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	_opt_metadata_thp@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_metadata_thp_auto@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_assert
	leaq	24(%r14), %rsi
	movq	%rbx, %rdi
	callq	_malloc_mutex_assert_owner
	cmpl	$0, (%r14)
	jne	LBB0_15
## %bb.1:
	movq	%r14, %rdi
	callq	_base_ind_get
	movq	%rax, %rbx
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_base_get_num_blocks
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.2:
	movq	_BASE_AUTO_THP_THRESHOLD@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_5
	jmp	LBB0_15
LBB0_3:
	movq	_BASE_AUTO_THP_THRESHOLD_A0@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_15
LBB0_5:
	movl	$1, (%r14)
	movq	_config_stats@GOTPCREL(%rip), %r12
	cmpq	$0, (%r12)
	je	LBB0_6
## %bb.7:
	xorl	%edi, %edi
	cmpq	$0, 8(%r14)
	sete	%dil
	jmp	LBB0_8
LBB0_6:
	movl	$1, %edi
LBB0_8:
	callq	_assert
	movq	16(%r14), %rbx
	testq	%rbx, %rbx
	je	LBB0_15
## %bb.9:
	movq	_HUGEPAGE_MASK@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %eax
	xorl	%edi, %edi
	andl	(%rbx), %eax
	sete	%dil
	callq	_assert
	movl	(%rbx), %esi
	movq	%rbx, %rdi
	callq	_pages_huge
	cmpq	$0, (%r12)
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movslq	(%rbx), %r15
	leaq	16(%rbx), %rdi
	callq	_extent_bsize_get
	subq	%rax, %r15
	movq	%r15, %rdi
	callq	_HUGEPAGE_CEILING
	movq	_LG_HUGEPAGE@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	sarl	%cl, %eax
	cltq
	addq	%rax, 8(%r14)
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	8(%rbx), %rbx
	testq	%rbx, %rbx
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	%r14, %rdi
	callq	_base_ind_get
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_assert
	jmp	LBB0_10
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movl	$1, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_assert                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_opt_metadata_thp,8,3           ## @opt_metadata_thp
	.comm	_metadata_thp_auto,8,3          ## @metadata_thp_auto
	.comm	_BASE_AUTO_THP_THRESHOLD,8,3    ## @BASE_AUTO_THP_THRESHOLD
	.comm	_BASE_AUTO_THP_THRESHOLD_A0,8,3 ## @BASE_AUTO_THP_THRESHOLD_A0
	.comm	_config_stats,8,3               ## @config_stats
	.comm	_HUGEPAGE_MASK,4,2              ## @HUGEPAGE_MASK
	.comm	_LG_HUGEPAGE,4,2                ## @LG_HUGEPAGE
	.no_dead_strip	_base_auto_thp_switch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function base_auto_thp_switch
_base_auto_thp_switch:                  ; @base_auto_thp_switch
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _opt_metadata_thp@GOTPAGE
Lloh1:
	ldr	x8, [x8, _opt_metadata_thp@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _metadata_thp_auto@GOTPAGE
Lloh4:
	ldr	x9, [x9, _metadata_thp_auto@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, eq
	bl	_assert
	add	x1, x19, #24
	mov	x0, x20
	bl	_malloc_mutex_assert_owner
	ldr	w8, [x19]
	cbnz	w8, LBB0_13
; %bb.1:
	mov	x0, x19
	bl	_base_ind_get
	mov	x20, x0
	mov	x0, x19
	mov	w1, #1
	bl	_base_get_num_blocks
	cbz	x20, LBB0_3
; %bb.2:
Lloh6:
	adrp	x8, _BASE_AUTO_THP_THRESHOLD@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BASE_AUTO_THP_THRESHOLD@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh8:
	adrp	x8, _BASE_AUTO_THP_THRESHOLD_A0@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BASE_AUTO_THP_THRESHOLD_A0@GOTPAGEOFF]
LBB0_4:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_13
; %bb.5:
	mov	w0, #1
	str	w0, [x19]
Lloh10:
	adrp	x21, _config_stats@GOTPAGE
Lloh11:
	ldr	x21, [x21, _config_stats@GOTPAGEOFF]
	ldr	x8, [x21]
	cbz	x8, LBB0_7
; %bb.6:
	ldr	x8, [x19, #8]
	cmp	x8, #0
	cset	w0, eq
LBB0_7:
	bl	_assert
	ldr	x20, [x19, #16]
	cbz	x20, LBB0_13
; %bb.8:
Lloh12:
	adrp	x22, _HUGEPAGE_MASK@GOTPAGE
Lloh13:
	ldr	x22, [x22, _HUGEPAGE_MASK@GOTPAGEOFF]
Lloh14:
	adrp	x23, _LG_HUGEPAGE@GOTPAGE
Lloh15:
	ldr	x23, [x23, _LG_HUGEPAGE@GOTPAGEOFF]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x20]
	ldr	w9, [x22]
	tst	w9, w8
	cset	w0, eq
	bl	_assert
	ldr	w1, [x20]
	mov	x0, x20
	bl	_pages_huge
	ldr	x8, [x21]
	cbz	x8, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x20
	ldrsw	x24, [x0], #16
	bl	_extent_bsize_get
	sub	x0, x24, x0
	bl	_HUGEPAGE_CEILING
	ldr	w8, [x23]
	asr	w8, w0, w8
	ldr	x9, [x19, #8]
	add	x8, x9, w8, sxtw
	str	x8, [x19, #8]
LBB0_11:                                ;   in Loop: Header=BB0_9 Depth=1
	ldr	x20, [x20, #8]
	cbz	x20, LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x19
	bl	_base_ind_get
	cmp	x0, #0
	cset	w0, eq
	bl	_assert
	b	LBB0_9
LBB0_13:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_14:
	mov	w0, #1
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_assert
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_opt_metadata_thp,8,3           ; @opt_metadata_thp
	.comm	_metadata_thp_auto,8,3          ; @metadata_thp_auto
	.comm	_BASE_AUTO_THP_THRESHOLD,8,3    ; @BASE_AUTO_THP_THRESHOLD
	.comm	_BASE_AUTO_THP_THRESHOLD_A0,8,3 ; @BASE_AUTO_THP_THRESHOLD_A0
	.comm	_config_stats,8,3               ; @config_stats
	.comm	_HUGEPAGE_MASK,4,2              ; @HUGEPAGE_MASK
	.comm	_LG_HUGEPAGE,4,2                ; @LG_HUGEPAGE
	.no_dead_strip	_base_auto_thp_switch
.subsections_via_symbols
