	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kvaser_pciefd_bus_on
_kvaser_pciefd_bus_on:                  ## @kvaser_pciefd_bus_on
	.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	%rdi, %r12
	addq	$52, %rdi
	callq	_del_timer
	leaq	48(%r12), %rbx
	movq	%rbx, %rdi
	callq	_completion_done
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movq	%r12, %rdi
	callq	_kvaser_pciefd_start_controller_flush
LBB0_2:
	movq	_KVASER_PCIEFD_WAIT_TIMEOUT@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_3
## %bb.5:
	leaq	44(%r12), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movq	_KVASER_PCIEFD_KCAN_IEN_REG@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rsi
	addq	32(%r12), %rsi
	xorl	%r14d, %r14d
	xorl	%edi, %edi
	callq	_iowrite32
	movq	_KVASER_PCIEFD_KCAN_IRQ_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	32(%r12), %rsi
	movl	$-1, %edi
	callq	_iowrite32
	movq	_KVASER_PCIEFD_KCAN_IRQ_ABD@GOTPCREL(%rip), %rax
	movq	_KVASER_PCIEFD_KCAN_IRQ_TFD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	(%rbx), %rsi
	addq	32(%r12), %rsi
	callq	_iowrite32
	movq	_KVASER_PCIEFD_KCAN_MODE_REG@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	addq	32(%r12), %rdi
	callq	_ioread32
	movq	_KVASER_PCIEFD_KCAN_MODE_RM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	notl	%edi
	andl	%eax, %edi
	movq	(%rbx), %rsi
	addq	32(%r12), %rsi
	callq	_iowrite32
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	leaq	40(%r12), %rdi
	movl	(%r13), %esi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	movq	_KVASER_PCIEFD_KCAN_IEN_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	32(%r12), %rsi
	xorl	%edi, %edi
	callq	_iowrite32
	movq	_KVASER_PCIEFD_KCAN_IRQ_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	32(%r12), %rsi
	movl	$-1, %edi
	callq	_iowrite32
	movq	%r12, %rdi
	callq	_kvaser_pciefd_set_tx_irq
	movq	%r12, %rdi
	callq	_kvaser_pciefd_setup_controller
	movq	_CAN_STATE_ERROR_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%r12)
	movl	24(%r12), %edi
	callq	_netif_wake_queue
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r12)
	movq	$0, 16(%r12)
	jmp	LBB0_8
LBB0_3:
	movl	24(%r12), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_4
