	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kvaser_pciefd_set_bittiming
_kvaser_pciefd_set_bittiming:           ## @kvaser_pciefd_set_bittiming
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	leaq	36(%rdi), %rax
	leaq	16(%rdi), %rcx
	movl	%esi, -60(%rbp)                 ## 4-byte Spill
	testl	%esi, %esi
	cmoveq	%rcx, %rax
	movl	(%rax), %r14d
	movl	4(%rax), %ecx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movq	_KVASER_PCIEFD_KCAN_BTRN_TSEG2_SHIFT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	8(%rax), %ecx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	_KVASER_PCIEFD_KCAN_BTRN_TSEG1_SHIFT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	12(%rax), %r12d
	movq	_KVASER_PCIEFD_KCAN_BTRN_SJW_SHIFT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -56(%rbp)                 ## 4-byte Spill
	movl	16(%rax), %r15d
	callq	_spin_lock_irqsave
	movq	_KVASER_PCIEFD_KCAN_MODE_REG@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	addq	8(%rbx), %rdi
	callq	_ioread32
	movq	_KVASER_PCIEFD_KCAN_MODE_RM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	orl	%eax, %edi
	movq	(%r13), %rsi
	addq	8(%rbx), %rsi
	callq	_iowrite32
	movq	(%r13), %rdi
	addq	8(%rbx), %rdi
	xorl	%r13d, %r13d
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movl	$10, %r8d
	callq	_readl_poll_timeout
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	movq	_EBUSY@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	jmp	LBB0_6
LBB0_2:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	addl	%ecx, %eax
	decl	%eax
	andl	$511, %eax                      ## imm = 0x1FF
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	decl	%r14d
	andl	$31, %r14d
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r14d
	orl	%eax, %r14d
	decl	%r12d
	andl	$15, %r12d
	movl	-56(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r12d
	decl	%r15d
	andl	$8191, %r15d                    ## imm = 0x1FFF
	orl	%r12d, %r15d
	orl	%r14d, %r15d
	cmpl	$0, -60(%rbp)                   ## 4-byte Folded Reload
	movq	_KVASER_PCIEFD_KCAN_MODE_REG@GOTPCREL(%rip), %r14
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	jne	LBB0_3
## %bb.4:
	movq	_KVASER_PCIEFD_KCAN_BTRN_REG@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_3:
	movq	_KVASER_PCIEFD_KCAN_BTRD_REG@GOTPCREL(%rip), %rax
LBB0_5:
	movq	(%rax), %rsi
	addq	8(%rbx), %rsi
	movl	%r15d, %edi
	callq	_iowrite32
	movq	(%r14), %rsi
	addq	8(%rbx), %rsi
	movl	%r12d, %edi
	callq	_iowrite32
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%r13d, %r13d
LBB0_6:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KVASER_PCIEFD_KCAN_BTRN_TSEG2_SHIFT,4,2 ## @KVASER_PCIEFD_KCAN_BTRN_TSEG2_SHIFT
	.comm	_KVASER_PCIEFD_KCAN_BTRN_TSEG1_SHIFT,4,2 ## @KVASER_PCIEFD_KCAN_BTRN_TSEG1_SHIFT
	.comm	_KVASER_PCIEFD_KCAN_BTRN_SJW_SHIFT,4,2 ## @KVASER_PCIEFD_KCAN_BTRN_SJW_SHIFT
	.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
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_KVASER_PCIEFD_KCAN_BTRD_REG,8,3 ## @KVASER_PCIEFD_KCAN_BTRD_REG
	.comm	_KVASER_PCIEFD_KCAN_BTRN_REG,8,3 ## @KVASER_PCIEFD_KCAN_BTRN_REG
	.no_dead_strip	_kvaser_pciefd_set_bittiming
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kvaser_pciefd_set_bittiming
_kvaser_pciefd_set_bittiming:           ; @kvaser_pciefd_set_bittiming
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x19, x0
	add	x8, x0, #36
	add	x9, x0, #16
	cmp	w1, #0
	csel	x8, x9, x8, eq
Lloh0:
	adrp	x9, _KVASER_PCIEFD_KCAN_BTRN_TSEG2_SHIFT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _KVASER_PCIEFD_KCAN_BTRN_TSEG2_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	str	w9, [sp, #12]                   ; 4-byte Folded Spill
	ldp	w25, w28, [x8]
Lloh3:
	adrp	x9, _KVASER_PCIEFD_KCAN_BTRN_TSEG1_SHIFT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _KVASER_PCIEFD_KCAN_BTRN_TSEG1_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w23, [x9]
	ldp	w24, w26, [x8, #8]
Lloh6:
	adrp	x9, _KVASER_PCIEFD_KCAN_BTRN_SJW_SHIFT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _KVASER_PCIEFD_KCAN_BTRN_SJW_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w27, [x9]
	ldr	w8, [x8, #16]
	str	w8, [sp, #8]                    ; 4-byte Folded Spill
	bl	_spin_lock_irqsave
	ldr	x8, [x19, #8]
Lloh9:
	adrp	x22, _KVASER_PCIEFD_KCAN_MODE_REG@GOTPAGE
Lloh10:
	ldr	x22, [x22, _KVASER_PCIEFD_KCAN_MODE_REG@GOTPAGEOFF]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_ioread32
	mov	x21, x0
Lloh11:
	adrp	x8, _KVASER_PCIEFD_KCAN_MODE_RM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _KVASER_PCIEFD_KCAN_MODE_RM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	orr	w0, w8, w0
	ldr	x8, [x19, #8]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_iowrite32
	ldr	x8, [x19, #8]
	ldr	x9, [x22]
	add	x0, x9, x8
	mov	w2, #0
	mov	w3, #0
	mov	w4, #10
	bl	_readl_poll_timeout
	cbz	w0, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
Lloh14:
	adrp	x8, _EBUSY@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_3
LBB0_2:
	add	w8, w28, w24
	sub	w8, w8, #1
	and	w8, w8, #0x1ff
	lsl	w8, w8, w23
	sub	w9, w25, #1
	and	w9, w9, #0x1f
	ldr	w10, [sp, #12]                  ; 4-byte Folded Reload
	lsl	w9, w9, w10
	orr	w8, w8, w9
	sub	w9, w26, #1
	and	w9, w9, #0xf
	lsl	w9, w9, w27
	orr	w8, w8, w9
	ldr	w9, [sp, #8]                    ; 4-byte Folded Reload
	sub	w9, w9, #1
	and	w9, w9, #0x1fff
	orr	w0, w8, w9
	ldr	x8, [x19, #8]
Lloh17:
	adrp	x9, _KVASER_PCIEFD_KCAN_BTRN_REG@GOTPAGE
Lloh18:
	ldr	x9, [x9, _KVASER_PCIEFD_KCAN_BTRN_REG@GOTPAGEOFF]
Lloh19:
	adrp	x10, _KVASER_PCIEFD_KCAN_BTRD_REG@GOTPAGE
Lloh20:
	ldr	x10, [x10, _KVASER_PCIEFD_KCAN_BTRD_REG@GOTPAGEOFF]
	cmp	w20, #0
	csel	x9, x9, x10, eq
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_iowrite32
	ldr	x8, [x19, #8]
	ldr	x9, [x22]
	add	x1, x9, x8
	mov	x0, x21
	bl	_iowrite32
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	w0, #0
LBB0_3:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_KVASER_PCIEFD_KCAN_BTRN_TSEG2_SHIFT,4,2 ; @KVASER_PCIEFD_KCAN_BTRN_TSEG2_SHIFT
	.comm	_KVASER_PCIEFD_KCAN_BTRN_TSEG1_SHIFT,4,2 ; @KVASER_PCIEFD_KCAN_BTRN_TSEG1_SHIFT
	.comm	_KVASER_PCIEFD_KCAN_BTRN_SJW_SHIFT,4,2 ; @KVASER_PCIEFD_KCAN_BTRN_SJW_SHIFT
	.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
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_KVASER_PCIEFD_KCAN_BTRD_REG,8,3 ; @KVASER_PCIEFD_KCAN_BTRD_REG
	.comm	_KVASER_PCIEFD_KCAN_BTRN_REG,8,3 ; @KVASER_PCIEFD_KCAN_BTRN_REG
	.no_dead_strip	_kvaser_pciefd_set_bittiming
.subsections_via_symbols
