	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pty_close
_pty_close:                             ## @pty_close
	.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
	xorl	%edi, %edi
	testq	%rbx, %rbx
	sete	%dil
	callq	_BUG_ON
	movq	16(%rbx), %rax
	movq	(%rax), %rcx
	movq	_PTY_TYPE_MASTER@GOTPCREL(%rip), %r14
	movl	(%rbx), %eax
	cmpq	(%r14), %rcx
	jne	LBB0_2
## %bb.1:
	xorl	%edi, %edi
	cmpl	$2, %eax
	setge	%dil
	callq	_WARN_ON
	jmp	LBB0_3
LBB0_2:
	cmpl	$2, %eax
	jg	LBB0_5
LBB0_3:
	leaq	44(%rbx), %rdi
	callq	_wake_up_interruptible
	leaq	40(%rbx), %rdi
	callq	_wake_up_interruptible
	movq	$0, 32(%rbx)
	movq	8(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_5
## %bb.4:
	movq	$0, 16(%rsi)
	movq	_TTY_OTHER_CLOSED@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	addq	$8, %rsi
	callq	_set_bit
	movq	8(%rbx), %rdi
	addq	$4, %rdi
	callq	_wake_up_interruptible
	movq	8(%rbx), %rdi
	callq	_wake_up_interruptible
	movq	16(%rbx), %rax
	movq	(%rax), %rax
	cmpq	(%r14), %rax
	jne	LBB0_5
## %bb.6:
	movl	(%r15), %edi
	leaq	24(%rbx), %rsi
	callq	_set_bit
	movq	8(%rbx), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_tty_vhangup                    ## TAILCALL
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PTY_TYPE_MASTER,8,3            ## @PTY_TYPE_MASTER
	.comm	_TTY_OTHER_CLOSED,4,2           ## @TTY_OTHER_CLOSED
	.comm	_ptm_driver,8,3                 ## @ptm_driver
	.no_dead_strip	_pty_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pty_close
_pty_close:                             ; @pty_close
	.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
	cmp	x0, #0
	cset	w0, eq
	bl	_BUG_ON
	ldr	x8, [x19, #16]
	ldr	x9, [x8]
Lloh0:
	adrp	x20, _PTY_TYPE_MASTER@GOTPAGE
Lloh1:
	ldr	x20, [x20, _PTY_TYPE_MASTER@GOTPAGEOFF]
	ldr	x10, [x20]
	ldr	w8, [x19]
	cmp	x9, x10
	b.ne	LBB0_2
; %bb.1:
	cmp	w8, #1
	cset	w0, gt
	bl	_WARN_ON
	b	LBB0_3
LBB0_2:
	cmp	w8, #2
	b.gt	LBB0_6
LBB0_3:
	add	x0, x19, #44
	bl	_wake_up_interruptible
	add	x0, x19, #40
	bl	_wake_up_interruptible
	str	xzr, [x19, #32]
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_6
; %bb.4:
	str	xzr, [x8, #16]
Lloh2:
	adrp	x21, _TTY_OTHER_CLOSED@GOTPAGE
Lloh3:
	ldr	x21, [x21, _TTY_OTHER_CLOSED@GOTPAGEOFF]
	ldr	w0, [x21]
	add	x1, x8, #8
	bl	_set_bit
	ldr	x8, [x19, #8]
	add	x0, x8, #4
	bl	_wake_up_interruptible
	ldr	x0, [x19, #8]
	bl	_wake_up_interruptible
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	ldr	x9, [x20]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	ldr	w0, [x21]
	add	x1, x19, #24
	bl	_set_bit
	ldr	x0, [x19, #8]
	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_vhangup
LBB0_6:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_PTY_TYPE_MASTER,8,3            ; @PTY_TYPE_MASTER
	.comm	_TTY_OTHER_CLOSED,4,2           ; @TTY_OTHER_CLOSED
	.comm	_ptm_driver,8,3                 ; @ptm_driver
	.no_dead_strip	_pty_close
.subsections_via_symbols
