	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kvaser_usb_leaf_rx_error_update_can_state
_kvaser_usb_leaf_rx_error_update_can_state: ## @kvaser_usb_leaf_rx_error_update_can_state
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	32(%rdi), %rbx
	movq	40(%rdi), %r12
	movl	(%rsi), %edx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_netdev_dbg
	movl	8(%r15), %r13d
	movl	(%r14), %eax
	movq	_M16C_STATE_BUS_OFF@GOTPCREL(%rip), %rcx
	movq	_M16C_STATE_BUS_RESET@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	testl	%eax, %edx
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_2
## %bb.1:
	movq	_CAN_STATE_BUS_OFF@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
LBB0_2:
	movq	_M16C_STATE_BUS_PASSIVE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_25
LBB0_3:
	movq	_CAN_STATE_ERROR_PASSIVE@GOTPCREL(%rip), %rcx
LBB0_4:
	movl	(%rcx), %r12d
LBB0_5:
	testl	%eax, %eax
	jne	LBB0_6
## %bb.8:
	movq	_CAN_STATE_ERROR_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	cmpl	%r13d, %r12d
	je	LBB0_7
LBB0_9:
	movl	4(%r14), %eax
	xorl	%ecx, %ecx
	cmpl	8(%r14), %eax
	movl	%r12d, %edx
	cmovll	%ecx, %edx
	cmovlel	%r12d, %ecx
	movq	32(%r15), %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_can_change_state
	cmpq	$0, 24(%r15)
	jne	LBB0_10
	jmp	LBB0_13
LBB0_6:
	cmpl	%r13d, %r12d
	jne	LBB0_9
LBB0_7:
	cmpq	$0, 24(%r15)
	je	LBB0_13
LBB0_10:
	movq	_CAN_STATE_BUS_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %r13d
	jb	LBB0_13
## %bb.11:
	cmpl	%eax, %r12d
	jae	LBB0_13
## %bb.12:
	incl	16(%r15)
LBB0_13:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	cmpl	$128, %eax
	je	LBB0_17
## %bb.14:
	cmpl	$129, %eax
	jne	LBB0_24
## %bb.15:
	cmpl	$0, 16(%r14)
	je	LBB0_24
## %bb.16:
	incl	12(%r15)
	jmp	LBB0_23
LBB0_17:
	movl	12(%r14), %eax
	movq	_USBCAN_ERROR_STATE_TX_ERROR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_19
## %bb.18:
	incl	4(%rbx)
LBB0_19:
	movq	_USBCAN_ERROR_STATE_RX_ERROR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_21
## %bb.20:
	incl	(%rbx)
LBB0_21:
	movq	_USBCAN_ERROR_STATE_BUSERROR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_24
## %bb.22:
	leaq	12(%r15), %rbx
LBB0_23:
	incl	(%rbx)
LBB0_24:
	movl	4(%r14), %eax
	movl	%eax, (%r15)
	movl	8(%r14), %eax
	movl	%eax, 4(%r15)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_25:
	movq	_M16C_STATE_BUS_ERROR@GOTPCREL(%rip), %rcx
	movl	%r13d, %r12d
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.26:
	movq	_CAN_STATE_BUS_OFF@GOTPCREL(%rip), %rcx
	movl	%r13d, %r12d
	cmpl	(%rcx), %r13d
	jae	LBB0_5
## %bb.27:
	movl	4(%r14), %ecx
	cmpl	$127, %ecx
	jg	LBB0_3
## %bb.28:
	movl	8(%r14), %edx
	cmpl	$128, %edx
	jge	LBB0_3
## %bb.29:
	cmpl	$95, %ecx
	jg	LBB0_32
## %bb.30:
	cmpl	$96, %edx
	jge	LBB0_32
## %bb.31:
	movq	_CAN_STATE_ERROR_ACTIVE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
	cmpl	%r12d, %r13d
	cmovbl	%r13d, %r12d
	jmp	LBB0_5
