	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cobalt_remove
_cobalt_remove:                         ## @cobalt_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_pci_get_drvdata
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	callq	_to_cobalt
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_cobalt_flash_remove
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_cobalt_set_interrupt
	movl	(%r12), %edi
	callq	_flush_workqueue
	movq	%r12, %rdi
	callq	_cobalt_nodes_unregister
	movq	_COBALT_NUM_ADAPTERS@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	testl	%eax, %eax
	jle	LBB0_5
## %bb.1:
	xorl	%r15d, %r15d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r15
	movslq	%eax, %rcx
	cmpq	%rcx, %r15
	jge	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rcx
	movq	(%rcx,%r15,8), %rbx
	testq	%rbx, %rbx
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	callq	_v4l2_get_subdevdata
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_v4l2_device_unregister_subdev
	movq	%r13, %rdi
	callq	_i2c_unregister_device
	movl	(%r14), %eax
	jmp	LBB0_4
LBB0_5:
	movq	%r12, %rdi
	callq	_cobalt_i2c_exit
	movq	%r12, %rdi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_cobalt_free_msi
	movq	_COBALT_SYS_CTRL_HSMA_TX_ENABLE_BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_cobalt_s_bit_sysctrl
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_cobalt_pci_iounmap
	movl	4(%r12), %edi
	callq	_pci_release_regions
	movl	4(%r12), %edi
	callq	_pci_disable_device
	movl	(%r12), %edi
	callq	_destroy_workqueue
	leaq	L_.str(%rip), %rdi
	callq	_cobalt_info
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_v4l2_device_unregister
	movq	%r12, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_COBALT_NUM_ADAPTERS,4,2        ## @COBALT_NUM_ADAPTERS
	.comm	_COBALT_SYS_CTRL_HSMA_TX_ENABLE_BIT,4,2 ## @COBALT_SYS_CTRL_HSMA_TX_ENABLE_BIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"removed cobalt card\n"

	.no_dead_strip	_cobalt_remove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cobalt_remove
_cobalt_remove:                         ; @cobalt_remove
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x21, x0
	bl	_pci_get_drvdata
	mov	x19, x0
	bl	_to_cobalt
	mov	x20, x0
	bl	_cobalt_flash_remove
	mov	x0, x20
	mov	w1, #0
	bl	_cobalt_set_interrupt
	ldr	w0, [x20]
	bl	_flush_workqueue
	mov	x0, x20
	bl	_cobalt_nodes_unregister
Lloh0:
	adrp	x24, _COBALT_NUM_ADAPTERS@GOTPAGE
Lloh1:
	ldr	x24, [x24, _COBALT_NUM_ADAPTERS@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.1:
	mov	x25, #0
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x25, x25, #1
	cmp	x25, w8, sxtw
	b.ge	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x20, #8]
	ldr	x22, [x9, x25, lsl #3]
	cbz	x22, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x22
	bl	_v4l2_get_subdevdata
	mov	x23, x0
	mov	x0, x22
	bl	_v4l2_device_unregister_subdev
	mov	x0, x23
	bl	_i2c_unregister_device
	ldr	w8, [x24]
	b	LBB0_2
LBB0_5:
	mov	x0, x20
	bl	_cobalt_i2c_exit
	mov	x0, x20
	mov	x1, x21
	bl	_cobalt_free_msi
Lloh2:
	adrp	x8, _COBALT_SYS_CTRL_HSMA_TX_ENABLE_BIT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _COBALT_SYS_CTRL_HSMA_TX_ENABLE_BIT@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_cobalt_s_bit_sysctrl
	mov	x0, x20
	mov	x1, x21
	bl	_cobalt_pci_iounmap
	ldr	w0, [x20, #4]
	bl	_pci_release_regions
	ldr	w0, [x20, #4]
	bl	_pci_disable_device
	ldr	w0, [x20]
	bl	_destroy_workqueue
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_cobalt_info
	mov	x0, x19
	bl	_v4l2_device_unregister
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_kfree
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_COBALT_NUM_ADAPTERS,4,2        ; @COBALT_NUM_ADAPTERS
	.comm	_COBALT_SYS_CTRL_HSMA_TX_ENABLE_BIT,4,2 ; @COBALT_SYS_CTRL_HSMA_TX_ENABLE_BIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"removed cobalt card\n"

	.no_dead_strip	_cobalt_remove
.subsections_via_symbols
