	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_moveifchanged                  ## -- Begin function moveifchanged
	.p2align	4, 0x90
_moveifchanged:                         ## @moveifchanged
	.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	%rsi, %r14
	movq	%rdi, %r15
	movq	_O_RDONLY@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_open
	movl	%eax, %r13d
	testl	%eax, %eax
	jns	LBB0_2
## %bb.1:
	movq	_EX_OSERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_err
LBB0_2:
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_open
	testl	%eax, %eax
	js	LBB0_13
## %bb.3:
	movl	%eax, %r12d
	leaq	-64(%rbp), %rsi
	movl	%r13d, %edi
	callq	_fstat
	testq	%rax, %rax
	jns	LBB0_5
## %bb.4:
	movq	_EX_OSERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_err
LBB0_5:
	leaq	-56(%rbp), %rsi
	movl	%r12d, %edi
	callq	_fstat
	testq	%rax, %rax
	jns	LBB0_7
## %bb.6:
	movq	_EX_OSERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_err
LBB0_7:
	movq	-64(%rbp), %rbx
	cmpq	-56(%rbp), %rbx
	jne	LBB0_13
## %bb.8:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	_PROT_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MAP_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%edi, %edi
	movq	%rbx, %rsi
	movl	%r13d, %r8d
	xorl	%r9d, %r9d
	callq	_mmap
	movq	_MAP_FAILED@GOTPCREL(%rip), %r13
	movq	%rax, %r14
	cmpq	(%r13), %rax
	jne	LBB0_10
## %bb.9:
	movq	_EX_OSERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_err
LBB0_10:
	movq	_PROT_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MAP_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%edi, %edi
	movq	%rbx, %rsi
	movl	%r12d, %r8d
	xorl	%r9d, %r9d
	callq	_mmap
	movq	%rax, %r12
	cmpq	(%r13), %rax
	jne	LBB0_12
## %bb.11:
	movq	_EX_OSERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_err
LBB0_12:
	movq	%r14, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	_memcmp
	movl	%eax, %r13d
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_munmap
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_munmap
	testl	%r13d, %r13d
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_15
LBB0_13:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_rename
	testq	%rax, %rax
	js	LBB0_14
LBB0_16:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	_EX_OSERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdx
	movq	%r14, %rcx
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_err                            ## TAILCALL
LBB0_15:
	movq	%r15, %rdi
	callq	_unlink
	testq	%rax, %rax
	jns	LBB0_16
## %bb.17:
	movq	_EX_OSERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rsi
	movq	%r15, %rdx
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_err                            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_EX_OSERR,4,2                   ## @EX_OSERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"moveifchanged open(%s)"

L_.str.1:                               ## @.str.1
	.asciz	"moveifchanged fstat(%s)"

	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_MAP_SHARED,4,2                 ## @MAP_SHARED
	.comm	_MAP_FAILED,8,3                 ## @MAP_FAILED
L_.str.2:                               ## @.str.2
	.asciz	"mmap %s"

L_.str.3:                               ## @.str.3
	.asciz	"rename(%s, %s)"

L_.str.4:                               ## @.str.4
	.asciz	"unlink(%s)"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_moveifchanged                  ; -- Begin function moveifchanged
	.p2align	2
