	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kvaser_pciefd_handle_error_packet
_kvaser_pciefd_handle_error_packet:     ## @kvaser_pciefd_handle_error_packet
	.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), %rax
	movl	4(%rax), %eax
	movq	_KVASER_PCIEFD_PACKET_CHID_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	andl	$7, %eax
	cmpq	%rax, (%rdi)
	jbe	LBB0_1
## %bb.2:
	movq	8(%rdi), %rcx
	movq	(%rcx,%rax,8), %rbx
	movq	%rbx, %rdi
	callq	_kvaser_pciefd_rx_error_frame
	movq	(%rbx), %rax
	movq	_KVASER_PCIEFD_MAX_ERR_REP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	callq	_kvaser_pciefd_disable_err_gen
LBB0_4:
	addq	$8, %rbx
	movq	_KVASER_PCIEFD_BEC_POLL_FREQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_mod_timer
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_1:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KVASER_PCIEFD_PACKET_CHID_SHIFT,4,2 ## @KVASER_PCIEFD_PACKET_CHID_SHIFT
	.comm	_EIO,4,2                        ## @EIO
	.comm	_KVASER_PCIEFD_MAX_ERR_REP,8,3  ## @KVASER_PCIEFD_MAX_ERR_REP
	.comm	_KVASER_PCIEFD_BEC_POLL_FREQ,4,2 ## @KVASER_PCIEFD_BEC_POLL_FREQ
	.no_dead_strip	_kvaser_pciefd_handle_error_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kvaser_pciefd_handle_error_packet
_kvaser_pciefd_handle_error_packet:     ; @kvaser_pciefd_handle_error_packet
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x8, [x1]
Lloh0:
	adrp	x9, _KVASER_PCIEFD_PACKET_CHID_SHIFT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _KVASER_PCIEFD_PACKET_CHID_SHIFT@GOTPAGEOFF]
	ldr	w8, [x8, #4]
Lloh2:
	ldr	w9, [x9]
	asr	w8, w8, w9
	and	w8, w8, #0x7
	ldr	x9, [x0]
	cmp	x9, x8
	b.ls	LBB0_4
; %bb.1:
	ldr	x9, [x0, #8]
	ldr	x19, [x9, x8, lsl #3]
	mov	x0, x19
	bl	_kvaser_pciefd_rx_error_frame
	ldr	x8, [x19]
Lloh3:
	adrp	x9, _KVASER_PCIEFD_MAX_ERR_REP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _KVASER_PCIEFD_MAX_ERR_REP@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_kvaser_pciefd_disable_err_gen
LBB0_3:
	add	x0, x19, #8
Lloh6:
	adrp	x8, _KVASER_PCIEFD_BEC_POLL_FREQ@GOTPAGE
Lloh7:
	ldr	x8, [x8, _KVASER_PCIEFD_BEC_POLL_FREQ@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_mod_timer
	mov	w0, #0
	b	LBB0_5
LBB0_4:
Lloh9:
	adrp	x8, _EIO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_KVASER_PCIEFD_PACKET_CHID_SHIFT,4,2 ; @KVASER_PCIEFD_PACKET_CHID_SHIFT
	.comm	_EIO,4,2                        ; @EIO
	.comm	_KVASER_PCIEFD_MAX_ERR_REP,8,3  ; @KVASER_PCIEFD_MAX_ERR_REP
	.comm	_KVASER_PCIEFD_BEC_POLL_FREQ,4,2 ; @KVASER_PCIEFD_BEC_POLL_FREQ
	.no_dead_strip	_kvaser_pciefd_handle_error_packet
.subsections_via_symbols
