	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function esd_usb2_close
_esd_usb2_close:                        ## @esd_usb2_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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_netdev_priv
	movq	%rax, %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$48, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	_CMD_IDADD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rbx)
	movq	_ESD_MAX_ID_SEGMENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	2(%rax), %ecx
	movl	%ecx, 24(%rbx)
	movl	8(%r15), %ecx
	movl	%ecx, 44(%rbx)
	movq	_ESD_ID_ENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 40(%rbx)
	testl	%eax, %eax
	js	LBB0_4
## %bb.3:
	movq	32(%rbx), %rdi
	leaq	8(,%rax,8), %rsi
	callq	___bzero
LBB0_4:
	movl	4(%r15), %edi
	movq	%rbx, %rsi
	callq	_esd_usb2_send_msg
	testq	%rax, %rax
	jns	LBB0_6
## %bb.5:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_netdev_err
LBB0_6:
	movl	$2, 24(%rbx)
	movq	_CMD_SETBAUD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rbx)
	movl	8(%r15), %eax
	movl	%eax, 16(%rbx)
	movq	$0, 8(%rbx)
	movq	_ESD_USB2_NO_BAUDRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_le32
	movl	%eax, (%rbx)
	movl	4(%r15), %edi
	movq	%rbx, %rsi
	callq	_esd_usb2_send_msg
	testq	%rax, %rax
	jns	LBB0_8
## %bb.7:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_netdev_err
LBB0_8:
	movq	_CAN_STATE_STOPPED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	movq	%r14, %rdi
	callq	_netif_stop_queue
	movq	%r14, %rdi
	callq	_close_candev
	movq	%rbx, %rdi
	callq	_kfree
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_CMD_IDADD,4,2                  ## @CMD_IDADD
	.comm	_ESD_MAX_ID_SEGMENT,4,2         ## @ESD_MAX_ID_SEGMENT
	.comm	_ESD_ID_ENABLE,4,2              ## @ESD_ID_ENABLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sending idadd message failed\n"

	.comm	_CMD_SETBAUD,4,2                ## @CMD_SETBAUD
	.comm	_ESD_USB2_NO_BAUDRATE,4,2       ## @ESD_USB2_NO_BAUDRATE
L_.str.1:                               ## @.str.1
	.asciz	"sending setbaud message failed\n"

	.comm	_CAN_STATE_STOPPED,4,2          ## @CAN_STATE_STOPPED
	.no_dead_strip	_esd_usb2_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function esd_usb2_close
_esd_usb2_close:                        ; @esd_usb2_close
	.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	x19, x0
	bl	_netdev_priv
	mov	x21, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #48
	bl	_kmalloc
	cbz	x0, LBB0_8
; %bb.1:
	mov	x20, x0
Lloh3:
	adrp	x8, _CMD_IDADD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CMD_IDADD@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x8]
Lloh6:
	adrp	x8, _ESD_MAX_ID_SEGMENT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ESD_MAX_ID_SEGMENT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	add	w10, w8, #2
	stp	w10, w9, [x0, #24]
	ldr	w9, [x21, #8]
Lloh9:
	adrp	x10, _ESD_ID_ENABLE@GOTPAGE
Lloh10:
	ldr	x10, [x10, _ESD_ID_ENABLE@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	stp	w10, w9, [x0, #40]
	tbnz	w8, #31, LBB0_3
; %bb.2:
	ldr	x0, [x20, #32]
	lsl	x8, x8, #3
	add	x1, x8, #8
	bl	_bzero
LBB0_3:
	ldr	w0, [x21, #4]
	mov	x1, x20
	bl	_esd_usb2_send_msg
	tbz	x0, #63, LBB0_5
; %bb.4:
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_netdev_err
LBB0_5:
	mov	w8, #2
Lloh14:
	adrp	x9, _CMD_SETBAUD@GOTPAGE
Lloh15:
	ldr	x9, [x9, _CMD_SETBAUD@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	stp	w8, w9, [x20, #24]
	ldr	w8, [x21, #8]
	str	w8, [x20, #16]
	str	xzr, [x20, #8]
Lloh17:
	adrp	x8, _ESD_USB2_NO_BAUDRATE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ESD_USB2_NO_BAUDRATE@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	bl	_cpu_to_le32
	str	w0, [x20]
	ldr	w0, [x21, #4]
	mov	x1, x20
	bl	_esd_usb2_send_msg
	tbz	x0, #63, LBB0_7
; %bb.6:
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_netdev_err
LBB0_7:
Lloh22:
	adrp	x8, _CAN_STATE_STOPPED@GOTPAGE
Lloh23:
	ldr	x8, [x8, _CAN_STATE_STOPPED@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	str	w8, [x21]
	mov	x0, x19
	bl	_netif_stop_queue
	mov	x0, x19
	bl	_close_candev
	mov	x0, x20
	bl	_kfree
	mov	w0, #0
	b	LBB0_9
LBB0_8:
Lloh25:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CMD_IDADD,4,2                  ; @CMD_IDADD
	.comm	_ESD_MAX_ID_SEGMENT,4,2         ; @ESD_MAX_ID_SEGMENT
	.comm	_ESD_ID_ENABLE,4,2              ; @ESD_ID_ENABLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sending idadd message failed\n"

	.comm	_CMD_SETBAUD,4,2                ; @CMD_SETBAUD
	.comm	_ESD_USB2_NO_BAUDRATE,4,2       ; @ESD_USB2_NO_BAUDRATE
l_.str.1:                               ; @.str.1
	.asciz	"sending setbaud message failed\n"

	.comm	_CAN_STATE_STOPPED,4,2          ; @CAN_STATE_STOPPED
	.no_dead_strip	_esd_usb2_close
.subsections_via_symbols
