	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stm32_timer_start
_stm32_timer_start:                     ## @stm32_timer_start
	.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
	movl	%edx, %r12d
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	12(%rdi), %edi
	callq	_clk_get_rate
	movq	%rax, %rbx
	movq	%rax, %rdi
	movl	%r12d, %esi
	callq	_do_div
	xorl	%r13d, %r13d
	cmpq	(%r15), %rbx
	jbe	LBB0_3
## %bb.1:
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	leal	1(%rsi), %r13d
	addl	$2, %esi
	movq	%rbx, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_do_div
	movl	%r13d, %esi
	cmpq	(%r15), %rbx
	ja	LBB0_2
LBB0_3:
	movq	_MAX_TIM_PSC@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jle	LBB0_5
## %bb.4:
	movl	16(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
LBB0_5:
	movl	8(%r15), %edi
	movq	_TIM_CCER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	callq	_regmap_read
	movq	_TIM_CCER_CCXE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -48(%rbp)
	je	LBB0_8
## %bb.6:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
LBB0_7:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	8(%r15), %edi
	movq	_TIM_CR1@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-44(%rbp), %rdx
	callq	_regmap_read
	movq	_TIM_CR1_CEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -44(%rbp)
	jne	LBB0_10
## %bb.9:
	movl	12(%r15), %edi
	callq	_clk_enable
LBB0_10:
	movl	8(%r15), %edi
	movq	_TIM_PSC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edx
	callq	_regmap_write
	movl	8(%r15), %edi
	movq	_TIM_ARR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	decq	%rbx
	movq	%rbx, %rdx
	callq	_regmap_write
	movl	8(%r15), %edi
	movl	(%r12), %esi
	movq	_TIM_CR1_ARPE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %edx
	callq	_regmap_update_bits
	movl	(%r14), %edi
	callq	_stm32_timer_is_trgo2_name
	testq	%rax, %rax
	movl	8(%r15), %edi
	movq	_TIM_CR2_MMS2@GOTPCREL(%rip), %rax
	cmoveq	_TIM_CR2_MMS@GOTPCREL(%rip), %rax
	movq	_TIM_CR2@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	(%rax), %edx
	movq	_TIM_CR2_MMS2_SHIFT@GOTPCREL(%rip), %rax
	cmoveq	_TIM_CR2_MMS_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$2, %eax
	shll	%cl, %eax
	movl	%eax, %ecx
	callq	_regmap_update_bits
	movl	8(%r15), %edi
	movq	_TIM_EGR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TIM_EGR_UG@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %edx
	callq	_regmap_update_bits
	movl	8(%r15), %edi
	movl	(%r12), %esi
	movq	_TIM_CR1_CEN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %edx
	callq	_regmap_update_bits
	xorl	%eax, %eax
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_TIM_PSC,4,2                ## @MAX_TIM_PSC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"prescaler exceeds the maximum value\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_TIM_CCER,4,2                   ## @TIM_CCER
	.comm	_TIM_CCER_CCXE,4,2              ## @TIM_CCER_CCXE
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_TIM_CR1,4,2                    ## @TIM_CR1
	.comm	_TIM_CR1_CEN,4,2                ## @TIM_CR1_CEN
	.comm	_TIM_PSC,4,2                    ## @TIM_PSC
	.comm	_TIM_ARR,4,2                    ## @TIM_ARR
	.comm	_TIM_CR1_ARPE,4,2               ## @TIM_CR1_ARPE
	.comm	_TIM_CR2,4,2                    ## @TIM_CR2
	.comm	_TIM_CR2_MMS2,4,2               ## @TIM_CR2_MMS2
	.comm	_TIM_CR2_MMS2_SHIFT,4,2         ## @TIM_CR2_MMS2_SHIFT
	.comm	_TIM_CR2_MMS,4,2                ## @TIM_CR2_MMS
	.comm	_TIM_CR2_MMS_SHIFT,4,2          ## @TIM_CR2_MMS_SHIFT
	.comm	_TIM_EGR,4,2                    ## @TIM_EGR
	.comm	_TIM_EGR_UG,4,2                 ## @TIM_EGR_UG
	.no_dead_strip	_stm32_timer_start
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stm32_timer_start
_stm32_timer_start:                     ; @stm32_timer_start
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x22, x2
	mov	x20, x1
	mov	x19, x0
	ldr	w0, [x0, #12]
	bl	_clk_get_rate
	mov	x21, x0
	mov	x1, x22
	bl	_do_div
	ldr	x8, [x19]
	cmp	x21, x8
	b.ls	LBB0_3
; %bb.1:
	mov	w8, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	add	w24, w8, #1
	add	w1, w8, #2
	mov	x0, x21
	bl	_do_div
	ldr	x9, [x19]
	mov	x8, x24
	cmp	x21, x9
	b.hi	LBB0_2
	b	LBB0_4
LBB0_3:
	mov	w24, #0
LBB0_4:
Lloh0:
	adrp	x8, _MAX_TIM_PSC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_TIM_PSC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w24, w8
	b.le	LBB0_6
; %bb.5:
	ldr	w0, [x19, #16]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:
	ldr	w0, [x19, #8]
Lloh7:
	adrp	x8, _TIM_CCER@GOTPAGE
Lloh8:
	ldr	x8, [x8, _TIM_CCER@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	ldr	w8, [sp, #12]
Lloh10:
	adrp	x9, _TIM_CCER_CCXE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _TIM_CCER_CCXE@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.7:
Lloh13:
	adrp	x8, _EBUSY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_10:
	ldr	w0, [x19, #8]
Lloh15:
	adrp	x22, _TIM_CR1@GOTPAGE
Lloh16:
	ldr	x22, [x22, _TIM_CR1@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #8
	bl	_regmap_read
	ldr	w8, [sp, #8]
Lloh17:
	adrp	x23, _TIM_CR1_CEN@GOTPAGE
Lloh18:
	ldr	x23, [x23, _TIM_CR1_CEN@GOTPAGEOFF]
	ldr	w9, [x23]
	tst	w9, w8
	b.ne	LBB0_12
; %bb.11:
	ldr	w0, [x19, #12]
	bl	_clk_enable
LBB0_12:
	ldr	w0, [x19, #8]
Lloh19:
	adrp	x8, _TIM_PSC@GOTPAGE
Lloh20:
	ldr	x8, [x8, _TIM_PSC@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	w2, w24
	bl	_regmap_write
	ldr	w0, [x19, #8]
Lloh22:
	adrp	x8, _TIM_ARR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _TIM_ARR@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	sub	x2, x21, #1
	bl	_regmap_write
	ldr	w0, [x19, #8]
	ldr	w1, [x22]
Lloh25:
	adrp	x8, _TIM_CR1_ARPE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _TIM_CR1_ARPE@GOTPAGEOFF]
Lloh27:
	ldr	w2, [x8]
	mov	x3, x2
	bl	_regmap_update_bits
	ldr	w0, [x20]
	bl	_stm32_timer_is_trgo2_name
	ldr	w8, [x19, #8]
Lloh28:
	adrp	x9, _TIM_CR2@GOTPAGE
Lloh29:
	ldr	x9, [x9, _TIM_CR2@GOTPAGEOFF]
Lloh30:
	adrp	x10, _TIM_CR2_MMS@GOTPAGE
Lloh31:
	ldr	x10, [x10, _TIM_CR2_MMS@GOTPAGEOFF]
Lloh32:
	adrp	x11, _TIM_CR2_MMS2@GOTPAGE
Lloh33:
	ldr	x11, [x11, _TIM_CR2_MMS2@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x9]
	cmp	x0, #0
	csel	x9, x10, x11, eq
	ldr	w2, [x9]
Lloh35:
	adrp	x9, _TIM_CR2_MMS_SHIFT@GOTPAGE
Lloh36:
	ldr	x9, [x9, _TIM_CR2_MMS_SHIFT@GOTPAGEOFF]
Lloh37:
	adrp	x10, _TIM_CR2_MMS2_SHIFT@GOTPAGE
Lloh38:
	ldr	x10, [x10, _TIM_CR2_MMS2_SHIFT@GOTPAGEOFF]
	csel	x9, x9, x10, eq
	ldr	w9, [x9]
	mov	w10, #2
	lsl	w3, w10, w9
	mov	x0, x8
	bl	_regmap_update_bits
	ldr	w0, [x19, #8]
Lloh39:
	adrp	x8, _TIM_EGR@GOTPAGE
Lloh40:
	ldr	x8, [x8, _TIM_EGR@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
Lloh42:
	adrp	x8, _TIM_EGR_UG@GOTPAGE
Lloh43:
	ldr	x8, [x8, _TIM_EGR_UG@GOTPAGEOFF]
Lloh44:
	ldr	w2, [x8]
	mov	x3, x2
	bl	_regmap_update_bits
	ldr	w0, [x19, #8]
	ldr	w1, [x22]
	ldr	w2, [x23]
	mov	x3, x2
	bl	_regmap_update_bits
	mov	w0, #0
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh34
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_TIM_PSC,4,2                ; @MAX_TIM_PSC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"prescaler exceeds the maximum value\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_TIM_CCER,4,2                   ; @TIM_CCER
	.comm	_TIM_CCER_CCXE,4,2              ; @TIM_CCER_CCXE
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_TIM_CR1,4,2                    ; @TIM_CR1
	.comm	_TIM_CR1_CEN,4,2                ; @TIM_CR1_CEN
	.comm	_TIM_PSC,4,2                    ; @TIM_PSC
	.comm	_TIM_ARR,4,2                    ; @TIM_ARR
	.comm	_TIM_CR1_ARPE,4,2               ; @TIM_CR1_ARPE
	.comm	_TIM_CR2,4,2                    ; @TIM_CR2
	.comm	_TIM_CR2_MMS2,4,2               ; @TIM_CR2_MMS2
	.comm	_TIM_CR2_MMS2_SHIFT,4,2         ; @TIM_CR2_MMS2_SHIFT
	.comm	_TIM_CR2_MMS,4,2                ; @TIM_CR2_MMS
	.comm	_TIM_CR2_MMS_SHIFT,4,2          ; @TIM_CR2_MMS_SHIFT
	.comm	_TIM_EGR,4,2                    ; @TIM_EGR
	.comm	_TIM_EGR_UG,4,2                 ; @TIM_EGR_UG
	.no_dead_strip	_stm32_timer_start
.subsections_via_symbols