LBB0_6:
	movl	24(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_4:
	callq	_netdev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_8:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KVASER_PCIEFD_WAIT_TIMEOUT,4,2 ## @KVASER_PCIEFD_WAIT_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timeout during bus on flush\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_KVASER_PCIEFD_KCAN_IEN_REG,8,3 ## @KVASER_PCIEFD_KCAN_IEN_REG
	.comm	_KVASER_PCIEFD_KCAN_IRQ_REG,8,3 ## @KVASER_PCIEFD_KCAN_IRQ_REG
	.comm	_KVASER_PCIEFD_KCAN_IRQ_ABD,4,2 ## @KVASER_PCIEFD_KCAN_IRQ_ABD
	.comm	_KVASER_PCIEFD_KCAN_IRQ_TFD,4,2 ## @KVASER_PCIEFD_KCAN_IRQ_TFD
	.comm	_KVASER_PCIEFD_KCAN_MODE_REG,8,3 ## @KVASER_PCIEFD_KCAN_MODE_REG
	.comm	_KVASER_PCIEFD_KCAN_MODE_RM,4,2 ## @KVASER_PCIEFD_KCAN_MODE_RM
L_.str.1:                               ## @.str.1
	.asciz	"Timeout during bus on reset\n"

	.comm	_CAN_STATE_ERROR_ACTIVE,4,2     ## @CAN_STATE_ERROR_ACTIVE
	.no_dead_strip	_kvaser_pciefd_bus_on
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kvaser_pciefd_bus_on
_kvaser_pciefd_bus_on:                  ; @kvaser_pciefd_bus_on
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	add	x0, x0, #52
	bl	_del_timer
	add	x20, x19, #48
	mov	x0, x20
	bl	_completion_done
	cbnz	w0, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_kvaser_pciefd_start_controller_flush
LBB0_2:
Lloh0:
	adrp	x21, _KVASER_PCIEFD_WAIT_TIMEOUT@GOTPAGE
Lloh1:
	ldr	x21, [x21, _KVASER_PCIEFD_WAIT_TIMEOUT@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_5
; %bb.3:
	add	x20, x19, #44
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	x8, [x19, #32]
Lloh2:
	adrp	x22, _KVASER_PCIEFD_KCAN_IEN_REG@GOTPAGE
Lloh3:
	ldr	x22, [x22, _KVASER_PCIEFD_KCAN_IEN_REG@GOTPAGEOFF]
	ldr	x9, [x22]
	add	x1, x9, x8
	mov	w0, #0
	bl	_iowrite32
	ldr	x8, [x19, #32]
Lloh4:
	adrp	x23, _KVASER_PCIEFD_KCAN_IRQ_REG@GOTPAGE
Lloh5:
	ldr	x23, [x23, _KVASER_PCIEFD_KCAN_IRQ_REG@GOTPAGEOFF]
	ldr	x9, [x23]
	add	x1, x9, x8
	mov	w0, #-1
	bl	_iowrite32
Lloh6:
	adrp	x8, _KVASER_PCIEFD_KCAN_IRQ_ABD@GOTPAGE
Lloh7:
	ldr	x8, [x8, _KVASER_PCIEFD_KCAN_IRQ_ABD@GOTPAGEOFF]
Lloh8:
	adrp	x9, _KVASER_PCIEFD_KCAN_IRQ_TFD@GOTPAGE
Lloh9:
	ldr	x9, [x9, _KVASER_PCIEFD_KCAN_IRQ_TFD@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	ldr	w9, [x9]
	orr	w0, w9, w8
	ldr	x8, [x19, #32]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_iowrite32
	ldr	x8, [x19, #32]
Lloh12:
	adrp	x24, _KVASER_PCIEFD_KCAN_MODE_REG@GOTPAGE
Lloh13:
	ldr	x24, [x24, _KVASER_PCIEFD_KCAN_MODE_REG@GOTPAGEOFF]
	ldr	x9, [x24]
	add	x0, x9, x8
	bl	_ioread32
Lloh14:
	adrp	x8, _KVASER_PCIEFD_KCAN_MODE_RM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _KVASER_PCIEFD_KCAN_MODE_RM@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	bic	w0, w0, w8
	ldr	x8, [x19, #32]
	ldr	x9, [x24]
	add	x1, x9, x8
	bl	_iowrite32
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	add	x0, x19, #40
	ldr	w1, [x21]
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_6
; %bb.4:
	ldr	x8, [x19, #32]
	ldr	x9, [x22]
	add	x1, x9, x8
	mov	w0, #0
	bl	_iowrite32
	ldr	x8, [x19, #32]
	ldr	x9, [x23]
	add	x1, x9, x8
	mov	w0, #-1
	bl	_iowrite32
	mov	x0, x19
	bl	_kvaser_pciefd_set_tx_irq
	mov	x0, x19
	bl	_kvaser_pciefd_setup_controller
Lloh17:
	adrp	x8, _CAN_STATE_ERROR_ACTIVE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _CAN_STATE_ERROR_ACTIVE@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	str	w8, [x19, #28]
	ldr	w0, [x19, #24]
	bl	_netif_wake_queue
	mov	w0, #0
	stp	xzr, xzr, [x19, #8]
	str	xzr, [x19]
	b	LBB0_8
LBB0_5:
	ldr	w0, [x19, #24]
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_7
LBB0_6:
	ldr	w0, [x19, #24]
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_7:
	bl	_netdev_err
Lloh24:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_KVASER_PCIEFD_WAIT_TIMEOUT,4,2 ; @KVASER_PCIEFD_WAIT_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timeout during bus on flush\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_KVASER_PCIEFD_KCAN_IEN_REG,8,3 ; @KVASER_PCIEFD_KCAN_IEN_REG
	.comm	_KVASER_PCIEFD_KCAN_IRQ_REG,8,3 ; @KVASER_PCIEFD_KCAN_IRQ_REG
	.comm	_KVASER_PCIEFD_KCAN_IRQ_ABD,4,2 ; @KVASER_PCIEFD_KCAN_IRQ_ABD
	.comm	_KVASER_PCIEFD_KCAN_IRQ_TFD,4,2 ; @KVASER_PCIEFD_KCAN_IRQ_TFD
	.comm	_KVASER_PCIEFD_KCAN_MODE_REG,8,3 ; @KVASER_PCIEFD_KCAN_MODE_REG
	.comm	_KVASER_PCIEFD_KCAN_MODE_RM,4,2 ; @KVASER_PCIEFD_KCAN_MODE_RM
l_.str.1:                               ; @.str.1
	.asciz	"Timeout during bus on reset\n"

	.comm	_CAN_STATE_ERROR_ACTIVE,4,2     ; @CAN_STATE_ERROR_ACTIVE
	.no_dead_strip	_kvaser_pciefd_bus_on
.subsections_via_symbols
