	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ucan_close
_ucan_close:                            ## @ucan_close
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	callq	_netdev_priv
	movq	%rax, %rbx
	movq	_CAN_STATE_STOPPED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	leaq	8(%rbx), %rdi
	callq	_usb_kill_anchored_urbs
	leaq	4(%rbx), %rdi
	callq	_usb_kill_anchored_urbs
	movq	_UCAN_COMMAND_STOP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_ucan_ctrl_command_out
	testl	%eax, %eax
	jns	LBB0_2
## %bb.1:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_netdev_err
LBB0_2:
	movq	_UCAN_COMMAND_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_ucan_ctrl_command_out
	testl	%eax, %eax
	jns	LBB0_4
## %bb.3:
	movl	(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	callq	_netdev_err
LBB0_4:
	movq	%r14, %rdi
	callq	_netif_stop_queue
	movq	%rbx, %rdi
	callq	_ucan_release_context_array
	movl	(%rbx), %edi
	callq	_close_candev
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CAN_STATE_STOPPED,4,2          ## @CAN_STATE_STOPPED
	.comm	_UCAN_COMMAND_STOP,4,2          ## @UCAN_COMMAND_STOP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not stop device, code: %d\n"

	.comm	_UCAN_COMMAND_RESET,4,2         ## @UCAN_COMMAND_RESET
L_.str.1:                               ## @.str.1
	.asciz	"could not reset device, code: %d\n"

	.no_dead_strip	_ucan_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ucan_close
_ucan_close:                            ; @ucan_close
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x0
	bl	_netdev_priv
	mov	x19, x0
Lloh0:
	adrp	x8, _CAN_STATE_STOPPED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CAN_STATE_STOPPED@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x0, #12]
	add	x0, x0, #8
	bl	_usb_kill_anchored_urbs
	add	x0, x19, #4
	bl	_usb_kill_anchored_urbs
Lloh3:
	adrp	x8, _UCAN_COMMAND_STOP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _UCAN_COMMAND_STOP@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	mov	w3, #0
	bl	_ucan_ctrl_command_out
	tbz	w0, #31, LBB0_2
; %bb.1:
	mov	x2, x0
	ldr	w0, [x19]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_netdev_err
LBB0_2:
Lloh8:
	adrp	x8, _UCAN_COMMAND_RESET@GOTPAGE
Lloh9:
	ldr	x8, [x8, _UCAN_COMMAND_RESET@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	mov	w3, #0
	bl	_ucan_ctrl_command_out
	tbz	w0, #31, LBB0_4
; %bb.3:
	mov	x2, x0
	ldr	w0, [x19]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_netdev_err
LBB0_4:
	mov	x0, x20
	bl	_netif_stop_queue
	mov	x0, x19
	bl	_ucan_release_context_array
	ldr	w0, [x19]
	bl	_close_candev
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_CAN_STATE_STOPPED,4,2          ; @CAN_STATE_STOPPED
	.comm	_UCAN_COMMAND_STOP,4,2          ; @UCAN_COMMAND_STOP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not stop device, code: %d\n"

	.comm	_UCAN_COMMAND_RESET,4,2         ; @UCAN_COMMAND_RESET
l_.str.1:                               ; @.str.1
	.asciz	"could not reset device, code: %d\n"

	.no_dead_strip	_ucan_close
.subsections_via_symbols
