	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kvaser_pciefd_handle_ack_packet
_kvaser_pciefd_handle_ack_packet:       ## @kvaser_pciefd_handle_ack_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	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rsi), %rdx
	movl	4(%rdx), %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:
	movl	(%rdx), %r13d
	movq	_KVASER_PCIEFD_APACKET_CT@GOTPCREL(%rip), %rcx
	xorl	%r12d, %r12d
	testl	%r13d, (%rcx)
	jne	LBB0_12
## %bb.3:
	movq	%rsi, %rbx
	movq	8(%rdi), %rcx
	movq	(%rcx,%rax,8), %r14
	movq	_KVASER_PCIEFD_APACKET_NACK@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	%r13d, %esi
	testl	%r13d, %r15d
	je	LBB0_5
## %bb.4:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_kvaser_pciefd_handle_nack_packet
	movq	(%rbx), %rax
	movl	(%rax), %esi
LBB0_5:
	movq	_KVASER_PCIEFD_APACKET_FLU@GOTPCREL(%rip), %rax
	testl	%esi, (%rax)
	je	LBB0_7
## %bb.6:
	movq	(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_netdev_dbg
	jmp	LBB0_12
LBB0_1:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_12:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_KVASER_PCIEFD_PACKET_SEQ_MSK@GOTPCREL(%rip), %rax
	andl	(%rax), %esi
	movq	(%r14), %rdi
	callq	_can_get_echo_skb
	movl	%eax, %ebx
	movq	_KVASER_PCIEFD_KCAN_TX_NPACKETS_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r14), %rdi
	callq	_ioread32
	movzbl	%al, %eax
	movq	_KVASER_PCIEFD_CAN_TX_MAX_COUNT@GOTPCREL(%rip), %rcx
	cmpq	%rax, (%rcx)
	jbe	LBB0_10
## %bb.8:
	movq	(%r14), %rdi
	callq	_netif_queue_stopped
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	(%r14), %rdi
	callq	_netif_wake_queue
LBB0_10:
	testl	%r13d, %r15d
	jne	LBB0_12
## %bb.11:
	movq	(%r14), %rax
	addl	%ebx, (%rax)
	incl	4(%rax)
	jmp	LBB0_12
	.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_APACKET_CT,4,2   ## @KVASER_PCIEFD_APACKET_CT
	.comm	_KVASER_PCIEFD_APACKET_NACK,4,2 ## @KVASER_PCIEFD_APACKET_NACK
	.comm	_KVASER_PCIEFD_APACKET_FLU,4,2  ## @KVASER_PCIEFD_APACKET_FLU
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Packet was flushed\n"

	.comm	_KVASER_PCIEFD_PACKET_SEQ_MSK,4,2 ## @KVASER_PCIEFD_PACKET_SEQ_MSK
	.comm	_KVASER_PCIEFD_KCAN_TX_NPACKETS_REG,8,3 ## @KVASER_PCIEFD_KCAN_TX_NPACKETS_REG
	.comm	_KVASER_PCIEFD_CAN_TX_MAX_COUNT,8,3 ## @KVASER_PCIEFD_CAN_TX_MAX_COUNT
	.no_dead_strip	_kvaser_pciefd_handle_ack_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_ack_packet
