	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pty_open
_pty_open:                              ## @pty_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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.1:
	movq	%rdi, %r14
	cmpq	$0, 8(%rdi)
	je	LBB0_6
## %bb.2:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	_TTY_OTHER_CLOSED@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	%r14, %rsi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_6
## %bb.3:
	movq	_TTY_PTY_LOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	8(%r14), %rsi
	addq	$4, %rsi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_6
## %bb.4:
	movq	8(%r14), %rsi
	cmpl	$1, (%rsi)
	jne	LBB0_6
## %bb.5:
	movl	(%r15), %edi
	addq	$4, %rsi
	callq	_clear_bit
	movq	_TTY_THROTTLED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_set_bit
	xorl	%ebx, %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_EIO,4,2                        ## @EIO
	.comm	_TTY_OTHER_CLOSED,4,2           ## @TTY_OTHER_CLOSED
	.comm	_TTY_PTY_LOCK,4,2               ## @TTY_PTY_LOCK
	.comm	_TTY_THROTTLED,4,2              ## @TTY_THROTTLED
	.no_dead_strip	_pty_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pty_open
_pty_open:                              ; @pty_open
	.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
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w20, w8
	cbz	x0, LBB0_6
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_6
; %bb.2:
Lloh3:
	adrp	x8, _EIO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w20, w8
Lloh6:
	adrp	x21, _TTY_OTHER_CLOSED@GOTPAGE
Lloh7:
	ldr	x21, [x21, _TTY_OTHER_CLOSED@GOTPAGEOFF]
	ldr	w0, [x21]
	mov	x1, x19
	bl	_test_bit
	cbnz	x0, LBB0_6
; %bb.3:
Lloh8:
	adrp	x8, _TTY_PTY_LOCK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _TTY_PTY_LOCK@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	ldr	x8, [x19, #8]
	add	x1, x8, #4
	bl	_test_bit
	cbnz	x0, LBB0_6
; %bb.4:
	ldr	x8, [x19, #8]
	ldr	w9, [x8]
	cmp	w9, #1
	b.ne	LBB0_6
; %bb.5:
	ldr	w0, [x21]
	add	x1, x8, #4
	bl	_clear_bit
Lloh11:
	adrp	x8, _TTY_THROTTLED@GOTPAGE
Lloh12:
	ldr	x8, [x8, _TTY_THROTTLED@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_set_bit
	mov	w20, #0
LBB0_6:
	mov	x0, x20
	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	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_EIO,4,2                        ; @EIO
	.comm	_TTY_OTHER_CLOSED,4,2           ; @TTY_OTHER_CLOSED
	.comm	_TTY_PTY_LOCK,4,2               ; @TTY_PTY_LOCK
	.comm	_TTY_THROTTLED,4,2              ; @TTY_THROTTLED
	.no_dead_strip	_pty_open
.subsections_via_symbols
