	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ipwireless_tty_free            ## -- Begin function ipwireless_tty_free
	.p2align	4, 0x90
_ipwireless_tty_free:                   ## @ipwireless_tty_free
	.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	(%rdi), %r14
	movq	_IPWIRELESS_PCMCIA_MINORS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%r14d, %eax
	jle	LBB0_12
## %bb.1:
	movq	_ttys@GOTPCREL(%rip), %r13
	movq	(%r13), %rcx
	movq	(%rcx,%r14,8), %rdx
	movq	40(%rdx), %rdx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movslq	%r15d, %r15
	movq	(%rcx,%r15,8), %rbx
	testq	%rbx, %rbx
	je	LBB0_10
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	12(%rbx), %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	_ipw_tty_driver@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax), %rdi
	addq	%r15, %rdi
	callq	_get_tty
	cmpq	%rbx, %rax
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	callq	_report_deregistering
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, 8(%rbx)
	cmpq	$0, 32(%rbx)
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	32(%rbx), %rdi
	callq	_tty_hangup
	xorl	%eax, %eax
	callq	_flush_scheduled_work
	movq	%r12, %rdi
	callq	_mutex_lock
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_8 Depth=2
	movq	%rbx, %rdi
	callq	_do_ipw_close
LBB0_8:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	$0, 24(%rbx)
	jne	LBB0_7
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	16(%rbx), %esi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_ipwireless_disassociate_network_ttys
	movq	_ipw_tty_driver@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movl	%r14d, %esi
	callq	_tty_unregister_device
	movq	(%r13), %rax
	movq	$0, (%rax,%r15,8)
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	%rbx, %rdi
	callq	_kfree
	movq	_IPWIRELESS_PCMCIA_MINORS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_IPWIRELESS_PCMCIA_MINOR_RANGE@GOTPCREL(%rip), %rcx
	addq	(%rcx), %r15
	cmpl	%r15d, %eax
	jle	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r13), %rcx
	movl	%r15d, %r14d
	jmp	LBB0_2
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ttys,8,3                       ## @ttys
	.comm	_IPWIRELESS_PCMCIA_MINORS,4,2   ## @IPWIRELESS_PCMCIA_MINORS
	.comm	_ipw_tty_driver,8,3             ## @ipw_tty_driver
	.comm	_IPWIRELESS_PCMCIA_MINOR_RANGE,8,3 ## @IPWIRELESS_PCMCIA_MINOR_RANGE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ipwireless_tty_free            ; -- Begin function ipwireless_tty_free
	.p2align	2
_ipwireless_tty_free:                   ; @ipwireless_tty_free
	.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
	ldr	x20, [x0]
Lloh0:
	adrp	x23, _IPWIRELESS_PCMCIA_MINORS@GOTPAGE
Lloh1:
	ldr	x23, [x23, _IPWIRELESS_PCMCIA_MINORS@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, w20
	b.le	LBB0_12
; %bb.1:
Lloh2:
	adrp	x24, _ttys@GOTPAGE
Lloh3:
	ldr	x24, [x24, _ttys@GOTPAGEOFF]
	ldr	x9, [x24]
	ldr	x10, [x9, x20, lsl #3]
	ldr	x19, [x10, #40]
Lloh4:
	adrp	x25, _IPWIRELESS_PCMCIA_MINOR_RANGE@GOTPAGE
Lloh5:
	ldr	x25, [x25, _IPWIRELESS_PCMCIA_MINOR_RANGE@GOTPAGEOFF]
Lloh6:
	adrp	x26, _ipw_tty_driver@GOTPAGE
Lloh7:
	ldr	x26, [x26, _ipw_tty_driver@GOTPAGEOFF]
	mov	w27, #1
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	sxtw	x28, w20
	sbfiz	x10, x20, #3, #32
	ldr	x21, [x9, x10]
	cbz	x21, LBB0_10
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x22, x21, #12
	mov	x0, x22
	bl	_mutex_lock
	ldr	x8, [x26]
	ldr	x8, [x8]
	add	x0, x8, x28
	bl	_get_tty
	cmp	x0, x21
	b.ne	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x21
	bl	_report_deregistering
LBB0_5:                                 ;   in Loop: Header=BB0_2 Depth=1
	str	w27, [x21, #8]
	ldr	x8, [x21, #32]
	cbz	x8, LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x22
	bl	_mutex_unlock
	ldr	x0, [x21, #32]
	bl	_tty_hangup
	bl	_flush_scheduled_work
	mov	x0, x22
	bl	_mutex_lock
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=2
	mov	x0, x21
	bl	_do_ipw_close
LBB0_8:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x21, #24]
	cbnz	x8, LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w1, [x21, #16]
	mov	x0, x19
	bl	_ipwireless_disassociate_network_ttys
	ldr	x0, [x26]
	mov	x1, x20
	bl	_tty_unregister_device
	ldr	x8, [x24]
	str	xzr, [x8, x28, lsl #3]
	mov	x0, x22
	bl	_mutex_unlock
	mov	x0, x21
	bl	_kfree
	ldr	w8, [x23]
LBB0_10:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x9, [x25]
	add	x20, x9, x28
	cmp	w8, w20
	b.le	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_2 Depth=1
	ldr	x9, [x24]
	b	LBB0_2
LBB0_12:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_ttys,8,3                       ; @ttys
	.comm	_IPWIRELESS_PCMCIA_MINORS,4,2   ; @IPWIRELESS_PCMCIA_MINORS
	.comm	_ipw_tty_driver,8,3             ; @ipw_tty_driver
	.comm	_IPWIRELESS_PCMCIA_MINOR_RANGE,8,3 ; @IPWIRELESS_PCMCIA_MINOR_RANGE
.subsections_via_symbols