_kvaser_pciefd_handle_ack_packet:       ; @kvaser_pciefd_handle_ack_packet
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	ldr	x8, [x1]
Lloh0:
	adrp	x9, _KVASER_PCIEFD_PACKET_CHID_SHIFT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _KVASER_PCIEFD_PACKET_CHID_SHIFT@GOTPAGEOFF]
	ldr	w10, [x8, #4]
Lloh2:
	ldr	w9, [x9]
	asr	w9, w10, w9
	and	w9, w9, #0x7
	ldr	x10, [x0]
	cmp	x10, x9
	b.ls	LBB0_3
; %bb.1:
	ldr	w8, [x8]
Lloh3:
	adrp	x10, _KVASER_PCIEFD_APACKET_CT@GOTPAGE
Lloh4:
	ldr	x10, [x10, _KVASER_PCIEFD_APACKET_CT@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	tst	w10, w8
	b.eq	LBB0_5
; %bb.2:
	mov	w0, #0
	b	LBB0_4
LBB0_3:
Lloh6:
	adrp	x8, _EIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_5:
	ldr	x10, [x0, #8]
	ldr	x19, [x10, x9, lsl #3]
Lloh9:
	adrp	x9, _KVASER_PCIEFD_APACKET_NACK@GOTPAGE
Lloh10:
	ldr	x9, [x9, _KVASER_PCIEFD_APACKET_NACK@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	ands	w21, w9, w8
	b.eq	LBB0_7
; %bb.6:
	mov	x20, x1
	mov	x0, x19
	bl	_kvaser_pciefd_handle_nack_packet
	ldr	x8, [x20]
	ldr	w8, [x8]
LBB0_7:
Lloh12:
	adrp	x9, _KVASER_PCIEFD_APACKET_FLU@GOTPAGE
Lloh13:
	ldr	x9, [x9, _KVASER_PCIEFD_APACKET_FLU@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.8:
	ldr	x0, [x19]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_netdev_dbg
	mov	w0, #0
	b	LBB0_4
LBB0_9:
Lloh17:
	adrp	x9, _KVASER_PCIEFD_PACKET_SEQ_MSK@GOTPAGE
Lloh18:
	ldr	x9, [x9, _KVASER_PCIEFD_PACKET_SEQ_MSK@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	and	w1, w9, w8
	ldr	x0, [x19]
	bl	_can_get_echo_skb
	mov	x20, x0
	ldr	x8, [x19, #8]
Lloh20:
	adrp	x9, _KVASER_PCIEFD_KCAN_TX_NPACKETS_REG@GOTPAGE
Lloh21:
	ldr	x9, [x9, _KVASER_PCIEFD_KCAN_TX_NPACKETS_REG@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_ioread32
	and	w8, w0, #0xff
Lloh23:
	adrp	x9, _KVASER_PCIEFD_CAN_TX_MAX_COUNT@GOTPAGE
Lloh24:
	ldr	x9, [x9, _KVASER_PCIEFD_CAN_TX_MAX_COUNT@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ls	LBB0_12
; %bb.10:
	ldr	x0, [x19]
	bl	_netif_queue_stopped
	cbz	x0, LBB0_12
; %bb.11:
	ldr	x0, [x19]
	bl	_netif_wake_queue
LBB0_12:
	mov	w0, #0
	cbnz	w21, LBB0_4
; %bb.13:
	ldr	x8, [x19]
	ldr	d0, [x8]
	movi.2s	v1, #1
	mov.s	v1[0], w20
	add.2s	v0, v0, v1
	str	d0, [x8]
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.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_APACKET_CT,4,2   ; @KVASER_PCIEFD_APACKET_CT
	.comm	_KVASER_PCIEFD_APACKET_NACK,4,2 ; @KVASER_PCIEFD_APACKET_NACK
	.comm	_KVASER_PCIEFD_APACKET_FLU,4,2  ; @KVASER_PCIEFD_APACKET_FLU
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Packet was flushed\n"

	.comm	_KVASER_PCIEFD_PACKET_SEQ_MSK,4,2 ; @KVASER_PCIEFD_PACKET_SEQ_MSK
	.comm	_KVASER_PCIEFD_KCAN_TX_NPACKETS_REG,8,3 ; @KVASER_PCIEFD_KCAN_TX_NPACKETS_REG
	.comm	_KVASER_PCIEFD_CAN_TX_MAX_COUNT,8,3 ; @KVASER_PCIEFD_CAN_TX_MAX_COUNT
	.no_dead_strip	_kvaser_pciefd_handle_ack_packet
.subsections_via_symbols
