	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function npcm7xx_pwm_init
_npcm7xx_pwm_init:                      ## @npcm7xx_pwm_init
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movl	8(%rdi), %edi
	callq	_clk_get_rate
	movl	%eax, (%r13)
	movq	_PWN_CNT_DEFAULT@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movl	%eax, %edi
	movq	_PWM_OUTPUT_FREQ_25KHZ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%edi, -52(%rbp)                 ## 4-byte Spill
	callq	_DIV_ROUND_CLOSEST
	movq	_MIN_PRESCALE1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	cmpl	%edx, %eax
	cmovgl	%eax, %edx
	decl	%edx
	movq	_NPCM7XX_PWM_PRESCALE_SHIFT_CH01@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%edx, %eax
	shll	%cl, %eax
	orl	%edx, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_NPCM7XX_PWM_MAX_MODULES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_6
## %bb.1:
	xorl	%ebx, %ebx
	movq	_NPCM7XX_PWM_MAX_CHN_NUM_IN_A_MODULE@GOTPCREL(%rip), %r15
	movq	_NPCM7XX_PWM_COUNTER_DEFAULT_NUM@GOTPCREL(%rip), %r14
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	incl	%ebx
	movq	_NPCM7XX_PWM_MAX_MODULES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jge	LBB0_6
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movl	4(%r13), %edi
	movl	%ebx, %esi
	callq	_NPCM7XX_PWM_REG_PR
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%eax, %esi
	callq	_iowrite32
	movq	_NPCM7XX_PWM_PRESCALE2_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	4(%r13), %edi
	movl	%ebx, %esi
	callq	_NPCM7XX_PWM_REG_CSR
	movl	%r12d, %edi
	movl	%eax, %esi
	callq	_iowrite32
	movq	_NPCM7XX_PWM_CTRL_MODE_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	4(%r13), %edi
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movl	%ebx, %esi
	callq	_NPCM7XX_PWM_REG_CR
	movl	%r12d, %edi
	movl	%eax, %esi
	callq	_iowrite32
	cmpl	$0, (%r15)
	jle	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r15, %r12
	movl	(%r14), %r15d
	movl	4(%r13), %edi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	%ebx, %edx
	callq	_NPCM7XX_PWM_REG_CNRx
	movl	%r15d, %edi
	movq	%r12, %r15
	movl	%eax, %esi
	callq	_iowrite32
	incl	%ebx
	cmpl	(%r12), %ebx
	jl	LBB0_4
	jmp	LBB0_5
LBB0_6:
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	andl	$15, %ecx
	incl	%ecx
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	cltd
	idivl	%ecx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PWN_CNT_DEFAULT,4,2            ## @PWN_CNT_DEFAULT
	.comm	_PWM_OUTPUT_FREQ_25KHZ,4,2      ## @PWM_OUTPUT_FREQ_25KHZ
	.comm	_MIN_PRESCALE1,4,2              ## @MIN_PRESCALE1
	.comm	_NPCM7XX_PWM_PRESCALE_SHIFT_CH01,4,2 ## @NPCM7XX_PWM_PRESCALE_SHIFT_CH01
	.comm	_NPCM7XX_PWM_MAX_MODULES,4,2    ## @NPCM7XX_PWM_MAX_MODULES
	.comm	_NPCM7XX_PWM_PRESCALE2_DEFAULT,4,2 ## @NPCM7XX_PWM_PRESCALE2_DEFAULT
	.comm	_NPCM7XX_PWM_CTRL_MODE_DEFAULT,4,2 ## @NPCM7XX_PWM_CTRL_MODE_DEFAULT
	.comm	_NPCM7XX_PWM_MAX_CHN_NUM_IN_A_MODULE,4,2 ## @NPCM7XX_PWM_MAX_CHN_NUM_IN_A_MODULE
	.comm	_NPCM7XX_PWM_COUNTER_DEFAULT_NUM,4,2 ## @NPCM7XX_PWM_COUNTER_DEFAULT_NUM
	.no_dead_strip	_npcm7xx_pwm_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function npcm7xx_pwm_init
_npcm7xx_pwm_init:                      ; @npcm7xx_pwm_init
	.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	x19, x0
	ldr	w0, [x0, #8]
	bl	_clk_get_rate
Lloh0:
	adrp	x8, _PWN_CNT_DEFAULT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PWN_CNT_DEFAULT@GOTPAGEOFF]
	str	w0, [x19]
Lloh2:
	ldr	w8, [x8]
	sdiv	w0, w0, w8
