	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nes_disconnect
_nes_disconnect:                        ## @nes_disconnect
	.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
	movl	48(%rdi), %edi
	callq	_to_nesvnic
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	16(%rax), %r12
	movq	(%rax), %rdi
	movq	8(%rax), %r13
	movq	_NES_DBG_CM@GOTPCREL(%rip), %r15
	movl	(%r15), %ebx
	callq	_atomic_read
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_nes_debug
	cmpq	$0, 40(%r14)
	je	LBB0_4
## %bb.3:
	movq	$0, 40(%r14)
	jmp	LBB0_8
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_4:
	movl	12(%r14), %edx
	testl	%edx, %edx
	je	LBB0_8
## %bb.5:
	movl	32(%r14), %edi
	testl	%edi, %edi
	je	LBB0_7
## %bb.6:
	callq	*(%r13)
	movl	12(%r14), %edx
LBB0_7:
	movl	(%r12), %edi
	movq	16(%r14), %rsi
	addq	24(%r14), %rsi
	movl	8(%r14), %ecx
	callq	_pci_free_consistent
LBB0_8:
	cmpq	$0, (%r14)
	je	LBB0_9
## %bb.10:
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_nes_debug
	movq	_g_cm_core@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	(%rdi), %rax
	movq	(%r14), %rsi
	callq	*(%rax)
	jmp	LBB0_11
LBB0_9:
	xorl	%ebx, %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_NES_DBG_CM,4,2                 ## @NES_DBG_CM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"netdev refcnt = %u.\n"

L_.str.1:                               ## @.str.1
	.asciz	"Call close API\n"

	.comm	_g_cm_core,8,3                  ## @g_cm_core
	.no_dead_strip	_nes_disconnect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nes_disconnect
_nes_disconnect:                        ; @nes_disconnect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
	ldr	w0, [x0, #48]
	bl	_to_nesvnic
	cbz	x0, LBB0_3
; %bb.1:
	ldp	x23, x22, [x0, #8]
Lloh0:
	adrp	x21, _NES_DBG_CM@GOTPAGE
Lloh1:
	ldr	x21, [x21, _NES_DBG_CM@GOTPAGEOFF]
	ldr	w20, [x21]
	ldr	x0, [x0]
	bl	_atomic_read
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_nes_debug
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_4
; %bb.2:
	str	xzr, [x19, #40]
	b	LBB0_8
LBB0_3:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_4:
	ldr	w2, [x19, #12]
	cbz	w2, LBB0_8
; %bb.5:
	ldr	w0, [x19, #32]
	cbz	w0, LBB0_7
; %bb.6:
	ldr	x8, [x23]
	blr	x8
	ldr	w2, [x19, #12]
LBB0_7:
	ldr	w0, [x22]
	ldp	x9, x8, [x19, #16]
	add	x1, x9, x8
	ldr	w3, [x19, #8]
	bl	_pci_free_consistent
LBB0_8:
	ldr	x8, [x19]
	cbz	x8, LBB0_10
; %bb.9:
	ldr	w0, [x21]
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_nes_debug
Lloh9:
	adrp	x8, _g_cm_core@GOTPAGE
Lloh10:
	ldr	x8, [x8, _g_cm_core@GOTPAGEOFF]
Lloh11:
	ldr	x0, [x8]
	ldr	x8, [x0]
	ldr	x8, [x8]
	ldr	x1, [x19]
	blr	x8
LBB0_10:
	mov	w0, #0
LBB0_11:
	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
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_NES_DBG_CM,4,2                 ; @NES_DBG_CM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"netdev refcnt = %u.\n"

l_.str.1:                               ; @.str.1
	.asciz	"Call close API\n"

	.comm	_g_cm_core,8,3                  ; @g_cm_core
	.no_dead_strip	_nes_disconnect
.subsections_via_symbols
