	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cleanopen                      ## -- Begin function cleanopen
	.p2align	4, 0x90
_cleanopen:                             ## @cleanopen
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_ptyslavefd@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	$-1, %eax
	jne	LBB0_4
## %bb.1:
	movq	%rdi, %rbx
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_chown
	movq	%rbx, %rdi
	movl	$384, %esi                      ## imm = 0x180
	callq	_chmod
	movq	_O_RDWR@GOTPCREL(%rip), %r14
	movq	_O_NOCTTY@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	orl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_open
	testl	%eax, %eax
	js	LBB0_2
## %bb.3:
	movq	_SIGHUP@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movq	_SIG_IGN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_signal
	movl	(%r12), %edi
	movq	_SIG_DFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_signal
	movl	(%r15), %esi
	orl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_open
	testl	%eax, %eax
	movl	$-1, %ecx
	cmovsl	%ecx, %eax
	jmp	LBB0_4
LBB0_2:
	movl	$-1, %eax
LBB0_4:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ptyslavefd,4,2                 ## @ptyslavefd
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_O_NOCTTY,4,2                   ## @O_NOCTTY
	.comm	_SIGHUP,4,2                     ## @SIGHUP
	.comm	_SIG_IGN,4,2                    ## @SIG_IGN
	.comm	_SIG_DFL,4,2                    ## @SIG_DFL
	.comm	_TCVHUP,4,2                     ## @TCVHUP
	.comm	_really_stream,4,2              ## @really_stream
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cleanopen                      ; -- Begin function cleanopen
	.p2align	2
_cleanopen:                             ; @cleanopen
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
Lloh0:
	adrp	x8, _ptyslavefd@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ptyslavefd@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	cmn	w0, #1
	b.ne	LBB0_4
; %bb.1:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #0
	bl	_chown
	mov	x0, x19
	mov	w1, #384
	bl	_chmod
Lloh3:
	adrp	x20, _O_RDWR@GOTPAGE
Lloh4:
	ldr	x20, [x20, _O_RDWR@GOTPAGEOFF]
	ldr	w8, [x20]
Lloh5:
	adrp	x21, _O_NOCTTY@GOTPAGE
Lloh6:
	ldr	x21, [x21, _O_NOCTTY@GOTPAGEOFF]
	ldr	w9, [x21]
	orr	w1, w9, w8
	mov	x0, x19
	bl	_open
	tbnz	w0, #31, LBB0_3
; %bb.2:
Lloh7:
	adrp	x22, _SIGHUP@GOTPAGE
Lloh8:
	ldr	x22, [x22, _SIGHUP@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh9:
	adrp	x8, _SIG_IGN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SIG_IGN@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_signal
	ldr	w0, [x22]
Lloh12:
	adrp	x8, _SIG_DFL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SIG_DFL@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	bl	_signal
	ldr	w8, [x20]
	ldr	w9, [x21]
	orr	w1, w9, w8
	mov	x0, x19
	bl	_open
	cmp	w0, #0
	csinv	w0, w0, wzr, ge
	b	LBB0_4
LBB0_3:
	mov	w0, #-1
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ptyslavefd,4,2                 ; @ptyslavefd
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_O_NOCTTY,4,2                   ; @O_NOCTTY
	.comm	_SIGHUP,4,2                     ; @SIGHUP
	.comm	_SIG_IGN,4,2                    ; @SIG_IGN
	.comm	_SIG_DFL,4,2                    ; @SIG_DFL
	.comm	_TCVHUP,4,2                     ; @TCVHUP
	.comm	_really_stream,4,2              ; @really_stream
.subsections_via_symbols