Lloh3:
	adrp	x8, _PWM_OUTPUT_FREQ_25KHZ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PWM_OUTPUT_FREQ_25KHZ@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	str	w0, [sp, #12]                   ; 4-byte Folded Spill
	bl	_DIV_ROUND_CLOSEST
Lloh6:
	adrp	x8, _MIN_PRESCALE1@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MIN_PRESCALE1@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w0, w8
	csel	w8, w0, w8, gt
	sub	w8, w8, #1
Lloh9:
	adrp	x9, _NPCM7XX_PWM_PRESCALE_SHIFT_CH01@GOTPAGE
Lloh10:
	ldr	x9, [x9, _NPCM7XX_PWM_PRESCALE_SHIFT_CH01@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	lsl	w9, w8, w9
	orr	w21, w9, w8
Lloh12:
	adrp	x25, _NPCM7XX_PWM_MAX_MODULES@GOTPAGE
Lloh13:
	ldr	x25, [x25, _NPCM7XX_PWM_MAX_MODULES@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.1:
	mov	w22, #0
Lloh14:
	adrp	x26, _NPCM7XX_PWM_PRESCALE2_DEFAULT@GOTPAGE
Lloh15:
	ldr	x26, [x26, _NPCM7XX_PWM_PRESCALE2_DEFAULT@GOTPAGEOFF]
Lloh16:
	adrp	x27, _NPCM7XX_PWM_CTRL_MODE_DEFAULT@GOTPAGE
Lloh17:
	ldr	x27, [x27, _NPCM7XX_PWM_CTRL_MODE_DEFAULT@GOTPAGEOFF]
Lloh18:
	adrp	x28, _NPCM7XX_PWM_MAX_CHN_NUM_IN_A_MODULE@GOTPAGE
Lloh19:
	ldr	x28, [x28, _NPCM7XX_PWM_MAX_CHN_NUM_IN_A_MODULE@GOTPAGEOFF]
Lloh20:
	adrp	x20, _NPCM7XX_PWM_COUNTER_DEFAULT_NUM@GOTPAGE
Lloh21:
	ldr	x20, [x20, _NPCM7XX_PWM_COUNTER_DEFAULT_NUM@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w22, w22, #1
	ldr	w8, [x25]
	cmp	w22, w8
	b.ge	LBB0_6
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	ldr	w0, [x19, #4]
	mov	x1, x22
	bl	_NPCM7XX_PWM_REG_PR
	mov	x1, x0
	mov	x0, x21
	bl	_iowrite32
	ldr	w23, [x26]
	ldr	w0, [x19, #4]
	mov	x1, x22
	bl	_NPCM7XX_PWM_REG_CSR
	mov	x1, x0
	mov	x0, x23
	bl	_iowrite32
	ldr	w23, [x27]
	ldr	w0, [x19, #4]
	mov	x1, x22
	bl	_NPCM7XX_PWM_REG_CR
	mov	x1, x0
	mov	x0, x23
	bl	_iowrite32
	ldr	w8, [x28]
	cmp	w8, #1
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w23, #0
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w24, [x20]
	ldr	w0, [x19, #4]
	mov	x1, x22
	mov	x2, x23
	bl	_NPCM7XX_PWM_REG_CNRx
	mov	x1, x0
	mov	x0, x24
	bl	_iowrite32
	add	w23, w23, #1
	ldr	w8, [x28]
	cmp	w23, w8
	b.lt	LBB0_5
	b	LBB0_2
LBB0_6:
	and	w8, w21, #0xf
	add	w8, w8, #1
	ldr	w9, [sp, #12]                   ; 4-byte Folded Reload
	sdiv	w0, w9, w8
	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 AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_PWN_CNT_DEFAULT,4,2            ; @PWN_CNT_DEFAULT
	.comm	_PWM_OUTPUT_FREQ_25KHZ,4,2      ; @PWM_OUTPUT_FREQ_25KHZ
	.comm	_MIN_PRESCALE1,4,2              ; @MIN_PRESCALE1
	.comm	_NPCM7XX_PWM_PRESCALE_SHIFT_CH01,4,2 ; @NPCM7XX_PWM_PRESCALE_SHIFT_CH01
	.comm	_NPCM7XX_PWM_MAX_MODULES,4,2    ; @NPCM7XX_PWM_MAX_MODULES
	.comm	_NPCM7XX_PWM_PRESCALE2_DEFAULT,4,2 ; @NPCM7XX_PWM_PRESCALE2_DEFAULT
	.comm	_NPCM7XX_PWM_CTRL_MODE_DEFAULT,4,2 ; @NPCM7XX_PWM_CTRL_MODE_DEFAULT
	.comm	_NPCM7XX_PWM_MAX_CHN_NUM_IN_A_MODULE,4,2 ; @NPCM7XX_PWM_MAX_CHN_NUM_IN_A_MODULE
	.comm	_NPCM7XX_PWM_COUNTER_DEFAULT_NUM,4,2 ; @NPCM7XX_PWM_COUNTER_DEFAULT_NUM
	.no_dead_strip	_npcm7xx_pwm_init
.subsections_via_symbols
