	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pcan_write_canreg
_pcan_write_canreg:                     ## @pcan_write_canreg
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rdi, %r15
	movq	8(%rdi), %r12
	movl	(%rdi), %eax
	subl	(%r12), %eax
	movq	_PCC_CHAN_SIZE@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movl	%esi, %ebx
	movq	_SJA1000_MOD@GOTPCREL(%rip), %rcx
	cmpl	%esi, (%rcx)
	jne	LBB0_5
## %bb.1:
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.2:
	cmpl	$128, %r14d
	jne	LBB0_5
## %bb.3:
	movl	%eax, %edi
	callq	_PCC_LED
	movq	_PCC_LED_ON@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_pcan_set_leds
	jmp	LBB0_5
LBB0_4:
	movl	%eax, %edi
	callq	_PCC_LED
	movq	_PCC_LED_SLOW@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_pcan_set_leds
	movq	%r12, %rdi
	callq	_pcan_start_led_timer
LBB0_5:
	addl	(%r15), %ebx
	movl	%r14d, %edi
	movl	%ebx, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_iowrite8                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PCC_CHAN_SIZE,4,2              ## @PCC_CHAN_SIZE
	.comm	_SJA1000_MOD,4,2                ## @SJA1000_MOD
	.comm	_PCC_LED_ON,4,2                 ## @PCC_LED_ON
	.comm	_PCC_LED_SLOW,4,2               ## @PCC_LED_SLOW
	.no_dead_strip	_pcan_write_canreg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pcan_write_canreg
_pcan_write_canreg:                     ; @pcan_write_canreg
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _SJA1000_MOD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SJA1000_MOD@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ne	LBB0_5
; %bb.1:
	ldr	x22, [x21, #8]
	ldr	w8, [x21]
	ldr	w9, [x22]
	sub	w8, w8, w9
Lloh3:
	adrp	x9, _PCC_CHAN_SIZE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PCC_CHAN_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	sdiv	w0, w8, w9
	cbz	w19, LBB0_4
; %bb.2:
	cmp	w19, #128
	b.ne	LBB0_5
; %bb.3:
	bl	_PCC_LED
	mov	x1, x0
Lloh6:
	adrp	x8, _PCC_LED_ON@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PCC_LED_ON@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x22
	bl	_pcan_set_leds
	b	LBB0_5
LBB0_4:
	bl	_PCC_LED
	mov	x1, x0
Lloh9:
	adrp	x8, _PCC_LED_SLOW@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PCC_LED_SLOW@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x22
	bl	_pcan_set_leds
	mov	x0, x22
	bl	_pcan_start_led_timer
LBB0_5:
	ldr	w8, [x21]
	add	w1, w8, w20
	mov	x0, x19
	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
	b	_iowrite8
	.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	_PCC_CHAN_SIZE,4,2              ; @PCC_CHAN_SIZE
	.comm	_SJA1000_MOD,4,2                ; @SJA1000_MOD
	.comm	_PCC_LED_ON,4,2                 ; @PCC_LED_ON
	.comm	_PCC_LED_SLOW,4,2               ; @PCC_LED_SLOW
	.no_dead_strip	_pcan_write_canreg
.subsections_via_symbols
