	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aspeed_set_pwm_port_fan_ctrl
_aspeed_set_pwm_port_fan_ctrl:          ## @aspeed_set_pwm_port_fan_ctrl
	.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	%rdx, %rax
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	(%rdi), %rcx
	movq	8(%rdi), %rdx
	movq	(%rdx,%rsi,8), %rdx
	movslq	(%rcx,%rdx,4), %rcx
	incq	%rcx
	imulq	%rcx, %rax
	movq	_PWM_MAX@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rsi
	movq	%rax, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_1
## %bb.2:
	xorl	%edx, %edx
	divq	%rsi
	testl	%eax, %eax
	je	LBB0_4
LBB0_5:
	xorl	%edx, %edx
	cmpl	%eax, %ecx
	cmovel	%edx, %eax
	movl	16(%rbx), %edi
	addq	$16, %rbx
	movq	%r14, %rsi
	xorl	%edx, %edx
	movl	%eax, %ecx
	callq	_aspeed_set_pwm_port_duty_rising_falling
	movl	$1, %edx
	jmp	LBB0_6
LBB0_1:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $eax killed $eax def $rax
	testl	%eax, %eax
	jne	LBB0_5
LBB0_4:
	addq	$16, %rbx
	xorl	%edx, %edx
LBB0_6:
	movl	(%rbx), %edi
	movq	%r14, %rsi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_aspeed_set_pwm_port_enable     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PWM_MAX,8,3                    ## @PWM_MAX
	.no_dead_strip	_aspeed_set_pwm_port_fan_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aspeed_set_pwm_port_fan_ctrl
_aspeed_set_pwm_port_fan_ctrl:          ; @aspeed_set_pwm_port_fan_ctrl
	.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, x1
	mov	x20, x0
	ldp	x8, x9, [x0]
	ldr	x9, [x9, x1, lsl #3]
	ldrsw	x8, [x8, x9, lsl #2]
	add	x8, x8, #1
	mul	x9, x8, x2
Lloh0:
	adrp	x10, _PWM_MAX@GOTPAGE
Lloh1:
	ldr	x10, [x10, _PWM_MAX@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	udiv	x9, x9, x10
	cbz	w9, LBB0_2
; %bb.1:
	cmp	w8, w9
	csel	w3, wzr, w9, eq
	ldr	w0, [x20, #16]!
	mov	x1, x19
	mov	w2, #0
	bl	_aspeed_set_pwm_port_duty_rising_falling
	mov	w2, #1
	b	LBB0_3
LBB0_2:
	mov	w2, #0
	add	x20, x20, #16
LBB0_3:
	ldr	w0, [x20]
	mov	x1, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_aspeed_set_pwm_port_enable
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PWM_MAX,8,3                    ; @PWM_MAX
	.no_dead_strip	_aspeed_set_pwm_port_fan_ctrl
.subsections_via_symbols
