	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function check_mmap_write
_check_mmap_write:                      ## @check_mmap_write
	.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
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	testl	%ecx, %ecx
	jle	LBB0_14
## %bb.1:
	movl	%ecx, %r14d
	xorl	%ebx, %ebx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str(%rip), %rsi
	movl	%r13d, %edx
	callq	_notok_mode
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	cmpq	%rbx, %r14
	je	LBB0_14
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax,%rbx,4), %r13d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	callq	_open
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %r12d
	xorl	%eax, %eax
	callq	_getpagesize
	movq	_PROT_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_MAP_SHARED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%edi, %edi
	movl	%eax, %esi
	movl	%r12d, %r8d
	xorl	%r9d, %r9d
	callq	_mmap
	movq	_O_ACCMODE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%r13d, %ecx
	movq	_O_WRONLY@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	movq	%rax, %r15
	sete	%dl
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	sete	%al
	orb	%dl, %al
	movq	_MAP_FAILED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %r15
	je	LBB0_5
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	testb	%al, %al
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.2(%rip), %rsi
	movl	%r13d, %edx
	callq	_ok_mode
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	testb	%al, %al
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.1(%rip), %rsi
	movl	%r13d, %edx
	callq	_notok_mode
	jmp	LBB0_12
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.2(%rip), %rsi
	movl	%r13d, %edx
	callq	_notok_mode
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	callq	_getpagesize
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_munmap
	jmp	LBB0_12
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.1(%rip), %rsi
	movl	%r13d, %edx
	callq	_ok_mode
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	%r12d, %edi
	callq	_close
	jmp	LBB0_13
LBB0_14:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"open"

	.comm	_PROT_WRITE,4,2                 ## @PROT_WRITE
	.comm	_MAP_SHARED,4,2                 ## @MAP_SHARED
	.comm	_MAP_FAILED,8,3                 ## @MAP_FAILED
	.comm	_O_ACCMODE,4,2                  ## @O_ACCMODE
	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
	.comm	_O_RDWR,4,2                     ## @O_RDWR
L_.str.1:                               ## @.str.1
	.asciz	"mmap failed"

L_.str.2:                               ## @.str.2
	.asciz	"mmap succeeded"

	.no_dead_strip	_check_mmap_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function check_mmap_write
_check_mmap_write:                      ; @check_mmap_write
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	cmp	w3, #1
	b.lt	LBB0_14
; %bb.1:
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	mov	w28, w3
Lloh0:
	adrp	x23, _O_ACCMODE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _O_ACCMODE@GOTPAGEOFF]
Lloh2:
	adrp	x22, _O_WRONLY@GOTPAGE
Lloh3:
	ldr	x22, [x22, _O_WRONLY@GOTPAGEOFF]
Lloh4:
	adrp	x24, _O_RDWR@GOTPAGE
Lloh5:
	ldr	x24, [x24, _O_RDWR@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x26
	bl	_notok_mode
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x19, x19, #4
	subs	x28, x28, #1
	b.eq	LBB0_14
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w26, [x19]
	mov	x0, x20
	mov	x1, x26
	bl	_open
	tbnz	w0, #31, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x25, x0
	bl	_getpagesize
	mov	x1, x0
Lloh8:
	adrp	x8, _PROT_WRITE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PROT_WRITE@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
Lloh11:
	adrp	x8, _MAP_SHARED@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MAP_SHARED@GOTPAGEOFF]
Lloh13:
	ldr	w3, [x8]
	mov	x0, #0
	mov	x4, x25
	mov	w5, #0
	bl	_mmap
Lloh14:
	adrp	x8, _MAP_FAILED@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MAP_FAILED@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x8]
	ldr	w8, [x23]
	and	w8, w8, w26
	ldr	w10, [x22]
	cmp	w8, w10
	ldr	w10, [x24]
	ccmp	w8, w10, #4, ne
	cset	w8, eq
	cmp	x0, x9
	b.eq	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x27, x0
	mov	x0, x21
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x26
	cbz	w8, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_ok_mode
	b	LBB0_11
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x26
	cbz	w8, LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_notok_mode
	b	LBB0_13
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_notok_mode
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_getpagesize
	mov	x1, x0
	mov	x0, x27
	bl	_munmap
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_ok_mode
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x25
	bl	_close
	b	LBB0_3
LBB0_14:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"open"

	.comm	_PROT_WRITE,4,2                 ; @PROT_WRITE
	.comm	_MAP_SHARED,4,2                 ; @MAP_SHARED
	.comm	_MAP_FAILED,8,3                 ; @MAP_FAILED
	.comm	_O_ACCMODE,4,2                  ; @O_ACCMODE
	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
	.comm	_O_RDWR,4,2                     ; @O_RDWR
l_.str.1:                               ; @.str.1
	.asciz	"mmap failed"

l_.str.2:                               ; @.str.2
	.asciz	"mmap succeeded"

	.no_dead_strip	_check_mmap_write
.subsections_via_symbols
