	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function n_tty_poll
_n_tty_poll:                            ## @n_tty_poll
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r12
	leaq	44(%rdi), %rsi
	movq	%r15, %rdi
	callq	_poll_wait
	leaq	40(%r12), %rsi
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	_poll_wait
	movq	%r12, %rdi
	callq	_TIME_CHAR
	xorl	%r14d, %r14d
	movl	$0, %esi
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	%r12, %rdi
	callq	_MIN_CHAR
	movl	%eax, %esi
LBB0_2:
	movq	%r12, %rdi
	callq	_input_available_p
	movq	_POLLIN@GOTPCREL(%rip), %rdx
	movq	_POLLRDNORM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rdx), %ecx
	testq	%rax, %rax
	cmovnel	%ecx, %r14d
	cmpq	$0, 32(%r12)
	je	LBB0_5
## %bb.3:
	movq	24(%r12), %rax
	cmpq	$0, (%rax)
	je	LBB0_5
## %bb.4:
	movq	_POLLPRI@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, %r14d
LBB0_5:
	movq	_TTY_OTHER_CLOSED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	16(%r12), %rsi
	callq	_test_bit
	xorl	%ebx, %ebx
	movq	_POLLHUP@GOTPCREL(%rip), %rcx
	movl	$0, %r13d
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movl	(%rcx), %r13d
LBB0_7:
	movq	%r15, %rdi
	movq	%rcx, %r15
	callq	_tty_hung_up_p
	testq	%rax, %rax
	movl	(%r15), %eax
	cmovnel	%eax, %ebx
	orl	%ebx, %r14d
	movq	_POLLIN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	orl	%r13d, %r14d
	movq	_POLLRDNORM@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	testl	%r14d, %eax
	jne	LBB0_12
## %bb.8:
	movq	%r12, %rdi
	callq	_MIN_CHAR
	movl	$1, %r15d
	testl	%eax, %eax
	je	LBB0_11
## %bb.9:
	movq	%r12, %rdi
	callq	_TIME_CHAR
	testq	%rax, %rax
	jne	LBB0_11
## %bb.10:
	movq	%r12, %rdi
	callq	_MIN_CHAR
	movl	%eax, %r15d
LBB0_11:
	movl	%r15d, (%r12)
LBB0_12:
	movq	8(%r12), %rax
	cmpq	$0, (%rax)
	je	LBB0_17
## %bb.13:
	movq	%r12, %rdi
	callq	_tty_is_writelocked
	testl	%eax, %eax
	jne	LBB0_17
## %bb.14:
	movq	%r12, %rdi
	callq	_tty_chars_in_buffer
	movq	_WAKEUP_CHARS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_17
## %bb.15:
	movq	%r12, %rdi
	callq	_tty_write_room
	testq	%rax, %rax
	jle	LBB0_17
## %bb.16:
	movq	_POLLOUT@GOTPCREL(%rip), %rax
	movq	_POLLWRNORM@GOTPCREL(%rip), %rcx
	orl	(%rax), %r14d
	orl	(%rcx), %r14d
LBB0_17:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_POLLIN,4,2                     ## @POLLIN
	.comm	_POLLRDNORM,4,2                 ## @POLLRDNORM
	.comm	_POLLPRI,4,2                    ## @POLLPRI
	.comm	_TTY_OTHER_CLOSED,4,2           ## @TTY_OTHER_CLOSED
	.comm	_POLLHUP,4,2                    ## @POLLHUP
	.comm	_WAKEUP_CHARS,8,3               ## @WAKEUP_CHARS
	.comm	_POLLOUT,4,2                    ## @POLLOUT
	.comm	_POLLWRNORM,4,2                 ## @POLLWRNORM
	.no_dead_strip	_n_tty_poll
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function n_tty_poll
_n_tty_poll:                            ; @n_tty_poll
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	add	x1, x0, #44
	mov	x0, x20
	bl	_poll_wait
	add	x1, x19, #40
	mov	x0, x20
	mov	x2, x21
	bl	_poll_wait
	mov	x0, x19
	bl	_TIME_CHAR
	cbz	x0, LBB0_2
