	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function n_tty_write
_n_tty_write:                           ## @n_tty_write
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r13
	movq	%rdx, %rbx
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	_wait@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_current@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_DECLARE_WAITQUEUE
	movq	%r15, %rdi
	callq	_L_TOSTOP
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	8(%r12), %rax
	movq	(%rax), %rax
	movq	_redirected_tty_write@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_3
## %bb.2:
	movq	%r15, %rdi
	callq	_tty_check_change
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_11
LBB0_3:
	movq	%r15, %rdi
	callq	_process_echoes
	leaq	16(%r15), %rdi
	movq	_wait@GOTPCREL(%rip), %rsi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_add_wait_queue
	movq	_TASK_INTERRUPTIBLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_set_current_state
	movq	_current@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_signal_pending
	testq	%rax, %rax
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_34
LBB0_4:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
LBB0_5:
	xorl	%r12d, %r12d
LBB0_6:
	subl	(%rax), %r12d
LBB0_7:
	movq	_TASK_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	___set_current_state
	movq	_wait@GOTPCREL(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_remove_wait_queue
	movq	%rbx, %r14
	subq	-48(%rbp), %r14                 ## 8-byte Folded Reload
	cmpq	%r13, %r14
	je	LBB0_10
## %bb.8:
	cmpq	$0, 8(%r15)
	je	LBB0_10
## %bb.9:
	movq	_TTY_DO_WRITE_WAKEUP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_set_bit
LBB0_10:
	cmpq	-48(%rbp), %rbx                 ## 8-byte Folded Reload
	cmovel	%r12d, %r14d
LBB0_11:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_34 Depth=1
	movq	32(%r15), %rax
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_34 Depth=1
	cmpl	$0, (%rax)
	je	LBB0_35
LBB0_14:                                ##   in Loop: Header=BB0_34 Depth=1
	movq	%r15, %rdi
	callq	_O_OPOST
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_34 Depth=1
	movq	_TTY_HW_COOK_OUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_test_bit
	testl	%eax, %eax
	je	LBB0_22
LBB0_16:                                ##   in Loop: Header=BB0_34 Depth=1
	testq	%r13, %r13
	je	LBB0_36
## %bb.17:                              ##   in Loop: Header=BB0_34 Depth=1
	movq	%r12, %r14
	.p2align	4, 0x90
LBB0_18:                                ##   Parent Loop BB0_34 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	24(%r15), %rax
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	%r13, %rdx
	callq	*(%rax)
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_7
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=2
	je	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_18 Depth=2
	movl	%r12d, %eax
	addq	%rax, %rbx
	subq	%rax, %r13
	jne	LBB0_18
	jmp	LBB0_36
LBB0_21:                                ##   in Loop: Header=BB0_34 Depth=1
	movq	%r14, %r12
	movq	_current@GOTPCREL(%rip), %r14
	jmp	LBB0_31
LBB0_22:                                ##   in Loop: Header=BB0_34 Depth=1
	testq	%r13, %r13
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_27
	.p2align	4, 0x90
LBB0_23:                                ##   Parent Loop BB0_34 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	%r13, %rdx
	callq	_process_output_block
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_33
## %bb.24:                              ##   in Loop: Header=BB0_23 Depth=2
	movl	%r12d, %eax
	addq	%rax, %rbx
	subq	%rax, %r13
	je	LBB0_27
## %bb.25:                              ##   in Loop: Header=BB0_23 Depth=2
	movzbl	(%rbx), %edi
	movq	%r15, %rsi
	callq	_process_output
	testq	%rax, %rax
	js	LBB0_28
## %bb.26:                              ##   in Loop: Header=BB0_23 Depth=2
	incq	%rbx
	decq	%r13
	jne	LBB0_23
LBB0_27:                                ##   in Loop: Header=BB0_34 Depth=1
	xorl	%r13d, %r13d
LBB0_28:                                ##   in Loop: Header=BB0_34 Depth=1
	movq	24(%r15), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	LBB0_30
## %bb.29:                              ##   in Loop: Header=BB0_34 Depth=1
	movq	%r15, %rdi
	callq	*%rax
LBB0_30:                                ##   in Loop: Header=BB0_34 Depth=1
	testq	%r13, %r13
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	je	LBB0_36
LBB0_31:                                ##   in Loop: Header=BB0_34 Depth=1
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	jne	LBB0_37
## %bb.32:                              ##   in Loop: Header=BB0_34 Depth=1
	xorl	%eax, %eax
	callq	_schedule
	movq	_TASK_INTERRUPTIBLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_set_current_state
	movl	(%r14), %edi
	callq	_signal_pending
	testq	%rax, %rax
	je	LBB0_34
	jmp	LBB0_4
LBB0_33:                                ##   in Loop: Header=BB0_34 Depth=1
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r12d, %eax
	je	LBB0_28
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_34:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_23 Depth 2
                                        ##     Child Loop BB0_18 Depth 2
	movq	%r12, %rdi
	callq	_tty_hung_up_p
	testq	%rax, %rax
	je	LBB0_12
LBB0_35:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_36:
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	jmp	LBB0_7
LBB0_37:
	xorl	%r12d, %r12d
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_wait,4,2                       ## @wait
	.comm	_current,4,2                    ## @current
	.comm	_redirected_tty_write,8,3       ## @redirected_tty_write
	.comm	_TASK_INTERRUPTIBLE,4,2         ## @TASK_INTERRUPTIBLE
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.comm	_EIO,4,2                        ## @EIO
	.comm	_TTY_HW_COOK_OUT,4,2            ## @TTY_HW_COOK_OUT
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_TASK_RUNNING,4,2               ## @TASK_RUNNING
	.comm	_TTY_DO_WRITE_WAKEUP,4,2        ## @TTY_DO_WRITE_WAKEUP
	.no_dead_strip	_n_tty_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function n_tty_write
_n_tty_write:                           ; @n_tty_write
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x3
	mov	x19, x2
	mov	x24, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _wait@GOTPAGE
Lloh1:
	ldr	x8, [x8, _wait@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x26, _current@GOTPAGE
Lloh4:
	ldr	x26, [x26, _current@GOTPAGEOFF]
	ldr	w1, [x26]
	bl	_DECLARE_WAITQUEUE
	mov	x0, x20
	bl	_L_TOSTOP
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x8, [x24, #8]
	ldr	x8, [x8]
Lloh5:
	adrp	x9, _redirected_tty_write@GOTPAGE
Lloh6:
	ldr	x9, [x9, _redirected_tty_write@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_3
; %bb.2:
	mov	x0, x20
	bl	_tty_check_change
	cbnz	w0, LBB0_11
LBB0_3:
	mov	x0, x20
	bl	_process_echoes
	add	x22, x20, #16
Lloh8:
	adrp	x1, _wait@GOTPAGE
Lloh9:
	ldr	x1, [x1, _wait@GOTPAGEOFF]
	mov	x0, x22
	bl	_add_wait_queue
Lloh10:
	adrp	x27, _TASK_INTERRUPTIBLE@GOTPAGE
Lloh11:
	ldr	x27, [x27, _TASK_INTERRUPTIBLE@GOTPAGEOFF]
	ldr	w0, [x27]
	bl	_set_current_state
	ldr	w0, [x26]
	bl	_signal_pending
	cbz	x0, LBB0_12
; %bb.4:
	mov	x23, x19
LBB0_5:
Lloh12:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w25, w8
LBB0_7:
Lloh14:
	adrp	x8, _TASK_RUNNING@GOTPAGE
Lloh15:
	ldr	x8, [x8, _TASK_RUNNING@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	___set_current_state
Lloh17:
	adrp	x1, _wait@GOTPAGE
Lloh18:
	ldr	x1, [x1, _wait@GOTPAGEOFF]
	mov	x0, x22
	bl	_remove_wait_queue
	sub	x22, x23, x19
	cmp	x22, x21
	b.eq	LBB0_10
; %bb.8:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_10
; %bb.9:
Lloh19:
	adrp	x8, _TTY_DO_WRITE_WAKEUP@GOTPAGE
Lloh20:
	ldr	x8, [x8, _TTY_DO_WRITE_WAKEUP@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_set_bit
LBB0_10:
	cmp	x23, x19
	csel	w0, w25, w22, eq
LBB0_11:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_12:
Lloh22:
	adrp	x28, _TTY_HW_COOK_OUT@GOTPAGE
Lloh23:
	ldr	x28, [x28, _TTY_HW_COOK_OUT@GOTPAGEOFF]
	mov	x23, x19
LBB0_13:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_23 Depth 2
                                        ;     Child Loop BB0_19 Depth 2
	mov	x0, x24
	bl	_tty_hung_up_p
	cbnz	x0, LBB0_34
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	x8, [x20, #32]
	cbz	x8, LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w8, [x8]
	cbz	w8, LBB0_34
LBB0_16:                                ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x20
	bl	_O_OPOST
	cbz	x0, LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w0, [x28]
	mov	x1, x20
	bl	_test_bit
	cbz	w0, LBB0_22
LBB0_18:                                ;   in Loop: Header=BB0_13 Depth=1
	cbz	x21, LBB0_33
LBB0_19:                                ;   Parent Loop BB0_13 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x20, #24]
	ldr	x8, [x8]
	mov	x0, x20
	mov	x1, x23
	mov	x2, x21
	blr	x8
	mov	x25, x0
	tbnz	w0, #31, LBB0_7
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=2
	cbz	w25, LBB0_31
; %bb.21:                               ;   in Loop: Header=BB0_19 Depth=2
	mov	w8, w25
	add	x23, x23, x8
	subs	x21, x21, x8
	b.ne	LBB0_19
	b	LBB0_33
LBB0_22:                                ;   in Loop: Header=BB0_13 Depth=1
	cbz	x21, LBB0_28
LBB0_23:                                ;   Parent Loop BB0_13 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x20
	mov	x1, x23
	mov	x2, x21
	bl	_process_output_block
	mov	x25, x0
	tbnz	w0, #31, LBB0_27
; %bb.24:                               ;   in Loop: Header=BB0_23 Depth=2
	mov	w8, w25
	add	x23, x23, x8
	subs	x21, x21, x8
	b.eq	LBB0_28
; %bb.25:                               ;   in Loop: Header=BB0_23 Depth=2
	ldrb	w0, [x23]
	mov	x1, x20
	bl	_process_output
	tbnz	x0, #63, LBB0_28
; %bb.26:                               ;   in Loop: Header=BB0_23 Depth=2
	add	x23, x23, #1
	subs	x21, x21, #1
	b.ne	LBB0_23
	b	LBB0_28
LBB0_27:                                ;   in Loop: Header=BB0_13 Depth=1
Lloh24:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	cmn	w25, w8
	b.ne	LBB0_7
LBB0_28:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	x8, [x20, #24]
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_30
; %bb.29:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x20
	blr	x8
LBB0_30:                                ;   in Loop: Header=BB0_13 Depth=1
	cbz	x21, LBB0_33
LBB0_31:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	w8, [x24]
Lloh27:
	adrp	x9, _O_NONBLOCK@GOTPAGE
Lloh28:
	ldr	x9, [x9, _O_NONBLOCK@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_35
; %bb.32:                               ;   in Loop: Header=BB0_13 Depth=1
	bl	_schedule
	ldr	w0, [x27]
	bl	_set_current_state
	ldr	w0, [x26]
	bl	_signal_pending
	cbz	x0, LBB0_13
	b	LBB0_5
LBB0_33:
	mov	w25, #0
	b	LBB0_7
LBB0_34:
Lloh30:
	adrp	x8, _EIO@GOTPAGE
Lloh31:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_6
LBB0_35:
Lloh32:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_wait,4,2                       ; @wait
	.comm	_current,4,2                    ; @current
	.comm	_redirected_tty_write,8,3       ; @redirected_tty_write
	.comm	_TASK_INTERRUPTIBLE,4,2         ; @TASK_INTERRUPTIBLE
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.comm	_EIO,4,2                        ; @EIO
	.comm	_TTY_HW_COOK_OUT,4,2            ; @TTY_HW_COOK_OUT
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_TASK_RUNNING,4,2               ; @TASK_RUNNING
	.comm	_TTY_DO_WRITE_WAKEUP,4,2        ; @TTY_DO_WRITE_WAKEUP
	.no_dead_strip	_n_tty_write
.subsections_via_symbols
