	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tty_ldisc_hangup               ## -- Begin function tty_ldisc_hangup
	.p2align	4, 0x90
_tty_ldisc_hangup:                      ## @tty_ldisc_hangup
	.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	%rdi, %rbx
	movq	40(%rdi), %rax
	movq	_TTY_DRIVER_RESET_TERMIOS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	andl	(%rax), %r15d
	callq	_tty_ldisc_ref
	testq	%rax, %rax
	je	LBB0_9
## %bb.1:
	movq	%rax, %r14
	movq	(%rax), %rax
	movq	16(%rax), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	callq	*%rax
LBB0_3:
	movq	%rbx, %rdi
	callq	_tty_driver_flush_buffer
	movq	_TTY_DO_WRITE_WAKEUP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	32(%rbx), %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movq	(%r14), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	callq	*%rax
LBB0_6:
	movq	(%r14), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	%rbx, %rdi
	callq	*%rax
LBB0_8:
	movq	%r14, %rdi
	callq	_tty_ldisc_deref
LBB0_9:
	leaq	28(%rbx), %rdi
	movq	_POLLOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_wake_up_interruptible_poll
	leaq	24(%rbx), %rdi
	movq	_POLLIN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_wake_up_interruptible_poll
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	callq	_tty_ldisc_halt
	cmpq	$0, 8(%rbx)
	je	LBB0_15
## %bb.10:
	testl	%r15d, %r15d
	jne	LBB0_13
## %bb.11:
	movq	16(%rbx), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_tty_ldisc_reinit
	testl	%eax, %eax
	jne	LBB0_13
## %bb.12:
	movq	8(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_tty_ldisc_open
	testl	%eax, %eax
	je	LBB0_14
LBB0_13:
	movq	_N_TTY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_tty_ldisc_reinit
	movl	%eax, %edi
	callq	_BUG_ON
	movq	8(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_tty_ldisc_open
	movl	%eax, %edi
	callq	_WARN_ON
LBB0_14:
	movq	%rbx, %rdi
	callq	_tty_ldisc_enable
LBB0_15:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	testl	%r15d, %r15d
	je	LBB0_16
## %bb.17:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_tty_reset_termios              ## TAILCALL
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TTY_DRIVER_RESET_TERMIOS,4,2   ## @TTY_DRIVER_RESET_TERMIOS
	.comm	_TTY_DO_WRITE_WAKEUP,4,2        ## @TTY_DO_WRITE_WAKEUP
	.comm	_POLLOUT,4,2                    ## @POLLOUT
	.comm	_POLLIN,4,2                     ## @POLLIN
	.comm	_N_TTY,4,2                      ## @N_TTY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tty_ldisc_hangup               ; -- Begin function tty_ldisc_hangup
	.p2align	2
_tty_ldisc_hangup:                      ; @tty_ldisc_hangup
	.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
	ldr	x8, [x0, #40]
	ldr	w21, [x8]
Lloh0:
	adrp	x8, _TTY_DRIVER_RESET_TERMIOS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TTY_DRIVER_RESET_TERMIOS@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	bl	_tty_ldisc_ref
	cbz	x0, LBB0_9
; %bb.1:
	mov	x20, x0
	ldr	x8, [x0]
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_3
; %bb.2:
	mov	x0, x19
	blr	x8
LBB0_3:
	mov	x0, x19
	bl	_tty_driver_flush_buffer
Lloh3:
	adrp	x8, _TTY_DO_WRITE_WAKEUP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TTY_DO_WRITE_WAKEUP@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	add	x1, x19, #32
	bl	_test_bit
	cbz	x0, LBB0_6
; %bb.4:
	ldr	x8, [x20]
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_6
; %bb.5:
	mov	x0, x19
	blr	x8
LBB0_6:
	ldr	x8, [x20]
	ldr	x8, [x8]
	cbz	x8, LBB0_8
; %bb.7:
	mov	x0, x19
	blr	x8
LBB0_8:
	mov	x0, x20
	bl	_tty_ldisc_deref
LBB0_9:
	and	w20, w22, w21
	add	x0, x19, #28
Lloh6:
	adrp	x8, _POLLOUT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _POLLOUT@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_wake_up_interruptible_poll
	add	x0, x19, #24
Lloh9:
	adrp	x8, _POLLIN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _POLLIN@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_wake_up_interruptible_poll
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x19
	bl	_tty_ldisc_halt
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_15
; %bb.10:
	cbnz	w20, LBB0_13
; %bb.11:
	ldr	x8, [x19, #16]
	ldr	w1, [x8]
	mov	x0, x19
	bl	_tty_ldisc_reinit
	cbnz	w0, LBB0_13
; %bb.12:
	ldr	x1, [x19, #8]
	mov	x0, x19
	bl	_tty_ldisc_open
	cbz	w0, LBB0_14
LBB0_13:
Lloh12:
	adrp	x8, _N_TTY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _N_TTY@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_tty_ldisc_reinit
	bl	_BUG_ON
	ldr	x1, [x19, #8]
	mov	x0, x19
	bl	_tty_ldisc_open
	bl	_WARN_ON
LBB0_14:
	mov	x0, x19
	bl	_tty_ldisc_enable
LBB0_15:
	mov	x0, x19
	bl	_mutex_unlock
	cbz	w20, LBB0_17
; %bb.16:
	mov	x0, x19
	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
	b	_tty_reset_termios
LBB0_17:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_TTY_DRIVER_RESET_TERMIOS,4,2   ; @TTY_DRIVER_RESET_TERMIOS
	.comm	_TTY_DO_WRITE_WAKEUP,4,2        ; @TTY_DO_WRITE_WAKEUP
	.comm	_POLLOUT,4,2                    ; @POLLOUT
	.comm	_POLLIN,4,2                     ; @POLLIN
	.comm	_N_TTY,4,2                      ; @N_TTY
.subsections_via_symbols
