	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msync_sync
_msync_sync:                            ## @msync_sync
	.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, %r15d
	movq	%rdi, %r14
	movq	_page@GOTPCREL(%rip), %r13
	movq	(%r13), %rbx
	movq	%rbx, %rdi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	%rax, %rdi
	movl	$120, %esi
	movq	%rbx, %rdx
	callq	_memset
	movq	_path@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movq	_O_CREAT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movl	$448, %edx                      ## imm = 0x1C0
	callq	_open
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movl	%eax, %r15d
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	(%r13), %rdx
	movl	%eax, %edi
	movq	%r12, %rsi
	callq	_write
	xorl	%ebx, %ebx
	cmpl	$-1, %eax
	setne	%bl
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	movl	%eax, %edx
	callq	_ATF_REQUIRE_MSG
	movq	(%r13), %rsi
	movq	_PROT_READ@GOTPCREL(%rip), %rax
	movq	_PROT_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_MAP_FILE@GOTPCREL(%rip), %rax
	movq	_MAP_PRIVATE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	xorl	%edi, %edi
	movl	%r15d, %r8d
	xorl	%r9d, %r9d
	callq	_mmap
	movq	%rax, %r13
	movq	_MAP_FAILED@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rax
	je	LBB0_5
## %bb.6:
	movq	_off@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rsi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r15d, %edi
	callq	_lseek
	cmpq	(%rbx), %rax
	jne	LBB0_7
## %bb.8:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_strlen
	movl	%r15d, %edi
	movq	%rbx, %rsi
	movq	%rax, %rbx
	movq	%rax, %rdx
	callq	_write
	cmpl	%ebx, %eax
	jne	LBB0_9
## %bb.10:
	movq	_page@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r13, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_msync
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	leaq	L_.str.5(%rip), %rbx
	jmp	LBB0_13
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_3:
	movq	%r12, %rdi
	callq	_free
	leaq	L_.str(%rip), %rbx
	jmp	LBB0_15
LBB0_5:
	leaq	L_.str.2(%rip), %rbx
	jmp	LBB0_13
LBB0_7:
	leaq	L_.str.3(%rip), %rbx
	jmp	LBB0_13
LBB0_9:
	leaq	L_.str.4(%rip), %rbx
	jmp	LBB0_13
LBB0_12:
	movq	_off@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	%r13, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%rbx, %rdx
	callq	_memcmp
	testq	%rax, %rax
	leaq	L_.str.6(%rip), %rbx
	cmoveq	%rax, %rbx
LBB0_13:
	movq	%r12, %rdi
	callq	_free
	movl	%r15d, %edi
	callq	_close
	movq	_path@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_unlink
	cmpq	(%r14), %r13
	je	LBB0_15
## %bb.14:
	movq	_page@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r13, %rdi
	callq	_munmap
LBB0_15:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAP_FAILED,8,3                 ## @MAP_FAILED
	.comm	_page,8,3                       ## @page
	.comm	_path,4,2                       ## @path
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to open"

L_.str.1:                               ## @.str.1
	.asciz	"write(2) failed: %s"

	.comm	_errno,4,2                      ## @errno
	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_PROT_WRITE,4,2                 ## @PROT_WRITE
	.comm	_MAP_FILE,4,2                   ## @MAP_FILE
	.comm	_MAP_PRIVATE,4,2                ## @MAP_PRIVATE
L_.str.2:                               ## @.str.2
	.asciz	"failed to map"

	.comm	_off,8,3                        ## @off
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
L_.str.3:                               ## @.str.3
	.asciz	"failed to seek"

L_.str.4:                               ## @.str.4
	.asciz	"failed to write garbage"

L_.str.5:                               ## @.str.5
	.asciz	"failed to msync"

L_.str.6:                               ## @.str.6
	.asciz	"msync did not synchronize"

	.no_dead_strip	_msync_sync
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msync_sync
_msync_sync:                            ; @msync_sync
	.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
	mov	x22, x1
	mov	x21, x0
Lloh0:
	adrp	x25, _page@GOTPAGE
Lloh1:
	ldr	x25, [x25, _page@GOTPAGEOFF]
	ldr	x20, [x25]
	mov	x0, x20
	bl	_malloc
	cbz	x0, LBB0_7
; %bb.1:
	mov	x19, x0
	mov	w1, #120
	mov	x2, x20
	bl	_memset
Lloh2:
	adrp	x26, _path@GOTPAGE
Lloh3:
	ldr	x26, [x26, _path@GOTPAGEOFF]
Lloh4:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
	ldr	w0, [x26]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _O_CREAT@GOTPAGE
