	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ucan_handle_error_frame
_ucan_handle_error_frame:               ## @ucan_handle_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_CAN_ERR_LOSTARB@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	je	LBB0_2
## %bb.1:
	incl	28(%rdi)
LBB0_2:
	movq	_CAN_ERR_BUSERROR@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	je	LBB0_4
## %bb.3:
	incl	24(%rdi)
LBB0_4:
	movl	8(%rdi), %r9d
	movq	(%rdi), %r8
	movq	_CAN_ERR_ACK@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	je	LBB0_6
## %bb.5:
	incl	4(%r8)
LBB0_6:
	movq	_CAN_ERR_BUSOFF@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	movl	$130, %eax
	cmovel	%r9d, %eax
	movq	_CAN_ERR_CRTL@GOTPCREL(%rip), %rbx
	testl	%edx, (%rbx)
	je	LBB0_12
## %bb.7:
	movq	(%rsi), %rbx
	movl	4(%rbx), %ebx
	movq	_CAN_ERR_CRTL_RX_OVERFLOW@GOTPCREL(%rip), %rcx
	testl	%ebx, (%rcx)
	je	LBB0_9
## %bb.8:
	incl	8(%r8)
LBB0_9:
	movq	_CAN_ERR_CRTL_ACTIVE@GOTPCREL(%rip), %rcx
	testl	%ebx, (%rcx)
	je	LBB0_11
## %bb.10:
	movq	_CAN_STATE_ERROR_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_11:
	movq	_CAN_ERR_CRTL_RX_WARNING@GOTPCREL(%rip), %r10
	movq	_CAN_ERR_CRTL_TX_WARNING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%r10), %ecx
	testl	%ebx, %ecx
	movl	$128, %ecx
	cmovel	%eax, %ecx
	movq	_CAN_ERR_CRTL_RX_PASSIVE@GOTPCREL(%rip), %r10
	movq	_CAN_ERR_CRTL_TX_PASSIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%r10), %eax
	testl	%ebx, %eax
	movl	$129, %eax
	cmovel	%ecx, %eax
LBB0_12:
	movq	_CAN_ERR_PROT@GOTPCREL(%rip), %rcx
	testl	%edx, (%rcx)
	je	LBB0_14
## %bb.13:
	movq	(%rsi), %rcx
	movq	_CAN_ERR_PROT_TX@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	xorl	%esi, %esi
	andl	8(%rcx), %edx
	setne	%sil
	incl	(%r8,%rsi,4)
LBB0_14:
	xorl	%ebx, %ebx
	cmpl	%eax, %r9d
	je	LBB0_22
## %bb.15:
	movl	%eax, 8(%rdi)
	movl	$1, %ebx
	ja	LBB0_22
## %bb.16:
	cmpl	$128, %eax
	je	LBB0_21
## %bb.17:
	cmpl	$129, %eax
	je	LBB0_20
## %bb.18:
	cmpl	$130, %eax
	jne	LBB0_22
## %bb.19:
	incl	20(%rdi)
	movq	%r8, %rdi
	callq	_can_bus_off
	jmp	LBB0_22
LBB0_21:
	incl	12(%rdi)
	jmp	LBB0_22
LBB0_20:
	incl	16(%rdi)
LBB0_22:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CAN_ERR_LOSTARB,4,2            ## @CAN_ERR_LOSTARB
	.comm	_CAN_ERR_BUSERROR,4,2           ## @CAN_ERR_BUSERROR
	.comm	_CAN_ERR_ACK,4,2                ## @CAN_ERR_ACK
	.comm	_CAN_ERR_BUSOFF,4,2             ## @CAN_ERR_BUSOFF
	.comm	_CAN_ERR_CRTL,4,2               ## @CAN_ERR_CRTL
	.comm	_CAN_ERR_CRTL_RX_OVERFLOW,4,2   ## @CAN_ERR_CRTL_RX_OVERFLOW
	.comm	_CAN_ERR_CRTL_ACTIVE,4,2        ## @CAN_ERR_CRTL_ACTIVE
	.comm	_CAN_STATE_ERROR_ACTIVE,4,2     ## @CAN_STATE_ERROR_ACTIVE
	.comm	_CAN_ERR_CRTL_RX_WARNING,4,2    ## @CAN_ERR_CRTL_RX_WARNING
	.comm	_CAN_ERR_CRTL_TX_WARNING,4,2    ## @CAN_ERR_CRTL_TX_WARNING
	.comm	_CAN_ERR_CRTL_RX_PASSIVE,4,2    ## @CAN_ERR_CRTL_RX_PASSIVE
	.comm	_CAN_ERR_CRTL_TX_PASSIVE,4,2    ## @CAN_ERR_CRTL_TX_PASSIVE
	.comm	_CAN_ERR_PROT,4,2               ## @CAN_ERR_PROT
	.comm	_CAN_ERR_PROT_TX,4,2            ## @CAN_ERR_PROT_TX
	.no_dead_strip	_ucan_handle_error_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ucan_handle_error_frame
