	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kvaser_pciefd_setup_controller
_kvaser_pciefd_setup_controller:        ## @kvaser_pciefd_setup_controller
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	callq	_spin_lock_irqsave
	movq	_KVASER_PCIEFD_KCAN_MODE_REG@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	addq	8(%rbx), %rdi
	callq	_ioread32
	movl	16(%rbx), %ecx
	movq	_CAN_CTRLMODE_FD@GOTPCREL(%rip), %rdx
	movq	_KVASER_PCIEFD_KCAN_MODE_CCM@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	testl	%ecx, (%rdx)
	je	LBB0_4
## %bb.1:
	notl	%esi
	andl	%esi, %eax
	movq	_CAN_CTRLMODE_FD_NON_ISO@GOTPCREL(%rip), %rsi
	movq	_KVASER_PCIEFD_KCAN_MODE_NIFDEN@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%ecx, (%rsi)
	je	LBB0_3
## %bb.2:
	orl	%eax, %edx
	jmp	LBB0_5
LBB0_4:
	orl	%eax, %esi
	movq	_KVASER_PCIEFD_KCAN_MODE_NIFDEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	andl	%esi, %edx
	jmp	LBB0_5
LBB0_3:
	notl	%edx
	andl	%eax, %edx
LBB0_5:
	movq	_CAN_CTRLMODE_LISTENONLY@GOTPCREL(%rip), %rax
	andl	(%rax), %ecx
	je	LBB0_7
