	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_test_flopen_lock_other         ## -- Begin function test_flopen_lock_other
	.p2align	4, 0x90
_test_flopen_lock_other:                ## @test_flopen_lock_other
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	leaq	L_.str(%rip), %rbx
	movq	%rbx, %rdi
	callq	_unlink
	movq	_O_RDWR@GOTPCREL(%rip), %r14
	movq	_O_CREAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	(%r14), %esi
	movq	%rbx, %rdi
	movl	$416, %edx                      ## imm = 0x1A0
	xorl	%eax, %eax
	callq	_flopen
	movl	%eax, -24(%rbp)
	cmpl	$0, -24(%rbp)
	js	LBB0_1
## %bb.2:
	movl	$-42, -20(%rbp)
	xorl	%eax, %eax
	callq	_vfork
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movl	-20(%rbp), %eax
	xorl	%ecx, %ecx
	cmpl	$-42, %eax
	leaq	L_.str.1(%rip), %rax
	cmoveq	%rax, %rcx
	cmpl	$0, -20(%rbp)
	leaq	L_.str.2(%rip), %rbx
	cmovsq	%rcx, %rbx
	movl	-24(%rbp), %edi
	callq	_close
	jmp	LBB0_4
LBB0_1:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	movq	%rax, %rbx
LBB0_4:
	leaq	L_.str(%rip), %rdi
	callq	_unlink
	movq	%rbx, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_5:
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	(%r14), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_flopen
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %edi
	callq	_close
	xorl	%edi, %edi
	callq	__exit
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"test_flopen_lock_other"

	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_errno,4,2                      ## @errno
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
L_.str.1:                               ## @.str.1
	.asciz	"vfork() doesn't work as expected"

L_.str.2:                               ## @.str.2
	.asciz	"second open succeeded"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_test_flopen_lock_other         ; -- Begin function test_flopen_lock_other
	.p2align	2
_test_flopen_lock_other:                ; @test_flopen_lock_other
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x19, l_.str@PAGE
Lloh1:
	add	x19, x19, l_.str@PAGEOFF
	mov	x0, x19
	bl	_unlink
Lloh2:
	adrp	x20, _O_RDWR@GOTPAGE
Lloh3:
	ldr	x20, [x20, _O_RDWR@GOTPAGEOFF]
	ldr	w8, [x20]
Lloh4:
	adrp	x9, _O_CREAT@GOTPAGE
Lloh5:
	ldr	x9, [x9, _O_CREAT@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	w8, #416
	str	x8, [sp]
	mov	x0, x19
	bl	_flopen
	str	w0, [sp, #12]
	ldr	w8, [sp, #12]
	tbnz	w8, #31, LBB0_3
; %bb.1:
	mov	w8, #-42
	str	w8, [sp, #8]
	bl	_vfork
	cbz	x0, LBB0_5
; %bb.2:
	ldr	w8, [sp, #8]
Lloh7:
	adrp	x9, l_.str.1@PAGE
Lloh8:
	add	x9, x9, l_.str.1@PAGEOFF
	cmn	w8, #42
	csel	x8, x9, xzr, eq
	ldr	w9, [sp, #8]
Lloh9:
	adrp	x10, l_.str.2@PAGE
Lloh10:
	add	x10, x10, l_.str.2@PAGEOFF
	cmp	w9, #0
	csel	x19, x10, x8, ge
	ldr	w0, [sp, #12]
	bl	_close
	b	LBB0_4
LBB0_3:
Lloh11:
	adrp	x8, _errno@GOTPAGE
Lloh12:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	bl	_strerror
	mov	x19, x0
LBB0_4:
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	bl	_unlink
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_5:
	ldr	w8, [x20]
Lloh16:
	adrp	x9, _O_NONBLOCK@GOTPAGE
Lloh17:
	ldr	x9, [x9, _O_NONBLOCK@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	orr	w1, w9, w8
Lloh19:
	adrp	x0, l_.str@PAGE
Lloh20:
	add	x0, x0, l_.str@PAGEOFF
	bl	_flopen
	str	w0, [sp, #8]
	ldr	w0, [sp, #8]
	bl	_close
	mov	w0, #0
	bl	__exit
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"test_flopen_lock_other"

	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_errno,4,2                      ; @errno
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
l_.str.1:                               ; @.str.1
	.asciz	"vfork() doesn't work as expected"

l_.str.2:                               ; @.str.2
	.asciz	"second open succeeded"

.subsections_via_symbols