LBB0_32:
	movq	_CAN_STATE_ERROR_WARNING@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error status: 0x%02x\n"

	.comm	_M16C_STATE_BUS_OFF,4,2         ## @M16C_STATE_BUS_OFF
	.comm	_M16C_STATE_BUS_RESET,4,2       ## @M16C_STATE_BUS_RESET
	.comm	_CAN_STATE_BUS_OFF,4,2          ## @CAN_STATE_BUS_OFF
	.comm	_M16C_STATE_BUS_PASSIVE,4,2     ## @M16C_STATE_BUS_PASSIVE
	.comm	_CAN_STATE_ERROR_PASSIVE,4,2    ## @CAN_STATE_ERROR_PASSIVE
	.comm	_M16C_STATE_BUS_ERROR,4,2       ## @M16C_STATE_BUS_ERROR
	.comm	_CAN_STATE_ERROR_WARNING,4,2    ## @CAN_STATE_ERROR_WARNING
	.comm	_CAN_STATE_ERROR_ACTIVE,4,2     ## @CAN_STATE_ERROR_ACTIVE
	.comm	_USBCAN_ERROR_STATE_TX_ERROR,4,2 ## @USBCAN_ERROR_STATE_TX_ERROR
	.comm	_USBCAN_ERROR_STATE_RX_ERROR,4,2 ## @USBCAN_ERROR_STATE_RX_ERROR
	.comm	_USBCAN_ERROR_STATE_BUSERROR,4,2 ## @USBCAN_ERROR_STATE_BUSERROR
	.no_dead_strip	_kvaser_usb_leaf_rx_error_update_can_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kvaser_usb_leaf_rx_error_update_can_state
