	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sky2_remove
_sky2_remove:                           ## @sky2_remove
	.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, %r14
	callq	_pci_get_drvdata
	testq	%rax, %rax
	je	LBB0_12
## %bb.1:
	movq	%rax, %r15
	leaq	40(%rax), %rdi
	callq	_del_timer_sync
	leaq	36(%r15), %rdi
	callq	_cancel_work_sync
	movl	(%r15), %ebx
	testl	%ebx, %ebx
	jle	LBB0_4
## %bb.2:
	incq	%rbx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	leal	-2(%rbx), %eax
	movq	16(%r15), %rcx
	movl	(%rcx,%rax,4), %edi
	callq	_unregister_netdev
	decq	%rbx
	cmpq	$1, %rbx
	ja	LBB0_3
LBB0_4:
	movq	_B0_IMSK@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_sky2_write32
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_sky2_read32
	movq	%r15, %rdi
	callq	_sky2_power_aux
	movq	_B0_CTST@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_CS_RST_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_sky2_write8
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_sky2_read8
	cmpl	$2, (%r15)
	jl	LBB0_6
## %bb.5:
	movq	%r15, %rdi
	addq	$32, %rdi
	callq	_napi_disable
	movl	(%r14), %edi
	movq	%r15, %rsi
	callq	_free_irq
LBB0_6:
	movq	_SKY2_HW_USE_MSI@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r15)
	je	LBB0_8
## %bb.7:
	movq	%r14, %rdi
	callq	_pci_disable_msi
LBB0_8:
	movl	8(%r15), %esi
	movl	24(%r15), %ecx
	shll	$2, %esi
	movl	28(%r15), %edx
	movq	%r14, %rdi
	callq	_pci_free_consistent
	movq	%r14, %rdi
	callq	_pci_release_regions
	movq	%r14, %rdi
	callq	_pci_disable_device
	movl	(%r15), %ebx
	testl	%ebx, %ebx
	jle	LBB0_11
## %bb.9:
	incq	%rbx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	leal	-2(%rbx), %eax
	movq	16(%r15), %rcx
	movl	(%rcx,%rax,4), %edi
	callq	_free_netdev
	decq	%rbx
	cmpq	$1, %rbx
	ja	LBB0_10
LBB0_11:
	movl	12(%r15), %edi
	callq	_iounmap
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_B0_IMSK,4,2                    ## @B0_IMSK
	.comm	_B0_CTST,4,2                    ## @B0_CTST
	.comm	_CS_RST_SET,4,2                 ## @CS_RST_SET
	.comm	_SKY2_HW_USE_MSI,4,2            ## @SKY2_HW_USE_MSI
	.no_dead_strip	_sky2_remove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sky2_remove
_sky2_remove:                           ; @sky2_remove
	.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	x20, x0
	bl	_pci_get_drvdata
	cbz	x0, LBB0_12
; %bb.1:
	mov	x19, x0
	add	x0, x0, #40
	bl	_del_timer_sync
	add	x0, x19, #36
	bl	_cancel_work_sync
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.2:
	add	x21, x8, #1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	sub	w8, w21, #2
	ldr	x9, [x19, #16]
	ldr	w0, [x9, w8, uxtw #2]
	bl	_unregister_netdev
	sub	x21, x21, #1
	cmp	x21, #1
	b.hi	LBB0_3
LBB0_4:
Lloh0:
	adrp	x21, _B0_IMSK@GOTPAGE
Lloh1:
	ldr	x21, [x21, _B0_IMSK@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	mov	w2, #0
	bl	_sky2_write32
	ldr	w1, [x21]
	mov	x0, x19
	bl	_sky2_read32
	mov	x0, x19
	bl	_sky2_power_aux
Lloh2:
	adrp	x21, _B0_CTST@GOTPAGE
Lloh3:
	ldr	x21, [x21, _B0_CTST@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh4:
	adrp	x8, _CS_RST_SET@GOTPAGE
Lloh5:
	ldr	x8, [x8, _CS_RST_SET@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_sky2_write8
	ldr	w1, [x21]
	mov	x0, x19
	bl	_sky2_read8
	ldr	w8, [x19]
	cmp	w8, #1
	b.le	LBB0_6
; %bb.5:
	add	x0, x19, #32
	bl	_napi_disable
	ldr	w0, [x20]
	mov	x1, x19
	bl	_free_irq
LBB0_6:
	ldr	w8, [x19, #4]
Lloh7:
	adrp	x9, _SKY2_HW_USE_MSI@GOTPAGE
Lloh8:
	ldr	x9, [x9, _SKY2_HW_USE_MSI@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.7:
	mov	x0, x20
	bl	_pci_disable_msi
LBB0_8:
	ldr	w8, [x19, #8]
	lsl	w1, w8, #2
	ldp	w3, w2, [x19, #24]
	mov	x0, x20
	bl	_pci_free_consistent
	mov	x0, x20
	bl	_pci_release_regions
	mov	x0, x20
	bl	_pci_disable_device
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.9:
	add	x20, x8, #1
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	sub	w8, w20, #2
	ldr	x9, [x19, #16]
	ldr	w0, [x9, w8, uxtw #2]
	bl	_free_netdev
	sub	x20, x20, #1
	cmp	x20, #1
	b.hi	LBB0_10
LBB0_11:
	ldr	w0, [x19, #12]
	bl	_iounmap
	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	_kfree
LBB0_12:
	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	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_B0_IMSK,4,2                    ; @B0_IMSK
	.comm	_B0_CTST,4,2                    ; @B0_CTST
	.comm	_CS_RST_SET,4,2                 ; @CS_RST_SET
	.comm	_SKY2_HW_USE_MSI,4,2            ; @SKY2_HW_USE_MSI
	.no_dead_strip	_sky2_remove
.subsections_via_symbols
