	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kern_madvise                   ## -- Begin function kern_madvise
	.p2align	4, 0x90
_kern_madvise:                          ## @kern_madvise
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_MADV_PROTECT@GOTPCREL(%rip), %rax
	cmpl	%ecx, (%rax)
	jne	LBB0_2
## %bb.1:
	movq	_PPROT_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -36(%rbp)
	movq	_P_PID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%rdi), %rax
	movl	8(%rax), %edx
	movq	_PROC_SPROTECT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-36(%rbp), %r8
	callq	_kern_procctl
	jmp	LBB0_5
LBB0_2:
	movl	%ecx, %r14d
	movq	%rdx, %r12
	movq	%rsi, %rbx
	movq	(%rdi), %rax
	movq	(%rax), %r15
	movq	%r15, %rdi
	callq	_vm_map_min
	cmpq	%rbx, %rax
	ja	LBB0_4
## %bb.3:
	addq	%rbx, %r12
	movq	%r15, %rdi
	callq	_vm_map_max
	cmpq	%rax, %r12
	ja	LBB0_4
## %bb.6:
	cmpq	%rbx, %r12
	jae	LBB0_7
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_5:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%rbx, %rdi
	callq	_trunc_page
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_round_page
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	%rax, %rdx
	movl	%r14d, %ecx
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_vm_map_madvise                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MADV_PROTECT,4,2               ## @MADV_PROTECT
	.comm	_PPROT_SET,4,2                  ## @PPROT_SET
	.comm	_P_PID,4,2                      ## @P_PID
	.comm	_PROC_SPROTECT,4,2              ## @PROC_SPROTECT
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kern_madvise                   ; -- Begin function kern_madvise
	.p2align	2
_kern_madvise:                          ; @kern_madvise
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
Lloh0:
	adrp	x8, _MADV_PROTECT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MADV_PROTECT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w3
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _PPROT_SET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PPROT_SET@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [sp, #12]
Lloh6:
	adrp	x8, _P_PID@GOTPAGE
Lloh7:
	ldr	x8, [x8, _P_PID@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ldr	x8, [x0]
	ldr	w2, [x8, #8]
Lloh9:
	adrp	x8, _PROC_SPROTECT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PROC_SPROTECT@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	add	x4, sp, #12
	bl	_kern_procctl
	b	LBB0_6
LBB0_2:
	mov	x19, x3
	mov	x22, x2
	mov	x21, x1
	ldr	x8, [x0]
	ldr	x20, [x8]
	mov	x0, x20
	bl	_vm_map_min
	cmp	x0, x21
	b.hi	LBB0_5
; %bb.3:
	add	x22, x22, x21
	mov	x0, x20
	bl	_vm_map_max
	cmp	x22, x0
	b.hi	LBB0_5
; %bb.4:
	cmp	x22, x21
	b.hs	LBB0_7
LBB0_5:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
LBB0_6:
	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
	add	sp, sp, #64
	ret
LBB0_7:
	mov	x0, x21
	bl	_trunc_page
	mov	x21, x0
	mov	x0, x22
	bl	_round_page
	mov	x2, x0
	mov	x0, x20
	mov	x1, x21
	mov	x3, x19
	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
	add	sp, sp, #64
	b	_vm_map_madvise
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_MADV_PROTECT,4,2               ; @MADV_PROTECT
	.comm	_PPROT_SET,4,2                  ; @PPROT_SET
	.comm	_P_PID,4,2                      ; @P_PID
	.comm	_PROC_SPROTECT,4,2              ; @PROC_SPROTECT
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