_kvaser_usb_leaf_rx_error_update_can_state: ; @kvaser_usb_leaf_rx_error_update_can_state
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x22, x2
	mov	x20, x1
	mov	x19, x0
	ldp	x21, x23, [x0, #32]
	ldr	w2, [x1]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_netdev_dbg
	ldr	w24, [x19, #8]
	ldr	w8, [x20]
Lloh2:
	adrp	x9, _M16C_STATE_BUS_OFF@GOTPAGE
Lloh3:
	ldr	x9, [x9, _M16C_STATE_BUS_OFF@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
Lloh5:
	adrp	x10, _M16C_STATE_BUS_RESET@GOTPAGE
Lloh6:
	ldr	x10, [x10, _M16C_STATE_BUS_RESET@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	orr	w10, w10, w9
Lloh8:
	adrp	x25, _CAN_STATE_BUS_OFF@GOTPAGE
Lloh9:
	ldr	x25, [x25, _CAN_STATE_BUS_OFF@GOTPAGEOFF]
Lloh10:
	adrp	x9, _CAN_STATE_ERROR_ACTIVE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _CAN_STATE_ERROR_ACTIVE@GOTPAGEOFF]
	tst	w10, w8
	b.eq	LBB0_2
; %bb.1:
	ldr	w10, [x25]
	b	LBB0_5
LBB0_2:
Lloh12:
	adrp	x10, _M16C_STATE_BUS_PASSIVE@GOTPAGE
Lloh13:
	ldr	x10, [x10, _M16C_STATE_BUS_PASSIVE@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	tst	w10, w8
	b.eq	LBB0_22
LBB0_3:
Lloh15:
	adrp	x10, _CAN_STATE_ERROR_PASSIVE@GOTPAGE
Lloh16:
	ldr	x10, [x10, _CAN_STATE_ERROR_PASSIVE@GOTPAGEOFF]
LBB0_4:
	ldr	w10, [x10]
LBB0_5:
	ldr	w9, [x9]
	cmp	w8, #0
	csel	w26, w9, w10, eq
	cmp	w26, w24
	b.eq	LBB0_7
; %bb.6:
	ldp	w8, w9, [x20, #4]
	cmp	w8, w9
	csel	w2, wzr, w26, lt
	csel	w3, wzr, w26, gt
	ldr	x0, [x19, #32]
	mov	x1, x22
	bl	_can_change_state
LBB0_7:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_10
; %bb.8:
	ldr	w8, [x25]
	cmp	w24, w8
	ccmp	w26, w8, #2, hs
	b.hs	LBB0_10
; %bb.9:
	ldr	w8, [x19, #16]
	add	w8, w8, #1
	str	w8, [x19, #16]
LBB0_10:
	ldr	w8, [x23]
	cmp	w8, #128
	b.eq	LBB0_14
; %bb.11:
	cmp	w8, #129
	b.ne	LBB0_21
; %bb.12:
	ldr	w8, [x20, #16]
	cbz	w8, LBB0_21
; %bb.13:
	ldr	w8, [x19, #12]
	add	w8, w8, #1
	str	w8, [x19, #12]
	b	LBB0_20
LBB0_14:
	ldr	w8, [x20, #12]
Lloh17:
	adrp	x9, _USBCAN_ERROR_STATE_TX_ERROR@GOTPAGE
Lloh18:
	ldr	x9, [x9, _USBCAN_ERROR_STATE_TX_ERROR@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_16
; %bb.15:
	ldr	w9, [x21, #4]
	add	w9, w9, #1
	str	w9, [x21, #4]
LBB0_16:
Lloh20:
	adrp	x9, _USBCAN_ERROR_STATE_RX_ERROR@GOTPAGE
Lloh21:
	ldr	x9, [x9, _USBCAN_ERROR_STATE_RX_ERROR@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_18
; %bb.17:
	ldr	w9, [x21]
	add	w9, w9, #1
	str	w9, [x21]
LBB0_18:
Lloh23:
	adrp	x9, _USBCAN_ERROR_STATE_BUSERROR@GOTPAGE
Lloh24:
	ldr	x9, [x9, _USBCAN_ERROR_STATE_BUSERROR@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_21
; %bb.19:
	add	x21, x19, #12
LBB0_20:
	ldr	w8, [x21]
	add	w8, w8, #1
	str	w8, [x21]
LBB0_21:
	ldur	d0, [x20, #4]
	str	d0, [x19]
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_22:
Lloh26:
	adrp	x10, _M16C_STATE_BUS_ERROR@GOTPAGE
Lloh27:
	ldr	x10, [x10, _M16C_STATE_BUS_ERROR@GOTPAGEOFF]
Lloh28:
	ldr	w10, [x10]
	and	w10, w10, w8
	ldr	w11, [x25]
	cmp	w10, #0
	ccmp	w24, w11, #2, ne
	mov	x10, x24
	b.hs	LBB0_5
; %bb.23:
	ldr	w10, [x20, #4]
	cmp	w10, #127
	b.gt	LBB0_3
; %bb.24:
	ldr	w11, [x20, #8]
	cmp	w11, #128
	b.ge	LBB0_3
; %bb.25:
	cmp	w10, #95
	b.gt	LBB0_28
; %bb.26:
	cmp	w11, #96
	b.ge	LBB0_28
; %bb.27:
	ldr	w10, [x9]
	cmp	w24, w10
	csel	w10, w24, w10, lo
	b	LBB0_5
LBB0_28:
Lloh29:
	adrp	x10, _CAN_STATE_ERROR_WARNING@GOTPAGE
Lloh30:
	ldr	x10, [x10, _CAN_STATE_ERROR_WARNING@GOTPAGEOFF]
	b	LBB0_4
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error status: 0x%02x\n"

	.comm	_M16C_STATE_BUS_OFF,4,2         ; @M16C_STATE_BUS_OFF
	.comm	_M16C_STATE_BUS_RESET,4,2       ; @M16C_STATE_BUS_RESET
	.comm	_CAN_STATE_BUS_OFF,4,2          ; @CAN_STATE_BUS_OFF
	.comm	_M16C_STATE_BUS_PASSIVE,4,2     ; @M16C_STATE_BUS_PASSIVE
	.comm	_CAN_STATE_ERROR_PASSIVE,4,2    ; @CAN_STATE_ERROR_PASSIVE
	.comm	_M16C_STATE_BUS_ERROR,4,2       ; @M16C_STATE_BUS_ERROR
	.comm	_CAN_STATE_ERROR_WARNING,4,2    ; @CAN_STATE_ERROR_WARNING
	.comm	_CAN_STATE_ERROR_ACTIVE,4,2     ; @CAN_STATE_ERROR_ACTIVE
	.comm	_USBCAN_ERROR_STATE_TX_ERROR,4,2 ; @USBCAN_ERROR_STATE_TX_ERROR
	.comm	_USBCAN_ERROR_STATE_RX_ERROR,4,2 ; @USBCAN_ERROR_STATE_RX_ERROR
	.comm	_USBCAN_ERROR_STATE_BUSERROR,4,2 ; @USBCAN_ERROR_STATE_BUSERROR
	.no_dead_strip	_kvaser_usb_leaf_rx_error_update_can_state
.subsections_via_symbols
