	.file	"extr_vm_apple_protect.c_apple_protect_pager_last_unmap.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	apple_protect_pager_last_unmap
	.type	apple_protect_pager_last_unmap, @function
apple_protect_pager_last_unmap:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movsx	rsi, edi
	mov	edi, DWORD PTR PAGER_ALL[rip]
	mov	rbp, rsi
	call	PAGER_DEBUG@PLT
	mov	edi, ebp
	call	apple_protect_pager_lookup@PLT
	lea	rdi, apple_protect_pager_lock[rip]
	mov	rbp, rax
	call	lck_mtx_lock@PLT
	cmp	QWORD PTR 0[rbp], 0
	je	.L2
	mov	eax, DWORD PTR apple_protect_pager_count_mapped[rip]
	mov	edx, DWORD PTR apple_protect_pager_count[rip]
	sub	eax, 1
	sub	edx, eax
	cmp	DWORD PTR apple_protect_pager_count_unmapped_max[rip], edx
	mov	DWORD PTR apple_protect_pager_count_mapped[rip], eax
	jl	.L7
.L3:
	mov	rax, QWORD PTR FALSE[rip]
	mov	esi, DWORD PTR TRUE[rip]
	mov	rdi, rbp
	mov	QWORD PTR 0[rbp], rax
	call	apple_protect_pager_deallocate_internal@PLT
	mov	eax, DWORD PTR KERN_SUCCESS[rip]
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	mov	DWORD PTR apple_protect_pager_count_unmapped_max[rip], edx
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L2:
	lea	rdi, apple_protect_pager_lock[rip]
	call	lck_mtx_unlock@PLT
	mov	eax, DWORD PTR KERN_SUCCESS[rip]
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	apple_protect_pager_last_unmap, .-apple_protect_pager_last_unmap
	.comm	apple_protect_pager_lock,4,4
	.comm	apple_protect_pager_count_unmapped_max,4,4
	.comm	apple_protect_pager_count_mapped,4,4
	.comm	apple_protect_pager_count,4,4
	.comm	TRUE,4,4
	.comm	PAGER_ALL,4,4
	.comm	KERN_SUCCESS,4,4
	.comm	FALSE,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_vm_apple_protect.c_apple_protect_pager_last_unmap.c"
	.text
	.align	2
	.global	apple_protect_pager_last_unmap
	.syntax unified
	.arm
	.fpu softvfp
	.type	apple_protect_pager_last_unmap, %function
apple_protect_pager_last_unmap:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, lr}
	mov	r4, r0
	ldr	r3, .L7
	mov	r1, r0
	ldr	r0, [r3]
	bl	PAGER_DEBUG
	mov	r0, r4
	bl	apple_protect_pager_lookup
	mov	r4, r0
	ldr	r0, .L7+4
	bl	lck_mtx_lock
	ldr	r3, [r4]
	cmp	r3, #0
	beq	.L2
	ldr	r1, .L7+8
	ldr	r2, .L7+12
	ldr	r3, [r1]
	ldr	r0, .L7+16
	ldr	r2, [r2]
	ldr	ip, [r0]
	sub	r3, r3, #1
	sub	r2, r2, r3
	cmp	ip, r2
	strlt	r2, [r0]
	ldr	r2, .L7+20
	str	r3, [r1]
	ldr	r2, [r2]
	ldr	r3, .L7+24
	mov	r0, r4
	ldr	r1, [r3]
	str	r2, [r4]
	bl	apple_protect_pager_deallocate_internal
.L4:
	ldr	r3, .L7+28
	ldr	r0, [r3]
	pop	{r4, pc}
.L2:
	ldr	r0, .L7+4
	bl	lck_mtx_unlock
	b	.L4
.L8:
	.align	2
.L7:
	.word	PAGER_ALL
	.word	apple_protect_pager_lock
	.word	apple_protect_pager_count_mapped
	.word	apple_protect_pager_count
	.word	apple_protect_pager_count_unmapped_max
	.word	FALSE
	.word	TRUE
	.word	KERN_SUCCESS
	.size	apple_protect_pager_last_unmap, .-apple_protect_pager_last_unmap
	.comm	apple_protect_pager_lock,4,4
	.comm	apple_protect_pager_count_unmapped_max,4,4
	.comm	apple_protect_pager_count_mapped,4,4
	.comm	apple_protect_pager_count,4,4
	.comm	TRUE,4,4
	.comm	PAGER_ALL,4,4
	.comm	KERN_SUCCESS,4,4
	.comm	FALSE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