Lloh8:
	ldr	x9, [x9, _O_CREAT@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	w2, #448
	bl	_open
	tbnz	w0, #31, LBB0_8
; %bb.2:
	mov	x20, x0
	ldr	x2, [x25]
	mov	x1, x19
	bl	_write
	cmn	w0, #1
	cset	w23, ne
Lloh10:
	adrp	x8, _errno@GOTPAGE
Lloh11:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	bl	_strerror
	mov	x2, x0
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x23
	bl	_ATF_REQUIRE_MSG
	ldr	x1, [x25]
Lloh15:
	adrp	x8, _PROT_READ@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PROT_READ@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _PROT_WRITE@GOTPAGE
Lloh19:
	ldr	x9, [x9, _PROT_WRITE@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
Lloh21:
	adrp	x10, _MAP_FILE@GOTPAGE
Lloh22:
	ldr	x10, [x10, _MAP_FILE@GOTPAGEOFF]
	orr	w2, w9, w8
Lloh23:
	ldr	w8, [x10]
Lloh24:
	adrp	x9, _MAP_PRIVATE@GOTPAGE
Lloh25:
	ldr	x9, [x9, _MAP_PRIVATE@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	orr	w3, w9, w8
	mov	x0, #0
	mov	x4, x20
	mov	w5, #0
	bl	_mmap
	mov	x23, x0
Lloh27:
	adrp	x27, _MAP_FAILED@GOTPAGE
Lloh28:
	ldr	x27, [x27, _MAP_FAILED@GOTPAGEOFF]
	ldr	x8, [x27]
	cmp	x0, x8
	b.eq	LBB0_9
; %bb.3:
Lloh29:
	adrp	x28, _off@GOTPAGE
Lloh30:
	ldr	x28, [x28, _off@GOTPAGEOFF]
	ldr	x1, [x28]
Lloh31:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh32:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh33:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_lseek
	ldr	x8, [x28]
	cmp	x0, x8
	b.ne	LBB0_10
; %bb.4:
	mov	x0, x21
	bl	_strlen
	mov	x24, x0
	mov	x0, x20
	mov	x1, x21
	mov	x2, x24
	bl	_write
	cmp	w0, w24
	b.ne	LBB0_11
; %bb.5:
	ldr	x1, [x25]
	mov	x0, x23
	mov	x2, x22
	bl	_msync
	cbz	x0, LBB0_12
; %bb.6:
Lloh34:
	adrp	x21, l_.str.5@PAGE
Lloh35:
	add	x21, x21, l_.str.5@PAGEOFF
	b	LBB0_13
LBB0_7:
	mov	x21, #0
	b	LBB0_15
LBB0_8:
	mov	x0, x19
	bl	_free
Lloh36:
	adrp	x21, l_.str@PAGE
Lloh37:
	add	x21, x21, l_.str@PAGEOFF
	b	LBB0_15
LBB0_9:
Lloh38:
	adrp	x21, l_.str.2@PAGE
Lloh39:
	add	x21, x21, l_.str.2@PAGEOFF
	b	LBB0_13
LBB0_10:
Lloh40:
	adrp	x21, l_.str.3@PAGE
Lloh41:
	add	x21, x21, l_.str.3@PAGEOFF
	b	LBB0_13
LBB0_11:
Lloh42:
	adrp	x21, l_.str.4@PAGE
Lloh43:
	add	x21, x21, l_.str.4@PAGEOFF
	b	LBB0_13
LBB0_12:
	ldr	x8, [x28]
	add	x0, x23, x8
	mov	x1, x21
	mov	x2, x24
	bl	_memcmp
Lloh44:
	adrp	x8, l_.str.6@PAGE
Lloh45:
	add	x8, x8, l_.str.6@PAGEOFF
	cmp	x0, #0
	csel	x21, xzr, x8, eq
LBB0_13:
	mov	x0, x19
	bl	_free
	mov	x0, x20
	bl	_close
	ldr	w0, [x26]
	bl	_unlink
	ldr	x8, [x27]
	cmp	x23, x8
	b.eq	LBB0_15
; %bb.14:
	ldr	x1, [x25]
	mov	x0, x23
	bl	_munmap
LBB0_15:
	mov	x0, x21
	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	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpAdd	Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.comm	_MAP_FAILED,8,3                 ; @MAP_FAILED
	.comm	_page,8,3                       ; @page
	.comm	_path,4,2                       ; @path
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to open"

l_.str.1:                               ; @.str.1
	.asciz	"write(2) failed: %s"

	.comm	_errno,4,2                      ; @errno
	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_PROT_WRITE,4,2                 ; @PROT_WRITE
	.comm	_MAP_FILE,4,2                   ; @MAP_FILE
	.comm	_MAP_PRIVATE,4,2                ; @MAP_PRIVATE
l_.str.2:                               ; @.str.2
	.asciz	"failed to map"

	.comm	_off,8,3                        ; @off
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
l_.str.3:                               ; @.str.3
	.asciz	"failed to seek"

l_.str.4:                               ; @.str.4
	.asciz	"failed to write garbage"

l_.str.5:                               ; @.str.5
	.asciz	"failed to msync"

l_.str.6:                               ; @.str.6
	.asciz	"msync did not synchronize"

	.no_dead_strip	_msync_sync
.subsections_via_symbols
