	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_test_flopen_lock_self          ## -- Begin function test_flopen_lock_self
	.p2align	4, 0x90
_test_flopen_lock_self:                 ## @test_flopen_lock_self
	.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
	.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
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	%eax, %ebx
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	(%r14), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_flopen
	testl	%eax, %eax
	js	LBB0_4
## %bb.3:
	movl	%eax, %edi
	callq	_close
	leaq	L_.str.1(%rip), %r14
LBB0_4:
	movl	%ebx, %edi
	callq	_close
	jmp	LBB0_5
LBB0_1:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	movq	%rax, %r14
LBB0_5:
	leaq	L_.str(%rip), %rdi
	callq	_unlink
	movq	%r14, %rax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"test_flopen_lock_self"

	.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	"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_self          ; -- Begin function test_flopen_lock_self
	.p2align	2
_test_flopen_lock_self:                 ; @test_flopen_lock_self
	.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
	tbnz	w0, #31, LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	w8, [x20]
Lloh7:
	adrp	x9, _O_NONBLOCK@GOTPAGE
Lloh8:
	ldr	x9, [x9, _O_NONBLOCK@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	orr	w1, w9, w8
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_flopen
	tbnz	w0, #31, LBB0_4
; %bb.2:
	bl	_close
Lloh12:
	adrp	x20, l_.str.1@PAGE
Lloh13:
	add	x20, x20, l_.str.1@PAGEOFF
	b	LBB0_5
LBB0_3:
Lloh14:
	adrp	x8, _errno@GOTPAGE
Lloh15:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_strerror
	mov	x20, x0
	b	LBB0_6
LBB0_4:
	mov	x20, #0
LBB0_5:
	mov	x0, x19
	bl	_close
LBB0_6:
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	bl	_unlink
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"test_flopen_lock_self"

	.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	"second open succeeded"

.subsections_via_symbols