_moveifchanged:                         ; @moveifchanged
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x21, _O_RDONLY@GOTPAGE
Lloh1:
	ldr	x21, [x21, _O_RDONLY@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_open
	mov	x22, x0
	tbz	w0, #31, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _EX_OSERR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EX_OSERR@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_err
LBB0_2:
	ldr	w1, [x21]
	mov	x0, x20
	bl	_open
	tbnz	w0, #31, LBB0_13
; %bb.3:
	mov	x21, x0
	add	x1, sp, #24
	mov	x0, x22
	bl	_fstat
	tbz	x0, #63, LBB0_5
; %bb.4:
Lloh7:
	adrp	x8, _EX_OSERR@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EX_OSERR@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x19
	bl	_err
LBB0_5:
	add	x1, sp, #16
	mov	x0, x21
	bl	_fstat
	tbz	x0, #63, LBB0_7
; %bb.6:
Lloh12:
	adrp	x8, _EX_OSERR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EX_OSERR@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_err
LBB0_7:
	ldp	x8, x23, [sp, #16]
	cmp	x23, x8
	b.ne	LBB0_13
; %bb.8:
Lloh17:
	adrp	x24, _PROT_READ@GOTPAGE
Lloh18:
	ldr	x24, [x24, _PROT_READ@GOTPAGEOFF]
	ldr	w2, [x24]
Lloh19:
	adrp	x25, _MAP_SHARED@GOTPAGE
Lloh20:
	ldr	x25, [x25, _MAP_SHARED@GOTPAGEOFF]
	ldr	w3, [x25]
	mov	x0, #0
	mov	x1, x23
	mov	x4, x22
	mov	w5, #0
	bl	_mmap
	mov	x22, x0
Lloh21:
	adrp	x26, _MAP_FAILED@GOTPAGE
Lloh22:
	ldr	x26, [x26, _MAP_FAILED@GOTPAGEOFF]
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_10
; %bb.9:
Lloh23:
	adrp	x8, _EX_OSERR@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EX_OSERR@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
Lloh26:
	adrp	x1, l_.str.2@PAGE
Lloh27:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x19
	bl	_err
LBB0_10:
	ldr	w2, [x24]
	ldr	w3, [x25]
	mov	x0, #0
	mov	x1, x23
	mov	x4, x21
	mov	w5, #0
	bl	_mmap
	mov	x21, x0
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_12
; %bb.11:
Lloh28:
	adrp	x8, _EX_OSERR@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EX_OSERR@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
Lloh31:
	adrp	x1, l_.str.2@PAGE
Lloh32:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x20
	bl	_err
LBB0_12:
	mov	x0, x22
	mov	x1, x21
	mov	x2, x23
	bl	_memcmp
	mov	x24, x0
	mov	x0, x22
	mov	x1, x23
	bl	_munmap
	mov	x0, x21
	mov	x1, x23
	bl	_munmap
	cbz	w24, LBB0_16
LBB0_13:
	mov	x0, x19
	mov	x1, x20
	bl	_rename
	tbz	x0, #63, LBB0_15
; %bb.14:
Lloh33:
	adrp	x8, _EX_OSERR@GOTPAGE
Lloh34:
	ldr	x8, [x8, _EX_OSERR@GOTPAGEOFF]
Lloh35:
	ldr	w0, [x8]
	str	x20, [sp]
Lloh36:
	adrp	x1, l_.str.3@PAGE
Lloh37:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, x19
	bl	_err
LBB0_15:
	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
	add	sp, sp, #112
	ret
LBB0_16:
	mov	x0, x19
	bl	_unlink
	tbz	x0, #63, LBB0_15
; %bb.17:
Lloh38:
	adrp	x8, _EX_OSERR@GOTPAGE
Lloh39:
	ldr	x8, [x8, _EX_OSERR@GOTPAGEOFF]
Lloh40:
	ldr	w0, [x8]
Lloh41:
	adrp	x1, l_.str.4@PAGE
Lloh42:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x2, 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
	add	sp, sp, #112
	b	_err
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_EX_OSERR,4,2                   ; @EX_OSERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"moveifchanged open(%s)"

l_.str.1:                               ; @.str.1
	.asciz	"moveifchanged fstat(%s)"

	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_MAP_SHARED,4,2                 ; @MAP_SHARED
	.comm	_MAP_FAILED,8,3                 ; @MAP_FAILED
l_.str.2:                               ; @.str.2
	.asciz	"mmap %s"

l_.str.3:                               ; @.str.3
	.asciz	"rename(%s, %s)"

l_.str.4:                               ; @.str.4
	.asciz	"unlink(%s)"

.subsections_via_symbols
