	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function at91_get_state_by_bec
_at91_get_state_by_bec:                 ## @at91_get_state_by_bec
	.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	%rsi, %rbx
	leaq	-16(%rbp), %rsi
	callq	_at91_get_berr_counter
	testl	%eax, %eax
	jne	LBB0_11
## %bb.1:
	movl	-16(%rbp), %ecx
	movl	-12(%rbp), %esi
	cmpl	$95, %ecx
	jg	LBB0_4
## %bb.2:
	cmpl	$96, %esi
	jge	LBB0_4
## %bb.3:
	movq	_CAN_STATE_ERROR_ACTIVE@GOTPCREL(%rip), %rdx
	jmp	LBB0_10
LBB0_4:
	cmpl	$127, %ecx
	jg	LBB0_7
## %bb.5:
	cmpl	$128, %esi
	jge	LBB0_7
## %bb.6:
	movq	_CAN_STATE_ERROR_WARNING@GOTPCREL(%rip), %rdx
	jmp	LBB0_10
LBB0_7:
	movq	_CAN_STATE_BUS_OFF@GOTPCREL(%rip), %rdx
	movq	%rdx, %rdi
	cmpl	$256, %esi                      ## imm = 0x100
	jge	LBB0_9
## %bb.8:
	movq	_CAN_STATE_ERROR_PASSIVE@GOTPCREL(%rip), %rdi
LBB0_9:
	cmpl	$256, %ecx                      ## imm = 0x100
	cmovlq	%rdi, %rdx
LBB0_10:
	movl	(%rdx), %ecx
	movl	%ecx, (%rbx)
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CAN_STATE_ERROR_ACTIVE,4,2     ## @CAN_STATE_ERROR_ACTIVE
	.comm	_CAN_STATE_ERROR_WARNING,4,2    ## @CAN_STATE_ERROR_WARNING
	.comm	_CAN_STATE_ERROR_PASSIVE,4,2    ## @CAN_STATE_ERROR_PASSIVE
	.comm	_CAN_STATE_BUS_OFF,4,2          ## @CAN_STATE_BUS_OFF
	.no_dead_strip	_at91_get_state_by_bec
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function at91_get_state_by_bec
_at91_get_state_by_bec:                 ; @at91_get_state_by_bec
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x1
	add	x1, sp, #8
	bl	_at91_get_berr_counter
	cbnz	w0, LBB0_9
; %bb.1:
	ldp	w8, w9, [sp, #8]
	cmp	w8, #95
	b.gt	LBB0_4
; %bb.2:
	cmp	w9, #96
	b.ge	LBB0_4
; %bb.3:
Lloh0:
	adrp	x8, _CAN_STATE_ERROR_ACTIVE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CAN_STATE_ERROR_ACTIVE@GOTPAGEOFF]
	b	LBB0_8
LBB0_4:
	cmp	w8, #127
	b.gt	LBB0_7
; %bb.5:
	cmp	w9, #128
	b.ge	LBB0_7
; %bb.6:
Lloh2:
	adrp	x8, _CAN_STATE_ERROR_WARNING@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CAN_STATE_ERROR_WARNING@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
	cmp	w9, #256
	mov	w9, #256
	ccmp	w8, w9, #0, lt
Lloh4:
	adrp	x8, _CAN_STATE_BUS_OFF@GOTPAGE
Lloh5:
	ldr	x8, [x8, _CAN_STATE_BUS_OFF@GOTPAGEOFF]
Lloh6:
	adrp	x9, _CAN_STATE_ERROR_PASSIVE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CAN_STATE_ERROR_PASSIVE@GOTPAGEOFF]
	csel	x8, x9, x8, lt
LBB0_8:
	ldr	w8, [x8]
	str	w8, [x19]
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_CAN_STATE_ERROR_ACTIVE,4,2     ; @CAN_STATE_ERROR_ACTIVE
	.comm	_CAN_STATE_ERROR_WARNING,4,2    ; @CAN_STATE_ERROR_WARNING
	.comm	_CAN_STATE_ERROR_PASSIVE,4,2    ; @CAN_STATE_ERROR_PASSIVE
	.comm	_CAN_STATE_BUS_OFF,4,2          ; @CAN_STATE_BUS_OFF
	.no_dead_strip	_at91_get_state_by_bec
.subsections_via_symbols