## %bb.6:
	movq	_KVASER_PCIEFD_KCAN_MODE_LOM@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_7:
	movq	_KVASER_PCIEFD_KCAN_MODE_EEN@GOTPCREL(%rip), %rax
	movq	_KVASER_PCIEFD_KCAN_MODE_EPEN@GOTPCREL(%rip), %rsi
	orl	(%rax), %edx
	orl	%ecx, %edx
	orl	(%rsi), %edx
	movq	_KVASER_PCIEFD_KCAN_MODE_APT@GOTPCREL(%rip), %rax
	movq	_KVASER_PCIEFD_KCAN_MODE_RM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	notl	%edi
	andl	%edx, %edi
	movq	(%r14), %rsi
	addq	8(%rbx), %rsi
	callq	_iowrite32
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_KVASER_PCIEFD_KCAN_MODE_REG,8,3 ## @KVASER_PCIEFD_KCAN_MODE_REG
	.comm	_CAN_CTRLMODE_FD,4,2            ## @CAN_CTRLMODE_FD
	.comm	_KVASER_PCIEFD_KCAN_MODE_CCM,4,2 ## @KVASER_PCIEFD_KCAN_MODE_CCM
	.comm	_CAN_CTRLMODE_FD_NON_ISO,4,2    ## @CAN_CTRLMODE_FD_NON_ISO
	.comm	_KVASER_PCIEFD_KCAN_MODE_NIFDEN,4,2 ## @KVASER_PCIEFD_KCAN_MODE_NIFDEN
	.comm	_CAN_CTRLMODE_LISTENONLY,4,2    ## @CAN_CTRLMODE_LISTENONLY
	.comm	_KVASER_PCIEFD_KCAN_MODE_LOM,4,2 ## @KVASER_PCIEFD_KCAN_MODE_LOM
	.comm	_KVASER_PCIEFD_KCAN_MODE_EEN,4,2 ## @KVASER_PCIEFD_KCAN_MODE_EEN
	.comm	_KVASER_PCIEFD_KCAN_MODE_EPEN,4,2 ## @KVASER_PCIEFD_KCAN_MODE_EPEN
	.comm	_KVASER_PCIEFD_KCAN_MODE_APT,4,2 ## @KVASER_PCIEFD_KCAN_MODE_APT
	.comm	_KVASER_PCIEFD_KCAN_MODE_RM,4,2 ## @KVASER_PCIEFD_KCAN_MODE_RM
	.no_dead_strip	_kvaser_pciefd_setup_controller
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kvaser_pciefd_setup_controller
_kvaser_pciefd_setup_controller:        ; @kvaser_pciefd_setup_controller
	.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
	mov	x19, x0
	bl	_spin_lock_irqsave
	ldr	x8, [x19, #8]
Lloh0:
	adrp	x20, _KVASER_PCIEFD_KCAN_MODE_REG@GOTPAGE
Lloh1:
	ldr	x20, [x20, _KVASER_PCIEFD_KCAN_MODE_REG@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_ioread32
Lloh2:
	adrp	x9, _CAN_CTRLMODE_FD@GOTPAGE
Lloh3:
	ldr	x9, [x9, _CAN_CTRLMODE_FD@GOTPAGEOFF]
	ldr	w8, [x19, #16]
Lloh4:
	ldr	w10, [x9]
Lloh5:
	adrp	x9, _KVASER_PCIEFD_KCAN_MODE_CCM@GOTPAGE
Lloh6:
	ldr	x9, [x9, _KVASER_PCIEFD_KCAN_MODE_CCM@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w10, w8
	b.eq	LBB0_2
; %bb.1:
	bic	w9, w0, w9
Lloh8:
	adrp	x10, _CAN_CTRLMODE_FD_NON_ISO@GOTPAGE
Lloh9:
	ldr	x10, [x10, _CAN_CTRLMODE_FD_NON_ISO@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	tst	w10, w8
Lloh11:
	adrp	x10, _KVASER_PCIEFD_KCAN_MODE_NIFDEN@GOTPAGE
Lloh12:
	ldr	x10, [x10, _KVASER_PCIEFD_KCAN_MODE_NIFDEN@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	bic	w11, w9, w10
	orr	w9, w10, w9
	csel	w9, w11, w9, eq
	b	LBB0_3
LBB0_2:
	orr	w9, w9, w0
Lloh14:
	adrp	x10, _KVASER_PCIEFD_KCAN_MODE_NIFDEN@GOTPAGE
Lloh15:
	ldr	x10, [x10, _KVASER_PCIEFD_KCAN_MODE_NIFDEN@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	bic	w9, w9, w10
LBB0_3:
Lloh17:
	adrp	x10, _CAN_CTRLMODE_LISTENONLY@GOTPAGE
Lloh18:
	ldr	x10, [x10, _CAN_CTRLMODE_LISTENONLY@GOTPAGEOFF]
Lloh19:
	adrp	x11, _KVASER_PCIEFD_KCAN_MODE_LOM@GOTPAGE
Lloh20:
	ldr	x11, [x11, _KVASER_PCIEFD_KCAN_MODE_LOM@GOTPAGEOFF]
Lloh21:
	ldr	w10, [x10]
Lloh22:
	ldr	w11, [x11]
	tst	w10, w8
	csel	w8, wzr, w11, eq
Lloh23:
	adrp	x10, _KVASER_PCIEFD_KCAN_MODE_EEN@GOTPAGE
Lloh24:
	ldr	x10, [x10, _KVASER_PCIEFD_KCAN_MODE_EEN@GOTPAGEOFF]
Lloh25:
	ldr	w10, [x10]
Lloh26:
	adrp	x11, _KVASER_PCIEFD_KCAN_MODE_EPEN@GOTPAGE
Lloh27:
	ldr	x11, [x11, _KVASER_PCIEFD_KCAN_MODE_EPEN@GOTPAGEOFF]
Lloh28:
	ldr	w11, [x11]
	orr	w9, w10, w9
	orr	w8, w9, w8
	orr	w8, w8, w11
Lloh29:
	adrp	x9, _KVASER_PCIEFD_KCAN_MODE_APT@GOTPAGE
Lloh30:
	ldr	x9, [x9, _KVASER_PCIEFD_KCAN_MODE_APT@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
Lloh32:
	adrp	x10, _KVASER_PCIEFD_KCAN_MODE_RM@GOTPAGE
Lloh33:
	ldr	x10, [x10, _KVASER_PCIEFD_KCAN_MODE_RM@GOTPAGEOFF]
Lloh34:
	ldr	w10, [x10]
	orr	w9, w10, w9
	bic	w0, w8, w9
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_iowrite32
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_spin_unlock_irqrestore
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_KVASER_PCIEFD_KCAN_MODE_REG,8,3 ; @KVASER_PCIEFD_KCAN_MODE_REG
	.comm	_CAN_CTRLMODE_FD,4,2            ; @CAN_CTRLMODE_FD
	.comm	_KVASER_PCIEFD_KCAN_MODE_CCM,4,2 ; @KVASER_PCIEFD_KCAN_MODE_CCM
	.comm	_CAN_CTRLMODE_FD_NON_ISO,4,2    ; @CAN_CTRLMODE_FD_NON_ISO
	.comm	_KVASER_PCIEFD_KCAN_MODE_NIFDEN,4,2 ; @KVASER_PCIEFD_KCAN_MODE_NIFDEN
	.comm	_CAN_CTRLMODE_LISTENONLY,4,2    ; @CAN_CTRLMODE_LISTENONLY
	.comm	_KVASER_PCIEFD_KCAN_MODE_LOM,4,2 ; @KVASER_PCIEFD_KCAN_MODE_LOM
	.comm	_KVASER_PCIEFD_KCAN_MODE_EEN,4,2 ; @KVASER_PCIEFD_KCAN_MODE_EEN
	.comm	_KVASER_PCIEFD_KCAN_MODE_EPEN,4,2 ; @KVASER_PCIEFD_KCAN_MODE_EPEN
	.comm	_KVASER_PCIEFD_KCAN_MODE_APT,4,2 ; @KVASER_PCIEFD_KCAN_MODE_APT
	.comm	_KVASER_PCIEFD_KCAN_MODE_RM,4,2 ; @KVASER_PCIEFD_KCAN_MODE_RM
	.no_dead_strip	_kvaser_pciefd_setup_controller
.subsections_via_symbols
