	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function swp_pager_getswapspace
_swp_pager_getswapspace:                ## @swp_pager_getswapspace
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	_SWAPBLK_NONE@GOTPCREL(%rip), %r12
	movq	(%r12), %r15
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movl	(%rdi), %r13d
	movq	_BLIST_MAX_ALLOC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r13d, %esi
	callq	_imin
	movl	%eax, -44(%rbp)
	movq	_sw_dev_mtx@GOTPCREL(%rip), %rdi
	callq	_mtx_lock
	movq	_swdevhd@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	_swtailq@GOTPCREL(%rip), %rdi
	callq	_TAILQ_EMPTY
	testl	%eax, %eax
	je	LBB0_1
LBB0_11:
	cmpq	(%r12), %r15
	jne	LBB0_12
## %bb.13:
	movq	_swap_pager_full@GOTPCREL(%rip), %rbx
	cmpl	$2, (%rbx)
	je	LBB0_15
## %bb.14:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	callq	_printf
	movl	$2, (%rbx)
	movq	_swap_pager_almost_full@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
LBB0_15:
	xorl	%eax, %eax
	jmp	LBB0_16
LBB0_12:
	movl	-44(%rbp), %eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	addq	8(%rbx), %r15
	addl	%eax, 16(%rbx)
	movq	_swap_pager_avail@GOTPCREL(%rip), %rcx
	subl	%eax, (%rcx)
	xorl	%eax, %eax
	callq	_swp_sizecheck
	movq	_sw_list@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_TAILQ_NEXT
LBB0_16:
	movq	_swdevhd@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movq	_sw_dev_mtx@GOTPCREL(%rip), %rdi
	callq	_mtx_unlock
	movq	%r15, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	movq	_swtailq@GOTPCREL(%rip), %r14
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	callq	_TAILQ_EMPTY
	testl	%eax, %eax
	jne	LBB0_11
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	testq	%rbx, %rbx
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	callq	_TAILQ_FIRST
	movq	%rax, %rbx
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_SW_CLOSING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	20(%rbx), %edi
	leaq	-44(%rbp), %rsi
	movl	%r13d, %edx
	callq	_blist_alloc
	movq	%rax, %r15
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpq	(%r12), %r15
	jne	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_sw_list@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_TAILQ_NEXT
	movq	%rax, %rbx
	movq	_swdevhd@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	jne	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-44(%rbp), %eax
	cmpl	-48(%rbp), %eax                 ## 4-byte Folded Reload
	jle	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	leal	-1(%rax), %r13d
	sarl	%eax
	movl	%eax, -44(%rbp)
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_SWAPBLK_NONE,8,3               ## @SWAPBLK_NONE
	.comm	_BLIST_MAX_ALLOC,4,2            ## @BLIST_MAX_ALLOC
	.comm	_sw_dev_mtx,4,2                 ## @sw_dev_mtx
	.comm	_swdevhd,8,3                    ## @swdevhd
	.comm	_swtailq,4,2                    ## @swtailq
	.comm	_SW_CLOSING,4,2                 ## @SW_CLOSING
	.comm	_sw_list,4,2                    ## @sw_list
	.comm	_swap_pager_avail,4,2           ## @swap_pager_avail
	.comm	_swap_pager_full,4,2            ## @swap_pager_full
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"swp_pager_getswapspace(%d): failed\n"

	.comm	_swap_pager_almost_full,4,2     ## @swap_pager_almost_full
	.no_dead_strip	_swp_pager_getswapspace
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function swp_pager_getswapspace
_swp_pager_getswapspace:                ; @swp_pager_getswapspace
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x26, _SWAPBLK_NONE@GOTPAGE
Lloh1:
	ldr	x26, [x26, _SWAPBLK_NONE@GOTPAGEOFF]
	ldr	x19, [x26]
	ldr	w23, [x0]