; %bb.1:
	mov	w1, #0
	b	LBB0_3
LBB0_2:
	mov	x0, x19
	bl	_MIN_CHAR
	mov	x1, x0
LBB0_3:
	mov	x0, x19
	bl	_input_available_p
Lloh0:
	adrp	x21, _POLLIN@GOTPAGE
Lloh1:
	ldr	x21, [x21, _POLLIN@GOTPAGEOFF]
Lloh2:
	adrp	x22, _POLLRDNORM@GOTPAGE
Lloh3:
	ldr	x22, [x22, _POLLRDNORM@GOTPAGEOFF]
	ldr	w8, [x21]
	ldr	w9, [x22]
	orr	w8, w9, w8
	cmp	x0, #0
	csel	w23, wzr, w8, eq
	ldr	x9, [x19, #32]
	cbz	x9, LBB0_6
; %bb.4:
	ldr	x9, [x19, #24]
	ldr	x9, [x9]
	cbz	x9, LBB0_6
; %bb.5:
Lloh4:
	adrp	x9, _POLLPRI@GOTPAGE
Lloh5:
	ldr	x9, [x9, _POLLPRI@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	orr	w23, w8, w9
LBB0_6:
Lloh7:
	adrp	x8, _TTY_OTHER_CLOSED@GOTPAGE
Lloh8:
	ldr	x8, [x8, _TTY_OTHER_CLOSED@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	add	x1, x19, #16
	bl	_test_bit
Lloh10:
	adrp	x24, _POLLHUP@GOTPAGE
Lloh11:
	ldr	x24, [x24, _POLLHUP@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	x0, #0
	csel	w8, wzr, w8, eq
	orr	w23, w8, w23
	mov	x0, x20
	bl	_tty_hung_up_p
	ldr	w8, [x24]
	cmp	x0, #0
	csel	w9, wzr, w8, eq
	orr	w20, w23, w9
	ldr	w9, [x21]
	orr	w8, w9, w8
	ldr	w9, [x22]
	orr	w8, w8, w9
	tst	w8, w20
	b.ne	LBB0_12
; %bb.7:
	mov	x0, x19
	bl	_MIN_CHAR
	cbz	w0, LBB0_9
; %bb.8:
	mov	x0, x19
	bl	_TIME_CHAR
	cbz	x0, LBB0_10
LBB0_9:
	mov	w0, #1
	b	LBB0_11
LBB0_10:
	mov	x0, x19
	bl	_MIN_CHAR
LBB0_11:
	str	w0, [x19]
LBB0_12:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_17
; %bb.13:
	mov	x0, x19
	bl	_tty_is_writelocked
	cbnz	w0, LBB0_17
; %bb.14:
	mov	x0, x19
	bl	_tty_chars_in_buffer
Lloh12:
	adrp	x8, _WAKEUP_CHARS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _WAKEUP_CHARS@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ge	LBB0_17
; %bb.15:
	mov	x0, x19
	bl	_tty_write_room
	cmp	x0, #1
	b.lt	LBB0_17
; %bb.16:
Lloh15:
	adrp	x8, _POLLOUT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _POLLOUT@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _POLLWRNORM@GOTPAGE
Lloh19:
	ldr	x9, [x9, _POLLWRNORM@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w8, w20
	orr	w20, w8, w9
LBB0_17:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_POLLIN,4,2                     ; @POLLIN
	.comm	_POLLRDNORM,4,2                 ; @POLLRDNORM
	.comm	_POLLPRI,4,2                    ; @POLLPRI
	.comm	_TTY_OTHER_CLOSED,4,2           ; @TTY_OTHER_CLOSED
	.comm	_POLLHUP,4,2                    ; @POLLHUP
	.comm	_WAKEUP_CHARS,8,3               ; @WAKEUP_CHARS
	.comm	_POLLOUT,4,2                    ; @POLLOUT
	.comm	_POLLWRNORM,4,2                 ; @POLLWRNORM
	.no_dead_strip	_n_tty_poll
.subsections_via_symbols
