	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kvaser_usb_hydra_error_frame
_kvaser_usb_hydra_error_frame:          ## @kvaser_usb_hydra_error_frame
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	40(%rdi), %r14
	incl	32(%rdi)
	movl	%edx, %r15d
	incl	12(%r14)
	movl	16(%rsi), %eax
	movups	(%rsi), %xmm0
	movaps	%xmm0, -80(%rbp)
	movl	16(%rdi), %r13d
	leaq	-80(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	movl	%eax, %esi
	callq	_kvaser_usb_hydra_bus_status_to_can_state
	leaq	-56(%rbp), %rsi
	movq	%r14, %rdi
	callq	_alloc_can_err_skb
	movq	%rax, %r12
	movl	-44(%rbp), %ecx
	cmpl	%r13d, %ecx
	je	LBB0_11
## %bb.1:
	testq	%r12, %r12
	je	LBB0_7
## %bb.2:
	movq	-80(%rbp), %rax
	cmpq	-72(%rbp), %rax
	movq	_CAN_STATE_ERROR_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%ecx, %edx
	cmovll	%eax, %edx
	cmovgl	%eax, %ecx
	movq	-56(%rbp), %rsi
	movq	%r14, %rdi
	callq	_can_change_state
	cmpq	$0, 24(%rbx)
	je	LBB0_3
## %bb.4:
	movq	_CAN_STATE_BUS_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	-44(%rbp), %ecx
	cmpl	%eax, %r13d
	jb	LBB0_7
## %bb.5:
	cmpl	%eax, %ecx
	jae	LBB0_7
## %bb.6:
	movq	_CAN_ERR_RESTARTED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-56(%rbp), %rdx
	orl	%eax, 16(%rdx)
	jmp	LBB0_7
LBB0_3:
	movl	-44(%rbp), %ecx
LBB0_7:
	movq	_CAN_STATE_BUS_OFF@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jne	LBB0_11
## %bb.8:
	cmpq	$0, 24(%rbx)
	jne	LBB0_10
## %bb.9:
	movq	_CMD_STOP_CHIP_REQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_kvaser_usb_hydra_send_simple_cmd_async
LBB0_10:
	movq	%r14, %rdi
	callq	_can_bus_off
LBB0_11:
	testq	%r12, %r12
	je	LBB0_12
## %bb.13:
	movq	%r12, %rdi
	callq	_skb_hwtstamps
	movl	%r15d, (%rax)
	movq	_CAN_ERR_BUSERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-56(%rbp), %rcx
	orl	%eax, 16(%rcx)
	movq	(%rcx), %rax
	movaps	-80(%rbp), %xmm0
	movups	%xmm0, 48(%rax)
	incl	4(%r14)
	movl	8(%rcx), %eax
	addl	%eax, (%r14)
	movq	%r12, %rdi
	callq	_netif_rx
	movaps	-80(%rbp), %xmm0
	movups	%xmm0, (%rbx)
	jmp	LBB0_14
LBB0_12:
	incl	8(%r14)
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_netdev_warn
LBB0_14:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CAN_STATE_ERROR_ACTIVE,4,2     ## @CAN_STATE_ERROR_ACTIVE
	.comm	_CAN_STATE_BUS_OFF,4,2          ## @CAN_STATE_BUS_OFF
	.comm	_CAN_ERR_RESTARTED,4,2          ## @CAN_ERR_RESTARTED
	.comm	_CMD_STOP_CHIP_REQ,4,2          ## @CMD_STOP_CHIP_REQ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No memory left for err_skb\n"

	.comm	_CAN_ERR_BUSERROR,4,2           ## @CAN_ERR_BUSERROR
	.no_dead_strip	_kvaser_usb_hydra_error_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kvaser_usb_hydra_error_frame
_kvaser_usb_hydra_error_frame:          ; @kvaser_usb_hydra_error_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x21, x2
	mov	x19, x0
	ldr	x20, [x0, #40]
	ldr	w8, [x0, #32]
	add	w8, w8, #1
	str	w8, [x0, #32]
	ldr	w8, [x20, #12]
	add	w8, w8, #1
	str	w8, [x20, #12]
	ldr	w8, [x1, #16]
	ldr	q0, [x1]
	str	q0, [sp, #16]
	ldr	w24, [x0, #16]
	add	x2, sp, #16
	add	x3, sp, #12
	mov	x1, x8
	bl	_kvaser_usb_hydra_bus_status_to_can_state
	add	x1, sp, #40
	mov	x0, x20
	bl	_alloc_can_err_skb
	mov	x22, x0
	ldr	w8, [sp, #12]
	cmp	w8, w24
	b.eq	LBB0_10
; %bb.1:
Lloh0:
	adrp	x23, _CAN_STATE_BUS_OFF@GOTPAGE
Lloh1:
	ldr	x23, [x23, _CAN_STATE_BUS_OFF@GOTPAGEOFF]
	cbz	x22, LBB0_6
; %bb.2:
Lloh2:
	adrp	x9, _CAN_STATE_ERROR_ACTIVE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _CAN_STATE_ERROR_ACTIVE@GOTPAGEOFF]
	ldp	x10, x11, [sp, #16]
Lloh4:
	ldr	w9, [x9]
	cmp	x10, x11
	csel	w2, w9, w8, lt
	csel	w3, w9, w8, gt
	ldr	x1, [sp, #40]
	mov	x0, x20
	bl	_can_change_state
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_5
; %bb.3:
	ldr	w9, [x23]
	ldr	w8, [sp, #12]
	cmp	w24, w9
	ccmp	w8, w9, #2, hs
	b.hs	LBB0_6
; %bb.4:
Lloh5:
	adrp	x9, _CAN_ERR_RESTARTED@GOTPAGE
Lloh6:
	ldr	x9, [x9, _CAN_ERR_RESTARTED@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	ldr	x10, [sp, #40]
	ldr	w11, [x10, #16]
	orr	w9, w11, w9
	str	w9, [x10, #16]
	b	LBB0_6
LBB0_5:
	ldr	w8, [sp, #12]
LBB0_6:
	ldr	w9, [x23]
	cmp	w8, w9
	b.ne	LBB0_10
; %bb.7:
	ldr	x8, [x19, #24]
	cbnz	x8, LBB0_9
; %bb.8:
Lloh8:
	adrp	x8, _CMD_STOP_CHIP_REQ@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CMD_STOP_CHIP_REQ@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_kvaser_usb_hydra_send_simple_cmd_async
LBB0_9:
	mov	x0, x20
	bl	_can_bus_off
LBB0_10:
	cbz	x22, LBB0_12
; %bb.11:
	mov	x0, x22
	bl	_skb_hwtstamps
	str	w21, [x0]
Lloh11:
	adrp	x8, _CAN_ERR_BUSERROR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CAN_ERR_BUSERROR@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	ldr	x9, [sp, #40]
	ldr	w10, [x9, #16]
	orr	w8, w10, w8
	str	w8, [x9, #16]
	ldr	x8, [x9]
	ldr	q0, [sp, #16]
	str	q0, [x8, #48]
	add	x8, x9, #8
	ldr	d0, [x20]
	movi.2s	v1, #1
	ld1.s	{ v1 }[0], [x8]
	add.2s	v0, v0, v1
	str	d0, [x20]
	mov	x0, x22
	bl	_netif_rx
	ldr	q0, [sp, #16]
	str	q0, [x19]
	b	LBB0_13
LBB0_12:
	ldr	w8, [x20, #8]
	add	w8, w8, #1
	str	w8, [x20, #8]
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_netdev_warn
LBB0_13:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_CAN_STATE_ERROR_ACTIVE,4,2     ; @CAN_STATE_ERROR_ACTIVE
	.comm	_CAN_STATE_BUS_OFF,4,2          ; @CAN_STATE_BUS_OFF
	.comm	_CAN_ERR_RESTARTED,4,2          ; @CAN_ERR_RESTARTED
	.comm	_CMD_STOP_CHIP_REQ,4,2          ; @CMD_STOP_CHIP_REQ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No memory left for err_skb\n"

	.comm	_CAN_ERR_BUSERROR,4,2           ; @CAN_ERR_BUSERROR
	.no_dead_strip	_kvaser_usb_hydra_error_frame
.subsections_via_symbols