Lloh2:
	adrp	x8, _BLIST_MAX_ALLOC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BLIST_MAX_ALLOC@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	mov	x1, x23
	bl	_imin
	str	w0, [sp, #12]
Lloh5:
	adrp	x0, _sw_dev_mtx@GOTPAGE
Lloh6:
	ldr	x0, [x0, _sw_dev_mtx@GOTPAGEOFF]
	bl	_mtx_lock
Lloh7:
	adrp	x25, _swdevhd@GOTPAGE
Lloh8:
	ldr	x25, [x25, _swdevhd@GOTPAGEOFF]
	ldr	x21, [x25]
Lloh9:
	adrp	x0, _swtailq@GOTPAGE
Lloh10:
	ldr	x0, [x0, _swtailq@GOTPAGEOFF]
	bl	_TAILQ_EMPTY
	cbz	w0, LBB0_5
LBB0_1:
	ldr	x8, [x26]
	cmp	x19, x8
	b.ne	LBB0_4
; %bb.2:
Lloh11:
	adrp	x21, _swap_pager_full@GOTPAGE
Lloh12:
	ldr	x21, [x21, _swap_pager_full@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, #2
	b.ne	LBB0_15
; %bb.3:
	mov	x0, #0
	b	LBB0_16
LBB0_4:
	ldr	w8, [sp, #12]
	str	w8, [x20]
	ldr	x9, [x21, #8]
	add	x19, x9, x19
	ldr	w9, [x21, #16]
	add	w9, w9, w8
	str	w9, [x21, #16]
Lloh13:
	adrp	x9, _swap_pager_avail@GOTPAGE
Lloh14:
	ldr	x9, [x9, _swap_pager_avail@GOTPAGEOFF]
	ldr	w10, [x9]
	sub	w8, w10, w8
	str	w8, [x9]
	bl	_swp_sizecheck
Lloh15:
	adrp	x8, _sw_list@GOTPAGE
Lloh16:
	ldr	x8, [x8, _sw_list@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_TAILQ_NEXT
	b	LBB0_16
LBB0_5:
Lloh18:
	adrp	x24, _swtailq@GOTPAGE
Lloh19:
	ldr	x24, [x24, _swtailq@GOTPAGEOFF]
Lloh20:
	adrp	x27, _SW_CLOSING@GOTPAGE
Lloh21:
	ldr	x27, [x27, _SW_CLOSING@GOTPAGEOFF]
Lloh22:
	adrp	x28, _sw_list@GOTPAGE
Lloh23:
	ldr	x28, [x28, _sw_list@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x24
	bl	_TAILQ_EMPTY
	cbnz	w0, LBB0_1
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	cbnz	x21, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x24
	bl	_TAILQ_FIRST
	mov	x21, x0
LBB0_9:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [x21]
	ldr	w9, [x27]
	tst	w9, w8
	b.ne	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w0, [x21, #20]
	add	x1, sp, #12
	mov	x2, x23
	bl	_blist_alloc
	mov	x19, x0
LBB0_11:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x26]
	cmp	x19, x8
	b.ne	LBB0_1
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w1, [x28]
	mov	x0, x21
	bl	_TAILQ_NEXT
	mov	x21, x0
	ldr	x8, [x25]
	cmp	x8, x0
	b.ne	LBB0_6
; %bb.13:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [sp, #12]
	cmp	w8, w22
	b.le	LBB0_1
; %bb.14:                               ;   in Loop: Header=BB0_7 Depth=1
	sub	w23, w8, #1
	asr	w8, w8, #1
	str	w8, [sp, #12]
	b	LBB0_6
LBB0_15:
	ldr	w1, [x20]
Lloh24:
	adrp	x0, l_.str@PAGE
Lloh25:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
	mov	x0, #0
	mov	w8, #2
	str	w8, [x21]
Lloh26:
	adrp	x8, _swap_pager_almost_full@GOTPAGE
Lloh27:
	ldr	x8, [x8, _swap_pager_almost_full@GOTPAGEOFF]
	mov	w9, #1
Lloh28:
	str	w9, [x8]
LBB0_16:
	str	x0, [x25]
Lloh29:
	adrp	x0, _sw_dev_mtx@GOTPAGE
Lloh30:
	ldr	x0, [x0, _sw_dev_mtx@GOTPAGEOFF]
	bl	_mtx_unlock
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotStr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_SWAPBLK_NONE,8,3               ; @SWAPBLK_NONE
	.comm	_BLIST_MAX_ALLOC,4,2            ; @BLIST_MAX_ALLOC
	.comm	_sw_dev_mtx,4,2                 ; @sw_dev_mtx
	.comm	_swdevhd,8,3                    ; @swdevhd
	.comm	_swtailq,4,2                    ; @swtailq
	.comm	_SW_CLOSING,4,2                 ; @SW_CLOSING
	.comm	_sw_list,4,2                    ; @sw_list
	.comm	_swap_pager_avail,4,2           ; @swap_pager_avail
	.comm	_swap_pager_full,4,2            ; @swap_pager_full
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"swp_pager_getswapspace(%d): failed\n"

	.comm	_swap_pager_almost_full,4,2     ; @swap_pager_almost_full
	.no_dead_strip	_swp_pager_getswapspace
.subsections_via_symbols
