	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xennet_remove
_xennet_remove:                         ## @xennet_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	leaq	8(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_dev_get_drvdata
	movq	%rax, %r14
	movl	4(%r13), %edx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_dbg
	movl	(%r13), %edi
	callq	_xenbus_read_driver_state
	movq	_XenbusStateClosed@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	je	LBB0_6
## %bb.1:
	movq	_XenbusStateClosing@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r13, %rdi
	callq	_xenbus_switch_state
	movq	_module_wq@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	(%r13), %edi
	callq	_xenbus_read_driver_state
	movl	$1, %r15d
	movl	$1, %esi
	movq	_XenbusStateClosing@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_3
## %bb.2:
	movl	(%r13), %edi
	callq	_xenbus_read_driver_state
	movq	_XenbusStateUnknown@GOTPCREL(%rip), %rcx
	xorl	%esi, %esi
	cmpq	(%rcx), %rax
	sete	%sil
LBB0_3:
	movl	%r12d, %edi
	callq	_wait_event
	movq	(%rbx), %rsi
	movq	%r13, %rdi
	callq	_xenbus_switch_state
	movq	_module_wq@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	(%r13), %edi
	callq	_xenbus_read_driver_state
	cmpq	(%rbx), %rax
	je	LBB0_5
## %bb.4:
	movl	(%r13), %edi
	callq	_xenbus_read_driver_state
	movq	_XenbusStateUnknown@GOTPCREL(%rip), %rcx
	xorl	%r15d, %r15d
	cmpq	(%rcx), %rax
	sete	%r15b
LBB0_5:
	movl	%r12d, %edi
	movl	%r15d, %esi
	callq	_wait_event
LBB0_6:
	movq	%r14, %rdi
	callq	_xennet_disconnect_backend
	movq	(%r14), %rdi
	movq	(%rdi), %rax
	movq	_NETREG_REGISTERED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.7:
	callq	_unregister_netdev
LBB0_8:
	cmpq	$0, 8(%r14)
	je	LBB0_10
## %bb.9:
	xorl	%eax, %eax
	callq	_rtnl_lock
	movq	%r14, %rdi
	callq	_xennet_destroy_queues
	xorl	%eax, %eax
	callq	_rtnl_unlock
LBB0_10:
	movq	(%r14), %rdi
	callq	_xennet_free_netdev
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s\n"

	.comm	_XenbusStateClosed,8,3          ## @XenbusStateClosed
	.comm	_XenbusStateClosing,8,3         ## @XenbusStateClosing
	.comm	_module_wq,4,2                  ## @module_wq
	.comm	_XenbusStateUnknown,8,3         ## @XenbusStateUnknown
	.comm	_NETREG_REGISTERED,8,3          ## @NETREG_REGISTERED
	.no_dead_strip	_xennet_remove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xennet_remove
_xennet_remove:                         ; @xennet_remove
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x0
	add	x21, x0, #8
	mov	x0, x21
	bl	_dev_get_drvdata
	mov	x19, x0
	ldr	w2, [x20, #4]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_dbg
	ldr	w0, [x20]
	bl	_xenbus_read_driver_state
Lloh2:
	adrp	x22, _XenbusStateClosed@GOTPAGE
Lloh3:
	ldr	x22, [x22, _XenbusStateClosed@GOTPAGEOFF]
	ldr	x8, [x22]
	cmp	x0, x8
	b.eq	LBB0_8
; %bb.1:
Lloh4:
	adrp	x23, _XenbusStateClosing@GOTPAGE
Lloh5:
	ldr	x23, [x23, _XenbusStateClosing@GOTPAGEOFF]
	ldr	x1, [x23]
	mov	x0, x20
	bl	_xenbus_switch_state
Lloh6:
	adrp	x24, _module_wq@GOTPAGE
Lloh7:
	ldr	x24, [x24, _module_wq@GOTPAGEOFF]
	ldr	w21, [x24]
	ldr	w0, [x20]
	bl	_xenbus_read_driver_state
	ldr	x8, [x23]
Lloh8:
	adrp	x23, _XenbusStateUnknown@GOTPAGE
Lloh9:
	ldr	x23, [x23, _XenbusStateUnknown@GOTPAGEOFF]
	cmp	x0, x8
	b.ne	LBB0_3
; %bb.2:
	mov	w1, #1
	b	LBB0_4
LBB0_3:
	ldr	w0, [x20]
	bl	_xenbus_read_driver_state
	ldr	x8, [x23]
	cmp	x0, x8
	cset	w1, eq
LBB0_4:
	mov	x0, x21
	bl	_wait_event
	ldr	x1, [x22]
	mov	x0, x20
	bl	_xenbus_switch_state
	ldr	w21, [x24]
	ldr	w0, [x20]
	bl	_xenbus_read_driver_state
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.5:
	mov	w1, #1
	b	LBB0_7
LBB0_6:
	ldr	w0, [x20]
	bl	_xenbus_read_driver_state
	ldr	x8, [x23]
	cmp	x0, x8
	cset	w1, eq
LBB0_7:
	mov	x0, x21
	bl	_wait_event
LBB0_8:
	mov	x0, x19
	bl	_xennet_disconnect_backend
	ldr	x0, [x19]
	ldr	x8, [x0]
Lloh10:
	adrp	x9, _NETREG_REGISTERED@GOTPAGE
Lloh11:
	ldr	x9, [x9, _NETREG_REGISTERED@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.9:
	bl	_unregister_netdev
LBB0_10:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_12
; %bb.11:
	bl	_rtnl_lock
	mov	x0, x19
	bl	_xennet_destroy_queues
	bl	_rtnl_unlock
LBB0_12:
	ldr	x0, [x19]
	bl	_xennet_free_netdev
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s\n"

	.comm	_XenbusStateClosed,8,3          ; @XenbusStateClosed
	.comm	_XenbusStateClosing,8,3         ; @XenbusStateClosing
	.comm	_module_wq,4,2                  ; @module_wq
	.comm	_XenbusStateUnknown,8,3         ; @XenbusStateUnknown
	.comm	_NETREG_REGISTERED,8,3          ; @NETREG_REGISTERED
	.no_dead_strip	_xennet_remove
.subsections_via_symbols
