	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ep93xx_pwm_set_freq
_ep93xx_pwm_set_freq:                   ## @ep93xx_pwm_set_freq
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r12
	movq	%rdx, %rbx
	callq	_to_platform_device
	movq	%rax, %rdi
	callq	_platform_get_drvdata
	movq	%rax, %r14
	leaq	-40(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_strict_strtol
	testl	%eax, %eax
	je	LBB0_1
LBB0_12:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subq	(%rax), %r12
LBB0_13:
	movq	%r12, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	-40(%rbp), %rbx
	testq	%rbx, %rbx
	je	LBB0_2
## %bb.3:
	movl	8(%r14), %edi
	callq	_clk_get_rate
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rax, %rcx
	sarq	%rcx
	cmpq	%rcx, %rbx
	jg	LBB0_12
## %bb.4:
	movl	8(%r14), %edi
	callq	_clk_get_rate
	movq	-40(%rbp), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_5
## %bb.6:
	cqto
	idivq	%rcx
	jmp	LBB0_7
LBB0_2:
	movq	%r14, %rdi
	callq	_ep93xx_pwm_disable
	jmp	LBB0_13
LBB0_5:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_7:
	decq	%rax
	movq	_EP93XX_PWM_MAX_COUNT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	cmovgeq	%rcx, %rax
	cmpq	$2, %rax
	movl	$1, %ecx
	cmovgeq	%rax, %rcx
	movq	%rcx, -40(%rbp)
	movq	%r14, %rdi
	callq	_ep93xx_pwm_read_tc
	movq	%rax, %rcx
	movq	-40(%rbp), %rsi
	leaq	1(%rsi), %rdi
	imulq	(%r14), %rdi
	movabsq	$-6640827866535438581, %rdx     ## imm = 0xA3D70A3D70A3D70B
	movq	%rdi, %rax
	imulq	%rdx
	addq	%rdi, %rdx
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$6, %rdx
	leaq	(%rdx,%rax), %r15
	decq	%r15
	movq	%r14, %rdi
	cmpq	%rcx, %rsi
	jle	LBB0_9
## %bb.8:
	callq	_ep93xx_pwm_write_tc
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_ep93xx_pwm_write_dc
	jmp	LBB0_10
LBB0_9:
	movq	%r15, %rsi
	callq	_ep93xx_pwm_write_dc
	movq	-40(%rbp), %rsi
	movq	%r14, %rdi
	callq	_ep93xx_pwm_write_tc
LBB0_10:
	movq	%r14, %rdi
	callq	_ep93xx_pwm_is_enabled
	testl	%eax, %eax
	jne	LBB0_13
## %bb.11:
	movq	%r14, %rdi
	callq	_ep93xx_pwm_enable
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,8,3                     ## @EINVAL
	.comm	_EP93XX_PWM_MAX_COUNT,8,3       ## @EP93XX_PWM_MAX_COUNT
	.no_dead_strip	_ep93xx_pwm_set_freq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ep93xx_pwm_set_freq
_ep93xx_pwm_set_freq:                   ; @ep93xx_pwm_set_freq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x3
	mov	x21, x2
	bl	_to_platform_device
	bl	_platform_get_drvdata
	mov	x20, x0
	add	x2, sp, #8
	mov	x0, x21
	mov	w1, #10
	bl	_strict_strtol
	cbz	w0, LBB0_3
LBB0_1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	neg	x19, x8
LBB0_2:
	mov	x0, x19
	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
	add	sp, sp, #64
	ret
LBB0_3:
	ldr	x21, [sp, #8]
	cbz	x21, LBB0_7
; %bb.4:
	ldr	w0, [x20, #8]
	bl	_clk_get_rate
	cmp	x0, #0
	cinc	x8, x0, lt
	cmp	x21, x8, asr #1
	b.gt	LBB0_1
; %bb.5:
	ldr	w0, [x20, #8]
	bl	_clk_get_rate
	ldr	x8, [sp, #8]
	sdiv	x8, x0, x8
	sub	x8, x8, #1
Lloh3:
	adrp	x9, _EP93XX_PWM_MAX_COUNT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EP93XX_PWM_MAX_COUNT@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	csel	x8, x8, x9, lt
	cmp	x8, #1
	csinc	x8, x8, xzr, gt
	str	x8, [sp, #8]
	mov	x0, x20
	bl	_ep93xx_pwm_read_tc
	ldr	x1, [sp, #8]
	ldr	x8, [x20]
	madd	x8, x8, x1, x8
	mov	x9, #55051
	movk	x9, #28835, lsl #16
	movk	x9, #2621, lsl #32
	movk	x9, #41943, lsl #48
	smulh	x9, x8, x9
	add	x8, x9, x8
	asr	x9, x8, #6
	add	x8, x9, x8, lsr #63
	sub	x21, x8, #1
	cmp	x1, x0
	b.le	LBB0_8
; %bb.6:
	mov	x0, x20
	bl	_ep93xx_pwm_write_tc
	mov	x0, x20
	mov	x1, x21
	bl	_ep93xx_pwm_write_dc
	b	LBB0_9
LBB0_7:
	mov	x0, x20
	bl	_ep93xx_pwm_disable
	b	LBB0_2
LBB0_8:
	mov	x0, x20
	mov	x1, x21
	bl	_ep93xx_pwm_write_dc
	ldr	x1, [sp, #8]
	mov	x0, x20
	bl	_ep93xx_pwm_write_tc
LBB0_9:
	mov	x0, x20
	bl	_ep93xx_pwm_is_enabled
	cbnz	w0, LBB0_2
; %bb.10:
	mov	x0, x20
	bl	_ep93xx_pwm_enable
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,8,3                     ; @EINVAL
	.comm	_EP93XX_PWM_MAX_COUNT,8,3       ; @EP93XX_PWM_MAX_COUNT
	.no_dead_strip	_ep93xx_pwm_set_freq
.subsections_via_symbols