_ucan_handle_error_frame:               ; @ucan_handle_error_frame
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh0:
	adrp	x8, _CAN_ERR_LOSTARB@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CAN_ERR_LOSTARB@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w2
	b.eq	LBB0_2
; %bb.1:
	ldr	w8, [x0, #28]
	add	w8, w8, #1
	str	w8, [x0, #28]
LBB0_2:
	ldr	x8, [x0]
Lloh3:
	adrp	x9, _CAN_ERR_BUSERROR@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CAN_ERR_BUSERROR@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w2
	b.eq	LBB0_4
; %bb.3:
	ldr	w9, [x0, #24]
	add	w9, w9, #1
	str	w9, [x0, #24]
LBB0_4:
	ldr	w9, [x0, #8]
Lloh6:
	adrp	x10, _CAN_ERR_ACK@GOTPAGE
Lloh7:
	ldr	x10, [x10, _CAN_ERR_ACK@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	tst	w10, w2
	b.eq	LBB0_6
; %bb.5:
	ldr	w10, [x8, #4]
	add	w10, w10, #1
	str	w10, [x8, #4]
LBB0_6:
Lloh9:
	adrp	x10, _CAN_ERR_BUSOFF@GOTPAGE
Lloh10:
	ldr	x10, [x10, _CAN_ERR_BUSOFF@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	tst	w10, w2
	mov	w10, #130
	csel	w10, w9, w10, eq
Lloh12:
	adrp	x11, _CAN_ERR_CRTL@GOTPAGE
Lloh13:
	ldr	x11, [x11, _CAN_ERR_CRTL@GOTPAGEOFF]
Lloh14:
	ldr	w11, [x11]
	tst	w11, w2
	b.eq	LBB0_10
; %bb.7:
	ldr	x11, [x1]
	ldr	w11, [x11, #4]
Lloh15:
	adrp	x12, _CAN_ERR_CRTL_RX_OVERFLOW@GOTPAGE
Lloh16:
	ldr	x12, [x12, _CAN_ERR_CRTL_RX_OVERFLOW@GOTPAGEOFF]
Lloh17:
	ldr	w12, [x12]
	tst	w12, w11
	b.eq	LBB0_9
; %bb.8:
	ldr	w12, [x8, #8]
	add	w12, w12, #1
	str	w12, [x8, #8]
LBB0_9:
Lloh18:
	adrp	x12, _CAN_ERR_CRTL_ACTIVE@GOTPAGE
Lloh19:
	ldr	x12, [x12, _CAN_ERR_CRTL_ACTIVE@GOTPAGEOFF]
Lloh20:
	adrp	x13, _CAN_STATE_ERROR_ACTIVE@GOTPAGE
Lloh21:
	ldr	x13, [x13, _CAN_STATE_ERROR_ACTIVE@GOTPAGEOFF]
Lloh22:
	ldr	w12, [x12]
Lloh23:
	ldr	w13, [x13]
	tst	w12, w11
	csel	w10, w10, w13, eq
Lloh24:
	adrp	x12, _CAN_ERR_CRTL_RX_WARNING@GOTPAGE
Lloh25:
	ldr	x12, [x12, _CAN_ERR_CRTL_RX_WARNING@GOTPAGEOFF]
Lloh26:
	ldr	w12, [x12]
Lloh27:
	adrp	x13, _CAN_ERR_CRTL_TX_WARNING@GOTPAGE
Lloh28:
	ldr	x13, [x13, _CAN_ERR_CRTL_TX_WARNING@GOTPAGEOFF]
Lloh29:
	ldr	w13, [x13]
	orr	w12, w13, w12
	tst	w12, w11
	mov	w12, #128
	csel	w10, w10, w12, eq
Lloh30:
	adrp	x12, _CAN_ERR_CRTL_RX_PASSIVE@GOTPAGE
Lloh31:
	ldr	x12, [x12, _CAN_ERR_CRTL_RX_PASSIVE@GOTPAGEOFF]
Lloh32:
	adrp	x13, _CAN_ERR_CRTL_TX_PASSIVE@GOTPAGE
Lloh33:
	ldr	x13, [x13, _CAN_ERR_CRTL_TX_PASSIVE@GOTPAGEOFF]
Lloh34:
	ldr	w12, [x12]
Lloh35:
	ldr	w13, [x13]
	orr	w12, w13, w12
	tst	w12, w11
	mov	w11, #129
	csel	w10, w10, w11, eq
LBB0_10:
Lloh36:
	adrp	x11, _CAN_ERR_PROT@GOTPAGE
Lloh37:
	ldr	x11, [x11, _CAN_ERR_PROT@GOTPAGEOFF]
Lloh38:
	ldr	w11, [x11]
	tst	w11, w2
	b.eq	LBB0_12
; %bb.11:
	ldr	x11, [x1]
	ldr	w11, [x11, #8]
Lloh39:
	adrp	x12, _CAN_ERR_PROT_TX@GOTPAGE
Lloh40:
	ldr	x12, [x12, _CAN_ERR_PROT_TX@GOTPAGEOFF]
Lloh41:
	ldr	w12, [x12]
	tst	w12, w11
	cset	w11, ne
	lsl	x11, x11, #2
	ldr	w12, [x8, x11]
	add	w12, w12, #1
	str	w12, [x8, x11]
LBB0_12:
	cmp	w9, w10
	b.ne	LBB0_14
; %bb.13:
	mov	w0, #0
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_14:
	str	w10, [x0, #8]
	cmp	w9, w10
	b.hi	LBB0_21
; %bb.15:
	cmp	w10, #128
	b.eq	LBB0_19
; %bb.16:
	cmp	w10, #129
	b.eq	LBB0_20
; %bb.17:
	cmp	w10, #130
	b.ne	LBB0_21
; %bb.18:
	ldr	w9, [x0, #20]
	add	w9, w9, #1
	str	w9, [x0, #20]
	mov	x0, x8
	bl	_can_bus_off
	b	LBB0_21
LBB0_19:
	ldr	w8, [x0, #12]
	add	w8, w8, #1
	str	w8, [x0, #12]
	b	LBB0_21
LBB0_20:
	ldr	w8, [x0, #16]
	add	w8, w8, #1
	str	w8, [x0, #16]
LBB0_21:
	mov	w0, #1
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh34
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh22
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_CAN_ERR_LOSTARB,4,2            ; @CAN_ERR_LOSTARB
	.comm	_CAN_ERR_BUSERROR,4,2           ; @CAN_ERR_BUSERROR
	.comm	_CAN_ERR_ACK,4,2                ; @CAN_ERR_ACK
	.comm	_CAN_ERR_BUSOFF,4,2             ; @CAN_ERR_BUSOFF
	.comm	_CAN_ERR_CRTL,4,2               ; @CAN_ERR_CRTL
	.comm	_CAN_ERR_CRTL_RX_OVERFLOW,4,2   ; @CAN_ERR_CRTL_RX_OVERFLOW
	.comm	_CAN_ERR_CRTL_ACTIVE,4,2        ; @CAN_ERR_CRTL_ACTIVE
	.comm	_CAN_STATE_ERROR_ACTIVE,4,2     ; @CAN_STATE_ERROR_ACTIVE
	.comm	_CAN_ERR_CRTL_RX_WARNING,4,2    ; @CAN_ERR_CRTL_RX_WARNING
	.comm	_CAN_ERR_CRTL_TX_WARNING,4,2    ; @CAN_ERR_CRTL_TX_WARNING
	.comm	_CAN_ERR_CRTL_RX_PASSIVE,4,2    ; @CAN_ERR_CRTL_RX_PASSIVE
	.comm	_CAN_ERR_CRTL_TX_PASSIVE,4,2    ; @CAN_ERR_CRTL_TX_PASSIVE
	.comm	_CAN_ERR_PROT,4,2               ; @CAN_ERR_PROT
	.comm	_CAN_ERR_PROT_TX,4,2            ; @CAN_ERR_PROT_TX
	.no_dead_strip	_ucan_handle_error_frame
.subsections_via_symbols
