	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function futx_open
_futx_open:                             ## @futx_open
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_O_CREAT@GOTPCREL(%rip), %rax
	movq	_O_RDWR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_O_EXLOCK@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	_O_CLOEXEC@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movl	$420, %edx                      ## imm = 0x1A4
	callq	__open
	testl	%eax, %eax
	js	LBB0_6
## %bb.1:
	movl	%eax, %ebx
	leaq	-16(%rbp), %rsi
	movl	%eax, %edi
	callq	__fstat
	cmpl	$-1, %eax
	je	LBB0_4
## %bb.2:
	testb	$3, -16(%rbp)
	je	LBB0_4
## %bb.3:
	movl	%ebx, %edi
	callq	__close
	movq	_EFTYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_6
LBB0_4:
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	callq	_fdopen
	testq	%rax, %rax
	jne	LBB0_7
## %bb.5:
	movl	%ebx, %edi
	callq	__close
LBB0_6:
	xorl	%eax, %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_O_EXLOCK,4,2                   ## @O_EXLOCK
	.comm	_O_CLOEXEC,4,2                  ## @O_CLOEXEC
	.comm	_EFTYPE,4,2                     ## @EFTYPE
	.comm	_errno,4,2                      ## @errno
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"r+"

	.no_dead_strip	_futx_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function futx_open
_futx_open:                             ; @futx_open
	.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	x8, _O_CREAT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_CREAT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _O_RDWR@GOTPAGE
Lloh4:
	ldr	x9, [x9, _O_RDWR@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _O_EXLOCK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _O_EXLOCK@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh9:
	adrp	x9, _O_CLOEXEC@GOTPAGE
Lloh10:
	ldr	x9, [x9, _O_CLOEXEC@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w1, w8, w9
	mov	w2, #420
	bl	__open
	tbnz	w0, #31, LBB0_6
; %bb.1:
	mov	x19, x0
	add	x1, sp, #8
	bl	__fstat
	cmn	w0, #1
	b.eq	LBB0_4
; %bb.2:
	ldrb	w8, [sp, #8]
	tst	w8, #0x3
	b.eq	LBB0_4
; %bb.3:
	mov	x0, x19
	bl	__close
	mov	x0, #0
Lloh12:
	adrp	x8, _EFTYPE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EFTYPE@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _errno@GOTPAGE
Lloh16:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh17:
	str	w8, [x9]
	b	LBB0_7
LBB0_4:
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_fdopen
	cbnz	x0, LBB0_7
; %bb.5:
	mov	x0, x19
	bl	__close
LBB0_6:
	mov	x0, #0
LBB0_7:
	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	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_O_EXLOCK,4,2                   ; @O_EXLOCK
	.comm	_O_CLOEXEC,4,2                  ; @O_CLOEXEC
	.comm	_EFTYPE,4,2                     ; @EFTYPE
	.comm	_errno,4,2                      ; @errno
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"r+"

	.no_dead_strip	_futx_open
.subsections_via_symbols
